protected override void OnTarget(Mobile from, object targeted) { int color = m_Dye.DyeColor; if (targeted is DyeTub) { DyeTub tub = (DyeTub)targeted; if (tub.Redyable) { tub.Hue = color; tub.DyedHue = color; from.RevealingAction(); from.PlaySound(0x23E); from.AddToBackpack(new Jar()); m_Dye.Consume(); } else if (tub is BlackDyeTub) { from.SendLocalizedMessage(1010092); // You can not use this on a black dye tub. } else { from.SendMessage("That dye tub may not be redyed."); } } else if (targeted is MagicPigment) { MagicPigment pigment = (MagicPigment)targeted; pigment.Hue = color; from.RevealingAction(); from.PlaySound(0x23E); from.AddToBackpack(new Jar()); m_Dye.Consume(); } else { from.SendLocalizedMessage(500857); // Use this on a dye tub. } }
public DyeTarget(MagicPigment tube) : base(1, false, TargetFlags.None) { m_Dye = tube; }