diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Player.h | 2 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 11 | ||||
-rw-r--r-- | src/game/StatSystem.cpp | 6 | ||||
-rw-r--r-- | src/game/Unit.h | 2 |
4 files changed, 11 insertions, 10 deletions
diff --git a/src/game/Player.h b/src/game/Player.h index 3e36a5f6802..44db36d30c4 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1670,7 +1670,7 @@ class MANGOS_DLL_SPEC Player : public Unit void ApplySpellPowerBonus(int32 amount, bool apply); void UpdateSpellDamageAndHealingBonus(); - void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, float& min_damage, float& max_damage); + void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& min_damage, float& max_damage); void UpdateDefenseBonusesMod(); void ApplyRatingMod(CombatRating cr, int32 value, bool apply); diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index c1e08006ad9..dd7bb3fe3e7 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -4262,7 +4262,7 @@ void Spell::SpellDamageWeaponDmg(uint32 i) // multiple weapon dmg effect workaround // execute only the last weapon damage // and handle all effects at once - for (int j = 0; j < 3; ++j) + for (int j = i+i; j < 3; ++j) { switch(m_spellInfo->Effect[j]) { @@ -4270,8 +4270,7 @@ void Spell::SpellDamageWeaponDmg(uint32 i) case SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL: case SPELL_EFFECT_NORMALIZED_WEAPON_DMG: case SPELL_EFFECT_WEAPON_PERCENT_DAMAGE: - if (j < i) // we must calculate only at last weapon effect - return; + return; // we must calculate only at last weapon effect break; } } @@ -4539,7 +4538,9 @@ void Spell::SpellDamageWeaponDmg(uint32 i) case RANGED_ATTACK: unitMod = UNIT_MOD_DAMAGE_RANGED; break; } - float weapon_total_pct = m_caster->GetModifierValue(unitMod, TOTAL_PCT); + float weapon_total_pct = 1.0f; + if ( m_spellInfo->SchoolMask & SPELL_SCHOOL_MASK_NORMAL ) + weapon_total_pct = m_caster->GetModifierValue(unitMod, TOTAL_PCT); if(fixed_bonus) fixed_bonus = int32(fixed_bonus * weapon_total_pct); @@ -4547,7 +4548,7 @@ void Spell::SpellDamageWeaponDmg(uint32 i) spell_bonus = int32(spell_bonus * weapon_total_pct); } - int32 weaponDamage = m_caster->CalculateDamage(m_attackType, normalized); + int32 weaponDamage = m_caster->CalculateDamage(m_attackType, normalized, true); // Sequence is important for (int j = 0; j < 3; ++j) diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp index 74d790de1a4..56bde0e5442 100644 --- a/src/game/StatSystem.cpp +++ b/src/game/StatSystem.cpp @@ -409,7 +409,7 @@ void Player::UpdateShieldBlockValue() SetUInt32Value(PLAYER_SHIELD_BLOCK, GetShieldBlockValue()); } -void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, float& min_damage, float& max_damage) +void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& min_damage, float& max_damage) { UnitMods unitMod; UnitMods attPower; @@ -436,7 +436,7 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, fl float base_value = GetModifierValue(unitMod, BASE_VALUE) + GetTotalAttackPowerValue(attType)/ 14.0f * att_speed; float base_pct = GetModifierValue(unitMod, BASE_PCT); float total_value = GetModifierValue(unitMod, TOTAL_VALUE); - float total_pct = GetModifierValue(unitMod, TOTAL_PCT); + float total_pct = addTotalPct ? GetModifierValue(unitMod, TOTAL_PCT) : 1.0f; float weapon_mindamage = GetWeaponDamageRange(attType, MINDAMAGE); float weapon_maxdamage = GetWeaponDamageRange(attType, MAXDAMAGE); @@ -476,7 +476,7 @@ void Player::UpdateDamagePhysical(WeaponAttackType attType) float mindamage; float maxdamage; - CalculateMinMaxDamage(attType,false,mindamage,maxdamage); + CalculateMinMaxDamage(attType, false, true, mindamage, maxdamage); switch(attType) { diff --git a/src/game/Unit.h b/src/game/Unit.h index 961a5c980e3..2869a7fe7ab 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1723,7 +1723,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject void RemoveGameObject(uint32 spellid, bool del); void RemoveAllGameObjects(); - uint32 CalculateDamage(WeaponAttackType attType, bool normalized); + uint32 CalculateDamage(WeaponAttackType attType, bool normalized, bool addTotalPct); float GetAPMultiplier(WeaponAttackType attType, bool normalized); void ModifyAuraState(AuraState flag, bool apply); uint32 BuildAuraStateUpdateForTarget(Unit * target) const; |