From a042fb4b573e413100af3244cf81489ec624e3ef Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 4 Mar 2024 11:44:05 -0500 Subject: [PATCH] Core/PacketIO: Implemented and enabled SMSG_STOP_SPEAKERBOT_SOUND Port From (https://github.com/TrinityCore/TrinityCore/commit/3f8f8674259b455e47b1456dc0246c1f6758fc74) --- Source/Game/Entities/Object/WorldObject.cs | 8 ++++++++ Source/Game/Networking/Packets/MiscPackets.cs | 15 +++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/Source/Game/Entities/Object/WorldObject.cs b/Source/Game/Entities/Object/WorldObject.cs index 54cf7ae2d..98aa90f01 100644 --- a/Source/Game/Entities/Object/WorldObject.cs +++ b/Source/Game/Entities/Object/WorldObject.cs @@ -2953,6 +2953,14 @@ namespace Game.Entities SendMessageToSet(playSpeakerBoxSound, true); } + void StopDistanceSound(Player target = null) + { + if (target != null) + target.SendPacket(new StopSpeakerbotSound(GetGUID())); + else + SendMessageToSet(new StopSpeakerbotSound(GetGUID()), true); + } + public void PlayDirectSound(uint soundId, Player target = null, uint broadcastTextId = 0) { PlaySound sound = new(GetGUID(), soundId, broadcastTextId); diff --git a/Source/Game/Networking/Packets/MiscPackets.cs b/Source/Game/Networking/Packets/MiscPackets.cs index 0486b7edf..b0b7351f0 100644 --- a/Source/Game/Networking/Packets/MiscPackets.cs +++ b/Source/Game/Networking/Packets/MiscPackets.cs @@ -938,6 +938,21 @@ namespace Game.Networking.Packets public uint SoundKitID; } + class StopSpeakerbotSound : ServerPacket + { + ObjectGuid SourceObjectGUID; + + public StopSpeakerbotSound(ObjectGuid sourceObjectGUID) : base(ServerOpcodes.StopSpeakerbotSound) + { + SourceObjectGUID = sourceObjectGUID; + } + + public override void Write() + { + _worldPacket.WritePackedGuid(SourceObjectGUID); + } + } + class OpeningCinematic : ClientPacket { public OpeningCinematic(WorldPacket packet) : base(packet) { }