public override void GetProperties(ObjectPropertyList list) { base.GetProperties(list); if (m_Type != PigmentType.None) { PigmentInfo p = PigmentInfo.GetInfo(m_Type); TextDefinition.AddTo(list, p.Label); } list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~ }
private void InternalCallback(Mobile from, object targeted, object state) { PigmentsOfTokuno pigment = (PigmentsOfTokuno)state; if (pigment.Deleted || pigment.UsesRemaining <= 0 || !from.InRange(pigment.GetWorldLocation(), 3) || !pigment.IsAccessibleTo(from)) { return; } Item i = targeted as Item; if (i == null) { from.SendLocalizedMessage(1070931); // You can only dye artifacts and enhanced magic items with this tub. } else if (!from.InRange(i.GetWorldLocation(), 3) || !IsAccessibleTo(from)) { from.SendLocalizedMessage(502436); // That is not accessible. } else if (from.Items.Contains(i)) { from.SendLocalizedMessage(1070930); // Can't dye artifacts or enhanced magic items that are being worn. } else if (i.IsLockedDown) { from.SendLocalizedMessage(1070932); // You may not dye artifacts and enhanced magic items which are locked down. } else if (i is PigmentsOfTokuno) { from.SendLocalizedMessage(1042417); // You cannot dye that. } else if (!IsValidItem(i)) { from.SendLocalizedMessage(1070931); // You can only dye artifacts and enhanced magic items with this tub. //Yes, it says tub on OSI. Don't ask me why ;p } else { //Notes: on OSI there IS no hue check to see if it's already hued. and no messages on successful hue either i.Hue = PigmentInfo.GetInfo(pigment.Type).Hue; if (--pigment.UsesRemaining <= 0) { pigment.Delete(); } from.PlaySound(0x23E); // As per OSI TC1 } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); m_Type = (PigmentType)reader.ReadEncodedInt(); m_UsesRemaining = reader.ReadEncodedInt(); PigmentInfo p = PigmentInfo.GetInfo(m_Type); if (Hue != p.Hue) { Hue = p.Hue; } }