mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
[10756] Implement armor penetration limitations
The tool-tip says "up to X%" for a reason...
This commit is contained in:
parent
7663cf6329
commit
1ef8ea1161
2 changed files with 12 additions and 2 deletions
|
|
@ -1841,7 +1841,17 @@ uint32 Unit::CalcArmorReducedDamage(Unit* pVictim, const uint32 damage)
|
||||||
|
|
||||||
// Apply Player CR_ARMOR_PENETRATION rating and percent talents
|
// Apply Player CR_ARMOR_PENETRATION rating and percent talents
|
||||||
if (GetTypeId()==TYPEID_PLAYER)
|
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)
|
if (armor < 0.0f)
|
||||||
armor = 0.0f;
|
armor = 0.0f;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10755"
|
#define REVISION_NR "10756"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue