[8458] Re-implement SPELL_AURA_MOD_TARGET_ARMOR_PCT in more porper way for weapon dependent cases.

(cherry picked from commit 7efab7fd38c3a753e967648ca8ef1f2cdfbac76c)

Signed-off-by: VladimirMangos <vladimir@getmangos.com>

With some fixes and rewrites.
This commit is contained in:
sixsixnine 2009-09-04 02:14:37 +04:00 committed by VladimirMangos
parent 57158e9185
commit 63e7c092f1
7 changed files with 61 additions and 8 deletions

View file

@ -439,6 +439,7 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa
m_baseSpellPower = 0;
m_baseFeralAP = 0;
m_baseManaRegen = 0;
m_armorPenetrationPct = 0.0f;
// Honor System
m_lastHonorUpdateTime = time(NULL);
@ -4972,6 +4973,8 @@ void Player::ApplyRatingMod(CombatRating cr, int32 value, bool apply)
}
break;
case CR_ARMOR_PENETRATION:
if(affectStats)
UpdateArmorPenetration();
break;
}
}
@ -10441,9 +10444,15 @@ Item* Player::EquipItem( uint16 pos, Item *pItem, bool update )
ApplyEquipCooldown(pItem);
if( slot == EQUIPMENT_SLOT_MAINHAND )
{
UpdateExpertise(BASE_ATTACK);
UpdateArmorPenetration();
}
else if( slot == EQUIPMENT_SLOT_OFFHAND )
{
UpdateExpertise(OFF_ATTACK);
UpdateArmorPenetration();
}
}
else
{
@ -10583,9 +10592,13 @@ void Player::RemoveItem( uint8 bag, uint8 slot, bool update )
}
UpdateExpertise(BASE_ATTACK);
UpdateArmorPenetration();
}
else if( slot == EQUIPMENT_SLOT_OFFHAND )
{
UpdateExpertise(OFF_ATTACK);
UpdateArmorPenetration();
}
}
}
// need update known currency
@ -10694,10 +10707,16 @@ void Player::DestroyItem( uint8 bag, uint8 slot, bool update )
RemoveItemDependentAurasAndCasts(pItem);
// update expertise
if ( slot == EQUIPMENT_SLOT_MAINHAND )
if( slot == EQUIPMENT_SLOT_MAINHAND )
{
UpdateExpertise(BASE_ATTACK);
UpdateArmorPenetration();
}
else if( slot == EQUIPMENT_SLOT_OFFHAND )
{
UpdateExpertise(OFF_ATTACK);
UpdateArmorPenetration();
}
// equipment visual show
SetVisibleItemSlot(slot, NULL);