refactor(Scripts/BlackTemple): Spell Scripts use registry macros (#19122)

This commit is contained in:
Jelle Meeus
2024-06-22 10:20:06 +02:00
committed by GitHub
parent f65283c35a
commit 9f348fc96d
7 changed files with 828 additions and 1164 deletions

View File

@@ -198,73 +198,51 @@ public:
};
};
class spell_gurtogg_bloodboil : public SpellScriptLoader
class spell_gurtogg_bloodboil : public SpellScript
{
public:
spell_gurtogg_bloodboil() : SpellScriptLoader("spell_gurtogg_bloodboil") { }
PrepareSpellScript(spell_gurtogg_bloodboil);
class spell_gurtogg_bloodboil_SpellScript : public SpellScript
void FilterTargets(std::list<WorldObject*>& targets)
{
PrepareSpellScript(spell_gurtogg_bloodboil_SpellScript);
if (targets.empty())
return;
void FilterTargets(std::list<WorldObject*>& targets)
targets.sort(Acore::ObjectDistanceOrderPred(GetCaster(), false));
if (targets.size() > GetSpellValue()->MaxAffectedTargets)
{
if (targets.empty())
return;
targets.sort(Acore::ObjectDistanceOrderPred(GetCaster(), false));
if (targets.size() > GetSpellValue()->MaxAffectedTargets)
{
std::list<WorldObject*>::iterator itr = targets.begin();
std::advance(itr, GetSpellValue()->MaxAffectedTargets);
targets.erase(itr, targets.end());
}
std::list<WorldObject*>::iterator itr = targets.begin();
std::advance(itr, GetSpellValue()->MaxAffectedTargets);
targets.erase(itr, targets.end());
}
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_gurtogg_bloodboil_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
SpellScript* GetSpellScript() const override
void Register() override
{
return new spell_gurtogg_bloodboil_SpellScript();
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_gurtogg_bloodboil::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
class spell_gurtogg_eject : public SpellScriptLoader
class spell_gurtogg_eject : public SpellScript
{
public:
spell_gurtogg_eject() : SpellScriptLoader("spell_gurtogg_eject") { }
PrepareSpellScript(spell_gurtogg_eject);
class spell_gurtogg_eject_SpellScript : public SpellScript
void HandleScriptEffect(SpellEffIndex effIndex)
{
PrepareSpellScript(spell_gurtogg_eject_SpellScript);
PreventHitEffect(effIndex);
if (Unit* target = GetHitUnit())
GetCaster()->GetThreatMgr().ModifyThreatByPercent(target, -20);
}
void HandleScriptEffect(SpellEffIndex effIndex)
{
PreventHitEffect(effIndex);
if (Unit* target = GetHitUnit())
GetCaster()->GetThreatMgr().ModifyThreatByPercent(target, -20);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_gurtogg_eject_SpellScript::HandleScriptEffect, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
void Register() override
{
return new spell_gurtogg_eject_SpellScript();
OnEffectHitTarget += SpellEffectFn(spell_gurtogg_eject::HandleScriptEffect, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
void AddSC_boss_gurtogg_bloodboil()
{
new boss_gurtogg_bloodboil();
new spell_gurtogg_bloodboil();
new spell_gurtogg_eject();
RegisterSpellScript(spell_gurtogg_bloodboil);
RegisterSpellScript(spell_gurtogg_eject);
}

View File

@@ -1023,419 +1023,337 @@ public:
}
};
class spell_illidan_draw_soul : public SpellScriptLoader
class spell_illidan_draw_soul : public SpellScript
{
public:
spell_illidan_draw_soul() : SpellScriptLoader("spell_illidan_draw_soul") { }
PrepareSpellScript(spell_illidan_draw_soul);
class spell_illidan_draw_soul_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareSpellScript(spell_illidan_draw_soul_SpellScript);
return ValidateSpellInfo({ SPELL_DRAW_SOUL_HEAL });
}
void HandleScriptEffect(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
if (Unit* target = GetHitUnit())
target->CastSpell(GetCaster(), SPELL_DRAW_SOUL_HEAL, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_illidan_draw_soul_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
void HandleScriptEffect(SpellEffIndex effIndex)
{
return new spell_illidan_draw_soul_SpellScript();
PreventHitDefaultEffect(effIndex);
if (Unit* target = GetHitUnit())
target->CastSpell(GetCaster(), SPELL_DRAW_SOUL_HEAL, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_illidan_draw_soul::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
class spell_illidan_parasitic_shadowfiend : public SpellScriptLoader
class spell_illidan_parasitic_shadowfiend_aura : public AuraScript
{
public:
spell_illidan_parasitic_shadowfiend() : SpellScriptLoader("spell_illidan_parasitic_shadowfiend") { }
PrepareAuraScript(spell_illidan_parasitic_shadowfiend_aura);
class spell_illidan_parasitic_shadowfiend_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_illidan_parasitic_shadowfiend_AuraScript)
return ValidateSpellInfo({ SPELL_SUMMON_PARASITIC_SHADOWFIENDS });
}
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (!GetTarget()->HasAura(SPELL_SHADOW_PRISON) && GetTarget()->GetInstanceScript() && GetTarget()->GetInstanceScript()->IsEncounterInProgress())
GetTarget()->CastSpell(GetTarget(), SPELL_SUMMON_PARASITIC_SHADOWFIENDS, true);
}
void Register() override
{
AfterEffectRemove += AuraEffectRemoveFn(spell_illidan_parasitic_shadowfiend_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
return new spell_illidan_parasitic_shadowfiend_AuraScript();
if (!GetTarget()->HasAura(SPELL_SHADOW_PRISON) && GetTarget()->GetInstanceScript() && GetTarget()->GetInstanceScript()->IsEncounterInProgress())
GetTarget()->CastSpell(GetTarget(), SPELL_SUMMON_PARASITIC_SHADOWFIENDS, true);
}
void Register() override
{
AfterEffectRemove += AuraEffectRemoveFn(spell_illidan_parasitic_shadowfiend_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
}
};
class spell_illidan_parasitic_shadowfiend_trigger : public SpellScriptLoader
class spell_illidan_parasitic_shadowfiend_trigger : public SpellScript
{
public:
spell_illidan_parasitic_shadowfiend_trigger() : SpellScriptLoader("spell_illidan_parasitic_shadowfiend_trigger") { }
PrepareSpellScript(spell_illidan_parasitic_shadowfiend_trigger);
class spell_illidan_parasitic_shadowfiend_trigger_AuraScript : public AuraScript
void HandleScriptEffect(SpellEffIndex effIndex)
{
PrepareAuraScript(spell_illidan_parasitic_shadowfiend_trigger_AuraScript)
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (!GetTarget()->HasAura(SPELL_SHADOW_PRISON) && GetTarget()->GetInstanceScript() && GetTarget()->GetInstanceScript()->IsEncounterInProgress())
GetTarget()->CastSpell(GetTarget(), SPELL_SUMMON_PARASITIC_SHADOWFIENDS, true);
}
void Register() override
{
AfterEffectRemove += AuraEffectRemoveFn(spell_illidan_parasitic_shadowfiend_trigger_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_illidan_parasitic_shadowfiend_trigger_AuraScript();
PreventHitDefaultEffect(effIndex);
if (Creature* target = GetHitCreature())
target->DespawnOrUnsummon(1);
}
class spell_illidan_parasitic_shadowfiend_trigger_SpellScript : public SpellScript
void Register() override
{
PrepareSpellScript(spell_illidan_parasitic_shadowfiend_trigger_SpellScript);
void HandleScriptEffect(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
if (Creature* target = GetHitCreature())
target->DespawnOrUnsummon(1);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_illidan_parasitic_shadowfiend_trigger_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_illidan_parasitic_shadowfiend_trigger_SpellScript();
OnEffectHitTarget += SpellEffectFn(spell_illidan_parasitic_shadowfiend_trigger::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
class spell_illidan_glaive_throw : public SpellScriptLoader
class spell_illidan_parasitic_shadowfiend_trigger_aura : public AuraScript
{
public:
spell_illidan_glaive_throw() : SpellScriptLoader("spell_illidan_glaive_throw") { }
PrepareAuraScript(spell_illidan_parasitic_shadowfiend_trigger_aura);
class spell_illidan_glaive_throw_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareSpellScript(spell_illidan_glaive_throw_SpellScript);
return ValidateSpellInfo({ SPELL_SUMMON_PARASITIC_SHADOWFIENDS });
}
void HandleDummy(SpellEffIndex effIndex)
{
PreventHitEffect(effIndex);
if (Unit* target = GetHitUnit())
target->CastSpell(target, SPELL_SUMMON_GLAIVE, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_illidan_glaive_throw_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const override
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
return new spell_illidan_glaive_throw_SpellScript();
if (!GetTarget()->HasAura(SPELL_SHADOW_PRISON) && GetTarget()->GetInstanceScript() && GetTarget()->GetInstanceScript()->IsEncounterInProgress())
GetTarget()->CastSpell(GetTarget(), SPELL_SUMMON_PARASITIC_SHADOWFIENDS, true);
}
void Register() override
{
AfterEffectRemove += AuraEffectRemoveFn(spell_illidan_parasitic_shadowfiend_trigger_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
}
};
class spell_illidan_tear_of_azzinoth_summon_channel : public SpellScriptLoader
class spell_illidan_glaive_throw : public SpellScript
{
public:
spell_illidan_tear_of_azzinoth_summon_channel() : SpellScriptLoader("spell_illidan_tear_of_azzinoth_summon_channel") { }
PrepareSpellScript(spell_illidan_glaive_throw);
class spell_illidan_tear_of_azzinoth_summon_channel_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_illidan_tear_of_azzinoth_summon_channel_AuraScript);
return ValidateSpellInfo({ SPELL_SUMMON_GLAIVE });
}
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
PreventDefaultAction();
if (Unit* caster = GetCaster())
{
if (GetTarget()->GetDistance2d(caster) > 25.0f)
{
SetDuration(0);
GetTarget()->CastSpell(GetTarget(), SPELL_UNCAGED_WRATH, true);
}
}
// xinef: ugly hax, dunno how it really works on blizz
Map::PlayerList const& pl = GetTarget()->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
if (Player* player = itr->GetSource())
if (player->GetPositionX() > 693.4f || player->GetPositionY() < 271.8f || player->GetPositionX() < 658.43f || player->GetPositionY() > 338.68f)
{
GetTarget()->CastSpell(player, SPELL_CHARGE, true);
break;
}
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_illidan_tear_of_azzinoth_summon_channel_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
void HandleDummy(SpellEffIndex effIndex)
{
return new spell_illidan_tear_of_azzinoth_summon_channel_AuraScript();
PreventHitEffect(effIndex);
if (Unit* target = GetHitUnit())
target->CastSpell(target, SPELL_SUMMON_GLAIVE, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_illidan_glaive_throw::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
class spell_illidan_shadow_prison : public SpellScriptLoader
class spell_illidan_tear_of_azzinoth_summon_channel_aura : public AuraScript
{
public:
spell_illidan_shadow_prison() : SpellScriptLoader("spell_illidan_shadow_prison") { }
PrepareAuraScript(spell_illidan_tear_of_azzinoth_summon_channel_aura);
class spell_illidan_shadow_prison_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareSpellScript(spell_illidan_shadow_prison_SpellScript);
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(PlayerOrPetCheck());
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_illidan_shadow_prison_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_illidan_shadow_prison_SpellScript();
return ValidateSpellInfo({ SPELL_UNCAGED_WRATH, SPELL_CHARGE });
}
};
class spell_illidan_demon_transform1 : public SpellScriptLoader
{
public:
spell_illidan_demon_transform1() : SpellScriptLoader("spell_illidan_demon_transform1") { }
class spell_illidan_demon_transform1_AuraScript : public AuraScript
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
PrepareAuraScript(spell_illidan_demon_transform1_AuraScript);
bool Load() override
PreventDefaultAction();
if (Unit* caster = GetCaster())
{
return GetUnitOwner()->GetTypeId() == TYPEID_UNIT;
}
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
PreventDefaultAction();
SetDuration(0);
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_DEMON_TRANSFORM_2, true);
GetUnitOwner()->ToCreature()->LoadEquipment(0, true);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_illidan_demon_transform1_AuraScript::OnPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_illidan_demon_transform1_AuraScript();
}
};
class spell_illidan_demon_transform2 : public SpellScriptLoader
{
public:
spell_illidan_demon_transform2() : SpellScriptLoader("spell_illidan_demon_transform2") { }
class spell_illidan_demon_transform2_AuraScript : public AuraScript
{
PrepareAuraScript(spell_illidan_demon_transform2_AuraScript);
bool Load() override
{
return GetUnitOwner()->GetTypeId() == TYPEID_UNIT;
}
void OnPeriodic(AuraEffect const* aurEff)
{
PreventDefaultAction();
if (aurEff->GetTickNumber() == 1)
{
if (GetUnitOwner()->GetDisplayId() == GetUnitOwner()->GetNativeDisplayId())
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_DEMON_FORM, true);
else
GetUnitOwner()->RemoveAurasDueToSpell(SPELL_DEMON_FORM);
}
else if (aurEff->GetTickNumber() == 2)
if (GetTarget()->GetDistance2d(caster) > 25.0f)
{
SetDuration(0);
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_DEMON_TRANSFORM_3, true);
if (Aura* aura = GetUnitOwner()->GetAura(SPELL_DEMON_TRANSFORM_3))
aura->SetDuration(4500);
if (!GetUnitOwner()->HasAura(SPELL_DEMON_FORM))
GetUnitOwner()->ToCreature()->LoadEquipment(1, true);
GetTarget()->CastSpell(GetTarget(), SPELL_UNCAGED_WRATH, true);
}
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_illidan_demon_transform2_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_illidan_demon_transform2_AuraScript();
}
};
class spell_illidan_flame_burst : public SpellScriptLoader
{
public:
spell_illidan_flame_burst() : SpellScriptLoader("spell_illidan_flame_burst") { }
class spell_illidan_flame_burst_SpellScript : public SpellScript
{
PrepareSpellScript(spell_illidan_flame_burst_SpellScript);
void HandleScriptEffect(SpellEffIndex effIndex)
{
PreventHitEffect(effIndex);
if (Unit* target = GetHitUnit())
target->CastSpell(target, SPELL_FLAME_BURST_EFFECT, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_illidan_flame_burst_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_illidan_flame_burst_SpellScript();
}
};
class spell_illidan_found_target : public SpellScriptLoader
{
public:
spell_illidan_found_target() : SpellScriptLoader("spell_illidan_found_target") { }
class spell_illidan_found_target_SpellScript : public SpellScript
{
PrepareSpellScript(spell_illidan_found_target_SpellScript);
void HandleDummy(SpellEffIndex effIndex)
{
PreventHitEffect(effIndex);
if (Unit* target = GetHitUnit())
if (GetCaster()->GetDistance(target) < 2.0f)
// xinef: ugly hax, dunno how it really works on blizz
Map::PlayerList const& pl = GetTarget()->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
if (Player* player = itr->GetSource())
if (player->GetPositionX() > 693.4f || player->GetPositionY() < 271.8f || player->GetPositionX() < 658.43f || player->GetPositionY() > 338.68f)
{
GetCaster()->CastSpell(target, SPELL_CONSUME_SOUL, true);
GetCaster()->CastSpell(GetCaster(), SPELL_FIND_TARGET, true);
GetTarget()->CastSpell(player, SPELL_CHARGE, true);
break;
}
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_illidan_found_target_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const override
void Register() override
{
return new spell_illidan_found_target_SpellScript();
OnEffectPeriodic += AuraEffectPeriodicFn(spell_illidan_tear_of_azzinoth_summon_channel_aura::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
class spell_illidan_cage_trap : public SpellScriptLoader
class spell_illidan_shadow_prison : public SpellScript
{
public:
spell_illidan_cage_trap() : SpellScriptLoader("spell_illidan_cage_trap") { }
PrepareSpellScript(spell_illidan_shadow_prison);
class spell_illidan_cage_trap_SpellScript : public SpellScript
void FilterTargets(std::list<WorldObject*>& targets)
{
PrepareSpellScript(spell_illidan_cage_trap_SpellScript);
targets.remove_if(PlayerOrPetCheck());
}
bool Load() override
{
return GetCaster()->GetTypeId() == TYPEID_UNIT;
}
void HandleScriptEffect(SpellEffIndex effIndex)
{
PreventHitEffect(effIndex);
if (Creature* target = GetHitCreature())
if (GetCaster()->GetExactDist2d(target) < 4.0f)
{
target->AI()->DoAction(ACTION_ILLIDAN_CAGED);
target->CastSpell(target, SPELL_CAGE_TRAP, true);
GetCaster()->ToCreature()->DespawnOrUnsummon(1);
if (GameObject* gobject = GetCaster()->FindNearestGameObject(GO_CAGE_TRAP, 10.0f))
gobject->SetLootState(GO_JUST_DEACTIVATED);
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_illidan_cage_trap_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
void Register() override
{
return new spell_illidan_cage_trap_SpellScript();
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_illidan_shadow_prison::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
class spell_illidan_cage_trap_stun : public SpellScriptLoader
class spell_illidan_demon_transform1_aura : public AuraScript
{
public:
spell_illidan_cage_trap_stun() : SpellScriptLoader("spell_illidan_cage_trap_stun") { }
PrepareAuraScript(spell_illidan_demon_transform1_aura);
class spell_illidan_cage_trap_stun_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_illidan_cage_trap_stun_AuraScript);
return ValidateSpellInfo({ SPELL_DEMON_TRANSFORM_2 });
}
void OnPeriodic(AuraEffect const* /*aurEff*/)
bool Load() override
{
return GetUnitOwner()->GetTypeId() == TYPEID_UNIT;
}
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
PreventDefaultAction();
SetDuration(0);
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_DEMON_TRANSFORM_2, true);
GetUnitOwner()->ToCreature()->LoadEquipment(0, true);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_illidan_demon_transform1_aura::OnPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
class spell_illidan_demon_transform2_aura : public AuraScript
{
PrepareAuraScript(spell_illidan_demon_transform2_aura);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DEMON_FORM, SPELL_DEMON_TRANSFORM_3 });
}
bool Load() override
{
return GetUnitOwner()->GetTypeId() == TYPEID_UNIT;
}
void OnPeriodic(AuraEffect const* aurEff)
{
PreventDefaultAction();
if (aurEff->GetTickNumber() == 1)
{
if (GetUnitOwner()->GetDisplayId() == GetUnitOwner()->GetNativeDisplayId())
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_DEMON_FORM, true);
else
GetUnitOwner()->RemoveAurasDueToSpell(SPELL_DEMON_FORM);
}
else if (aurEff->GetTickNumber() == 2)
{
PreventDefaultAction();
SetDuration(0);
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_DEMON_TRANSFORM_3, true);
if (Aura* aura = GetUnitOwner()->GetAura(SPELL_DEMON_TRANSFORM_3))
aura->SetDuration(4500);
for (uint32 i = SPELL_CAGED_SUMMON1; i <= SPELL_CAGED_SUMMON8; ++i)
GetTarget()->CastSpell(GetTarget(), i, true);
GetTarget()->CastSpell(GetTarget(), SPELL_CAGED_DEBUFF, true);
if (!GetUnitOwner()->HasAura(SPELL_DEMON_FORM))
GetUnitOwner()->ToCreature()->LoadEquipment(1, true);
}
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_illidan_cage_trap_stun_AuraScript::OnPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
void Register() override
{
return new spell_illidan_cage_trap_stun_AuraScript();
OnEffectPeriodic += AuraEffectPeriodicFn(spell_illidan_demon_transform2_aura::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
class spell_illidan_flame_burst : public SpellScript
{
PrepareSpellScript(spell_illidan_flame_burst);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_FLAME_BURST_EFFECT });
}
void HandleScriptEffect(SpellEffIndex effIndex)
{
PreventHitEffect(effIndex);
if (Unit* target = GetHitUnit())
target->CastSpell(target, SPELL_FLAME_BURST_EFFECT, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_illidan_flame_burst::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
class spell_illidan_found_target : public SpellScript
{
PrepareSpellScript(spell_illidan_found_target);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_CONSUME_SOUL, SPELL_FIND_TARGET });
}
void HandleDummy(SpellEffIndex effIndex)
{
PreventHitEffect(effIndex);
if (Unit* target = GetHitUnit())
if (GetCaster()->GetDistance(target) < 2.0f)
{
GetCaster()->CastSpell(target, SPELL_CONSUME_SOUL, true);
GetCaster()->CastSpell(GetCaster(), SPELL_FIND_TARGET, true);
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_illidan_found_target::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
class spell_illidan_cage_trap : public SpellScript
{
PrepareSpellScript(spell_illidan_cage_trap);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_CAGE_TRAP });
}
bool Load() override
{
return GetCaster()->GetTypeId() == TYPEID_UNIT;
}
void HandleScriptEffect(SpellEffIndex effIndex)
{
PreventHitEffect(effIndex);
if (Creature* target = GetHitCreature())
if (GetCaster()->GetExactDist2d(target) < 4.0f)
{
target->AI()->DoAction(ACTION_ILLIDAN_CAGED);
target->CastSpell(target, SPELL_CAGE_TRAP, true);
GetCaster()->ToCreature()->DespawnOrUnsummon(1);
if (GameObject* gobject = GetCaster()->FindNearestGameObject(GO_CAGE_TRAP, 10.0f))
gobject->SetLootState(GO_JUST_DEACTIVATED);
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_illidan_cage_trap::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
class spell_illidan_cage_trap_stun_aura : public AuraScript
{
PrepareAuraScript(spell_illidan_cage_trap_stun_aura);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_CAGED_DEBUFF, SPELL_CAGED_SUMMON1, SPELL_CAGED_SUMMON1+1, SPELL_CAGED_SUMMON1+2, SPELL_CAGED_SUMMON1+3, SPELL_CAGED_SUMMON1+4, SPELL_CAGED_SUMMON1+5, SPELL_CAGED_SUMMON1+6, SPELL_CAGED_SUMMON8 });
}
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
PreventDefaultAction();
SetDuration(0);
for (uint32 i = SPELL_CAGED_SUMMON1; i <= SPELL_CAGED_SUMMON8; ++i)
GetTarget()->CastSpell(GetTarget(), i, true);
GetTarget()->CastSpell(GetTarget(), SPELL_CAGED_DEBUFF, true);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_illidan_cage_trap_stun_aura::OnPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
@@ -1443,17 +1361,17 @@ void AddSC_boss_illidan()
{
new boss_illidan_stormrage();
new npc_akama_illidan();
new spell_illidan_draw_soul();
new spell_illidan_parasitic_shadowfiend();
new spell_illidan_parasitic_shadowfiend_trigger();
new spell_illidan_glaive_throw();
new spell_illidan_tear_of_azzinoth_summon_channel();
new spell_illidan_shadow_prison();
new spell_illidan_demon_transform1();
new spell_illidan_demon_transform2();
new spell_illidan_flame_burst();
new spell_illidan_found_target();
new spell_illidan_cage_trap();
new spell_illidan_cage_trap_stun();
RegisterSpellScript(spell_illidan_draw_soul);
RegisterSpellScript(spell_illidan_parasitic_shadowfiend_aura);
RegisterSpellAndAuraScriptPair(spell_illidan_parasitic_shadowfiend_trigger, spell_illidan_parasitic_shadowfiend_trigger_aura);
RegisterSpellScript(spell_illidan_glaive_throw);
RegisterSpellScript(spell_illidan_tear_of_azzinoth_summon_channel_aura);
RegisterSpellScript(spell_illidan_shadow_prison);
RegisterSpellScript(spell_illidan_demon_transform1_aura);
RegisterSpellScript(spell_illidan_demon_transform2_aura);
RegisterSpellScript(spell_illidan_flame_burst);
RegisterSpellScript(spell_illidan_found_target);
RegisterSpellScript(spell_illidan_cage_trap);
RegisterSpellScript(spell_illidan_cage_trap_stun_aura);
}

View File

@@ -171,213 +171,162 @@ public:
};
};
class spell_mother_shahraz_random_periodic : public SpellScriptLoader
class spell_mother_shahraz_random_periodic_aura : public AuraScript
{
public:
spell_mother_shahraz_random_periodic() : SpellScriptLoader("spell_mother_shahraz_random_periodic") { }
PrepareAuraScript(spell_mother_shahraz_random_periodic_aura);
class spell_mother_shahraz_random_periodic_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_mother_shahraz_random_periodic_AuraScript);
return ValidateSpellInfo({ SPELL_SINFUL_PERIODIC, SPELL_SINISTER_PERIODIC, SPELL_VILE_PERIODIC, SPELL_WICKED_PERIODIC });
}
void Update(AuraEffect const* effect)
{
PreventDefaultAction();
if (effect->GetTickNumber() % 5 == 1)
GetUnitOwner()->CastSpell(GetUnitOwner(), RAND(SPELL_SINFUL_PERIODIC, SPELL_SINISTER_PERIODIC, SPELL_VILE_PERIODIC, SPELL_WICKED_PERIODIC), true);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mother_shahraz_random_periodic_AuraScript::Update, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
void Update(AuraEffect const* effect)
{
return new spell_mother_shahraz_random_periodic_AuraScript();
PreventDefaultAction();
if (effect->GetTickNumber() % 5 == 1)
GetUnitOwner()->CastSpell(GetUnitOwner(), RAND(SPELL_SINFUL_PERIODIC, SPELL_SINISTER_PERIODIC, SPELL_VILE_PERIODIC, SPELL_WICKED_PERIODIC), true);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mother_shahraz_random_periodic_aura::Update, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
class spell_mother_shahraz_beam_periodic : public SpellScriptLoader
class spell_mother_shahraz_beam_periodic_aura : public AuraScript
{
public:
spell_mother_shahraz_beam_periodic() : SpellScriptLoader("spell_mother_shahraz_beam_periodic") { }
PrepareAuraScript(spell_mother_shahraz_beam_periodic_aura);
class spell_mother_shahraz_beam_periodic_AuraScript : public AuraScript
void Update(AuraEffect const* effect)
{
PrepareAuraScript(spell_mother_shahraz_beam_periodic_AuraScript);
PreventDefaultAction();
if (Unit* target = GetUnitOwner()->GetAI()->SelectTarget(SelectTargetMethod::Random, 0))
GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[effect->GetEffIndex()].TriggerSpell, true);
}
void Update(AuraEffect const* effect)
{
PreventDefaultAction();
if (Unit* target = GetUnitOwner()->GetAI()->SelectTarget(SelectTargetMethod::Random, 0))
GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[effect->GetEffIndex()].TriggerSpell, true);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mother_shahraz_beam_periodic_AuraScript::Update, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
void Register() override
{
return new spell_mother_shahraz_beam_periodic_AuraScript();
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mother_shahraz_beam_periodic_aura::Update, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
class spell_mother_shahraz_saber_lash : public SpellScriptLoader
class spell_mother_shahraz_saber_lash_aura : public AuraScript
{
public:
spell_mother_shahraz_saber_lash() : SpellScriptLoader("spell_mother_shahraz_saber_lash") { }
PrepareAuraScript(spell_mother_shahraz_saber_lash_aura);
class spell_mother_shahraz_saber_lash_AuraScript : public AuraScript
bool CheckProc(ProcEventInfo& /*eventInfo*/)
{
PrepareAuraScript(spell_mother_shahraz_saber_lash_AuraScript);
return false;
}
bool CheckProc(ProcEventInfo& /*eventInfo*/)
{
return false;
}
void Update(AuraEffect const* effect)
{
PreventDefaultAction();
if (Unit* target = GetUnitOwner()->GetVictim())
GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[effect->GetEffIndex()].TriggerSpell, true);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_mother_shahraz_saber_lash_AuraScript::CheckProc);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mother_shahraz_saber_lash_AuraScript::Update, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
void Update(AuraEffect const* effect)
{
return new spell_mother_shahraz_saber_lash_AuraScript();
PreventDefaultAction();
if (Unit* target = GetUnitOwner()->GetVictim())
GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[effect->GetEffIndex()].TriggerSpell, true);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_mother_shahraz_saber_lash_aura::CheckProc);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mother_shahraz_saber_lash_aura::Update, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
class spell_mother_shahraz_fatal_attraction : public SpellScriptLoader
class spell_mother_shahraz_fatal_attraction : public SpellScript
{
public:
spell_mother_shahraz_fatal_attraction() : SpellScriptLoader("spell_mother_shahraz_fatal_attraction") { }
PrepareSpellScript(spell_mother_shahraz_fatal_attraction);
class spell_mother_shahraz_fatal_attraction_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareSpellScript(spell_mother_shahraz_fatal_attraction_SpellScript);
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(Acore::UnitAuraCheck(true, SPELL_SABER_LASH_IMMUNITY));
if (targets.size() <= 1)
FinishCast(SPELL_FAILED_DONT_REPORT);
}
void SetDest(SpellDestination& dest)
{
std::list<TargetInfo> const* targetsInfo = GetSpell()->GetUniqueTargetInfo();
for (std::list<TargetInfo>::const_iterator ihit = targetsInfo->begin(); ihit != targetsInfo->end(); ++ihit)
if (Unit* target = ObjectAccessor::GetUnit(*GetCaster(), ihit->targetGUID))
{
dest.Relocate(*target);
if (roll_chance_i(50))
break;
}
}
void HandleTeleportUnits(SpellEffIndex /*effIndex*/)
{
if (Unit* target = GetHitUnit())
GetCaster()->CastSpell(target, SPELL_FATAL_ATTRACTION_AURA, true);
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mother_shahraz_fatal_attraction_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_mother_shahraz_fatal_attraction_SpellScript::SetDest, EFFECT_1, TARGET_DEST_CASTER_RANDOM);
OnEffectHitTarget += SpellEffectFn(spell_mother_shahraz_fatal_attraction_SpellScript::HandleTeleportUnits, EFFECT_1, SPELL_EFFECT_TELEPORT_UNITS);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_mother_shahraz_fatal_attraction_SpellScript();
return ValidateSpellInfo({ SPELL_FATAL_ATTRACTION_AURA });
}
};
class spell_mother_shahraz_fatal_attraction_dummy : public SpellScriptLoader
{
public:
spell_mother_shahraz_fatal_attraction_dummy() : SpellScriptLoader("spell_mother_shahraz_fatal_attraction_dummy") { }
class spell_mother_shahraz_fatal_attraction_dummy_SpellScript : public SpellScript
void FilterTargets(std::list<WorldObject*>& targets)
{
PrepareSpellScript(spell_mother_shahraz_fatal_attraction_dummy_SpellScript);
targets.remove_if(Acore::UnitAuraCheck(true, SPELL_SABER_LASH_IMMUNITY));
if (targets.size() <= 1)
FinishCast(SPELL_FAILED_DONT_REPORT);
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (Unit* target = GetHitUnit())
void SetDest(SpellDestination& dest)
{
std::list<TargetInfo> const* targetsInfo = GetSpell()->GetUniqueTargetInfo();
for (std::list<TargetInfo>::const_iterator ihit = targetsInfo->begin(); ihit != targetsInfo->end(); ++ihit)
if (Unit* target = ObjectAccessor::GetUnit(*GetCaster(), ihit->targetGUID))
{
target->CastSpell(target, SPELL_FATAL_ATTRACTION_DAMAGE, true);
if (AuraEffect* aurEff = target->GetAuraEffect(SPELL_FATAL_ATTRACTION_AURA, EFFECT_1))
aurEff->SetAmount(aurEff->GetTickNumber());
dest.Relocate(*target);
if (roll_chance_i(50))
break;
}
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_mother_shahraz_fatal_attraction_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const override
void HandleTeleportUnits(SpellEffIndex /*effIndex*/)
{
return new spell_mother_shahraz_fatal_attraction_dummy_SpellScript();
if (Unit* target = GetHitUnit())
GetCaster()->CastSpell(target, SPELL_FATAL_ATTRACTION_AURA, true);
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mother_shahraz_fatal_attraction::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_mother_shahraz_fatal_attraction::SetDest, EFFECT_1, TARGET_DEST_CASTER_RANDOM);
OnEffectHitTarget += SpellEffectFn(spell_mother_shahraz_fatal_attraction::HandleTeleportUnits, EFFECT_1, SPELL_EFFECT_TELEPORT_UNITS);
}
};
class spell_mother_shahraz_fatal_attraction_aura : public SpellScriptLoader
class spell_mother_shahraz_fatal_attraction_dummy : public SpellScript
{
public:
spell_mother_shahraz_fatal_attraction_aura() : SpellScriptLoader("spell_mother_shahraz_fatal_attraction_aura") { }
PrepareSpellScript(spell_mother_shahraz_fatal_attraction_dummy);
class spell_mother_shahraz_fatal_attraction_aura_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_mother_shahraz_fatal_attraction_aura_AuraScript);
return ValidateSpellInfo({ SPELL_FATAL_ATTRACTION_DAMAGE });
}
void Update(AuraEffect const* effect)
{
if (effect->GetTickNumber() > uint32(effect->GetAmount() + 1))
{
PreventDefaultAction();
SetDuration(0);
}
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mother_shahraz_fatal_attraction_aura_AuraScript::Update, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
void HandleDummy(SpellEffIndex /*effIndex*/)
{
return new spell_mother_shahraz_fatal_attraction_aura_AuraScript();
if (Unit* target = GetHitUnit())
{
target->CastSpell(target, SPELL_FATAL_ATTRACTION_DAMAGE, true);
if (AuraEffect* aurEff = target->GetAuraEffect(SPELL_FATAL_ATTRACTION_AURA, EFFECT_1))
aurEff->SetAmount(aurEff->GetTickNumber());
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_mother_shahraz_fatal_attraction_dummy::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
class spell_mother_shahraz_fatal_attraction_aura : public AuraScript
{
PrepareAuraScript(spell_mother_shahraz_fatal_attraction_aura);
void Update(AuraEffect const* effect)
{
if (effect->GetTickNumber() > uint32(effect->GetAmount() + 1))
{
PreventDefaultAction();
SetDuration(0);
}
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mother_shahraz_fatal_attraction_aura::Update, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
void AddSC_boss_mother_shahraz()
{
new boss_mother_shahraz();
new spell_mother_shahraz_random_periodic();
new spell_mother_shahraz_beam_periodic();
new spell_mother_shahraz_saber_lash();
new spell_mother_shahraz_fatal_attraction();
new spell_mother_shahraz_fatal_attraction_dummy();
new spell_mother_shahraz_fatal_attraction_aura();
RegisterSpellScript(spell_mother_shahraz_random_periodic_aura);
RegisterSpellScript(spell_mother_shahraz_beam_periodic_aura);
RegisterSpellScript(spell_mother_shahraz_saber_lash_aura);
RegisterSpellScript(spell_mother_shahraz_fatal_attraction);
RegisterSpellScript(spell_mother_shahraz_fatal_attraction_dummy);
RegisterSpellScript(spell_mother_shahraz_fatal_attraction_aura);
}

View File

@@ -582,200 +582,155 @@ public:
};
};
class spell_reliquary_of_souls_aura_of_suffering : public SpellScriptLoader
class spell_reliquary_of_souls_aura_of_suffering_aura : public AuraScript
{
public:
spell_reliquary_of_souls_aura_of_suffering() : SpellScriptLoader("spell_reliquary_of_souls_aura_of_suffering") { }
PrepareAuraScript(spell_reliquary_of_souls_aura_of_suffering_aura);
class spell_reliquary_of_souls_aura_of_suffering_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_reliquary_of_souls_aura_of_suffering_AuraScript)
return ValidateSpellInfo({ SPELL_AURA_OF_SUFFERING_TRIGGER });
}
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetTarget()->CastSpell(GetTarget(), SPELL_AURA_OF_SUFFERING_TRIGGER, true);
}
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetTarget()->RemoveAurasDueToSpell(SPELL_AURA_OF_SUFFERING_TRIGGER);
}
void Register() override
{
OnEffectApply += AuraEffectApplyFn(spell_reliquary_of_souls_aura_of_suffering_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_MOD_HEALING_PCT, AURA_EFFECT_HANDLE_REAL);
OnEffectRemove += AuraEffectRemoveFn(spell_reliquary_of_souls_aura_of_suffering_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_MOD_HEALING_PCT, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
return new spell_reliquary_of_souls_aura_of_suffering_AuraScript();
GetTarget()->CastSpell(GetTarget(), SPELL_AURA_OF_SUFFERING_TRIGGER, true);
}
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetTarget()->RemoveAurasDueToSpell(SPELL_AURA_OF_SUFFERING_TRIGGER);
}
void Register() override
{
OnEffectApply += AuraEffectApplyFn(spell_reliquary_of_souls_aura_of_suffering_aura::HandleEffectApply, EFFECT_0, SPELL_AURA_MOD_HEALING_PCT, AURA_EFFECT_HANDLE_REAL);
OnEffectRemove += AuraEffectRemoveFn(spell_reliquary_of_souls_aura_of_suffering_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_MOD_HEALING_PCT, AURA_EFFECT_HANDLE_REAL);
}
};
class spell_reliquary_of_souls_fixate : public SpellScriptLoader
class spell_reliquary_of_souls_fixate : public SpellScript
{
public:
spell_reliquary_of_souls_fixate() : SpellScriptLoader("spell_reliquary_of_souls_fixate") { }
PrepareSpellScript(spell_reliquary_of_souls_fixate);
class spell_reliquary_of_souls_fixate_SpellScript : public SpellScript
void FilterTargets(std::list<WorldObject*>& targets)
{
PrepareSpellScript(spell_reliquary_of_souls_fixate_SpellScript);
if (targets.empty())
return;
void FilterTargets(std::list<WorldObject*>& targets)
{
if (targets.empty())
return;
targets.sort(Acore::ObjectDistanceOrderPred(GetCaster()));
WorldObject* target = targets.front();
targets.clear();
targets.push_back(target);
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_reliquary_of_souls_fixate_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_reliquary_of_souls_fixate_SpellScript();
targets.sort(Acore::ObjectDistanceOrderPred(GetCaster()));
WorldObject* target = targets.front();
targets.clear();
targets.push_back(target);
}
class spell_reliquary_of_souls_fixate_AuraScript : public AuraScript
void Register() override
{
PrepareAuraScript(spell_reliquary_of_souls_fixate_AuraScript)
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Unit* caster = GetCaster())
caster->RemoveAurasDueToSpell(GetSpellInfo()->Effects[EFFECT_1].TriggerSpell, GetTarget()->GetGUID());
}
void Register() override
{
OnEffectRemove += AuraEffectRemoveFn(spell_reliquary_of_souls_fixate_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_reliquary_of_souls_fixate_AuraScript();
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_reliquary_of_souls_fixate::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
class spell_reliquary_of_souls_aura_of_desire : public SpellScriptLoader
class spell_reliquary_of_souls_fixate_aura : public AuraScript
{
public:
spell_reliquary_of_souls_aura_of_desire() : SpellScriptLoader("spell_reliquary_of_souls_aura_of_desire") { }
PrepareAuraScript(spell_reliquary_of_souls_fixate_aura);
class spell_reliquary_of_souls_aura_of_desire_AuraScript : public AuraScript
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
PrepareAuraScript(spell_reliquary_of_souls_aura_of_desire_AuraScript);
if (Unit* caster = GetCaster())
caster->RemoveAurasDueToSpell(GetSpellInfo()->Effects[EFFECT_1].TriggerSpell, GetTarget()->GetGUID());
}
bool CheckProc(ProcEventInfo& eventInfo)
{
return eventInfo.GetActor() && eventInfo.GetActionTarget();
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
eventInfo.GetActionTarget()->CastCustomSpell(SPELL_AURA_OF_DESIRE_DAMAGE, SPELLVALUE_BASE_POINT0, eventInfo.GetDamageInfo()->GetDamage() / 2, eventInfo.GetActor(), true);
}
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
{
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_2))
amount = std::max<int32>(-100, -5 * int32(effect->GetTickNumber()));
}
void Update(AuraEffect const* /*effect*/)
{
PreventDefaultAction();
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_1))
effect->RecalculateAmount();
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_reliquary_of_souls_aura_of_desire_AuraScript::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_reliquary_of_souls_aura_of_desire_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_MOD_HEALING_PCT);
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_reliquary_of_souls_aura_of_desire_AuraScript::CalculateAmount, EFFECT_1, SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_reliquary_of_souls_aura_of_desire_AuraScript::Update, EFFECT_2, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
void Register() override
{
return new spell_reliquary_of_souls_aura_of_desire_AuraScript();
OnEffectRemove += AuraEffectRemoveFn(spell_reliquary_of_souls_fixate_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
class spell_reliquary_of_souls_aura_of_anger : public SpellScriptLoader
class spell_reliquary_of_souls_aura_of_desire_aura : public AuraScript
{
public:
spell_reliquary_of_souls_aura_of_anger() : SpellScriptLoader("spell_reliquary_of_souls_aura_of_anger") { }
PrepareAuraScript(spell_reliquary_of_souls_aura_of_desire_aura);
class spell_reliquary_of_souls_aura_of_anger_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_reliquary_of_souls_aura_of_anger_AuraScript);
return ValidateSpellInfo({ SPELL_AURA_OF_DESIRE_DAMAGE });
}
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
{
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_0))
amount = amount * effect->GetTickNumber();
}
void Update(AuraEffect const* /*effect*/)
{
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_0))
effect->RecalculateAmount();
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_1))
effect->RecalculateAmount();
}
void Register() override
{
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_reliquary_of_souls_aura_of_anger_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_reliquary_of_souls_aura_of_anger_AuraScript::CalculateAmount, EFFECT_1, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_reliquary_of_souls_aura_of_anger_AuraScript::Update, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
}
};
AuraScript* GetAuraScript() const override
bool CheckProc(ProcEventInfo& eventInfo)
{
return new spell_reliquary_of_souls_aura_of_anger_AuraScript();
return eventInfo.GetActor() && eventInfo.GetActionTarget();
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
eventInfo.GetActionTarget()->CastCustomSpell(SPELL_AURA_OF_DESIRE_DAMAGE, SPELLVALUE_BASE_POINT0, eventInfo.GetDamageInfo()->GetDamage() / 2, eventInfo.GetActor(), true);
}
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
{
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_2))
amount = std::max<int32>(-100, -5 * int32(effect->GetTickNumber()));
}
void Update(AuraEffect const* /*effect*/)
{
PreventDefaultAction();
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_1))
effect->RecalculateAmount();
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_reliquary_of_souls_aura_of_desire_aura::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_reliquary_of_souls_aura_of_desire_aura::HandleProc, EFFECT_0, SPELL_AURA_MOD_HEALING_PCT);
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_reliquary_of_souls_aura_of_desire_aura::CalculateAmount, EFFECT_1, SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_reliquary_of_souls_aura_of_desire_aura::Update, EFFECT_2, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
class spell_reliquary_of_souls_spite : public SpellScriptLoader
class spell_reliquary_of_souls_aura_of_anger_aura : public AuraScript
{
public:
spell_reliquary_of_souls_spite() : SpellScriptLoader("spell_reliquary_of_souls_spite") { }
PrepareAuraScript(spell_reliquary_of_souls_aura_of_anger_aura);
class spell_reliquary_of_souls_spite_AuraScript : public AuraScript
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
{
PrepareAuraScript(spell_reliquary_of_souls_spite_AuraScript)
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_0))
amount = amount * effect->GetTickNumber();
}
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Unit* caster = GetCaster())
caster->CastSpell(GetTarget(), SPELL_SPITE_DAMAGE, true);
}
void Register() override
{
AfterEffectRemove += AuraEffectRemoveFn(spell_reliquary_of_souls_spite_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DAMAGE_IMMUNITY, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
void Update(AuraEffect const* /*effect*/)
{
return new spell_reliquary_of_souls_spite_AuraScript();
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_0))
effect->RecalculateAmount();
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_1))
effect->RecalculateAmount();
}
void Register() override
{
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_reliquary_of_souls_aura_of_anger_aura::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_reliquary_of_souls_aura_of_anger_aura::CalculateAmount, EFFECT_1, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_reliquary_of_souls_aura_of_anger_aura::Update, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
}
};
class spell_reliquary_of_souls_spite_aura : public AuraScript
{
PrepareAuraScript(spell_reliquary_of_souls_spite_aura);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_SPITE_DAMAGE });
}
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Unit* caster = GetCaster())
caster->CastSpell(GetTarget(), SPELL_SPITE_DAMAGE, true);
}
void Register() override
{
AfterEffectRemove += AuraEffectRemoveFn(spell_reliquary_of_souls_spite_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_DAMAGE_IMMUNITY, AURA_EFFECT_HANDLE_REAL);
}
};
@@ -785,10 +740,10 @@ void AddSC_boss_reliquary_of_souls()
new boss_essence_of_suffering();
new boss_essence_of_desire();
new boss_essence_of_anger();
new spell_reliquary_of_souls_aura_of_suffering();
new spell_reliquary_of_souls_fixate();
new spell_reliquary_of_souls_aura_of_desire();
new spell_reliquary_of_souls_aura_of_anger();
new spell_reliquary_of_souls_spite();
RegisterSpellScript(spell_reliquary_of_souls_aura_of_suffering_aura);
RegisterSpellAndAuraScriptPair(spell_reliquary_of_souls_fixate, spell_reliquary_of_souls_fixate_aura);
RegisterSpellScript(spell_reliquary_of_souls_aura_of_desire_aura);
RegisterSpellScript(spell_reliquary_of_souls_aura_of_anger_aura);
RegisterSpellScript(spell_reliquary_of_souls_spite_aura);
}

