Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2024-06-29 21:57:41 +08:00
29 changed files with 962 additions and 984 deletions

View File

@@ -383,7 +383,7 @@ void wstrToLower(std::wstring& str) { std::transform(std::begin(str), std::end(s
void strToUpper(std::string& str) { std::transform(std::begin(str), std::end(str), std::begin(str), charToUpper); }
void strToLower(std::string& str) { std::transform(std::begin(str), std::end(str), std::begin(str), charToLower); }
std::wstring GetMainPartOfName(std::wstring const& wname, uint32 declension)
std::wstring GetMainPartOfName(std::wstring const& wname, uint32_t declension)
{
// supported only Cyrillic cases
if (wname.empty() || !isCyrillicCharacter(wname[0]) || declension > 5)
@@ -392,22 +392,22 @@ std::wstring GetMainPartOfName(std::wstring const& wname, uint32 declension)
}
// Important: end length must be <= MAX_INTERNAL_PLAYER_NAME-MAX_PLAYER_NAME (3 currently)
static std::wstring const a_End = { wchar_t(0x0430), wchar_t(0x0000) };
static std::wstring const o_End = { wchar_t(0x043E), wchar_t(0x0000) };
static std::wstring const ya_End = { wchar_t(0x044F), wchar_t(0x0000) };
static std::wstring const ie_End = { wchar_t(0x0435), wchar_t(0x0000) };
static std::wstring const i_End = { wchar_t(0x0438), wchar_t(0x0000) };
static std::wstring const yeru_End = { wchar_t(0x044B), wchar_t(0x0000) };
static std::wstring const u_End = { wchar_t(0x0443), wchar_t(0x0000) };
static std::wstring const yu_End = { wchar_t(0x044E), wchar_t(0x0000) };
static std::wstring const oj_End = { wchar_t(0x043E), wchar_t(0x0439), wchar_t(0x0000) };
static std::wstring const ie_j_End = { wchar_t(0x0435), wchar_t(0x0439), wchar_t(0x0000) };
static std::wstring const io_j_End = { wchar_t(0x0451), wchar_t(0x0439), wchar_t(0x0000) };
static std::wstring const o_m_End = { wchar_t(0x043E), wchar_t(0x043C), wchar_t(0x0000) };
static std::wstring const io_m_End = { wchar_t(0x0451), wchar_t(0x043C), wchar_t(0x0000) };
static std::wstring const ie_m_End = { wchar_t(0x0435), wchar_t(0x043C), wchar_t(0x0000) };
static std::wstring const soft_End = { wchar_t(0x044C), wchar_t(0x0000) };
static std::wstring const j_End = { wchar_t(0x0439), wchar_t(0x0000) };
static std::wstring const a_End = L"\u0430";
static std::wstring const o_End = L"\u043E";
static std::wstring const ya_End = L"\u044F";
static std::wstring const ie_End = L"\u0435";
static std::wstring const i_End = L"\u0438";
static std::wstring const yeru_End = L"\u044B";
static std::wstring const u_End = L"\u0443";
static std::wstring const yu_End = L"\u044E";
static std::wstring const oj_End = L"\u043E\u0439";
static std::wstring const ie_j_End = L"\u0435\u0439";
static std::wstring const io_j_End = L"\u0451\u0439";
static std::wstring const o_m_End = L"\u043E\u043C";
static std::wstring const io_m_End = L"\u0451\u043C";
static std::wstring const ie_m_End = L"\u0435\u043C";
static std::wstring const soft_End = L"\u044C";
static std::wstring const j_End = L"\u0439";
static std::array<std::array<std::wstring const*, 7>, 6> const dropEnds = {{
{ &a_End, &o_End, &ya_End, &ie_End, &soft_End, &j_End, nullptr },
@@ -421,16 +421,21 @@ std::wstring GetMainPartOfName(std::wstring const& wname, uint32 declension)
std::size_t const thisLen = wname.length();
std::array<std::wstring const*, 7> const& endings = dropEnds[declension];
for (auto itr = endings.begin(), end = endings.end(); (itr != end) && *itr; ++itr)
for (const std::wstring* endingPtr : endings)
{
std::wstring const& ending = **itr;
if (endingPtr == nullptr)
{
break;
}
std::wstring const& ending = *endingPtr;
std::size_t const endLen = ending.length();
if (endLen > thisLen)
{
continue;
}
if (wname.substr(thisLen - endLen, thisLen) == ending)
if (wname.compare(thisLen - endLen, endLen, ending) == 0)
{
return wname.substr(0, thisLen - endLen);
}

View File

@@ -6394,23 +6394,6 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster)
Unit::Kill(target, target);
return;
}
// Eye of Grillok
case 38495:
triggerSpellId = 38530;
break;
// Absorb Eye of Grillok (Zezzak's Shard)
case 38554:
{
if (!caster || target->GetTypeId() != TYPEID_UNIT)
return;
caster->CastSpell(caster, 38495, true, nullptr, this);
Creature* creatureTarget = target->ToCreature();
creatureTarget->DespawnOrUnsummon();
return;
}
// Tear of Azzinoth Summon Channel - it's not really supposed to do anything, and this only prevents the console spam
case 39857:
triggerSpellId = 39856;

View File

@@ -4590,7 +4590,7 @@ void SpellMgr::LoadSpellInfoCorrections()
// Holiday - Midsummer, Ribbon Pole Periodic Visual
ApplySpellFix({ 45406 }, [](SpellInfo* spellInfo)
{
spellInfo->AuraInterruptFlags |= ( AURA_INTERRUPT_FLAG_MOUNT | AURA_INTERRUPT_FLAG_CAST );
spellInfo->AuraInterruptFlags |= ( AURA_INTERRUPT_FLAG_MOUNT | AURA_INTERRUPT_FLAG_CAST | AURA_INTERRUPT_FLAG_TALK );
});
// Improved Mind Flay and Smite
@@ -4804,6 +4804,12 @@ void SpellMgr::LoadSpellInfoCorrections()
spellInfo->AttributesEx6 |= SPELL_ATTR6_NO_CATEGORY_COOLDOWN_MODS;
});
// Eye of Grillok
ApplySpellFix({ 38495 }, [](SpellInfo* spellInfo)
{
spellInfo->Effects[EFFECT_0].TriggerSpell = 38530; // Quest Credit for Eye of Grillok
});
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
{
SpellInfo* spellInfo = mSpellInfoMap[i];
@@ -4925,6 +4931,14 @@ void SpellMgr::LoadSpellInfoCorrections()
factionTemplateEntry = const_cast<FactionTemplateEntry*>(sFactionTemplateStore.LookupEntry(1921)); // The Taunka
factionTemplateEntry->hostileMask |= 8;
// Remove 1 from guards friendly mask, making able to attack players
factionTemplateEntry = const_cast<FactionTemplateEntry*>(sFactionTemplateStore.LookupEntry(1857)); // Area 52 Bruiser
factionTemplateEntry->friendlyMask &= ~1;
factionTemplateEntry = const_cast<FactionTemplateEntry*>(sFactionTemplateStore.LookupEntry(1806)); // Netherstorm Agent
factionTemplateEntry->friendlyMask &= ~1;
factionTemplateEntry = const_cast<FactionTemplateEntry*>(sFactionTemplateStore.LookupEntry(1812)); // K3 Bruiser
factionTemplateEntry->friendlyMask &= ~1;
// Remove vehicles attr, making accessories selectable
VehicleSeatEntry* vse = const_cast<VehicleSeatEntry*>(sVehicleSeatStore.LookupEntry(4689)); // Siege Engine, Accessory
vse->m_flags &= ~VEHICLE_SEAT_FLAG_PASSENGER_NOT_SELECTABLE;

View File

@@ -406,118 +406,90 @@ public:
}
};
class spell_madrigosa_activate_barrier : public SpellScriptLoader
class spell_madrigosa_activate_barrier : public SpellScript
{
public:
spell_madrigosa_activate_barrier() : SpellScriptLoader("spell_madrigosa_activate_barrier") { }
PrepareSpellScript(spell_madrigosa_activate_barrier);
class spell_madrigosa_activate_barrier_SpellScript : public SpellScript
void HandleActivateObject(SpellEffIndex effIndex)
{
PrepareSpellScript(spell_madrigosa_activate_barrier_SpellScript);
void HandleActivateObject(SpellEffIndex effIndex)
PreventHitDefaultEffect(effIndex);
if (GameObject* go = GetHitGObj())
{
PreventHitDefaultEffect(effIndex);
if (GameObject* go = GetHitGObj())
go->SetGoState(GO_STATE_READY);
if (Map* map = go->GetMap())
{
go->SetGoState(GO_STATE_READY);
if (Map* map = go->GetMap())
{
Map::PlayerList const& PlayerList = map->GetPlayers();
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (i->GetSource())
{
UpdateData data;
WorldPacket pkt;
go->BuildValuesUpdateBlockForPlayer(&data, i->GetSource());
data.BuildPacket(pkt);
i->GetSource()->GetSession()->SendPacket(&pkt);
}
}
Map::PlayerList const& PlayerList = map->GetPlayers();
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (i->GetSource())
{
UpdateData data;
WorldPacket pkt;
go->BuildValuesUpdateBlockForPlayer(&data, i->GetSource());
data.BuildPacket(pkt);
i->GetSource()->GetSession()->SendPacket(&pkt);
}
}
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_madrigosa_activate_barrier_SpellScript::HandleActivateObject, EFFECT_0, SPELL_EFFECT_ACTIVATE_OBJECT);
}
};
SpellScript* GetSpellScript() const override
void Register() override
{
return new spell_madrigosa_activate_barrier_SpellScript();
OnEffectHitTarget += SpellEffectFn(spell_madrigosa_activate_barrier::HandleActivateObject, EFFECT_0, SPELL_EFFECT_ACTIVATE_OBJECT);
}
};
class spell_madrigosa_deactivate_barrier : public SpellScriptLoader
class spell_madrigosa_deactivate_barrier : public SpellScript
{
public:
spell_madrigosa_deactivate_barrier() : SpellScriptLoader("spell_madrigosa_deactivate_barrier") { }
PrepareSpellScript(spell_madrigosa_deactivate_barrier);
class spell_madrigosa_deactivate_barrier_SpellScript : public SpellScript
void HandleActivateObject(SpellEffIndex effIndex)
{
PrepareSpellScript(spell_madrigosa_deactivate_barrier_SpellScript);
void HandleActivateObject(SpellEffIndex effIndex)
PreventHitDefaultEffect(effIndex);
if (GameObject* go = GetHitGObj())
{
PreventHitDefaultEffect(effIndex);
if (GameObject* go = GetHitGObj())
go->SetGoState(GO_STATE_ACTIVE);
if (Map* map = go->GetMap())
{
go->SetGoState(GO_STATE_ACTIVE);
if (Map* map = go->GetMap())
{
Map::PlayerList const& PlayerList = map->GetPlayers();
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (i->GetSource())
{
UpdateData data;
WorldPacket pkt;
go->BuildValuesUpdateBlockForPlayer(&data, i->GetSource());
data.BuildPacket(pkt);
i->GetSource()->GetSession()->SendPacket(&pkt);
}
}
Map::PlayerList const& PlayerList = map->GetPlayers();
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (i->GetSource())
{
UpdateData data;
WorldPacket pkt;
go->BuildValuesUpdateBlockForPlayer(&data, i->GetSource());
data.BuildPacket(pkt);
i->GetSource()->GetSession()->SendPacket(&pkt);
}
}
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_madrigosa_deactivate_barrier_SpellScript::HandleActivateObject, EFFECT_0, SPELL_EFFECT_ACTIVATE_OBJECT);
}
};
SpellScript* GetSpellScript() const override
void Register() override
{
return new spell_madrigosa_deactivate_barrier_SpellScript();
OnEffectHitTarget += SpellEffectFn(spell_madrigosa_deactivate_barrier::HandleActivateObject, EFFECT_0, SPELL_EFFECT_ACTIVATE_OBJECT);
}
};
class spell_brutallus_burn : public SpellScriptLoader
class spell_brutallus_burn : public SpellScript
{
public:
spell_brutallus_burn() : SpellScriptLoader("spell_brutallus_burn") { }
PrepareSpellScript(spell_brutallus_burn);
class spell_brutallus_burn_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareSpellScript(spell_brutallus_burn_SpellScript);
return ValidateSpellInfo({ SPELL_BURN_DAMAGE });
}
void HandleScriptEffect(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
if (Unit* target = GetHitUnit())
if (!target->HasAura(SPELL_BURN_DAMAGE))
target->CastSpell(target, SPELL_BURN_DAMAGE, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_brutallus_burn_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
void HandleScriptEffect(SpellEffIndex effIndex)
{
return new spell_brutallus_burn_SpellScript();
PreventHitDefaultEffect(effIndex);
if (Unit* target = GetHitUnit())
if (!target->HasAura(SPELL_BURN_DAMAGE))
target->CastSpell(target, SPELL_BURN_DAMAGE, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_brutallus_burn::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
@@ -545,9 +517,9 @@ void AddSC_boss_brutallus()
{
new boss_brutallus();
new npc_madrigosa();
new spell_madrigosa_activate_barrier();
new spell_madrigosa_deactivate_barrier();
new spell_brutallus_burn();
RegisterSpellScript(spell_madrigosa_activate_barrier);
RegisterSpellScript(spell_madrigosa_deactivate_barrier);
RegisterSpellScript(spell_brutallus_burn);
new AreaTrigger_at_sunwell_madrigosa();
}

View File

@@ -366,132 +366,108 @@ public:
};
};
class spell_eredar_twins_apply_dark_touched : public SpellScriptLoader
class spell_eredar_twins_apply_dark_touched : public SpellScript
{
public:
spell_eredar_twins_apply_dark_touched() : SpellScriptLoader("spell_eredar_twins_apply_dark_touched") { }
PrepareSpellScript(spell_eredar_twins_apply_dark_touched);
class spell_eredar_twins_apply_dark_touched_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareSpellScript(spell_eredar_twins_apply_dark_touched_SpellScript);
return ValidateSpellInfo({ SPELL_DARK_TOUCHED });
}
void HandleApplyTouch()
{
if (Player* target = GetHitPlayer())
target->CastSpell(target, SPELL_DARK_TOUCHED, true);
}
void Register() override
{
AfterHit += SpellHitFn(spell_eredar_twins_apply_dark_touched_SpellScript::HandleApplyTouch);
}
};
SpellScript* GetSpellScript() const override
void HandleApplyTouch()
{
return new spell_eredar_twins_apply_dark_touched_SpellScript();
if (Player* target = GetHitPlayer())
target->CastSpell(target, SPELL_DARK_TOUCHED, true);
}
void Register() override
{
AfterHit += SpellHitFn(spell_eredar_twins_apply_dark_touched::HandleApplyTouch);
}
};
class spell_eredar_twins_apply_flame_touched : public SpellScriptLoader
class spell_eredar_twins_apply_flame_touched : public SpellScript
{
public:
spell_eredar_twins_apply_flame_touched() : SpellScriptLoader("spell_eredar_twins_apply_flame_touched") { }
PrepareSpellScript(spell_eredar_twins_apply_flame_touched);
class spell_eredar_twins_apply_flame_touched_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareSpellScript(spell_eredar_twins_apply_flame_touched_SpellScript);
return ValidateSpellInfo({ SPELL_FLAME_TOUCHED });
}
void HandleApplyTouch()
{
if (Player* target = GetHitPlayer())
target->CastSpell(target, SPELL_FLAME_TOUCHED, true);
}
void Register() override
{
AfterHit += SpellHitFn(spell_eredar_twins_apply_flame_touched_SpellScript::HandleApplyTouch);
}
};
SpellScript* GetSpellScript() const override
void HandleApplyTouch()
{
return new spell_eredar_twins_apply_flame_touched_SpellScript();
if (Player* target = GetHitPlayer())
target->CastSpell(target, SPELL_FLAME_TOUCHED, true);
}
void Register() override
{
AfterHit += SpellHitFn(spell_eredar_twins_apply_flame_touched::HandleApplyTouch);
}
};
class spell_eredar_twins_handle_touch : public SpellScriptLoader
class spell_eredar_twins_handle_touch : public SpellScript
{
public:
spell_eredar_twins_handle_touch() : SpellScriptLoader("spell_eredar_twins_handle_touch") { }
PrepareSpellScript(spell_eredar_twins_handle_touch);
class spell_eredar_twins_handle_touch_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareSpellScript(spell_eredar_twins_handle_touch_SpellScript);
return ValidateSpellInfo({ SPELL_DARK_FLAME, SPELL_FLAME_TOUCHED, SPELL_DARK_TOUCHED });
}
SpellCastResult CheckCast()
SpellCastResult CheckCast()
{
if (GetCaster()->HasAura(SPELL_DARK_FLAME))
return SPELL_FAILED_DONT_REPORT;
if (GetSpellInfo()->Id == SPELL_DARK_TOUCHED)
{
if (GetCaster()->HasAura(SPELL_DARK_FLAME))
if (GetCaster()->HasAura(SPELL_FLAME_TOUCHED))
{
GetCaster()->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED);
GetCaster()->CastSpell(GetCaster(), SPELL_DARK_FLAME, true);
return SPELL_FAILED_DONT_REPORT;
if (GetSpellInfo()->Id == SPELL_DARK_TOUCHED)
{
if (GetCaster()->HasAura(SPELL_FLAME_TOUCHED))
{
GetCaster()->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED);
GetCaster()->CastSpell(GetCaster(), SPELL_DARK_FLAME, true);
return SPELL_FAILED_DONT_REPORT;
}
}
else // if (m_spellInfo->Id == SPELL_FLAME_TOUCHED)
{
if (GetCaster()->HasAura(SPELL_DARK_TOUCHED))
{
GetCaster()->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED);
GetCaster()->CastSpell(GetCaster(), SPELL_DARK_FLAME, true);
return SPELL_FAILED_DONT_REPORT;
}
}
return SPELL_CAST_OK;
}
void Register() override
else // if (m_spellInfo->Id == SPELL_FLAME_TOUCHED)
{
OnCheckCast += SpellCheckCastFn(spell_eredar_twins_handle_touch_SpellScript::CheckCast);
if (GetCaster()->HasAura(SPELL_DARK_TOUCHED))
{
GetCaster()->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED);
GetCaster()->CastSpell(GetCaster(), SPELL_DARK_FLAME, true);
return SPELL_FAILED_DONT_REPORT;
}
}
};
return SPELL_CAST_OK;
}
SpellScript* GetSpellScript() const override
void Register() override
{
return new spell_eredar_twins_handle_touch_SpellScript();
OnCheckCast += SpellCheckCastFn(spell_eredar_twins_handle_touch::CheckCast);
}
};
class spell_eredar_twins_blaze : public SpellScriptLoader
class spell_eredar_twins_blaze : public SpellScript
{
public:
spell_eredar_twins_blaze() : SpellScriptLoader("spell_eredar_twins_blaze") { }
PrepareSpellScript(spell_eredar_twins_blaze);
class spell_eredar_twins_blaze_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareSpellScript(spell_eredar_twins_blaze_SpellScript);
return ValidateSpellInfo({ SPELL_BLAZE_SUMMON });
}
void HandleScript(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
if (Unit* target = GetHitUnit())
target->CastSpell(target, SPELL_BLAZE_SUMMON, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_eredar_twins_blaze_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
void HandleScript(SpellEffIndex effIndex)
{
return new spell_eredar_twins_blaze_SpellScript();
PreventHitDefaultEffect(effIndex);
if (Unit* target = GetHitUnit())
target->CastSpell(target, SPELL_BLAZE_SUMMON, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_eredar_twins_blaze::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
@@ -520,10 +496,10 @@ void AddSC_boss_eredar_twins()
{
new boss_sacrolash();
new boss_alythess();
new spell_eredar_twins_apply_dark_touched();
new spell_eredar_twins_apply_flame_touched();
new spell_eredar_twins_handle_touch();
new spell_eredar_twins_blaze();
RegisterSpellScript(spell_eredar_twins_apply_dark_touched);
RegisterSpellScript(spell_eredar_twins_apply_flame_touched);
RegisterSpellScript(spell_eredar_twins_handle_touch);
RegisterSpellScript(spell_eredar_twins_blaze);
new AreaTrigger_at_sunwell_eredar_twins();
}

View File

@@ -476,65 +476,53 @@ public:
};
};
class spell_felmyst_fog_of_corruption : public SpellScriptLoader
class spell_felmyst_fog_of_corruption : public SpellScript
{
public:
spell_felmyst_fog_of_corruption() : SpellScriptLoader("spell_felmyst_fog_of_corruption") { }
PrepareSpellScript(spell_felmyst_fog_of_corruption);
class spell_felmyst_fog_of_corruption_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareSpellScript(spell_felmyst_fog_of_corruption_SpellScript);
return ValidateSpellInfo({ SPELL_FOG_OF_CORRUPTION_CHARM });
}
void HandleScriptEffect(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
if (Unit* target = GetHitUnit())
target->CastSpell(GetCaster(), SPELL_FOG_OF_CORRUPTION_CHARM, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_felmyst_fog_of_corruption_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
void HandleScriptEffect(SpellEffIndex effIndex)
{
return new spell_felmyst_fog_of_corruption_SpellScript();
PreventHitDefaultEffect(effIndex);
if (Unit* target = GetHitUnit())
target->CastSpell(GetCaster(), SPELL_FOG_OF_CORRUPTION_CHARM, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_felmyst_fog_of_corruption::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
class spell_felmyst_fog_of_corruption_charm : public SpellScriptLoader
class spell_felmyst_fog_of_corruption_charm_aura : public AuraScript
{
public:
spell_felmyst_fog_of_corruption_charm() : SpellScriptLoader("spell_felmyst_fog_of_corruption_charm") { }
PrepareAuraScript(spell_felmyst_fog_of_corruption_charm_aura);
class spell_felmyst_fog_of_corruption_charm_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_felmyst_fog_of_corruption_charm_AuraScript);
return ValidateSpellInfo({ SPELL_FOG_OF_CORRUPTION_CHARM2, SPELL_FOG_OF_CORRUPTION_CHARM });
}
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetTarget()->CastSpell(GetTarget(), SPELL_FOG_OF_CORRUPTION_CHARM2, true);
}
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetTarget()->RemoveAurasDueToSpell(SPELL_FOG_OF_CORRUPTION_CHARM);
GetTarget()->RemoveAurasDueToSpell(SPELL_FOG_OF_CORRUPTION_CHARM2);
Unit::Kill(GetCaster(), GetTarget(), false);
}
void Register() override
{
OnEffectApply += AuraEffectApplyFn(spell_felmyst_fog_of_corruption_charm_AuraScript::HandleApply, EFFECT_0, SPELL_AURA_AOE_CHARM, AURA_EFFECT_HANDLE_REAL);
OnEffectRemove += AuraEffectRemoveFn(spell_felmyst_fog_of_corruption_charm_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_AOE_CHARM, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
return new spell_felmyst_fog_of_corruption_charm_AuraScript();
GetTarget()->CastSpell(GetTarget(), SPELL_FOG_OF_CORRUPTION_CHARM2, true);
}
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetTarget()->RemoveAurasDueToSpell(SPELL_FOG_OF_CORRUPTION_CHARM);
GetTarget()->RemoveAurasDueToSpell(SPELL_FOG_OF_CORRUPTION_CHARM2);
Unit::Kill(GetCaster(), GetTarget(), false);
}
void Register() override
{
OnEffectApply += AuraEffectApplyFn(spell_felmyst_fog_of_corruption_charm_aura::HandleApply, EFFECT_0, SPELL_AURA_AOE_CHARM, AURA_EFFECT_HANDLE_REAL);
OnEffectRemove += AuraEffectRemoveFn(spell_felmyst_fog_of_corruption_charm_aura::HandleRemove, EFFECT_0, SPELL_AURA_AOE_CHARM, AURA_EFFECT_HANDLE_REAL);
}
};
@@ -551,29 +539,18 @@ public:
}
};
class spell_felmyst_open_brutallus_back_doors : public SpellScriptLoader
class spell_felmyst_open_brutallus_back_doors : public SpellScript
{
public:
spell_felmyst_open_brutallus_back_doors() : SpellScriptLoader("spell_felmyst_open_brutallus_back_doors") { }
PrepareSpellScript(spell_felmyst_open_brutallus_back_doors);
class spell_felmyst_open_brutallus_back_doors_SpellScript : public SpellScript
void FilterTargets(std::list<WorldObject*>& unitList)
{
PrepareSpellScript(spell_felmyst_open_brutallus_back_doors_SpellScript);
unitList.remove_if(DoorsGuidCheck());
}
void FilterTargets(std::list<WorldObject*>& unitList)
{
unitList.remove_if(DoorsGuidCheck());
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_felmyst_open_brutallus_back_doors_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
}
};
SpellScript* GetSpellScript() const override
void Register() override
{
return new spell_felmyst_open_brutallus_back_doors_SpellScript();
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_felmyst_open_brutallus_back_doors::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
}
};
@@ -582,8 +559,8 @@ void AddSC_boss_felmyst()
new boss_felmyst();
new npc_demonic_vapor();
new npc_demonic_vapor_trail();
new spell_felmyst_fog_of_corruption();
new spell_felmyst_fog_of_corruption_charm();
new spell_felmyst_open_brutallus_back_doors();
RegisterSpellScript(spell_felmyst_fog_of_corruption);
RegisterSpellScript(spell_felmyst_fog_of_corruption_charm_aura);
RegisterSpellScript(spell_felmyst_open_brutallus_back_doors);
}

