Kinglykrab 7df9b2974b
[Commands] Cleanup #reloadzps Command. (#2129)
* [Commands] Cleanup #reloadzps Command.
- Cleanup messages and logic.
- Make reloading of zone points global instead of zone specific.

* Further cleanup.
- Add zone->GetZoneDescription().
- Add mob->GetTargetDescription(mob).

* Final cleanup.

* Typo.
2022-05-07 03:23:15 -04:00

30 lines
735 B
C++
Executable File

#include "../client.h"
void command_lastname(Client *c, const Seperator *sep)
{
Client *target = c;
if (c->GetTarget() && c->GetTarget()->IsClient()) {
target = c->GetTarget()->CastToClient();
}
LogInfo("#lastname request from [{}] for [{}]", c->GetCleanName(), target->GetCleanName());
std::string last_name = sep->arg[1];
if (last_name.size() > 64) {
c->Message(Chat::White, "Usage: #lastname [Last Name] (Last Name must be 64 characters or less)");
return;
}
target->ChangeLastName(last_name.c_str());
c->Message(
Chat::White,
fmt::format(
"{} now {} a last name of '{}'.",
c->GetTargetDescription(target, TargetDescriptionType::UCYou),
c == target ? "have" : "has",
last_name
).c_str()
);
}