mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 23:01:30 +00:00
[Commands] Cleanup #gmspeed Command. (#1831)
* [Commands] Cleanup #gmspeed Command. - Cleanup message and logic. * Update gmspeed.cpp * Update gmspeed.cpp
This commit is contained in:
parent
e87b8e2682
commit
8b54bb34e4
@ -196,7 +196,7 @@ int command_init(void)
|
|||||||
command_add("givemoney", "[Platinum] [Gold] [Silver] [Copper] - Gives specified amount of money to you or your player target", AccountStatus::GMMgmt, command_givemoney) ||
|
command_add("givemoney", "[Platinum] [Gold] [Silver] [Copper] - Gives specified amount of money to you or your player target", AccountStatus::GMMgmt, command_givemoney) ||
|
||||||
command_add("globalview", "Lists all qglobals in cache if you were to do a quest with this target.", AccountStatus::QuestTroupe, command_globalview) ||
|
command_add("globalview", "Lists all qglobals in cache if you were to do a quest with this target.", AccountStatus::QuestTroupe, command_globalview) ||
|
||||||
command_add("gm", "[On|Off] - Modify your or your target's GM Flag", AccountStatus::QuestTroupe, command_gm) ||
|
command_add("gm", "[On|Off] - Modify your or your target's GM Flag", AccountStatus::QuestTroupe, command_gm) ||
|
||||||
command_add("gmspeed", "[on/off] - Turn GM speed hack on/off for you or your player target", AccountStatus::GMAdmin, command_gmspeed) ||
|
command_add("gmspeed", "[On|Off] - Turn GM Speed On or Off for you or your player target", AccountStatus::GMAdmin, command_gmspeed) ||
|
||||||
command_add("gmzone", "[zone_short_name] [zone_version=0] [identifier=gmzone] - Zones to a private GM instance", AccountStatus::GMAdmin, command_gmzone) ||
|
command_add("gmzone", "[zone_short_name] [zone_version=0] [identifier=gmzone] - Zones to a private GM instance", AccountStatus::GMAdmin, command_gmzone) ||
|
||||||
command_add("goto", "[playername] or [x y z] [h] - Teleport to the provided coordinates or to your target", AccountStatus::Steward, command_goto) ||
|
command_add("goto", "[playername] or [x y z] [h] - Teleport to the provided coordinates or to your target", AccountStatus::Steward, command_goto) ||
|
||||||
command_add("grid", "[add/delete] [grid_num] [wandertype] [pausetype] - Create/delete a wandering grid", AccountStatus::GMAreas, command_grid) ||
|
command_add("grid", "[add/delete] [grid_num] [wandertype] [pausetype] - Create/delete a wandering grid", AccountStatus::GMAreas, command_grid) ||
|
||||||
|
|||||||
@ -2,19 +2,54 @@
|
|||||||
|
|
||||||
void command_gmspeed(Client *c, const Seperator *sep)
|
void command_gmspeed(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: #gmspeed [On|Off]");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool gm_speed_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) {
|
database.SetGMSpeed(
|
||||||
database.SetGMSpeed(t->AccountID(), state ? 1 : 0);
|
target->AccountID(),
|
||||||
c->Message(Chat::White, "Turning GMSpeed %s for %s (zone to take effect)", state ? "On" : "Off", t->GetName());
|
gm_speed_flag ? 1 : 0
|
||||||
}
|
);
|
||||||
else {
|
|
||||||
c->Message(Chat::White, "Usage: #gmspeed [on/off]");
|
c->Message(
|
||||||
}
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"Turning GM Speed {} for {}.",
|
||||||
|
gm_speed_flag ? "on" : "off",
|
||||||
|
(
|
||||||
|
c == target ?
|
||||||
|
"yourself" :
|
||||||
|
fmt::format(
|
||||||
|
"{} ({})",
|
||||||
|
target->GetCleanName(),
|
||||||
|
target->GetID()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
|
||||||
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"Note: {} must zone for it to take effect.",
|
||||||
|
(
|
||||||
|
c == target ?
|
||||||
|
"You" :
|
||||||
|
fmt::format(
|
||||||
|
"{} ({})",
|
||||||
|
target->GetCleanName(),
|
||||||
|
target->GetID()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user