Core/AI: allow manually added escort waypoints to have run states specified

*turn waypoints of Raz the Crazed into run mode
This commit is contained in:
Ovahlord
2020-07-27 00:34:28 +02:00
parent 9f6a7f6671
commit 287fdc542f
3 changed files with 5 additions and 5 deletions

View File

@@ -314,7 +314,7 @@ void EscortAI::OnCharmed(bool apply)
}
*/
void EscortAI::AddWaypoint(uint32 id, float x, float y, float z, float orientation/* = 0*/, uint32 waitTime/* = 0*/)
void EscortAI::AddWaypoint(uint32 id, float x, float y, float z, float orientation /*= 0.f*/, uint32 waitTime /*= 0*/, bool run /*= false*/)
{
Trinity::NormalizeMapCoord(x);
Trinity::NormalizeMapCoord(y);
@@ -325,7 +325,7 @@ void EscortAI::AddWaypoint(uint32 id, float x, float y, float z, float orientati
waypoint.y = y;
waypoint.z = z;
waypoint.orientation = orientation;
waypoint.moveType = _running ? WAYPOINT_MOVE_TYPE_RUN : WAYPOINT_MOVE_TYPE_WALK;
waypoint.moveType = run ? WAYPOINT_MOVE_TYPE_RUN : WAYPOINT_MOVE_TYPE_WALK;
waypoint.delay = waitTime;
waypoint.eventId = 0;
waypoint.eventChance = 100;

View File

@@ -49,7 +49,7 @@ struct TC_GAME_API EscortAI : public ScriptedAI
virtual void UpdateEscortAI(uint32 diff); // used when it's needed to add code in update (abilities, scripted events, etc)
void AddWaypoint(uint32 id, float x, float y, float z, float orientation = 0.f, uint32 waitTime = 0); // waitTime is in ms
void AddWaypoint(uint32 id, float x, float y, float z, float orientation = 0.f, uint32 waitTime = 0, bool run = false); // waitTime is in ms
void Start(bool isActiveAttacker = true, bool run = false, ObjectGuid playerGUID = ObjectGuid::Empty, Quest const* quest = nullptr, bool instantRespawn = false, bool canLoopPath = false, bool resetWaypoints = true);
void SetRun(bool on = true);

View File

@@ -635,13 +635,13 @@ struct npc_raz_the_crazed : public EscortAI
void BuildRomoggPath()
{
for (uint8 i = 0; i < 12; i++)
AddWaypoint(i, RazPathRomogg[i].GetPositionX(), RazPathRomogg[i].GetPositionY(), RazPathRomogg[i].GetPositionZ());
AddWaypoint(i, RazPathRomogg[i].GetPositionX(), RazPathRomogg[i].GetPositionY(), RazPathRomogg[i].GetPositionZ(), 0.f, 0, true);
}
void BuildCorlaPath()
{
for (uint8 i = 0; i < 2; i++)
AddWaypoint(i, RazPathCorla[i].GetPositionX(), RazPathCorla[i].GetPositionY(), RazPathCorla[i].GetPositionZ());
AddWaypoint(i, RazPathCorla[i].GetPositionX(), RazPathCorla[i].GetPositionY(), RazPathCorla[i].GetPositionZ(), 0.f, 0, true);
}
void WaypointReached(uint32 id, uint32 /*pathId*/) override