aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/StatSystem.cpp7
-rw-r--r--src/game/Unit.cpp10
-rw-r--r--src/game/Unit.h1
3 files changed, 16 insertions, 2 deletions
diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp
index 7836b5336c5..798bf3299d0 100644
--- a/src/game/StatSystem.cpp
+++ b/src/game/StatSystem.cpp
@@ -71,9 +71,12 @@ bool Player::UpdateStats(Stats stat)
default:
break;
}
+
// Need update (exist AP from stat auras)
- UpdateAttackPowerAndDamage();
- UpdateAttackPowerAndDamage(true);
+ if (HasAuraTypeWithMiscvalue(SPELL_AURA_MOD_MEELE_ATTACK_POWER_OF_STAT_PERCENT, stat))
+ UpdateAttackPowerAndDamage(false);
+ if (HasAuraTypeWithMiscvalue(SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT, stat))
+ UpdateAttackPowerAndDamage(true);
UpdateSpellDamageAndHealingBonus();
UpdateManaRegen();
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index e211065f041..4cc5c532fc0 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -3403,6 +3403,16 @@ void Unit::DeMorph()
SetDisplayId(GetNativeDisplayId());
}
+bool Unit::HasAuraTypeWithMiscvalue(AuraType auratype, uint32 miscvalue) const
+{
+ AuraList const& mTotalAuraList = GetAurasByType(auratype);
+ for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
+ if (miscvalue == (*i)->GetModifier()->m_miscvalue)
+ return true;
+
+ return false;
+}
+
int32 Unit::GetTotalAuraModifier(AuraType auratype) const
{
int32 modifier = 0;
diff --git a/src/game/Unit.h b/src/game/Unit.h
index 181efff1571..48686bcef14 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1366,6 +1366,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
AuraList const& GetAurasByType(AuraType type) const { return m_modAuras[type]; }
void ApplyAuraProcTriggerDamage(Aura* aura, bool apply);
+ bool HasAuraTypeWithMiscvalue(AuraType auratype, uint32 miscvalue) const;
int32 GetTotalAuraModifier(AuraType auratype) const;
float GetTotalAuraMultiplier(AuraType auratype) const;
int32 GetMaxPositiveAuraModifier(AuraType auratype) const;