fix(Scripts/SunwellPlateau): Felmyst should choose the closest side (#21865)

This commit is contained in:
Andrew
2025-04-07 06:58:21 -03:00
committed by GitHub
parent b5931cd53a
commit 1355762160

View File

@@ -107,7 +107,8 @@ const Position RightSideLanes[3] =
const Position RightSide = { 1458.5555f, 502.1995f, 59.899513f, 1.605702f };
const Position LeftSide = { 1469.0642f, 729.5854f, 59.823853f, 4.6774f };
const Position LandingPos = { 1476.77f, 665.094f, 20.6423f };
const Position LandingRightPos = { 1476.77f, 665.094f, 20.6423f };
const Position LandingLeftPos = { 1469.93f, 557.009f, 22.631699f };
class CorruptTriggers : public BasicEvent
{
@@ -285,21 +286,25 @@ struct boss_felmyst : public BossAI
scheduler.Schedule(27s, GROUP_BREATH, [this](TaskContext)
{
me->GetMotionMaster()->MovePoint(POINT_AIR_UP, RightSide);
if (me->GetDistance(LeftSide) < me->GetDistance(RightSide))
me->GetMotionMaster()->MovePoint(POINT_AIR_UP, LeftSide);
else
me->GetMotionMaster()->MovePoint(POINT_AIR_UP, RightSide);
});
break;
case POINT_AIR_UP:
me->m_Events.AddEventAtOffset([&] {
bool isRightSide = me->FindNearestCreature(NPC_WORLD_TRIGGER_RIGHT, 30.0f);
if (_strafeCount >= 3)
{
_strafeCount = 0;
me->GetMotionMaster()->MoveLand(POINT_GROUND, LandingPos);
me->GetMotionMaster()->MoveLand(POINT_GROUND, isRightSide ? LandingRightPos : LandingLeftPos);
return;
}
++_strafeCount;
_currentLane = urand(0, 2);
if (me->FindNearestCreature(NPC_WORLD_TRIGGER_RIGHT, 30.0f))
if (isRightSide)
me->GetMotionMaster()->MovePoint(POINT_LANE, RightSideLanes[_currentLane], false);
else
me->GetMotionMaster()->MovePoint(POINT_LANE, LeftSideLanes[_currentLane], false);