mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 13:16:23 +00:00
(Scripts/AI) ZG20: Jeklik (Bat Boss) - Implement Bat Riders, other fixes and improvements (#17573)
--------- Co-authored-by: AG <43139552+AGandrup@users.noreply.github.com>
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include "RandomMovementGenerator.h"
|
||||
#include "TargetedMovementGenerator.h"
|
||||
#include "WaypointMovementGenerator.h"
|
||||
#include "WaypointMgr.h"
|
||||
|
||||
inline MovementGenerator* GetIdleMovementGenerator()
|
||||
{
|
||||
@@ -448,6 +449,21 @@ void MotionMaster::MoveSplinePath(Movement::PointsArray* path)
|
||||
}
|
||||
}
|
||||
|
||||
void MotionMaster::MoveSplinePath(uint32 path_id)
|
||||
{
|
||||
// convert the path id to a Movement::PointsArray*
|
||||
Movement::PointsArray* points = new Movement::PointsArray();
|
||||
WaypointPath const* path = sWaypointMgr->GetPath(path_id);
|
||||
for (uint8 i = 0; i < path->size(); ++i)
|
||||
{
|
||||
WaypointData const* node = path->at(i);
|
||||
points->push_back(G3D::Vector3(node->x, node->y, node->z));
|
||||
}
|
||||
|
||||
// pass the new PointsArray* to the appropriate MoveSplinePath function
|
||||
MoveSplinePath(points);
|
||||
}
|
||||
|
||||
void MotionMaster::MoveLand(uint32 id, Position const& pos, float speed /* = 0.0f*/)
|
||||
{
|
||||
// Xinef: do not allow to move with UNIT_FLAG_DISABLE_MOVE
|
||||
|
||||
@@ -212,6 +212,7 @@ public:
|
||||
{ MovePoint(id, pos.m_positionX, pos.m_positionY, pos.m_positionZ, generatePath, forceDestination, MOTION_SLOT_ACTIVE, pos.GetOrientation()); }
|
||||
void MovePoint(uint32 id, float x, float y, float z, bool generatePath = true, bool forceDestination = true, MovementSlot slot = MOTION_SLOT_ACTIVE, float orientation = 0.0f);
|
||||
void MoveSplinePath(Movement::PointsArray* path);
|
||||
void MoveSplinePath(uint32 path_id);
|
||||
|
||||
// These two movement types should only be used with creatures having landing/takeoff animations
|
||||
void MoveLand(uint32 id, Position const& pos, float speed = 0.0f);
|
||||
|
||||
Reference in New Issue
Block a user