mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-22 16:28:28 +00:00
[Commands] Cleanup #shownpcgloballoot and #showzonegloballoot Command. (#2141)
- Cleanup messages and logic.
This commit is contained in:
@@ -23,15 +23,59 @@ std::vector<int> 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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user