Help me make an NPC to check style variables

Domo

New member
Messages
28
Points
0
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.

Code:
-	script	Stylist#Man::ST_00	-1,{	 set .@name$,"[ ^FF8000Stylist^000000 ]";	setarray .@max[1],553,256,90;		// Number of cloths, haircolors, hairstyles in client	setarray .@blacklist[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 .@type[1],7,6,1;		// DO NOT EDIT	set .@style,0;		mes .@name$;	mes "I can change your appearance for you if you'd like.";	mes " ";	mes "Just choose what you'd like to change:";	next;	set .@s,select("Clothes color",				"Hair color",				"Hair style");		mes .@name$;	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 .@name$;	mes "Alright, choose a style between ^0000FF0 and " +.@max[.@s]+ "^000000.";	next;	input .@style;		if (.@style < 0 || .@style > .@max[.@s]) {		mes .@name$;		mes "Style chosen is out of range.";		close;	}   L_start:	setarray @revert[1],getlook(.@type[.@s]),0,0;	mes .@name$;	mes "Alright here we go, starting at style ^007700" +.@style+ "^000000.";	next;	  // BEGINNING OF STYLE MENU LOOP ================================================  L_menuloop:	if (.@blacklist[0]) {		for (set .@f,0; .@f < getarraysize(.@blacklist); set .@f,.@f+1) {			if (.@style == .@blacklist[.@f] && .@previous == 1 && .@s == 1) {				message strcharinfo(0),"GM Message - Cloth " +.@style+ " was removed.";				set .@style, .@style - 1;				goto L_menuloop;			} else if (.@style == .@blacklist[.@f] && .@s == 1) {				message strcharinfo(0),"GM Message - Cloth " +.@style+ " was removed.";				set .@style, .@style +1;				goto L_menuloop;			}		}	}	setlook .@type[.@s],.@style;	mes "This is style number ^007700" +.@style+ "^000000.";		set .@next, .@style + 1;	set .@prev, .@style - 1;		// MAXIMUM MENU	if (.@style == .@max[.@s]) {		set .@next,0;		message strcharinfo(0),"Limit Reached";	}		// MINIMUM MENU ==============================================================	if (.@style == 0) {		set .@prev,.@max[.@s];		message strcharinfo(0),"Beginning Reached";	}		// PREVIOUS MENU =============================================================	if (.@previous) {		menu "^FF0000Previous - " +.@prev+ "^000000",L_prev,			"^0000FFNext - " +.@next+ "^000000",L_next,			"Jump to",L_jump,			"Save",L_save,			"Load",L_load;	}		// DEFAULT MENU ==============================================================	menu "^0000FFNext - " +.@next+ "^000000",L_next,		"^FF0000Previous - " +.@prev+ "^000000",L_prev,		"Jump to",L_jump,		"Save",L_save,		"Load",L_load;		  L_next:	set .@previous,0;	set .@style, .@next;	goto L_menuloop;   L_prev:	set .@previous,1;	set .@style, .@prev;	goto L_menuloop;	  L_jump:	next;	mes .@name$;	mes "Choose which style you'd like to jump to:";	next;	input .@style;	if (.@style < 0 || .@style > .@max[.@s]) {		mes .@name$;		mes "Style chosen is out of range.";		close;	}	goto L_menuloop;	  L_save:	next;	mes .@name$;	mes "Choose which slot you'd like to save to:";	set .@x, select("Slot 1 - [" +@revert[1]+ "]",					"Slot 2 - [" +@revert[2]+ "]",					"Slot 3 - [" +@revert[3]+ "]");						setarray @revert[.@x], .@style;	goto L_menuloop;	  L_load:	next;	mes .@name$;	mes "Choose which slot you'd like to load from:";	set .@x, select("Slot 1 - [" +@revert[1]+ "]",					"Slot 2 - [" +@revert[2]+ "]",					"Slot 3 - [" +@revert[3]+ "]");						set .@style, @revert[.@x];	goto L_menuloop;} prontera,186,198,4	duplicate(ST_00)	Stylist#Man	558
 
Last edited by a moderator:
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 
default_smile.png


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.

 
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.

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

 
Last edited by a moderator:
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.

Code:
    .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
have you test that script? because when i install it to my server is getting stack on 0 style and cannot select next or previous :D  

 
current version is 1.5



already having people report bugs on infinite loop ... via discord
so I assumed it tested

 
Back
Top