ammo_boxes.txt 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  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. //= 2.2 Updated to new bullets. [Aleos]
  16. //============================================================
  17. que_ng,187,149,3 script Magazine Dealer Kenny::mdk 4_M_01,{
  18. mes "[Kenny]";
  19. mes "Bullet bags will help you carry bullets much more easily.";
  20. mes "Come take a look~";
  21. next;
  22. switch(select("Various Bullet Cases:Sphere Exchange:Old Sphere Exchange:Slug Exchange:Cancel")) {
  23. case 1:
  24. switch(select("Bullet Case:Bloody Bullet Case:Silver Bullet Case:Ammo AP Bullet Case:Ammo Blazing Bullet Case:Ammo Freezing Bullet Case:Ammo Lightning Bullet Case:Ammo Magic Stone Bullet Case:Ammo Purifying Bullet Case:Flare Bullet Case:Lightning Bullet Case:Ice Bullet Case:Poison Bullet Case:Blind Bullet Case:Cancel")) {
  25. case 1: callsub S_Casing,13200,12149;
  26. case 2: callsub S_Casing,13222,22737;
  27. case 3: callsub S_Casing,13221,22738;
  28. case 4: callsub S_Casing,13215,22744;
  29. case 5: callsub S_Casing,13216,22745;
  30. case 6: callsub S_Casing,13217,22746;
  31. case 7: callsub S_Casing,13218,22747;
  32. case 8: callsub S_Casing,13219,22748;
  33. case 9: callsub S_Casing,13220,22749;
  34. case 10: callsub S_Casing,13228,23123;
  35. case 11: callsub S_Casing,13229,23124;
  36. case 12: callsub S_Casing,13230,23125;
  37. case 13: callsub S_Casing,13231,23126;
  38. case 14: callsub S_Casing,13232,23127;
  39. case 15: callsub S_Close;
  40. }
  41. case 2:
  42. switch(select("Fire Bullet:Wind Bullet:Freezing Bullet:Poison Bullet:Blind Bullet:Cancel")) {
  43. case 1: callsub S_Sphere_Exchange,13223,13228;
  44. case 2: callsub S_Sphere_Exchange,13224,13229;
  45. case 3: callsub S_Sphere_Exchange,13227,13230;
  46. case 4: callsub S_Sphere_Exchange,13225,13231;
  47. case 5: callsub S_Sphere_Exchange,13226,13232;
  48. case 6: callsub S_Close;
  49. }
  50. case 3:
  51. switch(select("Fire Sphere:Wind Sphere:Freezing Sphere:Poison Sphere:Blind Sphere:Cancel")) {
  52. case 1: callsub S_Old_Sphere_Exchange,13203,13228;
  53. case 2: callsub S_Old_Sphere_Exchange,13204,13229;
  54. case 3: callsub S_Old_Sphere_Exchange,13207,13230;
  55. case 4: callsub S_Old_Sphere_Exchange,13205,13231;
  56. case 5: callsub S_Old_Sphere_Exchange,13206,13232;
  57. case 6: callsub S_Close;
  58. }
  59. case 4:
  60. switch(select("Slug Ammunition L:Slug Ammunition M:Slug Ammunition H:Slug Ammunition SH:Slug Ammunition XH:Cancel")) {
  61. case 1: callsub S_Slug_Exchange,13210,24;
  62. case 2: callsub S_Slug_Exchange,13211,12;
  63. case 3: callsub S_Slug_Exchange,13212,8;
  64. case 4: callsub S_Slug_Exchange,13213,6;
  65. case 5: callsub S_Slug_Exchange,13214,5;
  66. case 6: callsub S_Close;
  67. }
  68. case 5:
  69. callsub S_Close;
  70. }
  71. S_Casing:
  72. .@bullet_id = getarg(0);
  73. .@pack_id = getarg(1);
  74. .@bullet_str$ = getitemname(.@bullet_id);
  75. .@pack_str$ = getitemname(.@pack_id);
  76. .@bullet_count = countitem(.@bullet_id);
  77. .@pack_count = .@bullet_count / 500;
  78. if (.@bullet_count < 500 || getequipid(EQI_AMMO) != -1 || BaseClass != Job_Gunslinger) {
  79. mes "[Kenny]";
  80. mes "Hey~ You need the exact amount of items to exchange. Go get some more.";
  81. mes "You must have 500 or more of ^FF0000" + .@bullet_str$ + "^000000, ok? Also, make sure not to ^FF0000wear^000000 them if you want to exchange.";
  82. close;
  83. }
  84. mes "[Kenny]";
  85. mes "You've chosen ^FF0000" + .@pack_str$ + "^000000.";
  86. mes "You need 500 ^3131FF" + .@bullet_str$ + "^000000 to make 1 ^3131FF" + .@bullet_str$ + "^000000 item, and it will cost ^3131FF500^000000 zeny.";
  87. mes "How many do you want to exchange?";
  88. next;
  89. switch(select("Exchange all:Make only 1:Cancel")) {
  90. case 1:
  91. mes "[Kenny]";
  92. mes "Bullet count: ^3131FF" + .@bullet_count;
  93. mes "Combination of bullet bags: ^3131FF" + .@pack_count;
  94. mes "Zeny required: ^3131FF" + .@pack_count * 500;
  95. next;
  96. mes "Do you want to exchange?";
  97. next;
  98. switch(select("Exchange:Cancel")) {
  99. case 1:
  100. if (Zeny < .@pack_count * 500) {
  101. mes "[Kenny]";
  102. mes "Hey~ You need the exact amount of Zeny to exchange. Go get some more.";
  103. mes "You must have ^FF0000" + .@pack_count * 500 + "^000000, ok?";
  104. close;
  105. }
  106. mes "[Kenny]";
  107. mes "All done.";
  108. mes "The bag is useless when the weight of inventory gets over 70%. Please be careful.";
  109. Zeny -= .@pack_count * 500;
  110. delitem .@bullet_id, .@pack_count * 500;
  111. getitem .@pack_id, .@pack_count;
  112. close;
  113. case 2:
  114. close;
  115. }
  116. case 2:
  117. if (Zeny < 500) {
  118. mes "[Kenny]";
  119. mes "Hey~ You need the exact amount of Zeny to exchange. Go get some more.";
  120. mes "You must have ^FF0000500^000000, ok?";
  121. close;
  122. }
  123. mes "[Kenny]";
  124. mes "All done.";
  125. mes "The bag is useless when the weight of inventory gets over 70%. Please be careful.";
  126. Zeny -= 500;
  127. delitem .@bullet_id, 500;
  128. getitem .@pack_id, 1;
  129. close;
  130. case 3:
  131. callsub S_Close;
  132. }
  133. S_Sphere_Exchange:
  134. .@old_id = getarg(0);
  135. .@new_id = getarg(1);
  136. .@old_str$ = getitemname(.@old_id);
  137. .@new_str$ = getitemname(.@new_id);
  138. .@old_count = countitem(.@old_id);
  139. .@new_count = .@old_count / 10;
  140. if (.@old_count < 10 || getequipid(EQI_AMMO) != -1 || BaseClass != Job_Gunslinger) {
  141. mes "[Kenny]";
  142. mes "Hey~ You need the exact amount of items to exchange. Go get some more.";
  143. mes "You must have 10 or more of ^FF0000" + .@old_str$ + "^000000, ok? Also, make sure not to ^FF0000wear^000000 them if you want to exchange.";
  144. close;
  145. }
  146. mes "[Kenny]";
  147. mes "You've chosen ^FF0000" + .@old_str$ + "^000000.";
  148. mes "You need 10 ^3131FF" + .@old_str$ + "^000000 to make 1 ^3131FF" + .@new_str$ + "^000000 item.";
  149. mes "How many do you want to exchange?";
  150. next;
  151. switch(select("Exchange all:Make only 1:Cancel")) {
  152. case 1:
  153. mes "[Kenny]";
  154. mes .@old_str$ + " count: ^3131FF" + .@old_count;
  155. mes .@new_str$ + " count: ^3131FF" + .@new_count;
  156. next;
  157. mes "Do you want to exchange?";
  158. next;
  159. switch(select("Exchange:Cancel")) {
  160. case 1:
  161. mes "[Kenny]";
  162. mes "All done.";
  163. delitem .@slug_id, .@new_count * 10;
  164. getitem .@new_slug_id, .@old_count;
  165. close;
  166. case 2:
  167. close;
  168. }
  169. case 2:
  170. mes "[Kenny]";
  171. mes "All done.";
  172. delitem .@old_id, 10;
  173. getitem .@new_id, 1;
  174. close;
  175. case 3:
  176. callsub S_Close;
  177. }
  178. S_Old_Sphere_Exchange:
  179. .@old_id = getarg(0);
  180. .@new_id = getarg(1);
  181. .@old_str$ = getitemname(.@old_id);
  182. .@new_str$ = getitemname(.@new_id);
  183. .@old_count = countitem(.@old_id);
  184. if (.@old_count < 1 || getequipid(EQI_AMMO) != -1 || BaseClass != Job_Gunslinger) {
  185. mes "[Kenny]";
  186. mes "Hey~ You need the exact amount of items to exchange. Go get some more.";
  187. mes "You must have 1 or more of ^FF0000" + .@old_str$ + "^000000, ok? Also, make sure not to ^FF0000wear^000000 them if you want to exchange.";
  188. close;
  189. }
  190. mes "[Kenny]";
  191. mes "You've chosen ^FF0000" + .@old_str$ + "^000000.";
  192. mes "You need 1 ^3131FF" + .@old_str$ + "^000000 to make 1 ^3131FF" + .@new_str$ + "^000000 item.";
  193. mes "How many do you want to exchange?";
  194. next;
  195. switch(select("Exchange all:Make only 1:Cancel")) {
  196. case 1:
  197. mes "[Kenny]";
  198. mes .@old_str$ + " count: ^3131FF" + .@old_count;
  199. mes .@new_str$ + " count: ^3131FF" + .@old_count;
  200. next;
  201. mes "Do you want to exchange?";
  202. next;
  203. switch(select("Exchange:Cancel")) {
  204. case 1:
  205. mes "[Kenny]";
  206. mes "All done.";
  207. delitem .@slug_id, .@old_count;
  208. getitem .@new_slug_id, .@old_count;
  209. close;
  210. case 2:
  211. close;
  212. }
  213. case 2:
  214. mes "[Kenny]";
  215. mes "All done.";
  216. delitem .@old_id, 1;
  217. getitem .@new_id, 1;
  218. close;
  219. case 3:
  220. callsub S_Close;
  221. }
  222. S_Slug_Exchange:
  223. .@slug_id = getarg(0);
  224. .@req_count = getarg(1);
  225. .@slug_str$ = getitemname(.@slug_id);
  226. .@new_slug_str$ = getitemname(25187);
  227. .@count = countitem(.@slug_id);
  228. .@new_count = .@count / .@req_count;
  229. if (.@count < .@req_count || getequipid(EQI_AMMO) != -1 || BaseClass != Job_Gunslinger) {
  230. mes "[Kenny]";
  231. mes "Hey~ You need the exact amount of items to exchange. Go get some more.";
  232. mes "You must have " + .@req_count + " or more of ^FF0000" + .@slug_str$ + "^000000, ok? Also, make sure not to ^FF0000wear^000000 them if you want to exchange.";
  233. close;
  234. }
  235. mes "[Kenny]";
  236. mes "You've chosen ^FF0000" + .@slug_str$ + "^000000.";
  237. mes "You need " + .@req_count + " ^3131FF" + .@slug_str$ + "^000000 to make 1 ^3131FF" + .@new_slug_str$ + "^000000 item.";
  238. mes "How many do you want to exchange?";
  239. next;
  240. switch(select("Exchange all:Make only 1:Cancel")) {
  241. case 1:
  242. mes "[Kenny]";
  243. mes .@slug_str$ + " count: ^3131FF" + .@count;
  244. mes .@new_slug_str$ + " count: ^3131FF" + .@new_count;
  245. next;
  246. mes "Do you want to exchange?";
  247. next;
  248. switch(select("Exchange:Cancel")) {
  249. case 1:
  250. mes "[Kenny]";
  251. mes "All done.";
  252. delitem .@slug_id, .@new_count * 500;
  253. getitem 25187, .@new_count;
  254. close;
  255. case 2:
  256. close;
  257. }
  258. case 2:
  259. mes "[Kenny]";
  260. mes "All done.";
  261. delitem .@slug_id, .@req_count;
  262. getitem 25187, 1;
  263. close;
  264. case 3:
  265. callsub S_Close;
  266. }
  267. S_Close:
  268. mes "[Kenny]";
  269. mes "Okay.";
  270. mes "If you need anything";
  271. mes "please come back.";
  272. close;
  273. }
  274. alberta,118,157,3 duplicate(mdk) Magazine Dealer Kenny#al 4_M_01
  275. izlude_in,74,104,5 duplicate(mdk) Magazine Dealer Kenny#iz 4_M_01