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