Skip to content

Commit 0eae05a

Browse files
committed
Update stylist.txt
- fix ID start with 0 instead of 1 - add Job_Summoner to have its own specific range
1 parent 51483b4 commit 0eae05a

File tree

1 file changed

+39
-21
lines changed

1 file changed

+39
-21
lines changed

npc/custom/stylist.txt

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,50 @@
33
//===== By: ==================================================
44
//= Euphy
55
//===== Current Version: =====================================
6-
//= 1.1
6+
//= 1.2
77
//===== Description: =========================================
88
//= Changes your hair style, hair color, and cloth color.
99
//===== Additional Comments: =================================
1010
//= 1.1 Switched to 'getbattleflag', credits to Saithis. [Euphy]
11+
//= 1.2 Fix style start at 0, add Job_Summoner [AnnieRuru]
1112
//============================================================
1213

13-
prontera,170,180,1 script Stylist#custom_stylist 2_M_DYEINGER,{
14-
15-
setarray .@styles[1],getbattleflag("max_cloth_color"),getbattleflag("max_hair_style"),getbattleflag("max_hair_color");
16-
setarray .@Look[1],7,1,6;
17-
set .@s, select(" ~ Cloth color", " ~ Hairstyle", " ~ Hair color");
18-
set .@Revert, getlook(.@Look[.@s]);
19-
set .@style,1;
20-
while(1) {
21-
setlook .@Look[.@s], .@style;
22-
message strcharinfo(PC_NAME),"This is style #"+.@style+".";
23-
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)";
24-
switch(select(.@menu$)) {
25-
case 1: set .@style, ((.@style!=.@styles[.@s])?.@style+1:1); break;
26-
case 2: set .@style, ((.@style!=1)?.@style-1:.@styles[.@s]); break;
27-
case 3: message strcharinfo(PC_NAME),"Choose a style between 1 - "+.@styles[.@s]+".";
28-
input .@style,0,.@styles[.@s];
29-
if (!.@style) set .@style, rand(1,.@styles[.@s]);
30-
break;
31-
case 4: set .@style, .@Revert; setlook .@Look[.@s], .@Revert; break;
14+
prontera,165,176,1 script Stylist HIDDEN_NPC,{
15+
.@choose = select("Hair style", "Hair color", "Cloth color") -1;
16+
.@part = .@lookpart = .look[.@choose];
17+
if (BaseClass == Job_Summoner)
18+
.@part += Job_Summoner;
19+
.@i = .@revert = getlook(.@lookpart);
20+
while (true) {
21+
setlook .@lookpart, .@i;
22+
message strcharinfo(PC_NAME), sprintf("This is style #%d.", .@i);
23+
.@next = (.@i == .maxstyles[.@part])? 0 : .@i + 1;
24+
.@previous = (.@i == 0)? .maxstyles[.@part] : .@i - 1;
25+
switch(select(sprintf(" ~ Next (%s%d%s)", F_MesColor(C_BLUE), .@next, F_MesColor(C_BLACK)), sprintf(" ~ Previous (%s%d%s)", F_MesColor(C_BLUE), .@previous, F_MesColor(C_BLACK)), " ~ Jump to...", sprintf(" ~ Revert to original (%s%d%s)", F_MesColor(C_BLUE), .@revert, F_MesColor(C_BLACK)))) {
26+
case 1:
27+
.@i = .@next;
28+
break;
29+
case 2:
30+
.@i = .@previous;
31+
break;
32+
case 3:
33+
message strcharinfo(PC_NAME), sprintf("Choose a style between 0 - %d.", .maxstyles[.@part]);
34+
input .@i, 0, .maxstyles[.@part];
35+
break;
36+
case 4:
37+
.@i = .@revert;
3238
}
3339
}
34-
}
40+
end;
41+
OnInit:
42+
.maxstyles[LOOK_HAIR] = getbattleflag("max_hair_style");
43+
.maxstyles[LOOK_HAIR_COLOR] = getbattleflag("max_hair_color");
44+
.maxstyles[LOOK_CLOTHES_COLOR] = getbattleflag("max_cloth_color");
45+
46+
.maxstyles[Job_Summoner + LOOK_HAIR] = getbattleflag("max_hair_style");
47+
.maxstyles[Job_Summoner + LOOK_HAIR_COLOR] = getbattleflag("max_hair_color");
48+
.maxstyles[Job_Summoner + LOOK_CLOTHES_COLOR] = getbattleflag("max_cloth_color");
49+
50+
setarray .look[0], LOOK_HAIR, LOOK_HAIR_COLOR, LOOK_CLOTHES_COLOR, Job_Summoner + LOOK_HAIR, Job_Summoner + LOOK_HAIR_COLOR, Job_Summoner + LOOK_CLOTHES_COLOR;
51+
end;
52+
}

0 commit comments

Comments
 (0)