diff options
| author | jackpoz <giacomopoz@gmail.com> | 2020-01-17 23:05:25 +0100 |
|---|---|---|
| committer | jackpoz <giacomopoz@gmail.com> | 2020-01-17 23:05:25 +0100 |
| commit | c1df161e1ddf95584030480d3dcb15149aacd7a6 (patch) | |
| tree | 057437edfcc9038667121320047c8d9d8e552bd8 /src | |
| parent | 196dd1591234c9a69457f4198c6a2bb2411d8d91 (diff) | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
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 5d0f5596fcd..261ab643524 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp @@ -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 |
