aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellAuras.cpp
diff options
context:
space:
mode:
authorQAston <none@none>2009-03-01 16:29:40 +0100
committerQAston <none@none>2009-03-01 16:29:40 +0100
commit44de012148eda14fd3286b04a933ad9f9e286105 (patch)
treed4c733bd9fdfb0f9f13715a4c08a76428cd2f3a7 /src/game/SpellAuras.cpp
parentef500cc204c29f85125486f45f0ca82e4c3ac0ed (diff)
*Fix drain mana, judgement of widsom and viper sting damage amount. Patch by Maxxie.
*Add one more rank of Devour Magic. --HG-- branch : trunk
Diffstat (limited to 'src/game/SpellAuras.cpp')
-rw-r--r--src/game/SpellAuras.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index fc9b4d32148..e0e9befbb77 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -5682,6 +5682,17 @@ void Aura::PeriodicTick()
int32 drain_amount = m_target->GetPower(power) > pdamage ? pdamage : m_target->GetPower(power);
+ //Viper sting and Drain Life take mana % amount from target, but not bigger than amount*2 of caster mana
+ if ((m_spellProto->SpellFamilyName==SPELLFAMILY_WARLOCK && m_spellProto->SpellFamilyFlags[0]&0x10)
+ || (m_spellProto->SpellFamilyName==SPELLFAMILY_HUNTER && m_spellProto->SpellFamilyFlags[1]&0x80))
+ {
+ uint32 drain = m_target->GetMaxPower(power) * drain_amount /100;
+ if(drain > pCaster->GetMaxPower(power) * drain_amount / 50)
+ drain_amount = pCaster->GetMaxPower(power) * drain_amount / 50;
+ else
+ drain_amount = drain;
+ }
+
// resilience reduce mana draining effect at spell crit damage reduction (added in 2.4)
if (power == POWER_MANA && m_target->GetTypeId() == TYPEID_PLAYER)
drain_amount -= ((Player*)m_target)->GetSpellCritDamageReduction(drain_amount);