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

26 lines
470 B
C++
Executable File

#include "../client.h"
void command_mana(Client *c, const Seperator *sep)
{
auto target = c->GetTarget() ? c->GetTarget() : c;
int mana = 0;
if (target->IsClient()) {
mana = target->CastToClient()->CalcMaxMana();
target->CastToClient()->SetMana(mana);
}
else {
mana = target->CalcMaxMana();
target->SetMana(mana);
}
c->Message(
Chat::White,
fmt::format(
"Set {} to full Mana ({}).",
c->GetTargetDescription(target),
mana
).c_str()
);
}