当前位置: 首页>>代码示例>>C#>>正文


C# Item.Delete方法代码示例

本文整理汇总了C#中Server.Item.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# Item.Delete方法的具体用法?C# Item.Delete怎么用?C# Item.Delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server.Item的用法示例。


在下文中一共展示了Item.Delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnDragDrop

		public override bool OnDragDrop( Mobile from, Item dropped )
		{
			PlayerMobile player = from as PlayerMobile;

			if ( player != null )
			{
				QuestSystem qs = player.Quest;

				if ( qs is EminosUndertakingQuest )
				{
					if ( dropped is NoteForZoel )
					{
						QuestObjective obj = qs.FindObjective( typeof( GiveZoelNoteObjective ) );

						if ( obj != null && !obj.Completed )
						{
							dropped.Delete();
							obj.Complete();
							return true;
						}
					}
				}
			}

			return base.OnDragDrop( from, dropped );
		}
开发者ID:jsrn,项目名称:MidnightWatchServer,代码行数:26,代码来源:Zoel.cs

示例2: OnDragDrop

		public override bool OnDragDrop( Mobile from, Item dropped )
		{          		
			if ( from == null )
				return false;

			if( dropped is GrandmasBrace )
			{
				if ( alFinished.Contains( from ) )
				{
					from.SendMessage(32, "You can do the quest only once");
					return false;
				}
				alFinished.Add( from );
				from.AddToBackpack( new Gold( 5000 ) );
				if (dropped.Amount > 1)
					dropped.Amount--;
				else
					dropped.Delete();
				from.SendMessage( "Thank you kind neighbor!" );
				from.SendGump( new LauraFinishGump());
			}
			else
				PrivateOverheadMessage( MessageType.Regular, 1153, false, "I have no use of this!", from.NetState );
			return false;
		}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:25,代码来源:Lauraquestnpc.cs

示例3: DestroyFurniture

        private void DestroyFurniture( Mobile from, Item item )
        {
            if ( !from.InRange( item.GetWorldLocation(), 3 ) )
            {
                from.SendLocalizedMessage( 500446 ); // That is too far away.
                return;
            }
            else if ( !item.Movable || !item.IsChildOf( from.Backpack ) )
            {
                from.SendLocalizedMessage( 500462 ); // You can't destroy that while it is here.
                return;
            }

            from.SendLocalizedMessage( 500461 ); // You destroy the item.
            Effects.PlaySound( item.GetWorldLocation(), item.Map, 0x3B3 );

            if ( item is Container )
            {
                if ( item is TrapableContainer )
                    ((TrapableContainer)item).ExecuteTrap( from );
                ((Container)item).Destroy();
            }
            else
            {
                item.Delete();
            }
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:27,代码来源:HarvestTarget.cs

示例4: Deserialize

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 0:
                    {
                        m_Platform = reader.ReadItem() as PeerlessPlatform;
                        m_Key = reader.ReadItem();

                        if ( m_Platform == null )
                            Delete();

                        if ( m_Key != null )
                        {
                            m_Key.Delete();
                            m_Key = null;
                        }

                        break;
                    }
            }
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:26,代码来源:PeerlessKeyBrazier.cs

示例5: OnDragDrop

 public override bool OnDragDrop(Mobile from, Item item)
 {
     if (item is GoblinEars)
     {
         Say(1049368); // You have been rewarded for your dedication to Justice!
         from.Backpack.AddItem(new Factions.Silver(1, 5));
         item.Delete();
         return true;
     }
     else if (item is OutlanderHead)
     {
         Say(1049368); // You have been rewarded for your dedication to Justice!
         from.Backpack.AddItem(new Factions.Silver(10, 50));
         item.Delete();
         return true;
     }
     else if (item is GilwiremarHead)
     {
         Say(1049368); // You have been rewarded for your dedication to Justice!
         from.Backpack.AddItem(new Factions.Silver(100, 500));
         item.Delete();
         return true;
     }
     else
     {
         Say(502816); // You feel that such an action would be inappropriate
         return false;
     }
 }
开发者ID:greeduomacro,项目名称:annox,代码行数:29,代码来源:GoblinBountyHunter.cs

