OSDN Git Service

First version
[st-ro/stro.git] / npc / pre-re / jobs / 1-1 / merchant.txt
1 //===== rAthena Script ======================================= 
2 //= Merchant Job Quest
3 //===== By: ================================================== 
4 //= kobra_k88; L0ne_W0lf
5 //===== Current Version: ===================================== 
6 //= 2.4
7 //===== Compatible With: ===================================== 
8 //= rAthena Project
9 //===== Description: ========================================= 
10 //= [Official Conversion]
11 //= Job quest for Merchant classes
12 //===== Additional Comments: ================================= 
13 //= 1.0 Fully working.
14 //= 1.1 Added instant job change for High Novice [Lupus]
15 //= 1.3 Added Baby Class support [Lupus]
16 //= 1.4 Optimised and moved first checker to Jfunc1-1 [massdriller]
17 //= 1.5 Changed Prontera->Izlude teleport price to 600 [Lupus]
18 //= 1.5.1 Removed Duplicates [Silent]
19 //= 1.5.2 Now saves/restores all quest skills [Lupus]
20 //= 1.6 Merged back JFunc, CHANGED NUMBERS TO CONSTANTS [Lupus]
21 //= 1.7 Updated to use Free Ticket for Kafra [Lupus]
22 //= 1.8 Rescripted to Aegis 10.3 stadards. [L0ne_W0lf]
23 //=     No longer uses function "F_ToHigh"
24 //= 1.9 Bugfixes, thanks to Barron-Monster. [L0ne_W0lf]
25 //= 1.9a Added a missing next; (Barron-Monster) [L0ne_W0lf]
26 //= 1.9b Typo. "nextl" -> "next;" (Barron-Monster) [L0ne_W0lf]
27 //= 2.0 Should "fix" the problem with the Biliban Kafra. [L0ne_W0lf]
28 //= 2.1 Fixed mistake in condition check. [L0ne_W0lf]
29 //= 2.2 Added Quest Log commands. [L0ne_W0lf]
30 //= 2.3 Fixed an issue with completequest by adding checkquest. [Kisuka]
31 //= 2.4 Quest log fixes. [Euphy]
32 //============================================================ 
33
34 alberta_in,53,43,6      script  Merchant#mer    86,{
35         if (Upper == 1) {
36                 if (Class == Job_Novice_High && (ADVJOB == Job_Whitesmith || ADVJOB == Job_Creator)) {
37                         mes "[Chief Mahnsoo]";
38                         mes "Long time no see!";
39                         mes "Hey, you didn't quit";
40                         mes "your business, did you?";
41                         mes "What happened?";
42                         next;
43                         mes "[Chief Mahnsoo]";
44                         mes "Whoa...";
45                         mes "You've actually been to Valhalla?! Wow, you've come a long way...";
46                         next;
47                         if (!callfunc("F_CanChangeJob")) {
48                                 mes "[Chief Mahnsoo]";
49                                 mes "Hmmm...";
50                                 mes "It seems that you're not ready to become a Merchant again. Go finish learning the Basic Novice Skills first.";
51                                 next;
52                                 mes "[Chief Mahnsoo]";
53                                 mes "Don't worry, we'll always have a Merchant position open for you. Just come back when you're ready, okay?";
54                                 close;
55                         }
56                         mes "[Chief Mahnsoo]";
57                         mes "I guess it's destiny that we meet like this once more. Alright. Once again, let me change you into a Merchant!";
58                         next;
59                         skill "NV_TRICKDEAD",0,SKILL_PERM;
60                         jobchange Job_Merchant_High;
61                         skill "MC_CARTREVOLUTION",1,SKILL_PERM;
62                         skill "MC_CHANGECART",1,SKILL_PERM;
63                         skill "MC_LOUD",1,SKILL_PERM;
64                         mes "[Chief Mahnsoo]";
65                         mes "Ah~ How nostalgic. Just like old times! Alright, do your best!";
66                         close;
67                 }
68                 else {
69                         mes "[Chief Mahnsoo]";
70                         mes "^333333*Sigh*^000000";
71                         mes "I'm so bored...";
72                         mes "When will I hear from my lovely Blossom?";
73                         close;
74                 }
75         }
76         if (BaseJob == Job_Merchant) {
77                 mes "[Chief Mahnsoo]";
78                 mes "Hello there!";
79                 mes "How do you like";
80                 mes "being a Merchant?";
81                 next;
82                 mes "[Chief Mahnsoo]";
83                 mes "Having a way with";
84                 mes "money certainly";
85                 mes "has its perks,";
86                 mes "does it not?";
87                 close;
88         }
89         else if (BaseJob != Job_Merchant && BaseJob != Job_Novice) {
90                 mes "[Chief Mahnsoo]";
91                 mes "We Merchants hate people who are two faced. It's bad for business.";
92                 next;
93                 mes "[Chief Mahnsoo]";
94                 mes "People who always try to take advantage of other people by selling things at a ridiculous price just so they can make money that they'll waste are the worst.";
95                 next;
96                 mes "[Chief Mahnsoo]";
97                 mes "Well, in any case, we only accept Novices for job changes to the Merchant class. But I appreciate your interest in what we do.";
98                 close;
99         }
100         else if (job_merchant_q == 9) {
101                 mes "[Chief Mahnsoo]";
102                 mes "Hello there,";
103                 mes ""+ strcharinfo(0) +".";
104                 set job_merchant_q,0;
105                 set job_merchant_q2,0;
106                 set quest_alb_01,0;
107                 mes "Unfortunately, you failed to earn your Merchant License this time.";
108                 next;
109                 mes "[Chief Mahnsoo]";
110                 mes "I'll erase your records, so come back anytime when you want to reapply.";
111                 close;
112         }
113         else if (job_merchant_q == 8 || job_merchant_q == 7) {
114                 mes "[Chief Mahnsoo]";
115                 mes "Hello there,";
116                 mes ""+ strcharinfo(0) +".";
117                 mes "I'm pleased to tell you";
118                 mes "that I have good news!";
119                 next;
120                 mes "[Chief Mahnsoo]";
121                 mes "The Merchant Guild accepted your application. You've proven that you are fully qualified to become a Merchant.";
122                 if (job_merchant_q == 7) {
123                         next;
124                         mes "[Chief Mahnsoo]";
125                         mes "The only thing to take care of is your Membership Fee.";
126                         mes "Are you ready?";
127                         next;
128                         switch(select("Pay the rest of the 500 Zeny:Quit")) {
129                         case 1:
130                                 mes "[Chief Mahnsoo]";
131                                 if (Zeny < 500) {
132                                         mes "Hmmm...";
133                                         mes "I suppose you currently don't have enough zeny to pay the rest of your Membership fee right now.";
134                                         next;
135                                         mes "[Chief Mahnsoo]";
136                                         mes "Please return when you have earned the 500 zeny that you need to become a Merchant.";
137                                         close;
138                                 }
139                                 set Zeny, Zeny-500;
140                                 mes "Ah yes...!";
141                                 mes "Now your";
142                                 mes "membership";
143                                 mes "is paid in full.";
144                                 break;
145                         case 2:
146                                 mes "[Chief Mahnsoo]";
147                                 mes "I suppose you need some time to gather some zeny to pay your membership fee. Please come";
148                                 mes "back as soon as you're ready.";
149                                 close;
150                         }
151                 }
152                 next;
153                 mes "[Chief Mahnsoo]";
154                 mes "Congratulations!";
155                 callfunc "Job_Change",Job_Merchant;
156                 callfunc "F_ClearJobVar";
157                 for ( .@quest_id = 1009; .@quest_id <= 1012; .@quest_id++ ) {
158                         if (isbegin_quest(.@quest_id) == 1)
159                                 completequest .@quest_id;
160                 }
161                 mes "I'm very pleased that you are joining the Merchant Guild and hope that you will play an active part in Rune-Midgarts' economy.";
162                 next;
163                 if (quest_alb_01 == 1) {
164                         mes "[Chief Mahnsoo]";
165                         mes "*Ahem* Aaaaand let me give you a little bit of money for delivering that message to Blossom for me.";
166                         mes "I hope you'll help me again next time~";
167                         set Zeny, Zeny+200;
168                         set quest_alb_01,2;
169                 }
170                 else {
171                         mes "[Chief Mahnsoo]";
172                         mes "The message you were supposed to deliver as per my request? You've forgotten about that? Oh well. Good work!";
173                 }
174                 next;
175                 mes "[Chief Mahnsoo]";
176                 mes "Our goal is to control 20 % of the world's income! We're going to need young, eager people like you!";
177                 next;
178                 mes "[Chief Mahnsoo]";
179                 mes "But overall, we'll also be happy just to make loads of money.";
180                 mes "But we all know that~";
181                 close;
182         }
183         else if (job_merchant_q <= 6 && job_merchant_q != 0) {
184                 mes "[Chief Mahnsoo]";
185                 if (job_merchant_q2 == 1 || job_merchant_q2 == 2) {
186                         mes "First, get the delivery package from the storehouse, and then take it to the former Swordman's Association in Prontera.";
187                         next;
188                         mes "[Chief Mahnsoo]";
189                         mes "When you get there, give the package to the Kafra Employee stationed near there. Her name is Blossom. Did you get all that?";
190                         next;
191                         if (job_merchant_q2 == 1) {
192                                 mes "[Chief Mahnsoo]";
193                                 mes "Remember, the Serial Number of the package is ^3355FF2485741^000000.";
194                         }
195                         else {
196                                 mes "[Chief Mahnsoo]";
197                                 mes "Remember, the Serial Number of the package is ^3355FF2328137^000000.";
198                         }
199                 }
200                 else if (job_merchant_q2 == 3 || job_merchant_q2 == 4) {
201                         mes "First, get the delivery package from the storehouse, and then take it to the Mage Guild in Geffen.";
202                         next;
203                         if (job_merchant_q2 == 3) {
204                                 mes "[Chief Mahnsoo]";
205                                 mes "When you get there, give the package to the Mage Guildsman in charge. Remember, the packages Serial Number is ^3355FF2989396^000000.";
206                         }
207                         else {
208                                 mes "[Chief Mahnsoo]";
209                                 mes "When you get there, give the package to the Mage Guildsman in charge. Remember, the packages Serial Number is ^3355FF2191737^000000.";
210                         }
211                 }
212                 else if (job_merchant_q2 == 5 || job_merchant_q2 == 6) {
213                         mes "First, get the delivery package from the storehouse, and then take it to Morroc.";
214                         next;
215                         mes "[Chief Mahnsoo]";
216                         mes "You'll have to find Java Dullihan, the Dyemaker, so that you can deliver the product he ordered.";
217                         next;
218                         if (job_merchant_q2 == 5) {
219                                 mes "[Chief Mahnsoo]";
220                                 mes "But he's a little forgetful, so give it to one of his students. Remember, the package's Serial Number is ^3355FF3012685^000000.";
221                         }
222                         else {
223                                 mes "[Chief Mahnsoo]";
224                                 mes "But he's a little forgetful, give it to one of his students. Remember, the package's Serial Number is ^3355FF3487372^000000.";
225                         }
226                 }
227                 else if (job_merchant_q2 == 7 || job_merchant_q2 == 8) {
228                         mes "First, get the package from the storehouse, and then give it to the Kafra Employee stationed on Byalan Island. Her name is Blossom.";
229                         next;
230                         if (job_merchant_q2 == 7) {
231                                 mes "[Chief Mahnsoo]";
232                                 mes "Remember, the package's Serial Number is ^3355FF3318702^000000.";
233                         }
234                         else {
235                                 mes "[Chief Mahnsoo]";
236                                 mes "Remember, the package's Serial Number is ^3355FF3543625^000000.";
237                         }
238                 }
239                 if (job_merchant_q2 == 7 || job_merchant_q2 == 8) {
240                         next;
241                         mes "[Chief Mahnsoo]";
242                         mes "Aaaannnnd...";
243                         mes "Don't forget to deliver that message for me~";
244                 }
245                 next;
246                 mes "[Chief Mahnsoo]";
247                 mes "Don't forget your destination and the package's Serial Number.";
248                 mes "You'll need to tell them";
249                 mes "to the storekeeper.";
250                 next;
251                 mes "[Chief Mahnsoo]";
252                 mes "The storehouse is in the room";
253                 mes "to my right. There, you can talk";
254                 mes "to the storekeeper, and he'll";
255                 mes "help you out.";
256                 next;
257                 mes "[Chief Mahnsoo]";
258                 mes "After you make the delivery, return to the storehouse and give the receipt to the storekeeper.";
259                 mes "Then, come back";
260                 mes "and see me.";
261                 next;
262                 mes "[Chief Mahnsoo]";
263                 mes "Is that clear?";
264                 mes "Alright, that's";
265                 mes "the spirit.";
266                 mes "Take care!";
267                 close;
268         }
269         else if (job_merchant_q == 0) {
270                 mes "[Chief Mahnsoo]";
271                 mes "So, what brings you to";
272                 mes "the Merchant Association?";
273                 mes "Is there anything";
274                 mes "I can help you with?";
275                 next;
276                 switch(select("I want to be a Merchant.:Tell me about Merchants.:Tell me the requirements.:Nope.")) {
277                 case 1:
278                         mes "[Chief Mahnsoo]";
279                         mes "Do you want to";
280                         mes "be a Merchant?";
281                         mes "Well...";
282                         next;
283                         if (!callfunc("F_CanChangeJob")) {
284                                 mes "[Chief Mahnsoo]";
285                                 mes "First, you have to be a Novice with Job Level 10. Once you do that, make sure you learn all of the Basic Skills.";
286                                 next;
287                                 mes "[Chief Mahnsoo]";
288                                 mes "We're not just";
289                                 mes "simple money makers!";
290                                 mes "We pride ourselves on having standards and only accepting qualified applicants!";
291                                 close;
292                         }
293                         mes "[Chief Mahnsoo]";
294                         mes "Alright, you'll need to fill out this application and prepare 1,000 Zeny for your Membership Fee.";
295                         next;
296                         mes "[Chief Mahnsoo]";
297                         mes "Oh...!";
298                         mes "If you don't have all the money,";
299                         mes "I can just take 500 Zeny now.";
300                         mes "You can pay the rest after you";
301                         mes "pass the test and earn your";
302                         mes "Merchant Guild License.";
303                         next;
304                         mes "[Chief Mahnsoo]";
305                         mes "So what do you think?";
306                         mes "Are you ready to join now?";
307                         next;
308                         if (select("Yes, I will.:Ummm, maybe later...") ==1 ) {
309                                 mes "[Chief Mahnsoo]";
310                                 mes "Let me check if you";
311                                 mes "filled out everything";
312                                 mes "on your application form...";
313                                 next;
314                                 mes "[Chief Mahnsoo]";
315                                 mes "Hmm... ";
316                                 mes "" + strcharinfo(0) + "...";
317                                 mes "That's a nice name.";
318                                 next;
319                                 mes "[Chief Mahnsoo]";
320                                 mes "This application will";
321                                 mes "only be registered once";
322                                 mes "the Membership Fee is paid.";
323                                 mes "How do you wish to";
324                                 mes "handle the fee?";
325                                 next;
326                                 switch(select("Pay all 1,000 Zeny now!:Two payments of 500 Zeny.:Quit")) {
327                                 case 1:
328                                         mes "[Chief Mahnsoo]";
329                                         if (Zeny >= 1000) {
330                                                 set job_merchant_q,2;
331                                                 set Zeny, Zeny-1000;
332                                                 mes "Alright~";
333                                                 mes "That's 1,000 zeny.";
334                                                 mes "Excellent, excellent.";
335                                         }
336                                         else {
337                                                 mes "It seems don't have enough zeny to pay all of the fee right now. Why don't you just pay 500 zeny now? Think about it.";
338                                                 close;
339                                         }
340                                         break;
341                                 case 2:
342                                         mes "[Chief Mahnsoo]";
343                                         if (Zeny >= 500) {
344                                                 set job_merchant_q,1;
345                                                 set Zeny, Zeny-500;
346                                                 mes "Let's see...";
347                                                 mes "That's 500 Zeny. Although I don't think splitting payment is a good idea for any Merchant, it's alright since you're still learning.";
348                                         }
349                                         else {
350                                                 mes "Hmm...";
351                                                 mes "It seems you don't have the funds to pay half of the membership fee. Please come back once you collect the zeny that you need.";
352                                                 close;
353                                         }
354                                         break;
355                                 case 3:
356                                         mes "[Chief Mahnsoo]";
357                                         mes "Feel free to return anytime";
358                                         mes "when you are ready, alright?";
359                                         close;
360                                 }
361                         }
362                         else {
363                                 mes "[Chief Mahnsoo]";
364                                 mes "You don't have enough zeny now? That's no problem. Take your time and come back when you're";
365                                 mes "ready, okay?";
366                                 close;
367                         }
368                         next;
369                         mes "[Chief Mahnsoo]";
370                         mes "Alright, you're now on the list of applicants. Ah, before I get started let me say just one thing.";
371                         next;
372                         mes "[Chief Mahnsoo]";
373                         mes "There are some dumb and greedy people out there who do not know what it means to be a Merchant.";
374                         mes "I hope you won't turn out to be like them, will you?";
375                         next;
376                         mes "[Chief Mahnsoo]";
377                         mes "Now, let me";
378                         mes "explain what you";
379                         mes "need to do for the";
380                         mes "Merchant License Test.";
381                         next;
382                         mes "[Chief Mahnsoo]";
383                         switch(rand(1,4)) {
384                         case 1:
385                                 mes "First, get the delivery package from the storehouse, then go to the former Swordman's Association in Prontera.";
386                                 next;
387                                 mes "[Chief Mahnsoo]";
388                                 mes "When you get there, visit the Kafra Employee stationed there. Her name is Blossom. Did you get";
389                                 mes "all of that?";
390                                 callsub S_GiveSerial,2485741,1,2328137,2,1009;
391                                 break;
392                         case 2:
393                                 mes "First, get the delivery package from the storehouse, and then go to the Mage Guild in Geffen. When you get there, visit the Mage Guildsman in charge.";
394                                 callsub S_GiveSerial,2989396,3,2191737,4,1010;
395                                 break;
396                         case 3:
397                                 mes "First, get the delivery package from the storehouse, and then go to Morroc. There you must find Java Dullihan, the dyemaker.";
398                                 next;
399                                 mes "[Chief Mahnsoo]";
400                                 mes "He's a bit forgetful, so you should probably give the package to one of his students.";
401                                 callsub S_GiveSerial,3012685,5,3487372,6,1011;
402                                 break;
403                         case 4:
404                                 mes "First, get the delivery package from the storehouse, and then give it to the Kafra Employee stationed on Byalan Island.";
405                                 callsub S_GiveSerial,3318702,7,3543625,8,1012;
406                                 next;
407                                 mes "[Chief Mahnsoo]";
408                                 mes "Ummmm...";
409                                 mes "And I also have";
410                                 mes "a bit of a personal";
411                                 mes "request for you.";
412                                 next;
413                                 mes "[Chief Mahnsoo]";
414                                 mes "Would you please give her this message when you deliver the package? Please~";
415                                 getitem 1072,1; //Delivery_Message
416                                 break;
417                         }
418                         next;
419                         mes "[Chief Mahnsoo]";
420                         mes "Don't forget your destination and the package's Serial Number. You will need to tell those to the storekeeper in the storehouse to the right of me.";
421                         next;
422                         mes "[Chief Mahnsoo]";
423                         mes "After the delivery, give the receipt to the storekeeper, and then come back and see me.";
424                         next;
425                         mes "[Chief Mahnsoo]";
426                         mes "Is that clear?";
427                         mes "Alright, that's";
428                         mes "the spirit.";
429                         mes "Take care!";
430                         close;
431                 case 2:
432                         mes "[Chief Mahnsoo]";
433                         mes "Merchant?";
434                         mes "Well, we basically sell goods to make money. That is the way";
435                         mes "of the Merchant.";
436                         next;
437                         mes "[Chief Mahnsoo]";
438                         mes "I guess we may not be the best at fighting, and we don't have many special attacks. We've got no healing skills...";
439                         next;
440                         mes "[Chief Mahnsoo]";
441                         mes "But we can buy goods at lower prices from NPC shops and sell them at a higher price to other people~";
442                         next;
443                         mes "[Chief Mahnsoo]";
444                         mes "Our ultimate attack skill is 'Mammonite.' The strength of Mammonite comes from the anger";
445                         mes "when we're forced to throw away perfectly good zeny.";
446                         next;
447                         mes "[Chief Mahnsoo]";
448                         mes "Throwing away zeny like that";
449                         mes "causes a deadly rage to well up in the heart of any Merchant!";
450                         mes "Just thinking about it";
451                         mes "makes my blood boil!";
452                         next;
453                         mes "[Chief Mahnsoo]";
454                         mes "Anyway, we can use most";
455                         mes "weapons except Bows, Rods, and Two-Handed Swords. But we can always sell those.";
456                         next;
457                         mes "[Chief Mahnsoo]";
458                         mes "Yes...";
459                         mes "We Merchants generally";
460                         mes "have money on our minds...";
461                         close;
462                 case 3:
463                         mes "[Chief Mahnsoo]";
464                         mes "There are three conditions that must be fulfilled before you can become a Merchant.";
465                         next;
466                         mes "[Chief Mahnsoo]";
467                         mes "First, You have to be a Novice with Job Level 10, and have learned all of the Basic Skills.";
468                         next;
469                         mes "[Chief Mahnsoo]";
470                         mes "Second, You have to pay a 1,000 Zeny Membership Fee. I believe any Merchant candidate should be able to earn 1,000 Zeny with ease.";
471                         next;
472                         mes "[Chief Mahnsoo]";
473                         mes "Third, there is a License Test to test your physical strength and sense of direction. You will deliver a package to a specific person in a specific location.";
474                         close;
475                 case 4:
476                         close;
477                 }
478         }
479
480 S_GiveSerial:
481         next;
482         mes "[Chief Mahnsoo]";
483         mes "Remember...";
484         mes "The package's";
485         mes "Serial Number is";
486         if (rand(2)) {
487                 mes "^3355FF"+getarg(0)+"^000000.";
488                 set job_merchant_q2,getarg(1);
489         }
490         else {
491                 mes "^3355FF"+getarg(2)+"^000000.";
492                 set job_merchant_q2,getarg(3);
493         }
494         setquest getarg(4);
495         return;
496 }
497
498 alberta_in,28,29,2      script  Merchant Guildsman#mer  83,{
499         if (BaseJob == Job_Merchant) {
500                 mes "[Union Staff Kay]";
501                 mes "Heya pal.";
502                 mes "How ya doin'?";
503                 close;
504         }
505         else if (BaseJob != Job_Merchant && BaseJob != Job_Novice) {
506                 mes "[Union Staff Kay]";
507                 mes "Hey you. We don't have any open positions for part time work. If you wanna earn some zeny, you'll hafta look elsewhere.";
508                 close;
509         }
510         else if (job_merchant_q == 9) {
511                 mes "[Union Staff Kay]";
512                 mes "Hey you. Yeah, you.";
513                 mes "If you wanna restart the test, go visit Mahnsoo in the other room. Then we can talk.";
514                 close;
515         }
516         else if (job_merchant_q == 8 || job_merchant_q == 7) {
517                 mes "[Union Staff Kay]";
518                 mes "Alright! Everything looks perfect! I'll report your success to the guildmaster. Now go talk to Chief Mahnsoo, yeah?";
519                 close;
520         }
521         else if (job_merchant_q == 6 || job_merchant_q == 5) {
522                 mes " [Union Staff Kay] ";
523                 mes "Oh, yeah? Okay, lemme check. Your name is " + strcharinfo(0) + "? Alright, your destination was...";
524                 next;
525                 mes "[Union Staff Kay]";
526                 if (job_merchant_q2 == 1 || job_merchant_q2 == 2)
527                         mes "Wow! You met the Kafra babe in Prontera?! Lucky you~ ...Receipt?";
528                 else if (job_merchant_q2 == 3 || job_merchant_q2 == 4)
529                         mes "Geffen Magic Academy. Okay, receipt?";
530                 else if (job_merchant_q2 == 5 || job_merchant_q2 == 6)
531                         mes "The dyemaker in Morroc. Not bad. Receipt?";
532                 else if (job_merchant_q2 == 7 || job_merchant_q2 == 8)
533                         mes "Oh hohohoho~! The Kafra Babe on Byalan Island?! Awesome! Anyway, did you bring the receipt?";
534
535                 if (job_merchant_q2 == 1 && countitem(1073) != 0)
536                         delitem 1073,1; //Merchant_Voucher_1
537                 else if (job_merchant_q2 == 2 && countitem(1074) != 0)
538                         delitem 1074,1; //Merchant_Voucher_2
539                 else if (job_merchant_q2 == 3 && countitem(1075) != 0)
540                         delitem 1075,1; //Merchant_Voucher_3
541                 else if (job_merchant_q2 == 4 && countitem(1076) != 0)
542                         delitem 1076,1; //Merchant_Voucher_4
543                 else if (job_merchant_q2 == 5 && countitem(1077) != 0)
544                         delitem 1077,1; //Merchant_Voucher_5
545                 else if (job_merchant_q2 == 6 && countitem(1078) != 0)
546                         delitem 1078,1; //Merchant_Voucher_6
547                 else if (job_merchant_q2 == 7 && countitem(1079) != 0)
548                         delitem 1079,1; //Merchant_Voucher_7
549                 else if (job_merchant_q2 == 8 && countitem(1080) != 0)
550                         delitem 1080,1; //Merchant_Voucher_8
551                 else {
552                         next;
553                         set job_merchant_q,9;
554                         mes " [Union Staff Kay] ";
555                         mes "Wait a sec.";
556                         mes "Where's the receipt?";
557                         mes "What happened?";
558                         next;
559                         mes " [Union Staff Kay] ";
560                         mes "If you don't have the receipt, you fail the test! You better talk to Mahnsoo if you wanna retake it, alright? Pay attention next time!";
561                         close;
562                 }
563                 next;
564                 mes " [Union Staff Kay] ";
565                 mes "...Great! Everything's perfect! I'll report your success to the Guildmaster. You should talk to Chief Mahnsoo now, alright?";
566                 close2;
567                 if (job_merchant_q == 6)
568                         set job_merchant_q,8;
569                 else if (job_merchant_q == 5)
570                         set job_merchant_q,7;
571                 end;
572         }
573         else if (job_merchant_q == 4 || job_merchant_q == 3 && countitem(1081) == 0 && countitem(1082) == 0 && countitem(1091) == 0) {
574                 mes " [Union Staff Kay] ";
575                 mes "Huh?";
576                 mes "You're back?";
577                 mes "So how did";
578                 mes "the delivery go?";
579                 next;
580                 if (select("*Sob* I lost the package.:Fine.") == 1) {
581                         set job_merchant_q,9;
582                         mes "[Union Staff Kay]";
583                         mes "Are you kidding me? You'll fail the test if you lose the package!";
584                         next;
585                         mes "[Union Staff Kay]";
586                         mes "Awwww man. Well, if you wanna restart the test, talk to Mahnsoo, okay? You're lucky you're getting another chance!";
587                         close;
588                 }
589                 mes "[Union Staff Kay]";
590                 mes "Huh...";
591                 mes "Okay...";
592                 close;
593         }
594         else if (job_merchant_q == 4 || job_merchant_q == 3 && countitem(1081) != 0 || countitem(1082) != 0 || countitem(1091) != 0) {
595                 mes "[Union Staff Kay]";
596                 mes "Hey, what are you still doing here? Shouldn't you be on your way already?";
597                 next;
598                 if (select("I need a new package.:Oh, yeah. You're right!") == 1) {
599                         if (countitem(1081) == 0 && countitem(1082) == 0 && countitem(1083) == 0 && countitem(1091) == 0) {
600                                 mes "[Union Staff Kay]";
601                                 mes "Wha--?";
602                                 mes "So where did";
603                                 mes "the package go?";
604                                 mes "Where is it?!";
605                                 next;
606                                 if (select("*Sob* I lost it!:I have it right here.") == 1) {
607                                         set job_merchant_q,9;
608                                         mes "[Union Staff Kay]";
609                                         mes "You...";
610                                         mes "Lost it?!";
611                                         mes "You failed the test!";
612                                         next;
613                                         mes "[Union Staff Kay]";
614                                         mes "*Sigh* If you want to restart the test, go visit Mahnsoo in the other room, alright?";
615                                         close;
616                                 }
617                                 mes "[Union Staff Kay]";
618                                 mes "Huh.";
619                                 mes "I thought";
620                                 mes "you lost it.";
621                                 mes "You don't";
622                                 mes "need a new one.";
623                                 close;
624                         }
625                         mes "[Union Staff Kay]";
626                         mes "*Sigh* Man, you're starting to become a pain in the ass. Hold on, lemme cancel your record...";
627                         if (countitem(1081) != 0)
628                                 delitem 1081,1; //Merchant_Box_1
629                         else if (countitem(1082) != 0)
630                                 delitem 1082,1; //Merchant_Box_2
631                         else if (countitem(1091) != 0)
632                                 delitem 1091,1; //Merchant_Box_Etc
633                         if (job_merchant_q == 4)
634                                 set job_merchant_q,2;
635                         else if (job_merchant_q == 3)
636                                 set job_merchant_q,1;
637                         next;
638                         mes "[Union Staff Kay]";
639                         mes "I need some time to get everything in order, so come back later.";
640                         close;
641                 }
642                 mes "[Union Staff Kay]";
643                 mes "What a bummer...";
644                 close;
645         }
646         else if ((job_merchant_q == 0 || job_merchant_q == 1 || job_merchant_q == 2)) {
647                 set where_village,0;
648                 mes "[Union Staff Kay]";
649                 mes "Hey there.";
650                 mes "what brings";
651                 mes "you here?";
652                 next;
653                 switch(select("My Merchant License test.:I'm looking for part time work.:Nothing.")) {
654                 case 1:
655                         mes "[Union Staff Kay]";
656                         mes "I see.";
657                         mes "Alright.";
658                         mes "So what's";
659                         mes "your name?";
660                         mes "" + strcharinfo(0) + "...?";
661                         next;
662                         if (job_merchant_q == 0) {
663                                 mes "[Union Staff Kay]";
664                                 mes "Huh. Your name's not on my list. Did you apply for the job change quest or what?";
665                                 next;
666                                 mes "[Union Staff Kay]";
667                                 mes "You gotta apply first by talking to Chief Mahnsoo in the center";
668                                 mes "of this building, okay?";
669                                 close;
670                         }
671                         mes "[Union Staff Kay]";
672                         mes "Alright, there you go. Lemme give you the package. Now, choose the destination of the delivery.";
673                         next;
674                         switch(select("Prontera.:Geffen.:Morocc.:Byalan Island.")) {
675                         case 1: set .@where_village,1; break;
676                         case 2: set .@where_village,2; break;
677                         case 3: set .@where_village,3; break;
678                         case 4: set .@where_village,4; break;
679                         }
680                         mes "[Union Staff Kay]";
681                         mes "Okay, now you need to give me the package's Serial Number. If you wanna cancel, just enter '0', alright?";
682                         next;
683                         while(1) {
684                                 while(1) {
685                                         input .@input;
686                                         if (.@input == 0) {
687                                                 mes "[Union Staff Kay]";
688                                                 mes "Are you sure that you wanna cancel?";
689                                                 if (select("Yes.:Let me try again.") == 1) {
690                                                         mes "Alright, we'll cancel for now.";
691                                                         close;
692                                                 }
693                                                 next;
694                                         }
695                                         else if (.@input < 1000000 || .@input > 5000000) {
696                                                 mes "[Union Staff Kay]";
697                                                 mes "Hey hey. That number's not valid! Enter a value from 1000000 to 5000000. got it?";
698                                                 next;
699                                         }
700                                         else 
701                                                 break;
702                                 }
703                                 mes "[Union Staff Kay]";
704                                 if (.@where_village == 1)
705                                         mes "Destination is Prontera. The Serial Number is " + .@input + ". Are you positive?";
706                                 else if (.@where_village == 2)
707                                         mes "Destination is Geffen. Phew! That's really far! The Serial Number is " + .@input + ". Are you positive?";
708                                 else if (.@where_village == 3)
709                                         mes "Destination is Morocc. That's pretty far away! The Serial Number is " + .@input + ". Are you positive?";
710                                 else
711                                         mes "Lucky you! Your destination is Byalan Island. The Serial Number is " + .@input + ". Are you positive?";
712                                 next;
713                                 if (select("Positive.:Whoops! Wrong number!") == 1) {
714                                         break;
715                                 }
716                         }
717                         if (.@where_village == 1) {
718                                 if (job_merchant_q2 == 1 && .@input == 2485741)
719                                         getitem 1081,1; //Merchant_Box_1
720                                 else if (job_merchant_q2 == 2 && .@input == 2328137)
721                                         getitem 1082,1; //Merchant_Box_2
722                                 else
723                                         getitem 1091,1; //Merchant_Box_Etc
724                         }
725                         else if (.@where_village == 2) {
726                                 if (job_merchant_q2 == 3 && .@input == 2989396)
727                                         getitem 1081,1; //Merchant_Box_1
728                                 else if (job_merchant_q2 == 4 && .@input == 2191737)
729                                         getitem 1082,1; //Merchant_Box_2
730                                 else
731                                         getitem 1091,1; //Merchant_Box_Etc
732                         }
733                         else if (.@where_village == 3) {
734                                 if (job_merchant_q2 == 5 && .@input == 3012685)
735                                         getitem 1081,1; //Merchant_Box_1
736                                 else if (job_merchant_q2 == 6 && .@input == 3487372)
737                                         getitem 1082,1; //Merchant_Box_2
738                                 else
739                                         getitem 1091,1; //Merchant_Box_Etc
740                         }
741                         else {
742                                 if (job_merchant_q2 == 7 && .@input == 3318702)
743                                         getitem 1081,1; //Merchant_Box_1
744                                 else if (job_merchant_q2 == 8 && .@input == 3543625)
745                                         getitem 1082,1; //Merchant_Box_2
746                                 else
747                                         getitem 1091,1; //Merchant_Box_Etc
748                         }
749                         if (job_merchant_q == 2)
750                                 set job_merchant_q,4;
751                         else if (job_merchant_q == 1)
752                                 set job_merchant_q,3;
753                         mes "[Union Staff Kay]";
754                         mes "Alright. Take this package and guard it with your life until it's safely delivered to the customer. Don't lose this thing, got it?";
755                         next;
756                         mes "[Union Staff Kay]";
757                         mes "Well then, I wish you luck. Remember, you gotta bring me";
758                         mes "a receipt once you finish the delivery, okay?";
759                         close;
760                 case 2:
761                         mes "[Union Staff Kay]";
762                         mes "Part time job? Sorry pal, no jobs yet. The Paymaster's department can never balance our budget...";
763                         close;
764                 case 3:
765                         mes "[Union Staff Kay]";
766                         mes "Nothing, eh?";
767                         mes "I guess you enjoy";
768                         mes "bothering people for";
769                         mes "no reason then, yeah?";
770                         close;
771                 }
772         }
773 }
774
775 morocc_in,140,102,4     script  Student#mer     86,{
776         if ((job_merchant_q == 4) || (job_merchant_q == 3)) {
777                 mes "[Dyer's Student]";
778                 mes "You're from";
779                 mes "the Merchant Guild?";
780                 mes "Yes! You've come to";
781                 mes "the right place.";
782                 next;
783                 mes "[Dyer's Student]";
784                 if (countitem(1081) == 1 || countitem(1082) == 1 || countitem(1091) == 1) {
785                         mes "Okay~";
786                         mes "Please set the";
787                         mes "package down";
788                         mes "over there.";
789                 }
790                 else {
791                         mes "But...";
792                         mes "Where's the";
793                         mes "package I ordered?";
794                         mes "That's strange...";
795                         close;
796                 }
797                 next;
798                 mes "[Dyer's Student]";
799                 mes "Let me check the Serial Number of the package so I can give you the receipt, okay?";
800                 next;
801                 mes "[Dyer's Student]";
802                 if (job_merchant_q2 == 5 && countitem(1081) != 0) {
803                         mes "3012685...";
804                         mes "That's right.";
805                         mes "Here's your";
806                         mes "receipt.";
807                         delitem 1081,1; //Merchant_Box_1
808                         getitem 1077,1; //Merchant_Voucher_5
809                 }
810                 else if (job_merchant_q2 == 6 && countitem(1082) != 0) {
811                         mes "3487372...";
812                         mes "That's right.";
813                         mes "Here's your";
814                         mes "receipt.";
815                         delitem 1082,1; //Merchant_Box_2
816                         getitem 1078,1; //Merchant_Voucher_6
817                 }
818                 else {
819                         mes "Excuse me, but...";
820                         if (job_merchant_q2 == 5)
821                                 mes "I don't think this is the package we ordered. The Serial Number should be 3012685. See?";
822                         else if (job_merchant_q2 == 6)
823                                 mes "I don't think this is the package we ordered. The Serial Number should be 3487372. See?";
824                         else
825                                 mes "I don't think this is the package we ordered. The Serial Number should be 3012685 or 3487372. Well, one of those two...";
826                         close;
827                 }
828                 if (job_merchant_q == 4)
829                         set job_merchant_q,6;
830                 else if (job_merchant_q == 3)
831                         set job_merchant_q,5;
832                 next;
833                 mes "[Dyer's Student]";
834                 mes "Thanks a lot!";
835                 mes "See you again";
836                 mes "sometime!";
837                 close;
838         }
839         else if (job_merchant_q == 6 || job_merchant_q == 5 && job_merchant_q2 == 6 || job_merchant_q2 == 5) {
840                 mes "[Dyer's Student]";
841                 mes "Oh...";
842                 mes "You're gonna";
843                 mes "go back? Okay";
844                 mes "then, take care!";
845                 close;
846         }
847         else {
848                 mes "[Dyer's Student]";
849                 mes "Mr. Java Dullihan is the one and only, the best dye maker on the Rune-Midgard continent.";
850                 next;
851                 mes "[Dyer's Student]";
852                 mes "Aaaand I'm proud to say that I'm his student! Someday, I'll be able to make really beautiful dyes too!";
853                 next;
854                 mes "[Dyer's Student]";
855                 mes "Of course, I'm still learning the basics right now, but someday...";
856                 close;
857         }
858 }
859
860 geffen_in,155,122,4     script  Guild Staff#mer 47,{
861         if (job_merchant_q == 4 || job_merchant_q == 3) {
862                 mes "[Guild Staff]";
863                 mes "Ah, you must be with the Merchant Guild. Finally, my package has arrived! Alright...!";
864                 next;
865                 mes "[Guild Staff]";
866                 if (countitem(1081) == 1 || countitem(1082) == 1 || countitem(1091) == 1) {
867                         mes "You must be very tired";
868                         mes "from having to travel";
869                         mes "in this kind";
870                         mes "of weather...";
871                 }
872                 else {
873                         mes "Wait...";
874                         mes "Where's the";
875                         mes "package?";
876                         close;
877                 }
878                 next;
879                 mes "[Guild Staff]";
880                 mes "Alright, let me";
881                 mes "check the Serial Number...";
882                 if (job_merchant_q2 == 3 && countitem(1081) != 0) {
883                         mes "2989396. Yes, this is what we ordered. Here is your receipt.";
884                         delitem 1081,1; //Merchant_Box_1
885                         getitem 1075,1; //Merchant_Voucher_3
886                 }
887                 else if (job_merchant_q2 == 4 && countitem(1082) != 0) {
888                         mes "2191737. Yes, this is what we ordered. Here is your receipt.";
889                         delitem 1082,1; //Merchant_Box_2
890                         getitem 1076,1; //Merchant_Voucher_4
891                 }
892                 else {
893                         mes "Uh oh, this is the wrong number. This isn't what we ordered...";
894                         next;
895                         mes "[Guild Staff]";
896                         if (job_merchant_q2 == 3) {
897                                 mes "The Serial Number";
898                                 mes "should be 2989396.";
899                         }
900                         else if (job_merchant_q2 == 4) {
901                                 mes "The Serial Number";
902                                 mes "should be 2191737.";
903                         }
904                         else {
905                                 mes "The Serial Number";
906                                 mes "should be 2989396";
907                                 mes "or 2191737, one of";
908                                 mes "those two.";
909                         }
910                         mes "Look here!";
911                         mes "Don't you see";
912                         mes "something";
913                         mes "is wrong?";
914                         close;
915                 }
916                 if (job_merchant_q == 4)
917                         set job_merchant_q,6;
918                 else if (job_merchant_q == 3)
919                         set job_merchant_q,5;
920                 next;
921                 mes "[Guild Staff]";
922                 mes "Heh heh~";
923                 mes "Thank you!";
924                 mes "Bye bye!";
925                 close;
926         }
927         else if (job_merchant_q == 6 || job_merchant_q == 5 && job_merchant_q2 == 4 || job_merchant_q2 == 3) {
928                 mes "[Guild Staff]";
929                 mes "Hello,";
930                 mes "Merchant Guildsman~";
931                 mes "I give you my thanks.";
932                 close;
933         }
934         else {
935                 mes "[Guild Staff]";
936                 mes "My package should have arrived by now. Huh. I guess the Merchant Guild might be running a little late...";
937                 close;
938         }
939 }
940
941 prontera,248,42,0       script  Kafra Employee#mer      116,{
942         cutin "kafra_02",2;
943         if (job_merchant_q == 6 || job_merchant_q == 5) && (job_merchant_q2 == 2 || job_merchant_q2 == 1) {
944                 mes "[Kafra Employee]";
945                 mes "Oh! Thank you for";
946                 mes "traveling such a long";
947                 mes "way to come over here~";
948                 close2;
949                 cutin "",255;
950                 end;
951         }
952         else if (job_merchant_q == 4 || job_merchant_q == 3) {
953                 mes "[Kafra Employee]";
954                 mes "A delivery from";
955                 mes "the Merchant Guild?";
956                 mes "Oh, yes, please set";
957                 mes "it down right over there...";
958                 if (countitem(1081) == 1 || countitem(1082) == 1 || countitem(1091) == 1) {
959                         mes "You must be really tired";
960                         mes "after carrying it for so long!";
961                 }
962                 else {
963                         mes "W-wait. Didn't you bring it?";
964                         mes "Where's the package?";
965                         close2;
966                         cutin "",255;
967                         end;
968                 }
969                 next;
970                 mes "[Kafra Employee]";
971                 mes "Now, let me check";
972                 mes "the serial number...";
973                 if (job_merchant_q2 == 1 && countitem(1081) != 0) {
974                         mes "2485741. Right, this is";
975                         mes "the one we ordered. Oh,";
976                         mes "and don't forget this receipt!";
977                         next;
978                         delitem 1081,1; //Merchant_Box_1
979                         getitem 1073,1; //Merchant_Voucher_1
980                 }
981                 else if (job_merchant_q2 == 2 && countitem(1082) != 0) {
982                         mes "2328137. Right, this is";
983                         mes "the one we ordered. Oh,";
984                         mes "and don't forget this receipt!";
985                         next;
986                         delitem 1082,1; //Merchant_Box_2
987                         getitem 1074,1; //Merchant_Voucher_2
988                 }
989                 else {
990                         mes "Mmmm? Hold on. This is";
991                         mes "the wrong package. What we";
992                         if (job_merchant_q2 == 1)
993                                 mes "ordered had the serial number 2485741. I'm sure it's not this.";
994                         else if (job_merchant_q2 == 2)
995                                 mes "ordered had the serial number 2328137. I'm sure it's not this.";
996                         else
997                                 mes "ordered had the serial number 2328137 or 2328137.";
998                         next;
999                         mes "[Kafra Employee]";
1000                         mes "I'm afraid there";
1001                         mes "must be some kind";
1002                         mes "of mistake. Perhaps";
1003                         mes "you should go back to";
1004                         mes "the Merchant Guild to";
1005                         mes "clear up this situation?";
1006                         close2;
1007                         cutin "",255;
1008                         end;
1009                 }
1010                 if (job_merchant_q == 4)
1011                         set job_merchant_q,6;
1012                 else if (job_merchant_q == 3)
1013                         set job_merchant_q,5;
1014                 mes "[Kafra Employee]";
1015                 mes "Thanks again";
1016                 mes "for going through";
1017                 mes "all of that trouble~";
1018                 close2;
1019                 cutin "",255;
1020                 end;
1021         }
1022         else {
1023                 mes "[Kafra Employee]";
1024                 mes "Welcome to the";
1025                 mes "Kafra Corportation,";
1026                 mes "where the service is";
1027                 mes "always on your side~";
1028                 next;
1029                 mes "[Kafra Employee]";
1030                 mes "As you can see, the";
1031                 mes "Swordman Assocation";
1032                 mes "has moved to Izlude, a";
1033                 mes "satellite city of Prontera.";
1034                 mes "Currently, we offer a Teleport";
1035                 mes "Service to Izlude for 600 zeny.";
1036                 next;
1037                 if (select("Use:Cancel") == 1) {
1038                         if (Zeny < 600) {
1039                                 mes "[Kafra Employee]";
1040                                 mes "I'm sorry, but you";
1041                                 mes "don't have enough zeny";
1042                                 mes "for this Teleport Service.";
1043                                 close2;
1044                                 cutin "",255;
1045                                 end;
1046                         }
1047                         set Zeny, Zeny-600;
1048                         set RESRVPTS, RESRVPTS + 37;
1049                         cutin "",255;
1050                         warp "izlude",94,103;
1051                         end;
1052                 }
1053                 close2;
1054                 cutin "",255;
1055                 end;
1056         }
1057 }
1058
1059 //izlu2dun,106,58,4     script  Kafra Employee#mer      116,{
1060 function        script  F_MercKafra     {
1061         if ((job_merchant_q == 6 || job_merchant_q == 5) && (job_merchant_q2 == 8 || job_merchant_q2 == 7)) {
1062                 mes "[Kafra Employee]";
1063                 mes "Oh hello~";
1064                 mes "Um, is there";
1065                 mes "some special reason";
1066                 mes "as to why you're here?";
1067                 close2;
1068                 cutin "",255;
1069                 end;
1070         }
1071         else if (job_merchant_q == 4 || job_merchant_q == 3) {
1072                 mes "[Kafra Employee]";
1073                 mes "A delivery from";
1074                 mes "the Merchant Guild?";
1075                 mes "Oh, yes, please set";
1076                 mes "it down right over there...";
1077                 if (countitem(1081) == 1 || countitem(1082) == 1 || countitem(1091) == 1) {
1078                         mes "You must be really tired";
1079                         mes "after carrying it for so long!";
1080                 }
1081                 else {
1082                         mes "W-wait. Didn't you bring it?";
1083                         mes "Where's the package?";
1084                         close2;
1085                         cutin "",255;
1086                         end;
1087                 }
1088                 next;
1089                 mes "[Kafra Employee]";
1090                 mes "Now, let me check";
1091                 mes "the serial number...";
1092                 if (job_merchant_q2 == 7 && countitem(1081) != 0) {
1093                         mes "3318702. Right, this is";
1094                         mes "the one we ordered. Oh,";
1095                         mes "and don't forget this receipt!";
1096                         delitem 1081,1; //Merchant_Box_1
1097                         getitem 1079,1; //Merchant_Voucher_7
1098                 }
1099                 else if (job_merchant_q2 == 8 && countitem(1082) != 0) {
1100                         mes "3543625. Right, this is";
1101                         mes "the one we ordered. Oh,";
1102                         mes "and don't forget this receipt!";
1103                         delitem 1082,1; //Merchant_Box_2
1104                         getitem 1080,1; //Merchant_Voucher_8
1105                 }
1106                 else {
1107                         mes "Mmmm? Hold on. This is";
1108                         mes "the wrong package. What we";
1109                         if (job_merchant_q2 == 7)
1110                                 mes "ordered had the serial number 3318702. I'm sure it's not this.";
1111                         else if (job_merchant_q2 == 8)
1112                                 mes "ordered had the serial number 3543625. I'm sure it's not this.";
1113                         else
1114                                 mes "ordered had the serial number 3318702 or 3543625.";
1115                         close2;
1116                         cutin "",255;
1117                         end;
1118                 }
1119                 if (job_merchant_q == 4)
1120                         set job_merchant_q,6;
1121                 else if (job_merchant_q == 3)
1122                         set job_merchant_q,5;
1123                 next;
1124                 if (countitem(1072) != 0 && quest_alb_01 == 0) {
1125                         select("This is from Chief Mahnsoo of the Merchant Guild...");
1126                         delitem 1072,1; //Delivery_Message
1127                         set quest_alb_01,1;
1128                         mes "[Kafra Employee]";
1129                         mes "Oh~! A letter from";
1130                         mes "Mahnsoo! Thank you";
1131                         mes "so much, I've been dying";
1132                         mes "to hear from him. How is";
1133                         mes "he doing, is he alright?";
1134                         mes "I can't wait to read it...";
1135                         next;
1136                         mes "[Kafra Employee]";
1137                         mes "Oh, thank you for";
1138                         mes "going through all the";
1139                         mes "trouble of delivering all";
1140                         mes "of this. This isn't anything";
1141                         mes "special, but please take it.";
1142                         mes "Well, see you again~";
1143                         getitem 513,3; //Banana
1144                 }
1145                 else {
1146                         mes "[Kafra Employee]";
1147                         mes "Thanks again";
1148                         mes "for going through";
1149                         mes "all of that trouble~";
1150                 }
1151                 close2;
1152                 cutin "",255;
1153                 end;
1154         }
1155         return;
1156 }