當前位置: 首頁>>代碼示例>>C#>>正文


C# Container.AddItem方法代碼示例

本文整理匯總了C#中Server.Items.Container.AddItem方法的典型用法代碼示例。如果您正苦於以下問題:C# Container.AddItem方法的具體用法?C# Container.AddItem怎麽用?C# Container.AddItem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Server.Items.Container的用法示例。


在下文中一共展示了Container.AddItem方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: OnDeath

        public override void OnDeath(Container c)
        {
            base.OnDeath(c);

            double rand = Utility.RandomDouble();

            if (0.0020 > rand)
                c.AddItem(new KrakenStatue());
            else if (0.0030 > rand)
                c.AddItem(new Fountainofyouth());
            else if (0.0040 > rand)
                c.AddItem(new BlackPearlShip());
            else if (0.0055 > rand)
                c.AddItem(new Netofthedead());
            else if (0.0060 > rand)
                c.AddItem(new PirateCap());
            else if (0.0065 > rand)
                c.AddItem(new BlackPearlOars());
            else if (0.0070 > rand)
                c.AddItem(new GhostShipAnchor());
            else if (0.0080 > rand)
                c.AddItem(new DavyJonesOar());
            else if (0.0085 > rand)
                c.AddItem(new PirateCoffin());
            else if (0.0090 > rand)
                c.AddItem(new Pulley());
            else if (0.0095 > rand)
                c.AddItem(new Hook());
            else if (0.01 > rand)
                c.AddItem(new SlipKnot());
            else if (0.02 > rand)
                c.AddItem(new MessageInABottle());
        }
開發者ID:greeduomacro,項目名稱:UO-Forever,代碼行數:33,代碼來源:FamousPiratesSpecific.cs

示例2: OnDeath

 public override void OnDeath(Container c)
 {
     switch (Utility.Random(15))
     {
         //case 0: c.AddItem(new TokenCheck(25)); break;       //Remove if not using Tokens
         case 1: c.AddItem(new LetterGeneral()); break;      //Last Item Requested.
         case 2: c.AddItem(new LetterHome()); break;         //Not requested but gives additional reward
     }
     base.OnDeath(c);
 }
開發者ID:greeduomacro,項目名稱:matts-uo-server,代碼行數:10,代碼來源:Scavenger.cs

示例3: OnDeath

		public override void OnDeath(Container c)
		{
			base.OnDeath( c );	

			double rand = Utility.RandomDouble();

			if ( 0.008 > rand ) //Small Web
				c.AddItem( new SmallWebEast() );
			else if ( 0.008 > rand ) //Small Web
				c.AddItem( new SmallWebSouth() );
		}
開發者ID:greeduomacro,項目名稱:UO-Forever,代碼行數:11,代碼來源:Honeybee.cs

示例4: OnDeath

public override void OnDeath(Container c)
		{
			base.OnDeath( c );	

			double rand = Utility.RandomDouble();

			if ( 0.0020 > rand ) 
				c.AddItem( new BloodyBandage(2) );
			else if ( 0.030 > rand ) 
				c.AddItem( new BloodyBandage() );

		}
開發者ID:greeduomacro,項目名稱:UO-Forever,代碼行數:12,代碼來源:UndeadKnight.cs

示例5: OnDeath

        public override void OnDeath( Container c )
        {
            base.OnDeath(c);

            if ( Utility.RandomBool() )
                c.AddItem( ScrollofTranscendence.CreateRandom(30, 30) );

            if ( Utility.RandomBool() )
                c.AddItem( new TatteredAncientScroll() );

            if ( Utility.RandomBool() )
                c.AddItem( new UntransTome() );

            if ( Utility.RandomBool() )
                c.AddItem( new SpiderCarapace() );

            if ( Utility.RandomDouble() < 0.01 )
                DistributeRandomArtifact( this, m_Artifact );

            // distribute quest items for the 'Green with Envy' quest given by Vernix
            List<DamageStore> rights = BaseCreature.GetLootingRights( this.DamageEntries, this.HitsMax );
            for ( int i = rights.Count - 1; i >= 0; --i )
            {
                DamageStore ds = rights[i];
                if ( !ds.m_HasRight )
                    rights.RemoveAt( i );
            }

            // for each with looting rights... give an eye of navrey if they have the quest
            foreach ( DamageStore d in rights )
            {
                PlayerMobile pm = d.m_Mobile as PlayerMobile;
                if ( null!= pm )
                {
                    foreach ( BaseQuest quest in pm.Quests )
                    {
                        if ( quest is GreenWithEnvyQuest )
                        {
                            Container pack = pm.Backpack;
                            Item item = new EyeOfNavrey(); 
                            if ( pack == null || !pack.TryDropItem( pm, item, false ) )
                                pm.BankBox.DropItem( item );
                            pm.SendLocalizedMessage( 1095155 ); // As Navrey Night-Eyes dies, you find and claim one of her eyes as proof of her demise.
                            break;
                        }
                    }
                }
            }
        }
