mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
fix(Core/Spells): weapon damage based magic abilities gain too much effect from spell aura % damage increase (#22232)
This commit is contained in:
@@ -3576,30 +3576,26 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)
|
||||
}
|
||||
}
|
||||
|
||||
// apply to non-weapon bonus weapon total pct effect, weapon total flat effect included in weapon damage
|
||||
if (fixed_bonus || spell_bonus)
|
||||
bool const isPhysical = (m_spellSchoolMask & SPELL_SCHOOL_MASK_NORMAL);
|
||||
if (isPhysical && (fixed_bonus || spell_bonus))
|
||||
{
|
||||
UnitMods unitMod;
|
||||
switch (m_attackType)
|
||||
{
|
||||
default:
|
||||
case BASE_ATTACK:
|
||||
unitMod = UNIT_MOD_DAMAGE_MAINHAND;
|
||||
break;
|
||||
case OFF_ATTACK:
|
||||
unitMod = UNIT_MOD_DAMAGE_OFFHAND;
|
||||
break;
|
||||
case RANGED_ATTACK:
|
||||
unitMod = UNIT_MOD_DAMAGE_RANGED;
|
||||
break;
|
||||
}
|
||||
|
||||
if (m_spellSchoolMask & SPELL_SCHOOL_MASK_NORMAL)
|
||||
{
|
||||
float weapon_total_pct = m_caster->GetModifierValue(unitMod, TOTAL_PCT);
|
||||
fixed_bonus = int32(fixed_bonus * weapon_total_pct);
|
||||
spell_bonus = int32(spell_bonus * weapon_total_pct);
|
||||
default:
|
||||
case BASE_ATTACK:
|
||||
unitMod = UNIT_MOD_DAMAGE_MAINHAND;
|
||||
break;
|
||||
case OFF_ATTACK:
|
||||
unitMod = UNIT_MOD_DAMAGE_OFFHAND;
|
||||
break;
|
||||
case RANGED_ATTACK:
|
||||
unitMod = UNIT_MOD_DAMAGE_RANGED;
|
||||
break;
|
||||
}
|
||||
float weapon_total_pct = m_caster->GetModifierValue(unitMod, TOTAL_PCT);
|
||||
fixed_bonus = int32(fixed_bonus * weapon_total_pct);
|
||||
spell_bonus = int32(spell_bonus * weapon_total_pct);
|
||||
}
|
||||
|
||||
int32 weaponDamage = 0;
|
||||
@@ -3607,15 +3603,11 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)
|
||||
if (m_caster->GetEntry() == 27893)
|
||||
{
|
||||
if (Unit* owner = m_caster->GetOwner())
|
||||
weaponDamage = owner->CalculateDamage(m_attackType, normalized, true);
|
||||
}
|
||||
else if (m_spellInfo->Id == 5019) // Wands
|
||||
{
|
||||
weaponDamage = m_caster->CalculateDamage(m_attackType, true, false);
|
||||
weaponDamage = owner->CalculateDamage(m_attackType, normalized, isPhysical);
|
||||
}
|
||||
else
|
||||
{
|
||||
weaponDamage = m_caster->CalculateDamage(m_attackType, normalized, true);
|
||||
weaponDamage = m_caster->CalculateDamage(m_attackType, normalized, isPhysical);
|
||||
}
|
||||
|
||||
// Sequence is important
|
||||
|
||||
Reference in New Issue
Block a user