diff options
author | jackpoz <giacomopoz@gmail.com> | 2020-01-17 23:05:25 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-12-20 22:34:14 +0100 |
commit | 87e5b3a08cecce2ae5833f3dfec1b10e0c1ce1a8 (patch) | |
tree | ee971fcca72a0150d315783428488641edbc88e4 /src | |
parent | e239c097c277150a5ba9c2550743eca8b120e5d1 (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.
(cherry picked from commit c1df161e1ddf95584030480d3dcb15149aacd7a6)
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 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 |