diff options
-rw-r--r-- | src/server/scripts/Spells/spell_warlock.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 78be4204ee0..c844001eda5 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -406,9 +406,10 @@ class spell_warl_doom : public AuraScript // 198590 - Drain Soul class spell_warl_drain_soul : public AuraScript { - bool Validate(SpellInfo const* /*spellInfo*/) override + bool Validate(SpellInfo const* spellInfo) override { - return ValidateSpellInfo ({ SPELL_WARLOCK_DRAIN_SOUL_ENERGIZE }); + return ValidateSpellInfo ({ SPELL_WARLOCK_DRAIN_SOUL_ENERGIZE }) + && ValidateSpellEffect({ { spellInfo->Id, EFFECT_2 } }); } void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) @@ -420,9 +421,16 @@ class spell_warl_drain_soul : public AuraScript caster->CastSpell(caster, SPELL_WARLOCK_DRAIN_SOUL_ENERGIZE, true); } + void CalculateDamage(AuraEffect const* /*aurEff*/, Unit const* victim, int32& /*damage*/, int32& /*flatMod*/, float& pctMod) const + { + if (victim->HealthBelowPct(GetEffectInfo(EFFECT_2).CalcValue(GetCaster()))) + AddPct(pctMod, GetEffectInfo(EFFECT_1).CalcValue(GetCaster())); + } + void Register() override { AfterEffectRemove += AuraEffectApplyFn(spell_warl_drain_soul::HandleRemove, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL); + DoEffectCalcDamageAndHealing += AuraEffectCalcDamageFn(spell_warl_drain_soul::CalculateDamage, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE); } }; |