mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
[Commands] Cleanup #shownpcgloballoot and #showzonegloballoot Command. (#2141)
- Cleanup messages and logic.
This commit is contained in:
parent
5aaaaed6f1
commit
e5acc7c322
@ -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("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("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("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("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("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("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("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("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) ||
|
command_add("spawn", "[name] [race] [level] [material] [hp] [gender] [class] [priweapon] [secweapon] [merchantid] - Spawn an NPC", AccountStatus::Steward, command_spawn) ||
|
||||||
|
|||||||
@ -23,15 +23,59 @@ std::vector<int> GlobalLootManager::GetGlobalLootTables(NPC *mob) const
|
|||||||
|
|
||||||
void GlobalLootManager::ShowZoneGlobalLoot(Client *to) const
|
void GlobalLootManager::ShowZoneGlobalLoot(Client *to) const
|
||||||
{
|
{
|
||||||
for (auto &e : m_entries)
|
int table_number = 1;
|
||||||
to->Message(Chat::White, " %s : %d table %d", e.GetDescription().c_str(), e.GetID(), e.GetLootTableID());
|
|
||||||
|
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
|
void GlobalLootManager::ShowNPCGlobalLoot(Client *to, NPC *who) const
|
||||||
{
|
{
|
||||||
|
int table_number = 1;
|
||||||
|
|
||||||
for (auto &e : m_entries) {
|
for (auto &e : m_entries) {
|
||||||
if (e.PassesRules(who))
|
if (e.PassesRules(who)) {
|
||||||
to->Message(Chat::White, " %s : %d table %d", e.GetDescription().c_str(), e.GetID(), e.GetLootTableID());
|
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++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,15 +2,22 @@
|
|||||||
|
|
||||||
void command_shownpcgloballoot(Client *c, const Seperator *sep)
|
void command_shownpcgloballoot(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
auto tar = c->GetTarget();
|
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
|
||||||
|
|
||||||
if (!tar || !tar->IsNPC()) {
|
|
||||||
c->Message(Chat::White, "You must target an NPC to use this command.");
|
c->Message(Chat::White, "You must target an NPC to use this command.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto npc = tar->CastToNPC();
|
auto target = c->GetTarget()->CastToNPC();
|
||||||
c->Message(Chat::White, "GlobalLoot for %s (%d)", npc->GetName(), npc->GetNPCTypeID());
|
|
||||||
zone->ShowNPCGlobalLoot(c, npc);
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"Global loot for {} ({}).",
|
||||||
|
target->GetCleanName(),
|
||||||
|
target->GetNPCTypeID()
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
|
||||||
|
zone->ShowNPCGlobalLoot(c, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,10 +4,13 @@ void command_showzonegloballoot(Client *c, const Seperator *sep)
|
|||||||
{
|
{
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
"GlobalLoot for %s (%d:%d)",
|
fmt::format(
|
||||||
zone->GetShortName(),
|
"Global loot for {} ({}).",
|
||||||
zone->GetZoneID(),
|
zone->GetLongName(),
|
||||||
zone->GetInstanceVersion());
|
zone->GetZoneID()
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
|
||||||
zone->ShowZoneGlobalLoot(c);
|
zone->ShowZoneGlobalLoot(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user