Help with Advance Stylist NPC

alfnsmgl

New member
Messages
2
Points
0
Github
alfnsmgl
Hi I am currently using Euphy's Stylist NPC and I've done some editing regarding an attempt for the NPC to accept and require 1 "New Clothing Dye Coupon(6046)" for each menu (Cloth Color, Hair Style & Hair Color). I am having trouble with the "cancel" button since when it's pressed, the program registers the last entered input. I'd appreciate if someone can help me to add in the script that whenever the player presses the "cancel" button; the script will revert the value to its original state. Thank you!

http://upaste.me/3e4d440178b91ac05

 
At first, I suggest you to set a Break; at the end of every case element in your code.

Second, element  flag dyecouponacceptance_fail Misses ":"

Third, I suggest you moving both flags (dyecoupon_fail and dyecouponacceptance_fail) outside Switch statement

UPDATE: I will be making a stylist changing styles as part of a quest

(I don't know when though...)

Scenario example:

player talks to little boy NPC named hooligan who is about to vandalize a city wall with dyes.

Player can try to stop that and

Hooligan: I will give you (quest item multi color dye) if you bring me poring card

Then, Stylist will use multi color dye to change colors..

If you are still struggling by that time, PM me i will share my script...

 
Last edited by a moderator:
Hi I am currently using Euphy's Stylist NPC and I've done some editing regarding an attempt for the NPC to accept and require 1 "New Clothing Dye Coupon(6046)" for each menu (Cloth Color, Hair Style & Hair Color). I am having trouble with the "cancel" button since when it's pressed, the program registers the last entered input. I'd appreciate if someone can help me to add in the script that whenever the player presses the "cancel" button; the script will revert the value to its original state. Thank you!

http://upaste.me/3e4d440178b91ac05
Hi!

Here is the script edited with the errors solved and with your request!

Code:
prontera.gat,170,180,4	script	Testing	4_F_JP_CHROME,{
		setarray .@styles[1],getbattleflag("max_cloth_color"),getbattleflag("max_hair_style"),getbattleflag("max_hair_color");
		setarray .@Look[1],7,1,6;

		mes "[ ^8B008BAdvanced Stylist^000000 ]";
		mes "Hello "+strcharinfo(0)+", I am Elendir.";
		mes "I can customize your appearance (Cloth Color, Hair Style, and Hair Color) in exchange for (1) Premium Reset Stone.";
		mes "Please select the service that you want:";
		set .@s, select(" ~ Cloth Color", " ~ Hair Style", " ~ Hair Color");
		set .@Revert, getlook(.@Look[.@s]);
		set .@style,1;

		while(1) {
				setlook .@Look[.@s], .@style;
				message strcharinfo(PC_NAME),"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): ~ I want this appearance";
				switch(prompt(.@menu$)){
						case 1:
								set .@style, ((.@style!=.@styles[.@s])?.@style+1:1);
								if ( countitem(6046) < 1 ) goto dyecouponacceptance_fail;
								break;
						case 2:
								set .@style, ((.@style!=1)?.@style-1:.@styles[.@s]);
								if ( countitem(6046) < 1 ) goto dyecouponacceptance_fail;
								break;
						case 3:
								message strcharinfo(PC_NAME),"Choose a style between 1 - "+.@styles[.@s]+".";
								input .@style,0,.@styles[.@s];
								break;
						case 5:
								if ( countitem(6046) < 1 ) goto dyecoupon_fail; // Counts Clothing Coupon
								delitem 6046, 1; // Deletes New Clothing Dye Coupon
								next;
								mes "[ ^8B008BAdvanced Stylist^000000 ]";
								mes "There you go! I've successfully changed your appearance.";
								close;

						case 4:
							set .@style, .@Revert;
							setlook .@Look[.@s], .@Revert;
							break;
						case 255:
							set .@style, .@Revert;
							setlook .@Look[.@s], .@Revert;
							end;
				dyecoupon_fail:
					next;
					mes "[ ^8B008BAdvanced Stylist^000000 ]";
					mes "It seems you don't have a ^0000FFNew Clothing Dye Coupon^000000.";
					mes "Please come back when you have the coupon.";
					set .@style, .@Revert;
					setlook .@Look[.@s], .@Revert;
					close;
				dyecouponacceptance_fail:
					set .@style, .@Revert;
					setlook .@Look[.@s], .@Revert;
					next;
					mes "[ ^8B008BAdvanced Stylist^000000 ]";
					mes "It seems you don't have a ^0000FFNew Clothing Dye Coupon^000000.";
					mes "Please come back when you have the coupon.";
					if (!.@style) set .@style, rand(1,.@styles[.@s]);
						break;
				
				}
		}
}
 
Last edited by a moderator:
Back
Top