mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
[Commands] Cleanup #wpinfo Command. (#1866)
- Cleanup message and logic. - Only display grid/waypoints if NPC has a grid.
This commit is contained in:
+45
-18
@@ -76,26 +76,53 @@ void NPC::AI_SetRoambox(
|
||||
roambox_min_delay = min_delay;
|
||||
}
|
||||
|
||||
void NPC::DisplayWaypointInfo(Client *c) {
|
||||
void NPC::DisplayWaypointInfo(Client *client) {
|
||||
client->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Waypoint Info for {} ({}) | Grid: {} Waypoint: {} of {}",
|
||||
GetCleanName(),
|
||||
GetID(),
|
||||
GetGrid(),
|
||||
GetCurWp(),
|
||||
GetMaxWp()
|
||||
).c_str()
|
||||
);
|
||||
|
||||
c->Message(Chat::White, "Mob is on grid %d, in spawn group %d, on waypoint %d/%d",
|
||||
GetGrid(),
|
||||
GetSpawnGroupId(),
|
||||
GetCurWp(),
|
||||
GetMaxWp());
|
||||
client->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Waypoint Info for {} ({}) | Spawn Group: {} Spawn Point: {}",
|
||||
GetCleanName(),
|
||||
GetID(),
|
||||
GetSpawnGroupId(),
|
||||
GetSpawnPointID()
|
||||
).c_str()
|
||||
);
|
||||
|
||||
|
||||
std::vector<wplist>::iterator cur, end;
|
||||
cur = Waypoints.begin();
|
||||
end = Waypoints.end();
|
||||
for (; cur != end; ++cur) {
|
||||
c->Message(Chat::White, "Waypoint %d: (%.2f,%.2f,%.2f,%.2f) pause %d",
|
||||
cur->index,
|
||||
cur->x,
|
||||
cur->y,
|
||||
cur->z,
|
||||
cur->heading,
|
||||
cur->pause);
|
||||
|
||||
for (const auto& current_waypoint : Waypoints) {
|
||||
client->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Waypoint {}{} | XYZ: {:.2f}, {:.2f}, {:.2f} Heading: {:.2f}{}",
|
||||
current_waypoint.index,
|
||||
current_waypoint.centerpoint ? " (Center)" : "",
|
||||
current_waypoint.x,
|
||||
current_waypoint.y,
|
||||
current_waypoint.z,
|
||||
current_waypoint.heading,
|
||||
(
|
||||
current_waypoint.pause ?
|
||||
fmt::format(
|
||||
"{} ({})",
|
||||
ConvertSecondsToTime(current_waypoint.pause),
|
||||
current_waypoint.pause
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user