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
+26
View File
@@ -1067,6 +1067,32 @@ namespace Game.Entities
SendMessageToSet(playSpellVisualKit, true);
}
void CancelSpellMissiles(uint spellId, bool reverseMissile = false)
{
bool hasMissile = false;
foreach (var pair in m_Events.GetEvents())
{
Spell spell = Spell.ExtractSpellFromEvent(pair.Value);
if (spell != null)
{
if (spell.GetSpellInfo().Id == spellId)
{
pair.Value.ScheduleAbort();
hasMissile = true;
}
}
}
if (hasMissile)
{
MissileCancel packet = new MissileCancel();
packet.OwnerGUID = GetGUID();
packet.SpellID = spellId;
packet.Reverse = reverseMissile;
SendMessageToSet(packet, false);
}
}
public void UnsummonAllTotems()
{
for (byte i = 0; i < SharedConst.MaxSummonSlot; ++i)