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


C# Key.Delete方法代码示例

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


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

示例1: OnTarget

        protected override void OnTarget(Mobile from, object target) // Override the protected OnTarget() for our feature
        {
            if (target is BaseDoor)
            {
                BaseDoor door = target as BaseDoor;
                BaseHouse h1 = BaseHouse.FindHouseAt(door);
                BaseHouse h2 = BaseHouse.FindHouseAt(from);
                if (h1 == null || h1 != h2)
                {
                    from.SendLocalizedMessage(502094); // You must be in your house to do this.
                    return;
                }
                else if (h1.IsOwner(from) == false)
                {
                    from.SendLocalizedMessage(501303); // Only the house owner may change the house locks.
                    return;
                }

                // don't remove old keys because you will endup removing the main house keys
                //  we need to single this door out somehow
                // Key.RemoveKeys( from, oldKeyValue );

                // make the keys
                uint keyValue = Key.RandomValue();
                Key packKey = new Key(KeyType.Gold);
                Key bankKey = new Key(KeyType.Gold);
                packKey.KeyValue = keyValue;
                bankKey.KeyValue = keyValue;
                BankBox box = from.BankBox;
                if (box == null || !box.TryDropItem(from, bankKey, false))
                    bankKey.Delete();
                from.AddToBackpack(packKey);

                // rekey door
                door.KeyValue = keyValue;

                from.SendMessage("The lock on this door has been changed, and new master key has been placed in your bank and your backpack.");
                m_Deed.Delete(); // Delete the deed                
            }
            else
            {
                from.SendMessage("That is not a door.");
            }
        }
开发者ID:zerodowned,项目名称:angelisland,代码行数:44,代码来源:DoorRekeyingContract.cs

示例2: CreateKeys

		public uint CreateKeys( Mobile m )
		{
			uint value = Key.RandomValue();

			if ( !IsAosRules )
			{
				Key packKey = new Key( KeyType.Gold );
				Key bankKey = new Key( KeyType.Gold );

				packKey.KeyValue = value;
				bankKey.KeyValue = value;

				packKey.LootType = LootType.Newbied;
				bankKey.LootType = LootType.Newbied;

				BankBox box = m.BankBox;

				if ( !box.TryDropItem( m, bankKey, false ) )
					bankKey.Delete();

				m.AddToBackpack( packKey );
			}

			return value;
		}
开发者ID:ITLongwell,项目名称:mondains-legacy,代码行数:25,代码来源:BaseHouse.cs

示例3: CreateKeys

		public uint CreateKeys( Mobile m )
		{
			uint value = Key.RandomValue();

			Key packKey = new Key( KeyType.Gold, value, this );
			Key bankKey = new Key( KeyType.Gold, value, this );

			packKey.MaxRange = 10;
			bankKey.MaxRange = 10;

			packKey.Name = "a ship key";
			bankKey.Name = "a ship key";

			BankBox box = m.BankBox;

			if ( !box.TryDropItem( m, bankKey, false ) )
				bankKey.Delete();
			else
				m.LocalOverheadMessage( MessageType.Regular, 0x3B2, 502484 ); // A ship's key is now in my safety deposit box.

			if ( m.AddToBackpack( packKey ) )
				m.LocalOverheadMessage( MessageType.Regular, 0x3B2, 502485 ); // A ship's key is now in my backpack.
			else
				m.LocalOverheadMessage( MessageType.Regular, 0x3B2, 502483 ); // A ship's key is now at my feet.

			return value;
		}
开发者ID:PepeBiondi,项目名称:runsa,代码行数:27,代码来源:BaseBoat.cs

示例4: CreateTentKeys

        public uint CreateTentKeys(Mobile m)
        {
            uint value = Key.RandomValue();

            m_KeyOwner = value;

            if (!IsAosRules)
            {

                Key packKey = new Key(KeyType.Iron);
                Key bankKey = new Key(KeyType.Iron);

                packKey.KeyValue = value;
                bankKey.KeyValue = value;

                packKey.LootType = LootType.Regular;
                bankKey.LootType = LootType.Regular;

                BankBox box = m.BankBox;

                if (box == null || !box.TryDropItem(m, bankKey, false))
                    bankKey.Delete();
                else
                    m.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "A house key is now in my safety deposit box."); // A ship's key is now in my safety deposit box.

                if (m.AddToBackpack(packKey))
                    m.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "A house key is now in my backpack."); // A ship's key is now in my backpack.
                else
                    m.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "A house key is now at my feet."); // A ship's key is now at my feet.
            }

            return value;
        }
开发者ID:Godkong,项目名称:RunUO,代码行数:33,代码来源:BaseHouse.cs

示例5: CreateKeys

        public uint CreateKeys(Mobile m)
        {
            uint value = Key.RandomValue();

            Key packKey = new Key(KeyType.Copper);
            Key bankKey = new Key(KeyType.Copper);

            packKey.KeyValue = value;
            bankKey.KeyValue = value;

            m_HouseKeyVal = value;

            packKey.LootType = LootType.Regular;
            bankKey.LootType = LootType.Regular;

            BankBox box = m.BankBox;

            if (!box.TryDropItem(m, bankKey, false))
                bankKey.Delete();

            m.AddToBackpack(packKey);

            return value;
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:24,代码来源:TownHouseSign.cs

示例6: CreateKeys

        public uint CreateKeys( Mobile m )
        {
            uint value = Key.RandomValue();

            Key packKey = new Key( KeyType.Gold, value, this );
            Key bankKey = new Key( KeyType.Gold, value, this );

            packKey.MaxRange = 10;
            bankKey.MaxRange = 10;

            BankBox box = m.BankBox;

            if ( box == null || !box.TryDropItem( m, bankKey, false ) )
                bankKey.Delete();
            else
                m.SendLocalizedMessage( 502484 ); // A ship's key is now in my safety deposit box.

            if ( m.AddToBackpack( packKey ) )
                m.SendLocalizedMessage( 502485 ); // A ship's key is now in my backpack.
            else
                m.SendLocalizedMessage( 502483 ); // A ship's key is now at my feet.

            return value;
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:24,代码来源:BaseBoat.cs


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