View File

@@ -633,140 +633,116 @@ private:
Unit* _victim;
};
class spell_kalecgos_spectral_blast_dummy : public SpellScriptLoader
class spell_kalecgos_spectral_blast_dummy : public SpellScript
{
public:
spell_kalecgos_spectral_blast_dummy() : SpellScriptLoader("spell_kalecgos_spectral_blast_dummy") { }
PrepareSpellScript(spell_kalecgos_spectral_blast_dummy);
class spell_kalecgos_spectral_blast_dummy_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareSpellScript(spell_kalecgos_spectral_blast_dummy_SpellScript);
return ValidateSpellInfo({ SPELL_SPECTRAL_BLAST_PORTAL, SPELL_SPECTRAL_BLAST_AA, SPELL_TELEPORT_SPECTRAL });
}
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(SpectralBlastCheck(GetCaster()->GetVictim()));
Acore::Containers::RandomResize(targets, 1);
}
void HandleDummy(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
if (Unit* target = GetHitUnit())
{
target->CastSpell(target, SPELL_SPECTRAL_BLAST_PORTAL, true);
target->CastSpell(target, SPELL_SPECTRAL_BLAST_AA, true);
target->CastSpell(target, SPELL_TELEPORT_SPECTRAL, true);
}
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_kalecgos_spectral_blast_dummy_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_kalecgos_spectral_blast_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const override
void FilterTargets(std::list<WorldObject*>& targets)
{
return new spell_kalecgos_spectral_blast_dummy_SpellScript();
targets.remove_if(SpectralBlastCheck(GetCaster()->GetVictim()));
Acore::Containers::RandomResize(targets, 1);
}
void HandleDummy(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
if (Unit* target = GetHitUnit())
{
target->CastSpell(target, SPELL_SPECTRAL_BLAST_PORTAL, true);
target->CastSpell(target, SPELL_SPECTRAL_BLAST_AA, true);
target->CastSpell(target, SPELL_TELEPORT_SPECTRAL, true);
}
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_kalecgos_spectral_blast_dummy::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_kalecgos_spectral_blast_dummy::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
class spell_kalecgos_curse_of_boundless_agony : public SpellScriptLoader
class spell_kalecgos_curse_of_boundless_agony_aura : public AuraScript
{
public:
spell_kalecgos_curse_of_boundless_agony() : SpellScriptLoader("spell_kalecgos_curse_of_boundless_agony") { }
PrepareAuraScript(spell_kalecgos_curse_of_boundless_agony_aura);
class spell_kalecgos_curse_of_boundless_agony_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_kalecgos_curse_of_boundless_agony_AuraScript);
return ValidateSpellInfo({ SPELL_CURSE_OF_BOUNDLESS_AGONY_PLR });
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (InstanceScript* instance = GetUnitOwner()->GetInstanceScript())
if (instance->IsEncounterInProgress())
GetUnitOwner()->CastCustomSpell(SPELL_CURSE_OF_BOUNDLESS_AGONY_PLR, SPELLVALUE_MAX_TARGETS, 1, GetUnitOwner(), true);
}
void OnPeriodic(AuraEffect const* aurEff)
{
if (aurEff->GetTickNumber() > 1 && aurEff->GetTickNumber() % 5 == 1)
GetAura()->GetEffect(aurEff->GetEffIndex())->SetAmount(aurEff->GetAmount() * 2);
}
void Register() override
{
AfterEffectRemove += AuraEffectRemoveFn(spell_kalecgos_curse_of_boundless_agony_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_kalecgos_curse_of_boundless_agony_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
}
};
AuraScript* GetAuraScript() const override
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
return new spell_kalecgos_curse_of_boundless_agony_AuraScript();
if (InstanceScript* instance = GetUnitOwner()->GetInstanceScript())
if (instance->IsEncounterInProgress())
GetUnitOwner()->CastCustomSpell(SPELL_CURSE_OF_BOUNDLESS_AGONY_PLR, SPELLVALUE_MAX_TARGETS, 1, GetUnitOwner(), true);
}
void OnPeriodic(AuraEffect const* aurEff)
{
if (aurEff->GetTickNumber() > 1 && aurEff->GetTickNumber() % 5 == 1)
GetAura()->GetEffect(aurEff->GetEffIndex())->SetAmount(aurEff->GetAmount() * 2);
}
void Register() override
{
AfterEffectRemove += AuraEffectRemoveFn(spell_kalecgos_curse_of_boundless_agony_aura::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_kalecgos_curse_of_boundless_agony_aura::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
}
};
class spell_kalecgos_spectral_realm_dummy : public SpellScriptLoader
class spell_kalecgos_spectral_realm_dummy : public SpellScript
{
public:
spell_kalecgos_spectral_realm_dummy() : SpellScriptLoader("spell_kalecgos_spectral_realm_dummy") { }
PrepareSpellScript(spell_kalecgos_spectral_realm_dummy);
class spell_kalecgos_spectral_realm_dummy_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareSpellScript(spell_kalecgos_spectral_realm_dummy_SpellScript);
return ValidateSpellInfo({ SPELL_SPECTRAL_EXHAUSTION, SPELL_TELEPORT_SPECTRAL });
}
SpellCastResult CheckCast()
{
if (GetCaster()->HasAura(SPELL_SPECTRAL_EXHAUSTION))
return SPELL_FAILED_CASTER_AURASTATE;
return SPELL_CAST_OK;
}
void HandleScriptEffect(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
GetCaster()->CastSpell(GetCaster(), SPELL_TELEPORT_SPECTRAL, true);
}
void Register() override
{
OnCheckCast += SpellCheckCastFn(spell_kalecgos_spectral_realm_dummy_SpellScript::CheckCast);
OnEffectHitTarget += SpellEffectFn(spell_kalecgos_spectral_realm_dummy_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
SpellCastResult CheckCast()
{
return new spell_kalecgos_spectral_realm_dummy_SpellScript();
if (GetCaster()->HasAura(SPELL_SPECTRAL_EXHAUSTION))
return SPELL_FAILED_CASTER_AURASTATE;
return SPELL_CAST_OK;
}
void HandleScriptEffect(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
GetCaster()->CastSpell(GetCaster(), SPELL_TELEPORT_SPECTRAL, true);
}
void Register() override
{
OnCheckCast += SpellCheckCastFn(spell_kalecgos_spectral_realm_dummy::CheckCast);
OnEffectHitTarget += SpellEffectFn(spell_kalecgos_spectral_realm_dummy::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
class spell_kalecgos_spectral_realm : public SpellScriptLoader
class spell_kalecgos_spectral_realm_aura : public AuraScript
{
public:
spell_kalecgos_spectral_realm() : SpellScriptLoader("spell_kalecgos_spectral_realm") { }
PrepareAuraScript(spell_kalecgos_spectral_realm_aura);
class spell_kalecgos_spectral_realm_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_kalecgos_spectral_realm_AuraScript);
return ValidateSpellInfo({ SPELL_SPECTRAL_EXHAUSTION, SPELL_TELEPORT_NORMAL_REALM });
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SPECTRAL_EXHAUSTION, true);
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_TELEPORT_NORMAL_REALM, true);
}
void Register() override
{
OnEffectRemove += AuraEffectRemoveFn(spell_kalecgos_spectral_realm_AuraScript::OnRemove, EFFECT_1, SPELL_AURA_MOD_INVISIBILITY, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
return new spell_kalecgos_spectral_realm_AuraScript();
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SPECTRAL_EXHAUSTION, true);
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_TELEPORT_NORMAL_REALM, true);
}
void Register() override
{
OnEffectRemove += AuraEffectRemoveFn(spell_kalecgos_spectral_realm_aura::OnRemove, EFFECT_1, SPELL_AURA_MOD_INVISIBILITY, AURA_EFFECT_HANDLE_REAL);
}
};
@@ -775,9 +751,9 @@ void AddSC_boss_kalecgos()
new boss_kalecgos();
new boss_sathrovarr();
new boss_kalec();
new spell_kalecgos_spectral_blast_dummy();
new spell_kalecgos_curse_of_boundless_agony();
new spell_kalecgos_spectral_realm_dummy();
new spell_kalecgos_spectral_realm();
RegisterSpellScript(spell_kalecgos_spectral_blast_dummy);
RegisterSpellScript(spell_kalecgos_curse_of_boundless_agony_aura);
RegisterSpellScript(spell_kalecgos_spectral_realm_dummy);
RegisterSpellScript(spell_kalecgos_spectral_realm_aura);
}

View File

@@ -1027,304 +1027,219 @@ public:
};
};
class spell_kiljaeden_shadow_spike : public SpellScriptLoader
class spell_kiljaeden_shadow_spike_aura : public AuraScript
{
public:
spell_kiljaeden_shadow_spike() : SpellScriptLoader("spell_kiljaeden_shadow_spike") { }
PrepareAuraScript(spell_kiljaeden_shadow_spike_aura);
class spell_kiljaeden_shadow_spike_AuraScript : public AuraScript
void HandlePeriodic(AuraEffect const* aurEff)
{
PrepareAuraScript(spell_kiljaeden_shadow_spike_AuraScript);
PreventDefaultAction();
if (Unit* target = GetUnitOwner()->GetAI()->SelectTarget(SelectTargetMethod::Random, 0, 60.0f, true))
GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true);
}
void HandlePeriodic(AuraEffect const* aurEff)
{
PreventDefaultAction();
if (Unit* target = GetUnitOwner()->GetAI()->SelectTarget(SelectTargetMethod::Random, 0, 60.0f, true))
GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_kiljaeden_shadow_spike_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
void Register() override
{
return new spell_kiljaeden_shadow_spike_AuraScript();
OnEffectPeriodic += AuraEffectPeriodicFn(spell_kiljaeden_shadow_spike_aura::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
class spell_kiljaeden_sinister_reflection : public SpellScriptLoader
class spell_kiljaeden_sinister_reflection : public SpellScript
{
public:
spell_kiljaeden_sinister_reflection() : SpellScriptLoader("spell_kiljaeden_sinister_reflection") { }
PrepareSpellScript(spell_kiljaeden_sinister_reflection);
class spell_kiljaeden_sinister_reflection_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareSpellScript(spell_kiljaeden_sinister_reflection_SpellScript);
return ValidateSpellInfo({ SPELL_SINISTER_REFLECTION_SUMMON, SPELL_SINISTER_REFLECTION_CLONE });
}
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(Acore::UnitAuraCheck(true, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT));
}
void HandleScriptEffect(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
if (Unit* target = GetHitUnit())
{
target->CastSpell(target, SPELL_SINISTER_REFLECTION_SUMMON, true);
//target->CastSpell(target, SPELL_SINISTER_REFLECTION_CLONE, true);
}
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_kiljaeden_sinister_reflection_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_kiljaeden_sinister_reflection_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
void FilterTargets(std::list<WorldObject*>& targets)
{
return new spell_kiljaeden_sinister_reflection_SpellScript();
targets.remove_if(Acore::UnitAuraCheck(true, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT));
}
void HandleScriptEffect(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
if (Unit* target = GetHitUnit())
{
target->CastSpell(target, SPELL_SINISTER_REFLECTION_SUMMON, true);
//target->CastSpell(target, SPELL_SINISTER_REFLECTION_CLONE, true);
}
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_kiljaeden_sinister_reflection::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_kiljaeden_sinister_reflection::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
class spell_kiljaeden_sinister_reflection_clone : public SpellScriptLoader
class spell_kiljaeden_sinister_reflection_clone : public SpellScript
{
public:
spell_kiljaeden_sinister_reflection_clone() : SpellScriptLoader("spell_kiljaeden_sinister_reflection_clone") { }
PrepareSpellScript(spell_kiljaeden_sinister_reflection_clone);
class spell_kiljaeden_sinister_reflection_clone_SpellScript : public SpellScript
void FilterTargets(std::list<WorldObject*>& targets)
{
PrepareSpellScript(spell_kiljaeden_sinister_reflection_clone_SpellScript);
targets.sort(Acore::ObjectDistanceOrderPred(GetCaster()));
WorldObject* target = targets.front();
void FilterTargets(std::list<WorldObject*>& targets)
targets.clear();
if (target && target->GetTypeId() == TYPEID_UNIT)
{
targets.sort(Acore::ObjectDistanceOrderPred(GetCaster()));
WorldObject* target = targets.front();
targets.clear();
if (target && target->GetTypeId() == TYPEID_UNIT)
{
target->ToCreature()->AI()->SetData(1, GetCaster()->getClass());
targets.push_back(target);
}
target->ToCreature()->AI()->SetData(1, GetCaster()->getClass());
targets.push_back(target);
}
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_kiljaeden_sinister_reflection_clone_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
SpellScript* GetSpellScript() const override
void Register() override
{
return new spell_kiljaeden_sinister_reflection_clone_SpellScript();
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_kiljaeden_sinister_reflection_clone::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
class spell_kiljaeden_flame_dart : public SpellScriptLoader
class spell_kiljaeden_flame_dart : public SpellScript
{
public:
spell_kiljaeden_flame_dart() : SpellScriptLoader("spell_kiljaeden_flame_dart") { }
PrepareSpellScript(spell_kiljaeden_flame_dart);
class spell_kiljaeden_flame_dart_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareSpellScript(spell_kiljaeden_flame_dart_SpellScript);
return ValidateSpellInfo({ SPELL_FLAME_DART_EXPLOSION });
}
void HandleSchoolDamage(SpellEffIndex /*effIndex*/)
{
if (Unit* target = GetHitUnit())
target->CastSpell(target, SPELL_FLAME_DART_EXPLOSION, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_kiljaeden_flame_dart_SpellScript::HandleSchoolDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
SpellScript* GetSpellScript() const override
void HandleSchoolDamage(SpellEffIndex /*effIndex*/)
{
return new spell_kiljaeden_flame_dart_SpellScript();
if (Unit* target = GetHitUnit())
target->CastSpell(target, SPELL_FLAME_DART_EXPLOSION, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_kiljaeden_flame_dart::HandleSchoolDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
class spell_kiljaeden_darkness : public SpellScriptLoader
class spell_kiljaeden_darkness_aura : public AuraScript
{
public:
spell_kiljaeden_darkness() : SpellScriptLoader("spell_kiljaeden_darkness") { }
PrepareAuraScript(spell_kiljaeden_darkness_aura);
class spell_kiljaeden_darkness_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_kiljaeden_darkness_AuraScript);
return ValidateSpellInfo({ SPELL_DARKNESS_OF_A_THOUSAND_SOULS_DAMAGE });
}
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetUnitOwner()->GetTypeId() == TYPEID_UNIT)
GetUnitOwner()->ToCreature()->AI()->DoAction(ACTION_NO_KILL_TALK);
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_DARKNESS_OF_A_THOUSAND_SOULS_DAMAGE, true);
}
void Register() override
{
OnEffectRemove += AuraEffectRemoveFn(spell_kiljaeden_darkness_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
return new spell_kiljaeden_darkness_AuraScript();
if (GetUnitOwner()->GetTypeId() == TYPEID_UNIT)
GetUnitOwner()->ToCreature()->AI()->DoAction(ACTION_NO_KILL_TALK);
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_DARKNESS_OF_A_THOUSAND_SOULS_DAMAGE, true);
}
void Register() override
{
OnEffectRemove += AuraEffectRemoveFn(spell_kiljaeden_darkness_aura::HandleRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
class spell_kiljaeden_power_of_the_blue_flight : public SpellScriptLoader
class spell_kiljaeden_power_of_the_blue_flight : public SpellScript
{
public:
spell_kiljaeden_power_of_the_blue_flight() : SpellScriptLoader("spell_kiljaeden_power_of_the_blue_flight") { }
PrepareSpellScript(spell_kiljaeden_power_of_the_blue_flight);
class spell_kiljaeden_power_of_the_blue_flight_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareSpellScript(spell_kiljaeden_power_of_the_blue_flight_SpellScript);
return ValidateSpellInfo({ SPELL_SUMMON_BLUE_DRAKE, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT });
}
void HandleScriptEffect(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
if (Player* player = GetHitPlayer())
{
player->CastSpell(player, SPELL_SUMMON_BLUE_DRAKE, true);
player->CastSpell(player, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT, true);
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_kiljaeden_power_of_the_blue_flight_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
void HandleScriptEffect(SpellEffIndex effIndex)
{
return new spell_kiljaeden_power_of_the_blue_flight_SpellScript();
PreventHitDefaultEffect(effIndex);
if (Player* player = GetHitPlayer())
{
player->CastSpell(player, SPELL_SUMMON_BLUE_DRAKE, true);
player->CastSpell(player, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT, true);
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_kiljaeden_power_of_the_blue_flight::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
class spell_kiljaeden_vengeance_of_the_blue_flight : public SpellScriptLoader
class spell_kiljaeden_vengeance_of_the_blue_flight_aura : public AuraScript
{
public:
spell_kiljaeden_vengeance_of_the_blue_flight() : SpellScriptLoader("spell_kiljaeden_vengeance_of_the_blue_flight") { }
PrepareAuraScript(spell_kiljaeden_vengeance_of_the_blue_flight_aura);
class spell_kiljaeden_vengeance_of_the_blue_flight_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_kiljaeden_vengeance_of_the_blue_flight_AuraScript);
return ValidateSpellInfo({ SPELL_POSSESS_DRAKE_IMMUNITY });
}
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_POSSESS_DRAKE_IMMUNITY, true);
}
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetUnitOwner()->RemoveAurasDueToSpell(SPELL_POSSESS_DRAKE_IMMUNITY);
}
void Register() override
{
OnEffectApply += AuraEffectApplyFn(spell_kiljaeden_vengeance_of_the_blue_flight_AuraScript::HandleApply, EFFECT_0, SPELL_AURA_MOD_POSSESS, AURA_EFFECT_HANDLE_REAL);
OnEffectApply += AuraEffectApplyFn(spell_kiljaeden_vengeance_of_the_blue_flight_AuraScript::HandleApply, EFFECT_2, SPELL_AURA_MOD_PACIFY_SILENCE, AURA_EFFECT_HANDLE_REAL);
OnEffectRemove += AuraEffectRemoveFn(spell_kiljaeden_vengeance_of_the_blue_flight_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_MOD_POSSESS, AURA_EFFECT_HANDLE_REAL);
OnEffectRemove += AuraEffectRemoveFn(spell_kiljaeden_vengeance_of_the_blue_flight_AuraScript::HandleRemove, EFFECT_2, SPELL_AURA_MOD_PACIFY_SILENCE, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
return new spell_kiljaeden_vengeance_of_the_blue_flight_AuraScript();
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_POSSESS_DRAKE_IMMUNITY, true);
}
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetUnitOwner()->RemoveAurasDueToSpell(SPELL_POSSESS_DRAKE_IMMUNITY);
}
void Register() override
{
OnEffectApply += AuraEffectApplyFn(spell_kiljaeden_vengeance_of_the_blue_flight_aura::HandleApply, EFFECT_0, SPELL_AURA_MOD_POSSESS, AURA_EFFECT_HANDLE_REAL);
OnEffectApply += AuraEffectApplyFn(spell_kiljaeden_vengeance_of_the_blue_flight_aura::HandleApply, EFFECT_2, SPELL_AURA_MOD_PACIFY_SILENCE, AURA_EFFECT_HANDLE_REAL);
OnEffectRemove += AuraEffectRemoveFn(spell_kiljaeden_vengeance_of_the_blue_flight_aura::HandleRemove, EFFECT_0, SPELL_AURA_MOD_POSSESS, AURA_EFFECT_HANDLE_REAL);
OnEffectRemove += AuraEffectRemoveFn(spell_kiljaeden_vengeance_of_the_blue_flight_aura::HandleRemove, EFFECT_2, SPELL_AURA_MOD_PACIFY_SILENCE, AURA_EFFECT_HANDLE_REAL);
}
};
class spell_kiljaeden_armageddon_periodic : public SpellScriptLoader
class spell_kiljaeden_armageddon_periodic_aura : public AuraScript
{
public:
spell_kiljaeden_armageddon_periodic() : SpellScriptLoader("spell_kiljaeden_armageddon_periodic") { }
PrepareAuraScript(spell_kiljaeden_armageddon_periodic_aura);
class spell_kiljaeden_armageddon_periodic_AuraScript : public AuraScript
void HandlePeriodic(AuraEffect const* aurEff)
{
PrepareAuraScript(spell_kiljaeden_armageddon_periodic_AuraScript);
PreventDefaultAction();
if (Unit* target = GetUnitOwner()->GetAI()->SelectTarget(SelectTargetMethod::Random, 0, 60.0f, true))
GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true);
}
void HandlePeriodic(AuraEffect const* aurEff)
{
PreventDefaultAction();
if (Unit* target = GetUnitOwner()->GetAI()->SelectTarget(SelectTargetMethod::Random, 0, 60.0f, true))
GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_kiljaeden_armageddon_periodic_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
void Register() override
{
return new spell_kiljaeden_armageddon_periodic_AuraScript();
OnEffectPeriodic += AuraEffectPeriodicFn(spell_kiljaeden_armageddon_periodic_aura::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
class spell_kiljaeden_armageddon_missile : public SpellScriptLoader
class spell_kiljaeden_armageddon_missile : public SpellScript
{
public:
spell_kiljaeden_armageddon_missile() : SpellScriptLoader("spell_kiljaeden_armageddon_missile") { }
PrepareSpellScript(spell_kiljaeden_armageddon_missile);
class spell_kiljaeden_armageddon_missile_SpellScript : public SpellScript
void SetDest(SpellDestination& dest)
{
PrepareSpellScript(spell_kiljaeden_armageddon_missile_SpellScript);
Position const offset = { 0.0f, 0.0f, -20.0f, 0.0f };
dest.RelocateOffset(offset);
}
void SetDest(SpellDestination& dest)
{
Position const offset = { 0.0f, 0.0f, -20.0f, 0.0f };
dest.RelocateOffset(offset);
}
void Register() override
{
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_kiljaeden_armageddon_missile_SpellScript::SetDest, EFFECT_0, TARGET_DEST_CASTER);
}
};
SpellScript* GetSpellScript() const override
void Register() override
{
return new spell_kiljaeden_armageddon_missile_SpellScript();
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_kiljaeden_armageddon_missile::SetDest, EFFECT_0, TARGET_DEST_CASTER);
}
};
class spell_kiljaeden_dragon_breath : public SpellScriptLoader
class spell_kiljaeden_dragon_breath : public SpellScript
{
public:
spell_kiljaeden_dragon_breath() : SpellScriptLoader("spell_kiljaeden_dragon_breath") { }
PrepareSpellScript(spell_kiljaeden_dragon_breath);
class spell_kiljaeden_dragon_breath_SpellScript : public SpellScript
void FilterTargets(std::list<WorldObject*>& targets)
{
PrepareSpellScript(spell_kiljaeden_dragon_breath_SpellScript);
targets.remove_if(Acore::UnitAuraCheck(true, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT));
}
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(Acore::UnitAuraCheck(true, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT));
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_kiljaeden_dragon_breath_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_CONE_ALLY);
}
};
SpellScript* GetSpellScript() const override
void Register() override
{
return new spell_kiljaeden_dragon_breath_SpellScript();
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_kiljaeden_dragon_breath::FilterTargets, EFFECT_ALL, TARGET_UNIT_CONE_ALLY);
}
};
@@ -1333,15 +1248,15 @@ void AddSC_boss_kiljaeden()
new npc_kiljaeden_controller();
new boss_kiljaeden();
new npc_kalecgos_kj();
new spell_kiljaeden_shadow_spike();
new spell_kiljaeden_sinister_reflection();
new spell_kiljaeden_sinister_reflection_clone();
new spell_kiljaeden_flame_dart();
new spell_kiljaeden_darkness();
new spell_kiljaeden_power_of_the_blue_flight();
new spell_kiljaeden_vengeance_of_the_blue_flight();
new spell_kiljaeden_armageddon_periodic();
new spell_kiljaeden_armageddon_missile();
new spell_kiljaeden_dragon_breath();
RegisterSpellScript(spell_kiljaeden_shadow_spike_aura);
RegisterSpellScript(spell_kiljaeden_sinister_reflection);
RegisterSpellScript(spell_kiljaeden_sinister_reflection_clone);
RegisterSpellScript(spell_kiljaeden_flame_dart);
RegisterSpellScript(spell_kiljaeden_darkness_aura);
RegisterSpellScript(spell_kiljaeden_power_of_the_blue_flight);
RegisterSpellScript(spell_kiljaeden_vengeance_of_the_blue_flight_aura);
RegisterSpellScript(spell_kiljaeden_armageddon_periodic_aura);
RegisterSpellScript(spell_kiljaeden_armageddon_missile);
RegisterSpellScript(spell_kiljaeden_dragon_breath);
}

View File

@@ -326,183 +326,148 @@ public:
};
};
class spell_muru_summon_blood_elves_periodic : public SpellScriptLoader
class spell_muru_summon_blood_elves_periodic_aura : public AuraScript
{
public:
spell_muru_summon_blood_elves_periodic() : SpellScriptLoader("spell_muru_summon_blood_elves_periodic") { }
PrepareAuraScript(spell_muru_summon_blood_elves_periodic_aura);
class spell_muru_summon_blood_elves_periodic_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_muru_summon_blood_elves_periodic_AuraScript);
return ValidateSpellInfo({ SPELL_SUMMON_FURY_MAGE1, SPELL_SUMMON_FURY_MAGE2, SPELL_SUMMON_BERSERKER1, SPELL_SUMMON_BERSERKER2 });
}
void HandleApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
// first tick after 10 seconds
GetAura()->GetEffect(aurEff->GetEffIndex())->SetPeriodicTimer(10000);
}
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SUMMON_FURY_MAGE1, true);
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SUMMON_FURY_MAGE2, true);
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SUMMON_BERSERKER1, true);
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SUMMON_BERSERKER2, true);
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SUMMON_BERSERKER1, true);
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SUMMON_BERSERKER2, true);
}
void Register() override
{
OnEffectApply += AuraEffectApplyFn(spell_muru_summon_blood_elves_periodic_AuraScript::HandleApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_muru_summon_blood_elves_periodic_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
};
AuraScript* GetAuraScript() const override
void HandleApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
return new spell_muru_summon_blood_elves_periodic_AuraScript();
// first tick after 10 seconds
GetAura()->GetEffect(aurEff->GetEffIndex())->SetPeriodicTimer(10000);
}
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SUMMON_FURY_MAGE1, true);
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SUMMON_FURY_MAGE2, true);
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SUMMON_BERSERKER1, true);
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SUMMON_BERSERKER2, true);
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SUMMON_BERSERKER1, true);
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SUMMON_BERSERKER2, true);
}
void Register() override
{
OnEffectApply += AuraEffectApplyFn(spell_muru_summon_blood_elves_periodic_aura::HandleApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_muru_summon_blood_elves_periodic_aura::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
};
class spell_muru_darkness : public SpellScriptLoader
class spell_muru_darkness_aura : public AuraScript
{
public:
spell_muru_darkness() : SpellScriptLoader("spell_muru_darkness") { }
PrepareAuraScript(spell_muru_darkness_aura);
class spell_muru_darkness_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_muru_darkness_AuraScript);
return ValidateSpellInfo({ SPELL_SUMMON_DARK_FIEND });
}
void OnPeriodic(AuraEffect const* aurEff)
{
if (aurEff->GetTickNumber() == 3)
for (uint8 i = 0; i < 8; ++i)
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SUMMON_DARK_FIEND + i, true);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_muru_darkness_AuraScript::OnPeriodic, EFFECT_2, SPELL_AURA_PERIODIC_DUMMY);
}
};
AuraScript* GetAuraScript() const override
void OnPeriodic(AuraEffect const* aurEff)
{
return new spell_muru_darkness_AuraScript();
if (aurEff->GetTickNumber() == 3)
for (uint8 i = 0; i < 8; ++i)
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SUMMON_DARK_FIEND + i, true);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_muru_darkness_aura::OnPeriodic, EFFECT_2, SPELL_AURA_PERIODIC_DUMMY);
}
};
class spell_entropius_negative_energy : public SpellScriptLoader
class spell_entropius_negative_energy : public SpellScript
{
public:
spell_entropius_negative_energy() : SpellScriptLoader("spell_entropius_negative_energy") { }
PrepareSpellScript(spell_entropius_negative_energy);
class spell_entropius_negative_energy_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareSpellScript(spell_entropius_negative_energy_SpellScript);
return ValidateSpellInfo({ SPELL_NEGATIVE_ENERGY_CHAIN });
}
bool Load() override
{
return GetCaster()->GetTypeId() == TYPEID_UNIT;
}
void FilterTargets(std::list<WorldObject*>& targets)
{
Acore::Containers::RandomResize(targets, GetCaster()->GetAI()->GetData(DATA_NEGATIVE_ENERGY_TARGETS));
}
void HandleScriptEffect(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
if (Unit* target = GetHitUnit())
GetCaster()->CastSpell(target, SPELL_NEGATIVE_ENERGY_CHAIN, true);
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_entropius_negative_energy_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_entropius_negative_energy_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
bool Load() override
{
return new spell_entropius_negative_energy_SpellScript();
return GetCaster()->GetTypeId() == TYPEID_UNIT;
}
void FilterTargets(std::list<WorldObject*>& targets)
{
Acore::Containers::RandomResize(targets, GetCaster()->GetAI()->GetData(DATA_NEGATIVE_ENERGY_TARGETS));
}
void HandleScriptEffect(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
if (Unit* target = GetHitUnit())
GetCaster()->CastSpell(target, SPELL_NEGATIVE_ENERGY_CHAIN, true);
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_entropius_negative_energy::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_entropius_negative_energy::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
class spell_entropius_void_zone_visual : public SpellScriptLoader
class spell_entropius_void_zone_visual_aura : public AuraScript
{
public:
spell_entropius_void_zone_visual() : SpellScriptLoader("spell_entropius_void_zone_visual") { }
PrepareAuraScript(spell_entropius_void_zone_visual_aura);
class spell_entropius_void_zone_visual_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_entropius_void_zone_visual_AuraScript);
return ValidateSpellInfo({ SPELL_SUMMON_DARK_FIEND_ENTROPIUS });
}
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
SetDuration(3000);
}
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SUMMON_DARK_FIEND_ENTROPIUS, true);
}
void Register() override
{
OnEffectApply += AuraEffectApplyFn(spell_entropius_void_zone_visual_AuraScript::HandleApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
OnEffectRemove += AuraEffectRemoveFn(spell_entropius_void_zone_visual_AuraScript::HandleApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
return new spell_entropius_void_zone_visual_AuraScript();
SetDuration(3000);
}
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SUMMON_DARK_FIEND_ENTROPIUS, true);
}
void Register() override
{
OnEffectApply += AuraEffectApplyFn(spell_entropius_void_zone_visual_aura::HandleApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
OnEffectRemove += AuraEffectRemoveFn(spell_entropius_void_zone_visual_aura::HandleApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
class spell_entropius_black_hole_effect : public SpellScriptLoader
class spell_entropius_black_hole_effect : public SpellScript
{
public:
spell_entropius_black_hole_effect() : SpellScriptLoader("spell_entropius_black_hole_effect") { }
PrepareSpellScript(spell_entropius_black_hole_effect);
class spell_entropius_black_hole_effect_SpellScript : public SpellScript
void HandlePull(SpellEffIndex effIndex)
{
PrepareSpellScript(spell_entropius_black_hole_effect_SpellScript);
PreventHitDefaultEffect(effIndex);
Unit* target = GetHitUnit();
if (!target)
return;
void HandlePull(SpellEffIndex effIndex)
Position pos;
if (target->GetDistance(GetCaster()) < 5.0f)
{
PreventHitDefaultEffect(effIndex);
Unit* target = GetHitUnit();
if (!target)
return;
Position pos;
if (target->GetDistance(GetCaster()) < 5.0f)
{
float o = frand(0, 2 * M_PI);
pos.Relocate(GetCaster()->GetPositionX() + 4.0f * cos(o), GetCaster()->GetPositionY() + 4.0f * std::sin(o), GetCaster()->GetPositionZ() + frand(10.0f, 15.0f));
}
else
pos.Relocate(GetCaster()->GetPositionX(), GetCaster()->GetPositionY(), GetCaster()->GetPositionZ() + 1.0f);
float speedXY = float(GetSpellInfo()->Effects[effIndex].MiscValue) * 0.1f;
float speedZ = target->GetDistance(pos) / speedXY * 0.5f * Movement::gravity;
target->GetMotionMaster()->MoveJump(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), speedXY, speedZ);
float o = frand(0, 2 * M_PI);
pos.Relocate(GetCaster()->GetPositionX() + 4.0f * cos(o), GetCaster()->GetPositionY() + 4.0f * std::sin(o), GetCaster()->GetPositionZ() + frand(10.0f, 15.0f));
}
else
pos.Relocate(GetCaster()->GetPositionX(), GetCaster()->GetPositionY(), GetCaster()->GetPositionZ() + 1.0f);
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_entropius_black_hole_effect_SpellScript::HandlePull, EFFECT_0, SPELL_EFFECT_PULL_TOWARDS_DEST);
}
};
float speedXY = float(GetSpellInfo()->Effects[effIndex].MiscValue) * 0.1f;
float speedZ = target->GetDistance(pos) / speedXY * 0.5f * Movement::gravity;
SpellScript* GetSpellScript() const override
target->GetMotionMaster()->MoveJump(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), speedXY, speedZ);
}
void Register() override
{
return new spell_entropius_black_hole_effect_SpellScript();
OnEffectHitTarget += SpellEffectFn(spell_entropius_black_hole_effect::HandlePull, EFFECT_0, SPELL_EFFECT_PULL_TOWARDS_DEST);
}
};
@@ -512,10 +477,10 @@ void AddSC_boss_muru()
new boss_entropius();
new npc_singularity();
new spell_muru_summon_blood_elves_periodic();
new spell_muru_darkness();
new spell_entropius_negative_energy();
new spell_entropius_void_zone_visual();
new spell_entropius_black_hole_effect();
RegisterSpellScript(spell_muru_summon_blood_elves_periodic_aura);
RegisterSpellScript(spell_muru_darkness_aura);
RegisterSpellScript(spell_entropius_negative_energy);
RegisterSpellScript(spell_entropius_void_zone_visual_aura);
RegisterSpellScript(spell_entropius_black_hole_effect);
}

