mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[9581] Fixed apply damage reduction to melee/ranged damage.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
ab7840a591
commit
bae7d15bb9
2 changed files with 7 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue