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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
|
//================= 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) Kisuka
//= Copyright (C) L0ne_W0lf
//= Copyright (C) Lupus
//= Copyright (C) DZeroX
//=
//= 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/>.
//=========================================================================
//= Old Pharmacist
//================= Description ===========================================
//= Trade in items for potions.
//================= Current Version =======================================
//= 1.4
//=========================================================================
alberta_in,16,28,4 script Pharmacist 1_M_PUBMASTER,{
if (checkweight(Knife,1) == 0) {
mes "- Wait a moment! -";
mes "- Currently you're carrying -";
mes "- too many items with you. -";
mes "- Please come back later -";
mes "- after you put some items into kafra storage. -";
close;
}
mes "[Old Pharmacist]";
mes "Ummmm...";
mes "What brings you here...?";
switch(select("Make Potion", "Talk.", "Mixing Information", "Cancel")) {
case 1:
next;
if (MaxWeight - Weight < 5000) {
mes "[Old Pharmacist]";
mes "Why are you carrying these so many!";
mes "Don't be greedy, carry only as much you need!";
next;
mes "[Old Pharmacist]";
mes "You are too heavy to receive potions from me...";
mes "Go store some items in your storage first!";
close;
} else {
mes "[Old Pharmacist]";
mes "You have all the stuff ready, right? Which one would you like?";
switch(select("Red Potion.", "Orange Potion.", "Yellow Potion.", "White Potion.", "Blue Potion.", "Green Potion.", "Actually, I don't want anything.")) {
case 1:
callsub L_Making,507,3,501;
case 2:
next;
mes "[Old Pharmacist]";
if (countitem(Red_Herb) < countitem(Empty_Bottle)) {
.@max = countitem(Red_Herb);
}
else if (countitem(Yellow_Herb) < countitem(Empty_Bottle)) {
.@max = countitem(Yellow_Herb);
}
else {
.@max = countitem(Empty_Bottle);
}
if ((countitem(Red_Herb) < 1) || (countitem(Yellow_Herb) < 1) || (countitem(Empty_Bottle) == 0)) {
mes "You rascal! What did you expect?! Coming here with nothing. Tsk!";
mes "Get lost!";
close;
}
if (Zeny < 3) {
mes "You rascal! What did you expect?! Coming here with nothing. Tsk!";
mes "Get lost!";
close;
}
mes "How many?";
switch(select("Make as many as I can.", "I want to choose an amount.", "Actually, I don't want anything.")) {
case 1:
next;
if ((countitem(Red_Herb) < .@max) || (countitem(Yellow_Herb) < .@max) || (countitem(Empty_Bottle) < .@max) || (Zeny < .@max*3)) {
mes "[Old Pharmacist]";
mes "You rascal! You don't even have all the materials and you want me to make you potions?!";
close;
}
Zeny -= (.@max*5);
delitem Red_Herb,.@max;
delitem Yellow_Herb,.@max;
delitem Empty_Bottle,.@max;
getitem Orange_Potion,.@max;
break;
case 2:
next;
mes "[Old Pharmacist]";
mes "Then pick a number below 100. If you don't want any, just enter '0'. With the materials you have, you can make about "+.@max+" potions.";
input(.@amount);
if (.@amount <= 0) {
next;
mes "[Old Pharmacist]";
mes "Make up your mind, will you?!";
close;
}
if (.@amount > 100) {
next;
mes "[Old Pharmacist]";
mes "Are you deaf? I said less than 100!";
close;
}
if ((countitem(Red_Herb) < .@amount) || (countitem(Yellow_Herb) < .@amount) || (countitem(Empty_Bottle) < .@amount) || (Zeny < .@amount*3)) {
next;
mes "[Old Pharmacist]";
mes "You rascal! You don't even have all the materials and you want me to make you potions?!";
close;
}
next;
Zeny -= (.@amount*5);
delitem Red_Herb,.@amount;
delitem Yellow_Herb,.@amount;
delitem Empty_Bottle,.@amount;
getitem Orange_Potion,.@amount;
break;
case 3:
next;
mes "[Old Pharmacist]";
mes "What?!";
mes "Grrr...";
mes "Bleh!";
mes "Get lost!";
close;
}
mes "[Old Pharmacist]";
mes "Here you go. It's all done so you can take it. But remember! Abusing medicine is not good.";
close;
case 3:
callsub L_Making,508,10,503;
case 4:
callsub L_Making,509,20,504;
case 5:
callsub L_Making,510,30,505;
case 6:
callsub L_Making,511,3,506;
case 7:
mes "[Old Pharmacist]";
mes "What?!";
mes "Grrr...";
mes "Bleh!";
mes "Get lost!";
close;
}
}
case 2:
mes "[Old Pharmacist]";
mes "With medicine, you can increase a person's ability to regenerate. But, they're only good up to a point. *Sigh* I'm starting to think of the days when I was young. I must be getting old.";
next;
mes "[Old Pharmacist]";
mes "Anyways, a potion is merely a potion. Nothing more and nothing less.";
close;
case 3:
mes "[Old Pharmacist]";
mes "Hrrrmm...";
mes "You young ones can be quite annoying. But, since you asked, I'll explain.";
next;
mes "[Old Pharmacist]";
mes "Herbs work well by themselves, but if you use my special techniques and skills to make potions out of them, the effect is much much greater.";
next;
mes "[Old Pharmacist]";
mes "If you ask eagerly and politely, I will make them for you. But, not for free... Don't worry though, I only charge a small fee, so it's not that expensive.";
next;
mes "[Old Pharmacist]";
mes "Red Potion - ^0098E52 Red Herbs, 1 Empty Bottle, 2 zeny fee.^000000";
mes "Orange Potion - ^0098E51 Red Herb, 1 Yellow Herb, 1 Empty Bottle, 5 zeny fee.^000000";
mes "Yellow Potion - ^0098E52 Yellow Herbs, 1 Empty Bottle, 10 zeny.^000000";
next;
mes "[Old Pharmacist]";
mes "White Potion - ^0098E52 White Herbs, 1 Empty Bottle, 20 zeny fee.^000000";
mes "Blue Potion - ^0098E52 Blue Herbs, 1 Empty Bottle, 30 zeny fee.^000000";
mes "Green Potion - ^0098E52 Green Herbs, 1 Empty Bottle, 3 zeny fee.^000000";
close;
case 4:
mes "[Old Pharmacist]";
mes "What a boring person. If you have something to say, why don't you say it?!";
close;
}
// Arguments:
// - 0: Herb required.
// - 1: Zeny cost.
// - 2: Potion given.
L_Making:
next;
mes "[Old Pharmacist]";
if ((countitem(getarg(0))/2) < countitem(Empty_Bottle)) {
.@max = countitem(getarg(0))/2;
} else {
.@max = countitem(Empty_Bottle);
}
if ((countitem(getarg(0)) < 2) || (countitem(Empty_Bottle) == 0)) {
mes "You rascal! What did you expect?! Coming here with nothing. Tsk!";
mes "Get lost!";
close;
}
if (Zeny < 3) {
mes "You rascal! What did you expect?! Coming here with nothing. Tsk!";
mes "Get lost!";
close;
}
mes "How many?";
switch(select("Make as many as I can.", "I want to choose an amount.", "Actually, I don't want anything.")) {
case 1:
next;
if ((countitem(getarg(0)) < .@max*2) || (countitem(Empty_Bottle) < .@max) || (Zeny < .@max*getarg(1))) {
mes "[Old Pharmacist]";
mes "You rascal! You don't even have all the materials and you want me to make you potions?!";
close;
}
Zeny -= (.@max*getarg(1));
delitem getarg(0),.@max*2;
delitem Empty_Bottle,.@max;
getitem getarg(2),.@max;
break;
case 2:
next;
mes "[Old Pharmacist]";
mes "Then pick a number below 100. If you don't want any, just enter '0'. With the materials you have, you can make about "+.@max+" potions.";
input(.@amount);
next;
if (.@amount <= 0) {
mes "[Old Pharmacist]";
mes "Make up your mind, will you?!";
close;
}
if (.@amount > 100) {
mes "[Old Pharmacist]";
mes "Are you deaf? I said less than 100!";
close;
}
if ((countitem(getarg(0)) < .@amount*2) || (countitem(Empty_Bottle) < .@amount) || (Zeny < .@amount*getarg(1))) {
mes "[Old Pharmacist]";
mes "You rascal! You don't even have all the materials and you want me to make you potions?!";
close;
}
Zeny -= (.@amount*getarg(1));
delitem getarg(0),.@amount*2;
delitem Empty_Bottle,.@amount;
getitem getarg(2),.@amount;
break;
case 3:
next;
mes "[Old Pharmacist]";
mes "What?!";
mes "Grrr...";
mes "Bleh!";
mes "Get lost!";
close;
}
mes "[Old Pharmacist]";
mes "Here you go. It's all done so you can take it. But remember! Abusing medicine is not good.";
close;
}
|