ammo_boxes.txt 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. //===== rAthena Script =======================================
  2. //= Magazine Dealer Kenny
  3. //===== By: ==================================================
  4. //= rAthena dev team
  5. //===== Current Version: =====================================
  6. //= 1.5
  7. //===== Compatible With: =====================================
  8. //= rAthena SVN
  9. //===== Description: =========================================
  10. //= Turns bullets into magazines/packs.
  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. //= 1.3 Updated to match AEGIS script. [Kisuka]
  17. //= 1.4 Updated to match AEGIS script again. [Masao]
  18. //= 1.5 Moved Izlude duplicate to pre-re/re paths. [Euphy]
  19. //============================================================
  20. alberta,118,157,3 script Magazine Dealer Tonny::mdk 83,{
  21. set .n$, compare(strnpcinfo(1),"Tonny")?"[Tonny]":"[Kenny]";
  22. if(BaseJob == Job_Gunslinger) {
  23. mes .n$;
  24. mes "Welcome to my Magazine Shop.";
  25. mes "As you may know, large numbers";
  26. mes "of bullets can be carried more";
  27. mes "easily when they're in Magazines. Now, can I interest you in";
  28. mes "anything in particular?";
  29. next;
  30. switch(select("Wind Sphere Pack:Shadow Sphere Pack:Poison Sphere Pack:Water Sphere Pack:Fire Sphere Pack:Cartridge:Blood Cartridge:Silver Cartridge:Cancel")) {
  31. case 1: callfunc "Func_Casing",13204,12144; break;
  32. case 2: callfunc "Func_Casing",13206,12145; break;
  33. case 3: callfunc "Func_Casing",13205,12146; break;
  34. case 4: callfunc "Func_Casing",13207,12147; break;
  35. case 5: callfunc "Func_Casing",13203,12148; break;
  36. case 6: callfunc "Func_Casing",13200,12149; break;
  37. case 7: callfunc "Func_Casing",13202,12150; break;
  38. case 8: callfunc "Func_Casing",13201,12151; break;
  39. case 9:
  40. mes .n$;
  41. mes "Well, if you ever find";
  42. mes "that you have too many";
  43. mes "bullets, come and see me.";
  44. mes "It's a smart idea to store";
  45. mes "bullets with my Magazines.";
  46. close;
  47. }
  48. }
  49. mes .n$;
  50. mes "Welcome to my shop.";
  51. mes "Here, I provide Magazines";
  52. mes "and Cartridges for Gunslingers.";
  53. mes "Sorry, but it doesn't look like";
  54. mes "my services would be of any";
  55. mes "use to you, adventurer.";
  56. next;
  57. mes .n$;
  58. mes "Eh, but if you happen to";
  59. mes "know any Gunslingers, send";
  60. mes "them my way. You can never";
  61. mes "have too many bullets.";
  62. close;
  63. }
  64. function script Func_Casing {
  65. mes .n$;
  66. mes "Now, you can trade";
  67. mes "500 "+getitemname(getarg(0))+"s";
  68. mes "and 500 zeny for 1 "+getitemname(getarg(1))+", so make sure";
  69. mes "you have sufficient bullets";
  70. mes "and zeny for this exchange.";
  71. next;
  72. mes .n$;
  73. mes "You can exchange 500 "+getitemname(getarg(0))+"s and 500 zeny";
  74. mes "with 1 "+getitemname(getarg(1))+".";
  75. next;
  76. mes .n$;
  77. mes "Remember that I can't give";
  78. mes "you more than 50 Magazines";
  79. mes "at a time. Now please enter";
  80. mes "the number of Magazines you";
  81. mes "want to receive. If you want to cancel, then just enter ''0.''";
  82. next;
  83. input .@amount;
  84. if(.@amount > 50 || .@amount == 0) {
  85. mes .n$;
  86. mes "Hey, I can't give you";
  87. mes "that many Magazines.";
  88. mes "Please try again, and";
  89. mes "enter a number no";
  90. mes "greater than 50.";
  91. close;
  92. }
  93. if (countitem(getarg(0)) >= (500*.@amount)) {
  94. if (Zeny >= (500*.@amount)) {
  95. if (checkweight(getarg(1),.@amount) == 0) {
  96. mes .n$;
  97. mes "Hey, you've got a lot";
  98. mes "of junk crammed in your";
  99. mes "Inventory. Free up some";
  100. mes "space, and then come back";
  101. mes "and trade your bullets for";
  102. mes "some Magazines later, okay?";
  103. close;
  104. }else{
  105. mes .n$;
  106. mes "Alright, here are";
  107. mes "your Magazines. Thanks";
  108. mes "for visiting my shop, and";
  109. mes "I hope that you use all";
  110. mes "of your ammo wisely.";
  111. set Zeny,Zeny-500*.@amount;
  112. delitem getarg(0),500*.@amount;
  113. getitem getarg(1),.@amount;
  114. close;
  115. }
  116. }else{
  117. mes .n$;
  118. mes "Sorry, but you don't";
  119. mes "have enough zeny for";
  120. mes "this Magazine exchange.";
  121. mes "Come back to my shop";
  122. mes "after you've saved up";
  123. mes "some more money.";
  124. close;
  125. }
  126. }else{
  127. mes .n$;
  128. mes "Sorry, but you don't";
  129. mes "have enough bullets for";
  130. mes "this Magazine exchange.";
  131. mes "Maybe you should double";
  132. mes "check your Inventory, and";
  133. mes "then come back to me later.";
  134. close;
  135. }
  136. }