[1] | 1 | //===== eAthena Script ======================================= |
---|
| 2 | //= Magazine Dealer Kenny |
---|
| 3 | //===== By: ================================================== |
---|
| 4 | //= eAthena dev team |
---|
| 5 | //===== Current Version: ===================================== |
---|
| 6 | //= 1.2a |
---|
| 7 | //===== Compatible With: ===================================== |
---|
| 8 | //= eAthena 1.0+ |
---|
| 9 | //===== Description: ========================================= |
---|
| 10 | //= Turns bullets/spheres into packs/casings. |
---|
| 11 | //===== Additional Comments: ================================= |
---|
| 12 | //= 1.0 First version. [SinSloth] |
---|
| 13 | //= 1.1 Optimized version - Reduced to only one function [SinSloth] |
---|
| 14 | //= 1.2 Optimized^2, corrected npc's name [ultramage] |
---|
| 15 | //= 1.2a Optimized. Please, ommit extra NPC names [Lupus] |
---|
| 16 | //============================================================ |
---|
| 17 | |
---|
| 18 | que_ng,187,149,3 script Magazine Dealer Kenny 83,{ |
---|
| 19 | |
---|
| 20 | mes "[Kenny]"; |
---|
| 21 | mes "I am the Casing Dealer, Kenny!"; |
---|
| 22 | if(BaseJob != Job_Gunslinger) { |
---|
| 23 | mes "I'm here to package the Shells"; |
---|
| 24 | mes "and Bullets for Gunslingers."; |
---|
| 25 | next; |
---|
| 26 | mes "[Kenny]"; |
---|
| 27 | mes "But you don't look like a"; |
---|
| 28 | mes "Gunslinger to me. I'm afraid"; |
---|
| 29 | mes "that I must ask you to leave"; |
---|
| 30 | mes "after you're done looking around."; |
---|
| 31 | close; |
---|
| 32 | } |
---|
| 33 | mes "If your bullets are getting"; |
---|
| 34 | mes "too heavy, come to me!"; |
---|
| 35 | next; |
---|
| 36 | mes "[Kenny]"; |
---|
| 37 | mes "I can make you Casings and Packs,"; |
---|
| 38 | mes "which will let you carry the"; |
---|
| 39 | mes "Spheres at a lower weight!"; |
---|
| 40 | mes "Come on! Take a look!"; |
---|
| 41 | next; |
---|
| 42 | switch(select("Lightning Sphere Pack","Blind Sphere Pack","Poison Sphere Pack","Freezing Sphere Pack","Flare Sphere Pack","Bullet Casing","Shell of Blood Casing","Silver Bullet Casing","Cancel")) { |
---|
| 43 | case 1: callfunc "Func_Casing",13204,12144; break; |
---|
| 44 | case 2: callfunc "Func_Casing",13206,12145; break; |
---|
| 45 | case 3: callfunc "Func_Casing",13205,12146; break; |
---|
| 46 | case 4: callfunc "Func_Casing",13207,12147; break; |
---|
| 47 | case 5: callfunc "Func_Casing",13203,12148; break; |
---|
| 48 | case 6: callfunc "Func_Casing",13200,12149; break; |
---|
| 49 | case 7: callfunc "Func_Casing",13202,12150; break; |
---|
| 50 | case 8: callfunc "Func_Casing",13201,12151; break; |
---|
| 51 | default: |
---|
| 52 | mes "[Kenny]"; |
---|
| 53 | mes "Alright. If there's"; |
---|
| 54 | mes "something else I can help"; |
---|
| 55 | mes "you with, please tell me."; |
---|
| 56 | close; |
---|
| 57 | } |
---|
| 58 | close; |
---|
| 59 | } |
---|
| 60 | |
---|
| 61 | function script Func_Casing { |
---|
| 62 | |
---|
| 63 | mes "[Kenny]"; |
---|
| 64 | mes "Please input the amount you want."; |
---|
| 65 | next; |
---|
| 66 | mes "[Kenny]"; |
---|
| 67 | mes "" +getitemname(getarg(1))+ " will"; |
---|
| 68 | if(getarg(0) == 13202) |
---|
| 69 | mes "cost 500 Shells of Blood"; |
---|
| 70 | else |
---|
| 71 | mes "cost 500 " +getitemname(getarg(0))+ "s"; |
---|
| 72 | mes "and 500 zeny each."; |
---|
| 73 | next; |
---|
| 74 | mes "[Kenny]"; |
---|
| 75 | mes "You can trade a maximum of 50."; |
---|
| 76 | mes "Input 0 if you want to cancel."; |
---|
| 77 | next; |
---|
| 78 | input .@amount; |
---|
| 79 | mes "[Kenny]"; |
---|
| 80 | if(.@amount < 1) { |
---|
| 81 | mes "Alright. If there's"; |
---|
| 82 | mes "something else I can help"; |
---|
| 83 | mes "you with, please tell me."; |
---|
| 84 | close; |
---|
| 85 | } |
---|
| 86 | if(.@amount > 50) { |
---|
| 87 | mes "You've exceeded the limit!"; |
---|
| 88 | mes "Try again next time?"; |
---|
| 89 | close; |
---|
| 90 | } |
---|
| 91 | //Weight checking |
---|
| 92 | if(checkweight(getarg(1), .@amount) != 1) { |
---|
| 93 | mes "You are overweight."; |
---|
| 94 | mes "Please clear your inventory."; |
---|
| 95 | close; |
---|
| 96 | } |
---|
| 97 | |
---|
| 98 | //Materials checking |
---|
| 99 | if(countitem(getarg(0)) < .@amount * 500) { |
---|
| 100 | mes "Huh......"; |
---|
| 101 | mes "You don't have enough"; |
---|
| 102 | mes "materials to trade for"; |
---|
| 103 | mes "the number of items you"; |
---|
| 104 | mes "want. Please come with the"; |
---|
| 105 | mes "correct amount of items."; |
---|
| 106 | close; |
---|
| 107 | } |
---|
| 108 | |
---|
| 109 | //Zeny checking |
---|
| 110 | if(Zeny < .@amount * 500) { |
---|
| 111 | mes "Erm... You don't have enough money."; |
---|
| 112 | mes "The fee is 500 zeny"; |
---|
| 113 | mes "Check your zeny and come again."; |
---|
| 114 | close; |
---|
| 115 | } |
---|
| 116 | |
---|
| 117 | mes "Ah very well!"; |
---|
| 118 | mes "The number is confirmed!"; |
---|
| 119 | if(getarg(1) < 12149) |
---|
| 120 | mes "I'll get you the Packs right away."; |
---|
| 121 | else |
---|
| 122 | mes "I'll get you the Casings right away."; |
---|
| 123 | set Zeny, Zeny - .@amount * 500; |
---|
| 124 | delitem getarg(0), .@amount * 500; |
---|
| 125 | getitem getarg(1), .@amount; |
---|
| 126 | close; |
---|
| 127 | } |
---|