[1] | 1 | //===== eAthena Script ======================================= |
---|
| 2 | //= Bullet Dealer Tony |
---|
| 3 | //===== By =================================================== |
---|
| 4 | //= Playtester, Paradox924X |
---|
| 5 | //===== Version ============================================== |
---|
| 6 | //= 1.3 |
---|
| 7 | //===== Compatible With ====================================== |
---|
| 8 | //= eAthena SVN with jAthena scripting engine and . variables |
---|
| 9 | //===== Description ========================================== |
---|
| 10 | //= Bullet trader. |
---|
| 11 | //===== Comments ============================================= |
---|
| 12 | //= 1.0 First version [Playtester] |
---|
| 13 | //= 1.1 Converted from Aegis [Paradox924X] |
---|
| 14 | //= 1.2 More optimized conversion [Legionaire] |
---|
| 15 | //= 1.2a Removed .GATs [Lupus] |
---|
| 16 | //= 1.3 Fixed [Playtester] Optimized. Got rid of @vars [Lupus] |
---|
| 17 | //============================================================ |
---|
| 18 | |
---|
| 19 | que_ng,187,156,3 script Bullet Dealer Tony 86,{ |
---|
| 20 | |
---|
| 21 | mes "[Tony]"; |
---|
| 22 | if (BaseJob == Job_Gunslinger) { |
---|
| 23 | mes "I'm Bullet-tooth Tony!"; |
---|
| 24 | mes "Whenever your out of bullets,"; |
---|
| 25 | mes "Visit me!!!"; |
---|
| 26 | next; |
---|
| 27 | mes "[Tony]"; |
---|
| 28 | mes "Now~! Friend~Companion~ Buddy~"; |
---|
| 29 | mes "What do you need?!"; |
---|
| 30 | mes "Choose anything~!"; |
---|
| 31 | mes "And pay money~!"; |
---|
| 32 | next; |
---|
| 33 | switch(select("Poison Sphere:Flare Sphere:Lighting Sphere:Blind Sphere:Freezing Sphere:Cancel")) { |
---|
| 34 | case 1: callfunc "Bullet_Trade",937,10,13205; break; |
---|
| 35 | case 2: callfunc "Bullet_Trade",7097,2,13203; break; |
---|
| 36 | case 3: callfunc "Bullet_Trade",7053,3,13204; break; |
---|
| 37 | case 4: callfunc "Bullet_Trade",1024,5,13206; break; |
---|
| 38 | case 5: callfunc "Bullet_Trade",7054,2,13207; break; |
---|
| 39 | default: |
---|
| 40 | mes "[Tony]"; |
---|
| 41 | mes "Mmm~ Okay~"; |
---|
| 42 | mes "Please visit again~"; |
---|
| 43 | mes "I, Bullet-tooth Tony,"; |
---|
| 44 | mes "Will always be here~!!!"; |
---|
| 45 | close; |
---|
| 46 | } |
---|
| 47 | } |
---|
| 48 | mes "I'm a trader who supplies"; |
---|
| 49 | mes "Gunslingers with trade items."; |
---|
| 50 | mes "I am called Bullet-tooth Tony."; |
---|
| 51 | next; |
---|
| 52 | mes "[Tony]"; |
---|
| 53 | mes "I don't think you are a Gunslinger"; |
---|
| 54 | mes "So just look around"; |
---|
| 55 | mes "and go."; |
---|
| 56 | close; |
---|
| 57 | } |
---|
| 58 | |
---|
| 59 | function script Bullet_Trade { |
---|
| 60 | mes "[Tony]"; |
---|
| 61 | mes "Input the amount you wish to purchase."; |
---|
| 62 | next; |
---|
| 63 | mes "[Tony]"; |
---|
| 64 | mes "We trade 30 "+getitemname(getarg(2))+"s for"; |
---|
| 65 | mes "1 Phracon,"; |
---|
| 66 | mes "1 Emveretarcon,"; |
---|
| 67 | mes "and "+getarg(1)+" "+getitemname(getarg(0))+"."; |
---|
| 68 | next; |
---|
| 69 | mes "[Tony]"; |
---|
| 70 | mes "The maximum number you can trade is 500."; |
---|
| 71 | mes "If you want to cancel, input 0."; |
---|
| 72 | next; |
---|
| 73 | input .@amount; |
---|
| 74 | mes "[Tony]"; |
---|
| 75 | if (.@amount < 1 || .@amount > 500) { |
---|
| 76 | mes "Invalid Amount!"; |
---|
| 77 | mes "Enter again~!"; |
---|
| 78 | close; |
---|
| 79 | } else if (countitem(1010) >= .@amount && countitem(1011) >= .@amount && countitem(getarg(0)) >= (.@amount*getarg(1))) { |
---|
| 80 | if (checkweight(getarg(2),.@amount * 30) == 0) { |
---|
| 81 | mes "I cannot give it to you because your inventory is full. Come back after your inventory has more space."; |
---|
| 82 | close; |
---|
| 83 | } else { |
---|
| 84 | mes "Oh~ Good!"; |
---|
| 85 | mes "Trade number checked!"; |
---|
| 86 | mes "I'll trade immediately."; |
---|
| 87 | delitem 1010,.@amount; |
---|
| 88 | delitem 1011,.@amount; |
---|
| 89 | delitem getarg(0),.@amount * getarg(1); |
---|
| 90 | getitem getarg(2),.@amount * 30; |
---|
| 91 | close; |
---|
| 92 | } |
---|
| 93 | } else { |
---|
| 94 | mes "Tsk Tsk~"; |
---|
| 95 | mes "You do not have"; |
---|
| 96 | mes "enough items for the"; |
---|
| 97 | mes "items you want to trade."; |
---|
| 98 | mes "Prepare again and come back."; |
---|
| 99 | close; |
---|
| 100 | } |
---|
| 101 | } |
---|