mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[7904] Change creature damage calculation formula.
* Add new creature_template field `dmg_multiplier` * Make attackpower include in creature damage not dependent from attack speed. NOTE: included in sql update recalculation for creature damage related fields only make temporary possible usable values. Real values need revisited by DB devs for correctness. Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
0614a9eb75
commit
2fc277fdb6
7 changed files with 21 additions and 9 deletions
|
|
@ -796,18 +796,17 @@ void Creature::UpdateDamagePhysical(WeaponAttackType attType)
|
|||
|
||||
UnitMods unitMod = UNIT_MOD_DAMAGE_MAINHAND;
|
||||
|
||||
float att_speed = float(GetAttackTime(BASE_ATTACK))/1000.0f;
|
||||
|
||||
float base_value = GetModifierValue(unitMod, BASE_VALUE) + GetTotalAttackPowerValue(attType)/ 14.0f * att_speed;
|
||||
float base_value = GetModifierValue(unitMod, BASE_VALUE) + GetTotalAttackPowerValue(attType);
|
||||
float base_pct = GetModifierValue(unitMod, BASE_PCT);
|
||||
float total_value = GetModifierValue(unitMod, TOTAL_VALUE);
|
||||
float total_pct = GetModifierValue(unitMod, TOTAL_PCT);
|
||||
float dmg_multiplier = GetCreatureInfo()->dmg_multiplier;
|
||||
|
||||
float weapon_mindamage = GetWeaponDamageRange(BASE_ATTACK, MINDAMAGE);
|
||||
float weapon_maxdamage = GetWeaponDamageRange(BASE_ATTACK, MAXDAMAGE);
|
||||
|
||||
float mindamage = ((base_value + weapon_mindamage) * base_pct + total_value) * total_pct ;
|
||||
float maxdamage = ((base_value + weapon_maxdamage) * base_pct + total_value) * total_pct ;
|
||||
float mindamage = ((base_value + weapon_mindamage) * base_pct + total_value) * total_pct * dmg_multiplier;
|
||||
float maxdamage = ((base_value + weapon_maxdamage) * base_pct + total_value) * total_pct * dmg_multiplier;
|
||||
|
||||
SetStatFloatValue(UNIT_FIELD_MINDAMAGE, mindamage);
|
||||
SetStatFloatValue(UNIT_FIELD_MAXDAMAGE, maxdamage);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue