From 864957b403d00a14cd5f60ca136905035374d1cd Mon Sep 17 00:00:00 2001 From: click Date: Mon, 30 May 2011 04:31:59 +0200 Subject: Scripts/World: Add a lost change to the dreamfog --- src/server/scripts/World/boss_emerald_dragons.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/server') diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp index e0a103d7e4f..65e70b84b58 100644 --- a/src/server/scripts/World/boss_emerald_dragons.cpp +++ b/src/server/scripts/World/boss_emerald_dragons.cpp @@ -190,6 +190,8 @@ class npc_dream_fog : public CreatureScript void Reset() { + _activeFog = false; + _roamTimer = 0; me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NON_ATTACKABLE); } @@ -204,16 +206,22 @@ class npc_dream_fog : public CreatureScript _activeFog = true; } - // Chase target, but don't attack - otherwise just roam around - Unit* target = SelectTarget(SELECT_TARGET_RANDOM); - if (target) - me->GetMotionMaster()->MoveChase(target); - else - me->GetMotionMaster()->MoveIdle(); + if (!_roamTimer) + { + // Chase target, but don't attack - otherwise just roam around + Unit* target = SelectTarget(SELECT_TARGET_RANDOM); + if (target) + me->GetMotionMaster()->MoveChase(target); + else + me->GetMotionMaster()->MoveIdle(); + _roamTimer = 15000; + } + --_roamTimer; } private: bool _activeFog; + uint32 _roamTimer; }; CreatureAI* GetAI(Creature* creature) const -- cgit v1.2.3