ammo_boxes.txt 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. //===== rAthena Script =======================================
  2. //= Magazine Dealers
  3. //===== By: ==================================================
  4. //= rAthena Dev Team
  5. //===== Current Version: =====================================
  6. //= 2.1
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  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. //= 2.0 Clean-up. [Capuche]
  20. //= 2.1 Fixes Issue #1482, where Rebellion jobs cannot use this npc. [Limestone]
  21. //============================================================
  22. alberta,118,157,3 script Magazine Dealer Kenny::mdk 4_M_01,{
  23. mes "[Kenny]";
  24. if (BaseClass == Job_Gunslinger) {
  25. mes "Welcome to my Magazine Shop.";
  26. mes "As you may know, large numbers";
  27. mes "of bullets can be carried more";
  28. mes "easily when they're in Magazines. Now, can I interest you in";
  29. mes "anything in particular?";
  30. next;
  31. switch(select("Wind Sphere Pack:Shadow Sphere Pack:Poison Sphere Pack:Water Sphere Pack:Fire Sphere Pack:Cartridge:Blood Cartridge:Silver Cartridge:Cancel")) {
  32. case 1: callsub S_Casing,13204,12144;// <bullet id>, <pack id>
  33. case 2: callsub S_Casing,13206,12145;
  34. case 3: callsub S_Casing,13205,12146;
  35. case 4: callsub S_Casing,13207,12147;
  36. case 5: callsub S_Casing,13203,12148;
  37. case 6: callsub S_Casing,13200,12149;
  38. case 7: callsub S_Casing,13202,12150;
  39. case 8: callsub S_Casing,13201,12151;
  40. case 9:
  41. mes "[Kenny]";
  42. mes "Well, if you ever find";
  43. mes "that you have too many";
  44. mes "bullets, come and see me.";
  45. mes "It's a smart idea to store";
  46. mes "bullets with my Magazines.";
  47. close;
  48. }
  49. }
  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 "[Kenny]";
  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. S_Casing:
  64. .@bullet_id = getarg(0);
  65. .@pack_id = getarg(1);
  66. mes "[Kenny]";
  67. mes "Now, you can trade";
  68. mes callfunc("F_InsertPlural",500,getitemname(.@bullet_id));
  69. mes "and 500 zeny for 1 "+getitemname(.@pack_id)+", so make sure";
  70. mes "you have sufficient bullets";
  71. mes "and zeny for this exchange.";
  72. next;
  73. mes "[Kenny]";
  74. mes "You can exchange "+callfunc("F_InsertPlural",500,getitemname(.@bullet_id))+" and 500 zeny";
  75. mes "with 1 "+getitemname(.@pack_id)+".";
  76. next;
  77. mes "[Kenny]";
  78. mes "Remember that I can't give";
  79. mes "you more than 50 Magazines";
  80. mes "at a time. Now please enter";
  81. mes "the number of Magazines you";
  82. mes "want to receive. If you want to cancel, then just enter ''0.''";
  83. next;
  84. input .@amount;
  85. mes "[Kenny]";
  86. if (.@amount > 50 || .@amount == 0) {
  87. mes "Hey, I can't give you";
  88. mes "that many Magazines.";
  89. mes "Please try again, and";
  90. mes "enter a number no";
  91. mes "greater than 50.";
  92. }
  93. else if (countitem(.@bullet_id) >= (500*.@amount)) {
  94. if (Zeny >= (500*.@amount)) {
  95. if (checkweight(.@pack_id,.@amount) == 0) {
  96. mes "Hey, you've got a lot";
  97. mes "of junk crammed in your";
  98. mes "Inventory. Free up some";
  99. mes "space, and then come back";
  100. mes "and trade your bullets for";
  101. mes "some Magazines later, okay?";
  102. } else {
  103. mes "Alright, here are";
  104. mes "your Magazines. Thanks";
  105. mes "for visiting my shop, and";
  106. mes "I hope that you use all";
  107. mes "of your ammo wisely.";
  108. Zeny = Zeny -500*.@amount;
  109. delitem .@bullet_id,(500*.@amount);
  110. getitem .@pack_id,.@amount;
  111. }
  112. } else {
  113. mes "Sorry, but you don't";
  114. mes "have enough zeny for";
  115. mes "this Magazine exchange.";
  116. mes "Come back to my shop";
  117. mes "after you've saved up";
  118. mes "some more money.";
  119. }
  120. } else {
  121. mes "Sorry, but you don't";
  122. mes "have enough bullets for";
  123. mes "this Magazine exchange.";
  124. mes "Maybe you should double";
  125. mes "check your Inventory, and";
  126. mes "then come back to me later.";
  127. }
  128. close;
  129. }