diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 5424a2e59d6..126bb2e40f3 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1070,16 +1070,15 @@ class spell_gen_lifeblood : public SpellScriptLoader { PrepareAuraScript(spell_gen_lifeblood_AuraScript); - void HandleEffect(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) { - Unit * caster = GetCaster(); - - const_cast<AuraEffect *>(aurEff)->SetAmount(aurEff->GetAmount() + CalculatePctF(caster->GetMaxHealth(), 1.5f / aurEff->GetTotalTicks())); + if (Unit* owner = GetUnitOwner()) + amount += int32(CalculatePctF(owner->GetMaxHealth(), 1.5f / aurEff->GetTotalTicks())); } void Register() { - OnEffectApply += AuraEffectApplyFn(spell_gen_lifeblood_AuraScript::HandleEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_lifeblood_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_HEAL); } }; |