mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
feat(Scripts/Commands): Add guild ranks display to guild info command (#22380)
This commit is contained in:
@@ -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, '| {} - {}');
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user