Core/Stats: disabled armor penetration handlings and removed related functions as they are deprecated since Cataclysm
This commit is contained in:
1 parent
f990fbb7ab
commit
5cedd2dcc3
4 files changed
+14
-73
No files matched your search
@@ -226,7 +226,6 @@ bool Player::UpdateAllStats()
|
||||
UpdateManaRegen();
|
||||
UpdateExpertise(BASE_ATTACK);
|
||||
UpdateExpertise(OFF_ATTACK);
|
||||
RecalculateRating(CR_ARMOR_PENETRATION);
|
||||
UpdateAllResistances();
|
||||
|
||||
return true;
|
||||
@@ -673,12 +672,6 @@ void Player::UpdateSpellCritChance(uint32 school)
|
||||
SetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1 + school, crit);
|
||||
}
|
||||
|
||||
void Player::UpdateArmorPenetration(int32 amount)
|
||||
{
|
||||
// Store Rating Value
|
||||
SetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + CR_ARMOR_PENETRATION, amount);
|
||||
}
|
||||
|
||||
void Player::UpdateMeleeHitChances()
|
||||
{
|
||||
m_modMeleeHitChance = GetRatingBonusValue(CR_HIT_MELEE);
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user