View File

@@ -271,37 +271,31 @@ enum cataclysmBreath
SPELL_WITHERED_TOUCH = 46300
};
class spell_cataclysm_breath : public SpellScriptLoader
class spell_cataclysm_breath : public SpellScript
{
public:
spell_cataclysm_breath() : SpellScriptLoader("spell_cataclysm_breath") { }
PrepareSpellScript(spell_cataclysm_breath);
class spell_cataclysm_breath_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareSpellScript(spell_cataclysm_breath_SpellScript);
return ValidateSpellInfo({ SPELL_CORROSIVE_POISON, SPELL_FEVERED_FATIGUE, SPELL_HEX, SPELL_NECROTIC_POISON, SPELL_PIERCING_SHADOW, SPELL_SHRINK, SPELL_WAVERING_WILL, SPELL_WITHERED_TOUCH });
}
void HandleAfterCast()
{
if (Unit* target = GetExplTargetUnit())
for (uint8 i = 0; i < 4; ++i)
GetCaster()->CastSpell(target, RAND(SPELL_CORROSIVE_POISON, SPELL_FEVERED_FATIGUE, SPELL_HEX, SPELL_NECROTIC_POISON, SPELL_PIERCING_SHADOW, SPELL_SHRINK, SPELL_WAVERING_WILL, SPELL_WITHERED_TOUCH), true);
}
void Register() override
{
AfterCast += SpellCastFn(spell_cataclysm_breath_SpellScript::HandleAfterCast);
}
};
SpellScript* GetSpellScript() const override
void HandleAfterCast()
{
return new spell_cataclysm_breath_SpellScript();
if (Unit* target = GetExplTargetUnit())
for (uint8 i = 0; i < 4; ++i)
GetCaster()->CastSpell(target, RAND(SPELL_CORROSIVE_POISON, SPELL_FEVERED_FATIGUE, SPELL_HEX, SPELL_NECROTIC_POISON, SPELL_PIERCING_SHADOW, SPELL_SHRINK, SPELL_WAVERING_WILL, SPELL_WITHERED_TOUCH), true);
}
void Register() override
{
AfterCast += SpellCastFn(spell_cataclysm_breath::HandleAfterCast);
}
};
void AddSC_instance_sunwell_plateau()
{
new instance_sunwell_plateau();
new spell_cataclysm_breath();
RegisterSpellScript(spell_cataclysm_breath);
}

