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


C# Items.Container類代碼示例

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


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

示例1: Fill

		public static void Fill( Container c, int itemCount, double talismanChance )
		{
			c.Hue = Utility.RandomNondyedHue();

			int done = 0;

			if ( Utility.RandomDouble() < talismanChance )
			{
				c.DropItem( new RandomTalisman() );
				++done;
			}

			for ( ; done < itemCount; ++done )
			{
				Item loot = null;

				switch ( Utility.Random( 5 ) )
				{
					case 0: loot = Loot.RandomWeapon( false, true ); break;
					case 1: loot = Loot.RandomArmor( false, true ); break;
					case 2: loot = Loot.RandomRangedWeapon( false, true ); break;
					case 3: loot = Loot.RandomJewelry(); break;
					case 4: loot = Loot.RandomHat( false ); break;
				}

				if ( loot == null )
					continue;

				Enhance( loot );
				c.DropItem( loot );
			}
		}
開發者ID:nathanvy,項目名稱:runuo,代碼行數:32,代碼來源:RewardBags.cs

示例2: OnDeath

		public override void OnDeath( Container c )
		{
			if ( Utility.Random( 250 ) <  1 )
				c.DropItem( new SpiderWeb() );

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

示例3: OnDeath

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

            if (Utility.RandomDouble() < 0.5)
                c.DropItem(new VoidOrb());
        }
開發者ID:aj9251,項目名稱:ServUO,代碼行數:7,代碼來源:Relanord.cs

示例4: 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

示例5: OnDeath

        public override void OnDeath(Container c)
        {
            base.OnDeath(c);	
			
            if (Utility.RandomDouble() < 0.2)
                c.DropItem(new SerpentFangKey());
        }
開發者ID:m309,項目名稱:ForkUO,代碼行數:7,代碼來源:SerpentsFangHighExecutioner.cs

示例6: OnDeath

        public override void OnDeath(Container c)
        {
            if (Utility.RandomDouble() <= 0.1)
            {
                c.DropItem(new BlindingAnkh());
            }

            if (Utility.RandomDouble() <= 0.01)
            {
                c.DropItem(new DaemonBlood{Hue = 33, Name = "Daemon Ichor"});
            }

            if (Utility.RandomDouble() <= 0.001)
            {
                if (Utility.RandomBool())
                {
                    c.DropItem(new BloodSpear {Hue = 33});
                }
                else
                {
                    c.DropItem(new BloodFork { Hue = 33 });
                }
            }
            base.OnDeath(c);
        }
開發者ID:greeduomacro,項目名稱:UO-Forever,代碼行數:25,代碼來源:AsylumGuardian.cs

示例7: OnDeath

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

			if ( Utility.RandomDouble() < 0.1 )
				c.DropItem( new PrimitiveFetish() );
		}
開發者ID:jackuoll,項目名稱:Pre-AOS-RunUO,代碼行數:7,代碼來源:Troglodyte.cs

示例8: OnKill

		public override void OnKill( BaseCreature creature, Container corpse )
		{
			if ( creature is CursedSoul )
			{
				if ( m_CursedSoulsKilled == 0 )
					System.AddConversation( new GainKarmaConversation( true ) );

				m_CursedSoulsKilled++;

				// Cursed Souls killed:  ~1_COUNT~
				System.From.SendLocalizedMessage( 1063038, m_CursedSoulsKilled.ToString() );
			}
			else if ( creature is YoungRonin )
			{
				if ( m_YoungRoninKilled == 0 )
					System.AddConversation( new GainKarmaConversation( false ) );

				m_YoungRoninKilled++;

				// Young Ronin killed:  ~1_COUNT~
				System.From.SendLocalizedMessage( 1063039, m_YoungRoninKilled.ToString() );
			}

			CurProgress = Math.Max( m_CursedSoulsKilled, m_YoungRoninKilled );
		}
開發者ID:FreeReign,項目名稱:imaginenation,代碼行數:25,代碼來源:Objectives.cs

示例9: OnDeath

		public override void OnDeath( Container c )
		{ 
			if( this.m_GoldOnDeath > 0 ) 
				c.DropItem( new Gold( this.m_GoldOnDeath ) );

			base.OnDeath( c );
		}
開發者ID:greeduomacro,項目名稱:last-wish,代碼行數:7,代碼來源:BaseHire.cs

