From 512e05f12e0beebbd360c68d0c85ed1bd671a79f Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 13 Oct 2021 10:08:56 -0400 Subject: [PATCH] Core/Units: Added possibility to send emotes to single players Port From (https://github.com/TrinityCore/TrinityCore/commit/4a6308f5f0737cd42d381096573763459c8393be) --- Source/Game/Entities/Unit/Unit.cs | 7 +++++-- Source/Game/Handlers/ChatHandler.cs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/Game/Entities/Unit/Unit.cs b/Source/Game/Entities/Unit/Unit.cs index fec3e7e50..f35dcb91d 100644 --- a/Source/Game/Entities/Unit/Unit.cs +++ b/Source/Game/Entities/Unit/Unit.cs @@ -229,7 +229,7 @@ namespace Game.Entities _spellHistory.Update(); } - public void HandleEmoteCommand(Emote animId, uint[] spellVisualKitIds = null) + public void HandleEmoteCommand(Emote animId, Player target = null, uint[] spellVisualKitIds = null) { EmoteMessage packet = new(); packet.Guid = GetGUID(); @@ -240,7 +240,10 @@ namespace Game.Entities if (emotesEntry.AnimId == (uint)Anim.MountSpecial || emotesEntry.AnimId == (uint)Anim.MountSelfSpecial) packet.SpellVisualKitIDs.AddRange(spellVisualKitIds); - SendMessageToSet(packet, true); + if (target != null) + target.SendPacket(packet); + else + SendMessageToSet(packet, true); } public void SendDurabilityLoss(Player receiver, uint percent) diff --git a/Source/Game/Handlers/ChatHandler.cs b/Source/Game/Handlers/ChatHandler.cs index ffa31c211..b359e36d8 100644 --- a/Source/Game/Handlers/ChatHandler.cs +++ b/Source/Game/Handlers/ChatHandler.cs @@ -579,7 +579,7 @@ namespace Game // Only allow text-emotes for "dead" entities (feign death included) if (GetPlayer().HasUnitState(UnitState.Died)) break; - GetPlayer().HandleEmoteCommand(emoteAnim, packet.SpellVisualKitIDs); + GetPlayer().HandleEmoteCommand(emoteAnim, null, packet.SpellVisualKitIDs); break; }