• 0
Sign in to follow this  
Followers 0
Domo

Help me make an NPC to check style variables

Question

Can somebody help me make an NPC that detects the character's Clothing dye, hair color, and hair style?

 

example: if you click on the NPC it tells you your own variables (like clothing dye: 20, hairstyle: 10, hair color: 5)

 

This is the current script for the stylist made by Hudelf. i think this is rAthena.

 

-	script	Stylist#Man::ST_00	-1,{	 set [email protected]$,"[ ^FF8000Stylist^000000 ]";	setarray [email protected][1],553,256,90;		// Number of cloths, haircolors, hairstyles in client	setarray [email protected][0],0,143,261;	// NPC will skip any cloth colors in this array.						// 	 Use for palettes that cause errors or just plain look bad.						//		Leave first value at 0 to disable.	setarray [email protected][1],7,6,1;		// DO NOT EDIT	set [email protected],0;		mes [email protected]$;	mes "I can change your appearance for you if you'd like.";	mes " ";	mes "Just choose what you'd like to change:";	next;	set [email protected],select("Clothes color",				"Hair color",				"Hair style");		mes [email protected]$;	mes "Alright, how would you like to search?";	next;	menu "Start at the beginning",L_start,		"Choose where to start",-;		// CHOOSE WHERE TO START =====================================================	mes [email protected]$;	mes "Alright, choose a style between ^0000FF0 and " [email protected][[email protected]]+ "^000000.";	next;	input [email protected];		if ([email protected] < 0 || [email protected] > [email protected][[email protected]]) {		mes [email protected]$;		mes "Style chosen is out of range.";		close;	}   L_start:	setarray @revert[1],getlook([email protected][[email protected]]),0,0;	mes [email protected]$;	mes "Alright here we go, starting at style ^007700" [email protected]+ "^000000.";	next;	  // BEGINNING OF STYLE MENU LOOP ================================================  L_menuloop:	if ([email protected][0]) {		for (set [email protected],0; [email protected] < getarraysize([email protected]); set [email protected],[email protected]+1) {			if ([email protected] == [email protected][[email protected]] && [email protected] == 1 && [email protected] == 1) {				message strcharinfo(0),"GM Message - Cloth " [email protected]+ " was removed.";				set [email protected], [email protected] - 1;				goto L_menuloop;			} else if ([email protected] == [email protected][[email protected]] && [email protected] == 1) {				message strcharinfo(0),"GM Message - Cloth " [email protected]+ " was removed.";				set [email protected], [email protected] +1;				goto L_menuloop;			}		}	}	setlook [email protected][[email protected]],[email protected];	mes "This is style number ^007700" [email protected]+ "^000000.";		set [email protected], [email protected] + 1;	set [email protected], [email protected] - 1;		// MAXIMUM MENU	if ([email protected] == [email protected][[email protected]]) {		set [email protected],0;		message strcharinfo(0),"Limit Reached";	}		// MINIMUM MENU ==============================================================	if ([email protected] == 0) {		set [email protected],[email protected][[email protected]];		message strcharinfo(0),"Beginning Reached";	}		// PREVIOUS MENU =============================================================	if ([email protected]) {		menu "^FF0000Previous - " [email protected]+ "^000000",L_prev,			"^0000FFNext - " [email protected]+ "^000000",L_next,			"Jump to",L_jump,			"Save",L_save,			"Load",L_load;	}		// DEFAULT MENU ==============================================================	menu "^0000FFNext - " [email protected]+ "^000000",L_next,		"^FF0000Previous - " [email protected]+ "^000000",L_prev,		"Jump to",L_jump,		"Save",L_save,		"Load",L_load;		  L_next:	set [email protected],0;	set [email protected], [email protected];	goto L_menuloop;   L_prev:	set [email protected],1;	set [email protected], [email protected];	goto L_menuloop;	  L_jump:	next;	mes [email protected]$;	mes "Choose which style you'd like to jump to:";	next;	input [email protected];	if ([email protected] < 0 || [email protected] > [email protected][[email protected]]) {		mes [email protected]$;		mes "Style chosen is out of range.";		close;	}	goto L_menuloop;	  L_save:	next;	mes [email protected]$;	mes "Choose which slot you'd like to save to:";	set [email protected], select("Slot 1 - [" [email protected][1]+ "]",					"Slot 2 - [" [email protected][2]+ "]",					"Slot 3 - [" [email protected][3]+ "]");						setarray @revert[[email protected]], [email protected];	goto L_menuloop;	  L_load:	next;	mes [email protected]$;	mes "Choose which slot you'd like to load from:";	set [email protected], select("Slot 1 - [" [email protected][1]+ "]",					"Slot 2 - [" [email protected][2]+ "]",					"Slot 3 - [" [email protected][3]+ "]");						set [email protected], @revert[[email protected]];	goto L_menuloop;} prontera,186,198,4	duplicate(ST_00)	Stylist#Man	558
Edited by AnnieRuru
use [code] if the script > 10 lines

Share this post


Link to post
Share on other sites

5 answers to this question

  • 0

time to show my stylist script ?

https://github.com/AnnieRuru/customs/blob/master/scripts/stylist.txt

 

when you start searching, it automatically save a variable on which style you are on

the revert feature was from Euphy script though

https://github.com/HerculesWS/Hercules/blob/master/npc/custom/stylist.txt

Share this post


Link to post
Share on other sites
  • 0

It's a pretty simple NPC you can make using *getlook script command (*setlook for variable reference)

Thank you very much; I didn't bother to read the variable references the first time i read that page  :)

 

time to show my stylist script ?

https://github.com/AnnieRuru/customs/blob/master/scripts/stylist.txt

 

when you start searching, it automatically save a variable on which style you are on

the revert feature was from Euphy script though

https://github.com/HerculesWS/Hercules/blob/master/npc/custom/stylist.txt

Thanks for the script; I could probably use this when I overhaul my existing NPCs to make them more efficient.

Share this post


Link to post
Share on other sites
  • 0

not sure if @kyemestill around, but I actually completed it XD

https://drive.google.com/file/d/10rdB2Pp5ACMdufHV4NTl9SXTExCVbycc/view



this time doesn't use blacklist range, but use allow range in CSV format.

    .list$[LOOK_HAIR] = "0-5,11-18,20-23";
    .list$[Job_Summoner + LOOK_CLOTHES_COLOR] = "0-1";

This means, the ID range for hair style is 0,1,2,3,4,5,11,12,13,14,15,16,17,18,20,21,22,23
2nd line means Summoner job can only use clothing range 0 and 1, this prevent crash client

Edited by AnnieRuru

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0