mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 18:36:31 +01:00
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:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user