示例10: OnDeath

        public override void OnDeath(Container c)
        {

            base.OnDeath(c);
            Region reg = Region.Find(c.GetWorldLocation(), c.Map);
            if (0.25 > Utility.RandomDouble() && reg.Name == "Fairy Dragon Lair")
            {
                switch (Utility.Random(2))
                {
                    case 0: c.DropItem(new EssenceDiligence()); break;
                    case 1: c.DropItem(new FaeryDust()); break;
                }
            }
            if (Utility.RandomDouble() <= 0.25)
            {
                switch (Utility.Random(2))
                {
                    case 0:
                        c.DropItem(new FeyWings());
                        break;
                    case 1:
                        c.DropItem(new FairyDragonWing());
                        break;

                }
            }

            if (Utility.RandomDouble() < 0.10)
            {
                c.DropItem(new DraconicOrb());

            }
        }
開發者ID:Tukaramdas,項目名稱:ServUO-EC-Test-Fork,代碼行數:33,代碼來源:FairyDragon.cs

示例11: OnDeath

		public override void OnDeath( Container c )
		{
			base.OnDeath( c );		
/*
			c.DropItem( new LardOfParoxysmus() );
			
			switch ( Utility.Random( 3 ) )
			{
				case 0: c.DropItem( new ParoxysmusDinner() ); break;
				case 1: c.DropItem( new ParoxysmusCorrodedStein() ); break;
				case 2: c.DropItem( new StringOfPartsOfParoxysmusVictims() ); break;
			}
			
			if ( Utility.RandomDouble() < 0.6 )				
				c.DropItem( new ParrotItem() );
			
			if ( Utility.RandomBool() )
				c.DropItem( new SweatOfParoxysmus() );
				
			if ( Utility.RandomDouble() < 0.05 )
				c.DropItem( new ParoxysmusSwampDragonStatuette() );
				
			if ( Utility.RandomDouble() < 0.05 )
				c.DropItem( new ScepterOfTheChief() );
				
			if ( Utility.RandomDouble() < 0.025 )
				c.DropItem( new CrimsonCincture() );
*/
		}
開發者ID:ITLongwell,項目名稱:runuo-nerun-distro,代碼行數:29,代碼來源:ChiefParoxysmus.cs

示例12: Target

        public void Target( Container item )
        {
            if ( CheckSequence() )
            {
                SpellHelper.Turn( Caster, item );

                object root = item.RootParent;

                if ( !item.IsAccessibleTo( Caster ) )
                {
                    item.OnDoubleClickNotAccessible( Caster );
                }
                else if ( !item.CheckItemUse( Caster, item ) )
                {
                }
                else if ( root != null && root is Mobile && root != Caster )
                {
                    item.OnSnoop( Caster );
                }
                else if ( item is Corpse && !((Corpse)item).CheckLoot( Caster, null ) )
                {
                }
                else if ( Caster.Region.OnDoubleClick( Caster, item ) )
                {
                    Effects.SendLocationParticles( EffectItem.Create( item.Location, item.Map, EffectItem.DefaultDuration ), 0x376A, 9, 32, 5022 );
                    Effects.PlaySound( item.Location, item.Map, 0x1F5 );

                    item.DisplayTo( Caster );
                    item.OnItemUsed( Caster, item );
                }
            }

            FinishSequence();
        }
開發者ID:Godkong,項目名稱:Origins,代碼行數:34,代碼來源:Telekinesis.cs

示例13: OnDeath

		public override void OnDeath( Container c )
		{
			base.OnDeath( c );	
			
			if ( Utility.RandomDouble() < 0.3 )
				c.DropItem( new TigerClawKey() );
		}
開發者ID:greeduomacro,項目名稱:cov-shard-svn-1,代碼行數:7,代碼來源:TigersClawMaster.cs

示例14: OnDeath

		public override void OnDeath( Container c )
		{
			if ( Utility.Random( 10 ) < 1 )
				c.DropItem( new SnowDrop( Utility.RandomMinMax( 1, 3 ) ) );

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

示例15: OnDeath

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

            if ( Utility.RandomDouble() < 0.4 )
            c.DropItem( new ScatteredCrystals() );
        }
開發者ID:Ziden,項目名稱:ServUO-EC-Test-Fork,代碼行數:7,代碼來源:CrystalDaemon.cs


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