Core/Spells: enable and implement SMSG_MISSILE_CANCEL

Port From (https://github.com/TrinityCore/TrinityCore/commit/71db17220ae67dc6a354e88451ffc0700fe6c5f9)
This commit is contained in:
hondacrx
2020-08-22 12:58:19 -04:00
parent 9c4ce970b1
commit b3ebc2f8b5
4 changed files with 59 additions and 1 deletions
+13
View File
@@ -4418,6 +4418,15 @@ namespace Game.Spells
Global.SpellMgr.GetSpellEffectHandler(eff).Invoke(this, i);
}
public static Spell ExtractSpellFromEvent(BasicEvent basicEvent)
{
SpellEvent spellEvent = (SpellEvent)basicEvent;
if (spellEvent != null)
return spellEvent.GetSpell();
return null;
}
public SpellCastResult CheckCast(bool strict)
{
uint param1 = 0, param2 = 0;
@@ -7998,17 +8007,21 @@ namespace Game.Spells
m_Spell.GetCaster().m_Events.AddEvent(this, e_time + 1, false);
return false; // event not complete
}
public override void Abort(ulong e_time)
{
// oops, the spell we try to do is aborted
if (m_Spell.GetState() != SpellState.Finished)
m_Spell.Cancel();
}
public override bool IsDeletable()
{
return m_Spell.IsDeletable();
}
public Spell GetSpell() { return m_Spell; }
Spell m_Spell;
}