diff options
author | megamage <none@none> | 2009-07-30 11:02:07 +0800 |
---|---|---|
committer | megamage <none@none> | 2009-07-30 11:02:07 +0800 |
commit | a94cccbf4d900fd3e184239ce981a7dfbb6dc467 (patch) | |
tree | 6b5b98b3464a6c0ec3eef7484cf3910260239286 /src/game/StatSystem.cpp | |
parent | 7f6926dd3b1e2596e9cfa697b72afc7828f4e321 (diff) |
[8237] Apply attack power multiplier to creature bonus attackpower. Author: Lynx3d
Note: mindmg/maxdmg in creature_template expected including attackpower part in its.
attackpower field only show part of attackpower not affected by AP multiplier.
Thanks also to Seizer for take part in reseach and patch review.
--HG--
branch : trunk
Diffstat (limited to 'src/game/StatSystem.cpp')
-rw-r--r-- | src/game/StatSystem.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp index bd283c81fc5..fbe16c9b726 100644 --- a/src/game/StatSystem.cpp +++ b/src/game/StatSystem.cpp @@ -863,7 +863,9 @@ void Creature::UpdateDamagePhysical(WeaponAttackType attType) UnitMods unitMod = UNIT_MOD_DAMAGE_MAINHAND; - float base_value = GetModifierValue(unitMod, BASE_VALUE) + GetTotalAttackPowerValue(attType); + /* difference in AP between current attack power and base value from DB */ + float att_pwr_change = GetTotalAttackPowerValue(attType) - GetCreatureInfo()->attackpower; + float base_value = GetModifierValue(unitMod, BASE_VALUE) + (att_pwr_change * GetAPMultiplier(attType, false) / 14.0f); float base_pct = GetModifierValue(unitMod, BASE_PCT); float total_value = GetModifierValue(unitMod, TOTAL_VALUE); float total_pct = GetModifierValue(unitMod, TOTAL_PCT); |