public override void DoReset(TUnit unit)
        {
            NextMoveTime.Reset(0);

            if (!unit.IsAlive || unit.IsStopped)
            {
                return;
            }

            unit.AddState(UnitControlState.Confused | UnitControlState.ConfusedMove);
        }
        public override bool DoUpdate(TUnit unit, uint timeDiff)
        {
            if (unit.HasState(UnitControlState.Root | UnitControlState.Stunned | UnitControlState.Distracted))
            {
                return(true);
            }

            if (NextMoveTime.Passed)
            {
                // currently moving, update location
                unit.AddState(UnitControlState.ConfusedMove);
                NextMoveTime.Reset(RandomUtils.Next(800, 1500));
            }
            else
            {
                NextMoveTime.Update(timeDiff);
                if (NextMoveTime.Passed)
                {
                    unit.AddState(UnitControlState.ConfusedMove);
                }
            }

            return(true);
        }