mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-13 06:48:20 +00:00
[Commands] Add #setmana Command. (#1839)
* [Commands] Add #setmana Command. - Add #setmana [Mana] command to set an NPC or player's mana to a specified amount, or to max if the amount is greater than their max. - Cleanup #mana command message and logic. * Update mana.cpp
This commit is contained in:
+21
-15
@@ -3,25 +3,31 @@
|
||||
void command_mana(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto target = c->GetTarget() ? c->GetTarget() : c;
|
||||
int mana = 0;
|
||||
if (target->IsClient()) {
|
||||
target->CastToClient()->SetMana(target->CastToClient()->CalcMaxMana());
|
||||
mana = target->CastToClient()->CalcMaxMana();
|
||||
target->CastToClient()->SetMana(mana);
|
||||
}
|
||||
else {
|
||||
target->SetMana(target->CalcMaxMana());
|
||||
mana = target->CalcMaxMana();
|
||||
target->SetMana(mana);
|
||||
}
|
||||
|
||||
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.");
|
||||
}
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Set {} to full Mana ({}).",
|
||||
(
|
||||
c == target ?
|
||||
"yourself" :
|
||||
fmt::format(
|
||||
"{} ({})",
|
||||
target->GetCleanName(),
|
||||
target->GetID()
|
||||
)
|
||||
),
|
||||
mana
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user