aboutsummaryrefslogtreecommitdiff
path: root/src
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
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')
-rw-r--r--src/game/SpellAuras.cpp11
-rw-r--r--src/game/SpellEffects.cpp6
-rw-r--r--src/game/Unit.cpp5
3 files changed, 18 insertions, 4 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);
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 948b3cb7754..fa33d76571f 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -2440,16 +2440,15 @@ void Spell::EffectPowerBurn(uint32 i)
int32 curPower = int32(unitTarget->GetPower(powertype));
-
uint32 power = damage;
- // Priest's Mana Burn, burn max amount of 26% of caster's mana
+ //Mana burn take mana % amount from target, but not bigger than amount*2 of caster mana
if ( m_spellInfo->SpellFamilyName==SPELLFAMILY_PRIEST && m_spellInfo->SpellFamilyFlags[0] & 0x10)
{
// Burn percentage of target's mana
power = damage * curPower / 100;
if (caster)
{
- casterPower = caster->GetPower(powertype)*0.26f
+ uint32 casterPower = damage * caster->GetPower(powertype) / 50;
if (casterPower<curPower)
curPower = casterPower;
}
@@ -3494,6 +3493,7 @@ void Spell::EffectDispel(uint32 i)
case 19736: heal_spell = 19735; break;
case 27276: heal_spell = 27278; break;
case 27277: heal_spell = 27279; break;
+ case 48011: heal_spell = 48010; break;
default:
sLog.outDebug("Spell for Devour Magic %d not handled in Spell::EffectDispel", m_spellInfo->Id);
break;
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 625cc148baf..bbb7ffb9fb4 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -5765,7 +5765,10 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 20186:
{
if (pVictim->getPowerType() == POWER_MANA)
- pVictim->CastSpell(pVictim, 20268, true, 0, triggeredByAura);
+ {
+ int32 gainMana = pVictim->GetCreateMana() * triggeredByAura->GetBasePoints() / 100;
+ pVictim->CastCustomSpell(pVictim, 20268, &gainMana, 0, 0, true, 0, triggeredByAura);
+ }
return true;
}
// Holy Power (Redemption Armor set)