Exemplo n.º 1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Item)
                {
                    Item item = (Item)targeted;
                    if (it_Tub != null)
                    {
                        if (!(item.IsChildOf(from.Backpack)))
                        {
                            from.SendMessage("This must be in your backpack.");
                        }
                        else if (targeted is ChargedDyeTub)
                        {
                            ChargedDyeTub tub = targeted as ChargedDyeTub;
                            if (it_Tub == tub)
                            {
                                from.SendMessage("Please select a hue...");
                                from.SendHuePicker(new InternalPicker(tub));
                            }
                            else if (tub.DyeType == i_DyeType)
                            {
                                it_Tub.Charges += tub.Charges;
                                from.SendMessage("You combined the dye tubs");
                                tub.Delete();
                            }
                            else
                            {
                                from.SendMessage("You can't combine different charged dye tubs");
                            }
                        }
                        else
                        {
                            switch (i_DyeType)
                            {
                            case 0:
                            default:                                      //leather armor
                            {
                                if (targeted is BaseArmor && (((BaseArmor)item).MaterialType == ArmorMaterialType.Leather || ((BaseArmor)item).MaterialType == ArmorMaterialType.Studded))
                                {
                                    item.Hue = i_DyeHue;
                                    from.PlaySound(0x23E);
                                    it_Tub.Charges--;
                                }
                                else
                                {
                                    from.SendMessage("That's not leather armor!!!");
                                }
                                break;
                            }

                            case 1:                             //metal armor
                            {
                                if (targeted is BaseArmor && !(targeted is BaseShield) && !(((BaseArmor)item).MaterialType == ArmorMaterialType.Leather || ((BaseArmor)item).MaterialType == ArmorMaterialType.Studded))
                                {
                                    item.Hue = i_DyeHue;
                                    from.PlaySound(0x23E);
                                    it_Tub.Charges--;
                                }
                                else
                                {
                                    from.SendMessage("That's not metal armor!!!");
                                }
                                break;
                            }

                            case 2:                             //weapons
                            {
                                if (targeted is BaseWeapon && !(targeted is BaseRanged) && !(targeted is BaseStaff) && ((BaseWeapon)item).Resource >= CraftResource.Iron && ((BaseWeapon)item).Resource <= CraftResource.Sunstone)
                                {
                                    item.Hue = i_DyeHue;
                                    from.PlaySound(0x23E);
                                    it_Tub.Charges--;
                                }
                                else
                                {
                                    from.SendMessage("That's not metal weapon!!!");
                                }
                                break;
                            }
                            }
                        }
                    }
                }
            }
Exemplo n.º 2
0
 public InternalTarget(ChargedDyeTub tub, int Charges) : base(1, false, TargetFlags.None)
 {
     m_Tub = tub;
     m_Charges = Charges;
 }
Exemplo n.º 3
0
 public InternalTarget(ChargedDyeTub tub, int Charges) : base(1, false, TargetFlags.None)
 {
     m_Tub     = tub;
     m_Charges = Charges;
 }
Exemplo n.º 4
0
 public InternalTarget(ChargedDyeTub tub, int dyetype, int dyehue) : base(1, false, TargetFlags.None)
 {
     it_Tub    = tub;
     i_DyeType = dyetype;
     i_DyeHue  = dyehue;
 }
			public ChargedDyeTubGump( Mobile from, ChargedDyeTub tub, int hue ) : base(0, 0)
			{
				m_From = from;
				if (!(m_From is PlayerMobile))
					return;
				c_Tub = tub;
				i_Hue = hue;
				
				Resizable=false;
				AddPage(0);
				AddBackground(20, 20, 320, 130, 2620);
				AddLabel(35, 40, 89, @"Please type which hue number you want to use");
				AddTextEntry(70, 70, 70, 20, i_Hue, 1, i_Hue.ToString());
				AddButton(35, 67, 2644, 2645, 2, GumpButtonType.Reply, 0);
				AddLabel(35, 100, i_Hue, @"This is the current hue number " + i_Hue + ".");
				
			}
			public ChargedDyeTubMenu( Mobile from, ChargedDyeTub tub ) : base( 5049 )
			{
				m_From = from;
				c_Tub = tub;
			}
			public InternalPicker( ChargedDyeTub tub ) : base( tub.ItemID )
			{
				m_Tub = tub;
			}
			public InternalTarget( ChargedDyeTub tub, int dyetype, int dyehue ) : base( 1, false, TargetFlags.None )
			{
				it_Tub = tub;
				i_DyeType = dyetype;
				i_DyeHue = dyehue;
			}
		public static void SelectHueNumber( Mobile from, ChargedDyeTub tub )
		{
			if (tub.IsChildOf(from.Backpack))
				from.SendGump( new ChargedDyeTubGump(from, tub, tub.Hue));
		}