Core/Scripts: Add SpellInfo argument to ScriptMgr::ModifySpellDamageTaken
Port From (https://github.com/TrinityCore/TrinityCore/commit/995fb23bc11e5dff3f21e1afa977934b76482d1b)
This commit is contained in:
@@ -2475,7 +2475,7 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Script Hook For CalculateSpellDamageTaken -- Allow scripts to change the Damage post class mitigation calculations
|
// Script Hook For CalculateSpellDamageTaken -- Allow scripts to change the Damage post class mitigation calculations
|
||||||
Global.ScriptMgr.ModifySpellDamageTaken(damageInfo.target, damageInfo.attacker, ref damage);
|
Global.ScriptMgr.ModifySpellDamageTaken(damageInfo.target, damageInfo.attacker, ref damage, spellInfo);
|
||||||
|
|
||||||
// Calculate absorb resist
|
// Calculate absorb resist
|
||||||
if (damage < 0)
|
if (damage < 0)
|
||||||
|
|||||||
@@ -303,7 +303,7 @@ namespace Game.Scripting
|
|||||||
public virtual void ModifyMeleeDamage(Unit target, Unit attacker, ref uint damage) { }
|
public virtual void ModifyMeleeDamage(Unit target, Unit attacker, ref uint damage) { }
|
||||||
|
|
||||||
// Called when Spell Damage is being Dealt
|
// Called when Spell Damage is being Dealt
|
||||||
public virtual void ModifySpellDamageTaken(Unit target, Unit attacker, ref int damage) { }
|
public virtual void ModifySpellDamageTaken(Unit target, Unit attacker, ref int damage, SpellInfo spellInfo) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GenericCreatureScript<AI> : CreatureScript where AI : CreatureAI
|
public class GenericCreatureScript<AI> : CreatureScript where AI : CreatureAI
|
||||||
|
|||||||
@@ -1127,10 +1127,11 @@ namespace Game.Scripting
|
|||||||
ForEach<UnitScript>(p => p.ModifyMeleeDamage(target, attacker, ref dmg));
|
ForEach<UnitScript>(p => p.ModifyMeleeDamage(target, attacker, ref dmg));
|
||||||
damage = dmg;
|
damage = dmg;
|
||||||
}
|
}
|
||||||
public void ModifySpellDamageTaken(Unit target, Unit attacker, ref int damage)
|
public void ModifySpellDamageTaken(Unit target, Unit attacker, ref int damage, SpellInfo spellInfo)
|
||||||
{
|
{
|
||||||
int dmg = damage;
|
int dmg = damage;
|
||||||
ForEach<UnitScript>(p => p.ModifySpellDamageTaken(target, attacker, ref dmg));
|
ForEach<UnitScript>(p => p.ModifySpellDamageTaken(target, attacker, ref dmg, spellInfo));
|
||||||
|
ForEach<PlayerScript>(p => p.ModifySpellDamageTaken(target, attacker, ref dmg, spellInfo));
|
||||||
damage = dmg;
|
damage = dmg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user