View File

@@ -114,27 +114,6 @@ class spell_q10929_fumping_aura : public AuraScript
}
};
class npc_greatfather_aldrimus : public CreatureScript
{
public:
npc_greatfather_aldrimus() : CreatureScript("npc_greatfather_aldrimus") { }
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_greatfather_aldrimusAI(creature);
}
struct npc_greatfather_aldrimusAI : public ScriptedAI
{
npc_greatfather_aldrimusAI(Creature* c) : ScriptedAI(c) {}
bool CanBeSeen(Player const* player) override
{
return player->GetQuestStatus(10253) == QUEST_STATUS_REWARDED;
}
};
};
enum q10036Torgos
{
NPC_TORGOS = 18707
@@ -636,7 +615,6 @@ void AddSC_terokkar_forest()
// Ours
RegisterSpellAndAuraScriptPair(spell_q10930_big_bone_worm, spell_q10930_big_bone_worm_aura);
RegisterSpellAndAuraScriptPair(spell_q10929_fumping, spell_q10929_fumping_aura);
new npc_greatfather_aldrimus();
RegisterSpellScript(spell_q10036_torgos);
RegisterSpellScript(spell_q10923_evil_draws_near_summon);
RegisterSpellScript(spell_q10923_evil_draws_near_periodic_aura);

View File

@@ -3938,6 +3938,58 @@ class spell_item_scroll_of_retribution : public SpellScript
}
};
// 38554 - Absorb Eye of Grillok (Zezzak's Shard)
enum EyeofGrillok
{
SPELL_EYE_OF_GRILLOK = 38495,
NPC_EYE_OF_GRILLOK = 19440
};
class spell_item_eye_of_grillok : public SpellScript
{
PrepareSpellScript(spell_item_eye_of_grillok)
SpellCastResult CheckCast()
{
if (Unit* target = GetExplTargetUnit())
if (target->GetEntry() == NPC_EYE_OF_GRILLOK && !target->isDead())
return SPELL_CAST_OK;
return SPELL_FAILED_BAD_TARGETS;
}
void Register() override
{
OnCheckCast += SpellCheckCastFn(spell_item_eye_of_grillok::CheckCast);
}
};
class spell_item_eye_of_grillok_aura : public AuraScript
{
PrepareAuraScript(spell_item_eye_of_grillok_aura)
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_EYE_OF_GRILLOK });
}
void OnPeriodic(AuraEffect const* aurEff)
{
Unit* caster = GetCaster();
if (!caster || !GetTarget())
return;
caster->CastSpell(caster, SPELL_EYE_OF_GRILLOK, true);
GetTarget()->ToCreature()->DespawnOrUnsummon();
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_item_eye_of_grillok_aura::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
void AddSC_item_spell_scripts()
{
RegisterSpellScript(spell_item_massive_seaforium_charge);
@@ -4059,5 +4111,6 @@ void AddSC_item_spell_scripts()
RegisterSpellScript(spell_item_worn_troll_dice);
RegisterSpellScript(spell_item_venomhide_feed);
RegisterSpellScript(spell_item_scroll_of_retribution);
RegisterSpellAndAuraScriptPair(spell_item_eye_of_grillok, spell_item_eye_of_grillok_aura);
}

View File

@@ -281,135 +281,120 @@ class spell_rog_deadly_poison : public SpellScript
};
// 51690 - Killing Spree
#define KillingSpreeScriptName "spell_rog_killing_spree"
class spell_rog_killing_spree : public SpellScriptLoader
class spell_rog_killing_spree_aura : public AuraScript
{
public:
spell_rog_killing_spree() : SpellScriptLoader(KillingSpreeScriptName) { }
PrepareAuraScript(spell_rog_killing_spree_aura);
class spell_rog_killing_spree_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareSpellScript(spell_rog_killing_spree_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_ROGUE_KILLING_SPREE });
}
SpellCastResult CheckCast()
{
// Kologarn area, Killing Spree should not work
if (GetCaster()->GetMapId() == 603 /*Ulduar*/ && GetCaster()->GetDistance2d(1766.936f, -24.748f) < 50.0f)
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
return SPELL_CAST_OK;
}
void FilterTargets(std::list<WorldObject*>& targets)
{
if (targets.empty() || GetCaster()->GetVehicleBase() || GetCaster()->HasUnitState(UNIT_STATE_ROOT))
FinishCast(SPELL_FAILED_OUT_OF_RANGE);
else
return ValidateSpellInfo(
{
// Added attribute not breaking stealth, removes auras here
GetCaster()->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_CAST);
GetCaster()->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_SPELL_ATTACK);
}
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (Aura* aura = GetCaster()->GetAura(SPELL_ROGUE_KILLING_SPREE))
{
if (spell_rog_killing_spree_AuraScript* script = dynamic_cast<spell_rog_killing_spree_AuraScript*>(aura->GetScriptByName(KillingSpreeScriptName)))
script->AddTarget(GetHitUnit());
}
}
void Register() override
{
OnCheckCast += SpellCheckCastFn(spell_rog_killing_spree_SpellScript::CheckCast);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_rog_killing_spree_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_rog_killing_spree_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_rog_killing_spree_SpellScript();
SPELL_ROGUE_KILLING_SPREE_TELEPORT,
SPELL_ROGUE_KILLING_SPREE_WEAPON_DMG,
SPELL_ROGUE_KILLING_SPREE_DMG_BUFF
});
}
class spell_rog_killing_spree_AuraScript : public AuraScript
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
PrepareAuraScript(spell_rog_killing_spree_AuraScript);
GetTarget()->CastSpell(GetTarget(), SPELL_ROGUE_KILLING_SPREE_DMG_BUFF, true);
}
bool Validate(SpellInfo const* /*spellInfo*/) override
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
{
while (!_targets.empty())
{
return ValidateSpellInfo(
{
SPELL_ROGUE_KILLING_SPREE_TELEPORT,
SPELL_ROGUE_KILLING_SPREE_WEAPON_DMG,
SPELL_ROGUE_KILLING_SPREE_DMG_BUFF
});
}
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetTarget()->CastSpell(GetTarget(), SPELL_ROGUE_KILLING_SPREE_DMG_BUFF, true);
}
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
{
while (!_targets.empty())
ObjectGuid guid = Acore::Containers::SelectRandomContainerElement(_targets);
if (Unit* target = ObjectAccessor::GetUnit(*GetTarget(), guid))
{
ObjectGuid guid = Acore::Containers::SelectRandomContainerElement(_targets);
if (Unit* target = ObjectAccessor::GetUnit(*GetTarget(), guid))
// xinef: target may be no longer valid
if (!GetTarget()->IsValidAttackTarget(target) || target->HasStealthAura() || target->HasInvisibilityAura())
{
// xinef: target may be no longer valid
if (!GetTarget()->IsValidAttackTarget(target) || target->HasStealthAura() || target->HasInvisibilityAura())
{
_targets.remove(guid);
continue;
}
GetTarget()->CastSpell(target, SPELL_ROGUE_KILLING_SPREE_TELEPORT, true);
// xinef: ensure fast coordinates switch, dont wait for client to send opcode
WorldLocation const& dest = GetTarget()->ToPlayer()->GetTeleportDest();
GetTarget()->ToPlayer()->UpdatePosition(dest, true);
GetTarget()->CastSpell(target, SPELL_ROGUE_KILLING_SPREE_WEAPON_DMG, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_DONT_REPORT_CAST_ERROR));
break;
}
else
_targets.remove(guid);
continue;
}
GetTarget()->CastSpell(target, SPELL_ROGUE_KILLING_SPREE_TELEPORT, true);
// xinef: ensure fast coordinates switch, dont wait for client to send opcode
WorldLocation const& dest = GetTarget()->ToPlayer()->GetTeleportDest();
GetTarget()->ToPlayer()->UpdatePosition(dest, true);
GetTarget()->CastSpell(target, SPELL_ROGUE_KILLING_SPREE_WEAPON_DMG, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_DONT_REPORT_CAST_ERROR));
break;
}
else
_targets.remove(guid);
}
}
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetTarget()->RemoveAurasDueToSpell(SPELL_ROGUE_KILLING_SPREE_DMG_BUFF);
}
void Register() override
{
AfterEffectApply += AuraEffectApplyFn(spell_rog_killing_spree_AuraScript::HandleApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_rog_killing_spree_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
AfterEffectRemove += AuraEffectRemoveFn(spell_rog_killing_spree_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
public:
void AddTarget(Unit* target)
{
_targets.push_back(target->GetGUID());
}
private:
GuidList _targets;
};
AuraScript* GetAuraScript() const override
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
return new spell_rog_killing_spree_AuraScript();
GetTarget()->RemoveAurasDueToSpell(SPELL_ROGUE_KILLING_SPREE_DMG_BUFF);
}
public:
void AddTarget(Unit* target)
{
_targets.push_back(target->GetGUID());
}
void Register() override
{
AfterEffectApply += AuraEffectApplyFn(spell_rog_killing_spree_aura::HandleApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_rog_killing_spree_aura::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
AfterEffectRemove += AuraEffectRemoveFn(spell_rog_killing_spree_aura::HandleRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
private:
GuidList _targets;
};
#define KillingSpreeScriptName "spell_rog_killing_spree"
typedef spell_rog_killing_spree_aura spell_rog_killing_spree_aura_script;
class spell_rog_killing_spree : public SpellScript
{
PrepareSpellScript(spell_rog_killing_spree);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_ROGUE_KILLING_SPREE });
}
SpellCastResult CheckCast()
{
// Kologarn area, Killing Spree should not work
if (GetCaster()->GetMapId() == 603 /*Ulduar*/ && GetCaster()->GetDistance2d(1766.936f, -24.748f) < 50.0f)
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
return SPELL_CAST_OK;
}
void FilterTargets(std::list<WorldObject*>& targets)
{
if (targets.empty() || GetCaster()->GetVehicleBase() || GetCaster()->HasUnitState(UNIT_STATE_ROOT))
FinishCast(SPELL_FAILED_OUT_OF_RANGE);
else
{
// Added attribute not breaking stealth, removes auras here
GetCaster()->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_CAST);
GetCaster()->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_SPELL_ATTACK);
}
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (Aura* aura = GetCaster()->GetAura(SPELL_ROGUE_KILLING_SPREE))
{
if (spell_rog_killing_spree_aura* script = dynamic_cast<spell_rog_killing_spree_aura_script*>(aura->GetScriptByName(KillingSpreeScriptName)))
script->AddTarget(GetHitUnit());
}
}
void Register() override
{
OnCheckCast += SpellCheckCastFn(spell_rog_killing_spree::CheckCast);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_rog_killing_spree::FilterTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_rog_killing_spree::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
}
};
@@ -774,7 +759,7 @@ void AddSC_rogue_spell_scripts()
RegisterSpellScript(spell_rog_blade_flurry);
RegisterSpellScript(spell_rog_cheat_death);
RegisterSpellScript(spell_rog_deadly_poison);
new spell_rog_killing_spree();
RegisterSpellAndAuraScriptPair(spell_rog_killing_spree, spell_rog_killing_spree_aura);
RegisterSpellScript(spell_rog_nerves_of_steel);
RegisterSpellScript(spell_rog_preparation);
RegisterSpellScript(spell_rog_prey_on_the_weak);

