aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-04-03 16:33:25 -0600
committermegamage <none@none>2009-04-03 16:33:25 -0600
commitf7cc04e9dd71a00d4aa79654a93060871af2d154 (patch)
tree24059b29af0cc14dfd6f7e83b331b9d6e07e6d91 /src
parent8ad562d008877742dbfccac2115ef0d4353e355b (diff)
[7606] Fix use % power burn in effects Author: Lutik
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/SpellEffects.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index ac408381a83..051b4f1775c 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -2468,6 +2468,14 @@ void Spell::EffectPowerBurn(uint32 i)
Unit* caster = m_originalCaster ? m_originalCaster : m_caster;
+ // burn x% of target's mana, up to maximum of 2x% of caster's mana (Mana Burn)
+ if(m_spellInfo->ManaCostPercentage)
+ {
+ uint32 maxdamage = m_caster->GetMaxPower(powertype) * damage * 2 / 100;
+ damage = unitTarget->GetMaxPower(powertype) * damage / 100;
+ if(damage > maxdamage) damage = maxdamage;
+ }
+
int32 curPower = int32(unitTarget->GetPower(powertype));
uint32 power = damage;