mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
[Commands] Cleanup #invul Command. (#1780)
- Cleanup message and logic.
This commit is contained in:
parent
fb2f901539
commit
f1d9221b4c
@ -221,7 +221,7 @@ int command_init(void)
|
|||||||
command_add("interrogateinv", "- use [help] argument for available options", AccountStatus::Player, command_interrogateinv) ||
|
command_add("interrogateinv", "- use [help] argument for available options", AccountStatus::Player, command_interrogateinv) ||
|
||||||
command_add("interrupt", "[message id] [color] - Interrupt your casting. Arguments are optional.", AccountStatus::Guide, command_interrupt) ||
|
command_add("interrupt", "[message id] [color] - Interrupt your casting. Arguments are optional.", AccountStatus::Guide, command_interrupt) ||
|
||||||
command_add("invsnapshot", "- Manipulates inventory snapshots for your current target", AccountStatus::QuestTroupe, command_invsnapshot) ||
|
command_add("invsnapshot", "- Manipulates inventory snapshots for your current target", AccountStatus::QuestTroupe, command_invsnapshot) ||
|
||||||
command_add("invul", "[on/off] - Turn player target's or your invulnerable flag on or off", AccountStatus::QuestTroupe, command_invul) ||
|
command_add("invul", "[On|Off]] - Turn player target's or your invulnerable flag on or off", AccountStatus::QuestTroupe, command_invul) ||
|
||||||
command_add("ipban", "[IP address] - Ban IP by character name", AccountStatus::GMMgmt, command_ipban) ||
|
command_add("ipban", "[IP address] - Ban IP by character name", AccountStatus::GMMgmt, command_ipban) ||
|
||||||
command_add("iplookup", "[charname] - Look up IP address of charname", AccountStatus::GMMgmt, command_iplookup) ||
|
command_add("iplookup", "[charname] - Look up IP address of charname", AccountStatus::GMMgmt, command_iplookup) ||
|
||||||
command_add("iteminfo", "- Get information about the item on your cursor", AccountStatus::Steward, command_iteminfo) ||
|
command_add("iteminfo", "- Get information about the item on your cursor", AccountStatus::Steward, command_iteminfo) ||
|
||||||
|
|||||||
@ -2,19 +2,27 @@
|
|||||||
|
|
||||||
void command_invul(Client *c, const Seperator *sep)
|
void command_invul(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
bool state = atobool(sep->arg[1]);
|
int arguments = sep->argnum;
|
||||||
Client *t = c;
|
if (!arguments) {
|
||||||
|
c->Message(Chat::White, "Usage: #invul [On|Off]");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool invul_flag = atobool(sep->arg[1]);
|
||||||
|
Client *target = c;
|
||||||
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||||
t = c->GetTarget()->CastToClient();
|
target = c->GetTarget()->CastToClient();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sep->arg[1][0] != 0) {
|
target->SetInvul(invul_flag);
|
||||||
t->SetInvul(state);
|
c->Message(
|
||||||
c->Message(Chat::White, "%s is %s invulnerable from attack.", t->GetName(), state ? "now" : "no longer");
|
Chat::White,
|
||||||
}
|
fmt::format(
|
||||||
else {
|
"{} {} now {}.",
|
||||||
c->Message(Chat::White, "Usage: #invulnerable [on/off]");
|
c == target ? "You" : target->GetCleanName(),
|
||||||
}
|
c == target ? "are" : "is",
|
||||||
|
invul_flag ? "invulnerable" : "vulnerable"
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user