public ResourceData(CraftResourceType resourceType, CraftResource craftResource, string name, Type itemType, Type raw, double minSkill, int cantCraftMessage) { this.ResourceType = resourceType; this.CraftResource = craftResource; this.Name = name; this.RawType = raw; this.ItemType = itemType; this.MinSkill = minSkill; this.CantCraftMessage = cantCraftMessage; this.Level = (int)craftResource; }
protected override void OnTarget(Mobile from, object targeted) { if (this.m_Item.Deleted) { return; } Item item = targeted as Item; if (null != item) { bool valid = (item is IDyable || item is BaseBook || item is BaseClothing || item is BaseJewel || item is BaseStatuette || item is BaseWeapon || item is Runebook || item is Spellbook || item.IsArtifact || BasePigmentsOfTokuno.IsValidItem(item)); if (!valid && item is BaseArmor) { CraftResourceType restype = CraftResources.GetType(((BaseArmor)item).Resource); if ((CraftResourceType.Leather == restype || CraftResourceType.Metal == restype) && ArmorMaterialType.Bone != ((BaseArmor)item).MaterialType) { valid = true; } } if (!valid && FurnitureAttribute.Check(item)) { if (!from.InRange(this.m_Item.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1)) { from.SendLocalizedMessage(500446); // That is too far away. return; } else { BaseHouse house = BaseHouse.FindHouseAt(item); if (house == null || (!house.IsLockedDown(item) && !house.IsSecure(item))) { from.SendLocalizedMessage(501022); // Furniture must be locked down to paint it. return; } else if (!house.IsCoOwner(from)) { from.SendLocalizedMessage(501023); // You must be the owner to use this item. return; } else { valid = true; } } } // need to add any bags, chests, boxes, crates not IDyable but dyable by natural dyes if (valid) { item.Hue = PlantPigmentHueInfo.GetInfo(this.m_Item.PigmentHue).Hue; from.PlaySound(0x23E); if (--this.m_Item.UsesRemaining > 0) { this.m_Item.InvalidateProperties(); } else { this.m_Item.Delete(); } return; } } from.SendLocalizedMessage(1042083); // You cannot dye that. }