当前位置: 首页>>代码示例>>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;未经允许,请勿转载。