mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-14 15:41:30 +00:00
[Commands] Cleanup #aggrozone Command. (#1798)
- Cleanup message and logic. - Add the ability to aggro the zone on your target if you have one.
This commit is contained in:
parent
446c5d90ec
commit
04fda24c8e
@ -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()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user