예제 #1
0
        public HeartwoodChest() : base(0x9AA)
        {
            Hue    = 1193;
            Weight = 4;

            KeyValue = Key.RandomValue();
            DropItem(new HeartwoodChestKey(KeyValue, this));
        }
예제 #2
0
        public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            if (from.CheckSkill(SkillName.Tinkering, -5.0, 15.0))
            {
                from.SendLocalizedMessage(500636);                   // Your tinker skill was sufficient to make the item lockable.

                Key key = new Key(KeyType.Copper, Key.RandomValue());

                KeyValue = key.KeyValue;
                DropItem(key);

                double tinkering = from.Skills[SkillName.Tinkering].Value;

                int level;

                if (this is DonationBox)
                {
                    level = (int)(tinkering * 0.9);
                }
                else
                {
                    level = (int)(tinkering * 0.8);
                }

                RequiredSkill = level - 4;
                LockLevel     = level - 14;
                MaxLockLevel  = level + 35;

                if (LockLevel == 0)
                {
                    LockLevel = -1;
                }
                else if (LockLevel > 95)
                {
                    LockLevel = 95;
                }

                if (RequiredSkill > 95)
                {
                    RequiredSkill = 95;
                }

                if (MaxLockLevel > 95)
                {
                    MaxLockLevel = 95;
                }
            }
            else
            {
                from.SendLocalizedMessage(500637);                   // Your tinker skill was insufficient to make the item lockable.
            }

            return(1);
        }
		public int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue )
		{

			//STARTMOD: Teiravon chestmod

			Type resourceType = typeRes;

			if ( resourceType == null )
				resourceType = craftItem.Ressources.GetAt( 0 ).ItemType;

			Resource = CraftResources.GetFromType( resourceType );

			//ENDMOD: Teiravon chestmod


			if ( from.CheckSkill( SkillName.Tinkering, -5.0, 15.0 ) )
			{
				from.SendLocalizedMessage( 500636 ); // Your tinker skill was sufficient to make the item lockable.

				Key key = new Key( KeyType.Copper, Key.RandomValue() );

				KeyValue = key.KeyValue;
				DropItem( key );

				double tinkering = from.Skills[SkillName.Tinkering].Value;
				int level = (int)(tinkering * 0.8);

				RequiredSkill = level - 4;
				LockLevel = level - 14;
				MaxLockLevel = level + 35;

				if ( LockLevel == 0 )
					LockLevel = -1;
				else if ( LockLevel > 95 )
					LockLevel = 95;

				if ( RequiredSkill > 95 )
					RequiredSkill = 95;

				if ( MaxLockLevel > 95 )
					MaxLockLevel = 95;
			}
			else
			{
				from.SendLocalizedMessage( 500637 ); // Your tinker skill was insufficient to make the item lockable.
			}

			return 1;
		}
예제 #4
0
        // GeNova: Mondain's Legacy
        public override int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            if (from.CheckSkill(SkillName.Tinkering, -5.0, 15.0))
            {
                from.SendLocalizedMessage(500636);                   // Your tinker skill was sufficient to make the item lockable.

                Key key = new Key(KeyType.Copper, Key.RandomValue());

                KeyValue = key.KeyValue;
                DropItem(key);

                double tinkering = from.Skills[SkillName.Tinkering].Value;
                int    level     = (int)(tinkering * 0.8);

                RequiredSkill = level - 4;
                LockLevel     = level - 14;
                MaxLockLevel  = level + 35;

                if (LockLevel == 0)
                {
                    LockLevel = -1;
                }
                else if (LockLevel > 95)
                {
                    LockLevel = 95;
                }

                if (RequiredSkill > 95)
                {
                    RequiredSkill = 95;
                }

                if (MaxLockLevel > 95)
                {
                    MaxLockLevel = 95;
                }
            }
            else
            {
                from.SendLocalizedMessage(500637);                   // Your tinker skill was insufficient to make the item lockable.
            }

            #region GeNova: Mondain's Legacy
            return(base.OnCraft(quality, makersMark, from, craftSystem, typeRes, tool, craftItem, resHue));

            #endregion
        }
        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.");
            }
        }
예제 #6
0
        public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, ITool tool, CraftItem craftItem, int resHue)
        {
            Quality = (ItemQuality)quality;

            if (makersMark)
            {
                Crafter = from;
            }

            if (!craftItem.ForceNonExceptional)
            {
                if (typeRes == null)
                {
                    typeRes = craftItem.Resources.GetAt(0).ItemType;
                }

                Resource = CraftResources.GetFromType(typeRes);
            }

            if (from.CheckSkill(SkillName.Tinkering, -5.0, 15.0))
            {
                from.SendLocalizedMessage(500636); // Your tinker skill was sufficient to make the item lockable.

                Key key = new Key(KeyType.Copper, Key.RandomValue());

                KeyValue = key.KeyValue;
                DropItem(key);

                double tinkering = from.Skills[SkillName.Tinkering].Value;
                int    level     = (int)(tinkering * 0.8);

                RequiredSkill = level - 4;
                LockLevel     = level - 14;
                MaxLockLevel  = level + 35;

                if (LockLevel == 0)
                {
                    LockLevel = -1;
                }
                else if (LockLevel > 95)
                {
                    LockLevel = 95;
                }

                if (RequiredSkill > 95)
                {
                    RequiredSkill = 95;
                }

                if (MaxLockLevel > 95)
                {
                    MaxLockLevel = 95;
                }
            }
            else
            {
                from.SendLocalizedMessage(500637); // Your tinker skill was insufficient to make the item lockable.
            }

            return(quality);
        }
