diff options
author | win32 <> | 2010-01-21 13:48:27 +0200 |
---|---|---|
committer | win32 <> | 2010-01-21 13:48:27 +0200 |
commit | 2572e9ef8eacdd5944e8a63cf313c8a3c9ac7faf (patch) | |
tree | 9f0fedf87c181ea9a851754e70b3336769bea8f2 /src/game/StatSystem.cpp | |
parent | 1c310c887b40c8a415f4eb10c5aa7319c6855f4a (diff) |
* Add support for basedmg and baserangeddmg values in creature_classlevelstats.
* Remove mindmg, maxdmg, attackpower and ranged field in creature_template and add Dmg_Mod, Rangeddmg_Mod field.
--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 7197779fdfd..b5895fbb2e6 100644 --- a/src/game/StatSystem.cpp +++ b/src/game/StatSystem.cpp @@ -25,6 +25,7 @@ #include "SharedDefines.h" #include "SpellAuras.h" #include "SpellAuraEffects.h" +#include "ObjectMgr.h" /*####################################### ######## ######## @@ -865,7 +866,8 @@ void Creature::UpdateDamagePhysical(WeaponAttackType attType) float weapon_maxdamage = GetWeaponDamageRange(attType, MAXDAMAGE); /* difference in AP between current attack power and base value from DB */ - float att_pwr_change = GetTotalAttackPowerValue(attType) - GetCreatureInfo()->attackpower; + CreatureBaseStats const* stats = objmgr.GetCreatureBaseStats(getLevel(), GetCreatureInfo()->unit_class); + float att_pwr_change = GetTotalAttackPowerValue(attType) - stats->GenerateAttackPower(GetCreatureInfo()); 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); |