mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-14 20:22:23 -04:00
[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
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user