protected override void OnTarget(Mobile from, object o) { int enamhue = dhue; ArmorEnamelKit m_dkit = d_dkit; if (!(o is Item)) { return; } if (((Item)o).IsChildOf(from.Backpack)) { BaseArmor armor; if (o is ArmorEnamelKit) { ArmorEnamelKit enamkit = (ArmorEnamelKit)o; from.SendGump(new CustomHuePickerGump(from, m_dkit.CustomHuePicker, new CustomHuePickerCallback(SetKitHue), m_dkit)); return; } if (o is BaseArmor) { armor = (BaseArmor)o; } else { from.SendMessage("Only Armor can be colored with this kit"); return; } if (armor.MaterialType == ArmorMaterialType.Plate || armor.MaterialType == ArmorMaterialType.Ringmail || armor.MaterialType == ArmorMaterialType.Chainmail || (armor is BaseShield && !(armor is WoodenShield))) { armor.Hue = enamhue; } else { from.SendMessage("Only metal armor and shields can be colored with this kit"); return; } } else { from.SendMessage("Items must be in your backpack to color"); return; } }
public EnamelTarget(int d_hue, ArmorEnamelKit dkit) : base(-1, false, TargetFlags.None) { CheckLOS = true; dhue = d_hue; d_dkit = dkit; }