Guest User

Untitled

a guest
May 4th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.21 KB | None | 0 0
  1. //===== eAthena Script =======================================
  2. //= Magazine Dealer Kenny
  3. //===== By: ==================================================
  4. //= eAthena dev team
  5. //===== Current Version: =====================================
  6. //= 1.2b
  7. //===== Compatible With: =====================================
  8. //= eAthena 1.0+
  9. //===== Description: =========================================
  10. //= Turns bullets/spheres into packs/casings.
  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.2b Added "As many as possible" Option [Jacob]
  17. //============================================================
  18.  
  19. que_ng,187,149,3 script Magazine Dealer Kenny 83,{
  20.  
  21. mes "[Kenny]";
  22. mes "I am the Casing Dealer, Kenny!";
  23. if(BaseJob != Job_Gunslinger) {
  24. mes "I'm here to package the Shells";
  25. mes "and Bullets for Gunslingers.";
  26. next;
  27. mes "[Kenny]";
  28. mes "But you don't look like a";
  29. mes "Gunslinger to me. I'm afraid";
  30. mes "that I must ask you to leave";
  31. mes "after you're done looking around.";
  32. close;
  33. }
  34. mes "If your bullets are getting";
  35. mes "too heavy, come to me!";
  36. next;
  37. mes "[Kenny]";
  38. mes "I can make you Casings and Packs,";
  39. mes "which will let you carry the";
  40. mes "Spheres at a lower weight!";
  41. mes "Come on! Take a look!";
  42. next;
  43. switch(select("Lightning Sphere Pack","Blind Sphere Pack","Poison Sphere Pack","Freezing Sphere Pack","Flare Sphere Pack","Bullet Casing","Shell of Blood Casing","Silver Bullet Casing","Cancel")) {
  44. case 1: callfunc "Func_Casing",13204,12144; break;
  45. case 2: callfunc "Func_Casing",13206,12145; break;
  46. case 3: callfunc "Func_Casing",13205,12146; break;
  47. case 4: callfunc "Func_Casing",13207,12147; break;
  48. case 5: callfunc "Func_Casing",13203,12148; break;
  49. case 6: callfunc "Func_Casing",13200,12149; break;
  50. case 7: callfunc "Func_Casing",13202,12150; break;
  51. case 8: callfunc "Func_Casing",13201,12151; break;
  52. default:
  53. mes "[Kenny]";
  54. mes "Alright. If there's";
  55. mes "something else I can help";
  56. mes "you with, please tell me.";
  57. close;
  58. }
  59. close;
  60. }
  61.  
  62. function script Func_Casing {
  63. if (countitem(getarg(0)) < 500) {
  64. mes "[Kenny]";
  65. mes "I'm sorry, but you dont have 500 of this bullet.";
  66. close;
  67. }
  68. mes "[Kenny]";
  69. mes "Please input the amount you want.";
  70. next;
  71. mes "[Kenny]";
  72. mes "" +getitemname(getarg(1))+ " will";
  73. if(getarg(0) == 13202)
  74. mes "cost 500 Shells of Blood";
  75. else
  76. mes "cost 500 " +getitemname(getarg(0))+ "s";
  77. mes "and 500 zeny each.";
  78. next;
  79. mes "[Kenny]";
  80. mes "How many would you like?";
  81. next;
  82. switch(select("Store as many Arrows in quivers as possible:Purchase 1 quiver:Cancel")) {
  83. case 1:
  84. set .@bullets,countitem(getarg(0));
  85. set .@boxes,.@bullets / 500;
  86. set .@bullets_used,.@boxes * 500;
  87. set .@zeny_req,.@boxes * 500;
  88. mes "Number of";
  89. if(getarg(0) == 13202)
  90. mes "Blood Bullets: ^3131FF"+.@bullets+" ^000000";
  91. else
  92. mes getitemname(getarg(0))+ " Bullets: ^3131FF"+.@bullets+" ^000000";
  93. mes "Maximum Number";
  94. mes "of Purchasable";
  95. mes "Boxes: ^3131FF"+.@boxes+" ^000000";
  96. mes "Zeny required: ^3131FF"+.@zeny_req+" Zeny^000000";
  97. next;
  98. mes "[Kenny]";
  99. mes "Would you like to";
  100. mes "buy as many boxes";
  101. mes "as you can for the Arrows";
  102. mes "you are currently carrying?";
  103. next;
  104. if (select("Yes:Cancel") == 1) {
  105. if (.@zeny_req < Zeny) {
  106. mes "[Inventor Jaax]";
  107. mes "There you go!";
  108. mes "Just remember, ^FF0000you won't be able to use the Box when your carried weight is 90% of your maximum weight limit^000000.";
  109. set zeny,zeny-.@zeny_req;
  110. delitem getarg(0),.@bullets_used;
  111. getitem getarg(1),.@boxes;
  112. next;
  113. mes "[Kenny]";
  114. mes "So...";
  115. mes "Just keep track";
  116. mes "of how much you're";
  117. mes "carrying from time";
  118. mes "to time and you should";
  119. mes "be alright.";
  120. close;
  121. }
  122. else {
  123. mes "[Kenny]";
  124. mes "I'm sorry, but you don't have enough Zeny. I can't just give these away after working years";
  125. mes "to develop this revolutionary technology!";
  126. close;
  127. }
  128. }
  129. mes "[Kenny]";
  130. mes "You changed your mind?";
  131. mes "When the glory of owning";
  132. mes "a quiver is so close?";
  133. close;
  134. case 2:
  135. if (zeny > 500) {
  136. mes "[Kenny]";
  137. mes "There you go!";
  138. mes "Just remember, ^FF0000you won't be able to use the Quiver when your carried weight is 90% of your maximum weight limit^000000.";
  139. set zeny,zeny-500;
  140. delitem getarg(0),500;
  141. getitem getarg(1),1;
  142. next;
  143. mes "[Kenny]";
  144. mes "So...";
  145. mes "Just keep track";
  146. mes "of how much you're";
  147. mes "carrying from time";
  148. mes "to time and you should";
  149. mes "be alright.";
  150. close;
  151. }
  152. else {
  153. mes "[Kenny]";
  154. mes "You don't even";
  155. mes "have 500 Zeny?";
  156. mes "I'm so sorry. I had no";
  157. mes "idea that you were so...";
  158. mes "^333333Poor^000000.";
  159. close;
  160. }
  161. case 3:
  162. mes "[Kenny]";
  163. mes "Kay, See you later.";
  164. close;
  165. }
  166. }
Advertisement
Add Comment
Please, Sign In to add comment