Jump to content
  • 0
Sign in to follow this  
anjasoleil0

stylist help

Question

Hi, I edited this stylist script from euphy's and I was wondering

How do I 'DISABLE' changing hairstyle color when the hairstyle is past #99?

 

 

 function    script    ValueConvert    {
    set .@num, atoi(""+getarg(0));
    if ( .@num == 0 || .@num >= 2147483647 ) return getarg(0);
    set .@l, getstrlen(""+.@num);
    for ( set .@i,0; .@i < .@l; set .@i, .@i + 1 ) {
        set .@num$, .@num % pow(10,.@i+1) / pow(10,.@i) + .@num$;
            if ( (.@i+1) % 3 == 0 && .@i+1 != .@l ) set .@num$, ","+ .@num$;
    }
    return .@num$;
}
 
 
-    script    Stylist    -1,{
    .@style = ( select( .npc_menu$ ) - 1 );
    .@style_value = getlook( .look_type[.@style] );
    deletearray .@blacklist;
    switch( .@style ){
        case 0: .@blacklist$ = ","+.blacklist_hairstyle$+","; break;
        case 1: .@blacklist$ = ","+.blacklist_haircolor$+","; break;
        case 2: .@blacklist$ = ","+.blacklist_clothe$+","; break;
        default: break;
    }
 
    .@style_number = .min_style[.@style];
 
    do{
        .@removed = 0;
        if( compare( .@blacklist$,","+.@style_number+"," ) ){
            message strcharinfo(0),"NOTE: This style removed";
            .@removed = 1;
            setlook .look_type[.@style],.min_style[.@style];
        }else{
            if(.look_type == LOOK_HAIR_COLOR){message strcharinfo(0),"DONT";end;}
            setlook .look_type[.@style],.@style_number;
        }
        
        .@next = .@style_number + 1;
        .@prev = .@style_number - 1;
        if( .@next > .max_style[.@style] ) .@next = .min_style[.@style];
        if( .@prev < .min_style[.@style] ) .@prev = .max_style[.@style];
        
        .@select = prompt( "Next - [ ^777777"+.@next+"th Style^000000 ]",
                    "Back - [ ^777777"+.@prev+"th Style^000000 ]",
                    "Jump to a Style",
                    ( .@removed )?"":"^0055FFOkay, I want this "+.menu_name$[.@style]+"^000000" );
                    
        switch( .@select ){
            case 1:    .@style_number = .@next; break;
            case 2:    .@style_number = .@prev; break;
            case 3:    
                message strcharinfo(0),""+.min_style[.@style]+" ~ "+.max_style[.@style]+"";
                input .@style_number,.min_style[.@style],.max_style[.@style];
                break;
            case 4:
                close;
            default:
                setlook .look_type[.@style],.@style_value;
                end;
        }
    }while( .@select != 4 && .@select != 255 );
    close;
 
 
OnInit:
    // NPC name
    .npc_name$ = "[^0055FF ::: Adv. Stylist ::: ^000000]";
    
    // NPC Mode ( Bitmask )
    //    1 - Enable Hairstyle
    //    2 - Enable Hair Color
    //    4 - Enable Cloth Color
    .npc_mode = 7;
    
    // Menu Name
    setarray .menu_name$,
        "Hair Style",
        "Hair Color",
        "Cloth Color";
    
    // Blacklisted Style for each style.
    .blacklist_hairstyle$ = "";
    .blacklist_haircolor$ = "";
    .blacklist_cloth$ = "143,188,261";
 
    // Dont edit
    setarray .min_style,getbattleflag( "min_hair_style" ),getbattleflag( "min_hair_color" ),getbattleflag( "min_cloth_color" );
    setarray .max_style,getbattleflag( "max_hair_style" ),getbattleflag( "max_hair_color" ),getbattleflag( "max_cloth_color" );
    .menu_size = getarraysize( .menu_name$ );
    setarray .look_type,LOOK_HAIR,LOOK_HAIR_COLOR,LOOK_CLOTHES_COLOR;
    for( .npc_menu$ = ""; .@i < .menu_size; .@i++ )
        .npc_menu$ = .npc_menu$ + ( ( .npc_mode & ( 1 << .@i ) )? .menu_name$[.@i]:"" ) +":";
    end;
 
}

 

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.