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 } }
protected override void OnTarget(Mobile from, object targeted) { Item item = targeted as Item; if (item == null) { return; } if (!item.IsChildOf(from.Backpack)) { from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used. } else if (item is PigmentsOfTokuno || item is PigmentsOfTokunoMajor || item is CompassionPigment) { from.SendLocalizedMessage(1042083); // You cannot dye that. } else if (item.IsLockedDown) { from.SendLocalizedMessage(1070932); // You may not dye artifacts and enhanced magic items which are locked down. } else if (!PigmentsOfTokuno.CheckWarn(item)) { from.SendLocalizedMessage(1070930); // Can't dye artifacts or enhanced magic items that are being worn. } else if (PigmentsOfTokuno.CanHue(item)) { item.Hue = 0; dye.UsesRemaining--; if (dye.UsesRemaining <= 0) { dye.Delete(); } } else { from.SendLocalizedMessage(1070931); // You can only dye artifacts and enhanced magic items with this tub. } }