ammo_boxes.txt 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. //===== rAthena Script =======================================
  2. //= Magazine Dealers
  3. //===== By: ==================================================
  4. //= rAthena Dev Team
  5. //===== Current Version: =====================================
  6. //= 2.0
  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. //============================================================
  21. alberta,118,157,3 script Magazine Dealer Kenny::mdk 4_M_01,{
  22. mes "[Kenny]";
  23. if (BaseJob == Job_Gunslinger) {
  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: callsub S_Casing,13204,12144;// <bullet id>, <pack id>
  32. case 2: callsub S_Casing,13206,12145;
  33. case 3: callsub S_Casing,13205,12146;
  34. case 4: callsub S_Casing,13207,12147;
  35. case 5: callsub S_Casing,13203,12148;
  36. case 6: callsub S_Casing,13200,12149;
  37. case 7: callsub S_Casing,13202,12150;
  38. case 8: callsub S_Casing,13201,12151;
  39. case 9:
  40. mes "[Kenny]";
  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 "Welcome to my shop.";
  50. mes "Here, I provide Magazines";
  51. mes "and Cartridges for Gunslingers.";
  52. mes "Sorry, but it doesn't look like";
  53. mes "my services would be of any";
  54. mes "use to you, adventurer.";
  55. next;
  56. mes "[Kenny]";
  57. mes "Eh, but if you happen to";
  58. mes "know any Gunslingers, send";
  59. mes "them my way. You can never";
  60. mes "have too many bullets.";
  61. close;
  62. S_Casing:
  63. .@bullet_id = getarg(0);
  64. .@pack_id = getarg(1);
  65. mes "[Kenny]";
  66. mes "Now, you can trade";
  67. mes callfunc("F_InsertPlural",500,getitemname(.@bullet_id));
  68. mes "and 500 zeny for 1 "+getitemname(.@pack_id)+", so make sure";
  69. mes "you have sufficient bullets";
  70. mes "and zeny for this exchange.";
  71. next;
  72. mes "[Kenny]";
  73. mes "You can exchange "+callfunc("F_InsertPlural",500,getitemname(.@bullet_id))+" and 500 zeny";
  74. mes "with 1 "+getitemname(.@pack_id)+".";
  75. next;
  76. mes "[Kenny]";
  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. mes "[Kenny]";
  85. if (.@amount > 50 || .@amount == 0) {
  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. }
  92. else if (countitem(.@bullet_id) >= (500*.@amount)) {
  93. if (Zeny >= (500*.@amount)) {
  94. if (checkweight(.@pack_id,.@amount) == 0) {
  95. mes "Hey, you've got a lot";
  96. mes "of junk crammed in your";
  97. mes "Inventory. Free up some";
  98. mes "space, and then come back";
  99. mes "and trade your bullets for";
  100. mes "some Magazines later, okay?";
  101. } else {
  102. mes "Alright, here are";
  103. mes "your Magazines. Thanks";
  104. mes "for visiting my shop, and";
  105. mes "I hope that you use all";
  106. mes "of your ammo wisely.";
  107. Zeny = Zeny -500*.@amount;
  108. delitem .@bullet_id,(500*.@amount);
  109. getitem .@pack_id,.@amount;
  110. }
  111. } else {
  112. mes "Sorry, but you don't";
  113. mes "have enough zeny for";
  114. mes "this Magazine exchange.";
  115. mes "Come back to my shop";
  116. mes "after you've saved up";
  117. mes "some more money.";
  118. }
  119. } else {
  120. mes "Sorry, but you don't";
  121. mes "have enough bullets for";
  122. mes "this Magazine exchange.";
  123. mes "Maybe you should double";
  124. mes "check your Inventory, and";
  125. mes "then come back to me later.";
  126. }
  127. close;
  128. }