示例6: OnDragDrop

		public override bool OnDragDrop( Mobile from, Item dropped )
		{
			if ( dropped is LargeBOD )
			{
				if ( !IsChildOf( from.Backpack ) )
				{
					from.SendLocalizedMessage( 1062385 ); // You must have the book in your backpack to add deeds to it.
					return false;
				}
				else if ( m_Entries.Count < 500 )
				{
					m_Entries.Add( new BOBLargeEntry( (LargeBOD)dropped ) );
					InvalidateProperties();

					from.SendLocalizedMessage( 1062386 ); // Deed added to book.

					if ( from is PlayerMobile )
						from.SendGump( new BOBGump( (PlayerMobile)from, this ) );

					dropped.Delete();
					return true;
				}
				else
				{
					from.SendLocalizedMessage( 1062387 ); // The book is full of deeds.
					return false;
				}
			}
			else if ( dropped is SmallBOD )
			{
				if ( !IsChildOf( from.Backpack ) )
				{
					from.SendLocalizedMessage( 1062385 ); // You must have the book in your backpack to add deeds to it.
					return false;
				}
				else if ( m_Entries.Count < 500 )
				{
					m_Entries.Add( new BOBSmallEntry( (SmallBOD)dropped ) );
					InvalidateProperties();

					from.SendLocalizedMessage( 1062386 ); // Deed added to book.

					if ( from is PlayerMobile )
						from.SendGump( new BOBGump( (PlayerMobile)from, this ) );

					dropped.Delete();
					return true;
				}
				else
				{
					from.SendLocalizedMessage( 1062387 ); // The book is full of deeds.
					return false;
				}
			}

			from.SendLocalizedMessage( 1062388 ); // That is not a bulk order deed.
			return false;
		}
开发者ID:Godkong,项目名称:RunUO,代码行数:58,代码来源:BulkOrderBook.cs

示例7: PackItem

        public static void PackItem( Mobile m, Item item )
        {
            if ( item is BaseArmor )
                ((BaseArmor)item).Quality = ArmorQuality.Exceptional;
            else if ( item is BaseWeapon )
                ((BaseWeapon)item).Quality = WeaponQuality.Exceptional;

            if ( !m.PlaceInBackpack( item ) )
                item.Delete();
        }
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:10,代码来源:AutoSupply.cs

示例8: GiveItem

        public static void GiveItem( Mobile m, Item item )
        {
            if ( item is BaseArmor )
                ((BaseArmor)item).Quality = ArmorQuality.Exceptional;
            else if ( item is BaseWeapon )
                ((BaseWeapon)item).Quality = WeaponQuality.Exceptional;

            Item move = m.FindItemOnLayer( item.Layer );
            if ( move != null )
            {
                if ( !m.PlaceInBackpack( move ) )
                {
                    item.Delete();
                    return;
                }
            }

            if ( !m.EquipItem( item ) && !m.PlaceInBackpack( item ) )
                item.Delete();
        }
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:20,代码来源:AutoSupply.cs

示例9: PackItem

			private static void PackItem( Item item )
			{
				if ( !Core.AOS )
					item.LootType = LootType.Newbied;

				Container pack = m_Mobile.Backpack;

				if ( pack != null )
					pack.DropItem( item );
				else
					item.Delete();
			}
开发者ID:PepeBiondi,项目名称:runsa,代码行数:12,代码来源:GMbody.cs

示例10: EquipItem

			private static void EquipItem( Item item, bool mustEquip )
			{
				if ( !Core.AOS )
					item.LootType = LootType.Newbied;

				if ( m_Mobile != null && m_Mobile.EquipItem( item ) )
					return;

				Container pack = m_Mobile.Backpack;

				if ( !mustEquip && pack != null )
					pack.DropItem( item );
				else
					item.Delete();
			}
开发者ID:PepeBiondi,项目名称:runsa,代码行数:15,代码来源:GMbody.cs

示例11: TryDropItem

		public override bool TryDropItem(Mobile from, Item dropped, bool message)
		{
			if(dropped is ExperimentalGem && ((ExperimentalGem)dropped).Complete && from.InRange(this.Location, 2))
			{
				dropped.Delete();
				
				Item toDrop = GetRandomDrop();
				
				if(toDrop != null)
					AddItemFor(toDrop, from);
				
				base.OnDoubleClick(from);
			}
			
			return false;
		}
