summaryrefslogtreecommitdiff
path: root/npc/custom/stylist.txt
blob: 188a91ca712f385c0e691c1deda8542dcdf3d05c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//===== Hercules Script ======================================
//= Stylist
//===== By: ==================================================
//= Euphy
//===== Current Version: =====================================
//= 1.2
//===== Description: =========================================
//= Changes your hair style, hair color, and cloth color.
//===== Additional Comments: =================================
//= 1.1 Switched to 'getbattleflag', credits to Saithis. [Euphy]
//= 1.2 Fix style start at min_style, add Job_Summoner [AnnieRuru]
//============================================================

prontera,170,180,1	script	Stylist#custom_stylist	2_M_DYEINGER,{
	.@choose = select("Hair style", "Hair color", "Cloth color") - 1;
	.@part = .look[.@choose];
	if (BaseClass != Job_Summoner)
		callsub(L_styles, .@part, .minstyle[.@part], .maxstyle[.@part]);
	else
		callsub(L_styles, .@part, .summoner_minstyle[.@part], .summoner_maxstyle[.@part]);
L_styles:
	.@lookpart = getarg(0);
	.@minstyle = getarg(1);
	.@maxstyle = getarg(2);
	.@i = .@revert = getlook(.@lookpart);
	while (true) {
		setlook(.@lookpart, .@i);
		message(strcharinfo(PC_NAME), sprintf(_("This is style #%d."), .@i));
		if (.@i == .@maxstyle)
			.@next = .@minstyle;
		else
			.@next = .@i + 1;
		if (.@i == .@minstyle)
			.@previous = .@maxstyle;
		else
			.@previous = .@i - 1;
		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)))) {
		case 1:
			.@i = .@next;
			break;
		case 2:
			.@i = .@previous;
			break;
		case 3:
			message(strcharinfo(PC_NAME), sprintf(_("Choose a style between %d - %d."), .@minstyle, .@maxstyle));
			input(.@i, .@minstyle, .@maxstyle);
			break;
		case 4:
			.@i = .@revert;
		}
	}
	end;
OnInit:
	setarray .look[0], LOOK_HAIR, LOOK_HAIR_COLOR, LOOK_CLOTHES_COLOR;

	.minstyle[LOOK_HAIR] = getbattleflag("min_hair_style");
	.maxstyle[LOOK_HAIR] = getbattleflag("max_hair_style");
	.minstyle[LOOK_HAIR_COLOR] = getbattleflag("min_hair_color");
	.maxstyle[LOOK_HAIR_COLOR] = getbattleflag("max_hair_color");
	.minstyle[LOOK_CLOTHES_COLOR] = getbattleflag("min_cloth_color");
	.maxstyle[LOOK_CLOTHES_COLOR] = getbattleflag("max_cloth_color");

	.summoner_minstyle[LOOK_HAIR] = getbattleflag("min_hair_style");
	.summoner_maxstyle[LOOK_HAIR] = getbattleflag("max_hair_style");
	.summoner_minstyle[LOOK_HAIR_COLOR] = getbattleflag("min_hair_color");
	.summoner_maxstyle[LOOK_HAIR_COLOR] = getbattleflag("max_hair_color");
	.summoner_minstyle[LOOK_CLOTHES_COLOR] = getbattleflag("min_cloth_color");
	.summoner_maxstyle[LOOK_CLOTHES_COLOR] = getbattleflag("max_cloth_color");
	end;
}