root/npc/merchants/refine.txt @ 23

Revision 1, 25.2 kB (checked in by jinshiro, 17 years ago)
Line 
1//===== eAthena Script =======================================
2//= Refining NPCs
3//===== By: ==================================================
4//= Syrus22 (1.1) dafide18 (1.4) Skotlex (1.5)
5//===== Current Version: =====================================
6//= 2.3
7//===== Compatible With: =====================================
8//= Any Athena Version
9//===== Description: =========================================
10//= Refining NPCs and Metal Salesmen.
11//===== Additional Comments: =================================
12//= 1.0 - by A bunch of people!
13//=       Syrus22 - Completely redid the script using functions... also
14//=       added the option for auto safe refining and multiple refining.
15//= 1.1 - Negative input bug fixed [Lupus]
16//= 1.2 - Added additional reparimen in morroc and payon. Added
17//=       Christopher the blacksmith in Geffen. Edited some dialogue [kobra_k88]
18//= 1.3 - New Payon Locations [Darkchild]
19//=       Corrected zeny subtraction thx to jpnmania77.[kobra_k88]
20//= 1.3a - Temporary corrected an exploit. Need to check sources
21//=        to fully fix bug [Shinigami]
22//=        Fixed repairman prices [shadowlady]
23//=        Fixed bug that skips requirements thanks to sir_loon [massdriller]
24//=        Fixed itemid error thanks to -Vitamin- [massdriller]
25//= 1.4 - check again item in refining procedure to avoid
26//=        hacker that can change item [dafide18]
27//= 1.5 - Fixed crashing due to badly used callfunc's [Skotlex]
28//        Lupus, don't rollback this important fix again! >.<
29//= 1.5a - Corrected an unneeded callfunc, fixed the anti-bot
30//=       exploit ruining the safe refine loop. [Skotlex]
31//= 1.5b - Fixed Spelling mistakes. [Nexon]
32//= 1.6 - Replaced all breaks for ends as per the new script engine [Skotlex]
33//= 1.7 - Added Einbroch Refiners (Custom names ^^;) and a duplicated BS Shop. [Poki#3]
34//= 1.8 - Added Lighthalzen Refiners (Custom names again ^^;) [Poki#3]
35//= 1.8a - Fixed wrong indication thanks to NeoSaro [Lupus]
36//= 1.9 - Rewrote repairman, removed the Steel from repair cost [DracoRPG]
37//= 2.0 - Fixed missed equppment presence check. Thx2 Coltaro [Lupus]
38//= 2.0a - Added weight checks thanks to Neouni [Playtester]
39//= 2.0b - Fixed the names of Lighthalzen and Einbroch refiners thanks to Maud_Dib [Kargha]
40//= 2.1 - Removed Duplicates [Silent]
41//= 2.2 - Changed name from "Emvertacon" to "Emveretarcon". [Samuray22]
42//      - Thanks to Barron-Monster.
43//= 2.2b - Changed name from "Pharacon" to "Phracon". [Samuray22]
44//      - Thanks to Barron-Monster.
45//= 2.3 Corrected NPC names to fall within proper restrictions. [L0ne_W0lf]
46//============================================================
47
48
49//=========================================================
50// Christopher: Geffen Blacksmith
51//=========================================================
52geffen_in,110,172,2     script  Christopher#1::Chrisbs  63,{
53        mes "[Christopher Guillenrow]";
54        mes "Welcome to Christopher's Workshop. Ye can find all yer forging equipment here. So what can I help ye with?";
55        M_Menu:
56        next;
57        menu "Purchase Anvil",M_0, "Purchase Forging Item",M_1, "Purchase Metal",M_2, "Purify Rough Ores",M_3, "Cancel",M_End;
58
59        M_0:
60                mes "[Christopher Guillenrow]";
61                mes "Higher quality Anvils gives ye a better chance ta make better weapons, ye know. But they cost more than yer typical ones.";
62                next;
63                menu "Anvil - 30000z.",sM_Anvil, "Oridecon Anvil - 120000z.",sM_OriAnvil, "Golden Anvil - 300000z.",sM_GolAnvil,
64                        "Better Anvil than others",sM_BetAnvil, "Cancel",M_Menu;
65
66                sM_Anvil:
67                        if(Zeny < 30000) goto L_NoZeny;
68                        if(checkweight(986,1) == 0 ) goto L_OverWeight;
69                        set Zeny, Zeny - 30000;
70                        getitem 986,1;
71                        mes "[Christopher Guillenrow]";
72                        mes "This is the cheapest one but it's very efficient.";
73                        next;
74                        goto L_Thanks;
75                sM_OriAnvil:
76                        if(Zeny < 120000) goto L_NoZeny;
77                        if(checkweight(987,1) == 0 ) goto L_OverWeight;
78                        set Zeny, Zeny - 120000;
79                        getitem 987,1;
80                        mes "[Christopher Guillenrow]";
81                        mes "Ah! Ye have a good eye for anvils. This here is the proper anvil for a Blacksmith.";
82                        next;
83                        goto L_Thanks;
84                sM_GolAnvil:
85                        if(Zeny < 300000) goto L_NoZeny;
86                        if(checkweight(988,1) == 0 ) goto L_OverWeight;
87                        set Zeny, Zeny - 300000;
88                        mes "[Christopher Guillenrow]";
89                        mes "This is the best anvil in my workshop! With this ye'll be the best Blasksmith in no time.";
90                        getitem 988,1;
91                        next;
92                        goto L_Thanks;
93                sM_BetAnvil:
94                        mes "[Christopher Guillenrow]";
95                        mes "I'm sorry but I don't have anything better than a Golden Anvil.";
96                        mes "Maybe 'Ringgel' the legendary Anvil maker would have one... but he be a hard fellow ta find.";
97                        close;
98
99        M_1:
100                mes "[Christopher Guillenrow]";
101                mes "A respectable Blacksmith uses fine tools. Ye will come ta know my tools as being the finest around!";
102                mes "Choose anything you want.";
103                sM_Menu1:
104                next;
105                menu "Mini-Furnace - 150z.",sM_Furn, "Iron Hammer - 1000z.",sM_IrHam, "Golden Hammer - 3000z.",sM_GldHam,
106                     "Oridecon Hammer - 5000z.",sM_OriHam, "Cancel",M_Menu;
107
108                sM_Furn:
109                        mes "[Christopher Guillenrow]";
110                        mes "This is a prerequisite for Metal refining!!";
111                        mes "So, how many do ye wish to buy? If you want to quit, please input the number '0'. However, you the maximum amount you can buy is 1000";
112                        set @input, 0;
113                        input @input;
114                        next;
115                        if(@input < 1 ) goto sM_Menu1;
116                        if(@input > 1000 ) goto sM_Max;
117                        if(Zeny < 150 * @input) goto L_NoZeny;
118                        if(checkweight(612,@input) == 0 ) goto L_OverWeight;
119                        set Zeny, Zeny - (150 * @input);
120                        getitem 612, @input;
121                        goto L_Thanks;
122                sM_IrHam:
123                        if(Zeny < 1000) goto L_NoZeny;
124                        if(checkweight(613,1) == 0 ) goto L_OverWeight;
125                        set Zeny, Zeny - 1000;
126                        getitem 613,1;
127                        goto L_Thanks;
128                sM_GldHam:
129                        if(Zeny < 3000) goto L_NoZeny;
130                        if(checkweight(614,1) == 0 ) goto L_OverWeight;
131                        set Zeny, Zeny - 3000;
132                        getitem 614,1;
133                        goto L_Thanks;
134                sM_OriHam:
135                        if(Zeny < 5000) goto L_NoZeny;
136                        if(checkweight(615,1) == 0 ) goto L_OverWeight;
137                        set Zeny, Zeny - 5000;
138                        getitem 615,1;
139                        goto L_Thanks;
140                sM_Max:
141                        mes "[Christopher Guillenrow]";
142                        mes "Sorry, you can't buy more than 1000 furnace at a time.";
143                        close;
144
145        M_2:
146                mes "[Christopher Guillenrow]";
147                mes "I have 2 kinds of metals for sale. Which do ye like?";
148                set @chris, 1;
149                set @name$, "Christopher Guillenrow";
150                callfunc "phramain";
151
152        M_3:
153                mes "[Christopher Guillenrow]";
154                mes "I can purify yer rough Oridecon and rough Elunium ores. I'll need 5 rough ores to make 1 pure one.";
155                mes "Well... which one do ye want ta make?";
156                set @chris, 1;
157                set @name$, "Christopher Guillenrow";
158                callfunc "orimain";
159
160        M_End:
161                close;
162
163        L_NoZeny:
164                mes "[Christopher Guillenrow]";
165                mes "I don't think I can let ye have this at a lower price. I can't afford ta loose profits because of ye.";
166                emotion 4;
167                close;
168
169        L_OverWeight:
170                mes "[Christopher Guillenrow]";
171                mes "You don't seem to have enough strength to carry this.";
172                close;
173
174        L_Thanks:
175                mes "[Christopher Guillenrow]";
176                mes "Thank you for shopping at my workshop. Feel free to come anytime whenever you need.";
177                emotion 15;
178                close;
179}
180
181ein_in01,38,29,6        duplicate(Chrisbs)      Christopher#2   63
182
183//=====================================================================================
184// Weapon/Armor Refiners
185//=====================================================================================
186prt_in,63,60,4  script  Hollengrhen     85,{
187        set @name$,"Hollengrhen";
188        callfunc "refinemain";
189        end;
190}
191morocc_in,73,38,4       script  Aragham 99,{
192        set @name$,"Aragham";
193        callfunc "refinemain";
194        end;
195}
196payon,144,173,4 script  Antonio 88,{
197        set @name$,"Antonio";
198        callfunc "refinemain";
199        end;
200}
201alberta_in,28,58,4      script  Fredrik 85,{
202        set @name$,"Fredrik";
203        callfunc "refinemain";
204        end;
205}
206yuno_in01,164,26,6      script  Disturb 88,{
207        set @name$,"Disturb";
208        callfunc "refinemain";
209        end;
210}
211ein_in01,24,87,6        script  Manthasman      826,{
212        set @name$,"Manthasman Pruhag";
213        callfunc "refinemain";
214        end;
215}
216lhz_in02,282,20,7       script  Fulerr  869,{
217        set @name$,"Fulerr";
218        callfunc "refinemain";
219        end;
220}
221
222//============================================================
223//= Main Refiner Function
224//============================================================
225//= To allow auto safe refining/multiple refining set the
226//= @features variable to 1
227//============================================================
228function        script  refinemain      {
229        set @features,0;
230
231        mes "[" + @name$ + "]";
232        mes "I am the Armsmith... I can refine any weapon or piece of armor you choose!";
233        mes "Which piece of equipment do you want to refine?";
234        M_Menu:
235        next;
236        menu getequipname(1),PART1,getequipname(2),PART2,getequipname(3),PART3,getequipname(4),PART4,getequipname(5),PART5,
237             getequipname(6),PART6,getequipname(7),PART7,getequipname(8),PART8,getequipname(9),PART9,getequipname(10),PART10;
238
239        //Head Gear
240        PART1:
241                set @part,1;
242                if (getequipisequiped(1)) goto CHECK1;
243                mes "[" + @name$ + "]";
244                mes "Do you want me to refine your dumb brain?";
245                emotion 6;
246                goto M_Menu;
247        //Armor
248        PART2:
249                set @part,2;
250                if (getequipisequiped(2)) goto CHECK1;
251                mes "[" + @name$ + "]";
252                mes "Do you want me to melt your body with blazing heat...?";
253                emotion 6;
254                goto M_Menu;
255        //Left Hand
256        PART3:
257                set @part,3;
258                if (getequipisequiped(3)) goto CHECK1;
259                mes "[" + @name$ + "]";
260                mes "I can't make your left hand into an ultimate weapon...";
261                emotion 4;
262                goto M_Menu;
263        //Right Hand
264        PART4:
265                set @part,4;
266                if (getequipisequiped(4)) goto CHECK1;
267                mes "[" + @name$ + "]";
268                mes "I can't make your right hand into an ultimate weapon...";
269                emotion 4;
270                goto M_Menu;
271        //Garment
272        PART5:
273                set @part,5;
274                if (getequipisequiped(5)) goto CHECK1;
275                mes "[" + @name$ + "]";
276                mes "Look here... you don't have any Garments on...";
277                goto M_Menu;
278        //Foot Gear
279        PART6:
280                set @part,6;
281                if (getequipisequiped(6)) goto CHECK1;
282                mes "[" + @name$ + "]";
283                mes "Ack!! Those are some stinky feet. I definitely can't refine those... uck!!";
284                emotion 16;
285                goto M_Menu;
286        //Accessory1
287        PART7:
288                set @part,7;
289                if (getequipisequiped(7)) goto CHECK1;
290                mes "[" + @name$ + "]";
291                mes "What do you mean by Accessory? Which One?";
292                emotion 20;
293                goto M_Menu;
294        //Accessory2
295        PART8:
296                set @part,8;
297                if (getequipisequiped(8)) goto CHECK1;
298                mes "[" + @name$ + "]";
299                mes "What do you mean by Accessory? Which One?";
300                emotion 20;
301                goto M_Menu;
302        PART9:
303                set @part,9;
304                if (getequipisequiped(9)) goto CHECK1;
305                mes "[" + @name$ + "]";
306                mes "What do you want from me? There's nothing equipped there...";
307                emotion 20;
308                goto M_Menu;
309        PART10:
310                set @part,10;
311                if (getequipisequiped(10)) goto CHECK1;
312                mes "[" + @name$ + "]";
313                mes "What do you want from me? There's nothing equipped there...";
314                emotion 20;
315                goto M_Menu;
316
317//Check if the item is refinable...
318CHECK1:
319        if(getequipisenableref(@part)) goto CHECK2;
320        mes "[" + @name$ + "]";
321        mes "I can't work on this item...";
322        close;
323
324//Check if the item is identified... (Don't know why this is in here... but kept it anyway)
325CHECK2:
326        if(getequipisidentify(@part)) goto CHECK3;
327        mes "[" + @name$ + "]";
328        mes "You must appraise this item first.";
329        close;
330
331//Check to see if the items is already +10
332CHECK3:
333        if(getequiprefinerycnt(@part) < 10) goto REFINE0;
334        mes "[" + @name$ + "]";
335        mes "This weapon is already at its maximum level and can no longer be refined.";
336        close;
337
338//Refine Armor
339REFINE0:
340        set @refineitemid, getequipid(@part); // save id of the item
341        set @refinerycnt, getequiprefinerycnt(@part); //save refinery count
342        if(getequipweaponlv(@part) > 0) goto REFINE1;
343        set @matname$,"Elunium";
344        set @material,985;
345        set @price,2000;
346        set @safe,4;
347        if(@features == 1) goto L_refinefeatures;
348        goto L_refinenormal;
349//Refine Level 1 Weapon
350REFINE1:
351        if(getequipweaponlv(@part) > 1) goto REFINE2;
352        set @matname$,"Phracon";
353        set @material,1010;
354        set @price,50;
355        set @safe,7;
356        if(@features == 1) goto L_refinefeatures;
357        goto L_refinenormal;
358//Refine Level 2 Weapon
359REFINE2:
360        if(getequipweaponlv(@part) > 2) goto REFINE3;
361        set @matname$,"Emveretarcon";
362        set @material,1011;
363        set @price,200;
364        set @safe,6;
365        if(@features == 1) goto L_refinefeatures;
366        goto L_refinenormal;
367//Refine Level 3 Weapon
368REFINE3:
369        if(getequipweaponlv(@part) > 3) goto REFINE4;
370        set @matname$,"Oridecon";
371        set @material,984;
372        set @price,5000;
373        set @safe,5;
374        if(@features == 1) goto L_refinefeatures;
375        goto L_refinenormal;
376//Refine Level 4 Weapon
377REFINE4:
378        set @matname$,"Oridecon";
379        set @material,984;
380        set @price,20000;
381        set @safe,4;
382        if(@features == 1) goto L_refinefeatures;
383        goto L_refinenormal;
384
385L_refinenormal:
386        mes "[" + @name$ + "]";
387        mes "To refine this stuff, I need ^ff9999" + @matname$ + "^000000 and the fee " + @price + " Zeny.";
388        mes "Continue?";
389        next;
390        menu "Yes",-,"No",Lcancel;
391
392                if (getequippercentrefinery(@part) == 100) goto L_Sub;
393                mes "[" + @name$ + "]";
394                mes "Hmm... Hold on! This piece of equipment has already been refined to its maximum safety level.";
395                mes "I must warn you if it is refined ANYMORE, It could be DESTROYED and become USELESS!!";
396                next;
397                mes "["+@name$+"]";
398                mes "Do you still wish you refine it? If so I will not be able to guarantee my work...";
399                next;
400                menu "Yes",-,"No",Lcancel1;
401
402                L_Sub:
403                        if ((countitem(@material) < 1) || (Zeny < @price)) goto Lcancel2;
404                        set Zeny,Zeny-@price;
405                        delitem @material,1;
406
407Lrefine:
408        if (getequipisequiped(@part) == 0) goto LNoItem; // hacker has removed the item (not changed, why?)
409        if (getequipid(@part) != @refineitemid) goto LNoFake; // hacker has changed the item
410        if (getequiprefinerycnt(@part) != @refinerycnt) goto LNoFake; // hacker has changed the item
411        if (getequippercentrefinery(@part) <= rand(100)) goto Lfail;
412        mes "["+@name$+"]";
413        mes "Clang! Clang! Clang!";
414        successrefitem @part;
415        next;
416        mes "["+@name$+"]";
417        mes "HAHA! It seems my skills haven't gotten rusty yet! Splendid... just splendid...";
418        emotion 21;
419        close;
420
421Lfail:
422        mes "[" + @name$ + "]";
423        mes "Clang! Clang! Clang!";
424        failedrefitem @part;
425        next;
426        mes "["+@name$+"]";
427        mes "Aaahhh!! Oh no...!!";
428        emotion 16;
429        next;
430        mes "["+@name$+"]";
431        mes "Eh..Ehem... I'm sorry but the refining process ^ff0000failed^000000.";
432        next;
433        mes "["+@name$+"]";
434        mes "I am deeply ashamed of what I've done... but I DID warn you earlier about the risks.";
435        close;
436
437LNoItem:
438        mes "[" + @name$ + "]";
439        mes "Look here... you don't have any Items on...";
440        close;
441
442LNoFake:
443        mes "[" + @name$ + "]";
444        mes "Clan... No, but Did you imagine I could be so stupid !?!";
445        mes "You have changed it...";
446        mes "Go out before I stun you with my Hammer!!!";
447        close;
448
449Lcancel:
450        mes "[" + @name$ + "]";
451        mes "You said so..Hmm so be it...";
452        close;
453
454Lcancel1:
455        mes "[" + @name$ + "]";
456        mes "Good Choice.";
457        mes "Ah... good choice. I'd feel awful if I'd destroyed another persons piece of equipment with my own hands.";
458        close;
459
460Lcancel2:
461        mes "[" + @name$ + "]";
462        mes "Is that all you got? Unfortunately I can't work for you at a lower price. Try putting yourself in my shoes.";
463        close;
464
465// New Refining Functions ========================
466L_refinefeatures:
467        if(getequiprefinerycnt(@part) >= @safe) goto Lnosafe;
468        mes "[" + @name$ + "]";
469        mes "I can refine this to the safe limit or a desired number of times... it's your choice...";
470        next;
471        menu "To the safe limit please.",Lsafe,"I'll decide how many times.",Lnosafe,"I've changed my mind...",Lcancel;
472
473Lsafe:
474        set @refinecnt,@safe - getequiprefinerycnt(@part);
475        set @fullprice,@price * @refinecnt;
476        mes "[" + @name$ + "]";
477        mes "That will cost you " + @refinecnt + " " + @matname$ + " and " + @fullprice + " Zeny. Is that ok?";
478        next;
479        menu "Yes",-,"No...",Lcancel;
480        if((countitem(@material) < @refinecnt) || (Zeny < @fullprice)) goto Lcancel2;
481        set Zeny,Zeny - @fullprice;
482        delitem @material,@refinecnt;
483        goto L_refinesafe;
484
485Lnosafe:
486        mes "[" + @name$ + "]";
487        mes "So how many times would you like me to refine your item?";
488        next;
489        input @refinecnt;
490        if (@refinecnt<1) goto Lcancel3; //fixed by Lupus
491        set @refinecheck,@refinecnt + getequiprefinerycnt(@part);
492        if(@refinecheck > 10) goto Lcancel3;
493        set @fullprice,@price * @refinecnt;
494        mes "[" + @name$ + "]";
495        mes "This will cost you " + @refinecnt + " " + @matname$ + " and " + @fullprice + " Zeny... Is that ok?";
496        next;
497        menu "Yes...",-,"No...",Lcancel;
498                if(@refinecheck > @safe) goto Lwarn;
499                if((countitem(@material) < @refinecnt) || (Zeny < @fullprice)) goto Lcancel2;
500                set Zeny,Zeny - @fullprice;
501                delitem @material,@refinecnt;
502                goto L_refinenumber;
503                end;
504
505                Lwarn:
506                        set @refinecheck,@refinecheck - @safe;
507                        mes "[" + @name$ + "]";
508                        mes "This will try to refine the equipment " + @refinecheck + " times past the safe limit. Your equipment may be destroyed... is that ok?";
509                        next;
510                        menu "Yes",-,"No...",Lcancel1;
511                                if((countitem(@material) < @refinecnt) || (Zeny < @fullprice)) goto Lcancel2;
512                                set Zeny,Zeny - @fullprice;
513                                delitem @material,@refinecnt;
514                                goto L_refinenumber;
515
516Lcancel3:
517        mes "[" + @name$ + "]";
518        mes "I can't refine this item that many times.";
519        close;
520
521// SubFunction: Safe Refine ---------------------
522L_refinesafe:
523        if (getequipisequiped(@part) == 0) goto LNoItem; // hacker has removed the item (no changed, why?)
524        if (getequipid(@part) != @refineitemid) goto LNoFake; // hacker has changed the item
525        if (getequippercentrefinery(@part) < 100) goto LNoFake; // hacker has changed the item (it is not safe anymore)
526        mes "Clang, clang!!!";
527        successrefitem @part;
528        emotion 21;
529        set @refinecnt,@refinecnt - 1;
530        next;
531        if(@refinecnt == 0) goto Lend;
532        goto L_refinesafe;
533
534        Lend:
535                mes "[" + @name$ + "]";
536                mes "All finished... Come again soon.";
537                close;
538               
539// SubFunction: Refine
540L_refinenumber:
541        if (getequipisequiped(@part) == 0) goto LNoItem; // hacker has removed the item (no changed, why?)
542        if (getequipid(@part) != @refineitemid) goto LNoFake; // hacker has changed the item
543        mes "Clang, clang!!!";
544        if (getequippercentrefinery(@part)<=rand(100)) goto Lfail_number;
545        successrefitem @part;
546        emotion 21;
547        set @refinecnt,@refinecnt - 1;
548        next;
549        if(@refinecnt == 0) goto Lend;
550        goto L_refinenumber;
551
552        Lfail_number:
553                failedrefitem @part;
554                emotion 23;
555                mes "[" + @name$ + "]";
556                mes "WAHHHH!!! I'm so sorry... I warned you this could happen...";
557                set @refinecnt,@refinecnt - 1;
558                if(@refinecnt == 0) goto Lend2;
559                mes "Here's the unused Zeny and Material back...";
560                getitem @material,@refinecnt;
561                set @fullprice,@refinecnt * @price;
562                set Zeny,Zeny + @fullprice;
563
564        Lend2:
565                close;
566}
567
568
569
570//==============================================================================
571// Material Salesmen
572//==============================================================================
573prt_in,56,69,4  script  Vurewell        86,{
574        set @name$,"Vurewell";
575        callfunc "phramain";
576        end;
577}
578payon,145,178,4 script  Begnahd 88,{
579        set @name$,"Begnahd";
580        callfunc "phramain";
581        end;
582}
583morocc_in,65,37,4       script  Sade    99,{
584        set @name$,"Sade";
585        callfunc "phramain";
586        end;
587}
588alberta_in,18,59,5      script  Kahlamanlith    86,{
589        set @name$,"Kahlamanlith";
590        callfunc "phramain";
591        end;
592}
593yuno_in01,171,26,6      script  Dillemat        88,{
594        set @name$,"Dillemat";
595        callfunc "phramain";
596        end;
597}
598ein_in01,15,87,7        script  Tirehaus        86,{
599        set @name$,"Tirehaus";
600        callfunc "phramain";
601        end;
602}
603lhz_in02,278,24,3       script  Krugg   86,{
604        set @name$,"Krugg";
605        callfunc "phramain";
606        end;
607}
608
609//============================================================
610//= Material Salesmen Functions
611//============================================================
612function        script  phramain        {
613        if(@chris == 1) goto M_Menu;
614        mes "[" + @name$ + "]";
615        mes "Hello, Im selling metals I just mined.";
616        mes "They are Phracon and Emveretarcon.";
617        mes "Would you like to buy some?";
618        M_Menu:
619        set @chris, 0;
620        next;
621        menu"Phracon - 200z",PHARA,"Emveretarcon - 1000z",EMVER;
622
623        PHARA:
624                set @itemid,1010;
625                set @value,200;
626                goto CONTINUE;
627
628        EMVER:
629                set @itemid,1011;
630                set @value,1000;
631
632CONTINUE:
633        mes "[" + @name$ + "]";
634        mes "How many would you like?";
635        next;
636        input @ammount;
637        if (@ammount <= 0) goto L_BELOW;
638        if (@ammount > 999) goto L_ABOVE;
639        if (zeny < @value * @ammount) goto L_NOZENY;
640        if (checkweight(@itemid,@ammount) == 0) goto L_WEIGHT;
641        set Zeny,Zeny-@value*@ammount;
642        getitem @itemid,@ammount;
643        mes "[" + @name$ + "]";
644        mes "Here you go.";
645        close;
646
647L_NOZENY:
648        mes "You do not have enough zeny!";
649        close;
650L_WEIGHT:
651        mes "You can't hold that many of that item!";
652        close;
653L_BELOW:
654        mes "You have to buy a POSITIVE amount of items!";
655        close;
656L_ABOVE:
657        mes "You can't buy this much of this item!";
658        close;
659}
660
661
662
663//==============================================================================
664// Ori/Elu Refiners
665//==============================================================================
666prt_in,63,69,4  script  Dietrich        84,{
667        set @name$,"Dietrich";
668        callfunc "orimain";
669        end;
670}
671payon,137,178,4 script  Hakhim  88,{
672        set @name$,"Hakhim";
673        callfunc "orimain";
674        end;
675}
676morocc_in,72,32,4       script  Abdul   99,{
677        set @name$,"Abdul";
678        callfunc "orimain";
679        end;
680}
681alberta_in,21,63,5      script  Xenophon        84,{
682        set @name$,"Xenophon";
683        callfunc "orimain";
684        end;
685}
686yuno_in01,171,22,6      script  Delayt  88,{
687        set @name$,"Delayt";
688        callfunc "orimain";
689        end;
690}
691ein_in01,18,82,6        script  Matestein       84,{
692        set @name$,"Matestein";
693        callfunc "orimain";
694        end;
695}
696lhz_in02,281,24,5       script  Fruel   84,{
697        set @name$,"Fruel";
698        callfunc "orimain";
699        end;
700}
701
702//============================================================
703//= Ori/Elu Functions
704//============================================================
705function        script  orimain {
706        if(@chris == 1) goto M_Menu;
707        mes "[" + @name$ + "]";
708        mes "If you bring Rough Oridecons and";
709        mes "Rough Eluniums to me,";
710        mes "I can refine them for you.";
711        mes "However, you must bring 5 of each.";
712        M_Menu:
713        set @chris, 0;
714        next;
715        menu "Make Oridecon",M_Ori, "Make Elunium",M_Elu, "Ask about enchanted stones",M_Stones;
716
717        M_Ori:
718                if(countitem(756) < 5) goto L_NoOri;
719                delitem 756,5;
720                getitem 984,1;
721                mes "[" + @name$ + "]";
722                mes "As promised, here's your oridecon.";
723                mes "Come back again anytime.";
724                close;
725
726                L_NoOri:
727                        mes "[" + @name$ + "]";
728                        mes "Huh? You're kidding, right? Didn't I say I can't make you an Oridecon unless you bring me 5 rough ones?";
729                        close;
730        M_Elu:
731                if(countitem(757) < 5) goto L_NoElu;
732                delitem 757,5;
733                getitem 985,1;
734                mes "[" + @name$ + "]";
735                mes "As promised, here's your elunium.";
736                mes "Come back again anytime.";
737                close;
738
739                L_NoElu:
740                        mes "[" + @name$ + "]";
741                        mes "Huh? You're kidding, right? Didn't I say I can't make you an Elunium unless you bring me 5 rough ones?";
742                        close;
743        M_Stones:
744                mes "[" + @name$ + "]";
745                mes "Enchanted stones, huh...";
746                next;
747                mes "[" + @name$ + "]";
748                mes "Well, in the 20 years that I've been a stone smith I've heard of them many times... though I've never actually seen them before.";
749                next;
750                mes "[" + @name$ + "]";
751                mes "I've been told that enchanted stones possess different elemental properties such as ^5533FFWater, Earth, Fire, and Wind^000000.";
752                next;
753                mes "[" + @name$ + "]";
754                mes "If someone combines an Enchanted Stone with a weapon during the refining process, that weapon will possess the same property as the stone.";
755                next;
756                mes "[" + @name$ + "]";
757                mes "Of course, that person needs to be skillful enough to work on it.";
758                goto M_Menu;
759}
760
761
762
763//=====================================================================================
764// Equipment Repairmen
765//=====================================================================================
766prt_in,62,54,2  script  Grendal 84,{
767        set @name$,"Grendal";
768        callfunc "repairmain";
769        end;
770}
771//Temp Spot, Not Sure Where To place
772payon,149,182,2 script  Repairman#01    88,{
773        set @name$,"Repairman";
774        callfunc "repairmain";
775        end;
776}
777morocc_in,71,40,2       script  Repairman#02    99,{
778        set @name$,"Repairman";
779        callfunc "repairmain";
780        end;
781}
782lhz_in02,284,14,3       script  Repairman#03    86,{
783        set @name$,"Repairman";
784        callfunc "repairmain";
785        end;
786}
787
788//============================================================
789//= Equipment Repair Function
790//============================================================
791function        script  repairmain      {
792        set @repairprice,5000;
793        mes "[" + @name$ + "]";
794        mes "I am the Repair Smith and I can repair any Arms you want.";
795        mes "Tell me which Equipment you want to repair.";
796        next;
797        if(getbrokenid(1)==NULL) {
798                mes "[" + @name$ + "]";
799                mes "Looks like you don't need anything repaired today...";
800                close;
801        }
802        set @choice,select(getitemname(getbrokenid(1)),getitemname(getbrokenid(2)),
803                getitemname(getbrokenid(3)),getitemname(getbrokenid(4)),getitemname(getbrokenid(5)),
804                getitemname(getbrokenid(6)),getitemname(getbrokenid(7)),getitemname(getbrokenid(8)),
805                getitemname(getbrokenid(9)),getitemname(getbrokenid(10)));
806        mes "[" + @name$ + "]";
807        mes "You're gonna repair " + getitemname(getbrokenid(@choice)) + ".";
808        mes "To repair this, I need " + @repairprice + " Zeny.";
809        mes "Continue?";
810        next;
811        if(select("Yes","No") == 2) {
812                mes "[" + @name$ + "]";
813                mes "Ok, but don't expect to be using that...";
814                close;
815        }
816        if (Zeny < @repairprice) {
817                mes "[" + @name$ + "]";
818                mes "Is it all you got?";
819                mes "Unfortunately, I have kids to feed...";
820                close;
821        }
822        set Zeny,Zeny-@repairprice;
823        repair(@choice);
824        close;
825
826}
Note: See TracBrowser for help on using the browser.