开发者ID:Crome696,项目名称:ServUO,代码行数:16,代码来源:ExperimentalRoomChest.cs

示例12: Resmelt

			private bool Resmelt( Mobile from, Item item, CraftResource resource )
			{
				try
				{
					if ( CraftResources.GetType( resource ) != CraftResourceType.Metal )
						return false;

					CraftResourceInfo info = CraftResources.GetInfo( resource );

					if ( info == null || info.ResourceTypes.Length == 0 )
						return false;

					CraftItem craftItem = m_CraftSystem.CraftItems.SearchFor( item.GetType() );

					if ( craftItem == null || craftItem.Ressources.Count == 0 )
						return false;

					CraftRes craftResource = craftItem.Ressources.GetAt( 0 );

					if ( craftResource.Amount < 2 )
						return false; // Not enough metal to resmelt

					Type resourceType = info.ResourceTypes[0];
					Item ingot = (Item)Activator.CreateInstance( resourceType );

					if ( item is DragonBardingDeed || (item is BaseArmor && ((BaseArmor)item).PlayerConstructed) || (item is BaseWeapon && ((BaseWeapon)item).PlayerConstructed) || (item is BaseClothing && ((BaseClothing)item).PlayerConstructed) )
						ingot.Amount = craftResource.Amount / 2;
					else
						ingot.Amount = 1;

					item.Delete();
					from.AddToBackpack( ingot );

					from.PlaySound( 0x2A );
					from.PlaySound( 0x240 );
					return true;
				}
				catch
				{
				}

				return false;
			}
开发者ID:Godkong,项目名称:RunUO,代码行数:43,代码来源:Resmelt.cs

示例13: TryCreateItem

		public static Item TryCreateItem( int x, int y, int z, Item srcItem )
		{
			IPooledEnumerable eable = Map.Felucca.GetItemsInBounds( new Rectangle2D( x, y, 1, 1 ) );

				foreach ( Item item in eable )
				{
					if ( item.GetType() == srcItem.GetType() )
					{
						eable.Free();
						srcItem.Delete();
						return item;
					}
				}

			eable.Free();
			srcItem.MoveToWorld( new Point3D( x, y, z ), Map.Felucca );
			m_Count++;

			return srcItem;
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:20,代码来源:KhaldunGen.cs

示例14: OnDragDrop

		public override bool OnDragDrop( Mobile from, Item dropped )
		{
			if ( !( dropped is FactionSilver ) )
			{
				from.SendMessage( "You can only drop old faction silver here." );
				return false;
			}
			else
			{
				if ( from.Backpack != null )
				{
					Silver silver = new Silver( ((FactionSilver)dropped).Amount );
					from.Backpack.DropItem( silver );
					dropped.Delete();
					from.SendMessage( "You successfully converted the old silver to new silver!" );
				}
				else
					from.SendMessage( "Where is your backpack?!" );
				return true;
			}
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:21,代码来源:FactionSilverConverter.cs

示例15: AddReg

		public void AddReg( Type type, int amount, Item dropped, Mobile from)
		{
			if ( m_Regs == null )
				m_Regs = new Hashtable();
			if (m_Regs[type] == null)
			{
				if (amount <= StorageLimit)
				{
					m_Regs.Add(type,amount);
					dropped.Delete();
					BeginCombine(from);
					from.SendGump( new SpellCastersBoxGump( (PlayerMobile)from, this ) ); 
					from.SendMessage("You added the item.");
				}
				else
				{
					BeginCombine(from);
					from.SendMessage("You have too much of that item.");
				}
			}
			else if ( (amount + (int)m_Regs[type]) <= StorageLimit)
			{
				if ( m_Regs.ContainsKey(type) )
				{
					m_Regs[type] = (int)m_Regs[type] + amount;
				}
				else
					m_Regs.Add(type,amount);
				dropped.Delete();
				BeginCombine(from);
				from.SendGump( new SpellCastersBoxGump( (PlayerMobile)from, this ) ); 
				from.SendMessage("You added the item.");
			}
			else
			{
				BeginCombine(from);
				from.SendMessage("You have too much of that item.");
			}
		}
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:39,代码来源:Spell+Casters+Box.cs


注:本文中的Server.Item.Delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。