From c989047700b36b7e1faef7cd76f48df44bb87b2c Mon Sep 17 00:00:00 2001 From: hondacrx Date: Tue, 14 Jun 2022 18:03:15 -0400 Subject: [PATCH] Core/PacketIO: Implement CMSG_CANCEL_MOD_SPEED_NO_CONTROL_AURAS Port From (https://github.com/TrinityCore/TrinityCore/commit/5e8534767c66ca492bab929d91f2d86d18dd9aba) --- Source/Game/Handlers/SpellHandler.cs | 14 ++++++++++++++ Source/Game/Networking/Packets/PetPackets.cs | 12 ++++++++++++ 2 files changed, 26 insertions(+) diff --git a/Source/Game/Handlers/SpellHandler.cs b/Source/Game/Handlers/SpellHandler.cs index d6b02d7c1..306c60dbf 100644 --- a/Source/Game/Handlers/SpellHandler.cs +++ b/Source/Game/Handlers/SpellHandler.cs @@ -457,6 +457,20 @@ namespace Game pet.RemoveOwnedAura(packet.SpellID, ObjectGuid.Empty, 0, AuraRemoveMode.Cancel); } + [WorldPacketHandler(ClientOpcodes.CancelAutoRepeatSpell, Processing = PacketProcessing.Inplace)] + void HandleCancelModSpeedNoControlAuras(CancelModSpeedNoControlAuras cancelModSpeedNoControlAuras) + { + Unit mover = _player.GetUnitBeingMoved(); + if (mover == null || mover.GetGUID() != cancelModSpeedNoControlAuras.TargetGUID) + return; + + _player.RemoveAurasByType(AuraType.ModSpeedNoControl, aurApp => + { + SpellInfo spellInfo = aurApp.GetBase().GetSpellInfo(); + return !spellInfo.HasAttribute(SpellAttr0.NoAuraCancel) && spellInfo.IsPositive() && !spellInfo.IsPassive(); + }); + } + [WorldPacketHandler(ClientOpcodes.CancelAutoRepeatSpell, Processing = PacketProcessing.Inplace)] void HandleCancelAutoRepeatSpell(CancelAutoRepeatSpell packet) { diff --git a/Source/Game/Networking/Packets/PetPackets.cs b/Source/Game/Networking/Packets/PetPackets.cs index 74df76ec2..470490459 100644 --- a/Source/Game/Networking/Packets/PetPackets.cs +++ b/Source/Game/Networking/Packets/PetPackets.cs @@ -300,6 +300,18 @@ namespace Game.Networking.Packets public uint Action; } + class CancelModSpeedNoControlAuras : ClientPacket + { + public ObjectGuid TargetGUID; + + public CancelModSpeedNoControlAuras(WorldPacket packet) : base(packet) { } + + public override void Read() + { + TargetGUID = _worldPacket.ReadPackedGuid(); + } + } + class PetCancelAura : ClientPacket { public PetCancelAura(WorldPacket packet) : base(packet) { }