mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 00:46:46 +00:00
[Commands] Cleanup #resetaa Command (#4310)
* [Commands] Cleanup #resetaa Command * Update resetaa.cpp
This commit is contained in:
@@ -2,18 +2,32 @@
|
||||
|
||||
void command_resetaa(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!c->GetTarget() || !c->GetTarget()->IsClient()) {
|
||||
c->Message(Chat::White, "You must target a player to use this command.");
|
||||
Client* t = c;
|
||||
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||
t = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
const uint16 arguments = sep->argnum;
|
||||
const bool is_aa = !strcasecmp(sep->arg[1], "aa");
|
||||
const bool is_leadership = !strcasecmp(sep->arg[1], "leadership");
|
||||
|
||||
if (!arguments || (!is_aa && !is_leadership)) {
|
||||
c->Message(Chat::White, "Usage: #resetaa aa - Resets and refunds a player's AAs");
|
||||
c->Message(Chat::White, "Usage: #resetaa leadership - Resets a player's Leadership AAs");
|
||||
return;
|
||||
}
|
||||
|
||||
auto t = c->GetTarget()->CastToClient();
|
||||
t->ResetAA();
|
||||
if (is_aa) {
|
||||
t->ResetAA();
|
||||
} else if (is_leadership) {
|
||||
t->ResetLeadershipAA();
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Successfully reset all Alternate Advancements for {}.",
|
||||
"Successfully reset all{} AAs for {}.",
|
||||
is_aa ? "" : " Leadership",
|
||||
c->GetTargetDescription(t)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user