Advertisement
Oxxy

Untitled

May 2nd, 2015
381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.62 KB | None | 0 0
  1.  
  2. /*
  3. Oxxy (C) 2013 ;)
  4. */
  5.  
  6. function script CustomQuest {
  7.  
  8. set .@npc$, "["+getarg(0)+"]"; // NPC Header
  9. set .@text$, getarg(1); // Quest's text
  10. set .@yes_no_text$, getarg(2); // Another text
  11. set .@yes_no_menu$, getarg(3); // Menu Yes or No text
  12. set .@no_text$, getarg(4); // Text if you pressed No
  13. //set .@items_menu$, getarg(5); // Items menu (The last one should be Close or something like this) unused actually
  14. set .@oneItemText$, getarg(6); // Text that will be displayed when u chose item
  15. set .@yes_no_text1$, getarg(7); // Menu Yes or No(item creating)
  16.  
  17. set .@item_id1, getarg(8); // Item ID 1
  18. set .@item_Amount1, getarg(9); // Item Amount 1
  19.  
  20. set .@item_id2, getarg(10); // Item ID 2
  21. set .@item_Amount2, getarg(11); // Item Amount 2
  22.  
  23. set .@item_id3, getarg(12); // Item ID 3
  24. set .@item_Amount3, getarg(13); // Item Amount 3
  25.  
  26. set .@item_id4, getarg(14); // Item ID 4
  27. set .@item_Amount4, getarg(15); // Item Amount 4
  28.  
  29. set .@item_id5, getarg(16); // Item ID 5
  30. set .@item_Amount5, getarg(17); // Item Amount 5
  31.  
  32. set .@item_id6, getarg(18); // Item ID 6
  33. set .@item_Amount6, getarg(19); // Item Amount 6
  34.  
  35. set .@Zeny, getarg(20); // Zeny required for quest
  36. // 0 - No zeny required
  37.  
  38. set .@oneItemReward, getarg(21); // Reward Item ID
  39. set .@oneItemAmount, getarg(22); // Reward Item Amount
  40.  
  41. mes .@npc$;
  42. mes .@text$;
  43. mes .@yes_no_text$;
  44. next;
  45. if(select(.@yes_no_menu$) == 2)
  46. {
  47. next;
  48. mes .@npc$;
  49. mes .@no_text$;
  50. close;
  51. }
  52.  
  53. mes .@npc$;
  54. mes .@oneItemtext$;
  55. mes "You will need: ";
  56. if(.@item_id1 && .@item_Amount1)
  57. mes ""+.@item_Amount1+" "+getitemname(.@item_id1)+"";
  58.  
  59. if(.@item_id2 && .@item_Amount2)
  60. mes ""+.@item_Amount2+" "+getitemname(.@item_id2)+"";
  61.  
  62. if(.@item_id3 && .@item_Amount3)
  63. mes ""+.@item_Amount3+" "+getitemname(.@item_id3)+"";
  64.  
  65. if(.@item_id4 && .@item_Amount4)
  66. mes ""+.@item_Amount4+" "+getitemname(.@item_id4)+"";
  67.  
  68. if(.@item_id5 && .@item_Amount5)
  69. mes ""+.@item_Amount5+" "+getitemname(.@item_id5)+"";
  70.  
  71. if(.@item_id6 && .@item_Amount6)
  72. mes ""+.@item_Amount6+" "+getitemname(.@item_id6)+"";
  73.  
  74. mes .@yes_no_text1$;
  75. if(select(.@yes_no_menu$) == 2)
  76. {
  77. mes .@no_text$;
  78. close;
  79. }
  80. if(.@item_id1 && .@item_Amount1)
  81. {
  82. if(countitem(.@item_id1) < .@item_Amount1)
  83. {
  84. next;
  85. mes .@npc$;
  86. mes "You don't have enough "+getitemname(.@item_id1)+".";
  87. close;
  88. }
  89.  
  90. delitem .@item_id1, .@item_Amount1;
  91. }
  92.  
  93. if(.@item_id2 && .@item_Amount2)
  94. {
  95. if(countitem(.@item_id2) < .@item_Amount2)
  96. {
  97. next;
  98. mes .@npc$;
  99. mes "You don't have enough "+getitemname(.@item_id2)+".";
  100. close;
  101. }
  102.  
  103. delitem .@item_id2, .@item_Amount2;
  104. }
  105.  
  106. if(.@item_id3 && .@item_Amount3)
  107. {
  108. if(countitem(.@item_id3) < .@item_Amount3)
  109. {
  110. next;
  111. mes .@npc$;
  112. mes "You don't have enough "+getitemname(.@item_id3)+".";
  113. close;
  114. }
  115.  
  116. delitem .@item_id3, .@item_Amount3;
  117. }
  118.  
  119. if(.@item_id4 && .@item_Amount4)
  120. {
  121. if(countitem(.@item_id4) < .@item_Amount4)
  122. {
  123. next;
  124. mes .@npc$;
  125. mes "You don't have enough "+getitemname(.@item_id4)+".";
  126. close;
  127. }
  128.  
  129. delitem .@item_id4, .@item_Amount4;
  130. }
  131.  
  132. if(.@item_id5 && .@item_Amount5)
  133. {
  134. if(countitem(.@item_id5) < .@item_Amount5)
  135. {
  136. next;
  137. mes .@npc$;
  138. mes "You don't have enough "+getitemname(.@item_id5)+".";
  139. close;
  140. }
  141.  
  142. delitem .@item_id5, .@item_Amount5;
  143. }
  144.  
  145. if(.@item_id6)
  146. {
  147. if(countitem(.@item_id6) < .@item_Amount6)
  148. {
  149. next;
  150. mes .@npc$;
  151. mes "You don't have enough "+getitemname(.@item_id6)+".";
  152. close;
  153. }
  154.  
  155. delitem .@item_id6, .@item_Amount6;
  156. }
  157.  
  158. if(.@Zeny)
  159. {
  160. if(Zeny < .@Zeny)
  161. {
  162. next;
  163. mes .@npc$;
  164. mes "You don't have enough "+(.@Zeny - Zeny)+".";
  165. close;
  166. }
  167.  
  168. set Zeny, Zeny - .@Zeny;
  169. }
  170. next;
  171. mes .@npc$;
  172. mes "Here's your item!";
  173. getitem .@oneItemReward, .@oneItemAmount;
  174. close;
  175.  
  176. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement