From cc9196bd65c1064ee8febc56f97716ae3a1a5f8c Mon Sep 17 00:00:00 2001 From: Kinglykrab <89047260+Kinglykrab@users.noreply.github.com> Date: Mon, 14 Feb 2022 19:49:14 -0500 Subject: [PATCH] [Commands] Cleanup #showskills Command. (#1994) * [Commands] Cleanup #showskills Command. - Utilize popup over messages. - Usage: #showskills [Start Skill ID] [All] - shows skills starting from skill ID and if "all" is specified it will show skills the player does not have normally (no max/cannot have skill). * Update showskills.cpp * Update command.cpp --- zone/command.cpp | 2 +- zone/gm_commands/showskills.cpp | 124 +++++++++++++++++++++++++------- 2 files changed, 100 insertions(+), 26 deletions(-) diff --git a/zone/command.cpp b/zone/command.cpp index ed5d34eaa..380b01a1b 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -347,7 +347,7 @@ int command_init(void) command_add("showbuffs", "- List buffs active on your target or you if no target", AccountStatus::Guide, command_showbuffs) || command_add("shownumhits", "Shows buffs numhits for yourself.", AccountStatus::Player, command_shownumhits) || command_add("shownpcgloballoot", "Show GlobalLoot entires on this npc", AccountStatus::Guide, command_shownpcgloballoot) || - command_add("showskills", "- Show the values of your or your player target's skills", AccountStatus::Guide, command_showskills) || + command_add("showskills", "[Start Skill ID] [All] - Show the values of your or your player target's skills in a popup 50 at a time, use 'all' as second argument to show non-usable skill's values", AccountStatus::Guide, command_showskills) || command_add("showspellslist", "Shows spell list of targeted NPC", AccountStatus::GMAdmin, command_showspellslist) || command_add("showstats", "- Show details about you or your target", AccountStatus::Guide, command_showstats) || command_add("showzonegloballoot", "Show GlobalLoot entires on this zone", AccountStatus::Guide, command_showzonegloballoot) || diff --git a/zone/gm_commands/showskills.cpp b/zone/gm_commands/showskills.cpp index e970dd7aa..8dc4dc47a 100755 --- a/zone/gm_commands/showskills.cpp +++ b/zone/gm_commands/showskills.cpp @@ -2,43 +2,117 @@ void command_showskills(Client *c, const Seperator *sep) { - Client *target = c; + auto target = c; if (c->GetTarget() && c->GetTarget()->IsClient()) { target = c->GetTarget()->CastToClient(); } - bool show_all = false; - - if (!strcasecmp("all", sep->arg[1])) { - show_all = true; + uint32 start_skill_id = 0; + if (sep->IsNumber(1)) { + start_skill_id = std::stoul(sep->arg[1]); } + bool show_all = !strcasecmp(sep->arg[2], "all"); + + uint32 max_skill_id = (start_skill_id + 49); + + std::string popup_text = "
| ID | Name | Current | Max | Raw |
| {} | {} | {} | {} | {} |