Ejemplo n.º 1
0
        public UniversalDyeGump(PlayerMobile from, UniversalDyeTub tub) : base(50, 50)
        {
            m_From = from;
            m_Tub  = tub;

            this.Closable   = true;
            this.Disposable = true;
            this.Dragable   = true;
            this.Resizable  = false;
            this.AddPage(0);
            this.AddBackground(50, 50, 250, 215, 2620);
            this.AddLabel(120, 67, 1160, "Tub Hue Selection");
            this.AddLabel(114, 96, 1160, "Choose your Hue");
            this.AddLabel(84, 156, 1152, "HUE = ");
            this.AddTextEntry(134, 156, 50, 20, 1359, 0, tub.Hue.ToString());
            this.AddButton(200, 221, 238, 240, 4, GumpButtonType.Reply, 0);

//  Swap these comment lines if using custom Cap variable.  Then set the number in the gump display here
//  Remember to comment out ALL 3 lines, and uncomment the 1 line.
            this.AddLabel(60, 200, 1152, "* Universal Dye Tub By - Doobs. *");
//			this.AddLabel(114, 200, 1152, "* Stat totals should equal 200 *");
        }
Ejemplo n.º 2
0
 protected override void OnTarget(Mobile from, object targeted)
 {
     if (targeted is Item)
     {
         Item targ = (Item)targeted;
         if (!targ.IsChildOf(from.Backpack))
         {
             from.SendMessage(38, "The item is not in your backpack!");
             return;
         }
         else if (targeted is DyeTub)
         {
             DyeTub tub = (DyeTub)targeted;
             if (tub.Redyable == true)
             {
                 tub.DyedHue = m_Item.Hue;
                 targ.Name   = "Dying Tub: " + Convert.ToString(m_Item.Hue);
                 from.PlaySound(0x23F);
                 if (Reusable == false)
                 {
                     tub.Redyable = false;
                     m_Item.Delete();
                     return;
                 }
                 return;
             }
             else
             {
                 from.SendMessage(38, "This dyetub has already been dyed!");
             }
         }
         else if (targeted is UniversalDyeTub)
         {
             UniversalDyeTub utub = (UniversalDyeTub)targeted;
             if (Reusable == false)
             {
                 if (utub.Hue == 0)
                 {
                     utub.Hue  = m_Item.Hue;
                     targ.Name = "Universal Dying Tub: " + Convert.ToString(m_Item.Hue);
                     from.PlaySound(0x23F);
                     m_Item.Delete();
                     return;
                 }
                 else
                 {
                     from.SendMessage(38, "This Universal dyetub has already been dyed!");
                 }
             }
             else if (Reusable == true)
             {
                 utub.Hue  = m_Item.Hue;
                 targ.Name = "Universal Dying Tub: " + Convert.ToString(m_Item.Hue);
                 from.PlaySound(0x23F);
                 return;
             }
         }
         else
         {
             from.SendMessage(38, "This is not a dyetub!!");
         }
     }
     else
     {
         from.SendMessage(38, "You cannot Dye Mobiles!!");
     }
 }