Advertisement
xabugaspt

Untitled

Jun 17th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.88 KB | None | 0 0
  1. quest dragon_soul begin
  2. state start begin
  3. when levelup or letter with pc.level >= 30 begin
  4. send_letter(gameforge.dragon_soul._1010_sendLetter)
  5. local v = find_npc_by_vnum(20001)
  6.  
  7. if 0 != v then
  8. target.vid("__TARGET__", v, mob_name(20001))
  9. end
  10. end
  11. when info or button begin
  12. say_title("Fragmentos do Drag√£o")
  13. say("")
  14. say(gameforge.dragon_soul._1020_say)
  15. end
  16.  
  17. when 20001.chat.gameforge.dragon_soul._1030_npcChat with pc.level >= 30 begin
  18. target.delete("__TARGET__")
  19.  
  20. say_title(mob_name(20001))
  21. say(gameforge.dragon_soul._1040_say)
  22. set_state(state_learning)
  23. end
  24. end
  25. state state_learning begin
  26. when letter begin
  27. send_letter(gameforge.dragon_soul._1050_sendLetter)
  28. end
  29. when info or button begin
  30. say(gameforge.dragon_soul._1060_say)
  31. end
  32. when kill begin
  33. if npc.is_pc() then
  34. return
  35. end
  36. ------------
  37. if pc.get_map_index() >= 2400000 and pc.get_map_index() <= 2405000 or pc.get_map_index() >= 2350000 and pc.get_map_index() <= 2355000 then
  38. return
  39. else
  40. -----------------------
  41. if pc.getf("dragon_soul","drop_on") == 1 then
  42. if pc.count_item(30270) < 15 then
  43. if drop_gamble_with_flag("ds_drop") then
  44.  
  45. game.drop_item_with_ownership(30270)
  46.  
  47. end
  48. end
  49. end
  50. -------------------------
  51. end
  52. ------------
  53. end
  54. when 20001.chat.gameforge.dragon_soul._1050_sendLetter begin
  55. say_title(mob_name(20001))
  56. if pc.count_item(30270) >= 10 then
  57. say(gameforge.dragon_soul._1070_say)
  58. pc.remove_item(30270, 10)
  59. ds.give_qualification()
  60. char_log(pc.get_player_id(), 'DS_QUALIFICATION', 'SUCCESS')
  61. pc.give_item2(50255)
  62. local today = math.floor(get_global_time() / 86400)
  63. pc.setf("dragon_soul", "eye_timestamp", today)
  64. pc.setf("dragon_soul", "eye_left", 3)
  65. set_state(state_farming)
  66. else
  67. say(gameforge.dragon_soul._1080_say)
  68. end
  69. end
  70. end
  71. state state_farming begin
  72. when letter begin
  73. send_letter(gameforge.dragon_soul._1090_sendLetter)
  74. end
  75. when info or button begin
  76. say(string.format(gameforge.dragon_soul._1100_say, pc.getf("dragon_soul", "eye_left")))
  77. end
  78. when kill begin
  79. if npc.is_pc() then
  80. return
  81. end
  82. ---------
  83. if pc.get_map_index() >= 2400000 and pc.get_map_index() <= 2405000 or pc.get_map_index() >= 2350000 and pc.get_map_index() <= 2355000 then
  84. return
  85. else
  86. ------------------------------------
  87. if pc.getf("dragon_soul","drop_on") == 1 then
  88. if drop_gamble_with_flag("ds_drop") then
  89. local eye_left = pc.getf("dragon_soul", "eye_left")
  90. local haved_gemstone_number = pc.count_item(30270)
  91.  
  92. if eye_left > haved_gemstone_number / 20 then
  93.  
  94. game.drop_item_with_ownership(30270)
  95.  
  96. end
  97. end
  98. end
  99. ----------------------------
  100. end
  101. -----------
  102. end
  103. when 30270.pick begin
  104. local eye_left = pc.getf("dragon_soul", "eye_left")
  105. if eye_left <= 0 then
  106. return
  107. end
  108.  
  109. if pc.count_item(30270) >= 20 then
  110. pc.setf("dragon_soul", "eye_left", eye_left - 1)
  111. pc.remove_item(30270, 20)
  112. pc.give_item2(50255)
  113. if 1 == eye_left then
  114. notice_multiline(gameforge.dragon_soul._1110_notice, notice)
  115. set_state(state_closed_season)
  116. end
  117. end
  118. end
  119. when 20001.chat.gameforge.dragon_soul._1120_npcChat begin
  120. say_title(mob_name(20001))
  121. local today = math.floor(get_global_time() / 86400)
  122. if today == pc.getf("dragon_soul", "eye_timestamp") then
  123. say(gameforge.dragon_soul._1130_say)
  124. else
  125. say(gameforge.dragon_soul._1140_say)
  126. pc.setf("dragon_soul", "eye_timestamp", today)
  127. pc.setf("dragon_soul", "eye_left", 3)
  128. pc.setf("dragon_soul","drop_on",1)
  129. end
  130. end
  131. end
  132. state state_closed_season begin
  133. when letter begin
  134. send_letter(gameforge.dragon_soul._1150_sendLetter)
  135. end
  136. when info or button begin
  137. say(gameforge.dragon_soul._1160_say)
  138. local today = math.floor(get_global_time() / 86400)
  139. if today == pc.getf("dragon_soul", "eye_timestamp") then
  140. say(gameforge.dragon_soul._1170_say)
  141. else
  142. say(gameforge.dragon_soul._1180_say)
  143. end
  144. end
  145.  
  146. when 20001.chat.gameforge.dragon_soul._1090_sendLetter begin
  147. say_title(mob_name(20001))
  148. local today = math.floor(get_global_time() / 86400)
  149. if today == pc.getf("dragon_soul", "eye_timestamp") then
  150. say(gameforge.dragon_soul._1130_say)
  151. else
  152. say(gameforge.dragon_soul._1140_say)
  153. pc.setf("dragon_soul", "eye_timestamp", today)
  154. pc.setf("dragon_soul", "eye_left", 3)
  155. set_state(state_farming)
  156. end
  157. end
  158. end
  159. -- deprecated states. so, jump to new state.
  160. state state_1 begin
  161. when login begin
  162. set_state(state_learning)
  163. end
  164. end
  165. state state_2 begin
  166. when login begin
  167. set_state(state_learning)
  168. end
  169. end
  170. state state_3 begin
  171. when login begin
  172. set_state(state_closed_season)
  173. end
  174. end
  175. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement