Esempio n. 1
0
        public override void OnDeregister()
        {
            if (LifespanAI.IsSubscribed(this))
            {
                LifespanAI.Unsubscribe(this);
            }

            base.OnDeregister();
        }
Esempio n. 2
0
 /// <summary>
 /// Subscribes the monsters moving ai if an
 /// character appears.
 /// </summary>
 /// <param name="character"></param>
 public override void Appears(Character character)
 {
     //ENABLE THE AI
     if (!LifespanAI.IsSubscribed(this))
     {
         Lifespan.lasttick = Environment.TickCount;
         LifespanAI.Subscribe(this);
     }
 }
Esempio n. 3
0
        /// <summary>
        /// Unsubscribes the monsters moving ai if the region's player
        /// count is 0.
        /// </summary>
        /// <param name="character"></param>
        public override void Disappear(Character character)
        {
            //DISABLE THE AI
            if (Regiontree.GetCharacterCount(this) == 0)
            {
                LifespanAI.Unsubscribe(this);
                this.Position = this.DestPosition;
            }

            base.Disappear(character);
        }
Esempio n. 4
0
        /// <summary>
        /// Subscribes the monsters ai if an the monster is summoned in a crowded
        /// area.
        /// </summary>
        public override void OnRegister()
        {
            //First register the mob
            base.OnRegister();

            //Check if start moving the mob
            if (Regiontree.GetCharacterCount(this) > 0)
            {
                LifespanAI.Subscribe(this);
            }
        }
        /// <summary>
        /// Occurs when the speciafiec character killed
        /// our monsters
        /// </summary>
        /// <param name="target"></param>
        /// <returns></returns>
        public override void OnDie(MapObject target)
        {
            //Stop movement
            lock (this)
            {
                LifespanAI.Unsubscribe(this);
                this.stance = 7;
            }

            base.OnDie(target);
        }
Esempio n. 6
0
        public override void OnRegister()
        {
            this.currentzone.Regiontree.Subscribe(this);
            string filename = Server.SecurePath("~/ships/{0}.xml", this.ModelId);

            aipath = Path.FromFile(filename, this);
            if (aipath != null)
            {
                aipath.Start(this);
                LifespanAI.Subscribe(this);
            }
        }
Esempio n. 7
0
 public override void OnDeregister()
 {
     LifespanAI.Unsubscribe(this);
     base.OnDeregister();
 }
Esempio n. 8
0
 /// <summary>
 /// Occurs when the speciafiec character killed
 /// our monsters
 /// </summary>
 /// <param name="target"></param>
 /// <returns></returns>
 public override void OnDie(MapObject target)
 {
     //Stop movement
     LifespanAI.Unsubscribe(this);
     base.OnDie(target);
 }