Implement SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT aura

Remove redurant check m_miscvalue on Intelect for SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT

Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
DiSlord 2008-12-20 23:56:58 +03:00
parent 061e73492e
commit 4090872bfa
3 changed files with 29 additions and 13 deletions

View file

@ -308,11 +308,20 @@ void Player::UpdateAttackPowerAndDamage(bool ranged )
float attPowerMod = GetModifierValue(unitMod, TOTAL_VALUE);
//add dynamic flat mods
if( ranged && (getClassMask() & CLASSMASK_WAND_USERS)==0)
if ((getClassMask() & CLASSMASK_WAND_USERS)==0)
{
AuraList const& mRAPbyIntellect = GetAurasByType(SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT);
for(AuraList::const_iterator i = mRAPbyIntellect.begin();i != mRAPbyIntellect.end(); ++i)
attPowerMod += int32(GetStat(Stats((*i)->GetModifier()->m_miscvalue)) * (*i)->GetModifier()->m_amount / 100.0f);
if( ranged )
{
AuraList const& mRAPbyIntellect = GetAurasByType(SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT);
for(AuraList::const_iterator i = mRAPbyIntellect.begin();i != mRAPbyIntellect.end(); ++i)
attPowerMod += int32(GetStat(Stats((*i)->GetModifier()->m_miscvalue)) * (*i)->GetModifier()->m_amount / 100.0f);
}
else
{
AuraList const& mRAPbyIntellect = GetAurasByType(SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT);
for(AuraList::const_iterator i = mRAPbyIntellect.begin();i != mRAPbyIntellect.end(); ++i)
attPowerMod += int32(GetStat(Stats((*i)->GetModifier()->m_miscvalue)) * (*i)->GetModifier()->m_amount / 100.0f);
}
}
float attPowerMultiplier = GetModifierValue(unitMod, TOTAL_PCT) - 1.0f;