Core/Scripts: Added SpellEffectInfo argument to CalcDamage and CalcHealing spell script hooks

Port From (https://github.com/TrinityCore/TrinityCore/commit/884662a75a901af6f61cab9efc171d052e8042f4)
This commit is contained in:
Hondacrx
2025-05-19 11:01:52 -04:00
parent 6097bf92cc
commit 94877fed77
13 changed files with 29 additions and 29 deletions
+1 -1
View File
@@ -5238,7 +5238,7 @@ namespace Game.Spells
// Add melee damage bonuses (also check for negative)
if (caster != null)
damage = (uint)caster.MeleeDamageBonusDone(target, (int)damage, attackType, DamageEffectType.DOT, GetSpellInfo(), GetSpellEffectInfo().Mechanic, GetSpellInfo().GetSchoolMask(), null, this);
damage = (uint)caster.MeleeDamageBonusDone(target, (int)damage, attackType, DamageEffectType.DOT, GetSpellInfo(), GetSpellEffectInfo(), GetSpellEffectInfo().Mechanic, GetSpellInfo().GetSchoolMask(), null, this);
damage = (uint)target.MeleeDamageBonusTaken(caster, (int)damage, attackType, DamageEffectType.DOT, GetSpellInfo());
break;
+4 -4
View File
@@ -8077,25 +8077,25 @@ namespace Game.Spells
}
}
public void CallScriptCalcDamageHandlers(Unit victim, ref int damage, ref int flatMod, ref float pctMod)
public void CallScriptCalcDamageHandlers(SpellEffectInfo spellEffectInfo, Unit victim, ref int damage, ref int flatMod, ref float pctMod)
{
foreach (SpellScript script in m_loadedScripts)
{
script._PrepareScriptCall(SpellScriptHookType.CalcDamage);
foreach (var calcDamage in script.CalcDamage)
calcDamage.Call(victim, ref damage, ref flatMod, ref pctMod);
calcDamage.Call(spellEffectInfo, victim, ref damage, ref flatMod, ref pctMod);
script._FinishScriptCall();
}
}
public void CallScriptCalcHealingHandlers(Unit victim, ref int healing, ref int flatMod, ref float pctMod)
public void CallScriptCalcHealingHandlers(SpellEffectInfo spellEffectInfo, Unit victim, ref int healing, ref int flatMod, ref float pctMod)
{
foreach (SpellScript script in m_loadedScripts)
{
script._PrepareScriptCall(SpellScriptHookType.CalcHealing);
foreach (var calcHealing in script.CalcHealing)
calcHealing.Call(victim, ref healing, ref flatMod, ref pctMod);
calcHealing.Call(spellEffectInfo, victim, ref healing, ref flatMod, ref pctMod);
script._FinishScriptCall();
}
+1 -1
View File
@@ -2498,7 +2498,7 @@ namespace Game.Spells
weaponDamage = Math.Max(weaponDamage, 0);
// Add melee damage bonuses (also check for negative)
weaponDamage = (uint)unitCaster.MeleeDamageBonusDone(unitTarget, (int)weaponDamage, m_attackType, DamageEffectType.SpellDirect, m_spellInfo, mechanic, m_spellSchoolMask, this);
weaponDamage = (uint)unitCaster.MeleeDamageBonusDone(unitTarget, (int)weaponDamage, m_attackType, DamageEffectType.SpellDirect, m_spellInfo, effectInfo, mechanic, m_spellSchoolMask, this);
m_damage += unitTarget.MeleeDamageBonusTaken(unitCaster, (int)weaponDamage, m_attackType, DamageEffectType.SpellDirect, m_spellInfo);
}