refactor(Scripts/Kalimdor): Spell Scripts registry macros (#19185)

* zone_dustwallow_marsh spell:spell_ooze_zap

* zone_dustwallow_marsh spell:spell_ooze_zap_channel_end

* zone_dustwallow_marsh spell:spell_energize_aoe

* zone_feralas spell:spell_gordunni_trap

* zone_durotar aura:spell_mount_check_aura

* zone_durotar spell:spell_voljin_war_drums

* zone_durotar spell:spell_voodoo

* boss_salramm aura:spell_boss_salramm_steal_flesh_aura

* instance_zulfarrak spell:spell_zulfarrak_summon_zulfarrak_zombies

* instance_zulfarrak spell:spell_zulfarrak_unlocking
This commit is contained in:
Jelle Meeus
2024-06-26 22:26:35 +02:00
committed by GitHub
parent b259ec6df7
commit a9c93cc94e
6 changed files with 210 additions and 312 deletions

View File

@@ -161,41 +161,35 @@ public:
};
};
class spell_boss_salramm_steal_flesh : public SpellScriptLoader
class spell_boss_salramm_steal_flesh_aura : public AuraScript
{
public:
spell_boss_salramm_steal_flesh() : SpellScriptLoader("spell_boss_salramm_steal_flesh") { }
PrepareAuraScript(spell_boss_salramm_steal_flesh_aura);
class spell_boss_salramm_steal_flesh_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_boss_salramm_steal_flesh_AuraScript);
return ValidateSpellInfo({ SPELL_STEAL_FLESH_CASTER, SPELL_STEAL_FLESH_TARGET });
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* caster = GetCaster();
Unit* target = GetUnitOwner();
if (caster)
{
caster->CastSpell(caster, SPELL_STEAL_FLESH_CASTER, true);
caster->CastSpell(target, SPELL_STEAL_FLESH_TARGET, true);
}
}
void Register() override
{
AfterEffectRemove += AuraEffectRemoveFn(spell_boss_salramm_steal_flesh_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
return new spell_boss_salramm_steal_flesh_AuraScript();
Unit* caster = GetCaster();
Unit* target = GetUnitOwner();
if (caster)
{
caster->CastSpell(caster, SPELL_STEAL_FLESH_CASTER, true);
caster->CastSpell(target, SPELL_STEAL_FLESH_TARGET, true);
}
}
void Register() override
{
AfterEffectRemove += AuraEffectRemoveFn(spell_boss_salramm_steal_flesh_aura::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
void AddSC_boss_salramm()
{
new boss_salramm();
new spell_boss_salramm_steal_flesh();
RegisterSpellScript(spell_boss_salramm_steal_flesh_aura);
}