Core/Units: Added possibility to send emotes to single players
Port From (https://github.com/TrinityCore/TrinityCore/commit/4a6308f5f0737cd42d381096573763459c8393be)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user