[9581] Fixed apply damage reduction to melee/ranged damage.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
laise 2010-03-13 21:47:42 +03:00 committed by VladimirMangos
parent ab7840a591
commit bae7d15bb9
2 changed files with 7 additions and 4 deletions

View file

@ -1558,11 +1558,14 @@ void Unit::CalculateMeleeDamage(Unit *pVictim, uint32 damage, CalcDamageInfo *da
// only from players
if (GetTypeId() == TYPEID_PLAYER)
{
uint32 redunction_affected_damage = CalcNotIgnoreDamageRedunction(damage,damageInfo->damageSchoolMask);
uint32 redunction_affected_damage = CalcNotIgnoreDamageRedunction(damageInfo->damage,damageInfo->damageSchoolMask);
uint32 resilienceReduction;
if (attackType != RANGED_ATTACK)
damage -= pVictim->GetMeleeDamageReduction(redunction_affected_damage);
resilienceReduction = pVictim->GetMeleeDamageReduction(redunction_affected_damage);
else
damage -= pVictim->GetRangedDamageReduction(redunction_affected_damage);
resilienceReduction = pVictim->GetRangedDamageReduction(redunction_affected_damage);
damageInfo->damage -= resilienceReduction;
damageInfo->cleanDamage += resilienceReduction;
}
// Calculate absorb resist