Core/Stats: disabled armor penetration handlings and removed related functions as they are deprecated since Cataclysm

This commit is contained in:
Ovahlord committed 2019-12-08 01:04:15 +01:00
1 parent f990fbb7ab
commit 5cedd2dcc3
4 files changed
+14 -73

No files matched your search

-17
View File
@@ -1702,23 +1702,6 @@ uint32 Unit::CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo
armor = std::floor(AddPct(armor, -(*j)->GetAmount()));
}
// Apply Player CR_ARMOR_PENETRATION rating
if (GetTypeId() == TYPEID_PLAYER)
{
float maxArmorPen = 0;
if (victim->getLevel() < 60)
maxArmorPen = float(400 + 85 * victim->getLevel());
else
maxArmorPen = 400 + 85 * victim->getLevel() + 4.5f * 85 * (victim->getLevel() - 59);
// Cap armor penetration to this number
maxArmorPen = std::min((armor + maxArmorPen) / 3, armor);
// Figure out how much armor do we ignore
float armorPen = CalculatePct(maxArmorPen, ToPlayer()->GetRatingBonusValue(CR_ARMOR_PENETRATION));
// Got the value, apply it
armor -= std::min(armorPen, maxArmorPen);
}
if (armor < 0.0f)
armor = 0.0f;