diff --git a/zone/gm_commands/aggrozone.cpp b/zone/gm_commands/aggrozone.cpp index afdf4ad64..797ed2128 100755 --- a/zone/gm_commands/aggrozone.cpp +++ b/zone/gm_commands/aggrozone.cpp @@ -2,18 +2,30 @@ void command_aggrozone(Client *c, const Seperator *sep) { - if (!c) { - return; + Mob *target = c; + if (c->GetTarget()) { + target = c->GetTarget(); } - Mob *m = c->CastToMob(); - - if (!m) { - return; + uint32 hate = 0; + if (sep->IsNumber(1)) { + hate = std::stoul(sep->arg[1]); } - uint32 hate = atoi(sep->arg[1]); //should default to 0 if we don't enter anything - entity_list.AggroZone(m, hate); - c->Message(Chat::White, "Train to you! Last chance to go invulnerable..."); + entity_list.AggroZone(target, hate); + c->Message( + Chat::White, + fmt::format( + "Aggroing zone on {}.", + ( + c == target ? + "yourself" : + fmt::format( + "{} ({})", + target->GetCleanName(), + target->GetID() + ) + ) + ).c_str() + ); } -