summaryrefslogtreecommitdiff
path: root/npc/merchants/cashheadgear_dye.txt
blob: 656c63de97cf6a1559f6f6472f93679cabaf8844 (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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
//================= Hercules Script =======================================
//=       _   _                     _
//=      | | | |                   | |
//=      | |_| | ___ _ __ ___ _   _| | ___  ___
//=      |  _  |/ _ \ '__/ __| | | | |/ _ \/ __|
//=      | | | |  __/ | | (__| |_| | |  __/\__ \
//=      \_| |_/\___|_|  \___|\__,_|_|\___||___/
//================= License ===============================================
//= This file is part of Hercules.
//= http://herc.ws - http://github.com/HerculesWS/Hercules
//=
//= Copyright (C) 2012-2020 Hercules Dev Team
//= Copyright (C) Xantara
//= Copyright (C) Maud_Dib
//=
//= Hercules is free software: you can redistribute it and/or modify
//= it under the terms of the GNU General Public License as published by
//= the Free Software Foundation, either version 3 of the License, or
//= (at your option) any later version.
//=
//= This program is distributed in the hope that it will be useful,
//= but WITHOUT ANY WARRANTY; without even the implied warranty of
//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//= GNU General Public License for more details.
//=
//= You should have received a copy of the GNU General Public License
//= along with this program.  If not, see <http://www.gnu.org/licenses/>.
//=========================================================================
//= Headgear Dyer (Cash)
//================= Description ===========================================
//= Change headgear's color. Cost is a Mysterious Dyestuff
//================= Current Version =======================================
//= 1.0
//=========================================================================

prt_in,253,168,4	script	Alora	4_F_LGTGIRL,{
	// Mysterious Dyestuff
	.@dyeID = 6220;
	// Headgear Choices
	setarray .@hgn$[1], "Mage Hat","Beanie","Drooping Cat","Deviruchi Hat","Wig","Ribbon","Magestic Goat";
	// Mage Hats - Normal, Yellow, Blue, Brown, Gray, Red
	setarray .@hg_1[1], 5027, 5242, 5241, 5240, 5239, 5238;
	// Beanies - Normal, Pink, Blue, Brown
	setarray .@hg_2[1], 5076, 5237, 5236, 5235;
	// Drooping Cats - Normal, Blue, Brown, Gray, Pink, Yellow
	setarray .@hg_3[1], 5058, 5233, 5231, 5230, 5232, 5234;
	// Deviruchi Hats - Normal, Red, Gray, Brown
	setarray .@hg_4[1], 5038, 5227, 5228, 5229;
	// Wigs - Happy, Shiny, Marvelous, Fantastic
	setarray .@hg_5[1], 5273, 5274, 5275, 5276;
	// Ribbons - Normal, Black, Yellow, Green, Pink, Red, Orange, White
	setarray .@hg_6[1], 2208, 5191, 5192, 5193, 5194, 5195, 5196, 5197;
	// Magestic Goats - Normal, Evolved
	setarray .@hg_7[1], 2256, 5217;

	mes "[Alora]";
	mes "Hello, I can change your headgear's color if you bring me a Mysterious Dyestuff.";
	next;
	mes "[Alora]";
	mes "Do you have a headgear that you would like to dye?";
	next;
	for(.@i = 1; .@i < getarraysize(.@hgn$); ++.@i) {
		if(.@i == 1)    .@menu$ = .@hgn$[.@i];
		else            .@menu$ += ":"+ .@hgn$[.@i];
	}
	.@menu$ += ":Cancel";
	.@t = select(.@menu$);
	if(.@t == getarraysize(.@hgn$)) {
		mes "[Alora]";
		mes "Have a good journey adventurer!";
		mes "If you ever are curious to try a new color on your Kafra headgear or the ones you found on your adventures please come to me!";
		close;
	}
	mes "[Alora]";
	mes "Okay, what color do you want to change it to?";
	next;
	for(.@i = 1; .@i < getarraysize(getd(".@hg_"+.@t+"")); ++.@i) {
		if(.@i == 1 && .@t != 5)
			.@menu$ = "Normal";
		else if(.@i == 1 && .@t == 5)
			.@menu$ = getitemname(getd(".@hg_"+.@t+"["+.@i+"]"));
		else {
			sscanf(getitemname(getd(".@hg_"+.@t+"["+.@i+"]")),"%s "+ .@hgn$[.@t],.@colour$);
			.@menu$ += ":"+ .@colour$;
		}
	}
	.@menu$ += ":Cancel";
	.@c = select(.@menu$);
	if(.@c == getarraysize(getd(".@hg_"+.@t+""))) {
		mes "[Alora]";
		mes "Oh, okay no problem!";
		close;
	}
	.@dyHG = getd(".@hg_"+.@t+"["+.@c+"]");
	mes "[Alora]";
	mes "Oh I'm so excited aren't you?";
	mes "And just to be sure, what color is the "+ .@hgn$[.@t] +" you want me to use?";
	next;
	mes "[Alora]";
	mes "Please understand that I'm going to use the ^FF00001st "+ .@hgn$[.@t] +" of that color in your inventory!^000000";
	next;
	mes "[Alora]";
	mes "Any upgrades and cards will be dissolved by the mysterious dye, so be sure you are ok with having a ^0000FF+0 "+ getitemname(.@dyHG) +" without any cards.^000000";
	next;
	mes "["+ strcharinfo(PC_NAME) +"]";
	mes "Ok, thanks for the warning, I think I'll give you my";
	next;
	.@menu$ = "Nevermind";
	for(.@i = 1; .@i < getarraysize(getd(".@hg_"+.@t+"")); ++.@i) {
		if(.@i == 1)    .@menu$ += ":Normal "+ getitemname(getd(".@hg_"+.@t+"["+.@i+"]"));
		else            .@menu$ += ":"+ getitemname(getd(".@hg_"+.@t+"["+.@i+"]"));
	}
	.@mine = select(.@menu$) - 1;
	if(!.@mine) {
		mes "[Alora]";
		mes "It's best to be very sure, have a safe journey.";
		close;
	}
	.@myHG = getd(".@hg_"+.@t+"["+.@mine+"]");
	if(.@dyHG == .@myHG) {
		mes "[Alora]";
		mes "Woah what happened?";
		close;
	}
	if(!countitem(.@dyeID) || !countitem(.@myHG)) {
		mes "[Alora]";
		mes "Oh my, you seem to be missing something.";
		close;
	}
	mes "[Alora]";
	mes "Looks great doesn't it?!";
	mes "I hope you'll come back to dye more pretty headgears!";
	delitem .@dyeID,1; // Dyestuff
	delitem .@myHG,1;  // Your headgear
	getitem .@dyHG,1;  // Dyed headgear
	close;
}