mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[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:
parent
57158e9185
commit
63e7c092f1
7 changed files with 61 additions and 8 deletions
|
|
@ -132,6 +132,7 @@ bool Player::UpdateAllStats()
|
|||
UpdateAllSpellCritChances();
|
||||
UpdateDefenseBonusesMod();
|
||||
UpdateShieldBlockValue();
|
||||
UpdateArmorPenetration();
|
||||
UpdateSpellDamageAndHealingBonus();
|
||||
UpdateManaRegen();
|
||||
UpdateExpertise(BASE_ATTACK);
|
||||
|
|
@ -648,6 +649,30 @@ void Player::UpdateExpertise(WeaponAttackType attack)
|
|||
}
|
||||
}
|
||||
|
||||
void Player::UpdateArmorPenetration()
|
||||
{
|
||||
m_armorPenetrationPct = GetRatingBonusValue(CR_ARMOR_PENETRATION);
|
||||
|
||||
AuraList const& armorAuras = GetAurasByType(SPELL_AURA_MOD_TARGET_ARMOR_PCT);
|
||||
for(AuraList::const_iterator itr = armorAuras.begin(); itr != armorAuras.end(); ++itr)
|
||||
{
|
||||
// affects all weapons
|
||||
if((*itr)->GetSpellProto()->EquippedItemClass == -1)
|
||||
{
|
||||
m_armorPenetrationPct += (*itr)->GetModifier()->m_amount;
|
||||
continue;
|
||||
}
|
||||
|
||||
// dependent on weapon class
|
||||
for(uint8 i = 0; i < MAX_ATTACK; ++i)
|
||||
{
|
||||
Item *weapon = GetWeaponForAttack(WeaponAttackType(i));
|
||||
if(weapon && weapon->IsFitToSpellRequirements((*itr)->GetSpellProto()))
|
||||
m_armorPenetrationPct += (*itr)->GetModifier()->m_amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Player::ApplyManaRegenBonus(int32 amount, bool apply)
|
||||
{
|
||||
m_baseManaRegen+= apply ? amount : -amount;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue