feat(Scripts/Commands): Add guild ranks display to guild info command (#22380)

This commit is contained in:
Kitzunu
2025-06-29 21:02:55 +02:00
committed by GitHub
parent 563ef5d7d9
commit ae28b35f2c
3 changed files with 23 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
--
DELETE FROM `acore_string` WHERE `entry` IN (1184,1185);
INSERT INTO `acore_string` (`entry`, `content_default`) VALUES
(1184, '| Guild Ranks:'),
(1185, '| {} - {}');

View File

@@ -972,7 +972,9 @@ enum AcoreStrings
LANG_GUILD_INFO_BANK_GOLD = 1181,
LANG_GUILD_INFO_MOTD = 1182,
LANG_GUILD_INFO_EXTRA_INFO = 1183,
// Room for more level 3 1184-1198 not used
LANG_GUILD_INFO_RANKS = 1184,
LANG_GUILD_INFO_RANKS_LIST = 1185,
// Room for more level 3 1186-1198 not used
// Debug commands
LANG_DO_NOT_USE_6X_DEBUG_AREATRIGGER_LEFT = 1999,

View File

@@ -74,7 +74,7 @@ public:
if (sGuildMgr->GetGuildByName(guildName))
{
handler->SendErrorMessage(LANG_GUILD_RENAME_ALREADY_EXISTS);
handler->SendErrorMessage(LANG_GUILD_RENAME_ALREADY_EXISTS, guildName);
return false;
}
@@ -249,6 +249,20 @@ public:
handler->PSendSysMessage(LANG_GUILD_INFO_BANK_GOLD, guild->GetTotalBankMoney() / 100 / 100); // Bank Gold (in gold coins)
handler->PSendSysMessage(LANG_GUILD_INFO_MOTD, guild->GetMOTD()); // Message of the Day
handler->PSendSysMessage(LANG_GUILD_INFO_EXTRA_INFO, guild->GetInfo()); // Extra Information
QueryResult result = CharacterDatabase.Query("SELECT rid, rname FROM guild_rank WHERE guildid = {}", guild->GetId());
if (result)
{
handler->PSendSysMessage(LANG_GUILD_INFO_RANKS);
do
{
Field* fields = result->Fetch();
uint32 rid = fields[0].Get<uint32>();
std::string rname = fields[1].Get<std::string>();
handler->PSendSysMessage(LANG_GUILD_INFO_RANKS_LIST, rid, rname);
} while (result->NextRow());
}
return true;
}
};