From 451471d438e234698a91f15d63b17df3ec3327f4 Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 28 May 2009 18:29:59 -0500 Subject: [7904] Change creature damage calculation formula. Author: Seizerkiller * 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. --HG-- branch : trunk --- src/game/StatSystem.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/game/StatSystem.cpp') diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp index 4cf93760957..87bd8a46825 100644 --- a/src/game/StatSystem.cpp +++ b/src/game/StatSystem.cpp @@ -842,16 +842,14 @@ void Creature::UpdateDamagePhysical(WeaponAttackType attType) float weapon_mindamage = GetWeaponDamageRange(attType, MINDAMAGE); float weapon_maxdamage = GetWeaponDamageRange(attType, MAXDAMAGE); - //This formula is not correct - //The correct one is (Damage_from_AttackPower + Base_Weapon_Damage) * Multiplier - //We do not know the multiplier, so we assume attack power is about 25% damage - //float base_value = GetModifierValue(unitMod, BASE_VALUE) + GetTotalAttackPowerValue(attType)/ 14.0f * att_speed; float base_value = GetModifierValue(unitMod, BASE_VALUE) + (weapon_mindamage + weapon_maxdamage) / 6 * GetTotalAttackPowerValue(attType) / (getLevel() * 5); + //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; if(!CanUseAttackType(attType)) { @@ -859,8 +857,8 @@ void Creature::UpdateDamagePhysical(WeaponAttackType attType) weapon_maxdamage = 0; } - 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; switch(attType) { -- cgit v1.2.3