mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-21 15:27:47 -04:00
Core/Auras: implemented SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR delay mechanic
This commit is contained in:
@@ -209,7 +209,7 @@ bool Player::UpdateAllStats()
|
||||
}
|
||||
|
||||
UpdateArmor();
|
||||
// calls UpdateAttackPowerAndDamage() in UpdateArmor for SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR
|
||||
UpdateAttackPowerAndDamage(false);
|
||||
UpdateAttackPowerAndDamage(true);
|
||||
UpdateMaxHealth();
|
||||
|
||||
@@ -276,8 +276,6 @@ 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()
|
||||
@@ -461,22 +459,20 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
|
||||
if ((getClassMask() & CLASSMASK_WAND_USERS) == 0)
|
||||
{
|
||||
AuraEffectList const& mRAPbyStat = GetAuraEffectsByType(SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT);
|
||||
for (AuraEffectList::const_iterator i = mRAPbyStat.begin(); i != mRAPbyStat.end(); ++i)
|
||||
attPowerMod += CalculatePct(GetStat(Stats((*i)->GetMiscValue())), (*i)->GetAmount());
|
||||
for (AuraEffect const* aurEff : mRAPbyStat)
|
||||
attPowerMod += CalculatePct(GetStat(Stats(aurEff->GetMiscValue())), aurEff->GetAmount());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AuraEffectList const& mAPbyStat = GetAuraEffectsByType(SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT);
|
||||
for (AuraEffectList::const_iterator i = mAPbyStat.begin(); i != mAPbyStat.end(); ++i)
|
||||
attPowerMod += CalculatePct(GetStat(Stats((*i)->GetMiscValue())), (*i)->GetAmount());
|
||||
|
||||
AuraEffectList const& mAPbyArmor = GetAuraEffectsByType(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)->GetAmount());
|
||||
for (AuraEffect const* aurEff : mAPbyStat)
|
||||
attPowerMod += CalculatePct(GetStat(Stats(aurEff->GetMiscValue())), aurEff->GetAmount());
|
||||
}
|
||||
|
||||
// applies to both, amount updated in PeriodicTick each 30 seconds
|
||||
attPowerMod += GetTotalAuraModifier(SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR);
|
||||
|
||||
float attPowerMultiplier = GetPctModifierValue(unitMod, TOTAL_PCT) - 1.0f;
|
||||
|
||||
SetInt32Value(index, (uint32)base_attPower); //UNIT_FIELD_(RANGED)_ATTACK_POWER field
|
||||
|
||||
Reference in New Issue
Block a user