refactor(Scripts/TempestKeep): Spell Scripts use registry macros (#19123)

* init sql

* instance_the_eye aura:spell_the_eye_countercharge_aura

* instance_the_botanica aura:spell_botanica_call_of_the_falcon_aura

* instance_the_botanica aura:spell_botanica_shift_form_aura

* arcatraz aura:spell_arcatraz_soul_steal_aura
This commit is contained in:
Jelle Meeus
2024-06-22 10:19:43 +02:00
committed by GitHub
parent e83e343aec
commit f65283c35a
4 changed files with 122 additions and 156 deletions
@@ -0,0 +1,5 @@
--
UPDATE `spell_script_names` SET `ScriptName`='spell_the_eye_countercharge_aura' WHERE `spell_id`=35035;
UPDATE `spell_script_names` SET `ScriptName`='spell_botanica_call_of_the_falcon_aura' WHERE `spell_id`=34852;
UPDATE `spell_script_names` SET `ScriptName`='spell_botanica_shift_form_aura' WHERE `spell_id`=34201;
UPDATE `spell_script_names` SET `ScriptName`='spell_arcatraz_soul_steal_aura' WHERE `spell_id`=36778;
@@ -145,14 +145,9 @@ public:
} }
}; };
class spell_the_eye_countercharge : public SpellScriptLoader class spell_the_eye_countercharge_aura : public AuraScript
{ {
public: PrepareAuraScript(spell_the_eye_countercharge_aura);
spell_the_eye_countercharge() : SpellScriptLoader("spell_the_eye_countercharge") { }
class spell_the_eye_counterchargeScript : public AuraScript
{
PrepareAuraScript(spell_the_eye_counterchargeScript);
bool PrepareProc(ProcEventInfo& /*eventInfo*/) bool PrepareProc(ProcEventInfo& /*eventInfo*/)
{ {
@@ -163,19 +158,13 @@ public:
void Register() override void Register() override
{ {
DoCheckProc += AuraCheckProcFn(spell_the_eye_counterchargeScript::PrepareProc); DoCheckProc += AuraCheckProcFn(spell_the_eye_countercharge_aura::PrepareProc);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_the_eye_counterchargeScript();
} }
}; };
void AddSC_instance_the_eye() void AddSC_instance_the_eye()
{ {
new instance_the_eye(); new instance_the_eye();
new spell_the_eye_countercharge(); RegisterSpellScript(spell_the_eye_countercharge_aura);
} }
@@ -585,14 +585,14 @@ public:
} }
}; };
class spell_arcatraz_soul_steal : public SpellScriptLoader class spell_arcatraz_soul_steal_aura : public AuraScript
{ {
public: PrepareAuraScript(spell_arcatraz_soul_steal_aura);
spell_arcatraz_soul_steal() : SpellScriptLoader("spell_arcatraz_soul_steal") { }
class spell_arcatraz_soul_steal_AuraScript : public AuraScript bool Validate(SpellInfo const* /*spellInfo*/) override
{ {
PrepareAuraScript(spell_arcatraz_soul_steal_AuraScript) return ValidateSpellInfo({ SPELL_SOUL_STEAL });
}
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{ {
@@ -608,14 +608,8 @@ public:
void Register() override void Register() override
{ {
OnEffectApply += AuraEffectApplyFn(spell_arcatraz_soul_steal_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, AURA_EFFECT_HANDLE_REAL); OnEffectApply += AuraEffectApplyFn(spell_arcatraz_soul_steal_aura::HandleEffectApply, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, AURA_EFFECT_HANDLE_REAL);
OnEffectRemove += AuraEffectRemoveFn(spell_arcatraz_soul_steal_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, AURA_EFFECT_HANDLE_REAL); OnEffectRemove += AuraEffectRemoveFn(spell_arcatraz_soul_steal_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_arcatraz_soul_steal_AuraScript();
} }
}; };
@@ -624,6 +618,6 @@ void AddSC_arcatraz()
new npc_millhouse_manastorm(); new npc_millhouse_manastorm();
new npc_warden_mellichar(); new npc_warden_mellichar();
new spell_arcatraz_soul_steal(); RegisterSpellScript(spell_arcatraz_soul_steal_aura);
} }
@@ -42,14 +42,9 @@ public:
} }
}; };
class spell_botanica_call_of_the_falcon : public SpellScriptLoader class spell_botanica_call_of_the_falcon_aura : public AuraScript
{ {
public: PrepareAuraScript(spell_botanica_call_of_the_falcon_aura);
spell_botanica_call_of_the_falcon() : SpellScriptLoader("spell_botanica_call_of_the_falcon") { }
class spell_botanica_call_of_the_falcon_AuraScript : public AuraScript
{
PrepareAuraScript(spell_botanica_call_of_the_falcon_AuraScript)
bool Load() override bool Load() override
{ {
@@ -81,28 +76,17 @@ public:
void Register() override void Register() override
{ {
OnEffectApply += AuraEffectApplyFn(spell_botanica_call_of_the_falcon_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); OnEffectApply += AuraEffectApplyFn(spell_botanica_call_of_the_falcon_aura::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
OnEffectRemove += AuraEffectRemoveFn(spell_botanica_call_of_the_falcon_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); OnEffectRemove += AuraEffectRemoveFn(spell_botanica_call_of_the_falcon_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
} }
private: private:
GuidSet _falconSet; GuidSet _falconSet;
}; };
AuraScript* GetAuraScript() const override class spell_botanica_shift_form_aura : public AuraScript
{ {
return new spell_botanica_call_of_the_falcon_AuraScript(); PrepareAuraScript(spell_botanica_shift_form_aura);
}
};
class spell_botanica_shift_form : public SpellScriptLoader
{
public:
spell_botanica_shift_form() : SpellScriptLoader("spell_botanica_shift_form") { }
class spell_botanica_shift_form_AuraScript : public AuraScript
{
PrepareAuraScript(spell_botanica_shift_form_AuraScript);
bool Load() override bool Load() override
{ {
@@ -153,7 +137,7 @@ public:
void Register() override void Register() override
{ {
DoCheckProc += AuraCheckProcFn(spell_botanica_shift_form_AuraScript::CheckProc); DoCheckProc += AuraCheckProcFn(spell_botanica_shift_form_aura::CheckProc);
} }
private: private:
@@ -162,16 +146,10 @@ public:
uint32 _swapTime; uint32 _swapTime;
}; };
AuraScript* GetAuraScript() const override
{
return new spell_botanica_shift_form_AuraScript();
}
};
void AddSC_instance_the_botanica() void AddSC_instance_the_botanica()
{ {
new instance_the_botanica(); new instance_the_botanica();
new spell_botanica_call_of_the_falcon(); RegisterSpellScript(spell_botanica_call_of_the_falcon_aura);
new spell_botanica_shift_form(); RegisterSpellScript(spell_botanica_shift_form_aura);
} }