From 69c487abe51ac655b1f9cd4bc7388fb01e30fb0e Mon Sep 17 00:00:00 2001 From: megamage Date: Sat, 29 Aug 2009 17:14:47 -0500 Subject: *Handle creature rotation using movement generator. Please tell me if this breaks any script. --HG-- branch : trunk --- .../coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/bindings/scripts') diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp index fcc9c70a0f7..81df36cf986 100644 --- a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp @@ -163,6 +163,12 @@ struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI } } + void MovementInform(uint32 type, uint32 id) + { + if(type == ROTATE_MOTION_TYPE) + me->SetReactState(REACT_AGGRESSIVE); + } + void UpdateAI(const uint32 diff) { if(!CanStartEvent)//boss is invisible, don't attack @@ -216,10 +222,8 @@ struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI if (SpoutTimer < diff) { m_creature->MonsterTextEmote(EMOTE_SPOUT,0,true); - if(rand()%2) - m_creature->StartAutoRotate(CREATURE_ROTATE_LEFT,20000); - else - m_creature->StartAutoRotate(CREATURE_ROTATE_RIGHT,20000); + me->SetReactState(REACT_PASSIVE); + me->GetMotionMaster()->MoveRotate(20000, rand()%2 ? ROTATE_DIRECTION_LEFT : ROTATE_DIRECTION_RIGHT); SpoutTimer = 45000; WhirlTimer = 20000;//whirl directly after spout RotTimer = 20000; @@ -298,7 +302,7 @@ struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI }else WaterboltTimer -= diff; } - if (!UpdateVictim()) + if (!UpdateCombatState()) return; DoMeleeAttackIfReady(); -- cgit v1.2.3