Core/AI: Added CreatureAI hook that is getting triggered when a spell cast has been successfully finished.

This commit is contained in:
hondacrx
2018-04-12 18:14:14 -04:00
parent d72ab68d4a
commit 70fb5c6fd8
2 changed files with 9 additions and 0 deletions
+3
View File
@@ -435,6 +435,9 @@ namespace Game.AI
// Called when a spell cast gets interrupted
public virtual void OnSpellCastInterrupt(SpellInfo spell) { }
// Called when a spell cast has been successfully finished
public virtual void OnSuccessfulSpellCast(SpellInfo spell) { }
// Called at reaching home after evade
public virtual void JustReachedHome() { }
+6
View File
@@ -2954,6 +2954,12 @@ namespace Game.Spells
hitMask |= ProcFlagsHit.Normal;
m_originalCaster.ProcSkillsAndAuras(null, procAttacker, ProcFlags.None, ProcFlagsSpellType.MaskAll, ProcFlagsSpellPhase.Cast, hitMask, this, null, null);
// Call CreatureAI hook OnSuccessfulSpellCast
Creature caster = m_originalCaster.ToCreature();
if (caster)
if (caster.IsAIEnabled)
caster.GetAI().OnSuccessfulSpellCast(GetSpellInfo());
}
void handle_immediate()