mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 16:51:29 +00:00
* [Titles] Cleanup titles, title suffix, and last name methods. - Use strings instead of const chars*. - Add optional parameter to SetAATitle in Lua so you can save to the database similar to Perl. - Cleanup #lastname command. - Cleanup #title command. - Cleanup #titlesuffix command. * Update npc.cpp
30 lines
727 B
C++
Executable File
30 lines
727 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->Message(
|
|
Chat::White,
|
|
fmt::format(
|
|
"{} now {} a last name of '{}'.",
|
|
c->GetTargetDescription(target, TargetDescriptionType::UCYou),
|
|
c == target ? "have" : "has",
|
|
last_name
|
|
).c_str()
|
|
);
|
|
}
|
|
|