1 | //===== eAthena Script ======================================= |
---|
2 | //= Old Pharmacist |
---|
3 | //===== By: ================================================== |
---|
4 | //= DZeroX |
---|
5 | //===== Current Version: ===================================== |
---|
6 | //= 1.2 |
---|
7 | //===== Compatible With: ===================================== |
---|
8 | //= eAthena SVN Trunk |
---|
9 | //===== Description: ========================================= |
---|
10 | //= Trade in items for potions |
---|
11 | //=============================== |
---|
12 | //= Breakdown of arguments used |
---|
13 | //= arg(0): Herb required. |
---|
14 | //= arg(1): Zeny cost. |
---|
15 | //= arg(2): Potion given. |
---|
16 | //===== Additional Comments: ================================= |
---|
17 | //= 1.0 - Fully working. [DZeroX] |
---|
18 | //= 1.0a - Minor fixes [Lupus] |
---|
19 | //= 1.1 - Added changed the dialogs and name to fit the |
---|
20 | //= the official information. [DZeroX] |
---|
21 | //= 1.1a Removed .GATs [Lupus] |
---|
22 | //= 1.1b Fixed a bug in Orange Potion creating. Copy&Pasting = bad. [L0ne_W0lf] |
---|
23 | //= 1.2 Added checkweight, and input min/max values. [L0ne_W0lf] |
---|
24 | //============================================================ |
---|
25 | |
---|
26 | alberta_in,16,28,4 script Old Pharmacist 61,{ |
---|
27 | if (checkweight(1201,1) == 0) { |
---|
28 | mes "- Wait a moment! -"; |
---|
29 | mes "- Currently you're carrying -"; |
---|
30 | mes "- too many items with you. -"; |
---|
31 | mes "- Please come back later -"; |
---|
32 | mes "- after you put some items into kafra storage. -"; |
---|
33 | close; |
---|
34 | } |
---|
35 | mes "[Old Pharmacist]"; |
---|
36 | mes "Err....Are you a customer...?"; |
---|
37 | switch(select("Make Potion","Talk.","Instruction of making potions","Cancel")) { |
---|
38 | case 1: |
---|
39 | next; |
---|
40 | set .@weight,MaxWeight-Weight; |
---|
41 | if ((.@weight) < 10000) { |
---|
42 | mes "[Old Pharmacist]"; |
---|
43 | mes "Why are you carrying these so many!"; |
---|
44 | mes "Don't be greedy, carry only as much you need!"; |
---|
45 | next; |
---|
46 | mes "[Old Pharmacist]"; |
---|
47 | mes "You are too heavy to receive potions from me..."; |
---|
48 | mes "Go store some items in your storage first!"; |
---|
49 | close; |
---|
50 | } else { |
---|
51 | mes "[Old Pharmacist]"; |
---|
52 | mes "You have all the stuff ready, right? Which one would you like?"; |
---|
53 | switch(select("Red Potion.","Orange Potion.","Yellow Potion.","White Potion.","Blue Potion.","Green Potion.","Actually, I don't want anything.")) { |
---|
54 | case 1: |
---|
55 | callsub L_making,507,3,501; |
---|
56 | case 2: |
---|
57 | next; |
---|
58 | mes "[Old Pharmacist]"; |
---|
59 | if (countitem(507) < countitem(713)) { |
---|
60 | set .@max,countitem(507); |
---|
61 | } |
---|
62 | if (countitem(508) < countitem(713)) { |
---|
63 | set .@max,countitem(508); |
---|
64 | } else { |
---|
65 | set .@max,countitem(713); |
---|
66 | } |
---|
67 | if ((countitem(507) < 1) || (countitem(508) < 1) || (countitem(713) == 0)) { |
---|
68 | mes "You rascal! What did you expect?! Coming here with nothing. Tsk!"; |
---|
69 | mes "Get lost!"; |
---|
70 | close; |
---|
71 | } |
---|
72 | if (Zeny < 3) { |
---|
73 | mes "You rascal! What did you expect?! Coming here with nothing. Tsk!"; |
---|
74 | mes "Get lost!"; |
---|
75 | close; |
---|
76 | } |
---|
77 | mes "How many?"; |
---|
78 | switch(select("Make as many as I can.","I want to choose an amount.","Actually, I don't want anything.")) { |
---|
79 | case 1: |
---|
80 | next; |
---|
81 | if ((countitem(507) < .@max) || (countitem(508) < .@max) || (countitem(713) < .@max) || (Zeny < .@max*3)) { |
---|
82 | mes "[Old Pharmacist]"; |
---|
83 | mes "You rascal! You don't even have all the materials and you want me to make you potions?!"; |
---|
84 | close; |
---|
85 | } |
---|
86 | set Zeny,Zeny-(.@max*5); |
---|
87 | delitem 507,.@max; |
---|
88 | delitem 508,.@max; |
---|
89 | delitem 713,.@max; |
---|
90 | getitem 502,.@max; |
---|
91 | mes "[Old Pharmacist]"; |
---|
92 | mes "Here. Take them."; |
---|
93 | mes "Here you go. It's all done so you can take it. But remember! Abusing medicine is not good."; |
---|
94 | close; |
---|
95 | case 2: |
---|
96 | next; |
---|
97 | mes "[Old Pharmacist]"; |
---|
98 | 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."; |
---|
99 | input .@amount,0,101; |
---|
100 | if (.@amount == 0) { |
---|
101 | next; |
---|
102 | mes "[Old Pharmacist]"; |
---|
103 | mes "Make up your mind, will you?!"; |
---|
104 | close; |
---|
105 | } |
---|
106 | if (.@amount > 100) { |
---|
107 | next; |
---|
108 | mes "[Old Pharmacist]"; |
---|
109 | mes "Are you deaf? I said less than 100!"; |
---|
110 | close; |
---|
111 | } |
---|
112 | if ((countitem(507) < .@amount) || (countitem(508) < .@amount) || (countitem(713) < .@amount) || (Zeny < .@amount*3)) { |
---|
113 | next; |
---|
114 | mes "[Old Pharmacist]"; |
---|
115 | mes "You rascal! You don't even have all the materials and you want me to make you potions?!"; |
---|
116 | close; |
---|
117 | } |
---|
118 | next; |
---|
119 | set Zeny,Zeny-(.@amount*5); |
---|
120 | delitem 507,.@amount; |
---|
121 | delitem 508,.@amount; |
---|
122 | delitem 713,.@amount; |
---|
123 | getitem 502,.@amount; |
---|
124 | mes "[Old Pharmacist]"; |
---|
125 | mes "Here you go. It's all done so you can take it. But remember! Abusing medicine is not good."; |
---|
126 | close; |
---|
127 | case 3: |
---|
128 | next; |
---|
129 | mes "[Old Pharmacist]"; |
---|
130 | mes "What?!"; |
---|
131 | mes "Grrr..."; |
---|
132 | mes "Bleh!"; |
---|
133 | mes "Get lost!"; |
---|
134 | close; |
---|
135 | } |
---|
136 | case 3: |
---|
137 | callsub L_making,508,10,503; |
---|
138 | case 4: |
---|
139 | callsub L_making,509,20,504; |
---|
140 | case 5: |
---|
141 | callsub L_making,510,30,505; |
---|
142 | case 6: |
---|
143 | callsub L_making,511,3,506; |
---|
144 | case 7: |
---|
145 | mes "[Old Pharmacist]"; |
---|
146 | mes "What?!"; |
---|
147 | mes "Grrr..."; |
---|
148 | mes "Bleh!"; |
---|
149 | mes "Get lost!"; |
---|
150 | close; |
---|
151 | } |
---|
152 | } |
---|
153 | case 2: |
---|
154 | mes "[Old Pharmacist]"; |
---|
155 | 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."; |
---|
156 | next; |
---|
157 | mes "[Old Pharmacist]"; |
---|
158 | mes "Anyways, a potion is merely a potion. Nothing more and nothing less."; |
---|
159 | close; |
---|
160 | case 3: |
---|
161 | mes "[Old Pharmacist]"; |
---|
162 | mes "Hrrrmm..."; |
---|
163 | mes "You young ones can be quite annoying. But, since you asked, I'll explain."; |
---|
164 | next; |
---|
165 | mes "[Old Pharmacist]"; |
---|
166 | 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."; |
---|
167 | next; |
---|
168 | mes "[Old Pharmacist]"; |
---|
169 | 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."; |
---|
170 | next; |
---|
171 | mes "[Old Pharmacist]"; |
---|
172 | mes "Red Potion - ^0098E52 Red Herbs, 1 Empty Bottle, 2 zeny fee.^000000"; |
---|
173 | mes "Orange Potion - ^0098E51 Red Herb, 1 Yellow Herb, 1 Empty Bottle, 5 zeny fee.^000000"; |
---|
174 | mes "Yellow Potion - ^0098E52 Yellow Herbs, 1 Empty Bottle, 10 zeny.^000000"; |
---|
175 | next; |
---|
176 | mes "[Old Pharmacist]"; |
---|
177 | mes "White Potion - ^0098E52 White Herbs, 1 Empty Bottle, 20 zeny fee.^000000"; |
---|
178 | mes "Blue Potion - ^0098E52 Blue Herbs, 1 Empty Bottle, 30 zeny fee.^000000"; |
---|
179 | mes "Green Potion - ^0098E52 Green Herbs, 1 Empty Bottle, 3 zeny fee.^000000"; |
---|
180 | close; |
---|
181 | case 4: |
---|
182 | mes "[Old Pharmacist]"; |
---|
183 | mes "What a boring person. If you have something to say, why don't you say it?!"; |
---|
184 | close; |
---|
185 | } |
---|
186 | |
---|
187 | L_making: |
---|
188 | next; |
---|
189 | mes "[Old Pharmacist]"; |
---|
190 | if ((countitem(getarg(0))/2) < countitem(713)) { |
---|
191 | set .@max,countitem(getarg(0))/2; |
---|
192 | } else { |
---|
193 | set .@max,countitem(713); |
---|
194 | } |
---|
195 | if ((countitem(getarg(0)) < 2) || (countitem(713) == 0)) { |
---|
196 | mes "You rascal! What did you expect?! Coming here with nothing. Tsk!"; |
---|
197 | mes "Get lost!"; |
---|
198 | close; |
---|
199 | } |
---|
200 | if (Zeny < 3) { |
---|
201 | mes "You rascal! What did you expect?! Coming here with nothing. Tsk!"; |
---|
202 | mes "Get lost!"; |
---|
203 | close; |
---|
204 | } |
---|
205 | mes "How many?"; |
---|
206 | switch(select("Make as many as I can.","I want to choose an amount.","Actually, I don't want anything.")) { |
---|
207 | case 1: |
---|
208 | next; |
---|
209 | if ((countitem(getarg(0)) < .@max*2) || (countitem(713) < .@max) || (Zeny < .@max*getarg(1))) { |
---|
210 | mes "[Old Pharmacist]"; |
---|
211 | mes "You rascal! You don't even have all the materials and you want me to make you potions?!"; |
---|
212 | close; |
---|
213 | } |
---|
214 | set Zeny,Zeny-(.@max*getarg(1)); |
---|
215 | delitem getarg(0),.@max*2; |
---|
216 | delitem 713,.@max; |
---|
217 | getitem getarg(2),.@max; |
---|
218 | mes "[Old Pharmacist]"; |
---|
219 | mes "Here. Take them."; |
---|
220 | mes "Here you go. It's all done so you can take it. But remember! Abusing medicine is not good."; |
---|
221 | close; |
---|
222 | case 2: |
---|
223 | next; |
---|
224 | mes "[Old Pharmacist]"; |
---|
225 | 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."; |
---|
226 | input .@amount; |
---|
227 | if (.@amount == 0) { |
---|
228 | next; |
---|
229 | mes "[Old Pharmacist]"; |
---|
230 | mes "Make up your mind, will you?!"; |
---|
231 | close; |
---|
232 | } |
---|
233 | if (.@amount > 100) { |
---|
234 | next; |
---|
235 | mes "[Old Pharmacist]"; |
---|
236 | mes "Are you deaf? I said less than 100!"; |
---|
237 | close; |
---|
238 | } |
---|
239 | if ((countitem(getarg(0)) < .@amount*2) || (countitem(713) < .@amount) || (Zeny < .@amount*getarg(1))) { |
---|
240 | next; |
---|
241 | mes "[Old Pharmacist]"; |
---|
242 | mes "You rascal! You don't even have all the materials and you want me to make you potions?!"; |
---|
243 | close; |
---|
244 | } |
---|
245 | next; |
---|
246 | set Zeny,Zeny-(.@amount*getarg(1)); |
---|
247 | delitem getarg(0),.@amount*2; |
---|
248 | delitem 713,.@amount; |
---|
249 | getitem getarg(2),.@amount; |
---|
250 | mes "[Old Pharmacist]"; |
---|
251 | mes "Here you go. It's all done so you can take it. But remember! Abusing medicine is not good."; |
---|
252 | close; |
---|
253 | case 3: |
---|
254 | next; |
---|
255 | mes "[Old Pharmacist]"; |
---|
256 | mes "What?!"; |
---|
257 | mes "Grrr..."; |
---|
258 | mes "Bleh!"; |
---|
259 | mes "Get lost!"; |
---|
260 | close; |
---|
261 | } |
---|
262 | } |
---|