aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclick <none@none>2010-07-04 19:28:40 +0200
committerclick <none@none>2010-07-04 19:28:40 +0200
commita11391b3c09a2fce83a3d4c92e2267085fba10b2 (patch)
treef5cf46a8fe9e0ebaeeb6f00069e2a25119fdb282
parenteba3f0a1dd4d85fd74be11c14798d52e507c85c1 (diff)
Fix warrior selfheal & heal-reduction (and handling of OBS_MOD_HEALTH in the same time)
(Thanks to dr.tenma) --HG-- branch : trunk
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 54bb87470bc..da495eaa4f1 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -1485,7 +1485,37 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const
int32 damage = m_amount > 0 ? m_amount : 0;
if (GetAuraType() == SPELL_AURA_OBS_MOD_HEALTH)
+ {
+ // Taken mods
+ float TakenTotalMod = 1.0f;
+
+ // Tenacity increase healing % taken
+ if (AuraEffect const* Tenacity = target->GetAuraEffect(58549, 0))
+ TakenTotalMod *= (Tenacity->GetAmount() + 100.0f) / 100.0f;
+
+ // Healing taken percent
+ float minval = target->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
+ if (minval)
+ TakenTotalMod *= (100.0f + minval) / 100.0f;
+
+ float maxval = target->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
+ if (maxval)
+ TakenTotalMod *= (100.0f + maxval) / 100.0f;
+
+ // Healing over time taken percent
+ float minval_hot = target->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HOT_PCT);
+ if (minval_hot)
+ TakenTotalMod *= (100.0f + minval_hot) / 100.0f;
+
+ float maxval_hot = target->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HOT_PCT);
+ if (maxval_hot)
+ TakenTotalMod *= (100.0f + maxval_hot) / 100.0f;
+
+ TakenTotalMod = TakenTotalMod > 0.0f ? TakenTotalMod : 0.0f;
+
damage = uint32(target->GetMaxHealth() * damage / 100);
+ damage = uint32(damage * TakenTotalMod);
+ }
else
{
// Wild Growth = amount + (6 - 2*doneTicks) * ticks* amount / 100