mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 05:06:24 +00:00
fix(Scripts/Underbog): modernise boss scripts (#16149)
This commit is contained in:
@@ -344,6 +344,32 @@ void MotionMaster::MoveBackwards(Unit* target, float dist)
|
||||
init.Launch();
|
||||
}
|
||||
|
||||
void MotionMaster::MoveForwards(Unit* target, float dist)
|
||||
{
|
||||
//like movebackwards, but without the inversion
|
||||
if (!target)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Position const& pos = target->GetPosition();
|
||||
float angle = target->GetAngle(_owner);
|
||||
G3D::Vector3 point;
|
||||
point.x = pos.m_positionX + dist * cosf(angle);
|
||||
point.y = pos.m_positionY + dist * sinf(angle);
|
||||
point.z = pos.m_positionZ;
|
||||
|
||||
if (!_owner->GetMap()->CanReachPositionAndGetValidCoords(_owner, point.x, point.y, point.z, true, true))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Movement::MoveSplineInit init(_owner);
|
||||
init.MoveTo(point.x, point.y, point.z, false);
|
||||
init.SetFacing(target);
|
||||
init.Launch();
|
||||
}
|
||||
|
||||
void MotionMaster::MoveCircleTarget(Unit* target)
|
||||
{
|
||||
if (!target)
|
||||
|
||||
@@ -205,6 +205,7 @@ public:
|
||||
void MoveChase(Unit* target, float dist) { MoveChase(target, ChaseRange(dist)); }
|
||||
void MoveCircleTarget(Unit* target);
|
||||
void MoveBackwards(Unit* target, float dist);
|
||||
void MoveForwards(Unit* target, float dist);
|
||||
void MoveConfused();
|
||||
void MoveFleeing(Unit* enemy, uint32 time = 0);
|
||||
void MovePoint(uint32 id, const Position& pos, bool generatePath = true, bool forceDestination = true)
|
||||
|
||||
Reference in New Issue
Block a user