viewing paste Unknown #14214 | Athena

Posted on the | Last edited on
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
//===== Hercules Script ======================================
//= Stylist
//===== By: ==================================================
//= Euphy
//===== Current Version: =====================================
//= 1.1
//===== Description: =========================================
//= Changes your hair style, hair color, and cloth color.
//===== Additional Comments: =================================
//= 1.1 Switched to 'getbattleflag', credits to Saithis. [Euphy]
//============================================================
 
// credits to Annieruru
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$;
}
 
prontera,170,180,1  script  Stylist#custom_stylist  878,{
 
    if (BaseClass == Job_Novice) && #styletalked != 1 {
    mes "[Stylist]";
    mes "Hey there cutie pie! I'm the hippest and best ^0000FFStylist^000000 in all of Prontera!";
    next;
    mes "[Stylist]";
    mes "Change your hair? You should! That style and color are old! Change your clothes color? Fashion demands it!";
    next;
    mes "[Stylist]";
    mes "Oh and one last thing before I unleash you to the \'Hounds of no Taste\', the runway of life only extends so far, once you've reached the end of it, you can just turn right around and walk back! Ha!";
    next;
    mes "[Stylist]";
    mes "...";
    sleep2 2500;
    mes ".............";
    sleep2 2500;
    mes "But seriously, change that nasty hair.";
        close2;
        getexp 70,30;
        getitem 2103,1;
        set #styletalked, 1;
        getmapxy .@map$, .@x, .@y, 0;
        warp .@map$, .@x, .@y;
        end;
    }   
    doevent "Stylist::OnTalk";
}   
 
 
-   script  Stylist -1,{
OnTalk:
    mes "[^0055FF ::: Adv. Stylist ::: ^000000]";
    mes "I can change your appearance.";
    if( .cost_size ){
        mes " ";
        mes "^777777[ SERVICES PAYMENT ]^000000";
        for( .@i = 0; .@i < .menu_size; .@i++ )
            if( .npc_mode & ( 1 << .@i ) )
                if( .cost[.@i] )
                    mes "^0055FF"+.menu_name$[.@i]+" : ^777777"+ValueConvert( .cost[.@i] )+" "+.currency_name$[.@i]+"^000000";
                else
                    mes "^0055FF"+.menu_name$[.@i]+" : ^777777Free of Charge^000000";
    }
    next;
    @style = ( select( .npc_menu$ ) - 1 );
    @style_value = getlook( .look_type[@style] );
    deletearray .@blacklist;
    switch( @style ){
        case 0: .@blacklist$ = ","+getd( ".blacklist_hairstyle_"+Sex+"$" )+","; break;
        case 1: .@blacklist$ = ","+getd( ".blacklist_haircolor_"+Sex+"$" )+","; break;
        case 2: .@blacklist$ = ","+getd( ".blacklist_cloth_"+Sex+"$" )+","; break;
        default: break;
    }
 
    .@style_number = .min_style[@style];
 
    addtimer 1000,strnpcinfo(0)+"::OnPCLogoutEvent";
    do{
        message strcharinfo(0),.menu_name$[@style]+" : "+.@style_number+"th";
        .@removed = 0;
        if( compare( .@blacklist$,","+.@style_number+"," ) ){
            message strcharinfo(0),"[ REMOVED ] "+.menu_name$[@style]+" : "+.@style_number+"th";
            .@removed = 1;
            // setlook .look_type[@style],.min_style[@style];
        }else{
            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( (( .@backward )?"Backward":"Forward" )+" - [ ^777777"+(( .@backward )? .@prev:.@next )+"th Style^000000 ]",
                    (( !.@backward )?"Backward":"Forward" )+" - [ ^777777"+(( !.@backward )? .@prev:.@next )+"th Style^000000 ]",
                    "Jump to a Style",
                    ( .@removed )?"":"^0055FFOkay, I want this "+.menu_name$[@style]+"^000000" );
                    
        if( @select == 2 ) .@backward = !.@backward;
        
        switch( @select ){
            case 1: 
            case 2:
                .@style_number = (( .@backward )? .@prev:.@next );
                break;
            case 3: 
                message strcharinfo(0),"Available Style : "+.min_style[@style]+" ~ "+.max_style[@style]+".";
                input .@style_number,.min_style[@style],.max_style[@style];
                break;
            case 4:
                .@atoi_currency = atoi( .currency$[@style] );
                if( @style_value == .@style_number ){
                    message strcharinfo(0),"Swt..that is your original hairstyles.";
                    break;
                } else if( .@atoi_currency ){
                    if( countitem( .@atoi_currency ) >= .cost[@style] ){
                        .@success = 1;
                        delitem .@atoi_currency,.cost[@style];
                    }
                }else{
                    if( getd( ""+.currency$[@style] ) >= .cost[@style] ){
                        .@success = 1;
                        setd( ""+.currency$[@style] ),( getd( ""+.currency$[@style] ) - .cost[@style] );
                    }
                }
                if( .@success ){
                    message strcharinfo(0),"Enjoy your NEW "+.menu_name$[@style]+" !!";
                    @style_value = .@style_number;
                }else{
                    mes "You dont have enough "+.currency_name$[@style]+" to change this "+.menu_name$[@style]+".";
                    mes "Cost : ^777777"+ValueConvert( .cost[@style] )+" "+.currency_name$[@style]+"^000000";
                    close2;
                }
 
            default:
                setlook .look_type[@style],@style_value;
                break;
        }
    }while( @select != 4 && @select != 255 );
    mes "Come back again next time. ^^";
    @select = 0;
    close2;
    deltimer strnpcinfo(0)+"::OnPCLogoutEvent";
 
OnPCLogoutEvent:
    if( @select )
        setlook .look_type[@style],@style_value;
    end;
    
OnInit:
    // 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";
    
    // Payment Currency + Cost
    // Can be ITEM ID or Any Variable.
    setarray .currency$,
        "Zeny", //  Hairstyle - Ex. need Zeny
        "Zeny", //  Hair Color - Ex. need Zeny
        "Zeny"; //  Cloth Color - Ex. need Zeny
        
    setarray .cost,
        10, //  Hairstyle ( 10,000 Zeny )
        10, //  Hair Color ( 10,000 Zeny )
        10; //  Cloth Color ( 10,000 Zeny )
        
    // Blacklisted Style for each style and each gender.
    // --- Female ---
    .blacklist_hairstyle_0$ = "2,4,6";
    .blacklist_haircolor_0$ = "1,3,5";
    .blacklist_cloth_0$ = "1,2,3";
    // --- Male ---
    .blacklist_hairstyle_1$ = "3,5,7";
    .blacklist_haircolor_1$ = "2,4,6";
    .blacklist_cloth_1$ = "4,5,6";
 
    // 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$ );
    .cost_size = getarraysize( .cost );
    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]:"" ) +":";
    for( .@i = 0; .@i < .cost_size; .@i++ ){
        .@atoi = atoi( .currency$[.@i] );
        .currency_name$[.@i] = ( ( !.@atoi || getitemname( .@atoi ) == "null" )? .currency$[.@i]:getitemname( .@atoi ) );
    }
    end;
 
    
OnPCLoadMapEvent:
    if( strcharinfo(3) == strnpcinfo(4) )
    if (BaseClass == Job_Novice) && #styletalked != 1 {
    showevent 2,0;
    }           
}
 
Viewed 785 times, submitted by Ridley.