Jump to content
  • 0

stylist


Erio-chan

Question


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  97
  • Reputation:   10
  • Joined:  07/23/16
  • Last Seen:  

can anyone help me to limit the hair style of this script.

because I want some hair for my self only and not available in hairstylist

//===== rAthena Script =======================================
//= Stylist
//===== By: ==================================================
//= Euphy
//===== Current Version: =====================================
//= 1.1
//===== Compatible With: =====================================
//= rAthena Project
//===== Description: =========================================
//= Changes your hair style, hair color, and cloth color.
//===== Additional Comments: =================================
//= 1.0 Initial script.
//= 1.1 Switched to 'getbattleflag', credits to Saithis. [Euphy]
//============================================================

bro_mall,87,113,5	script	Stylist#custom_stylist	640,{
	
	cutin "gc_mayssel01",2;
	mes "^0000FF Stella^000000";
	mes "I'm Stylist Stella.";
	mes "I am happy to serve you Master.";
	setarray .@Styles[1],
		getbattleflag("max_cloth_color"),
		getbattleflag("max_hair_style"),
		getbattleflag("max_hair_color");
	setarray .@Look[1],
		LOOK_CLOTHES_COLOR,
		LOOK_HAIR,
		LOOK_HAIR_COLOR;
	set .@s, select(" ~ Cloth color: ~ Hairstyle: ~ Hair color");
	set .@Revert, getlook(.@Look[.@s]);
	set .@Style,1;
	while(1) {
		setlook .@Look[.@s], .@Style;
		message strcharinfo(0),"This is style #"+.@Style+".";
		set .@menu$, " ~ Next (^0055FF"+((.@Style!=.@Styles[.@s])?.@Style+1:1)+"^000000): ~ Previous (^0055FF"+((.@Style!=1)?.@Style-1:.@Styles[.@s])+"^000000): ~ Jump to...: ~ Revert to original (^0055FF"+.@Revert+"^000000)";
		switch(select(.@menu$)) {
		case 1:
			set .@Style, ((.@Style != .@Styles[.@s]) ? .@Style+1 : 1);
			break;
		case 2:
			set .@Style, ((.@Style != 1) ? .@Style-1 : .@Styles[.@s]);
			break;
		case 3:
			message strcharinfo(0),"Choose a style between 1 - "+.@Styles[.@s]+".";
			input .@Style,0,.@Styles[.@s];
			if (!.@Style)
				set .@Style, rand(1,.@Styles[.@s]);
			break;
		case 4:
			set .@Style, .@Revert;
			setlook .@Look[.@s], .@Revert;
			break;
		}
	}
	close2;
	cutin "",255;
	end;
}

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  97
  • Reputation:   10
  • Joined:  07/23/16
  • Last Seen:  

[SOLVED]

Advance Stylist 4.3.txt by Emisty, Hairstyle Blacklist



// 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$;
}


-	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,
		10000,	//	Hairstyle ( 10,000 Zeny )
		10000,	//	Hair Color ( 10,000 Zeny )
		10000;	//	Cloth Color ( 10,000 Zeny )
		
	// Blacklisted Style for each style and each gender.
	// --- Female ---
	.blacklist_hairstyle_0$ = "60"; //example .blacklist_hairstyle_0$ = "1,2,3,6,8,9";
	.blacklist_haircolor_0$ = "";
	.blacklist_cloth_0$ = "";
	// --- Male ---
	.blacklist_hairstyle_1$ = "60";
	.blacklist_haircolor_1$ = "";
	.blacklist_cloth_1$ = "";

	// 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;

}


// NPC Lists
prontera,155,181,5	script	Adv. Stylist#main	878,{
	doevent "Stylist::OnTalk";
}