開發者ID:suiy187,項目名稱:runuocustom,代碼行數:49,代碼來源:Navrey.cs

示例6: OnDeath

		public override void OnDeath(Container c)
		{
			base.OnDeath(c);

			if (Core.ML && Utility.RandomDouble() <= 0.25)
				c.AddItem(Loot.Construct(typeof(MapFragment)));
		}
開發者ID:Crome696,項目名稱:ServUO,代碼行數:7,代碼來源:EvilWanderingHealer.cs

示例7: OnDeath

		public override void OnDeath( Container c )
		{
			if ( Utility.Random( 18 ) < 1 )
			c.AddItem( new PurpleBall() );

			base.OnDeath( c );
		}
開發者ID:kamronbatman,項目名稱:DefianceUO-Pre1.10,代碼行數:7,代碼來源:NewbornLich.cs

示例8: OnDeath

		public override void OnDeath( Container c )
		{
			base.OnDeath( c );

			if ( m_CanHatch && 0.01 > Utility.RandomDouble() ) //Egg Case
				c.AddItem( new EggCase() );
		}
開發者ID:greeduomacro,項目名稱:UO-Forever,代碼行數:7,代碼來源:CamelSpider.cs

示例9: DisRobe

			private static void DisRobe( Mobile m_from, Container cont, Layer layer ) 
			{ 
				if ( m_from.FindItemOnLayer( layer ) != null )
				{
					Item item = m_from.FindItemOnLayer( layer );
					cont.AddItem( item );
				}
			}
開發者ID:PepeBiondi,項目名稱:runsa,代碼行數:8,代碼來源:GMbody.cs

示例10: OnDeath

 public override void OnDeath(Container c)
 {
     switch (Utility.Random(2))
     {
         //case 0: c.AddItem(new TokenCheck(25)); break;       //Remove if not using Tokens
         case 1: c.AddItem(new SpecialLeather()); break;     //6th Item Requested
     }
     base.OnDeath(c);
 }
開發者ID:greeduomacro,項目名稱:matts-uo-server,代碼行數:9,代碼來源:HookRat.cs

示例11: OnDeath

        public override void OnDeath(Container c)
        {
            switch (Utility.Random(2))
            {
 //               case 0: c.AddItem(new TokenCheck(25)); break;  //Remove if not using token
                case 1: c.AddItem(new TrainSupplies()); break;  //1st Item requested.
            }
            base.OnDeath(c);
        }
開發者ID:greeduomacro,項目名稱:matts-uo-server,代碼行數:9,代碼來源:BroodSkeleton.cs

示例12: OnDeath

 public override void OnDeath(Container c)
 {
     switch (Utility.Random(2))
     {
         //case 0: c.AddItem(new TokenCheck(25)); break;   //Remove if not using tokens
         case 1: c.AddItem(new DarkBone()); break;       //3rd item requested
     }
     base.OnDeath(c);
 }
開發者ID:greeduomacro,項目名稱:matts-uo-server,代碼行數:9,代碼來源:CelestialWraith.cs

示例13: OnAfterDeath

        protected override void OnAfterDeath( Container c )
        {
            base.OnAfterDeath( c );
            c.AddItem( new Engines.MLQuests.GrobusFur() );

            if (1000 > Utility.Random(100000))
            {
                c.DropItem(SetItemsHelper.GetRandomSetItem());
            }
        }
開發者ID:Ravenwolfe,項目名稱:xrunuo,代碼行數:10,代碼來源:Grobu.cs

示例14: OnDeath

        public override void OnDeath(Container c)
        {
            base.OnDeath(c);

            if (Utility.RandomBool())
                c.AddItem(ScrollofTranscendence.CreateRandom(30, 30));

            if (Utility.RandomBool())
                c.AddItem(new TatteredAncientScroll());

            if (Utility.RandomBool())
                c.AddItem(new UntransTome());

            if (Utility.RandomBool())
                c.AddItem(new SpiderCarapace());

            // add special drops to backpack here
            if (Utility.RandomDouble() < 0.025)
                c.AddItem(new Tangle1());

            if (Utility.RandomDouble() < 0.025)
                c.AddItem(new EyeOfNavery());

            if (Utility.RandomDouble() < 0.01)
                DistributeArtifact(DemonKnight.FindRandomPlayer(this), new NightEyes());
        }
開發者ID:greeduomacro,項目名稱:cov-shard-svn-1,代碼行數:26,代碼來源:Navrey.cs

示例15: OnDeath

        public override void OnDeath(Container c)
        {
            // No loot !
            foreach (Item i in c.Items)
            {
                i.Delete();
            }

            // fun?
            if (Utility.Random(25) == 10)
            {
                Item apple = new Apple();
                apple.Name = "Pomme qui tua Blanche-Neige";
                c.AddItem(apple);
            }

            base.OnDeath(c);
        }
開發者ID:greeduomacro,項目名稱:vivre-uo,代碼行數:18,代碼來源:BaseMercenary.cs


注:本文中的Server.Items.Container.AddItem方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。