ammo_boxes.txt 3.6 KB

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