mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 18:51:29 +00:00
[Commands] Cleanup #resetaa and #resetaa_timer (#3047)
# Notes - Cleanup messages and logic.
This commit is contained in:
parent
218ef80f96
commit
b6497cdd6a
@ -7,15 +7,14 @@ void command_resetaa(Client *c, const Seperator *sep)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto target = c->GetTarget()->CastToClient();
|
auto t = c->GetTarget()->CastToClient();
|
||||||
target->ResetAA();
|
t->ResetAA();
|
||||||
|
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"Successfully reset all Alternate Advancements for {}.",
|
"Successfully reset all Alternate Advancements for {}.",
|
||||||
c->GetTargetDescription(target)
|
c->GetTargetDescription(t)
|
||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,43 +2,44 @@
|
|||||||
|
|
||||||
void command_resetaa_timer(Client *c, const Seperator *sep)
|
void command_resetaa_timer(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
int arguments = sep->argnum;
|
const auto arguments = sep->argnum;
|
||||||
if (!arguments) {
|
if (!arguments) {
|
||||||
c->Message(Chat::White, "Usage: #resetaa_timer all - Reset all Alternate Advancement timers");
|
c->Message(Chat::White, "Usage: #resetaa_timer all - Reset all Alternate Advancement timers");
|
||||||
c->Message(Chat::White, "Usage: #resetaa_timer [Timer ID] - Reset Alternate Advancement timer by ID");
|
c->Message(Chat::White, "Usage: #resetaa_timer [Timer ID] - Reset Alternate Advancement timer by ID");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto target = c;
|
auto t = c;
|
||||||
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||||
target = c->GetTarget()->CastToClient();
|
t = c->GetTarget()->CastToClient();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_all = !strcasecmp(sep->arg[1], "all");
|
const bool is_all = !strcasecmp(sep->arg[1], "all");
|
||||||
|
|
||||||
if (is_all) {
|
if (is_all) {
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"Reset all Alternate Advancement timers for {}.",
|
"Reset all Alternate Advancement timers for {}.",
|
||||||
c->GetTargetDescription(target)
|
c->GetTargetDescription(t)
|
||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
target->ResetAlternateAdvancementTimers();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sep->IsNumber(1)) {
|
t->ResetAlternateAdvancementTimers();
|
||||||
int timer_id = Strings::ToInt(sep->arg[1]);
|
|
||||||
|
return;
|
||||||
|
} else if (sep->IsNumber(1)) {
|
||||||
|
const auto timer_id = Strings::ToInt(sep->arg[1]);
|
||||||
|
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"Reset Alternate Advancement timer {} for {}.",
|
"Reset Alternate Advancement timer {} for {}.",
|
||||||
timer_id,
|
timer_id,
|
||||||
c->GetTargetDescription(target)
|
c->GetTargetDescription(t)
|
||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
target->ResetAlternateAdvancementTimer(timer_id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
t->ResetAlternateAdvancementTimer(timer_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user