Core/AI: Add DamageEffectType and SpellInfo parameters to UnitAI::DamageTaken
Port From (https://github.com/TrinityCore/TrinityCore/commit/71c2f0af46b3ccec8c3422534e4403f3650b757d)
This commit is contained in:
@@ -655,7 +655,7 @@ namespace Game.AI
|
||||
}
|
||||
}
|
||||
|
||||
public override void DamageTaken(Unit attacker, ref uint damage)
|
||||
public override void DamageTaken(Unit attacker, ref uint damage, DamageEffectType damageType, SpellInfo spellInfo = null)
|
||||
{
|
||||
AttackStart(attacker);
|
||||
}
|
||||
|
||||
@@ -488,7 +488,7 @@ namespace Game.AI
|
||||
|
||||
// Called at any Damage to any victim (before damage apply)
|
||||
public virtual void DamageDealt(Unit victim, ref uint damage, DamageEffectType damageType) { }
|
||||
public virtual void DamageTaken(Unit attacker, ref uint damage) { }
|
||||
public virtual void DamageTaken(Unit attacker, ref uint damage, DamageEffectType damageType, SpellInfo spellInfo = null) { }
|
||||
public virtual void HealReceived(Unit by, uint addhealth) { }
|
||||
public virtual void HealDone(Unit to, uint addhealth) { }
|
||||
public virtual void SpellInterrupted(uint spellId, uint unTimeMs) { }
|
||||
|
||||
@@ -676,7 +676,7 @@ namespace Game.AI
|
||||
GetScript().ProcessEventsFor(SmartEvents.SpellHitTarget, target.ToUnit(), 0, 0, false, spellInfo, target.ToGameObject());
|
||||
}
|
||||
|
||||
public override void DamageTaken(Unit attacker, ref uint damage)
|
||||
public override void DamageTaken(Unit attacker, ref uint damage, DamageEffectType damageType, SpellInfo spellInfo = null)
|
||||
{
|
||||
GetScript().ProcessEventsFor(SmartEvents.Damaged, attacker, damage);
|
||||
|
||||
|
||||
@@ -2363,7 +2363,7 @@ namespace Game.Entities
|
||||
{
|
||||
UnitAI victimAI = victim.GetAI();
|
||||
if (victimAI != null)
|
||||
victimAI.DamageTaken(attacker, ref damage);
|
||||
victimAI.DamageTaken(attacker, ref damage, damagetype, spellProto);
|
||||
|
||||
UnitAI attackerAI = attacker ? attacker.GetAI() : null;
|
||||
if (attackerAI != null)
|
||||
|
||||
@@ -238,7 +238,7 @@ namespace Scripts.World.EmeraldDragons
|
||||
}
|
||||
|
||||
// Summon druid spirits on 75%, 50% and 25% health
|
||||
public override void DamageTaken(Unit attacker, ref uint damage)
|
||||
public override void DamageTaken(Unit attacker, ref uint damage, DamageEffectType damageType, SpellInfo spellInfo = null)
|
||||
{
|
||||
if (!HealthAbovePct(100 - 25 * _stage))
|
||||
{
|
||||
@@ -284,7 +284,7 @@ namespace Scripts.World.EmeraldDragons
|
||||
base.JustEngagedWith(who);
|
||||
}
|
||||
|
||||
public override void DamageTaken(Unit attacker, ref uint damage)
|
||||
public override void DamageTaken(Unit attacker, ref uint damage, DamageEffectType damageType, SpellInfo spellInfo = null)
|
||||
{
|
||||
if (!HealthAbovePct(100 - 25 * _stage))
|
||||
{
|
||||
@@ -371,7 +371,7 @@ namespace Scripts.World.EmeraldDragons
|
||||
base.JustEngagedWith(who);
|
||||
}
|
||||
|
||||
public override void DamageTaken(Unit attacker, ref uint damage)
|
||||
public override void DamageTaken(Unit attacker, ref uint damage, DamageEffectType damageType, SpellInfo spellInfo = null)
|
||||
{
|
||||
if (!HealthAbovePct(100 - 25 * _stage))
|
||||
{
|
||||
@@ -434,7 +434,7 @@ namespace Scripts.World.EmeraldDragons
|
||||
--_shades;
|
||||
}
|
||||
|
||||
public override void DamageTaken(Unit attacker, ref uint damage)
|
||||
public override void DamageTaken(Unit attacker, ref uint damage, DamageEffectType damageType, SpellInfo spellInfo = null)
|
||||
{
|
||||
// At 75, 50 or 25 percent health, we need to activate the shades and go "banished"
|
||||
// Note: _stage holds the amount of times they have been summoned
|
||||
|
||||
@@ -1315,7 +1315,7 @@ namespace Scripts.World.NpcSpecial
|
||||
|
||||
public npc_training_dummy(Creature creature) : base(creature) { }
|
||||
|
||||
public override void DamageTaken(Unit attacker, ref uint damage)
|
||||
public override void DamageTaken(Unit attacker, ref uint damage, DamageEffectType damageType, SpellInfo spellInfo = null)
|
||||
{
|
||||
damage = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user