Ejemplo n.º 1
0
        public override void OnDoubleClick(Mobile from)
        {
            BaseCreature squi = new Squire();

            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001);                   // That must be in your pack for you to use it.
                squi.Delete();
            }
            else if (from.FollowersMax - from.Followers < 5)
            {
                from.SendMessage("You have too many followers to have a squire at the moment.");
                squi.Delete();
            }
            else
            {
                squi.Controlled    = true;
                squi.ControlMaster = from;
                squi.ControlOrder  = OrderType.Follow;
                squi.ControlTarget = from;
                squi.Direction     = from.Direction & Direction.Mask;
                squi.MoveToWorld(from.Location, from.Map);

                from.SendMessage(squi.Name + " has arrived, meet your new squire!");

                this.Delete();
            }
        }
 public override void OnDelete()
 {
     try
     {
         if (m_KillTheSquire)
         {
             squire.Delete();
         }
     }
     catch
     {
         Console.Write("Error with calling squire back: {0} is being Deleted.  ItemID of:  {1}.", this.Name, this.ItemID);
     }
     base.OnDelete();
 }