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

@@ -28,8 +28,6 @@
class spell_westfall_unbound_energy : public SpellScript
{
PrepareSpellScript(spell_westfall_unbound_energy);
void FilterTargets(std::list<WorldObject*>& targets)
{
if (targets.empty())
@@ -47,7 +45,7 @@ class spell_westfall_unbound_energy : public SpellScript
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_westfall_unbound_energy::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
OnObjectAreaTargetSelect.Register(&spell_westfall_unbound_energy::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
}
};
@@ -112,8 +110,6 @@ private:
class spell_westfall_reaping_blows : public AuraScript
{
PrepareAuraScript(spell_westfall_reaping_blows);
void HandlePeriodic(AuraEffect const* /*aurEff*/)
{
PreventDefaultAction();
@@ -123,14 +119,12 @@ class spell_westfall_reaping_blows : public AuraScript
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_westfall_reaping_blows::HandlePeriodic, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
OnEffectPeriodic.Register(&spell_westfall_reaping_blows::HandlePeriodic, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
class spell_westfall_wake_harvest_golem : public SpellScript
{
PrepareSpellScript(spell_westfall_wake_harvest_golem);
SpellCastResult CheckTarget()
{
Unit* target = GetExplTargetUnit();
@@ -155,16 +149,13 @@ class spell_westfall_wake_harvest_golem : public SpellScript
void Register() override
{
OnCheckCast += SpellCheckCastFn(spell_westfall_wake_harvest_golem::CheckTarget);
OnEffectHitTarget += SpellEffectFn(spell_westfall_wake_harvest_golem::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
OnCheckCast.Register(&spell_westfall_wake_harvest_golem::CheckTarget);
OnEffectHitTarget.Register(&spell_westfall_wake_harvest_golem::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
class spell_westfall_quest_credit_jangolode_event : public SpellScript
{
PrepareSpellScript(spell_westfall_quest_credit_jangolode_event);
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
{
GetHitUnit()->ExitVehicle();
@@ -172,7 +163,7 @@ class spell_westfall_quest_credit_jangolode_event : public SpellScript
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_westfall_quest_credit_jangolode_event::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
OnEffectHitTarget.Register(&spell_westfall_quest_credit_jangolode_event::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
@@ -489,8 +480,6 @@ private:
class spell_westfall_summon_ragamuffin_looter : public SpellScript
{
PrepareSpellScript(spell_westfall_summon_ragamuffin_looter);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
@@ -513,14 +502,12 @@ class spell_westfall_summon_ragamuffin_looter : public SpellScript
void Register() override
{
OnEffectLaunch += SpellEffectFn(spell_westfall_summon_ragamuffin_looter::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
OnEffectLaunch.Register(&spell_westfall_summon_ragamuffin_looter::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
class spell_westfall_aggro_hobo : public SpellScript
{
PrepareSpellScript(spell_westfall_aggro_hobo);
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (Creature* creature = GetHitCreature())
@@ -530,7 +517,7 @@ class spell_westfall_aggro_hobo : public SpellScript
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_westfall_aggro_hobo::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
OnEffectHitTarget.Register(&spell_westfall_aggro_hobo::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};