Core/Units: Added possibility to send emotes to single players

Port From (https://github.com/TrinityCore/TrinityCore/commit/4a6308f5f0737cd42d381096573763459c8393be)
This commit is contained in:
hondacrx
2021-10-13 10:08:56 -04:00
parent 46195bd8b7
commit 512e05f12e
2 changed files with 6 additions and 3 deletions
+5 -2
View File
@@ -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)
+1 -1
View File
@@ -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;
}