*Fix drain mana, judgement of widsom and viper sting damage amount. Patch by Maxxie.

*Add one more rank of Devour Magic.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-03-01 16:29:40 +01:00
parent ef500cc204
commit 44de012148
3 changed files with 18 additions and 4 deletions
+11
View File
@@ -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);
+3 -3
View File
@@ -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;
+4 -1
View File
@@ -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)