fix(Core/Spells): weapon damage based magic abilities gain too much effect from spell aura % damage increase (#22232)

This commit is contained in:
Macs-Account
2025-06-05 09:48:38 -06:00
committed by GitHub
parent 2b70446322
commit 31ea22acc4

View File

@@ -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 bool const isPhysical = (m_spellSchoolMask & SPELL_SCHOOL_MASK_NORMAL);
if (fixed_bonus || spell_bonus) if (isPhysical && (fixed_bonus || spell_bonus))
{ {
UnitMods unitMod; UnitMods unitMod;
switch (m_attackType) switch (m_attackType)
{ {
default: default:
case BASE_ATTACK: case BASE_ATTACK:
unitMod = UNIT_MOD_DAMAGE_MAINHAND; unitMod = UNIT_MOD_DAMAGE_MAINHAND;
break; break;
case OFF_ATTACK: case OFF_ATTACK:
unitMod = UNIT_MOD_DAMAGE_OFFHAND; unitMod = UNIT_MOD_DAMAGE_OFFHAND;
break; break;
case RANGED_ATTACK: case RANGED_ATTACK:
unitMod = UNIT_MOD_DAMAGE_RANGED; unitMod = UNIT_MOD_DAMAGE_RANGED;
break; 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);
} }
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; int32 weaponDamage = 0;
@@ -3607,15 +3603,11 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)
if (m_caster->GetEntry() == 27893) if (m_caster->GetEntry() == 27893)
{ {
if (Unit* owner = m_caster->GetOwner()) if (Unit* owner = m_caster->GetOwner())
weaponDamage = owner->CalculateDamage(m_attackType, normalized, true); weaponDamage = owner->CalculateDamage(m_attackType, normalized, isPhysical);
}
else if (m_spellInfo->Id == 5019) // Wands
{
weaponDamage = m_caster->CalculateDamage(m_attackType, true, false);
} }
else else
{ {
weaponDamage = m_caster->CalculateDamage(m_attackType, normalized, true); weaponDamage = m_caster->CalculateDamage(m_attackType, normalized, isPhysical);
} }
// Sequence is important // Sequence is important