prontera,115,181,5	duplicate(Adv. Stylist#main)	Adv. Stylist#1	878
prontera,115,181,5	duplicate(Adv. Stylist#main)	Adv. Stylist#2	878
prontera,115,181,5	duplicate(Adv. Stylist#main)	Adv. Stylist#3	878

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  8
  • Reputation:   4
  • Joined:  12/04/17
  • Last Seen:  

hello limit hairstyle like this ? or you want specific range ?

//===== rAthena Script =======================================
//= Stylist
//===== By: ==================================================
//= Euphy
//===== Current Version: =====================================
//= 1.1
//===== Compatible With: =====================================
//= rAthena Project
//===== Description: =========================================
//= Changes your hair style, hair color, and cloth color.
//===== Additional Comments: =================================
//= 1.0 Initial script.
//= 1.1 Switched to 'getbattleflag', credits to Saithis. [Euphy]
//============================================================

ragnarok,68,78,5	script	Stylist#custom_stylist	640,{
	
	//cutin "gc_mayssel01",2;
	mes "^0000FF Stella^000000";
	mes "I'm Stylist Stella.";
	mes "I am happy to serve you Master.";
	setarray .@Styles[1],
		getbattleflag("max_cloth_color"),
		getbattleflag("max_hair_style"),
		getbattleflag("max_hair_color");
	setarray .@Look[1],
		LOOK_CLOTHES_COLOR,
		LOOK_HAIR,
		LOOK_HAIR_COLOR;
		
	set .@maxhairstyle,10; // Max Limit for Hairstyle
	
	set .@s, select(" ~ Cloth color: ~ Hairstyle: ~ Hair color");
	set .@Revert, getlook(.@Look[.@s]);
	set .@Style,1;
	switch(.@s){
		case 2:
			mes "MaxHairstyles ^ff0000"+.@maxhairstyle+"^000000";
			input .@hairstyle;
			if (.@hairstyle > .@maxhairstyle) {
				mes "Please input correctly.";
				close3;
			}
			if (.@hairstyle < 0 || .@hairstyle > .@maxhairstyle) set .@hairstyle,0; {
				setlook 1,.@hairstyle;
				close3;
			}
	}
	while(1) {
		setlook .@Look[.@s], .@Style;
		message strcharinfo(0),"This is style #"+.@Style+".";
		set .@menu$, " ~ Next (^0055FF"+((.@Style!=.@Styles[.@s])?.@Style+1:1)+"^000000): ~ Previous (^0055FF"+((.@Style!=1)?.@Style-1:.@Styles[.@s])+"^000000): ~ Jump to...: ~ Revert to original (^0055FF"+.@Revert+"^000000)";
		switch(select(.@menu$)) {
		case 1:
			set .@Style, ((.@Style != .@Styles[.@s]) ? .@Style+1 : 1);
			break;
		case 2:
			set .@Style, ((.@Style != 1) ? .@Style-1 : .@Styles[.@s]);
			break;
		case 3:
			message strcharinfo(0),"Choose a style between 1 - "+.@Styles[.@s]+".";
			input .@Style,0,.@Styles[.@s];
			if (!.@Style)
				set .@Style, rand(1,.@Styles[.@s]);
			break;
		case 4:
			set .@Style, .@Revert;
			setlook .@Look[.@s], .@Revert;
			break;
		}
	}
	close3;
}

note : you can use close3 instead close2 + cutin. 

  • MVP 1
  • Like 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  97
  • Reputation:   10
  • Joined:  07/23/16
  • Last Seen:  

10 minutes ago, yoonjunho said:

hello limit hairstyle like this ? or you want specific range ?


//===== rAthena Script =======================================
//= Stylist
//===== By: ==================================================
//= Euphy
//===== Current Version: =====================================
//= 1.1
//===== Compatible With: =====================================
//= rAthena Project
//===== Description: =========================================
//= Changes your hair style, hair color, and cloth color.
//===== Additional Comments: =================================
//= 1.0 Initial script.
//= 1.1 Switched to 'getbattleflag', credits to Saithis. [Euphy]
//============================================================

ragnarok,68,78,5	script	Stylist#custom_stylist	640,{
	
	//cutin "gc_mayssel01",2;
	mes "^0000FF Stella^000000";
	mes "I'm Stylist Stella.";
	mes "I am happy to serve you Master.";
	setarray .@Styles[1],
		getbattleflag("max_cloth_color"),
		getbattleflag("max_hair_style"),
		getbattleflag("max_hair_color");
	setarray .@Look[1],
		LOOK_CLOTHES_COLOR,
		LOOK_HAIR,
		LOOK_HAIR_COLOR;
		
	set .@maxhairstyle,10; // Max Limit for Hairstyle
	
	set .@s, select(" ~ Cloth color: ~ Hairstyle: ~ Hair color");
	set .@Revert, getlook(.@Look[.@s]);
	set .@Style,1;
	switch(.@s){
		case 2:
			mes "MaxHairstyles ^ff0000"+.@maxhairstyle+"^000000";
			input .@hairstyle;
			if (.@hairstyle > .@maxhairstyle) {
				mes "Please input correctly.";
				close3;
			}
			if (.@hairstyle < 0 || .@hairstyle > .@maxhairstyle) set .@hairstyle,0; {
				setlook 1,.@hairstyle;
				close3;
			}
	}
	while(1) {
		setlook .@Look[.@s], .@Style;
		message strcharinfo(0),"This is style #"+.@Style+".";
		set .@menu$, " ~ Next (^0055FF"+((.@Style!=.@Styles[.@s])?.@Style+1:1)+"^000000): ~ Previous (^0055FF"+((.@Style!=1)?.@Style-1:.@Styles[.@s])+"^000000): ~ Jump to...: ~ Revert to original (^0055FF"+.@Revert+"^000000)";
		switch(select(.@menu$)) {
		case 1:
			set .@Style, ((.@Style != .@Styles[.@s]) ? .@Style+1 : 1);
			break;
		case 2:
			set .@Style, ((.@Style != 1) ? .@Style-1 : .@Styles[.@s]);
			break;
		case 3:
			message strcharinfo(0),"Choose a style between 1 - "+.@Styles[.@s]+".";
			input .@Style,0,.@Styles[.@s];
			if (!.@Style)
				set .@Style, rand(1,.@Styles[.@s]);
			break;
		case 4:
			set .@Style, .@Revert;
			setlook .@Look[.@s], .@Revert;
			break;
		}
	}
	close3;
}

note : you can use close3 instead close2 + cutin. 

Thanks for the info!

Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

×
×
  • Create New...