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


C# Corpse.AddCarvedItem方法代碼示例

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


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

示例1: OnCarve

		public virtual void OnCarve( Mobile from, Corpse corpse, Item with )
		{
			int feathers = Feathers;
			int wool = Wool;
			int meat = Meat;
			int hides = Hides;
			int scales = Scales;

			if ( (feathers == 0 && wool == 0 && meat == 0 && hides == 0 && scales == 0) || Summoned || IsBonded || corpse.Animated )
			{
				if ( corpse.Animated ) 
					corpse.SendLocalizedMessageTo( from, 500464 );	// Use this on corpses to carve away meat and hide
				else
				from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse.
			}
			else
			{
				if( Core.ML && from.Race == Race.Human )
				{
					hides = (int)Math.Ceiling( hides * 1.1 );	//10% Bonus Only applies to Hides, Ore & Logs
				}

				if ( corpse.Map == Map.Felucca )
				{
					feathers *= 2;
					wool *= 2;
					hides *= 2;

					if (Core.ML)
					{
						meat *= 2;
						scales *= 2;
					}
				}

				new Blood( 0x122D ).MoveToWorld( corpse.Location, corpse.Map );

				if ( feathers != 0 )
				{
					corpse.AddCarvedItem( new Feather( feathers ), from );
					from.SendLocalizedMessage( 500479 ); // You pluck the bird. The feathers are now on the corpse.
				}

				if ( wool != 0 )
				{
					corpse.AddCarvedItem( new TaintedWool( wool ), from );
					from.SendLocalizedMessage( 500483 ); // You shear it, and the wool is now on the corpse.
				}

				if ( meat != 0 )
				{
					if ( MeatType == MeatType.Ribs )
						corpse.AddCarvedItem( new RawRibs( meat ), from );
					else if ( MeatType == MeatType.Bird )
						corpse.AddCarvedItem( new RawBird( meat ), from );
					else if ( MeatType == MeatType.LambLeg )
						corpse.AddCarvedItem( new RawLambLeg( meat ), from );

					from.SendLocalizedMessage( 500467 ); // You carve some meat, which remains on the corpse.
				}

				if ( hides != 0 )
				{
					Item holding = from.Weapon as Item;
					if ( Core.AOS && ( holding is SkinningKnife /* TODO: || holding is ButcherWarCleaver || with is ButcherWarCleaver */ ) )
					{
						Item leather = null;

						switch ( HideType )
						{
							case HideType.Regular: leather = new Leather( hides ); break;
							case HideType.Spined: leather = new SpinedLeather( hides ); break;
							case HideType.Horned: leather = new HornedLeather( hides ); break;
							case HideType.Barbed: leather = new BarbedLeather( hides ); break;
						}

						if ( leather != null )
						{
							if ( !from.PlaceInBackpack( leather ) )
							{
								corpse.DropItem( leather );
								from.SendLocalizedMessage( 500471 ); // You skin it, and the hides are now in the corpse.
							}
							else
								from.SendLocalizedMessage( 1073555 ); // You skin it and place the cut-up hides in your backpack.
						}
					}
					else
					{
						if ( HideType == HideType.Regular )
							corpse.DropItem( new Hides( hides ) );
						else if ( HideType == HideType.Spined )
							corpse.DropItem( new SpinedHides( hides ) );
						else if ( HideType == HideType.Horned )
							corpse.DropItem( new HornedHides( hides ) );
						else if ( HideType == HideType.Barbed )
							corpse.DropItem( new BarbedHides( hides ) );

						from.SendLocalizedMessage( 500471 ); // You skin it, and the hides are now in the corpse.
					}
//.........這裏部分代碼省略.........
開發者ID:greeduomacro,項目名稱:uotitan,代碼行數:101,代碼來源:BaseCreature.cs

示例2: OnCarve

        public override void OnCarve(Mobile from, Corpse corpse, Item with)
        {
            base.OnCarve(from, corpse, with);

            if (!GatheredFur)
            {
                from.SendLocalizedMessage(1112765); // You shear it, and the fur is now on the corpse.
                corpse.AddCarvedItem(new BouraFur(15), from);
                GatheredFur = true;
            }
        }
開發者ID:Ravenwolfe,項目名稱:ServUO,代碼行數:11,代碼來源:RuddyBoura.cs

示例3: OnCarve

        public virtual void OnCarve( Mobile from, Corpse corpse, bool butcher )
        {
            int feathers = Feathers;
            int wool = Wool;
            int meat = Meat;
            int hides = Hides;
            int scales = Scales;
            int blood = Blood;
            int fur = Fur;

            if ( ( feathers == 0 && wool == 0 && meat == 0 && hides == 0 && scales == 0 && blood == 0 && fur == 0 ) || Summoned || IsBonded )
            {
                from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse.
            }
            else
            {
                if ( from.Race == Race.Human )
                    hides = (int) Math.Ceiling( hides * 1.1 ); // 10% Bonus Only applies to Hides, Ore & Logs

                if ( corpse.Map == Map.Felucca )
                {
                    feathers *= 2;
                    wool *= 2;
                    meat *= 2;
                    hides *= 2;
                    scales *= 2;
                    blood *= 2;
                    fur *= 2;
                }

                new Blood( 0x122D ).MoveToWorld( corpse.Location, corpse.Map );

                if ( feathers != 0 )
                {
                    corpse.AddCarvedItem( new Feather( feathers ), from );
                    from.SendLocalizedMessage( 500479 ); // You pluck the bird. The feathers are now on the corpse.
                }

                if ( wool != 0 )
                {
                    corpse.AddCarvedItem( new Wool( wool ), from );
                    from.SendLocalizedMessage( 500483 ); // You shear it, and the wool is now on the corpse.
                }

                if ( meat != 0 )
                {
                    if ( MeatType == MeatType.Ribs )
                        corpse.AddCarvedItem( new RawRibs( meat ), from );
                    else if ( MeatType == MeatType.Bird )
                        corpse.AddCarvedItem( new RawBird( meat ), from );
                    else if ( MeatType == MeatType.LambLeg )
                        corpse.AddCarvedItem( new RawLambLeg( meat ), from );
                    else if ( MeatType == MeatType.Rotworm )
                        corpse.AddCarvedItem( new RawRotwormMeat( meat ), from );

                    from.SendLocalizedMessage( 500467 ); // You carve some meat, which remains on the corpse.
                }

                if ( hides != 0 )
                {
                    if ( butcher )
                    {
                        Item item = null;

                        if ( HideType == HideType.Regular )
                            item = new Leather( hides );
                        else if ( HideType == HideType.Spined )
                            item = new SpinedLeather( hides );
                        else if ( HideType == HideType.Horned )
                            item = new HornedLeather( hides );
                        else if ( HideType == HideType.Barbed )
                            item = new BarbedLeather( hides );

                        if ( item != null )
                        {
                            if ( from.AddToBackpack( item ) )
                            {
                                from.SendLocalizedMessage( 1073555 ); // You skin it and place the cut-up hides in your backpack.
                            }
                            else
                            {
                                corpse.AddCarvedItem( item, from );
                                from.SendLocalizedMessage( 500471 ); // You skin it, and the hides are now in the corpse.
                            }
                        }
                    }
                    else
                    {
                        if ( HideType == HideType.Regular )
                            corpse.AddCarvedItem( new Hides( hides ), from );
                        else if ( HideType == HideType.Spined )
                            corpse.AddCarvedItem( new SpinedHides( hides ), from );
                        else if ( HideType == HideType.Horned )
                            corpse.AddCarvedItem( new HornedHides( hides ), from );
                        else if ( HideType == HideType.Barbed )
                            corpse.AddCarvedItem( new BarbedHides( hides ), from );

                        from.SendLocalizedMessage( 500471 ); // You skin it, and the hides are now in the corpse.
                    }
                }
//.........這裏部分代碼省略.........
開發者ID:Ravenwolfe,項目名稱:xrunuo,代碼行數:101,代碼來源:BaseCreature.cs

示例4: OnCarve

		public virtual void OnCarve( Mobile from, Corpse corpse, Item with )
		{
			int feathers = Feathers;
			int wool = Wool;
			int meat = Meat;
			int hides = Hides;

			if ( ( feathers == 0 && wool == 0 && meat == 0 && hides == 0 ) || Summoned || IsBonded || corpse.Animated )
			{
				if ( corpse.Animated )
					corpse.SendLocalizedMessageTo( from, 500464 ); // Use this on corpses to carve away meat and hide
				else
					from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse.
			}
			else
			{
				if ( corpse.Map == Map.Felucca )
				{
					feathers *= 2;
					wool *= 2;
					hides *= 2;
				}

				new Blood( 0x122D ).MoveToWorld( corpse.Location, corpse.Map );

				if ( feathers != 0 )
				{
					corpse.AddCarvedItem( new Feather( feathers ), from );
					from.SendLocalizedMessage( 500479 ); // You pluck the bird. The feathers are now on the corpse.
				}

				if ( wool != 0 )
				{
					corpse.AddCarvedItem( new TaintedWool( wool ), from );
					from.SendLocalizedMessage( 500483 ); // You shear it, and the wool is now on the corpse.
				}

				if ( meat != 0 )
				{
					if ( MeatType == MeatType.Ribs )
						corpse.AddCarvedItem( new RawRibs( meat ), from );
					else if ( MeatType == MeatType.Bird )
						corpse.AddCarvedItem( new RawBird( meat ), from );
					else if ( MeatType == MeatType.LambLeg )
						corpse.AddCarvedItem( new RawLambLeg( meat ), from );

					from.SendLocalizedMessage( 500467 ); // You carve some meat, which remains on the corpse.
				}

				if ( hides != 0 )
				{
					Item holding = from.Weapon as Item;

					if ( false && ( holding is SkinningKnife /* TODO: || holding is ButcherWarCleaver || with is ButcherWarCleaver */ ) )
					{
						Item leather = null;

						switch ( HideType )
						{
							case HideType.Regular: leather = new Leather( hides ); break;
							case HideType.Spined: leather = new SpinedLeather( hides ); break;
							case HideType.Horned: leather = new HornedLeather( hides ); break;
							case HideType.Barbed: leather = new BarbedLeather( hides ); break;
						}

						if ( leather != null )
						{
							if ( !from.PlaceInBackpack( leather ) )
							{
								corpse.DropItem( leather );
								from.SendLocalizedMessage( 500471 ); // You skin it, and the hides are now in the corpse.
							}
							else
							{
								from.SendLocalizedMessage( 1073555 ); // You skin it and place the cut-up hides in your backpack.
							}
						}
					}
					else
					{
						if ( HideType == HideType.Regular )
							corpse.DropItem( new Hides( hides ) );
						else if ( HideType == HideType.Spined )
							corpse.DropItem( new SpinedHides( hides ) );
						else if ( HideType == HideType.Horned )
							corpse.DropItem( new HornedHides( hides ) );
						else if ( HideType == HideType.Barbed )
							corpse.DropItem( new BarbedHides( hides ) );

						from.SendLocalizedMessage( 500471 ); // You skin it, and the hides are now in the corpse.
					}
				}

				corpse.Carved = true;

				if ( corpse.IsCriminalAction( from ) )
					from.CriminalAction( true );
			}
		}
開發者ID:Grimoric,項目名稱:RunUO.T2A,代碼行數:99,代碼來源:BaseCreature.cs


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