mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-17 14:31: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)
|
void command_aggrozone(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
if (!c) {
|
Mob *target = c;
|
||||||
return;
|
if (c->GetTarget()) {
|
||||||
|
target = c->GetTarget();
|
||||||
}
|
}
|
||||||
|
|
||||||
Mob *m = c->CastToMob();
|
uint32 hate = 0;
|
||||||
|
if (sep->IsNumber(1)) {
|
||||||
if (!m) {
|
hate = std::stoul(sep->arg[1]);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 hate = atoi(sep->arg[1]); //should default to 0 if we don't enter anything
|
entity_list.AggroZone(target, hate);
|
||||||
entity_list.AggroZone(m, hate);
|
c->Message(
|
||||||
c->Message(Chat::White, "Train to you! Last chance to go invulnerable...");
|
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