Guest User

Untitled

a guest
Jul 15th, 2016
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.94 KB | None | 0 0
  1. ----------------------------------------------------
  2. --COLLECT QUEST_lv30
  3. --METIN2 Collecting Quest
  4. ----------------------------------------------------
  5. quest collect_quest_lv30 begin
  6. state start begin
  7. when login or levelup with pc.level >= 30 and (not is_amminchia()) begin
  8. set_state(information)
  9. end
  10. end
  11.  
  12. state information begin
  13. when letter begin
  14. local v = find_npc_by_vnum(20084)
  15. if v != 0 then
  16. target.vid("__TARGET__", v, "Biologo Cheagirab")
  17. end
  18. send_letter(localeInfo.coll_q.send_1)
  19. end
  20.  
  21. when button or info begin
  22. say_title(localeInfo.coll_q.sayt_1)
  23. say(localeInfo.coll_q.say_1)
  24. end
  25.  
  26. when __TARGET__.target.click or 20084.chat.localeInfo.coll_q.lv30_npc_1 begin
  27. target.delete("__TARGET__")
  28. say_title(localeInfo.coll_q.sayt_2)
  29. say(localeInfo.coll_q.say_2)
  30. wait()
  31. say_title(localeInfo.coll_q.sayt_2)
  32. say(localeInfo.coll_q.lv30_say_1)
  33. wait()
  34. say_title(localeInfo.coll_q.sayt_2)
  35. say(localeInfo.coll_q.lv30_say_2)
  36. set_state(go_to_disciple)
  37. pc.setqf("duration",0)
  38. pc.setqf("collect_count",0)
  39. pc.setqf("drink_drug",0)
  40. end
  41. end
  42.  
  43. state go_to_disciple begin
  44. when letter begin
  45. send_letter(localeInfo.coll_q.lv30_send_1)
  46. end
  47.  
  48. when button or info begin
  49. say_title(localeInfo.coll_q.lv30_npc_1)
  50. say(localeInfo.coll_q.lv30_say_3)
  51. say_item_vnum(30006)
  52. say_reward(string.format(localeInfo.coll_q.lv30_sayr_1,pc.getqf("collect_count")))
  53. end
  54.  
  55. when 71035.use begin
  56. if pc.getqf("drink_drug") == 1 then
  57. syschat(localeInfo.coll_q.use_e)
  58. return
  59. end
  60. pc.remove_item(71035, 1)
  61. pc.setqf("drink_drug",1)
  62. pc.setqf("duration",0)
  63. syschat(localeInfo.coll_q.use_e2)
  64. end
  65.  
  66. when 20084.chat.localeInfo.coll_q.lv30_npc_2 with pc.count_item(30006) >0 begin
  67. if get_time() > pc.getqf("duration") then
  68. if pc.count_item(30006) >0 then
  69. say_title(localeInfo.coll_q.sayt_2)
  70. say(localeInfo.coll_q.lv30_say_4)
  71. pc.remove_item(30006,1)
  72. wait()
  73. local pass_percent
  74. if pc.getqf("drink_drug")==0 then
  75. pass_percent=70
  76. else
  77. pass_percent=100
  78. end
  79. local s= number(1,100)
  80. if s<= pass_percent then
  81. if pc.getqf("collect_count")< 9 then
  82. local index =pc.getqf("collect_count")+1
  83. pc.setqf("collect_count",index)
  84. say_title(localeInfo.coll_q.sayt_2)
  85. say(localeInfo.coll_q.lv30_say_6)
  86. say(string.format(localeInfo.coll_q.lv30_sayr_3,10-pc.getqf("collect_count")))
  87. pc.setqf("drink_drug",0)
  88. return
  89. end
  90. say_title(localeInfo.coll_q.sayt_2)
  91. say(localeInfo.coll_q.lv30_say_7)
  92. pc.setqf("collect_count",0)
  93. pc.setqf("drink_drug",0)
  94. pc.setqf("duration",0)
  95. set_state(key_item)
  96. return
  97. else
  98. say_title(localeInfo.coll_q.sayt_2)
  99. say(localeInfo.coll_q.lv30_say_5)
  100. pc.setqf("drink_drug",0)
  101. return
  102. end
  103. else
  104. say_title(localeInfo.coll_q.sayt_2)
  105. say(localeInfo.coll_q.noitem)
  106. return
  107. end
  108. else
  109. say_title(localeInfo.coll_q.sayt_2)
  110. say(localeInfo.coll_q.time)
  111. return
  112. end
  113. end
  114. end
  115.  
  116. state key_item begin
  117. when letter begin
  118. send_letter(localeInfo.coll_q.send_2)
  119. if pc.count_item(30220)>0 then
  120. local v = find_npc_by_vnum(20084)
  121. if v != 0 then
  122. target.vid("__TARGET__", v, "")
  123. end
  124. end
  125. end
  126.  
  127. when button or info begin
  128. if pc.count_item(30220) >0 then
  129. say_title(localeInfo.coll_q.sayt_3)
  130. say(localeInfo.coll_q.say_3)
  131. return
  132. end
  133. say_title(localeInfo.coll_q.sayt_3)
  134. say(localeInfo.coll_q.say_4)
  135. say_item_vnum(30220)
  136. end
  137.  
  138. when __TARGET__.target.click or 20084.chat.localeInfo.coll_q.npc_1 with pc.count_item(30220) > 0 begin
  139. target.delete("__TARGET__")
  140. if pc.count_item(30220) > 0 then
  141. say_title(localeInfo.coll_q.sayt_2)
  142. say(localeInfo.coll_q.say_5)
  143. pc.remove_item(30220,1)
  144. set_state(__reward)
  145. else
  146. say_title(localeInfo.coll_q.sayt_2)
  147. say(localeInfo.coll_q.say_8)
  148. return
  149. end
  150. end
  151. end
  152.  
  153. state __reward begin
  154. when letter begin
  155. send_letter(localeInfo.coll_q.send_4)
  156. local v = find_npc_by_vnum(20018)
  157. if v != 0 then
  158. target.vid("__TARGET__", v, "Baek-Go")
  159. end
  160. end
  161.  
  162. when button or info begin
  163. say_title(localeInfo.coll_q.sayt_4)
  164. say(localeInfo.coll_q.say_6)
  165. end
  166.  
  167. when __TARGET__.target.click or 20018.chat.localeInfo.coll_q.sayt_5 begin
  168. target.delete("__TARGET__")
  169. say_title(localeInfo.coll_q.sayt_5)
  170. say(localeInfo.coll_q.say_7)
  171. say_reward(localeInfo.coll_q.sayr_1)
  172. say_reward(localeInfo.coll_q.lv30_sayr_5)
  173. affect.add_collect(apply.MOV_SPEED, 10, 60*60*24*365*60) -- 60Years
  174. pc.give_item2("50110",1)
  175. pc.changegold(500000)
  176. pc.give_exp2(212200)
  177. clear_letter()
  178. set_quest_state("collect_quest_lv40", "run")
  179. set_state(__complete)
  180. end
  181. end
  182. state __complete begin
  183. end
  184. end
Add Comment
Please, Sign In to add comment