diff --git a/zone/command.cpp b/zone/command.cpp index 0cd8cead9..4cfb9a388 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -177,7 +177,7 @@ int command_init(void) 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("guild", "Guild manipulation commands. Use argument help for more info.", AccountStatus::Steward, command_guild) || - command_add("haste", "[percentage] - Set your haste percentage", AccountStatus::GMAdmin, command_haste) || + command_add("haste", "[Percentage] - Set your or your target's GM Bonus Haste (100 is 100% more Attack Speed)", AccountStatus::GMAdmin, command_haste) || command_add("hatelist", "Display hate list for NPC.", AccountStatus::QuestTroupe, command_hatelist) || command_add("heal", "Completely heal your target", AccountStatus::Steward, command_heal) || command_add("help", "[Search Criteria] - List available commands and their description, specify partial command as argument to search", AccountStatus::Player, command_help) || diff --git a/zone/gm_commands/haste.cpp b/zone/gm_commands/haste.cpp index 705781f35..d5e19f569 100755 --- a/zone/gm_commands/haste.cpp +++ b/zone/gm_commands/haste.cpp @@ -2,19 +2,30 @@ void command_haste(Client *c, const Seperator *sep) { - // #haste command to set client attack speed. Takes a percentage (100 = twice normal attack speed) - if (sep->arg[1][0] != 0) { - uint16 Haste = Strings::ToInt(sep->arg[1]); - if (Haste > 85) { - Haste = 85; - } - c->SetExtraHaste(Haste); - // SetAttackTimer must be called to make this take effect, so player needs to change - // the primary weapon. - c->Message(Chat::White, "Haste set to %d%% - Need to re-equip primary weapon before it takes effect", Haste); + const auto arguments = sep->argnum; + if (!arguments || !sep->IsNumber(1)) { + c->Message(Chat::White, "Usage: #haste [Percentage] - Set GM Bonus Haste (100 is 100% more Attack Speed)"); + return; } - else { - c->Message(Chat::White, "Usage: #haste [percentage]"); + + auto t = c; + if (c->GetGM() && c->GetTarget() && c->GetTarget()->IsClient()) { + t = c->GetTarget()->CastToClient(); } + + const auto extra_haste = Strings::ToInt(sep->arg[1]); + + t->SetExtraHaste(extra_haste); + t->CalcBonuses(); + t->SetAttackTimer(); + + c->Message( + Chat::White, + fmt::format( + "GM Haste Bonus set to {}%% for {}.", + Strings::Commify(extra_haste), + c->GetTargetDescription(t) + ).c_str() + ); }