View File

@@ -556,191 +556,141 @@ public:
};
};
class spell_illidari_council_balance_of_power : public SpellScriptLoader
class spell_illidari_council_balance_of_power_aura : public AuraScript
{
public:
spell_illidari_council_balance_of_power() : SpellScriptLoader("spell_illidari_council_balance_of_power") { }
PrepareAuraScript(spell_illidari_council_balance_of_power_aura);
class spell_illidari_council_balance_of_power_AuraScript : public AuraScript
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
{
PrepareAuraScript(spell_illidari_council_balance_of_power_AuraScript);
// Set absorbtion amount to unlimited (no absorb)
amount = -1;
}
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
{
// Set absorbtion amount to unlimited (no absorb)
amount = -1;
}
void Register() override
{
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_illidari_council_balance_of_power_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
}
};
AuraScript* GetAuraScript() const override
void Register() override
{
return new spell_illidari_council_balance_of_power_AuraScript();
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_illidari_council_balance_of_power_aura::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
}
};
class spell_illidari_council_empyreal_balance : public SpellScriptLoader
class spell_illidari_council_empyreal_balance : public SpellScript
{
public:
spell_illidari_council_empyreal_balance() : SpellScriptLoader("spell_illidari_council_empyreal_balance") { }
PrepareSpellScript(spell_illidari_council_empyreal_balance);
class spell_illidari_council_empyreal_balance_SpellScript : public SpellScript
bool Load() override
{
PrepareSpellScript(spell_illidari_council_empyreal_balance_SpellScript);
_sharedHealth = 0;
_sharedHealthMax = 0;
_targetCount = 0;
return GetCaster()->GetTypeId() == TYPEID_UNIT;
}
bool Load() override
void HandleDummy(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
if (Unit* target = GetHitUnit())
{
_sharedHealth = 0;
_sharedHealthMax = 0;
_targetCount = 0;
return GetCaster()->GetTypeId() == TYPEID_UNIT;
_targetCount++;
_sharedHealth += target->GetHealth();
_sharedHealthMax += target->GetMaxHealth();
}
}
void HandleAfterCast()
{
if (_targetCount != 4)
{
GetCaster()->ToCreature()->AI()->EnterEvadeMode();
return;
}
void HandleDummy(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
if (Unit* target = GetHitUnit())
float pct = (_sharedHealth / _sharedHealthMax) * 100.0f;
std::list<TargetInfo> const* targetsInfo = GetSpell()->GetUniqueTargetInfo();
for (std::list<TargetInfo>::const_iterator ihit = targetsInfo->begin(); ihit != targetsInfo->end(); ++ihit)
if (Creature* target = ObjectAccessor::GetCreature(*GetCaster(), ihit->targetGUID))
{
_targetCount++;
_sharedHealth += target->GetHealth();
_sharedHealthMax += target->GetMaxHealth();
target->LowerPlayerDamageReq(target->GetMaxHealth());
target->SetHealth(CalculatePct(target->GetMaxHealth(), pct));
}
}
}
void HandleAfterCast()
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_illidari_council_empyreal_balance::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
AfterCast += SpellCastFn(spell_illidari_council_empyreal_balance::HandleAfterCast);
}
private:
float _sharedHealth;
float _sharedHealthMax;
uint8 _targetCount;
};
class spell_illidari_council_reflective_shield_aura : public AuraScript
{
PrepareAuraScript(spell_illidari_council_reflective_shield_aura);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_REFLECTIVE_SHIELD_T });
}
void ReflectDamage(AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount)
{
Unit* target = GetTarget();
if (dmgInfo.GetAttacker() == target)
return;
int32 bp = absorbAmount / 2;
target->CastCustomSpell(dmgInfo.GetAttacker(), SPELL_REFLECTIVE_SHIELD_T, &bp, nullptr, nullptr, true, nullptr, aurEff);
}
void Register() override
{
AfterEffectAbsorb += AuraEffectAbsorbFn(spell_illidari_council_reflective_shield_aura::ReflectDamage, EFFECT_0);
}
};
class spell_illidari_council_judgement : public SpellScript
{
PrepareSpellScript(spell_illidari_council_judgement);
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
{
Unit::AuraEffectList const& auras = GetCaster()->GetAuraEffectsByType(SPELL_AURA_DUMMY);
for (Unit::AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
{
if (_targetCount != 4)
{
GetCaster()->ToCreature()->AI()->EnterEvadeMode();
return;
}
float pct = (_sharedHealth / _sharedHealthMax) * 100.0f;
std::list<TargetInfo> const* targetsInfo = GetSpell()->GetUniqueTargetInfo();
for (std::list<TargetInfo>::const_iterator ihit = targetsInfo->begin(); ihit != targetsInfo->end(); ++ihit)
if (Creature* target = ObjectAccessor::GetCreature(*GetCaster(), ihit->targetGUID))
if ((*i)->GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_SEAL && (*i)->GetEffIndex() == EFFECT_2)
if (sSpellMgr->GetSpellInfo((*i)->GetAmount()))
{
target->LowerPlayerDamageReq(target->GetMaxHealth());
target->SetHealth(CalculatePct(target->GetMaxHealth(), pct));
GetCaster()->CastSpell(GetHitUnit(), (*i)->GetAmount(), true);
break;
}
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_illidari_council_empyreal_balance_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
AfterCast += SpellCastFn(spell_illidari_council_empyreal_balance_SpellScript::HandleAfterCast);
}
private:
float _sharedHealth;
float _sharedHealthMax;
uint8 _targetCount;
};
SpellScript* GetSpellScript() const override
void Register() override
{
return new spell_illidari_council_empyreal_balance_SpellScript();
OnEffectHitTarget += SpellEffectFn(spell_illidari_council_judgement::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
class spell_illidari_council_reflective_shield : public SpellScriptLoader
class spell_illidari_council_deadly_strike_aura : public AuraScript
{
public:
spell_illidari_council_reflective_shield() : SpellScriptLoader("spell_illidari_council_reflective_shield") { }
PrepareAuraScript(spell_illidari_council_deadly_strike_aura);
class spell_illidari_council_reflective_shield_AuraScript : public AuraScript
void Update(AuraEffect const* effect)
{
PrepareAuraScript(spell_illidari_council_reflective_shield_AuraScript);
void ReflectDamage(AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount)
PreventDefaultAction();
if (Unit* target = GetUnitOwner()->GetAI()->SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
{
Unit* target = GetTarget();
if (dmgInfo.GetAttacker() == target)
return;
int32 bp = absorbAmount / 2;
target->CastCustomSpell(dmgInfo.GetAttacker(), SPELL_REFLECTIVE_SHIELD_T, &bp, nullptr, nullptr, true, nullptr, aurEff);
GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[effect->GetEffIndex()].TriggerSpell, true);
GetUnitOwner()->m_Events.AddEvent(new VerasEnvenom(*GetUnitOwner(), target->GetGUID()), GetUnitOwner()->m_Events.CalculateTime(urand(1500, 3500)));
}
void Register() override
{
AfterEffectAbsorb += AuraEffectAbsorbFn(spell_illidari_council_reflective_shield_AuraScript::ReflectDamage, EFFECT_0);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_illidari_council_reflective_shield_AuraScript();
}
};
class spell_illidari_council_judgement : public SpellScriptLoader
{
public:
spell_illidari_council_judgement() : SpellScriptLoader("spell_illidari_council_judgement") { }
class spell_illidari_council_judgement_SpellScript : public SpellScript
void Register() override
{
PrepareSpellScript(spell_illidari_council_judgement_SpellScript);
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
{
Unit::AuraEffectList const& auras = GetCaster()->GetAuraEffectsByType(SPELL_AURA_DUMMY);
for (Unit::AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
{
if ((*i)->GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_SEAL && (*i)->GetEffIndex() == EFFECT_2)
if (sSpellMgr->GetSpellInfo((*i)->GetAmount()))
{
GetCaster()->CastSpell(GetHitUnit(), (*i)->GetAmount(), true);
break;
}
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_illidari_council_judgement_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_illidari_council_judgement_SpellScript();
}
};
class spell_illidari_council_deadly_strike : public SpellScriptLoader
{
public:
spell_illidari_council_deadly_strike() : SpellScriptLoader("spell_illidari_council_deadly_strike") { }
class spell_illidari_council_deadly_strike_AuraScript : public AuraScript
{
PrepareAuraScript(spell_illidari_council_deadly_strike_AuraScript);
void Update(AuraEffect const* effect)
{
PreventDefaultAction();
if (Unit* target = GetUnitOwner()->GetAI()->SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
{
GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[effect->GetEffIndex()].TriggerSpell, true);
GetUnitOwner()->m_Events.AddEvent(new VerasEnvenom(*GetUnitOwner(), target->GetGUID()), GetUnitOwner()->m_Events.CalculateTime(urand(1500, 3500)));
}
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_illidari_council_deadly_strike_AuraScript::Update, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_illidari_council_deadly_strike_AuraScript();
OnEffectPeriodic += AuraEffectPeriodicFn(spell_illidari_council_deadly_strike_aura::Update, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
@@ -751,10 +701,10 @@ void AddSC_boss_illidari_council()
new boss_lady_malande();
new boss_veras_darkshadow();
new boss_high_nethermancer_zerevor();
new spell_illidari_council_balance_of_power();
new spell_illidari_council_empyreal_balance();
new spell_illidari_council_reflective_shield();
new spell_illidari_council_judgement();
new spell_illidari_council_deadly_strike();
RegisterSpellScript(spell_illidari_council_balance_of_power_aura);
RegisterSpellScript(spell_illidari_council_empyreal_balance);
RegisterSpellScript(spell_illidari_council_reflective_shield_aura);
RegisterSpellScript(spell_illidari_council_judgement);
RegisterSpellScript(spell_illidari_council_deadly_strike_aura);
}

View File

@@ -188,402 +188,290 @@ public:
}
};
class spell_black_template_harpooners_mark : public SpellScriptLoader
class spell_black_template_harpooners_mark_aura : public AuraScript
{
public:
spell_black_template_harpooners_mark() : SpellScriptLoader("spell_black_template_harpooners_mark") { }
PrepareAuraScript(spell_black_template_harpooners_mark_aura);
class spell_black_template_harpooners_mark_AuraScript : public AuraScript
bool Load() override
{
PrepareAuraScript(spell_black_template_harpooners_mark_AuraScript)
_turtleSet.clear();
return true;
}
bool Load() override
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
std::list<Creature*> creatureList;
GetUnitOwner()->GetCreaturesWithEntryInRange(creatureList, 80.0f, NPC_DRAGON_TURTLE);
for (std::list<Creature*>::const_iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)
{
_turtleSet.clear();
return true;
(*itr)->TauntApply(GetUnitOwner());
(*itr)->AddThreat(GetUnitOwner(), 10000000.0f);
_turtleSet.insert((*itr)->GetGUID());
}
}
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
std::list<Creature*> creatureList;
GetUnitOwner()->GetCreaturesWithEntryInRange(creatureList, 80.0f, NPC_DRAGON_TURTLE);
for (std::list<Creature*>::const_iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
for (ObjectGuid const& guid : _turtleSet)
if (Creature* turtle = ObjectAccessor::GetCreature(*GetUnitOwner(), guid))
{
(*itr)->TauntApply(GetUnitOwner());
(*itr)->AddThreat(GetUnitOwner(), 10000000.0f);
_turtleSet.insert((*itr)->GetGUID());
turtle->TauntFadeOut(GetUnitOwner());
turtle->AddThreat(GetUnitOwner(), -10000000.0f);
}
}
}
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
for (ObjectGuid const& guid : _turtleSet)
if (Creature* turtle = ObjectAccessor::GetCreature(*GetUnitOwner(), guid))
{
turtle->TauntFadeOut(GetUnitOwner());
turtle->AddThreat(GetUnitOwner(), -10000000.0f);
}
}
void Register() override
{
OnEffectApply += AuraEffectApplyFn(spell_black_template_harpooners_mark_AuraScript::HandleEffectApply, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
OnEffectRemove += AuraEffectRemoveFn(spell_black_template_harpooners_mark_AuraScript::HandleEffectRemove, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
private:
GuidSet _turtleSet;
};
AuraScript* GetAuraScript() const override
void Register() override
{
return new spell_black_template_harpooners_mark_AuraScript();
OnEffectApply += AuraEffectApplyFn(spell_black_template_harpooners_mark_aura::HandleEffectApply, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
OnEffectRemove += AuraEffectRemoveFn(spell_black_template_harpooners_mark_aura::HandleEffectRemove, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
private:
GuidSet _turtleSet;
};
class spell_black_template_free_friend : public SpellScript
{
PrepareSpellScript(spell_black_template_free_friend);
void HandleScriptEffect(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
if (Unit* target = GetHitUnit())
target->RemoveAurasWithMechanic(IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_black_template_free_friend::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
class spell_black_template_free_friend : public SpellScriptLoader
class spell_black_temple_curse_of_the_bleakheart_aura : public AuraScript
{
public:
spell_black_template_free_friend() : SpellScriptLoader("spell_black_template_free_friend") { }
PrepareAuraScript(spell_black_temple_curse_of_the_bleakheart_aura);
class spell_black_template_free_friend_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareSpellScript(spell_black_template_free_friend_SpellScript);
return ValidateSpellInfo({ SPELL_CHEST_PAINS });
}
void HandleScriptEffect(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
if (Unit* target = GetHitUnit())
target->RemoveAurasWithMechanic(IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_black_template_free_friend_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
void CalcPeriodic(AuraEffect const* /*effect*/, bool& isPeriodic, int32& amplitude)
{
return new spell_black_template_free_friend_SpellScript();
isPeriodic = true;
amplitude = 5000;
}
void Update(AuraEffect const* /*effect*/)
{
PreventDefaultAction();
if (roll_chance_i(20))
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_CHEST_PAINS, true);
}
void Register() override
{
DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_black_temple_curse_of_the_bleakheart_aura::CalcPeriodic, EFFECT_0, SPELL_AURA_DUMMY);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_curse_of_the_bleakheart_aura::Update, EFFECT_0, SPELL_AURA_DUMMY);
}
};
class spell_black_temple_curse_of_the_bleakheart : public SpellScriptLoader
class spell_black_temple_skeleton_shot_aura : public AuraScript
{
public:
spell_black_temple_curse_of_the_bleakheart() : SpellScriptLoader("spell_black_temple_curse_of_the_bleakheart") { }
PrepareAuraScript(spell_black_temple_skeleton_shot_aura);
class spell_black_temple_curse_of_the_bleakheart_AuraScript : public AuraScript
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
PrepareAuraScript(spell_black_temple_curse_of_the_bleakheart_AuraScript);
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEATH)
GetTarget()->CastSpell(GetTarget(), GetSpellInfo()->Effects[EFFECT_2].CalcValue(), true);
}
void CalcPeriodic(AuraEffect const* /*effect*/, bool& isPeriodic, int32& amplitude)
{
isPeriodic = true;
amplitude = 5000;
}
void Update(AuraEffect const* /*effect*/)
{
PreventDefaultAction();
if (roll_chance_i(20))
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_CHEST_PAINS, true);
}
void Register() override
{
DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_black_temple_curse_of_the_bleakheart_AuraScript::CalcPeriodic, EFFECT_0, SPELL_AURA_DUMMY);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_curse_of_the_bleakheart_AuraScript::Update, EFFECT_0, SPELL_AURA_DUMMY);
}
};
AuraScript* GetAuraScript() const override
void Register() override
{
return new spell_black_temple_curse_of_the_bleakheart_AuraScript();
AfterEffectRemove += AuraEffectRemoveFn(spell_black_temple_skeleton_shot_aura::HandleEffectRemove, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
}
};
class spell_black_temple_skeleton_shot : public SpellScriptLoader
class spell_black_temple_wyvern_sting_aura : public AuraScript
{
public:
spell_black_temple_skeleton_shot() : SpellScriptLoader("spell_black_temple_skeleton_shot") { }
PrepareAuraScript(spell_black_temple_wyvern_sting_aura);
class spell_black_temple_skeleton_shot_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_black_temple_skeleton_shot_AuraScript)
return ValidateSpellInfo({ SPELL_WYVERN_STING });
}
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEATH)
GetTarget()->CastSpell(GetTarget(), GetSpellInfo()->Effects[EFFECT_2].CalcValue(), true);
}
void Register() override
{
AfterEffectRemove += AuraEffectRemoveFn(spell_black_temple_skeleton_shot_AuraScript::HandleEffectRemove, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
return new spell_black_temple_skeleton_shot_AuraScript();
if (Unit* caster = GetCaster())
caster->CastSpell(GetTarget(), SPELL_WYVERN_STING, true);
}
void Register() override
{
AfterEffectRemove += AuraEffectRemoveFn(spell_black_temple_wyvern_sting_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL);
}
};
class spell_black_temple_wyvern_sting : public SpellScriptLoader
class spell_black_temple_charge_rage_aura : public AuraScript
{
public:
spell_black_temple_wyvern_sting() : SpellScriptLoader("spell_black_temple_wyvern_sting") { }
PrepareAuraScript(spell_black_temple_charge_rage_aura);
class spell_black_temple_wyvern_sting_AuraScript : public AuraScript
void Update(AuraEffect const* effect)
{
PrepareAuraScript(spell_black_temple_wyvern_sting_AuraScript)
PreventDefaultAction();
if (Unit* target = GetUnitOwner()->SelectNearbyNoTotemTarget((Unit*)nullptr, 50.0f))
GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[effect->GetEffIndex()].TriggerSpell, true);
}
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Unit* caster = GetCaster())
caster->CastSpell(GetTarget(), SPELL_WYVERN_STING, true);
}
void Register() override
{
AfterEffectRemove += AuraEffectRemoveFn(spell_black_temple_wyvern_sting_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
void Register() override
{
return new spell_black_temple_wyvern_sting_AuraScript();
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_charge_rage_aura::Update, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
class spell_black_temple_charge_rage : public SpellScriptLoader
class spell_black_temple_shadow_inferno_aura : public AuraScript
{
public:
spell_black_temple_charge_rage() : SpellScriptLoader("spell_black_temple_charge_rage") { }
PrepareAuraScript(spell_black_temple_shadow_inferno_aura);
class spell_black_temple_charge_rage_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_black_temple_charge_rage_AuraScript);
return ValidateSpellInfo({ SPELL_SHADOW_INFERNO_DAMAGE });
}
void Update(AuraEffect const* effect)
{
PreventDefaultAction();
if (Unit* target = GetUnitOwner()->SelectNearbyNoTotemTarget((Unit*)nullptr, 50.0f))
GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[effect->GetEffIndex()].TriggerSpell, true);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_charge_rage_AuraScript::Update, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
void Update(AuraEffect const* effect)
{
return new spell_black_temple_charge_rage_AuraScript();
PreventDefaultAction();
GetUnitOwner()->CastCustomSpell(SPELL_SHADOW_INFERNO_DAMAGE, SPELLVALUE_BASE_POINT0, effect->GetAmount(), GetUnitOwner(), TRIGGERED_FULL_MASK);
GetAura()->GetEffect(effect->GetEffIndex())->SetAmount(effect->GetAmount() + 500);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_shadow_inferno_aura::Update, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
class spell_black_temple_shadow_inferno : public SpellScriptLoader
class spell_black_temple_spell_absorption_aura : public AuraScript
{
public:
spell_black_temple_shadow_inferno() : SpellScriptLoader("spell_black_temple_shadow_inferno") { }
PrepareAuraScript(spell_black_temple_spell_absorption_aura);
class spell_black_temple_shadow_inferno_AuraScript : public AuraScript
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
{
PrepareAuraScript(spell_black_temple_shadow_inferno_AuraScript);
// Set absorbtion amount to unlimited
amount = -1;
}
void Update(AuraEffect const* effect)
{
PreventDefaultAction();
GetUnitOwner()->CastCustomSpell(SPELL_SHADOW_INFERNO_DAMAGE, SPELLVALUE_BASE_POINT0, effect->GetAmount(), GetUnitOwner(), TRIGGERED_FULL_MASK);
GetAura()->GetEffect(effect->GetEffIndex())->SetAmount(effect->GetAmount() + 500);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_shadow_inferno_AuraScript::Update, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
void Absorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
{
return new spell_black_temple_shadow_inferno_AuraScript();
absorbAmount = dmgInfo.GetDamage();
}
void Update(AuraEffect const* effect)
{
PreventDefaultAction();
uint32 count = GetUnitOwner()->GetAuraCount(SPELL_CHAOTIC_CHARGE);
if (count == 0)
return;
GetUnitOwner()->CastCustomSpell(GetSpellInfo()->Effects[effect->GetEffIndex()].TriggerSpell, SPELLVALUE_BASE_POINT0, effect->GetAmount()*count, GetUnitOwner(), TRIGGERED_FULL_MASK);
GetUnitOwner()->RemoveAurasDueToSpell(SPELL_CHAOTIC_CHARGE);
}
void Register() override
{
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_black_temple_spell_absorption_aura::CalculateAmount, EFFECT_2, SPELL_AURA_SCHOOL_ABSORB);
OnEffectAbsorb += AuraEffectAbsorbFn(spell_black_temple_spell_absorption_aura::Absorb, EFFECT_2);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_spell_absorption_aura::Update, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE);
}
};
class spell_black_temple_spell_absorption : public SpellScriptLoader
class spell_black_temple_bloodbolt : public SpellScript
{
public:
spell_black_temple_spell_absorption() : SpellScriptLoader("spell_black_temple_spell_absorption") { }
PrepareSpellScript(spell_black_temple_bloodbolt);
class spell_black_temple_spell_absorption_AuraScript : public AuraScript
void HandleScriptEffect(SpellEffIndex effIndex)
{
PrepareAuraScript(spell_black_temple_spell_absorption_AuraScript);
PreventHitEffect(effIndex);
if (Unit* target = GetHitUnit())
GetCaster()->CastSpell(target, GetEffectValue(), true);
}
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
{
// Set absorbtion amount to unlimited
amount = -1;
}
void Absorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
{
absorbAmount = dmgInfo.GetDamage();
}
void Update(AuraEffect const* effect)
{
PreventDefaultAction();
uint32 count = GetUnitOwner()->GetAuraCount(SPELL_CHAOTIC_CHARGE);
if (count == 0)
return;
GetUnitOwner()->CastCustomSpell(GetSpellInfo()->Effects[effect->GetEffIndex()].TriggerSpell, SPELLVALUE_BASE_POINT0, effect->GetAmount()*count, GetUnitOwner(), TRIGGERED_FULL_MASK);
GetUnitOwner()->RemoveAurasDueToSpell(SPELL_CHAOTIC_CHARGE);
}
void Register() override
{
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_black_temple_spell_absorption_AuraScript::CalculateAmount, EFFECT_2, SPELL_AURA_SCHOOL_ABSORB);
OnEffectAbsorb += AuraEffectAbsorbFn(spell_black_temple_spell_absorption_AuraScript::Absorb, EFFECT_2);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_spell_absorption_AuraScript::Update, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE);
}
};
AuraScript* GetAuraScript() const override
void Register() override
{
return new spell_black_temple_spell_absorption_AuraScript();
OnEffectHitTarget += SpellEffectFn(spell_black_temple_bloodbolt::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
class spell_black_temple_bloodbolt : public SpellScriptLoader
class spell_black_temple_consuming_strikes_aura : public AuraScript
{
public:
spell_black_temple_bloodbolt() : SpellScriptLoader("spell_black_temple_bloodbolt") { }
PrepareAuraScript(spell_black_temple_consuming_strikes_aura);
class spell_black_temple_bloodbolt_SpellScript : public SpellScript
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
{
PrepareSpellScript(spell_black_temple_bloodbolt_SpellScript);
PreventDefaultAction();
GetTarget()->CastCustomSpell(GetSpellInfo()->Effects[EFFECT_1].CalcValue(), SPELLVALUE_BASE_POINT0, eventInfo.GetDamageInfo()->GetDamage(), GetTarget(), true);
}
void HandleScriptEffect(SpellEffIndex effIndex)
{
PreventHitEffect(effIndex);
if (Unit* target = GetHitUnit())
GetCaster()->CastSpell(target, GetEffectValue(), true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_black_temple_bloodbolt_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
void Register() override
{
return new spell_black_temple_bloodbolt_SpellScript();
OnEffectProc += AuraEffectProcFn(spell_black_temple_consuming_strikes_aura::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
class spell_black_temple_consuming_strikes : public SpellScriptLoader
class spell_black_temple_curse_of_vitality_aura : public AuraScript
{
public:
spell_black_temple_consuming_strikes() : SpellScriptLoader("spell_black_temple_consuming_strikes") { }
PrepareAuraScript(spell_black_temple_curse_of_vitality_aura);
class spell_black_temple_consuming_strikes_AuraScript : public AuraScript
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
PrepareAuraScript(spell_black_temple_consuming_strikes_AuraScript);
if (GetUnitOwner()->HealthBelowPct(50))
SetDuration(0);
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
GetTarget()->CastCustomSpell(GetSpellInfo()->Effects[EFFECT_1].CalcValue(), SPELLVALUE_BASE_POINT0, eventInfo.GetDamageInfo()->GetDamage(), GetTarget(), true);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_black_temple_consuming_strikes_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
void Register() override
{
return new spell_black_temple_consuming_strikes_AuraScript();
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_curse_of_vitality_aura::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
}
};
class spell_black_temple_curse_of_vitality : public SpellScriptLoader
class spell_black_temple_dementia_aura : public AuraScript
{
public:
spell_black_temple_curse_of_vitality() : SpellScriptLoader("spell_black_temple_curse_of_vitality") { }
PrepareAuraScript(spell_black_temple_dementia_aura);
class spell_black_temple_curse_of_vitality_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_black_temple_curse_of_vitality_AuraScript);
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
if (GetUnitOwner()->HealthBelowPct(50))
SetDuration(0);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_curse_of_vitality_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_black_temple_curse_of_vitality_AuraScript();
return ValidateSpellInfo({ SPELL_DEMENTIA1, SPELL_DEMENTIA2 });
}
};
class spell_black_temple_dementia : public SpellScriptLoader
{
public:
spell_black_temple_dementia() : SpellScriptLoader("spell_black_temple_dementia") { }
class spell_black_temple_dementia_AuraScript : public AuraScript
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
PrepareAuraScript(spell_black_temple_dementia_AuraScript);
if (roll_chance_i(50))
GetTarget()->CastSpell(GetTarget(), SPELL_DEMENTIA1, true);
else
GetTarget()->CastSpell(GetTarget(), SPELL_DEMENTIA2, true);
}
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
if (roll_chance_i(50))
GetTarget()->CastSpell(GetTarget(), SPELL_DEMENTIA1, true);
else
GetTarget()->CastSpell(GetTarget(), SPELL_DEMENTIA2, true);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_dementia_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
};
AuraScript* GetAuraScript() const override
void Register() override
{
return new spell_black_temple_dementia_AuraScript();
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_dementia_aura::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
};
void AddSC_instance_black_temple()
{
new instance_black_temple();
new spell_black_template_harpooners_mark();
new spell_black_template_free_friend();
new spell_black_temple_curse_of_the_bleakheart();
new spell_black_temple_skeleton_shot();
new spell_black_temple_wyvern_sting();
new spell_black_temple_charge_rage();
new spell_black_temple_shadow_inferno();
new spell_black_temple_spell_absorption();
new spell_black_temple_bloodbolt();
new spell_black_temple_consuming_strikes();
new spell_black_temple_curse_of_vitality();
new spell_black_temple_dementia();
RegisterSpellScript(spell_black_template_harpooners_mark_aura);
RegisterSpellScript(spell_black_template_free_friend);
RegisterSpellScript(spell_black_temple_curse_of_the_bleakheart_aura);
RegisterSpellScript(spell_black_temple_skeleton_shot_aura);
RegisterSpellScript(spell_black_temple_wyvern_sting_aura);
RegisterSpellScript(spell_black_temple_charge_rage_aura);
RegisterSpellScript(spell_black_temple_shadow_inferno_aura);
RegisterSpellScript(spell_black_temple_spell_absorption_aura);
RegisterSpellScript(spell_black_temple_bloodbolt);
RegisterSpellScript(spell_black_temple_consuming_strikes_aura);
RegisterSpellScript(spell_black_temple_curse_of_vitality_aura);
RegisterSpellScript(spell_black_temple_dementia_aura);
}