View File

@@ -316,7 +316,7 @@ public:
// Summon druid spirits on 75%, 50% and 25% health
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
{
if (me->HealthBelowPctDamaged(100 - (25 * _stage), damage))
if (_stage <= 3 && me->HealthBelowPctDamaged(100 - (25 * _stage), damage))
{
Talk(SAY_YSONDRE_SUMMON_DRUIDS);
@@ -421,7 +421,7 @@ public:
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
{
if (me->HealthBelowPctDamaged(100 - (25 * _stage), damage))
if (_stage <= 3 && me->HealthBelowPctDamaged(100 - (25 * _stage), damage))
{
Talk(SAY_LETHON_DRAW_SPIRIT);
DoCast(me, SPELL_DRAW_SPIRIT);
@@ -547,7 +547,7 @@ public:
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
{
if (me->HealthBelowPctDamaged(100 - (25 * _stage), damage))
if (_stage <= 3 && me->HealthBelowPctDamaged(100 - (25 * _stage), damage))
{
Talk(SAY_EMERISS_CAST_CORRUPTION);
DoCast(me, SPELL_CORRUPTION_OF_EARTH, true);
@@ -645,7 +645,7 @@ public:
{
// At 75, 50 or 25 percent health, we need to activate the shades and go "banished"
// Note: _stage holds the amount of times they have been summoned
if (!_banished && me->HealthBelowPctDamaged(100 - (25 * _stage), damage))
if (_stage <= 3 && !_banished && me->HealthBelowPctDamaged(100 - (25 * _stage), damage))
{
_banished = true;
_banishedTimer = 60000;
@@ -736,41 +736,30 @@ public:
* --- Spell: Dream Fog
*/
class spell_dream_fog_sleep : public SpellScriptLoader
class spell_dream_fog_sleep : public SpellScript
{
public:
spell_dream_fog_sleep() : SpellScriptLoader("spell_dream_fog_sleep") { }
PrepareSpellScript(spell_dream_fog_sleep);
class spell_dream_fog_sleep_SpellScript : public SpellScript
void HandleEffect(SpellEffIndex /*effIndex*/)
{
PrepareSpellScript(spell_dream_fog_sleep_SpellScript);
void HandleEffect(SpellEffIndex /*effIndex*/)
if (Unit* caster = GetCaster())
{
if (Unit* caster = GetCaster())
if (Unit* target = GetHitUnit())
{
if (Unit* target = GetHitUnit())
{
caster->GetAI()->SetGUID(target->GetGUID(), GUID_FOG_TARGET);
}
caster->GetAI()->SetGUID(target->GetGUID(), GUID_FOG_TARGET);
}
}
}
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(Acore::UnitAuraCheck(true, SPELL_SLEEP));
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_dream_fog_sleep_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dream_fog_sleep_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
}
};
SpellScript* GetSpellScript() const override
void FilterTargets(std::list<WorldObject*>& targets)
{
return new spell_dream_fog_sleep_SpellScript();
targets.remove_if(Acore::UnitAuraCheck(true, SPELL_SLEEP));
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_dream_fog_sleep::HandleEffect, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dream_fog_sleep::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
}
};
@@ -827,41 +816,30 @@ class spell_shadow_bolt_whirl : public AuraScript
OnEffectPeriodic += AuraEffectPeriodicFn(spell_shadow_bolt_whirl::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
class spell_mark_of_nature : public SpellScriptLoader
class spell_mark_of_nature : public SpellScript
{
public:
spell_mark_of_nature() : SpellScriptLoader("spell_mark_of_nature") { }
PrepareSpellScript(spell_mark_of_nature);
class spell_mark_of_nature_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareSpellScript(spell_mark_of_nature_SpellScript);
return ValidateSpellInfo({ SPELL_MARK_OF_NATURE, SPELL_AURA_OF_NATURE });
}
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MARK_OF_NATURE, SPELL_AURA_OF_NATURE });
}
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(MarkOfNatureTargetSelector());
}
void HandleEffect(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
GetHitUnit()->CastSpell(GetHitUnit(), SPELL_AURA_OF_NATURE, true);
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mark_of_nature_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_mark_of_nature_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
}
};
SpellScript* GetSpellScript() const override
void FilterTargets(std::list<WorldObject*>& targets)
{
return new spell_mark_of_nature_SpellScript();
targets.remove_if(MarkOfNatureTargetSelector());
}
void HandleEffect(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
GetHitUnit()->CastSpell(GetHitUnit(), SPELL_AURA_OF_NATURE, true);
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mark_of_nature::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_mark_of_nature::HandleEffect, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
}
};
@@ -878,8 +856,8 @@ void AddSC_emerald_dragons()
new boss_lethon();
// dragon spellscripts
new spell_dream_fog_sleep();
new spell_mark_of_nature();
RegisterSpellScript(spell_dream_fog_sleep);
RegisterSpellScript(spell_mark_of_nature);
RegisterSpellScript(spell_shadow_bolt_whirl);
};

