ammo_boxes.txt 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. //===== rAthena Script =======================================
  2. //= Magazine Dealers
  3. //===== Description: =========================================
  4. //= Turns bullets into magazines/packs.
  5. //===== Changelogs: ==========================================
  6. //= 1.0 First version. [SinSloth]
  7. //= 1.1 Optimized version - Reduced to only one function [SinSloth]
  8. //= 1.2 Optimized^2, corrected npc's name [ultramage]
  9. //= 1.2a Optimized. Please, ommit extra NPC names [Lupus]
  10. //= 1.3 Updated to match AEGIS script. [Kisuka]
  11. //= 1.4 Updated to match AEGIS script again. [Masao]
  12. //= 1.5 Moved Izlude duplicate to pre-re/re paths. [Euphy]
  13. //= 2.0 Clean-up. [Capuche]
  14. //= 2.1 Fixes Issue #1482, where Rebellion jobs cannot use this npc. [Limestone]
  15. //============================================================
  16. que_ng,187,149,3 script Magazine Dealer Kenny::mdk 4_M_01,{
  17. mes "[Kenny]";
  18. if (BaseClass == Job_Gunslinger) {
  19. mes "Welcome to my Magazine Shop.";
  20. mes "As you may know, large numbers";
  21. mes "of bullets can be carried more";
  22. mes "easily when they're in Magazines. Now, can I interest you in";
  23. mes "anything in particular?";
  24. next;
  25. switch(select("Wind Sphere Pack:Shadow Sphere Pack:Poison Sphere Pack:Water Sphere Pack:Fire Sphere Pack:Cartridge:Blood Cartridge:Silver Cartridge:Cancel")) {
  26. case 1: callsub S_Casing,13204,12144;// <bullet id>, <pack id>
  27. case 2: callsub S_Casing,13206,12145;
  28. case 3: callsub S_Casing,13205,12146;
  29. case 4: callsub S_Casing,13207,12147;
  30. case 5: callsub S_Casing,13203,12148;
  31. case 6: callsub S_Casing,13200,12149;
  32. case 7: callsub S_Casing,13202,12150;
  33. case 8: callsub S_Casing,13201,12151;
  34. case 9:
  35. mes "[Kenny]";
  36. mes "Well, if you ever find";
  37. mes "that you have too many";
  38. mes "bullets, come and see me.";
  39. mes "It's a smart idea to store";
  40. mes "bullets with my Magazines.";
  41. close;
  42. }
  43. }
  44. mes "Welcome to my shop.";
  45. mes "Here, I provide Magazines";
  46. mes "and Cartridges for Gunslingers.";
  47. mes "Sorry, but it doesn't look like";
  48. mes "my services would be of any";
  49. mes "use to you, adventurer.";
  50. next;
  51. mes "[Kenny]";
  52. mes "Eh, but if you happen to";
  53. mes "know any Gunslingers, send";
  54. mes "them my way. You can never";
  55. mes "have too many bullets.";
  56. close;
  57. S_Casing:
  58. .@bullet_id = getarg(0);
  59. .@pack_id = getarg(1);
  60. mes "[Kenny]";
  61. mes "Now, you can trade";
  62. mes callfunc("F_InsertPlural",500,getitemname(.@bullet_id));
  63. mes "and 500 zeny for 1 "+getitemname(.@pack_id)+", so make sure";
  64. mes "you have sufficient bullets";
  65. mes "and zeny for this exchange.";
  66. next;
  67. mes "[Kenny]";
  68. mes "You can exchange "+callfunc("F_InsertPlural",500,getitemname(.@bullet_id))+" and 500 zeny";
  69. mes "with 1 "+getitemname(.@pack_id)+".";
  70. next;
  71. mes "[Kenny]";
  72. mes "Remember that I can't give";
  73. mes "you more than 50 Magazines";
  74. mes "at a time. Now please enter";
  75. mes "the number of Magazines you";
  76. mes "want to receive. If you want to cancel, then just enter ''0.''";
  77. next;
  78. input .@amount;
  79. mes "[Kenny]";
  80. if (.@amount > 50 || .@amount == 0) {
  81. mes "Hey, I can't give you";
  82. mes "that many Magazines.";
  83. mes "Please try again, and";
  84. mes "enter a number no";
  85. mes "greater than 50.";
  86. }
  87. else if (countitem(.@bullet_id) >= (500*.@amount)) {
  88. if (Zeny >= (500*.@amount)) {
  89. if (checkweight(.@pack_id,.@amount) == 0) {
  90. mes "Hey, you've got a lot";
  91. mes "of junk crammed in your";
  92. mes "Inventory. Free up some";
  93. mes "space, and then come back";
  94. mes "and trade your bullets for";
  95. mes "some Magazines later, okay?";
  96. } else {
  97. mes "Alright, here are";
  98. mes "your Magazines. Thanks";
  99. mes "for visiting my shop, and";
  100. mes "I hope that you use all";
  101. mes "of your ammo wisely.";
  102. Zeny = Zeny -500*.@amount;
  103. delitem .@bullet_id,(500*.@amount);
  104. getitem .@pack_id,.@amount;
  105. }
  106. } else {
  107. mes "Sorry, but you don't";
  108. mes "have enough zeny for";
  109. mes "this Magazine exchange.";
  110. mes "Come back to my shop";
  111. mes "after you've saved up";
  112. mes "some more money.";
  113. }
  114. } else {
  115. mes "Sorry, but you don't";
  116. mes "have enough bullets for";
  117. mes "this Magazine exchange.";
  118. mes "Maybe you should double";
  119. mes "check your Inventory, and";
  120. mes "then come back to me later.";
  121. }
  122. close;
  123. }
  124. izlude,171,127,3 duplicate(mdk) Magazine Dealer Kenny#iz 4_M_01