Scripts/Ulduar: Fix Ominous Clouds movements

Fix Ominous Clouds being only clockwise, now they move both clock and counter-clock wise.
Add a workaround for GenericMovementGenerator not handling correctly cyclic splines started by MoveCirclePath(), stopping the movement after a single round. The workaround code can be removed once the bug in GenericMovementGenerator is fixed.
This commit is contained in:
jackpoz
2020-01-17 23:05:25 +01:00
parent 196dd15912
commit c1df161e1d

View File

@@ -1163,10 +1163,25 @@ class npc_ominous_cloud : public CreatureScript
void UpdateAI(uint32 /*diff*/) override { }
void DoAction(int32 /*action*/) override
void DoAction(int32 action) override
{
me->GetMotionMaster()->MoveCirclePath(YoggSaronSpawnPos.GetPositionX(), YoggSaronSpawnPos.GetPositionY(), me->GetPositionZ() + 5.0f, me->GetDistance2d(YoggSaronSpawnPos.GetPositionX(), YoggSaronSpawnPos.GetPositionY()), true, 16);
clockwise = bool(action);
me->GetMotionMaster()->MoveCirclePath(YoggSaronSpawnPos.GetPositionX(), YoggSaronSpawnPos.GetPositionY(), me->GetPositionZ() + 5.0f, me->GetDistance2d(YoggSaronSpawnPos.GetPositionX(), YoggSaronSpawnPos.GetPositionY()), clockwise, 16);
}
void MovementInform(uint32 type, uint32 /*id*/) override
{
if (type != EFFECT_MOTION_TYPE)
return;
/* MoveCirclePath() add a GenericMovementGenerator that doesn't handle cyclic splines, handling only 1 round of the circle.
* This means we have to reschedule another MoveCirclePath() every time the previous one ends.
* Remove this code once GenericMovementGenerator properly handles cyclic splines.
*/
me->GetMotionMaster()->MoveCirclePath(YoggSaronSpawnPos.GetPositionX(), YoggSaronSpawnPos.GetPositionY(), me->GetPositionZ() + 5.0f, me->GetDistance2d(YoggSaronSpawnPos.GetPositionX(), YoggSaronSpawnPos.GetPositionY()), clockwise, 16);
}
bool clockwise = false;
};
CreatureAI* GetAI(Creature* creature) const override