Advertisement
cripplez

Beran Script

Apr 14th, 2015
432
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.13 KB | None | 0 0
  1. quest beransystem begin
  2.  
  3. state start begin
  4.  
  5. when 30122.click with pc.get_level() >= 90 begin
  6.  
  7. if beranSystem.talk[pc.get_channel_id()] == 0 then
  8. beranSystem.talk[pc.get_channel_id()] = 1
  9. server_timer("npcTalk"..pc.get_channel_id(),90)
  10. if beranSystem.channel[pc.get_channel_id()] == 1 then
  11. say_title("Spirito Antico")
  12. say("Qualcun'altro sta gia' affrontando il Drago Beran")
  13. say("Potrai raggiungerlo inserendo la password!")
  14. local password = tonumber(input())
  15. if password == beranSystem.password[pc.get_channel_id()] then
  16. if pc.count_item(30179) == 0 then
  17. beranSystem.talk[pc.get_channel_id()] = 0
  18. clear_server_timer("npcTalk"..pc.get_channel_id())
  19. syschat("Ti serve una Chiave a Spirale")
  20. return
  21. end
  22. pc.remove_item(30179, 1)
  23. timer("warpStanza", 1)
  24. end
  25. else
  26. local s = select("Affronta il Drago Beran", "Chiudi")
  27. if s == 2 then
  28. beranSystem.talk[pc.get_channel_id()] = 0
  29. clear_server_timer("npcTalk"..pc.get_channel_id())
  30. return
  31. end
  32. say ("Sei pronto ad affrontare il temibile Beran?")
  33. say ("Ti occorre 1 Chiave a Spirale.")
  34. say ("Ogni membro del tuo gruppo dovra'")
  35. say ("avere una Chiave a Spirale per poter entrare.")
  36. say ("Avrai 30 minuti di tempo per sconfiggere il Drago.")
  37. say_item("Chiave a Spirale x1", "30179", "")
  38. local p = select("Si, sono pronto", "Chiudi")
  39. if p == 2 then
  40. beranSystem.talk[pc.get_channel_id()] = 0
  41. clear_server_timer("npcTalk"..pc.get_channel_id())
  42. return
  43. end
  44. if pc.count_item(30179) == 0 then
  45. beranSystem.talk[pc.get_channel_id()] = 0
  46. clear_server_timer("npcTalk"..pc.get_channel_id())
  47. syschat("Ti serve una Chiave a Spirale")
  48. return
  49. end
  50. say("Scegli la password!")
  51. local pwd = input()
  52. if not tonumber(pwd) then
  53. beranSystem.talk[pc.get_channel_id()] = 0
  54. clear_server_timer("npcTalk"..pc.get_channel_id())
  55. say("Inserisci Password di 9 cifre")
  56. return
  57. elseif tonumber(pwd) < 100000000 or tonumber(pwd) > 999999999 then
  58. say("Inserisci Password di 9 cifre")
  59. say("")
  60. beranSystem.talk[pc.get_channel_id()] = 0
  61. clear_server_timer("npcTalk"..pc.get_channel_id())
  62. return
  63. else
  64. if beranSystem.password[pc.get_channel_id()] == "" then
  65. pc.remove_item(30179, 1)
  66. beranSystem.password[pc.get_channel_id()] = tonumber(pwd)
  67. beranSystem.channel[pc.get_channel_id()] = 1
  68. beranSystem.entry[pc.get_channel_id()] = get_time()
  69. beranSystem.exit[pc.get_channel_id()] = get_time() + beranSystem.time[pc.get_channel_id()]
  70. server_timer("forceReload"..pc.get_channel_id(),beranSystem.time[pc.get_channel_id()]+120)
  71. timer("warpStanza", 1)
  72. else
  73. syschat("La Stanza di Cristallo e' gia occupata")
  74. end
  75. end
  76. end
  77. clear_server_timer("npcTalk"..pc.get_channel_id())
  78. beranSystem.talk[pc.get_channel_id()] = 0
  79. else
  80. say_title("Spirito Antico")
  81. say("")
  82. say("Un altro guerriero sta gia parlando con me!")
  83. say("Aspetta il tuo Turno !!")
  84. end
  85. end
  86.  
  87. when forceReload1.server_timer begin
  88.  
  89. beranSystem.reload(1)
  90.  
  91. end
  92.  
  93. when forceReload2.server_timer begin
  94.  
  95. beranSystem.reload(2)
  96.  
  97. end
  98.  
  99. when npcTalk1.server_timer begin
  100.  
  101. beranSystem.talk[1] = 0
  102.  
  103. end
  104.  
  105. when npcTalk2.server_timer begin
  106.  
  107. beranSystem.talk[2] = 0
  108.  
  109. end
  110.  
  111. when warpStanza.timer begin
  112.  
  113. beranSystem.player[pc.get_channel_id()][beranSystem.count[pc.get_channel_id()]] = pc.get_name()
  114. beranSystem.count[pc.get_channel_id()] = beranSystem.count[pc.get_channel_id()]+1
  115. if beranSystem.exit[pc.get_channel_id()] - get_time() < 21 then
  116. return
  117. end
  118. pc.warp(819200,1049600)
  119.  
  120. end
  121.  
  122. when login with pc.get_map_index() == 2 and pc.get_local_x() <= 250 and pc.get_local_y() <= 220 begin
  123.  
  124. local name = pc.get_name()
  125. for i=0,beranSystem.count[pc.get_channel_id()],1 do
  126. if beranSystem.player[pc.get_channel_id()][i] == name then
  127. timer("exit".. pc.get_channel_id(),beranSystem.exit[pc.get_channel_id()] - get_time())
  128. return
  129. end
  130. end
  131. pc.warp(241600,1275200)
  132.  
  133. end
  134.  
  135. when logout with pc.get_map_index() == 2 and pc.get_local_x() <= 250 and pc.get_local_y() <= 220 begin
  136.  
  137. for i=0,beranSystem.count[pc.get_channel_id()],1 do
  138. if beranSystem.player[pc.get_channel_id()][i] == name then
  139. beranSystem.player[pc.get_channel_id()][i] = ""
  140. return
  141. end
  142. end
  143.  
  144. end
  145.  
  146. when 2599.kill with pc.get_map_index() == 2 and pc.get_local_x()<= 250 and pc.get_local_y() <= 220 begin
  147.  
  148. notice_all("Il Drago Beran e' stato ucciso!")
  149. timer("exit".. pc.get_channel_id(),20)
  150. server_timer("logOutSystem"..pc.get_channel_id(),30)
  151.  
  152. end
  153.  
  154. when logOutSystem1.server_timer begin
  155.  
  156. clear_server_timer("forceReload1")
  157. beranSystem.reload(1)
  158.  
  159. end
  160.  
  161. when logOutSystem2.server_timer begin
  162.  
  163. clear_server_timer("forceReload2")
  164. beranSystem.reload(2)
  165.  
  166. end
  167.  
  168. when exit1.timer with pc.get_map_index() == 2 and pc.get_local_x()<= 250 and pc.get_local_y() <= 220 begin
  169.  
  170. if beranSystem.callReload[pc.get_channel_id()] == 1 then
  171. return
  172. end
  173. beranSystem.logOutSystem[pc.get_channel_id()] = 1
  174. beranSystem.callReload[pc.get_channel_id()] = 1
  175. clear_server_timer("forceReload1")
  176. beranSystem.exitDungeon(1)
  177.  
  178. end
  179.  
  180. when exit2.timer with pc.get_map_index() == 2 and pc.get_local_x()<= 250 and pc.get_local_y() <= 220 begin
  181.  
  182. if beranSystem.callReload[pc.get_channel_id()] == 1 then
  183. return
  184. end
  185. beranSystem.logOutSystem[pc.get_channel_id()] = 1
  186. beranSystem.callReload[pc.get_channel_id()] = 1
  187. clear_server_timer("forceReload2")
  188. beranSystem.exitDungeon(2)
  189.  
  190. end
  191.  
  192. ----------**********
  193. ----------********** Entrata minimo 90
  194. ----------**********
  195. when 30122.click with pc.get_level() < 90 begin
  196. say_title("Spirito Antico")
  197. say("")
  198. say("Devi raggiungere il livello 90")
  199. say("Prima di poter entrare nella Stanza di Cristallo.")
  200. say("Torna quando sarai piu' forte.")
  201. end
  202.  
  203.  
  204. end
  205.  
  206. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement