RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[RUNUO 2.0] Skilled DyeTub

kenferguson

Squire
This is just something I did to give players a few more color options for clothing as they gain Tailoring skill.

Tailoring skill up to 33 = seven basic colors--red, pink, blue, green, yellow, brown, and grey.

Tailoring skill from 34 to 66 = above colors + two more basic colors--purple and orange and shades of red, yellow, blue, green, brown and grey.

Tailoring skill from 67 to 100 = above colors + shades of purple and orange + black and white.

Tailoring skill over 100 = above colors + ten advanced colors (shiny colors that look like velvet).

The colors can be changed to what ever you like in CustomHuePicker.cs and the skill levels can be changed in Dyes.cs.
All it is is a few edits to CustomHuePicker.cs and Dyes.cs

First in CustomHuePicker.cs under theese lines around line 110
Code:
/* Yellows */
                new CustomHueGroup( 1018343, new int[]{ 2213, 2214, 2215, 2216, 2217, 2218 } )
            }, true );

add this code
Code:
public static readonly CustomHuePicker BasicDyeTub = new CustomHuePicker(new CustomHueGroup[]//Tailoring skill <= 33
            {
                /* Basic Colors */
                new CustomHueGroup( "Basic Colors", new int[]{ 33, 31, 101, 67, 53, 1033, 907 } ),
            }, true);
 
        public static readonly CustomHuePicker ShadesDyeTub = new CustomHuePicker(new CustomHueGroup[]//Tailoring skill > 33 and <= 66
            {
                /* Basic Colors */
                new CustomHueGroup( "Basic Colors", new int[]{ 33, 31, 101, 67, 53, 1033, 907, 42, 312 } ),
                /* Reds */
                new CustomHueGroup( "Shades of Red", new int[]{ 32, 34, 35, 36 } ),
                /* Yellows */
                new CustomHueGroup( "Shades of Yellow", new int[]{ 52, 54, 55, 56 } ),
                /* Greens */
                new CustomHueGroup( "Shades of Green", new int[]{ 68, 69, 70, 71 } ),
                /* Blues */
                new CustomHueGroup( "Shades of Blue", new int[]{ 97, 98, 99, 100 } ),
                /* Browns */
                new CustomHueGroup( "Shades of Brown", new int[]{ 1032, 1034, 1035, 1036 } ),
                /* Greys */
                new CustomHueGroup( "Shades of Grey", new int[]{ 908, 909, 910, 911 } )
            }, true);
 
        public static readonly CustomHuePicker SkilledDyeTub = new CustomHuePicker(new CustomHueGroup[]// Tailoring skill > 66 and <= 100
            {
                /* Basic Colors */
                new CustomHueGroup( "Basic Colors", new int[]{ 33, 31, 101, 67, 53, 1033, 907, 42, 312 } ),
                /* Reds */
                new CustomHueGroup( "Shades of Red", new int[]{ 32, 34, 35, 36 } ),
                /* Oranges */
                new CustomHueGroup( "Shades of Orange", new int[]{ 43, 44, 45, 46 } ),
                /* Yellows */
                new CustomHueGroup( "Shades of Yellow", new int[]{ 52, 54, 55, 56 } ),
                /* Greens */
                new CustomHueGroup( "Shades of Green", new int[]{ 68, 69, 70, 71 } ),
                /* Blues */
                new CustomHueGroup( "Shades of Blue", new int[]{ 97, 98, 99, 100 } ),
                /* Purples */
                new CustomHueGroup( "Shades of Purple", new int[]{ 313, 314, 315, 316 } ),
                /* Browns */
                new CustomHueGroup( "Shades of Brown", new int[]{ 1032, 1034, 1035, 1036 } ),
                /* Greys */
                new CustomHueGroup( "Shades of Grey", new int[]{ 908, 909, 910, 911 } ),
                /* Black */
                new CustomHueGroup( "True Black", new int[]{ 1 } ),
                /* White */
                new CustomHueGroup( "True White", new int[]{ 1153 } )
            }, true);
 
        public static readonly CustomHuePicker AdvancedDyeTub = new CustomHuePicker(new CustomHueGroup[]// Tailoring skill > 100
            {
                /* Basic Colors */
                new CustomHueGroup( "Basic Colors", new int[]{ 33, 31, 101, 67, 53, 1033, 907 } ),
                /* Reds */
                new CustomHueGroup( "Shades of Red", new int[]{ 32, 34, 35, 36 } ),
                /* Oranges */
                new CustomHueGroup( "Shades of Orange", new int[]{ 42, 43, 44, 45 } ),
                /* Yellows */
                new CustomHueGroup( "Shades of Yellow", new int[]{ 52, 54, 55, 56 } ),
                /* Greens */
                new CustomHueGroup( "Shades of Green", new int[]{ 68, 69, 70, 71 } ),
                /* Blues */
                new CustomHueGroup( "Shades of Blue", new int[]{ 97, 98, 99, 100 } ),
                /* Purples */
                new CustomHueGroup( "Shades of Purple", new int[]{ 312, 313, 314, 315 } ),
                /* Browns */
                new CustomHueGroup( "Shades of Brown", new int[]{ 1032, 1034, 1035, 1036 } ),
                /* Greys */
                new CustomHueGroup( "Shades of Grey", new int[]{ 908, 909, 910, 911 } ),
                /* Black */
                new CustomHueGroup( "True Black", new int[]{ 1 } ),
                /* White */
                new CustomHueGroup( "True White", new int[]{ 1153 } ),
                /* Advanced Colors */
                new CustomHueGroup( "Advanced Colors", new int[]{ 1152, 1165, 1166, 1167, 1168, 1170, 1171, 1172, 1177, 1288 } )
            }, true);

