Core/Players: Corrected shield block value calculations

This commit is contained in:
Shauren
2021-02-20 14:00:48 +01:00
parent 411631743a
commit 31d3080091
4 changed files with 20 additions and 6 deletions
+2 -2
View File
@@ -1363,7 +1363,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam
damageInfo->HitInfo |= HITINFO_BLOCK;
damageInfo->originalDamage = damageInfo->damage;
// 30% damage blocked, double blocked amount if block is critical
damageInfo->blocked_amount = CalculatePct(damageInfo->damage, damageInfo->target->isBlockCritical() ? damageInfo->target->GetBlockPercent() * 2 : damageInfo->target->GetBlockPercent());
damageInfo->blocked_amount = CalculatePct(damageInfo->damage, damageInfo->target->isBlockCritical() ? damageInfo->target->GetBlockPercent(getLevel()) * 2 : damageInfo->target->GetBlockPercent(getLevel()));
damageInfo->damage -= damageInfo->blocked_amount;
damageInfo->cleanDamage += damageInfo->blocked_amount;
break;
@@ -1649,7 +1649,7 @@ uint32 Unit::CalcArmorReducedDamage(Unit* attacker, Unit* victim, const uint32 d
// Expansion and ContentTuningID necessary? Does Player get a ContentTuningID too ?
float armorConstant = sDB2Manager.EvaluateExpectedStat(ExpectedStatType::ArmorConstant, attackerLevel, -2, 0, Classes(attacker->getClass()));
if (!armorConstant)
if (!(armor + armorConstant))
return damage;
float mitigation = std::min(armor / (armor + armorConstant), 0.85f);