Core/Auras: Fix SPELL_AURA_MOD_DAMAGE_DONE_FOR_MECHANIC for effects mechanics

Port From (https://github.com/TrinityCore/TrinityCore/commit/64e8e11377c9b0bf92e81afb38e0668ba3fdf3f4)
This commit is contained in:
hondacrx
2022-05-09 13:11:27 -04:00
parent 1f184161b9
commit 94eea137ae
4 changed files with 13 additions and 8 deletions
+4 -2
View File
@@ -3655,7 +3655,7 @@ namespace Game.Entities
return (uint)Math.Max(damage * (1.0f - mitigation), 0.0f);
}
public uint MeleeDamageBonusDone(Unit victim, uint damage, WeaponAttackType attType, DamageEffectType damagetype, SpellInfo spellProto = null, SpellSchoolMask damageSchoolMask = SpellSchoolMask.Normal)
public uint MeleeDamageBonusDone(Unit victim, uint damage, WeaponAttackType attType, DamageEffectType damagetype, SpellInfo spellProto = null, SpellEffectInfo spellEffectInfo = null, SpellSchoolMask damageSchoolMask = SpellSchoolMask.Normal)
{
if (victim == null || damage == 0)
return 0;
@@ -3741,7 +3741,9 @@ namespace Game.Entities
});
// Add SPELL_AURA_MOD_DAMAGE_DONE_FOR_MECHANIC percent bonus
if (spellProto != null)
if (spellEffectInfo != null && spellEffectInfo.Mechanic != 0)
MathFunctions.AddPct(ref DoneTotalMod, GetTotalAuraModifierByMiscValue(AuraType.ModDamageDoneForMechanic, (int)spellEffectInfo.Mechanic));
else if (spellProto != null && spellProto.Mechanic != 0)
MathFunctions.AddPct(ref DoneTotalMod, GetTotalAuraModifierByMiscValue(AuraType.ModDamageDoneForMechanic, (int)spellProto.Mechanic));
float damageF = damage;