Then in Dyes.cs after
Code:
private static void SetTubHue( Mobile from, object state, int hue )
            {
                ((DyeTub)state).DyedHue = hue;
            }

add this
Code:
            private CustomHuePicker m_BasicDyeTub;
            private CustomHuePicker m_ShadesDyeTub;
            private CustomHuePicker m_SkilledDyeTub;
            private CustomHuePicker m_AdvancedDyeTub;

and change this
Code:
protected override void OnTarget( Mobile from, object targeted )
            {
                if ( targeted is DyeTub )
                {
                    DyeTub tub = (DyeTub) targeted;
 
                    if ( tub.Redyable )
                    {
                        if ( tub.CustomHuePicker == null )
                            from.SendHuePicker( new InternalPicker( tub ) );
                        else
                            from.SendGump( new CustomHuePickerGump( from, tub.CustomHuePicker, new CustomHuePickerCallback( SetTubHue ), tub ) );
                    }
                    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
                {
                    from.SendLocalizedMessage( 500857 ); // Use this on a dye tub.
                }
            }

to this
Code:
protected override void OnTarget( Mobile from, object targeted )
            {
                if ( targeted is DyeTub )
                {
                    DyeTub tub = (DyeTub) targeted;
                    m_BasicDyeTub = CustomHuePicker.BasicDyeTub;
                    m_ShadesDyeTub = CustomHuePicker.ShadesDyeTub;
                    m_SkilledDyeTub = CustomHuePicker.SkilledDyeTub;
                    m_AdvancedDyeTub = CustomHuePicker.AdvancedDyeTub;
 
                    if ( tub.Redyable )
                    {
                        if (tub.CustomHuePicker == null && from.Skills[SkillName.Tailoring].Value <= 33.0)
                        {
                            from.SendGump(new CustomHuePickerGump(from, m_BasicDyeTub, new CustomHuePickerCallback(SetTubHue), tub));
                        }
                       
                        else if (tub.CustomHuePicker == null && from.Skills[SkillName.Tailoring].Value > 33.0 && from.Skills[SkillName.Tailoring].Value <= 66.0)
                            {
                                from.SendGump(new CustomHuePickerGump(from, m_ShadesDyeTub, new CustomHuePickerCallback(SetTubHue), tub));
                            }
 
                        else if (tub.CustomHuePicker == null && from.Skills[SkillName.Tailoring].Value > 66.0 && from.Skills[SkillName.Tailoring].Value <= 100.0)
                            {
                                from.SendGump(new CustomHuePickerGump(from, m_SkilledDyeTub, new CustomHuePickerCallback(SetTubHue), tub));
                            }
 
                        else if (tub.CustomHuePicker == null && from.Skills[SkillName.Tailoring].Value > 100.0)
                            {
                                from.SendGump(new CustomHuePickerGump(from, m_AdvancedDyeTub, new CustomHuePickerCallback(SetTubHue), tub));
                            }
 
                        else
                            from.SendGump(new CustomHuePickerGump(from, tub.CustomHuePicker, new CustomHuePickerCallback(SetTubHue), tub));
                    }
                    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
                {
                    from.SendLocalizedMessage( 500857 ); // Use this on a dye tub.
                }
            }
 
Man I gotta tell ya...being a long time crafter on OSI and multiple free shards I really love this. I did a craft rewrite for a test shard I was experimenting on but never thought of this. This is a fantastic idea. Kudos to you.
 
Top