fix(Core/Spells): Curse of Pain (#16844)

* fix(Core/Spells): Curse of Pain

* ocd
This commit is contained in:
avarishd
2023-07-29 22:51:15 +03:00
committed by GitHub
parent 0ebb1969cb
commit 66daf97144
2 changed files with 37 additions and 0 deletions

View File

@@ -4884,6 +4884,39 @@ class spell_gen_shriveling_gaze : public AuraScript
}
};
// 38048 - Curse of Pain
enum CurseOfPain
{
SPELL_CURSE_OF_PAIN = 38048,
};
class spell_gen_curse_of_pain : public AuraScript
{
PrepareAuraScript(spell_gen_curse_of_pain);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_CURSE_OF_PAIN });
}
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
Unit* target = GetTarget();
if (target && target->ToPlayer())
{
if (target->GetHealthPct() < 50.f)
{
target->RemoveAurasDueToSpell(SPELL_CURSE_OF_PAIN);
}
}
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_curse_of_pain::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
}
};
void AddSC_generic_spell_scripts()
{
RegisterSpellScript(spell_silithyst);
@@ -5029,4 +5062,5 @@ void AddSC_generic_spell_scripts()
RegisterSpellScript(spell_freezing_circle);
RegisterSpellScript(spell_gen_threshalisk_charge);
RegisterSpellScript(spell_gen_shriveling_gaze);
RegisterSpellScript(spell_gen_curse_of_pain);
}