aboutsummaryrefslogtreecommitdiff
path: root/src/game/StatSystem.cpp
diff options
context:
space:
mode:
authorMachiavelli <none@none>2009-06-16 18:40:57 +0200
committerMachiavelli <none@none>2009-06-16 18:40:57 +0200
commitbd054b84533305420e368fae85921e43c2382c78 (patch)
tree3ad43004b3505717781792afcdb80e7bf389bff2 /src/game/StatSystem.cpp
parente6c3d54e2686b4b7ee9f8ae3bd5815e126b8bfa6 (diff)
parent560ca5a2102a082f6712e1a3ec58f9f367532ade (diff)
*Merge
--HG-- branch : trunk
Diffstat (limited to 'src/game/StatSystem.cpp')
-rw-r--r--src/game/StatSystem.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp
index 896a6e98a4a..7a0b6f285eb 100644
--- a/src/game/StatSystem.cpp
+++ b/src/game/StatSystem.cpp
@@ -144,9 +144,9 @@ bool Player::UpdateAllStats()
SetStat(Stats(i), (int32)value);
}
- UpdateAttackPowerAndDamage();
- UpdateAttackPowerAndDamage(true);
UpdateArmor();
+ // calls UpdateAttackPowerAndDamage() in UpdateArmor for SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR
+ UpdateAttackPowerAndDamage(true);
UpdateMaxHealth();
for(int i = POWER_MANA; i < MAX_POWERS; ++i)
@@ -207,6 +207,8 @@ void Player::UpdateArmor()
Pet *pet = GetPet();
if(pet)
pet->UpdateArmor();
+
+ UpdateAttackPowerAndDamage(); // armor dependent auras update for SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR
}
float Player::GetHealthBonusFromStamina()
@@ -372,6 +374,11 @@ void Player::UpdateAttackPowerAndDamage(bool ranged )
AuraEffectList const& mAPbyStat = GetAurasByType(SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT);
for(AuraEffectList::const_iterator i = mAPbyStat.begin();i != mAPbyStat.end(); ++i)
attPowerMod += int32(GetStat(Stats((*i)->GetMiscValue())) * (*i)->GetAmount() / 100.0f);
+
+ AuraEffectList const& mAPbyArmor = GetAurasByType(SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR);
+ for(AuraEffectList::const_iterator iter = mAPbyArmor.begin(); iter != mAPbyArmor.end(); ++iter)
+ // always: ((*i)->GetModifier()->m_miscvalue == 1 == SPELL_SCHOOL_MASK_NORMAL)
+ attPowerMod += int32(GetArmor() / (*iter)->GetMiscValue());
}
float attPowerMultiplier = GetModifierValue(unitMod, TOTAL_PCT) - 1.0f;