Files
DarkflameServer/dScripts/ai/FV/FvGuildCreate.cpp
Aaron Kimbrell d48f43b579 feat(guilds): the Guild Master tells a player already in a guild so
Instead of opening the create box, a player with a guild gets "You are already in a guild!" in system chat, the
client's own MSG_GUILD_ALREADY_IN_GUILD text (which the client shows only once the box is submitted). Check: use the
Guild Master (LOT 3001) with and without a guild.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 08:24:35 -05:00

22 lines
816 B
C++

#include "FvGuildCreate.h"
#include "CharacterComponent.h"
#include "ChatPackets.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 client itself says the same
// (MSG_GUILD_ALREADY_IN_GUILD, system chat) only once the box is submitted (LWOGuildComponent::SendTMPGuildCreate).
const auto* characterComponent = user->GetComponent<CharacterComponent>();
if (characterComponent && characterComponent->GetGuildID() != LWOOBJID_EMPTY) {
ChatPackets::SendSystemMessage(user->GetSystemAddress(), u"You are already in a guild!");
return;
}
GameMessages::DisplayGuildCreateBox box;
box.target = user->GetObjectID();
box.bShow = true;
box.Send(user->GetSystemAddress());
}