Core/Units: Added helper function to clear boss emote frame and enable SMSG_CLEAR_BOSS_EMOTES

Port From (https://github.com/TrinityCore/TrinityCore/commit/deb24f3f53540733bef15f0a90a1b7e41e76d60e)
This commit is contained in:
hondacrx
2024-02-27 13:58:28 -05:00
parent 29af2a63b7
commit 6a6d36a151
2 changed files with 27 additions and 0 deletions
+20
View File
@@ -437,6 +437,26 @@ namespace Game.Entities
target.SendPacket(data);
}
/// <summary>
/// Clears boss emotes frame
/// </summary>
/// <param name="zoneId">Only clears emotes for players in that zone id</param>
/// <param name="target">Only clears emotes for that player</param>
public void ClearBossEmotes(uint? zoneId, Player target)
{
ClearBossEmotes clearBossEmotes = new();
if (target != null)
{
target.SendPacket(clearBossEmotes);
return;
}
foreach (var player in GetMap().GetPlayers())
if (!zoneId.HasValue || Global.DB2Mgr.IsInArea(player.GetAreaId(), zoneId.Value))
player.SendPacket(clearBossEmotes);
}
public override void UpdateObjectVisibility(bool forced = true)
{
if (!forced)