diff --git a/zone/command.cpp b/zone/command.cpp index 155e55fa9..b24114e63 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -340,11 +340,11 @@ int command_init(void) command_add("showbonusstats", "[item|spell|all] Shows bonus stats for target from items or spells. Shows both by default.", AccountStatus::Guide, command_showbonusstats) || 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("shownpcgloballoot", "Show global loot entries for your target NPC", AccountStatus::Guide, command_shownpcgloballoot) || 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) || + command_add("showzonegloballoot", "Show global loot entries for your current zone", AccountStatus::Guide, command_showzonegloballoot) || command_add("showzonepoints", "Show zone points for current zone", AccountStatus::Guide, command_showzonepoints) || command_add("shutdown", "- Shut this zone process down", AccountStatus::GMLeadAdmin, command_shutdown) || command_add("spawn", "[name] [race] [level] [material] [hp] [gender] [class] [priweapon] [secweapon] [merchantid] - Spawn an NPC", AccountStatus::Steward, command_spawn) || diff --git a/zone/global_loot_manager.cpp b/zone/global_loot_manager.cpp index 706769f77..0fea08aa8 100644 --- a/zone/global_loot_manager.cpp +++ b/zone/global_loot_manager.cpp @@ -23,15 +23,59 @@ std::vector GlobalLootManager::GetGlobalLootTables(NPC *mob) const void GlobalLootManager::ShowZoneGlobalLoot(Client *to) const { - for (auto &e : m_entries) - to->Message(Chat::White, " %s : %d table %d", e.GetDescription().c_str(), e.GetID(), e.GetLootTableID()); + int table_number = 1; + + for (auto &e : m_entries) { + to->Message( + Chat::White, + fmt::format( + "Table {} | Name: {}", + table_number, + e.GetDescription() + ).c_str() + ); + + to->Message( + Chat::White, + fmt::format( + "Table {} | Global Table ID: {} Loot Table ID: {}", + table_number, + e.GetID(), + e.GetLootTableID() + ).c_str() + ); + + table_number++; + } } void GlobalLootManager::ShowNPCGlobalLoot(Client *to, NPC *who) const { + int table_number = 1; + for (auto &e : m_entries) { - if (e.PassesRules(who)) - to->Message(Chat::White, " %s : %d table %d", e.GetDescription().c_str(), e.GetID(), e.GetLootTableID()); + if (e.PassesRules(who)) { + to->Message( + Chat::White, + fmt::format( + "Table {} | Name: {}", + table_number, + e.GetDescription() + ).c_str() + ); + + to->Message( + Chat::White, + fmt::format( + "Table {} | Global Table ID: {} Loot Table ID: {}", + table_number, + e.GetID(), + e.GetLootTableID() + ).c_str() + ); + + table_number++; + } } } diff --git a/zone/gm_commands/shownpcgloballoot.cpp b/zone/gm_commands/shownpcgloballoot.cpp index 546631c5c..4ff39b6c7 100755 --- a/zone/gm_commands/shownpcgloballoot.cpp +++ b/zone/gm_commands/shownpcgloballoot.cpp @@ -2,15 +2,22 @@ void command_shownpcgloballoot(Client *c, const Seperator *sep) { - auto tar = c->GetTarget(); - - if (!tar || !tar->IsNPC()) { + if (!c->GetTarget() || !c->GetTarget()->IsNPC()) { c->Message(Chat::White, "You must target an NPC to use this command."); return; } - auto npc = tar->CastToNPC(); - c->Message(Chat::White, "GlobalLoot for %s (%d)", npc->GetName(), npc->GetNPCTypeID()); - zone->ShowNPCGlobalLoot(c, npc); + auto target = c->GetTarget()->CastToNPC(); + + c->Message( + Chat::White, + fmt::format( + "Global loot for {} ({}).", + target->GetCleanName(), + target->GetNPCTypeID() + ).c_str() + ); + + zone->ShowNPCGlobalLoot(c, target); } diff --git a/zone/gm_commands/showzonegloballoot.cpp b/zone/gm_commands/showzonegloballoot.cpp index ecf774f88..570a9802e 100755 --- a/zone/gm_commands/showzonegloballoot.cpp +++ b/zone/gm_commands/showzonegloballoot.cpp @@ -4,10 +4,13 @@ void command_showzonegloballoot(Client *c, const Seperator *sep) { c->Message( Chat::White, - "GlobalLoot for %s (%d:%d)", - zone->GetShortName(), - zone->GetZoneID(), - zone->GetInstanceVersion()); + fmt::format( + "Global loot for {} ({}).", + zone->GetLongName(), + zone->GetZoneID() + ).c_str() + ); + zone->ShowZoneGlobalLoot(c); }