diff --git a/dScripts/ai/FV/FvGuildCreate.cpp b/dScripts/ai/FV/FvGuildCreate.cpp index 52a7c0616..fe80d2ab7 100644 --- a/dScripts/ai/FV/FvGuildCreate.cpp +++ b/dScripts/ai/FV/FvGuildCreate.cpp @@ -2,22 +2,23 @@ #include "CharacterComponent.h" #include "ChatPackets.h" -#include "EffectsMessages.h" +#include "eChatChannel.h" #include "Entity.h" #include "PlayerMessages.h" void FvGuildCreate::OnUse(Entity* self, Entity* user) { - // A player already in a guild is told so instead of getting the create box: the Guild Master says it in a chat - // bubble over its head and in system chat. The client itself says the same (MSG_GUILD_ALREADY_IN_GUILD, system chat) - // only once the box is submitted (LWOGuildComponent::SendTMPGuildCreate). + // A player already in a guild is told so instead of getting the create box, by the Guild Master saying it in local + // chat to that player: for a local chat line the client puts a chat bubble over the sender, plays its "talk" + // animation and adds the line under the sender's name (PacketHandler_MSG_CHAT_GENERAL_CHAT_MESSAGE). The text is + // the client's own MSG_GUILD_ALREADY_IN_GUILD, which the client itself shows only once the box is submitted. const auto* characterComponent = user->GetComponent(); if (characterComponent && characterComponent->GetGuildID() != LWOOBJID_EMPTY) { - constexpr auto text = u"You are already in a guild!"; - GameMessages::DisplayChatBubble bubble; - bubble.target = self->GetObjectID(); - bubble.wsText = text; - bubble.Send(user->GetSystemAddress()); - ChatPackets::SendSystemMessage(user->GetSystemAddress(), text); + ChatPackets::Client::GeneralChatMessage chat; + chat.chatChannel = static_cast(eChatChannel::LOCAL); + chat.senderName = LUWString("%[Objects_" + std::to_string(self->GetLOT()) + "_name]"); + chat.senderID = self->GetObjectID(); + chat.message = u"You are already in a guild!"; + chat.Send(user->GetSystemAddress()); return; }