[8747] Implement player's pet resilience, also fix DoT case.

This commit is contained in:
VladimirMangos 2009-10-29 04:32:16 +03:00
parent 012fac90c8
commit 1b6176396e
7 changed files with 82 additions and 99 deletions

View file

@ -6382,10 +6382,10 @@ void Aura::PeriodicTick()
if (isCrit)
cleanDamage.hitOutCome = MELEE_HIT_CRIT;
// Reduce dot damage from resilience for players.
// only from players
// FIXME: need use SpellDamageBonus instead?
if (m_target->GetTypeId() == TYPEID_PLAYER)
pdamage-=((Player*)m_target)->GetSpellDamageReduction(pdamage);
if (IS_PLAYER_GUID(m_caster_guid))
pdamage -= m_target->GetSpellDamageReduction(pdamage);
pCaster->CalcAbsorbResist(m_target, GetSpellSchoolMask(GetSpellProto()), DOT, pdamage, &absorb, &resist);
@ -6609,8 +6609,8 @@ void Aura::PeriodicTick()
int32 drain_amount = m_target->GetPower(power) > pdamage ? pdamage : m_target->GetPower(power);
// 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);
if (power == POWER_MANA)
drain_amount -= m_target->GetSpellCritDamageReduction(drain_amount);
m_target->ModifyPower(power, -drain_amount);
@ -6701,8 +6701,8 @@ void Aura::PeriodicTick()
return;
// resilience reduce mana draining effect at spell crit damage reduction (added in 2.4)
if (powerType == POWER_MANA && m_target->GetTypeId() == TYPEID_PLAYER)
pdamage -= ((Player*)m_target)->GetSpellCritDamageReduction(pdamage);
if (powerType == POWER_MANA)
pdamage -= m_target->GetSpellCritDamageReduction(pdamage);
uint32 gain = uint32(-m_target->ModifyPower(powerType, -pdamage));