mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-20 15:01:38 -04:00
Scripts/Spells: Allow using templated spell script with multiple template arguments in RegisterSpellScriptWithArgs
* Also fixed some script conversion issues
This commit is contained in:
@@ -2200,33 +2200,22 @@ class spell_gen_interrupt : public AuraScript
|
||||
}
|
||||
};
|
||||
|
||||
class spell_gen_increase_stats_buff : public SpellScriptLoader
|
||||
class spell_gen_increase_stats_buff : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_gen_increase_stats_buff(char const* scriptName) : SpellScriptLoader(scriptName) { }
|
||||
PrepareSpellScript(spell_gen_increase_stats_buff);
|
||||
|
||||
class spell_gen_increase_stats_buff_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gen_increase_stats_buff_SpellScript);
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (GetHitUnit()->IsInRaidWith(GetCaster()))
|
||||
GetCaster()->CastSpell(GetCaster(), GetEffectValue() + 1, true); // raid buff
|
||||
else
|
||||
GetCaster()->CastSpell(GetHitUnit(), GetEffectValue(), true); // single-target buff
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (GetHitUnit()->IsInRaidWith(GetCaster()))
|
||||
GetCaster()->CastSpell(GetCaster(), GetEffectValue() + 1, true); // raid buff
|
||||
else
|
||||
GetCaster()->CastSpell(GetHitUnit(), GetEffectValue(), true); // single-target buff
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_gen_increase_stats_buff_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_gen_increase_stats_buff_SpellScript();
|
||||
}
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_gen_increase_stats_buff::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
enum GenericLifebloom
|
||||
|
||||
Reference in New Issue
Block a user