Core/Spells: remove PrepareSpellScript and PrepareAuraScript macros and make Hooklist use emplace behaivior (#174)

This commit is contained in:
Warpten authored and GitHub committed 2020-08-28 15:40:26 +02:00
1 parent 677990a1b8
commit 2b2fc5fb8a
252 files changed
+3275 -7394

No files matched your search

+78 -172
View File
@@ -157,8 +157,6 @@ enum MiscSpells
// -31571 - Arcane Potency
class spell_mage_arcane_potency : public AuraScript
{
PrepareAuraScript(spell_mage_arcane_potency);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
@@ -188,7 +186,7 @@ class spell_mage_arcane_potency : public AuraScript
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_mage_arcane_potency::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
OnEffectProc.Register(&spell_mage_arcane_potency::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
@@ -205,8 +203,6 @@ class spell_mage_blast_wave : public SpellScriptLoader
class spell_mage_blast_wave_SpellScript : public SpellScript
{
PrepareSpellScript(spell_mage_blast_wave_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MAGE_FLAMESTRIKE });
@@ -235,8 +231,8 @@ class spell_mage_blast_wave : public SpellScriptLoader
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mage_blast_wave_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
AfterCast += SpellCastFn(spell_mage_blast_wave_SpellScript::HandleImprovedFlamestrike);
OnObjectAreaTargetSelect.Register(&spell_mage_blast_wave_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
AfterCast.Register(&spell_mage_blast_wave_SpellScript::HandleImprovedFlamestrike);
}
uint32 _targetCount = 0;
@@ -256,8 +252,6 @@ class spell_mage_blazing_speed : public SpellScriptLoader
class spell_mage_blazing_speed_AuraScript : public AuraScript
{
PrepareAuraScript(spell_mage_blazing_speed_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MAGE_BLAZING_SPEED });
@@ -271,7 +265,7 @@ class spell_mage_blazing_speed : public SpellScriptLoader
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_mage_blazing_speed_AuraScript::OnProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
OnEffectProc.Register(&spell_mage_blazing_speed_AuraScript::OnProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
@@ -290,8 +284,6 @@ class spell_mage_blizzard : public SpellScriptLoader
class spell_mage_blizzard_SpellScript : public SpellScript
{
PrepareSpellScript(spell_mage_blizzard_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
@@ -315,7 +307,7 @@ class spell_mage_blizzard : public SpellScriptLoader
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_mage_blizzard_SpellScript::AddChillEffect, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
OnEffectHitTarget.Register(&spell_mage_blizzard_SpellScript::AddChillEffect, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
@@ -333,8 +325,6 @@ class spell_mage_cold_snap : public SpellScriptLoader
class spell_mage_cold_snap_SpellScript : public SpellScript
{
PrepareSpellScript(spell_mage_cold_snap_SpellScript);
bool Load() override
{
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
@@ -352,7 +342,7 @@ class spell_mage_cold_snap : public SpellScriptLoader
void Register() override
{
OnEffectHit += SpellEffectFn(spell_mage_cold_snap_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
OnEffectHit.Register(&spell_mage_cold_snap_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
@@ -371,8 +361,6 @@ class spell_mage_cone_of_cold : public SpellScriptLoader
class spell_mage_cone_of_cold_SpellScript : public SpellScript
{
PrepareSpellScript(spell_mage_cone_of_cold_SpellScript);
void HandleConeOfColdScript(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
@@ -387,7 +375,7 @@ class spell_mage_cone_of_cold : public SpellScriptLoader
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_mage_cone_of_cold_SpellScript::HandleConeOfColdScript, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
OnEffectHitTarget.Register(&spell_mage_cone_of_cold_SpellScript::HandleConeOfColdScript, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
}
};
@@ -426,8 +414,6 @@ class spell_mage_conjure_refreshment : public SpellScriptLoader
class spell_mage_conjure_refreshment_SpellScript : public SpellScript
{
PrepareSpellScript(spell_mage_conjure_refreshment_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
for (uint8 i = 0; i < MAX_CONJURE_REFRESHMENT_SPELLS; ++i)
@@ -458,7 +444,7 @@ class spell_mage_conjure_refreshment : public SpellScriptLoader
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_mage_conjure_refreshment_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
OnEffectHitTarget.Register(&spell_mage_conjure_refreshment_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
@@ -471,8 +457,6 @@ class spell_mage_conjure_refreshment : public SpellScriptLoader
// -31661 - Dragon's Breath
class spell_mage_dragon_breath : public AuraScript
{
PrepareAuraScript(spell_mage_dragon_breath);
bool CheckProc(ProcEventInfo& eventInfo)
{
// Dont proc with Living Bomb explosion
@@ -484,7 +468,7 @@ class spell_mage_dragon_breath : public AuraScript
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_mage_dragon_breath::CheckProc);
DoCheckProc.Register(&spell_mage_dragon_breath::CheckProc);
}
};
@@ -496,8 +480,6 @@ class spell_mage_fire_frost_ward : public SpellScriptLoader
class spell_mage_fire_frost_ward_AuraScript : public AuraScript
{
PrepareAuraScript(spell_mage_fire_frost_ward_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MAGE_FROST_WARDING_TRIGGERED, SPELL_MAGE_FROST_WARDING_R1 });
@@ -537,8 +519,8 @@ class spell_mage_fire_frost_ward : public SpellScriptLoader
void Register() override
{
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_fire_frost_ward_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
OnEffectAbsorb += AuraEffectAbsorbFn(spell_mage_fire_frost_ward_AuraScript::Absorb, EFFECT_0);
DoEffectCalcAmount.Register(&spell_mage_fire_frost_ward_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
OnEffectAbsorb.Register(&spell_mage_fire_frost_ward_AuraScript::Absorb, EFFECT_0);
}
};
@@ -556,8 +538,6 @@ class spell_mage_focus_magic : public SpellScriptLoader
class spell_mage_focus_magic_AuraScript : public AuraScript
{
PrepareAuraScript(spell_mage_focus_magic_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MAGE_FOCUS_MAGIC_PROC });
@@ -577,8 +557,8 @@ class spell_mage_focus_magic : public SpellScriptLoader
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_mage_focus_magic_AuraScript::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_mage_focus_magic_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_MOD_SPELL_CRIT_CHANCE);
DoCheckProc.Register(&spell_mage_focus_magic_AuraScript::CheckProc);
OnEffectProc.Register(&spell_mage_focus_magic_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_MOD_SPELL_CRIT_CHANCE);
}
Unit* _procTarget = nullptr;
@@ -594,8 +574,6 @@ class spell_mage_focus_magic : public SpellScriptLoader
/// Updated 4.3.4
class spell_mage_frostbolt : public SpellScript
{
PrepareSpellScript(spell_mage_frostbolt);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
@@ -661,8 +639,8 @@ class spell_mage_frostbolt : public SpellScript
void Register() override
{
OnSpellStart += SpellCastFn(spell_mage_frostbolt::HandleEarlyFrost);
OnEffectHitTarget += SpellEffectFn(spell_mage_frostbolt::RecalculateDamage, EFFECT_1, SPELL_EFFECT_SCHOOL_DAMAGE);
OnSpellStart.Register(&spell_mage_frostbolt::HandleEarlyFrost);
OnEffectHitTarget.Register(&spell_mage_frostbolt::RecalculateDamage, EFFECT_1, SPELL_EFFECT_SCHOOL_DAMAGE);
}
private:
@@ -678,8 +656,6 @@ class spell_mage_glyph_of_ice_block : public SpellScriptLoader
class spell_mage_glyph_of_ice_block_AuraScript : public AuraScript
{
PrepareAuraScript(spell_mage_glyph_of_ice_block_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MAGE_FROST_NOVA });
@@ -699,8 +675,8 @@ class spell_mage_glyph_of_ice_block : public SpellScriptLoader
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_mage_glyph_of_ice_block_AuraScript::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_mage_glyph_of_ice_block_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY);
DoCheckProc.Register(&spell_mage_glyph_of_ice_block_AuraScript::CheckProc);
OnEffectProc.Register(&spell_mage_glyph_of_ice_block_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
@@ -718,8 +694,6 @@ class spell_mage_glyph_of_icy_veins : public SpellScriptLoader
class spell_mage_glyph_of_icy_veins_AuraScript : public AuraScript
{
PrepareAuraScript(spell_mage_glyph_of_icy_veins_AuraScript);
void HandleEffectProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
{
PreventDefaultAction();
@@ -730,7 +704,7 @@ class spell_mage_glyph_of_icy_veins : public SpellScriptLoader
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_mage_glyph_of_icy_veins_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY);
OnEffectProc.Register(&spell_mage_glyph_of_icy_veins_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
@@ -748,8 +722,6 @@ class spell_mage_glyph_of_polymorph : public SpellScriptLoader
class spell_mage_glyph_of_polymorph_AuraScript : public AuraScript
{
PrepareAuraScript(spell_mage_glyph_of_polymorph_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PRIEST_SHADOW_WORD_DEATH });
@@ -767,7 +739,7 @@ class spell_mage_glyph_of_polymorph : public SpellScriptLoader
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_mage_glyph_of_polymorph_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY);
OnEffectProc.Register(&spell_mage_glyph_of_polymorph_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
@@ -780,8 +752,6 @@ class spell_mage_glyph_of_polymorph : public SpellScriptLoader
// 44457 - Living Bomb
class spell_mage_living_bomb : public AuraScript
{
PrepareAuraScript(spell_mage_living_bomb);
bool Validate(SpellInfo const* spellInfo) override
{
return ValidateSpellInfo({ uint32(spellInfo->Effects[EFFECT_1].CalcValue()) });
@@ -798,7 +768,7 @@ class spell_mage_living_bomb : public AuraScript
void Register() override
{
AfterEffectRemove += AuraEffectRemoveFn(spell_mage_living_bomb::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove.Register(&spell_mage_living_bomb::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
@@ -811,8 +781,6 @@ class spell_mage_ice_barrier : public SpellScriptLoader
class spell_mage_ice_barrier_AuraScript : public AuraScript
{
PrepareAuraScript(spell_mage_ice_barrier_AuraScript);
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated)
{
canBeRecalculated = false;
@@ -833,9 +801,9 @@ class spell_mage_ice_barrier : public SpellScriptLoader
void Register() override
{
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_ice_barrier_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
AfterEffectRemove += AuraEffectRemoveFn(spell_mage_ice_barrier_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectRemoveFn(spell_mage_ice_barrier_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB, AURA_EFFECT_HANDLE_REAL);
DoEffectCalcAmount.Register(&spell_mage_ice_barrier_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
AfterEffectRemove.Register(&spell_mage_ice_barrier_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove.Register(&spell_mage_ice_barrier_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB, AURA_EFFECT_HANDLE_REAL);
}
};
@@ -848,8 +816,6 @@ class spell_mage_ice_barrier : public SpellScriptLoader
// -11119 - Ignite
class spell_mage_ignite : public AuraScript
{
PrepareAuraScript(spell_mage_ignite);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
@@ -894,8 +860,8 @@ class spell_mage_ignite : public AuraScript
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_mage_ignite::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_mage_ignite::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
DoCheckProc.Register(&spell_mage_ignite::CheckProc);
OnEffectProc.Register(&spell_mage_ignite::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 543 - Mage Ward
@@ -907,8 +873,6 @@ class spell_mage_mage_ward : public SpellScriptLoader
class spell_mage_mage_ward_AuraScript : public AuraScript
{
PrepareAuraScript(spell_mage_mage_ward_AuraScript);
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated)
{
canBeRecalculated = false;
@@ -931,8 +895,8 @@ class spell_mage_mage_ward : public SpellScriptLoader
void Register() override
{
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_mage_ward_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
AfterEffectAbsorb += AuraEffectAbsorbFn(spell_mage_mage_ward_AuraScript::HandleAbsorb, EFFECT_0);
DoEffectCalcAmount.Register(&spell_mage_mage_ward_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
AfterEffectAbsorb.Register(&spell_mage_mage_ward_AuraScript::HandleAbsorb, EFFECT_0);
}
};
@@ -951,8 +915,6 @@ class spell_mage_mana_shield : public SpellScriptLoader
class spell_mage_mana_shield_AuraScript : public AuraScript
{
PrepareAuraScript(spell_mage_mana_shield_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
@@ -991,9 +953,9 @@ class spell_mage_mana_shield : public SpellScriptLoader
void Register() override
{
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_mana_shield_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_MANA_SHIELD);
AfterEffectManaShield += AuraEffectManaShieldFn(spell_mage_mana_shield_AuraScript::HandleAbsorb, EFFECT_0);
AfterEffectRemove += AuraEffectRemoveFn(spell_mage_mana_shield_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_MANA_SHIELD, AURA_EFFECT_HANDLE_REAL);
DoEffectCalcAmount.Register(&spell_mage_mana_shield_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_MANA_SHIELD);
AfterEffectManaShield.Register(&spell_mage_mana_shield_AuraScript::HandleAbsorb, EFFECT_0);
AfterEffectRemove.Register(&spell_mage_mana_shield_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_MANA_SHIELD, AURA_EFFECT_HANDLE_REAL);
}
};
@@ -1006,8 +968,6 @@ class spell_mage_mana_shield : public SpellScriptLoader
// -29074 - Master of Elements
class spell_mage_master_of_elements : public AuraScript
{
PrepareAuraScript(spell_mage_master_of_elements);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MAGE_MASTER_OF_ELEMENTS_ENERGIZE });
@@ -1032,16 +992,14 @@ class spell_mage_master_of_elements : public AuraScript
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_mage_master_of_elements::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_mage_master_of_elements::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
DoCheckProc.Register(&spell_mage_master_of_elements::CheckProc);
OnEffectProc.Register(&spell_mage_master_of_elements::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// -86181 - Nether Vortex
class spell_mage_nether_vortex : public AuraScript
{
PrepareAuraScript(spell_mage_nether_vortex);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MAGE_SLOW });
@@ -1064,16 +1022,14 @@ class spell_mage_nether_vortex : public AuraScript
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_mage_nether_vortex::DoCheck);
OnEffectProc += AuraEffectProcFn(spell_mage_nether_vortex::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY);
DoCheckProc.Register(&spell_mage_nether_vortex::DoCheck);
OnEffectProc.Register(&spell_mage_nether_vortex::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// -11175 - Permafrost
class spell_mage_permafrost : public AuraScript
{
PrepareAuraScript(spell_mage_permafrost);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
@@ -1100,8 +1056,8 @@ class spell_mage_permafrost : public AuraScript
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_mage_permafrost::DoCheck);
OnEffectProc += AuraEffectProcFn(spell_mage_permafrost::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY);
DoCheckProc.Register(&spell_mage_permafrost::DoCheck);
OnEffectProc.Register(&spell_mage_permafrost::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
@@ -1113,8 +1069,6 @@ class spell_mage_polymorph : public SpellScriptLoader
class spell_mage_polymorph_AuraScript : public AuraScript
{
PrepareAuraScript(spell_mage_polymorph_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
@@ -1153,8 +1107,8 @@ class spell_mage_polymorph : public SpellScriptLoader
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_mage_polymorph_AuraScript::DoCheck);
OnEffectProc += AuraEffectProcFn(spell_mage_polymorph_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_MOD_CONFUSE);
DoCheckProc.Register(&spell_mage_polymorph_AuraScript::DoCheck);
OnEffectProc.Register(&spell_mage_polymorph_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_MOD_CONFUSE);
}
private:
@@ -1181,8 +1135,6 @@ class spell_mage_polymorph_cast_visual : public SpellScriptLoader
class spell_mage_polymorph_cast_visual_SpellScript : public SpellScript
{
PrepareSpellScript(spell_mage_polymorph_cast_visual_SpellScript);
static const uint32 PolymorhForms[6];
bool Validate(SpellInfo const* /*spellInfo*/) override
@@ -1201,7 +1153,7 @@ class spell_mage_polymorph_cast_visual : public SpellScriptLoader
void Register() override
{
// add dummy effect spell handler to Polymorph visual
OnEffectHitTarget += SpellEffectFn(spell_mage_polymorph_cast_visual_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
OnEffectHitTarget.Register(&spell_mage_polymorph_cast_visual_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
@@ -1229,10 +1181,8 @@ class spell_mage_replenish_mana : public SpellScriptLoader
spell_mage_replenish_mana() : SpellScriptLoader("spell_mage_replenish_mana") { }
class spell_mage_replenish_mana_SpellScript : public SpellScript
{
PrepareSpellScript(spell_mage_replenish_mana_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MAGE_IMPROVED_MANA_GEM_TRIGGERED });
}
@@ -1248,7 +1198,7 @@ class spell_mage_replenish_mana : public SpellScriptLoader
void Register() override
{
AfterCast += SpellCastFn(spell_mage_replenish_mana_SpellScript::HandleImprovedManaGem);
AfterCast.Register(&spell_mage_replenish_mana_SpellScript::HandleImprovedManaGem);
}
};
@@ -1267,8 +1217,6 @@ class spell_mage_ring_of_frost : public SpellScriptLoader
class spell_mage_ring_of_frost_AuraScript : public AuraScript
{
PrepareAuraScript(spell_mage_ring_of_frost_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
@@ -1321,8 +1269,8 @@ class spell_mage_ring_of_frost : public SpellScriptLoader
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mage_ring_of_frost_AuraScript::HandleEffectPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
OnEffectApply += AuraEffectApplyFn(spell_mage_ring_of_frost_AuraScript::Apply, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
OnEffectPeriodic.Register(&spell_mage_ring_of_frost_AuraScript::HandleEffectPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
OnEffectApply.Register(&spell_mage_ring_of_frost_AuraScript::Apply, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
}
};
@@ -1341,8 +1289,6 @@ class spell_mage_ring_of_frost_freeze : public SpellScriptLoader
class spell_mage_ring_of_frost_freeze_SpellScript : public SpellScript
{
PrepareSpellScript(spell_mage_ring_of_frost_freeze_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MAGE_RING_OF_FROST_SUMMON, SPELL_MAGE_RING_OF_FROST_FREEZE });
@@ -1361,7 +1307,7 @@ class spell_mage_ring_of_frost_freeze : public SpellScriptLoader
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mage_ring_of_frost_freeze_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
OnObjectAreaTargetSelect.Register(&spell_mage_ring_of_frost_freeze_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
}
};
@@ -1372,8 +1318,6 @@ class spell_mage_ring_of_frost_freeze : public SpellScriptLoader
class spell_mage_ring_of_frost_freeze_AuraScript : public AuraScript
{
PrepareAuraScript(spell_mage_ring_of_frost_freeze_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MAGE_RING_OF_FROST_DUMMY });
@@ -1388,7 +1332,7 @@ class spell_mage_ring_of_frost_freeze : public SpellScriptLoader
void Register() override
{
AfterEffectRemove += AuraEffectRemoveFn(spell_mage_ring_of_frost_freeze_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove.Register(&spell_mage_ring_of_frost_freeze_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL);
}
};
@@ -1406,8 +1350,6 @@ class spell_mage_time_warp : public SpellScriptLoader
class spell_mage_time_warp_SpellScript : public SpellScript
{
PrepareSpellScript(spell_mage_time_warp_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
@@ -1435,8 +1377,8 @@ class spell_mage_time_warp : public SpellScriptLoader
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mage_time_warp_SpellScript::RemoveInvalidTargets, EFFECT_ALL, TARGET_UNIT_CASTER_AREA_RAID);
AfterHit += SpellHitFn(spell_mage_time_warp_SpellScript::ApplyDebuff);
OnObjectAreaTargetSelect.Register(&spell_mage_time_warp_SpellScript::RemoveInvalidTargets, EFFECT_ALL, TARGET_UNIT_CASTER_AREA_RAID);
AfterHit.Register(&spell_mage_time_warp_SpellScript::ApplyDebuff);
}
};
@@ -1454,10 +1396,8 @@ class spell_mage_water_elemental_freeze : public SpellScriptLoader
spell_mage_water_elemental_freeze() : SpellScriptLoader("spell_mage_water_elemental_freeze") { }
class spell_mage_water_elemental_freeze_SpellScript : public SpellScript
{
PrepareSpellScript(spell_mage_water_elemental_freeze_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MAGE_FINGERS_OF_FROST });
}
@@ -1485,8 +1425,8 @@ class spell_mage_water_elemental_freeze : public SpellScriptLoader
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mage_water_elemental_freeze_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
AfterCast += SpellCastFn(spell_mage_water_elemental_freeze_SpellScript::HandleImprovedFreeze);
OnObjectAreaTargetSelect.Register(&spell_mage_water_elemental_freeze_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
AfterCast.Register(&spell_mage_water_elemental_freeze_SpellScript::HandleImprovedFreeze);
}
private:
@@ -1502,8 +1442,6 @@ class spell_mage_water_elemental_freeze : public SpellScriptLoader
// 79683 Arcane Missiles!
class spell_mage_arcane_missiles_trigger : public AuraScript
{
PrepareAuraScript(spell_mage_arcane_missiles_trigger);
bool Load() override
{
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
@@ -1531,17 +1469,15 @@ class spell_mage_arcane_missiles_trigger : public AuraScript
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_mage_arcane_missiles_trigger::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
AfterEffectApply += AuraEffectApplyFn(spell_mage_arcane_missiles_trigger::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectRemoveFn(spell_mage_arcane_missiles_trigger::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
OnEffectProc.Register(&spell_mage_arcane_missiles_trigger::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
AfterEffectApply.Register(&spell_mage_arcane_missiles_trigger::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove.Register(&spell_mage_arcane_missiles_trigger::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
// 79684 Offensive State (DND)
class spell_mage_offensive_state_dnd : public AuraScript
{
PrepareAuraScript(spell_mage_offensive_state_dnd);
bool Load() override
{
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
@@ -1585,7 +1521,7 @@ class spell_mage_offensive_state_dnd : public AuraScript
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_mage_offensive_state_dnd::CheckProc);
DoCheckProc.Register(&spell_mage_offensive_state_dnd::CheckProc);
}
};
@@ -1596,8 +1532,6 @@ public:
class spell_mage_early_frost_AuraScript : public AuraScript
{
PrepareAuraScript(spell_mage_early_frost_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MAGE_EARLY_FROST_VISUAL });
@@ -1611,7 +1545,7 @@ public:
void Register() override
{
AfterEffectRemove += AuraEffectRemoveFn(spell_mage_early_frost_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_ADD_FLAT_MODIFIER, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove.Register(&spell_mage_early_frost_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_ADD_FLAT_MODIFIER, AURA_EFFECT_HANDLE_REAL);
}
};
@@ -1629,8 +1563,6 @@ class spell_mage_flame_orb: public SpellScriptLoader
class spell_mage_flame_orb_SpellScript : public SpellScript
{
PrepareSpellScript(spell_mage_flame_orb_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
@@ -1668,7 +1600,7 @@ class spell_mage_flame_orb: public SpellScriptLoader
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_mage_flame_orb_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
OnEffectHitTarget.Register(&spell_mage_flame_orb_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
private:
@@ -1689,8 +1621,6 @@ class spell_mage_flame_orb_aoe_dummy: public SpellScriptLoader
class spell_mage_flame_orb_aoe_dummy_SpellScript : public SpellScript
{
PrepareSpellScript(spell_mage_flame_orb_aoe_dummy_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
@@ -1751,8 +1681,8 @@ class spell_mage_flame_orb_aoe_dummy: public SpellScriptLoader
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mage_flame_orb_aoe_dummy_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_mage_flame_orb_aoe_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
OnObjectAreaTargetSelect.Register(&spell_mage_flame_orb_aoe_dummy_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
OnEffectHitTarget.Register(&spell_mage_flame_orb_aoe_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
private:
@@ -1773,8 +1703,6 @@ class spell_mage_hot_streak : public SpellScriptLoader
class spell_mage_hot_streak_AuraScript : public AuraScript
{
PrepareAuraScript(spell_mage_hot_streak_AuraScript);
bool Load() override
{
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
@@ -1824,8 +1752,8 @@ class spell_mage_hot_streak : public SpellScriptLoader
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_mage_hot_streak_AuraScript::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_mage_hot_streak_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
DoCheckProc.Register(&spell_mage_hot_streak_AuraScript::CheckProc);
OnEffectProc.Register(&spell_mage_hot_streak_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
@@ -1843,8 +1771,6 @@ class spell_mage_improved_hot_streak : public SpellScriptLoader
class spell_mage_improved_hot_streak_AuraScript : public AuraScript
{
PrepareAuraScript(spell_mage_improved_hot_streak_AuraScript);
uint8 criticalStrikesCounter;
bool Load() override
@@ -1897,8 +1823,8 @@ class spell_mage_improved_hot_streak : public SpellScriptLoader
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_mage_improved_hot_streak_AuraScript::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_mage_improved_hot_streak_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
DoCheckProc.Register(&spell_mage_improved_hot_streak_AuraScript::CheckProc);
OnEffectProc.Register(&spell_mage_improved_hot_streak_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
@@ -1911,8 +1837,6 @@ class spell_mage_improved_hot_streak : public SpellScriptLoader
// 55342 - Mirror Image
class spell_mage_mirror_image : public SpellScript
{
PrepareSpellScript(spell_mage_mirror_image);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
@@ -1943,14 +1867,12 @@ class spell_mage_mirror_image : public SpellScript
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_mage_mirror_image::HandleDummyEffect, EFFECT_1, SPELL_EFFECT_DUMMY);
OnEffectHitTarget.Register(&spell_mage_mirror_image::HandleDummyEffect, EFFECT_1, SPELL_EFFECT_DUMMY);
}
};
class spell_mage_mirror_image_AurasScript : public AuraScript
{
PrepareAuraScript(spell_mage_mirror_image_AurasScript);
void HandleEffectPeriodic(AuraEffect const* aurEff)
{
if (aurEff->GetTickNumber() == 1)
@@ -1959,7 +1881,7 @@ class spell_mage_mirror_image_AurasScript : public AuraScript
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mage_mirror_image_AurasScript::HandleEffectPeriodic, EFFECT_2, SPELL_AURA_PERIODIC_DUMMY);
OnEffectPeriodic.Register(&spell_mage_mirror_image_AurasScript::HandleEffectPeriodic, EFFECT_2, SPELL_AURA_PERIODIC_DUMMY);
}
};
@@ -1983,8 +1905,6 @@ class SummonerCheck
class spell_mage_initialize_images : public SpellScript
{
PrepareSpellScript(spell_mage_initialize_images);
void FilterTargets(std::list<WorldObject*>& targets)
{
if (targets.empty())
@@ -1995,14 +1915,12 @@ class spell_mage_initialize_images : public SpellScript
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mage_initialize_images::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
OnObjectAreaTargetSelect.Register(&spell_mage_initialize_images::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
}
};
class spell_mage_deep_freeze : public SpellScript
{
PrepareSpellScript(spell_mage_deep_freeze);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MAGE_DEEP_FREEZE_DAMAGE });
@@ -2022,14 +1940,12 @@ class spell_mage_deep_freeze : public SpellScript
void Register() override
{
OnEffectLaunch += SpellEffectFn(spell_mage_deep_freeze::HandleDamage, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
OnEffectLaunch.Register(&spell_mage_deep_freeze::HandleDamage, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
}
};
class spell_mage_fingers_of_frost_charges : public AuraScript
{
PrepareAuraScript(spell_mage_fingers_of_frost_charges);
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
{
PreventDefaultAction();
@@ -2038,15 +1954,13 @@ class spell_mage_fingers_of_frost_charges : public AuraScript
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_mage_fingers_of_frost_charges::HandleProc, EFFECT_0, SPELL_AURA_ABILITY_IGNORE_AURASTATE);
OnEffectProc.Register(&spell_mage_fingers_of_frost_charges::HandleProc, EFFECT_0, SPELL_AURA_ABILITY_IGNORE_AURASTATE);
}
};
// -34293 - Pyromaniac
class spell_mage_pyromaniac : public AuraScript
{
PrepareAuraScript(spell_mage_pyromaniac);
bool Load() override
{
_buffActive = false;
@@ -2102,9 +2016,9 @@ class spell_mage_pyromaniac : public AuraScript
void Register() override
{
DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_mage_pyromaniac::CalcPeriodic, EFFECT_0, SPELL_AURA_DUMMY);
OnEffectProc += AuraEffectProcFn(spell_mage_pyromaniac::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mage_pyromaniac::HandlePeriodic, EFFECT_0, SPELL_AURA_DUMMY);
DoEffectCalcPeriodic.Register(&spell_mage_pyromaniac::CalcPeriodic, EFFECT_0, SPELL_AURA_DUMMY);
OnEffectProc.Register(&spell_mage_pyromaniac::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
OnEffectPeriodic.Register(&spell_mage_pyromaniac::HandlePeriodic, EFFECT_0, SPELL_AURA_DUMMY);
}
private:
GuidSet _dotTargetGuids;
@@ -2139,8 +2053,6 @@ private:
// -11103 - Impact
class spell_mage_impact : public AuraScript
{
PrepareAuraScript(spell_mage_impact);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_MAGE_FIRE_BLAST });
@@ -2153,15 +2065,13 @@ class spell_mage_impact : public AuraScript
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_mage_impact::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
OnEffectProc.Register(&spell_mage_impact::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
// 12355 - Impact
class spell_mage_impact_triggered : public SpellScript
{
PrepareSpellScript(spell_mage_impact_triggered);
void RegisterFireDots(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
@@ -2204,8 +2114,8 @@ class spell_mage_impact_triggered : public SpellScript
void Register() override
{
OnEffectLaunchTarget += SpellEffectFn(spell_mage_impact_triggered::RegisterFireDots, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
OnEffectHitTarget += SpellEffectFn(spell_mage_impact_triggered::SpeadFireDots, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
OnEffectLaunchTarget.Register(&spell_mage_impact_triggered::RegisterFireDots, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
OnEffectHitTarget.Register(&spell_mage_impact_triggered::SpeadFireDots, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
private:
std::vector<Aura*> _fireDotEffects;
@@ -2214,8 +2124,6 @@ private:
// 11129 - Combustion
class spell_mage_combustion : public SpellScript
{
PrepareSpellScript(spell_mage_combustion);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
@@ -2263,7 +2171,7 @@ class spell_mage_combustion : public SpellScript
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_mage_combustion::HandleDotEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
OnEffectHitTarget.Register(&spell_mage_combustion::HandleDotEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
private:
@@ -2273,8 +2181,6 @@ private:
// 44614 - Frostfire Bolt
class spell_mage_frostfire_bolt : public SpellScript
{
PrepareSpellScript(spell_mage_frostfire_bolt);
void HandleGlyphSlow(SpellEffIndex effIndex)
{
Unit* caster = GetCaster();
@@ -2304,8 +2210,8 @@ class spell_mage_frostfire_bolt : public SpellScript
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_mage_frostfire_bolt::HandleGlyphSlow, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
OnEffectHitTarget += SpellEffectFn(spell_mage_frostfire_bolt::HandleGlyphDot, EFFECT_2, SPELL_EFFECT_APPLY_AURA);
OnEffectHitTarget.Register(&spell_mage_frostfire_bolt::HandleGlyphSlow, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
OnEffectHitTarget.Register(&spell_mage_frostfire_bolt::HandleGlyphDot, EFFECT_2, SPELL_EFFECT_APPLY_AURA);
}
};