[Commands] Cleanup #mana Command. (#1718)

* [Commands] Cleanup #mana Command.
- Add message.

* Add self message.
This commit is contained in:
Kinglykrab 2021-11-12 08:10:43 -05:00 committed by GitHub
parent 110d2a0e10
commit f8c2e85f3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3087,14 +3087,25 @@ void command_size(Client *c, const Seperator *sep)
void command_mana(Client *c, const Seperator *sep)
{
Mob *t;
auto target = c->GetTarget() ? c->GetTarget() : c;
if(target->IsClient()) {
target->CastToClient()->SetMana(target->CastToClient()->CalcMaxMana());
} else {
target->SetMana(target->CalcMaxMana());
}
t = c->GetTarget() ? c->GetTarget() : c;
if(t->IsClient())
t->CastToClient()->SetMana(t->CastToClient()->CalcMaxMana());
else
t->SetMana(t->CalcMaxMana());
if (c != target) {
c->Message(
Chat::White,
fmt::format(
"Set {} ({}) to full Mana.",
target->GetCleanName(),
target->GetID()
).c_str()
);
} else {
c->Message(Chat::White, "Restored your Mana to full.");
}
}
void command_flymode(Client *c, const Seperator *sep)