Jump to content
  • 0
IsabelaFernandez

npc with access restriction

Question

hello community,
could anyone restrict the access of this NPC to "free" players up to hair style 29, hair color 80 and clothing color 180?
if the account is VIP have access to all colors and styles of the NPC

script: https://pastebin.com/GVv3pGBv

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 1

I didn't test it

// credits to Annieruru
 
-	script	Stylist	-1,{
	if(vip_status(VIP_STATUS_ACTIVE))
		setarray [email protected]_style,getbattleflag( "max_hair_style" ),getbattleflag( "max_hair_color" ),getbattleflag( "max_cloth_color" );
	else
		setarray [email protected]_style,29,80,180;

	cutin "hairstyle_"+Sex, 3;
	mes .npc_name$;
	mes "Eu posso mudar sua aparência.";
	if( .item_size ){
		mes " ";
		mes "^777777[ TAXAS DO SERVIÇO ]^000000";
		for( [email protected] = 0; [email protected] < .menu_size; [email protected]++ )
			if( .npc_mode & ( 1 << [email protected] ) )
				if( .item[[email protected]] )
					mes "^0055FF"+.menu_name$[[email protected]]+" : ^777777"+ .item[[email protected]] +" x "+getitemname(7420)+"^000000";
				else
					mes "^0055FF"+.menu_name$[[email protected]]+" : ^777777Free of Charge^000000";
	}
	next;
	[email protected] = ( select( .npc_menu$ ) - 1 );
	[email protected]_value = getlook( .look_type[[email protected]] );
	deletearray [email protected];
	switch( [email protected] ){
		Case 0: [email protected]$ = ","+getd( ".blacklist_hairstyle_"+Sex+"$" )+","; break;
		Case 1: [email protected]$ = ","+getd( ".blacklist_haircolor_"+Sex+"$" )+","; break;
		Case 2: [email protected]$ = ","+getd( ".blacklist_clothe_"+Sex+"$" )+","; break;
		default: break;
	}
 
	[email protected]_number = .min_style[[email protected]];
 
	do{
		next;
		mes .npc_name$;
		mes "Current "+.menu_name$[[email protected]]+" : ^0055FF"[email protected]_number+"th^000000";
		mes " ";
		[email protected] = 0;
		if( compare( [email protected]$,","[email protected]_number+"," ) ){
			mes "^FF0000NOTE : This style REMOVED^000000";
			[email protected] = 1;
			setlook .look_type[[email protected]],.min_style[[email protected]];
		}else{
			setlook .look_type[[email protected]],[email protected]_number;
			if( .item[[email protected]] ){
				mes "Cost : ^777777"+ .item[[email protected]] +" x "+getitemname(7420)+"^000000";
				mes " ";
			}
		}
 
		[email protected] = [email protected]_number + 1;
		[email protected] = [email protected]_number - 1;
		if( [email protected] > [email protected]_style[[email protected]] ) [email protected] = .min_style[[email protected]];
		if( [email protected] < .min_style[[email protected]] ) [email protected] = [email protected]_style[[email protected]];
 
		[email protected] = prompt( "Próximo - [ ^777777"[email protected]+"th Style^000000 ]",
					"Voltar - [ ^777777"[email protected]+"th Style^000000 ]",
					"Pular para...",
					( [email protected] )?"":"^0055FFCerto, eu quero esse "+.menu_name$[[email protected]]+"^000000" );
 
		switch( [email protected] ){
			Case 1:	[email protected]_number = [email protected]; break;
			Case 2:	[email protected]_number = [email protected]; break;
			Case 3:	
				mes "Available Style : ^0055FF"+.min_style[[email protected]]+" ~ "[email protected]_style[[email protected]]+"^000000.";
				input [email protected]_number,.min_style[[email protected]],[email protected]_style[[email protected]];
				break;
			Case 4:
				if( [email protected]_value == [email protected]_number ){
					mes "Swt..this is your original hairstyles.";
				} else if( .item[[email protected]] && countitem(7420) < .item[[email protected]] ){
					mes "Você não tem suficientes "+getitemname(7420)+" para mudar a "+.menu_name$[[email protected]]+".";
				}else{
					mes "Aproveite seu ^0055FFNEW "+.menu_name$[[email protected]]+" !!";
					if( .item[[email protected]] )
						delitem 7420, .item[[email protected]];
					[email protected]_value = [email protected]_number;
				}
			default:
				setlook .look_type[[email protected]],[email protected]_value;
				break;
		}
	}while( [email protected] != 4 && [email protected] != 255 );
	close;
 
 
OnInit:
waitingroom "[Estilista]",0;
	// NPC name
	.npc_name$ = "[^0055FF ::: Estilista ::: ^000000]";
 
	// NPC Mode ( Bitmask )
	//	1 - Enable Hairstyle
	//	2 - Enable Hair Color
	//	4 - Enable Cloth Color
	.npc_mode = 7;
 
	// Menu Name
	setarray .menu_name$,
		"Estilo do Cabelo",
		"Cor do Cabelo",
		"Cor da Roupa";
 
	// Payment (7420)
	setarray .item,
		5,	//	Hairstyle
		5,	//	Hair Color
		5;	//	Cloth Color
 
 
 
	// Blacklisted Style for each style and each gender.
	// --- Female ---
	.blacklist_hairstyle_0$ = "2,4,6";
	.blacklist_haircolor_0$ = "1,3,5";
	.blacklist_cloth_0$ = "143,188,261";
	// --- Male ---
	.blacklist_hairstyle_1$ = "3,5,7";
	.blacklist_haircolor_1$ = "2,4,6";
	.blacklist_cloth_1$ = "143,188,261";
 
	// Dont edit
	setarray .min_style,getbattleflag( "min_hair_style" ),getbattleflag( "min_hair_color" ),getbattleflag( "min_cloth_color" );
	
	.menu_size = getarraysize( .menu_name$ );
	.item_size = getarraysize( .item );
	setarray .look_type,LOOK_HAIR,LOOK_HAIR_COLOR,LOOK_CLOTHES_COLOR;
	for( .npc_menu$ = ""; [email protected] < .menu_size; [email protected]++ )
		.npc_menu$ = .npc_menu$ + ( ( .npc_mode & ( 1 << [email protected] ) )? .menu_name$[[email protected]]:"" ) +":";
	end;
 
}
 
 
// NPC Lists
prontera,175,202,4	duplicate(Stylist)	Estilista#4	878

 

