Core/AI: refactor SpellHit and SpellHitTarget.
Port From (https://github.com/TrinityCore/TrinityCore/commit/3171cd3fa9dbcec43f5d70b74ab2f54a2aa44173)
This commit is contained in:
@@ -486,12 +486,10 @@ namespace Game.AI
|
||||
public virtual void JustUnregisteredAreaTrigger(AreaTrigger areaTrigger) { }
|
||||
|
||||
// Called when hit by a spell
|
||||
public virtual void SpellHit(Unit caster, SpellInfo spellInfo) { }
|
||||
public virtual void SpellHitByGameObject(GameObject caster, SpellInfo spellInfo) { }
|
||||
public virtual void SpellHit(WorldObject caster, SpellInfo spellInfo) { }
|
||||
|
||||
// Called when spell hits a target
|
||||
public virtual void SpellHitTarget(Unit target, SpellInfo spellInfo) { }
|
||||
public virtual void SpellHitTargetGameObject(GameObject target, SpellInfo spellInfo) { }
|
||||
public virtual void SpellHitTarget(WorldObject target, SpellInfo spellInfo) { }
|
||||
|
||||
// Called when a spell cast gets interrupted
|
||||
public virtual void OnSpellCastInterrupt(SpellInfo spell) { }
|
||||
|
||||
@@ -95,12 +95,10 @@ namespace Game.AI
|
||||
public virtual void EventInform(uint eventId) { }
|
||||
|
||||
// Called when hit by a spell
|
||||
public virtual void SpellHit(Unit caster, SpellInfo spellInfo) { }
|
||||
public virtual void SpellHitByGameObject(GameObject caster, SpellInfo spellInfo) { }
|
||||
public virtual void SpellHit(WorldObject caster, SpellInfo spellInfo) { }
|
||||
|
||||
// Called when spell hits a target
|
||||
public virtual void SpellHitTarget(Unit target, SpellInfo spellInfo) { }
|
||||
public virtual void SpellHitTargetGameObject(GameObject target, SpellInfo spellInfo) { }
|
||||
public virtual void SpellHitTarget(WorldObject target, SpellInfo spellInfo) { }
|
||||
|
||||
// Called when the gameobject summon successfully other creature
|
||||
public virtual void JustSummoned(Creature summon) { }
|
||||
|
||||
@@ -664,24 +664,14 @@ namespace Game.AI
|
||||
}
|
||||
}
|
||||
|
||||
public override void SpellHit(Unit caster, SpellInfo spellInfo)
|
||||
public override void SpellHit(WorldObject caster, SpellInfo spellInfo)
|
||||
{
|
||||
GetScript().ProcessEventsFor(SmartEvents.SpellHit, caster, 0, 0, false, spellInfo);
|
||||
}
|
||||
|
||||
public override void SpellHitByGameObject(GameObject obj, SpellInfo spellInfo)
|
||||
{
|
||||
GetScript().ProcessEventsFor(SmartEvents.SpellHit, null, 0, 0, false, spellInfo, obj);
|
||||
GetScript().ProcessEventsFor(SmartEvents.SpellHit, caster.ToUnit(), 0, 0, false, spellInfo, caster.ToGameObject());
|
||||
}
|
||||
|
||||
public override void SpellHitTarget(Unit target, SpellInfo spellInfo)
|
||||
public override void SpellHitTarget(WorldObject target, SpellInfo spellInfo)
|
||||
{
|
||||
GetScript().ProcessEventsFor(SmartEvents.SpellHitTarget, target, 0, 0, false, spellInfo);
|
||||
}
|
||||
|
||||
public override void SpellHitTargetGameObject(GameObject target, SpellInfo spellInfo)
|
||||
{
|
||||
GetScript().ProcessEventsFor(SmartEvents.SpellHitTarget, null, 0, 0, false, spellInfo, target);
|
||||
GetScript().ProcessEventsFor(SmartEvents.SpellHitTarget, target.ToUnit(), 0, 0, false, spellInfo, target.ToGameObject());
|
||||
}
|
||||
|
||||
public override void DamageTaken(Unit attacker, ref uint damage)
|
||||
@@ -1199,9 +1189,9 @@ namespace Game.AI
|
||||
GetScript().ProcessEventsFor(SmartEvents.GoEventInform, null, eventId);
|
||||
}
|
||||
|
||||
public override void SpellHit(Unit unit, SpellInfo spellInfo)
|
||||
public override void SpellHit(WorldObject caster, SpellInfo spellInfo)
|
||||
{
|
||||
GetScript().ProcessEventsFor(SmartEvents.SpellHit, unit, 0, 0, false, spellInfo);
|
||||
GetScript().ProcessEventsFor(SmartEvents.SpellHit, caster.ToUnit(), 0, 0, false, spellInfo);
|
||||
}
|
||||
|
||||
public override void JustSummoned(Creature creature)
|
||||
|
||||
Reference in New Issue
Block a user