[8024] Implement SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR(285). Author: Beaste

Also drop outdated support code for 61216 and ranks.
    This implement work talents 61216 and 48978 with ranks.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-06-16 11:02:37 -05:00
parent 0916d5f189
commit aaec3c8191
4 changed files with 28 additions and 25 deletions

View File

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