aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2011-05-19 13:21:12 +0200
committerShauren <shauren.trinity@gmail.com>2011-05-19 13:21:12 +0200
commitc3e1f41bc2b71983f07d435550c18d535caf89a1 (patch)
treeac2cdd366bbd823d5998b5be57f355acdb55081f /src
parentea9a83407f53be8307b8bcc168d780412af3a5e6 (diff)
Scripts/Spells: Use more appropriate hook for Lifeblood calculations
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp9
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);
}
};