refactor(Scripts/EasternKingdoms): spell scripts use registry macros (#20399)

This commit is contained in:
Jelle Meeus
2024-11-01 20:54:41 +01:00
committed by GitHub
parent bbbcaac77c
commit 7410175a08
9 changed files with 308 additions and 433 deletions
@@ -153,30 +153,19 @@ public:
};
};
class spell_gnomeregan_radiation_bolt : public SpellScriptLoader
class spell_gnomeregan_radiation_bolt : public SpellScript
{
public:
spell_gnomeregan_radiation_bolt() : SpellScriptLoader("spell_gnomeregan_radiation_bolt") { }
PrepareSpellScript(spell_gnomeregan_radiation_bolt);
class spell_gnomeregan_radiation_bolt_SpellScript : public SpellScript
void HandleTriggerSpell(SpellEffIndex effIndex)
{
PrepareSpellScript(spell_gnomeregan_radiation_bolt_SpellScript);
if (roll_chance_i(80))
PreventHitDefaultEffect(effIndex);
}
void HandleTriggerSpell(SpellEffIndex effIndex)
{
if (roll_chance_i(80))
PreventHitDefaultEffect(effIndex);
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_gnomeregan_radiation_bolt_SpellScript::HandleTriggerSpell, EFFECT_1, SPELL_EFFECT_TRIGGER_SPELL);
}
};
SpellScript* GetSpellScript() const override
void Register() override
{
return new spell_gnomeregan_radiation_bolt_SpellScript;
OnEffectHit += SpellEffectFn(spell_gnomeregan_radiation_bolt::HandleTriggerSpell, EFFECT_1, SPELL_EFFECT_TRIGGER_SPELL);
}
};
@@ -184,5 +173,5 @@ void AddSC_instance_gnomeregan()
{
new instance_gnomeregan();
new npc_kernobee();
new spell_gnomeregan_radiation_bolt();
RegisterSpellScript(spell_gnomeregan_radiation_bolt);
}