diff options
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r-- | src/game/Player.cpp | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index af7057518fb..9c37f9a6bee 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -4999,6 +4999,8 @@ void Player::ApplyRatingMod(CombatRating cr, int32 value, bool apply) } break; case CR_ARMOR_PENETRATION: + if(affectStats) + UpdateArmorPenetration(amount); break; } } @@ -10625,10 +10627,22 @@ Item* Player::EquipItem( uint16 pos, Item *pItem, bool update ) ApplyEquipCooldown(pItem); + // update expertise and armor penetration - passive auras may need it + if( slot == EQUIPMENT_SLOT_MAINHAND ) UpdateExpertise(BASE_ATTACK); else if( slot == EQUIPMENT_SLOT_OFFHAND ) UpdateExpertise(OFF_ATTACK); + + switch(slot) + { + case EQUIPMENT_SLOT_MAINHAND: + case EQUIPMENT_SLOT_OFFHAND: + case EQUIPMENT_SLOT_RANGED: + RecalculateRating(CR_ARMOR_PENETRATION); + default: + break; + } } else { @@ -10771,6 +10785,16 @@ 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; + } } } // need update known currency @@ -10878,7 +10902,17 @@ void Player::DestroyItem( uint8 bag, uint8 slot, bool update ) // remove item dependent auras and casts (only weapon and armor slots) RemoveItemDependentAurasAndCasts(pItem); - // update expertise + // 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 ) |