diff --git a/Source/Framework/Constants/Language.cs b/Source/Framework/Constants/Language.cs index e33477418..e2f228f55 100644 --- a/Source/Framework/Constants/Language.cs +++ b/Source/Framework/Constants/Language.cs @@ -1021,7 +1021,13 @@ namespace Framework.Constants AccountBnetUnlinked = 1216, AccountBnetNotLinked = 1217, DisallowTicketsConfig = 1218, - // 1219-1499 - Free + + // Guild list (.guild list) + GuildListTitle = 1219, + GuildListHeader = 1220, + GuildListRow = 1221, + GuildListTotal = 1222, + // 1223-1499 - free // Command Argument Parsers CmdparserEither = 1500, diff --git a/Source/Game/Chat/Commands/GuildCommands.cs b/Source/Game/Chat/Commands/GuildCommands.cs index 965107b3c..f95bd3940 100644 --- a/Source/Game/Chat/Commands/GuildCommands.cs +++ b/Source/Game/Chat/Commands/GuildCommands.cs @@ -206,5 +206,36 @@ namespace Game.Chat handler.SendSysMessage(CypherStrings.GuildInfoExtraInfo, guild.GetInfo()); // Extra Information return true; } + + [Command("info", RBACPermissions.CommandGuildInfo, true)] + static bool HandleGuildListCommand(CommandHandler handler) + { + string titleAndSummaryColor = handler.IsConsole() ? "" : "|cff00ff00"; + string tableHeaderColor = handler.IsConsole() ? "" : "|cff00ffff"; + string resetColor = handler.IsConsole() ? "" : "|r"; + + handler.SendSysMessage(CypherStrings.GuildListTitle, titleAndSummaryColor, resetColor); + handler.SendSysMessage(CypherStrings.GuildListHeader, tableHeaderColor, resetColor); + + var guildStore = Global.GuildMgr.GetGuildStore(); + + foreach (var (id, g) in guildStore) + { + if (!Global.CharacterCacheStorage.GetCharacterNameByGuid(g.GetLeaderGUID(), out string gmName)) + gmName = "---"; + + handler.SendSysMessage(CypherStrings.GuildListRow, + id, + g.GetName(), + gmName, + Time.GetTimeString(g.GetCreatedDate()), + g.GetMembersCount(), + g.GetBankMoney() / MoneyConstants.Gold + ); + } + + handler.SendSysMessage(CypherStrings.GuildListTotal, titleAndSummaryColor, guildStore.Count, resetColor); + return true; + } } } diff --git a/Source/Game/Guilds/GuildManager.cs b/Source/Game/Guilds/GuildManager.cs index 0de70bdf9..e3b452b94 100644 --- a/Source/Game/Guilds/GuildManager.cs +++ b/Source/Game/Guilds/GuildManager.cs @@ -487,6 +487,8 @@ namespace Game public void SetNextGuildId(uint Id) { NextGuildId = Id; } + public Dictionary GetGuildStore() { return GuildStore; } + public List GetGuildRewards() { return guildRewards; } uint NextGuildId;