Edited by sader1992
  • Love 1
Link to comment
Share on other sites

  • 0
1 hour ago, sader1992 said:

I didn't test it

// credits to Annieruru
 
-	script	Stylist	-1,{
	if(vip_status(VIP_STATUS_ACTIVE))
		setarray [email protected]_style,getbattleflag( "max_hair_style" ),getbattleflag( "max_hair_color" ),getbattleflag( "max_cloth_color" );
	else
		setarray [email protected]_style,29,80,180;

	cutin "hairstyle_"+Sex, 3;
	mes .npc_name$;
	mes "Eu posso mudar sua aparência.";
	if( .item_size ){
		mes " ";
		mes "^777777[ TAXAS DO SERVIÇO ]^000000";
		for( [email protected] = 0; [email protected] < .menu_size; [email protected]++ )
			if( .npc_mode & ( 1 << [email protected] ) )
				if( .item[[email protected]] )
					mes "^0055FF"+.menu_name$[[email protected]]+" : ^777777"+ .item[[email protected]] +" x "+getitemname(7420)+"^000000";
				else
					mes "^0055FF"+.menu_name$[[email protected]]+" : ^777777Free of Charge^000000";
	}
	next;
	[email protected] = ( select( .npc_menu$ ) - 1 );
	[email protected]_value = getlook( .look_type[[email protected]] );
	deletearray [email protected];
	switch( [email protected] ){
		Case 0: [email protected]$ = ","+getd( ".blacklist_hairstyle_"+Sex+"$" )+","; break;
		Case 1: [email protected]$ = ","+getd( ".blacklist_haircolor_"+Sex+"$" )+","; break;
		Case 2: [email protected]$ = ","+getd( ".blacklist_clothe_"+Sex+"$" )+","; break;
		default: break;
	}
 
	[email protected]_number = .min_style[[email protected]];
 
	do{
		next;
		mes .npc_name$;
		mes "Current "+.menu_name$[[email protected]]+" : ^0055FF"[email protected]_number+"th^000000";
		mes " ";
		[email protected] = 0;
		if( compare( [email protected]$,","[email protected]_number+"," ) ){
			mes "^FF0000NOTE : This style REMOVED^000000";
			[email protected] = 1;
			setlook .look_type[[email protected]],.min_style[[email protected]];
		}else{
			setlook .look_type[[email protected]],[email protected]_number;
			if( .item[[email protected]] ){
				mes "Cost : ^777777"+ .item[[email protected]] +" x "+getitemname(7420)+"^000000";
				mes " ";
			}
		}
 
		[email protected] = [email protected]_number + 1;
		[email protected] = [email protected]_number - 1;
		if( [email protected] > [email protected]_style[[email protected]] ) [email protected] = .min_style[[email protected]];
		if( [email protected] < .min_style[[email protected]] ) [email protected] = [email protected]_style[[email protected]];
 
		[email protected] = prompt( "Próximo - [ ^777777"[email protected]+"th Style^000000 ]",
					"Voltar - [ ^777777"[email protected]+"th Style^000000 ]",
					"Pular para...",
					( [email protected] )?"":"^0055FFCerto, eu quero esse "+.menu_name$[[email protected]]+"^000000" );
 
		switch( [email protected] ){
			Case 1:	[email protected]_number = [email protected]; break;
			Case 2:	[email protected]_number = [email protected]; break;
			Case 3:	
				mes "Available Style : ^0055FF"+.min_style[[email protected]]+" ~ "[email protected]_style[[email protected]]+"^000000.";
				input [email protected]_number,.min_style[[email protected]],[email protected]_style[[email protected]];
				break;
			Case 4:
				if( [email protected]_value == [email protected]_number ){
					mes "Swt..this is your original hairstyles.";
				} else if( .item[[email protected]] && countitem(7420) < .item[[email protected]] ){
					mes "Você não tem suficientes "+getitemname(7420)+" para mudar a "+.menu_name$[[email protected]]+".";
				}else{
					mes "Aproveite seu ^0055FFNEW "+.menu_name$[[email protected]]+" !!";
					if( .item[[email protected]] )
						delitem 7420, .item[[email protected]];
					[email protected]_value = [email protected]_number;
				}
			default:
				setlook .look_type[[email protected]],[email protected]_value;
				break;
		}
	}while( [email protected] != 4 && [email protected] != 255 );
	close;
 
 
OnInit:
waitingroom "[Estilista]",0;
	// NPC name
	.npc_name$ = "[^0055FF ::: Estilista ::: ^000000]";
 
	// NPC Mode ( Bitmask )
	//	1 - Enable Hairstyle
	//	2 - Enable Hair Color
	//	4 - Enable Cloth Color
	.npc_mode = 7;
 
	// Menu Name
	setarray .menu_name$,
		"Estilo do Cabelo",
		"Cor do Cabelo",
		"Cor da Roupa";
 
	// Payment (7420)
	setarray .item,
		5,	//	Hairstyle
		5,	//	Hair Color
		5;	//	Cloth Color
 
 
 
	// Blacklisted Style for each style and each gender.
	// --- Female ---
	.blacklist_hairstyle_0$ = "2,4,6";
	.blacklist_haircolor_0$ = "1,3,5";
	.blacklist_cloth_0$ = "143,188,261";
	// --- Male ---
	.blacklist_hairstyle_1$ = "3,5,7";
	.blacklist_haircolor_1$ = "2,4,6";
	.blacklist_cloth_1$ = "143,188,261";
 
	// Dont edit
	setarray .min_style,getbattleflag( "min_hair_style" ),getbattleflag( "min_hair_color" ),getbattleflag( "min_cloth_color" );
	
	.menu_size = getarraysize( .menu_name$ );
	.item_size = getarraysize( .item );
	setarray .look_type,LOOK_HAIR,LOOK_HAIR_COLOR,LOOK_CLOTHES_COLOR;
	for( .npc_menu$ = ""; [email protected] < .menu_size; [email protected]++ )
		.npc_menu$ = .npc_menu$ + ( ( .npc_mode & ( 1 << [email protected] ) )? .menu_name$[[email protected]]:"" ) +":";
	end;
 
}
 
 
// NPC Lists
prontera,175,202,4	duplicate(Stylist)	Estilista#4	878

 

it worked exactly as i wanted, thanks!

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...

Important Information

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