View File

@@ -572,6 +572,10 @@ public:
if (!SpawnAssoc)
return;
// check if they're hostile
if (!(me->IsHostileTo(who) || who->IsHostileTo(me)))
return;
if (me->IsValidAttackTarget(who))
{
Player* playerTarget = who->ToPlayer();

View File

@@ -766,7 +766,7 @@ struct CreatureDisplayInfoExtraEntry
{
//uint32 ID; // 0
uint32 DisplayRaceID; // 1
uint32 DisplaySexID; // 2
//uint32 DisplaySexID; // 2
//uint32 SkinID; // 3
//uint32 FaceID; // 4
//uint32 HairStyleID; // 5

View File

@@ -37,7 +37,7 @@ char constexpr ChrRacesEntryfmt[] = "niixiixixxxxixssssssssssssssssxxxxxxxxxxxxx
char constexpr CinematicCameraEntryfmt[] = "nsiffff";
char constexpr CinematicSequencesEntryfmt[] = "nxixxxxxxx";
char constexpr CreatureDisplayInfofmt[] = "nixifxxxxxxxxxxx";
char constexpr CreatureDisplayInfoExtrafmt[] = "diixxxxxxxxxxxxxxxxxx";
char constexpr CreatureDisplayInfoExtrafmt[] = "dixxxxxxxxxxxxxxxxxxx";
char constexpr CreatureFamilyfmt[] = "nfifiiiiixssssssssssssssssxx";
char constexpr CreatureModelDatafmt[] = "nixxfxxxxxxxxxfffxxxxxxxxxxx";
char constexpr CreatureSpellDatafmt[] = "niiiixxxx";