Server.Items.Corpse.Carve C# (CSharp) Méthode

Carve() public méthode

public Carve ( Server.Mobile from, Item item ) : void
from Server.Mobile
item Item
Résultat void
		public void Carve( Mobile from, Item item )
		{
			if ( IsCriminalAction( from ) && this.Map != null && (this.Map.Rules & MapRules.HarmfulRestrictions) != 0 )
			{
				if ( m_Owner == null || !m_Owner.Player )
					from.SendLocalizedMessage( 1005035 ); // You did not earn the right to loot this creature!
				else
					from.SendLocalizedMessage( 1010049 ); // You may not loot this corpse.

				return;
			}

			Mobile dead = m_Owner;

			if ( GetFlag( CorpseFlag.Carved ) || dead == null )
			{
				from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse.
			}
			else if ( ((Body)Amount).IsHuman && ItemID == 0x2006 )
			{
				new Blood( 0x122D ).MoveToWorld( Location, Map );

				new Torso().MoveToWorld( Location, Map );
				new LeftLeg().MoveToWorld( Location, Map );
				new LeftArm().MoveToWorld( Location, Map );
				new RightLeg().MoveToWorld( Location, Map );
				new RightArm().MoveToWorld( Location, Map );
				new Head( dead.Name ).MoveToWorld( Location, Map );

				SetFlag( CorpseFlag.Carved, true );

				ProcessDelta();
				SendRemovePacket();
				ItemID = Utility.Random( 0xECA, 9 ); // bone graphic
				Hue = 0;
				ProcessDelta();

				if ( IsCriminalAction( from ) )
					from.CriminalAction( true );
			}
			else if ( dead is BaseCreature )
			{
				((BaseCreature)dead).OnCarve( from, this, item );
			}
			else
			{
				from.SendLocalizedMessage( 500485 ); // You see nothing useful to carve from the corpse.
			}
		}
	}

Usage Example

		public static bool ClaimCorpse( Mobile from, Corpse corpse, ClaimOption option )
		{
			if ( null == corpse || corpse.Owner == from )
				return false;

			Container goldBag = GetGoldBag( from );
			Container silverBag = GetSilverBag( from );
			Container lootBag = GetLootBag( from );

			if ( ClaimConfig.AggregateSilver )
				AggregateSilver( from, silverBag );

			if ( ClaimOption.Carve == option && !(corpse.Owner is PlayerMobile) )
				corpse.Carve( from, null );

			LootCorpse( from, corpse, option, goldBag, silverBag, lootBag );
			AwardGold( from, corpse, goldBag );
			corpse.Delete();

			return true;
		}