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 authored and Ovahlord committed 2020-04-04 19:11:23 +02:00
1 parent eba5dafada
commit 14e585d66b
1 file changed
+17 -2
@@ -1149,10 +1149,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