refactor(Scripts/BlackrockMountain): Spell Scripts registry macros (#19186)

* boss_garr aura:spell_garr_separation_nexiety_aura

* boss_garr spell:spell_garr_frenzy

* molten_core aura:spell_mc_play_dead_aura

* boss_magmadar spell:spell_magmadar_lava_bomb

* boss_majordomo_executus spell:spell_hate_to_zero

* boss_majordomo_executus aura:spell_majordomo_separation_nexiety_aura

* boss_majordomo_executus spell:spell_summon_ragnaros

* boss_shazzrah spell:spell_shazzrah_gate_dummy

* boss_baron_geddon aura:spell_geddon_inferno_aura

* boss_baron_geddon aura:spell_geddon_armageddon_aura

* boss_razorgore spell:spell_egg_event

* instance_blackwing_lair spell:spell_bwl_shadowflame

* fixup! boss_majordomo_executus aura:spell_majordomo_separation_nexiety_aura

* fixup! boss_garr aura:spell_garr_separation_nexiety_aura

* fixup! fixup! boss_garr aura:spell_garr_separation_nexiety_aura
This commit is contained in:
Jelle Meeus
2024-06-27 18:03:08 +02:00
committed by GitHub
parent 2d3f71a27e
commit a740c252f9
9 changed files with 359 additions and 482 deletions
@@ -0,0 +1,6 @@
--
UPDATE `spell_script_names` SET `ScriptName`='spell_garr_separation_anxiety_aura' WHERE `spell_id`=23487;
UPDATE `spell_script_names` SET `ScriptName`='spell_mc_play_dead_aura' WHERE `spell_id`=19822;
UPDATE `spell_script_names` SET `ScriptName`='spell_majordomo_separation_anxiety_aura' WHERE `spell_id`=21094;
UPDATE `spell_script_names` SET `ScriptName`='spell_geddon_inferno_aura' WHERE `spell_id`=19695;
UPDATE `spell_script_names` SET `ScriptName`='spell_geddon_armageddon_aura' WHERE `spell_id`=20478;
@@ -303,14 +303,9 @@ public:
}
};
class spell_egg_event : public SpellScriptLoader
class spell_egg_event : public SpellScript
{
public:
spell_egg_event() : SpellScriptLoader("spell_egg_event") { }
class spell_egg_eventSpellScript : public SpellScript
{
PrepareSpellScript(spell_egg_eventSpellScript);
PrepareSpellScript(spell_egg_event);
void HandleOnHit()
{
@@ -333,13 +328,7 @@ public:
void Register() override
{
OnHit += SpellHitFn(spell_egg_eventSpellScript::HandleOnHit);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_egg_eventSpellScript();
OnHit += SpellHitFn(spell_egg_event::HandleOnHit);
}
};
@@ -347,6 +336,6 @@ void AddSC_boss_razorgore()
{
new boss_razorgore();
new go_orb_of_domination();
new spell_egg_event();
RegisterSpellScript(spell_egg_event);
}
@@ -478,14 +478,9 @@ enum ShadowFlame
};
// 22539 - Shadowflame (used in Blackwing Lair)
class spell_bwl_shadowflame : public SpellScriptLoader
class spell_bwl_shadowflame : public SpellScript
{
public:
spell_bwl_shadowflame() : SpellScriptLoader("spell_bwl_shadowflame") { }
class spell_bwl_shadowflame_SpellScript : public SpellScript
{
PrepareSpellScript(spell_bwl_shadowflame_SpellScript);
PrepareSpellScript(spell_bwl_shadowflame);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
@@ -502,13 +497,7 @@ public:
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_bwl_shadowflame_SpellScript::HandleEffectScriptEffect, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_bwl_shadowflame_SpellScript;
OnEffectHitTarget += SpellEffectFn(spell_bwl_shadowflame::HandleEffectScriptEffect, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
@@ -539,7 +528,7 @@ public:
void AddSC_instance_blackwing_lair()
{
new instance_blackwing_lair();
new spell_bwl_shadowflame();
RegisterSpellScript(spell_bwl_shadowflame);
new at_orb_of_command();
}
@@ -128,14 +128,9 @@ public:
};
// 19695 Inferno
class spell_geddon_inferno : public SpellScriptLoader
class spell_geddon_inferno_aura : public AuraScript
{
public:
spell_geddon_inferno() : SpellScriptLoader("spell_geddon_inferno") { }
class spell_geddon_inferno_AuraScript : public AuraScript
{
PrepareAuraScript(spell_geddon_inferno_AuraScript);
PrepareAuraScript(spell_geddon_inferno_aura);
bool Validate(SpellInfo const* /*spell*/) override
{
@@ -191,27 +186,16 @@ public:
void Register() override
{
AfterEffectApply += AuraEffectApplyFn(spell_geddon_inferno_AuraScript::HandleAfterApply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectRemoveFn(spell_geddon_inferno_AuraScript::HandleAfterRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_geddon_inferno_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_geddon_inferno_AuraScript();
AfterEffectApply += AuraEffectApplyFn(spell_geddon_inferno_aura::HandleAfterApply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectRemoveFn(spell_geddon_inferno_aura::HandleAfterRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_geddon_inferno_aura::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
// 20478 Armageddon
class spell_geddon_armageddon : public SpellScriptLoader
class spell_geddon_armageddon_aura : public AuraScript
{
public:
spell_geddon_armageddon() : SpellScriptLoader("spell_geddon_armageddon") { }
class spell_geddon_armageddon_AuraScript : public AuraScript
{
PrepareAuraScript(spell_geddon_armageddon_AuraScript);
PrepareAuraScript(spell_geddon_armageddon_aura);
void HandleAfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
@@ -232,14 +216,8 @@ public:
void Register() override
{
AfterEffectApply += AuraEffectApplyFn(spell_geddon_armageddon_AuraScript::HandleAfterApply, EFFECT_1, SPELL_AURA_MOD_PACIFY, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectRemoveFn(spell_geddon_armageddon_AuraScript::HandleAfterRemove, EFFECT_1, SPELL_AURA_MOD_PACIFY, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_geddon_armageddon_AuraScript();
AfterEffectApply += AuraEffectApplyFn(spell_geddon_armageddon_aura::HandleAfterApply, EFFECT_1, SPELL_AURA_MOD_PACIFY, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectRemoveFn(spell_geddon_armageddon_aura::HandleAfterRemove, EFFECT_1, SPELL_AURA_MOD_PACIFY, AURA_EFFECT_HANDLE_REAL);
}
};
@@ -248,7 +226,7 @@ void AddSC_boss_baron_geddon()
new boss_baron_geddon();
// Spells
new spell_geddon_inferno();
new spell_geddon_armageddon();
RegisterSpellScript(spell_geddon_inferno_aura);
RegisterSpellScript(spell_geddon_armageddon_aura);
}
@@ -172,14 +172,9 @@ public:
};
// 23487 Separation Anxiety (server side)
class spell_garr_separation_nexiety : public SpellScriptLoader
class spell_garr_separation_anxiety_aura : public AuraScript
{
public:
spell_garr_separation_nexiety() : SpellScriptLoader("spell_garr_separation_nexiety") {}
class spell_garr_separation_nexiety_AuraScript : public AuraScript
{
PrepareAuraScript(spell_garr_separation_nexiety_AuraScript);
PrepareAuraScript(spell_garr_separation_anxiety_aura);
bool Validate(SpellInfo const* /*spell*/) override
{
@@ -198,26 +193,14 @@ public:
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_garr_separation_nexiety_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
};
// Should return a fully valid AuraScript pointer.
AuraScript* GetAuraScript() const override
{
return new spell_garr_separation_nexiety_AuraScript();
OnEffectPeriodic += AuraEffectPeriodicFn(spell_garr_separation_anxiety_aura::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
};
//19515 Frenzy (SERVERSIDE)
class spell_garr_frenzy : public SpellScriptLoader
class spell_garr_frenzy : public SpellScript
{
public:
spell_garr_frenzy() : SpellScriptLoader("spell_garr_frenzy") {}
class spell_garr_frenzy_SpellScript : public SpellScript
{
PrepareSpellScript(spell_garr_frenzy_SpellScript);
PrepareSpellScript(spell_garr_frenzy);
bool Validate(SpellInfo const* /*spell*/) override
{
@@ -234,13 +217,7 @@ public:
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_garr_frenzy_SpellScript::HandleHit, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_garr_frenzy_SpellScript();
OnEffectHitTarget += SpellEffectFn(spell_garr_frenzy::HandleHit, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
@@ -250,7 +227,7 @@ void AddSC_boss_garr()
new npc_garr_firesworn();
// Spells
new spell_garr_separation_nexiety();
new spell_garr_frenzy();
RegisterSpellScript(spell_garr_separation_anxiety_aura);
RegisterSpellScript(spell_garr_frenzy);
}
@@ -119,14 +119,9 @@ public:
// 19411 Lava Bomb
// 20474 Lava Bomb
class spell_magmadar_lava_bomb : public SpellScriptLoader
class spell_magmadar_lava_bomb : public SpellScript
{
public:
spell_magmadar_lava_bomb() : SpellScriptLoader("spell_magmadar_lava_bomb") {}
class spell_magmadar_lava_bomb_SpellScript : public SpellScript
{
PrepareSpellScript(spell_magmadar_lava_bomb_SpellScript);
PrepareSpellScript(spell_magmadar_lava_bomb);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
@@ -161,13 +156,7 @@ public:
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_magmadar_lava_bomb_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_magmadar_lava_bomb_SpellScript();
OnEffectHitTarget += SpellEffectFn(spell_magmadar_lava_bomb::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
@@ -176,6 +165,6 @@ void AddSC_boss_magmadar()
new boss_magmadar();
// Spells
new spell_magmadar_lava_bomb();
RegisterSpellScript(spell_magmadar_lava_bomb);
}
@@ -581,14 +581,9 @@ public:
};
// 20538 Hate to Zero (SERVERSIDE)
class spell_hate_to_zero : public SpellScriptLoader
class spell_hate_to_zero : public SpellScript
{
public:
spell_hate_to_zero() : SpellScriptLoader("spell_hate_to_zero") {}
class spell_hate_to_zero_SpellScript : public SpellScript
{
PrepareSpellScript(spell_hate_to_zero_SpellScript);
PrepareSpellScript(spell_hate_to_zero);
bool Load() override
{
@@ -608,25 +603,14 @@ public:
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_hate_to_zero_SpellScript::HandleHit, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_hate_to_zero_SpellScript();
OnEffectHitTarget += SpellEffectFn(spell_hate_to_zero::HandleHit, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
// 21094 Separation Anxiety (server side)
class spell_majordomo_separation_nexiety : public SpellScriptLoader
class spell_majordomo_separation_anxiety_aura : public AuraScript
{
public:
spell_majordomo_separation_nexiety() : SpellScriptLoader("spell_majordomo_separation_nexiety") {}
class spell_majordomo_separation_nexiety_AuraScript : public AuraScript
{
PrepareAuraScript(spell_majordomo_separation_nexiety_AuraScript);
PrepareAuraScript(spell_majordomo_separation_anxiety_aura);
bool Validate(SpellInfo const* /*spell*/) override
{
@@ -645,26 +629,14 @@ public:
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_majordomo_separation_nexiety_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
};
// Should return a fully valid AuraScript pointer.
AuraScript* GetAuraScript() const override
{
return new spell_majordomo_separation_nexiety_AuraScript();
OnEffectPeriodic += AuraEffectPeriodicFn(spell_majordomo_separation_anxiety_aura::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
};
// 19774 Summon Ragnaros
class spell_summon_ragnaros : public SpellScriptLoader
class spell_summon_ragnaros : public SpellScript
{
public:
spell_summon_ragnaros() : SpellScriptLoader("spell_summon_ragnaros") {}
class spell_summon_ragnaros_SpellScript : public SpellScript
{
PrepareSpellScript(spell_summon_ragnaros_SpellScript);
PrepareSpellScript(spell_summon_ragnaros);
void HandleHit()
{
@@ -676,13 +648,7 @@ public:
void Register() override
{
AfterCast += SpellCastFn(spell_summon_ragnaros_SpellScript::HandleHit);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_summon_ragnaros_SpellScript();
AfterCast += SpellCastFn(spell_summon_ragnaros::HandleHit);
}
};
@@ -691,8 +657,8 @@ void AddSC_boss_majordomo()
new boss_majordomo();
// Spells
new spell_hate_to_zero();
new spell_majordomo_separation_nexiety();
new spell_summon_ragnaros();
RegisterSpellScript(spell_hate_to_zero);
RegisterSpellScript(spell_majordomo_separation_anxiety_aura);
RegisterSpellScript(spell_summon_ragnaros);
}
@@ -109,14 +109,9 @@ public:
};
// 23138 - Gate of Shazzrah
class spell_shazzrah_gate_dummy : public SpellScriptLoader
class spell_shazzrah_gate_dummy : public SpellScript
{
public:
spell_shazzrah_gate_dummy() : SpellScriptLoader("spell_shazzrah_gate_dummy") {}
class spell_shazzrah_gate_dummy_SpellScript : public SpellScript
{
PrepareSpellScript(spell_shazzrah_gate_dummy_SpellScript);
PrepareSpellScript(spell_shazzrah_gate_dummy);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
@@ -180,14 +175,8 @@ public:
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_shazzrah_gate_dummy_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_shazzrah_gate_dummy_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_shazzrah_gate_dummy_SpellScript();
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_shazzrah_gate_dummy::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_shazzrah_gate_dummy::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
@@ -196,6 +185,6 @@ void AddSC_boss_shazzrah()
new boss_shazzrah();
// Spells
new spell_shazzrah_gate_dummy();
RegisterSpellScript(spell_shazzrah_gate_dummy);
}
@@ -118,14 +118,14 @@ public:
};
// 19822 Play Dead
class spell_mc_play_dead : public SpellScriptLoader
class spell_mc_play_dead_aura : public AuraScript
{
public:
spell_mc_play_dead() : SpellScriptLoader("spell_mc_play_dead") { }
PrepareAuraScript(spell_mc_play_dead_aura);
class spell_mc_play_dead_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_mc_play_dead_AuraScript);
return ValidateSpellInfo({ SPELL_PLAY_DEAD_PACIFY, SPELL_PLAY_DEAD });
}
bool Load() override
{
@@ -205,14 +205,8 @@ public:
void Register() override
{
AfterEffectApply += AuraEffectApplyFn(spell_mc_play_dead_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_FEIGN_DEATH, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectApplyFn(spell_mc_play_dead_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_FEIGN_DEATH, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_mc_play_dead_AuraScript();
AfterEffectApply += AuraEffectApplyFn(spell_mc_play_dead_aura::HandleEffectApply, EFFECT_0, SPELL_AURA_FEIGN_DEATH, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectApplyFn(spell_mc_play_dead_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_FEIGN_DEATH, AURA_EFFECT_HANDLE_REAL);
}
};
@@ -272,6 +266,6 @@ void AddSC_molten_core()
RegisterCreatureAI(npc_lava_spawn);
// Spells
new spell_mc_play_dead();
RegisterSpellScript(spell_mc_play_dead_aura);
}