mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-17 16:10:49 +01:00
Scripts/World: Add a lost change to the dreamfog
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user