mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 09:06:46 +00:00
[Commands] Cleanup #getplayerburiedcorpsecount Command. (#1818)
* [Commands] Cleanup #getplayerburiedcorpsecount Command. - Cleanup message and logic. * Update command.cpp
This commit is contained in:
@@ -3,25 +3,32 @@
|
||||
|
||||
void command_getplayerburiedcorpsecount(Client *c, const Seperator *sep)
|
||||
{
|
||||
Client *t = c;
|
||||
|
||||
Client *target = c;
|
||||
if (c->GetTarget() && c->GetTarget()->IsClient() && c->GetGM()) {
|
||||
t = c->GetTarget()->CastToClient();
|
||||
}
|
||||
else {
|
||||
c->Message(Chat::White, "You must first select a target!");
|
||||
return;
|
||||
target = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
uint32 CorpseCount = database.GetCharacterBuriedCorpseCount(t->CharacterID());
|
||||
|
||||
if (CorpseCount > 0) {
|
||||
c->Message(Chat::White, "Your target has a total of %u buried corpses.", CorpseCount);
|
||||
}
|
||||
else {
|
||||
c->Message(Chat::White, "Your target doesn't have any buried corpses.");
|
||||
}
|
||||
|
||||
return;
|
||||
uint32 corpse_count = database.GetCharacterBuriedCorpseCount(target->CharacterID());
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} {} {} buried corpse{}.",
|
||||
(
|
||||
c == target ?
|
||||
"You" :
|
||||
fmt::format(
|
||||
"{} ({})",
|
||||
target->GetCleanName(),
|
||||
target->GetID()
|
||||
)
|
||||
),
|
||||
c == target ? "have" : "has",
|
||||
(
|
||||
corpse_count ?
|
||||
std::to_string(corpse_count) :
|
||||
"no"
|
||||
),
|
||||
corpse_count != 1 ? "s" : ""
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user