Core/Object: Implemented helper method PlayObjectSound
Port From (https://github.com/TrinityCore/TrinityCore/commit/35e5da37bdbbac355e454c5cbabe5991b7966709)
This commit is contained in:
@@ -2960,6 +2960,21 @@ namespace Game.Entities
|
||||
SendMessageToSet(new PlayMusic(musicId), true);
|
||||
}
|
||||
|
||||
void PlayObjectSound(uint soundKitId, ObjectGuid targetObjectGUID, Player target = null, int broadcastTextId = 0)
|
||||
{
|
||||
PlayObjectSound pkt = new();
|
||||
pkt.TargetObjectGUID = targetObjectGUID;
|
||||
pkt.SourceObjectGUID = GetGUID();
|
||||
pkt.SoundKitID = soundKitId;
|
||||
pkt.Position = GetPosition();
|
||||
pkt.BroadcastTextID = broadcastTextId;
|
||||
|
||||
if (target)
|
||||
target.SendPacket(pkt);
|
||||
else
|
||||
SendMessageToSet(pkt, true);
|
||||
}
|
||||
|
||||
public void DestroyForNearbyPlayers()
|
||||
{
|
||||
if (!IsInWorld)
|
||||
|
||||
Reference in New Issue
Block a user