コード例 #1
0
 public override void CreateBaby()
 {
     for (int j = 0; j < this.LitterSize; j++)
     {
         WildHorse foal = new WildHorse();
         foal.Female   = ((Utility.RandomMinMax(1, 4) == 1) ? false: true);
         foal.Mother   = this;
         foal.Spawned  = false;
         foal.TypeName = "a horse";
         if (Utility.RandomBool())
         {
             foal.MotherBreed = m_MotherBreed;
             //this.Say("passes on "+m_MotherBreed);
         }
         else
         {
             foal.MotherBreed = m_FatherBreed;
             //this.Say("passes on "+m_FatherBreed);
         }
         foal.FatherBreed = m_FoalFatherBreed;
         foal.MakeBaby();
         if (this.Brand != "" && this.Brand != null)
         {
             foal.Owner = this.Owner;
         }
         foal.MoveToWorld(this.Location, this.Map);
     }
     base.CreateBaby();
 }
コード例 #2
0
        public override void OnThink()
        {
            base.OnThink();
//wild animal start
            if ((this.ControlMaster == null) && (this.SummonMaster == null))
            {
                WildHorse wh = new WildHorse();
                wh.Location = this.Location;
                wh.Map      = this.Map;
                Backpack  bag      = new Backpack();
                Container pack     = this.Backpack;
                ArrayList bagitems = new ArrayList(pack.Items);
                foreach (Item item in bagitems)
                {
                    bag.DropItem(item);
                }
                bag.MoveToWorld(this.Location, this.Map);
                wh.MoveToWorld(this.Location, this.Map);
                PublicOverheadMessage(MessageType.Regular, 0x3B2, false, "* The Horse shakes off its pack! *");
                this.Delete();
            }
//wild animal end
        }