[10756] Implement armor penetration limitations

The tool-tip says "up to X%" for a reason...
This commit is contained in:
Lynx3d 2010-11-20 04:18:29 +01:00
parent 7663cf6329
commit 1ef8ea1161
2 changed files with 12 additions and 2 deletions

View file

@ -1841,7 +1841,17 @@ uint32 Unit::CalcArmorReducedDamage(Unit* pVictim, const uint32 damage)
// Apply Player CR_ARMOR_PENETRATION rating and percent talents
if (GetTypeId()==TYPEID_PLAYER)
armor *= 1.0f - ((Player*)this)->GetArmorPenetrationPct() / 100.0f;
{
float maxArmorPen = 400 + 85 * pVictim->getLevel();
if (getLevel() > 59)
maxArmorPen += 4.5f * 85 * (pVictim->getLevel()-59);
// Cap ignored armor to this value
maxArmorPen = std::min(((armor+maxArmorPen)/3), armor);
// Also, armor penetration is limited to 100% since 3.1.2, before greater values did
// continue to give benefit for targets with more armor than the above cap
float armorPenPct = std::min(100.f, ((Player*)this)->GetArmorPenetrationPct());
armor -= maxArmorPen * armorPenPct / 100.0f;
}
if (armor < 0.0f)
armor = 0.0f;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10755"
#define REVISION_NR "10756"
#endif // __REVISION_NR_H__