From 87e5b3a08cecce2ae5833f3dfec1b10e0c1ce1a8 Mon Sep 17 00:00:00 2001 From: jackpoz Date: Fri, 17 Jan 2020 23:05:25 +0100 Subject: 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. (cherry picked from commit c1df161e1ddf95584030480d3dcb15149aacd7a6) --- .../Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp index 9d2237591fb..2422be16ec5 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp @@ -1162,10 +1162,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 -- cgit v1.2.3