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

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

View File

@@ -5556,6 +5556,7 @@ void Player::UpdateRating(CombatRating cr)
case CR_RESILIENCE_PLAYER_DAMAGE_TAKEN:
case CR_RESILIENCE_CRIT_TAKEN:
case CR_CRIT_TAKEN_SPELL: // Deprecated since Cataclysm
case CR_ARMOR_PENETRATION: // Deprecated since Cataclysm
break;
case CR_HASTE_MELEE: // Implemented in Player::ApplyRatingMod
case CR_HASTE_RANGED:
@@ -5572,10 +5573,6 @@ void Player::UpdateRating(CombatRating cr)
UpdateExpertise(OFF_ATTACK);
}
break;
case CR_ARMOR_PENETRATION:
if (affectStats)
UpdateArmorPenetration(amount);
break;
case CR_MASTERY:
UpdateMastery();
break;
@@ -8026,9 +8023,9 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply
case ITEM_MOD_MANA_REGENERATION:
ApplyManaRegenBonus(int32(val), apply);
break;
case ITEM_MOD_ARMOR_PENETRATION_RATING:
ApplyRatingMod(CR_ARMOR_PENETRATION, int32(val), apply);
break;
//case ITEM_MOD_ARMOR_PENETRATION_RATING:
// ApplyRatingMod(CR_ARMOR_PENETRATION, int32(val), apply);
// break;
case ITEM_MOD_SPELL_POWER:
ApplySpellPowerBonus(int32(val), apply);
break;
@@ -12136,16 +12133,6 @@ Item* Player::EquipItem(uint16 pos, Item* pItem, bool update)
UpdateExpertise(OFF_ATTACK);
UpdateArmorSpecialization();
switch (slot)
{
case EQUIPMENT_SLOT_MAINHAND:
case EQUIPMENT_SLOT_OFFHAND:
case EQUIPMENT_SLOT_RANGED:
RecalculateRating(CR_ARMOR_PENETRATION);
default:
break;
}
}
else
{
@@ -12309,16 +12296,6 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update)
}
else if (slot == EQUIPMENT_SLOT_OFFHAND)
UpdateExpertise(OFF_ATTACK);
// update armor penetration - passive auras may need it
switch (slot)
{
case EQUIPMENT_SLOT_MAINHAND:
case EQUIPMENT_SLOT_OFFHAND:
case EQUIPMENT_SLOT_RANGED:
RecalculateRating(CR_ARMOR_PENETRATION);
default:
break;
}
}
}
@@ -12438,17 +12415,6 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update)
if (slot < EQUIPMENT_SLOT_END)
{
// update expertise and armor penetration - passive auras may need it
switch (slot)
{
case EQUIPMENT_SLOT_MAINHAND:
case EQUIPMENT_SLOT_OFFHAND:
case EQUIPMENT_SLOT_RANGED:
RecalculateRating(CR_ARMOR_PENETRATION);
default:
break;
}
if (slot == EQUIPMENT_SLOT_MAINHAND)
UpdateExpertise(BASE_ATTACK);
else if (slot == EQUIPMENT_SLOT_OFFHAND)
@@ -13721,9 +13687,9 @@ void Player::ApplyReforgeEnchantment(Item* item, bool apply)
case ITEM_MOD_MANA_REGENERATION:
ApplyManaRegenBonus(-int32(removeValue), apply);
break;
case ITEM_MOD_ARMOR_PENETRATION_RATING:
ApplyRatingMod(CR_ARMOR_PENETRATION, -int32(removeValue), apply);
break;
//case ITEM_MOD_ARMOR_PENETRATION_RATING:
// ApplyRatingMod(CR_ARMOR_PENETRATION, -int32(removeValue), apply);
// break;
case ITEM_MOD_SPELL_POWER:
ApplySpellPowerBonus(-int32(removeValue), apply);
break;
@@ -13834,9 +13800,9 @@ void Player::ApplyReforgeEnchantment(Item* item, bool apply)
case ITEM_MOD_MANA_REGENERATION:
ApplyManaRegenBonus(int32(addValue), apply);
break;
case ITEM_MOD_ARMOR_PENETRATION_RATING:
ApplyRatingMod(CR_ARMOR_PENETRATION, int32(addValue), apply);
break;
//case ITEM_MOD_ARMOR_PENETRATION_RATING:
// ApplyRatingMod(CR_ARMOR_PENETRATION, int32(addValue), apply);
// break;
case ITEM_MOD_SPELL_POWER:
ApplySpellPowerBonus(int32(addValue), apply);
break;
@@ -14167,10 +14133,10 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
ApplyManaRegenBonus(enchant_amount, apply);
TC_LOG_DEBUG("entities.player.items", "+ %u MANA_REGENERATION", enchant_amount);
break;
case ITEM_MOD_ARMOR_PENETRATION_RATING:
ApplyRatingMod(CR_ARMOR_PENETRATION, enchant_amount, apply);
TC_LOG_DEBUG("entities.player.items", "+ %u ARMOR PENETRATION", enchant_amount);
break;
// case ITEM_MOD_ARMOR_PENETRATION_RATING:
// ApplyRatingMod(CR_ARMOR_PENETRATION, enchant_amount, apply);
// TC_LOG_DEBUG("entities.player.items", "+ %u ARMOR PENETRATION", enchant_amount);
// break;
case ITEM_MOD_SPELL_POWER:
ApplySpellPowerBonus(enchant_amount, apply);
TC_LOG_DEBUG("entities.player.items", "+ %u SPELL_POWER", enchant_amount);

View File

@@ -1838,7 +1838,6 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
void UpdateAllSpellCritChances();
void UpdateSpellCritChance(uint32 school);
void UpdateArmorPenetration(int32 amount);
void UpdateExpertise(WeaponAttackType attType);
void ApplyManaRegenBonus(int32 amount, bool apply);
void ApplyHealthRegenBonus(int32 amount, bool apply);

View File

@@ -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);

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;