예제 #7
0
        public override int OnCraft(int mark, double quality, bool makersMark, Mobile from, CraftSystem craftSystem,
                                    Type typeRes, BaseTool tool,
                                    CraftItem craftItem, int resHue)
        {
            if (from.CheckSkill(SkillName.Tinkering, -5.0, 15.0))
            {
                from.SendSuccessMessage(500636); // Your tinker skill was sufficient to make the item lockable.

                var key = new Key(KeyType.Copper, Key.RandomValue());

                KeyValue = key.KeyValue;
                DropItem(key);

                var tinkering = from.Skills[SkillName.Tinkering].Value;
                var level     = (int)(tinkering * 0.8);

                RequiredSkill = level - 4;
                LockLevel     = level - 14;
                MaxLockLevel  = level + 35;

                if (LockLevel == 0)
                {
                    LockLevel = -1;
                }
                else if (LockLevel > 95)
                {
                    LockLevel = 95;
                }

                if (RequiredSkill > 95)
                {
                    RequiredSkill = 95;
                }

                if (MaxLockLevel > 95)
                {
                    MaxLockLevel = 95;
                }
            }
            else
            {
                from.SendFailureMessage(500637); // Your tinker skill was insufficient to make the item lockable.
            }

            Mark = (MarkQuality)mark;

            if (makersMark)
            {
                Crafter = from;
            }

            var resourceType = typeRes;

            if (resourceType == null)
            {
                resourceType = craftItem.Resources[0].ItemType;
            }

            Resource = CraftResources.GetFromType(resourceType);

            PlayerConstructed = true;

            var context = craftSystem.GetContext(from);

            if (context != null && context.DoNotColor)
            {
                Hue = 0;
            }

            return(base.OnCraft(mark, quality, makersMark, from, craftSystem, typeRes, tool, craftItem, resHue));
        }
        public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            if (Core.ML)
            {
                Quality = (CraftQuality)quality;

                Type resourceType = typeRes;

                if (resourceType == null)
                {
                    resourceType = craftItem.Resources.GetAt(0).ItemType;
                }

                Resource = CraftResources.GetFromType(resourceType);

                CraftContext context = craftSystem.GetContext(from);

                if (context != null && context.DoNotColor)
                {
                    Resource = DefaultResource;
                }

                if (makersMark)
                {
                    Crafter = from;
                }
            }

            if (from.CheckSkill(SkillName.Tinkering, -5.0, 15.0))
            {
                from.SendLocalizedMessage(500636);                   // Your tinker skill was sufficient to make the item lockable.

                Key key = new Key(KeyType.Copper, Key.RandomValue());

                KeyValue = key.KeyValue;
                DropItem(key);

                double tinkering = from.Skills[SkillName.Tinkering].Value;
                int    level     = (int)(tinkering * 0.8);

                RequiredSkill = level - 4;
                LockLevel     = level - 14;
                MaxLockLevel  = level + 35;

                if (LockLevel == 0)
                {
                    LockLevel = -1;
                }
                else if (LockLevel > 95)
                {
                    LockLevel = 95;
                }

                if (RequiredSkill > 95)
                {
                    RequiredSkill = 95;
                }

                if (MaxLockLevel > 95)
                {
                    MaxLockLevel = 95;
                }
            }
            else
            {
                from.SendLocalizedMessage(500637);                   // Your tinker skill was insufficient to make the item lockable.
            }

            return(quality);
        }
예제 #9
0
        public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, IBaseTool tool, CraftItem craftItem, int resHue)
        {
            if (from.CheckSkill(SkillName.Tinkering, -5.0, 15.0))
            {
                from.SendLocalizedMessage(500636);                   // Your tinker skill was sufficient to make the item lockable.

                Key key = new Key(KeyType.Copper, Key.RandomValue());

                KeyValue = key.KeyValue;
                DropItem(key);

                double tinkering = from.Skills[SkillName.Tinkering].Value;
                int    level     = (int)(tinkering * 0.8);

                RequiredSkill = level - 4;
                LockLevel     = level - 14;
                MaxLockLevel  = level + 35;

                if (LockLevel == 0)
                {
                    LockLevel = -1;
                }
                else if (LockLevel > 95)
                {
                    LockLevel = 95;
                }

                if (RequiredSkill > 95)
                {
                    RequiredSkill = 95;
                }

                if (MaxLockLevel > 95)
                {
                    MaxLockLevel = 95;
                }

                // A tinker trapped box should not explode until it is armed with a key
                Armed = false;
            }
            else
            {
                from.SendLocalizedMessage(500637);                   // Your tinker skill was insufficient to make the item lockable.
            }

            // The lockable containers never took material color into account, so this fixes it
            Type resourceType = typeRes;

            if (resourceType == null)
            {
                resourceType = craftItem.Resources.GetAt(0).ItemType;
            }

            var resource = CraftResources.GetFromType(resourceType);

            CraftContext context = craftSystem.GetContext(from);

            if (context != null && context.DoNotColor)
            {
                Hue = 0;
            }
            else
            {
                Hue = CraftResources.GetHue(resource);
            }

            return(1);
        }