Core/Spells: remove PrepareSpellScript and PrepareAuraScript macros and make Hooklist use emplace behaivior (#174)
This commit is contained in:
1 parent
677990a1b8
commit
2b2fc5fb8a
252 files changed
+3275
-7394
No files matched your search
@@ -422,8 +422,6 @@ class spell_ingvar_summon_banshee : public SpellScriptLoader
|
||||
|
||||
class spell_ingvar_summon_banshee_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_ingvar_summon_banshee_SpellScript);
|
||||
|
||||
void SetDest(SpellDestination& dest)
|
||||
{
|
||||
dest.RelocateOffset({ 0.0f, 0.0f, 30.0f, 0.0f });
|
||||
@@ -431,7 +429,7 @@ class spell_ingvar_summon_banshee : public SpellScriptLoader
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_ingvar_summon_banshee_SpellScript::SetDest, EFFECT_0, TARGET_DEST_CASTER_BACK);
|
||||
OnDestinationTargetSelect.Register(&spell_ingvar_summon_banshee_SpellScript::SetDest, EFFECT_0, TARGET_DEST_CASTER_BACK);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -449,8 +447,6 @@ class spell_ingvar_woe_strike : public SpellScriptLoader
|
||||
|
||||
class spell_ingvar_woe_strike_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_ingvar_woe_strike_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_WOE_STRIKE_EFFECT });
|
||||
@@ -473,8 +469,8 @@ class spell_ingvar_woe_strike : public SpellScriptLoader
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_ingvar_woe_strike_AuraScript::CheckProc);
|
||||
OnEffectProc += AuraEffectProcFn(spell_ingvar_woe_strike_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
DoCheckProc.Register(&spell_ingvar_woe_strike_AuraScript::CheckProc);
|
||||
OnEffectProc.Register(&spell_ingvar_woe_strike_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -342,8 +342,6 @@ class spell_frost_tomb : public SpellScriptLoader
|
||||
|
||||
class spell_frost_tomb_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_frost_tomb_AuraScript);
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByDeath))
|
||||
@@ -355,7 +353,7 @@ class spell_frost_tomb : public SpellScriptLoader
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_frost_tomb_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectRemove.Register(&spell_frost_tomb_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -129,8 +129,6 @@ class spell_ticking_time_bomb : public SpellScriptLoader
|
||||
|
||||
class spell_ticking_time_bomb_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_ticking_time_bomb_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_TICKING_TIME_BOMB_EXPLODE });
|
||||
@@ -144,7 +142,7 @@ class spell_ticking_time_bomb : public SpellScriptLoader
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_ticking_time_bomb_AuraScript::HandleOnEffectRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove.Register(&spell_ticking_time_bomb_AuraScript::HandleOnEffectRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -166,8 +164,6 @@ class spell_fixate : public SpellScriptLoader
|
||||
|
||||
class spell_fixate_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_fixate_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_FIXATE_TRIGGER });
|
||||
@@ -180,7 +176,7 @@ class spell_fixate : public SpellScriptLoader
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_fixate_SpellScript::HandleScriptEffect, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
OnEffectHitTarget.Register(&spell_fixate_SpellScript::HandleScriptEffect, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -203,8 +199,6 @@ class spell_uk_second_wind : public SpellScriptLoader
|
||||
|
||||
class spell_uk_second_wind_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_uk_second_wind_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_SECOND_WIND_TRIGGER });
|
||||
@@ -228,8 +222,8 @@ class spell_uk_second_wind : public SpellScriptLoader
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_uk_second_wind_AuraScript::CheckProc);
|
||||
OnEffectProc += AuraEffectProcFn(spell_uk_second_wind_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
DoCheckProc.Register(&spell_uk_second_wind_AuraScript::CheckProc);
|
||||
OnEffectProc.Register(&spell_uk_second_wind_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -595,8 +595,6 @@ class spell_palehoof_crazed : public SpellScriptLoader
|
||||
|
||||
class spell_palehoof_crazed_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_palehoof_crazed_AuraScript);
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetTarget()->RemoveAurasDueToSpell(SPELL_CRAZED_TAUNT);
|
||||
@@ -604,7 +602,7 @@ class spell_palehoof_crazed : public SpellScriptLoader
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_palehoof_crazed_AuraScript::OnRemove, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove.Register(&spell_palehoof_crazed_AuraScript::OnRemove, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -620,8 +618,6 @@ class spell_palehoof_crazed_effect : public SpellScriptLoader
|
||||
|
||||
class spell_palehoof_crazed_effect_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_palehoof_crazed_effect_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_CRAZED_TAUNT });
|
||||
@@ -634,7 +630,7 @@ class spell_palehoof_crazed_effect : public SpellScriptLoader
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_palehoof_crazed_effect_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
OnEffectHitTarget.Register(&spell_palehoof_crazed_effect_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -652,8 +648,6 @@ class spell_palehoof_awaken_subboss : public SpellScriptLoader
|
||||
|
||||
class spell_palehoof_awaken_subboss_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_palehoof_awaken_subboss_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_ORB_CHANNEL });
|
||||
@@ -669,7 +663,7 @@ class spell_palehoof_awaken_subboss : public SpellScriptLoader
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_palehoof_awaken_subboss_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
|
||||
OnEffectHitTarget.Register(&spell_palehoof_awaken_subboss_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -687,8 +681,6 @@ class spell_palehoof_awaken_gortok : public SpellScriptLoader
|
||||
|
||||
class spell_palehoof_awaken_gortok_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_palehoof_awaken_gortok_SpellScript);
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* target = GetHitUnit();
|
||||
@@ -698,7 +690,7 @@ class spell_palehoof_awaken_gortok : public SpellScriptLoader
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_palehoof_awaken_gortok_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
OnEffectHitTarget.Register(&spell_palehoof_awaken_gortok_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -634,8 +634,6 @@ class spell_freezing_cloud_area_right : public SpellScriptLoader
|
||||
|
||||
class spell_freezing_cloud_area_right_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_freezing_cloud_area_right_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_FREEZING_CLOUD });
|
||||
@@ -653,8 +651,8 @@ class spell_freezing_cloud_area_right : public SpellScriptLoader
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_freezing_cloud_area_right_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_freezing_cloud_area_right_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
|
||||
OnObjectAreaTargetSelect.Register(&spell_freezing_cloud_area_right_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
|
||||
OnEffectHitTarget.Register(&spell_freezing_cloud_area_right_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -671,8 +669,6 @@ class spell_freezing_cloud_area_left : public SpellScriptLoader
|
||||
|
||||
class spell_freezing_cloud_area_left_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_freezing_cloud_area_left_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_FREEZING_CLOUD });
|
||||
@@ -690,8 +686,8 @@ class spell_freezing_cloud_area_left : public SpellScriptLoader
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_freezing_cloud_area_left_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_freezing_cloud_area_left_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
|
||||
OnObjectAreaTargetSelect.Register(&spell_freezing_cloud_area_left_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
|
||||
OnEffectHitTarget.Register(&spell_freezing_cloud_area_left_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -708,8 +704,6 @@ class spell_freezing_cloud_damage : public SpellScriptLoader
|
||||
|
||||
class spell_freezing_cloud_damage_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_freezing_cloud_damage_AuraScript);
|
||||
|
||||
bool CanBeAppliedOn(Unit* target)
|
||||
{
|
||||
if (Aura* aur = target->GetAura(GetId()))
|
||||
@@ -721,7 +715,7 @@ class spell_freezing_cloud_damage : public SpellScriptLoader
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckAreaTarget += AuraCheckAreaTargetFn(spell_freezing_cloud_damage_AuraScript::CanBeAppliedOn);
|
||||
DoCheckAreaTarget.Register(&spell_freezing_cloud_damage_AuraScript::CanBeAppliedOn);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -738,8 +732,6 @@ class spell_skadi_reset_check : public SpellScriptLoader
|
||||
|
||||
class spell_skadi_reset_check_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_skadi_reset_check_SpellScript);
|
||||
|
||||
void CountTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if(Trinity::UnitAuraCheck(false, SPELL_UTGARDE_PINNACLE_GAUNTLET_EFFECT));
|
||||
@@ -762,8 +754,8 @@ class spell_skadi_reset_check : public SpellScriptLoader
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_skadi_reset_check_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_skadi_reset_check_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
|
||||
OnObjectAreaTargetSelect.Register(&spell_skadi_reset_check_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
|
||||
OnEffectHitTarget.Register(&spell_skadi_reset_check_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -783,8 +775,6 @@ class spell_skadi_launch_harpoon : public SpellScriptLoader
|
||||
|
||||
class spell_skadi_launch_harpoon_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_skadi_launch_harpoon_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
if (targets.size() >= 2)
|
||||
@@ -799,8 +789,8 @@ class spell_skadi_launch_harpoon : public SpellScriptLoader
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_skadi_launch_harpoon_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_CONE_ENTRY);
|
||||
OnHit += SpellHitFn(spell_skadi_launch_harpoon_SpellScript::HandleDamageCalc);
|
||||
OnObjectAreaTargetSelect.Register(&spell_skadi_launch_harpoon_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_CONE_ENTRY);
|
||||
OnHit.Register(&spell_skadi_launch_harpoon_SpellScript::HandleDamageCalc);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -817,8 +807,6 @@ class spell_skadi_poisoned_spear : public SpellScriptLoader
|
||||
|
||||
class spell_skadi_poisoned_spear_left_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_skadi_poisoned_spear_left_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_POISONED_SPEAR_PERIODIC });
|
||||
@@ -831,7 +819,7 @@ class spell_skadi_poisoned_spear : public SpellScriptLoader
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_skadi_poisoned_spear_left_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
OnEffectHitTarget.Register(&spell_skadi_poisoned_spear_left_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -848,8 +836,6 @@ class spell_summon_gauntlet_mobs_periodic : public SpellScriptLoader
|
||||
|
||||
class spell_summon_gauntlet_mobs_periodic_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_summon_gauntlet_mobs_periodic_AuraScript);
|
||||
|
||||
void CastTheNextTwoSpells()
|
||||
{
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
@@ -897,7 +883,7 @@ class spell_summon_gauntlet_mobs_periodic : public SpellScriptLoader
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_summon_gauntlet_mobs_periodic_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
OnEffectPeriodic.Register(&spell_summon_gauntlet_mobs_periodic_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -506,8 +506,6 @@ class spell_paralyze_pinnacle : public SpellScriptLoader
|
||||
|
||||
class spell_paralyze_pinnacle_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_paralyze_pinnacle_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& unitList)
|
||||
{
|
||||
unitList.remove_if(RitualTargetCheck());
|
||||
@@ -515,7 +513,7 @@ class spell_paralyze_pinnacle : public SpellScriptLoader
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_paralyze_pinnacle_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnObjectAreaTargetSelect.Register(&spell_paralyze_pinnacle_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user