Example #1
0
        public override void FireEvent()
        {
            if (m_monster.MapTile == null)
            {
                m_monster  = null;
                m_position = null;
                return;
            }
            ArrayList list = m_monster.MapTile.Map.GetObjectsInRange(OBJECTTYPE.PLAYER, m_position, 25.0f);

            if (list.Count > 0)
            {
                PlayerObject plr = (PlayerObject)list[random.Next(list.Count)];
                AddNode(plr.Position);
                if (NumNodes == 10)
                {
                    EventManager.AddEvent(new RandomWalkEvent(m_monster, nodes));
                    nodes      = null;
                    m_position = null;
                    m_monster  = null;
                    return;
                }
            }
            eventTime = DateTime.Now.Add(TimeSpan.FromSeconds(0.5));
            EventManager.AddEvent(this);
        }
Example #2
0
 public RandomWalkEvent(MonsterBase monster, ArrayList nodes) : base(TimeSpan.FromMilliseconds(1))
 {
     m_monster = monster;
     m_nodes   = nodes;
 }
Example #3
0
 public GetWalkNodeEvent(MonsterBase monster) : base(TimeSpan.FromSeconds(0.1))
 {
     m_monster  = monster;
     m_position = new Vector(monster.Position.X, monster.Position.Y, monster.Position.Z);
 }