aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authormaximius <none@none>2009-09-14 16:49:23 -0700
committermaximius <none@none>2009-09-14 16:49:23 -0700
commit140ec674a040bdc04086472330a289c2d15ecc65 (patch)
tree343ac40e805c3139a2bc1bd80e956e89c5a1653c /src/game/Unit.cpp
parentb37f9b1e55bd4b80597b8b8c3f461aad70ccc5c1 (diff)
Backed out changeset d3fe2d6d504a (please test your patches thoroughly before getting me to push them ogeraisi)
--HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 5fec651dd47..dac9f91a16e 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -1671,9 +1671,21 @@ uint32 Unit::CalcArmorReducedDamage(Unit* pVictim, const uint32 damage, SpellEnt
}
}
- // Apply Player CR_ARMOR_PENETRATION rating and percent talents
+ // Apply Player CR_ARMOR_PENETRATION rating
if (GetTypeId()==TYPEID_PLAYER)
- armor *= 1.0f - ((Player*)this)->GetArmorPenetrationPct() / 100.0f;
+ {
+ float maxArmorPen=0;
+ if (getLevel()<60)
+ maxArmorPen=400+85*pVictim->getLevel();
+ else
+ maxArmorPen=400+85*pVictim->getLevel()+4.5*85*(pVictim->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 = maxArmorPen*((Player*)this)->GetRatingBonusValue(CR_ARMOR_PENETRATION) / 100.0f;
+ // Got the value, apply it
+ armor -= armorPen;
+ }
// Ignore enemy armor by SPELL_AURA_MOD_TARGET_ARMOR_PCT
//armor *= 1.0f - GetTotalAuraModifier(SPELL_AURA_MOD_ARMOR_PENETRATION_PCT) / 100.0f;