Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.30 KB | None | 0 0
  1. --
  2. -- Copyright (c) 2020 by Adams <lukasz.adamski@eterprime.eu>
  3. --
  4. -- Niniejszy kod jest chroniony prawem autorskim.
  5. -- Wszelkie kopiowanie oraz używanie bez zgody autora
  6. -- zabronione pod pieczą Kodeksu Karnego - ustaw o prawie autorskim.
  7. --
  8. -- Nazwa dungeonu : dungeon_pustynne_wyzyny
  9. -- Identyfikator : D39e54cff9138d563e0ce1144b8a19a
  10. -- Data utworzenia : 17/01/2020 15:31:41
  11. --
  12.  
  13. quest D39e54cff9138d563e0ce1144b8a19a begin
  14. state start begin
  15. function enabled()
  16. return (0 == game.get_event_flag("disable_pustynne_wyzyny"))
  17. end
  18.  
  19. function inside()
  20. return (pc.in_dungeon() and pc.get_map_index() >= (222 * 10000) and pc.get_map_index() < (223 * 10000))
  21. end
  22. when 20095.chat."Pustynne Wyżyny <Lv.95>" begin
  23. say_title("Pustynne Wyżyny")
  24. say("Dungeon w którym musisz")
  25. say("Zmierzyć sie z potężnym Smokiem")
  26. say("Podołasz temu wyzwaniu?")
  27. say("Liczymy na ciebie powodzenia.")
  28. say("")
  29. wait()
  30.  
  31. if pc.get_level() < 95 then
  32. say_title(mob_name(20095)..":")
  33. say("Poziom Twojej postaci jest za niski!")
  34. return
  35. end
  36. if pc.count_item(70030) < 3 then
  37. say_title(mob_name(20095)..":")
  38. say("Musisz posiadać 3x przepustkę.")
  39. say_item_vnum(70030)
  40. say("")
  41. say("Wróć jak zbierzesz wszystkie")
  42. else
  43. say_title(mob_name(20095)..":")
  44. say("Spełniasz wymagania, chcesz wejsc?")
  45. local answer = select("Chce dolaczyc sam!", "Dolacze z grupa!", "Nie")
  46. if answer == 1 then
  47. if party.is_party() then
  48. say_title(mob_name(20095)..":")
  49. say("Nie możesz być w grupie !")
  50. else
  51. pc.remove_item(70030, 3)
  52. d.join(222)
  53. pc.setqf("pustynne_wyzyny_dungeon_enter", 1)
  54. end
  55. end
  56. if answer == 2 then
  57. if party.is_party() then
  58. if not party.is_leader() then
  59. say_title(mob_name(20095)..":")
  60. say("")
  61. say("Musisz byc liderem!")
  62. return
  63. end
  64. if party.get_near_count() < 2 or party.get_near_count() > 2 then
  65. say_title(mob_name(20095)..":")
  66. say("")
  67. say("Wymagana ilość członków grupy: 2.")
  68. else
  69. pc.remove_item(70030, 3)
  70. d.join(222)
  71. d.new_jump_party(222, 280, 140)
  72. pc.setqf("pustynne_wyzyny_dungeon_enter", 1)
  73. chat("[2]Poziom grupy to: "..poziom_grupy.."")
  74. end
  75. else
  76. say_title(mob_name(20095)..":")
  77. say("Nie posiadasz grupy!")
  78. return
  79. end
  80. end
  81. if answer == 3 then
  82. say_title(mob_name(20095)..":")
  83. say("")
  84. say("Mam nadzieje że wrócisz.")
  85. end
  86. end
  87. end
  88.  
  89. when login with pc.in_dungeon() and pc.get_map_index() >= (222 * 10000) begin
  90. if pc.get_level() < 95 then
  91. say("Poziom Twojej postaci jest za niski!")
  92. say("Za 10 sek zostaniesz wyrzucony.")
  93. timer("wyzyny_kick", 10)
  94. end
  95. if pc.getqf("wyzyny_enter") == 1 then
  96. pc.delqf("wyzyny_enter")
  97. end
  98. end
  99. when wyzyny_kick.timer begin
  100. pc.delqf("wyzyny__enter")
  101. d.exit()
  102. end
  103.  
  104. function outside()
  105. return (false == pc.in_dungeon())
  106. end
  107.  
  108. function prepare(stage)
  109. if (d.getf("stage") == stage) then
  110. return
  111. end
  112.  
  113. if (is_test_server()) then
  114. d.notice("[debug]: Current dungeon stage is " .. stage)
  115. end
  116.  
  117. d.setf("stage", stage)
  118.  
  119. if (1 == stage) then
  120. d.notice("(Dungeon): Pokonajcie wszystkich przeciwników.")
  121. d.notice("Udało Ci się dostać na Pustynne Wyżyny. Świetnie, jednak to dopiero początek... Zniszcz wszystkie")
  122. d.notice("potwory i metiny aby rozwścieczyć bossa.")
  123. d.regen_file("data/dungeon/dung160/regen1.txt")
  124. d.setf("total_monsters_1", d.count_monster())
  125. end
  126.  
  127. if (2 == stage) then
  128. d.notice("(Dungeon): Pokonajcie wszystkich przeciwników.")
  129. d.notice("Zabiłeś Pełzacze Żołnierzy. Na następnej platformie zjawiły się pełzacze by pomścić swoich kolegów.")
  130. d.notice("Zniszcz ich.")
  131. d.regen_file("data/dungeon/dung160/regen2.txt")
  132. d.setf("total_monsters_2", d.count_monster())
  133. end
  134.  
  135. if (3 == stage) then
  136. d.spawn_mob(8034, 219, 188)
  137. d.spawn_mob(8034, 152, 162)
  138. d.spawn_mob(8034, 110, 202)
  139. d.spawn_mob(8034, 193, 143)
  140. d.spawn_mob(8034, 100, 122)
  141. d.spawn_mob(8034, 217, 68)
  142. d.notice("Udało Ci się zabić wszystkie zbiegłe Pełzacze. Teraz na ziemie spadło 6 metinów. Znajdź je i")
  143. d.notice("zniszcz.")
  144. end
  145.  
  146. if (4 == stage) then
  147. d.spawn_mob(3902, 101, 127)
  148. d.notice("Zniszczyliście wszystkie metiny! Rozwścieczony Eoten wyszedł z ukrycia!")
  149. end
  150.  
  151. if (5 == stage) then
  152. d.clear_regen()
  153. d.kill_all()
  154. timer("dungeon_exit_5", 30)
  155. d.notice("Pokonaliście wszystkie potwory oraz bossa! Gratulacje!")
  156. end
  157. end
  158.  
  159. function set(list)
  160. local set = {}
  161. for _, l in ipairs(list) do
  162. set[l] = true
  163. end
  164. return set
  165. end
  166.  
  167. function foreach(fn)
  168. local vid = pc.get_vid()
  169. local pids = {}
  170.  
  171. if (party.is_party()) then
  172. pids = _party.get_member_pids()
  173. else
  174. pids = {vid}
  175. end
  176.  
  177. for i = 1, table.getn(pids) do
  178. if (pc.select(pids[i])) then
  179. fn()
  180. end
  181. end
  182.  
  183. pc.select(vid)
  184. end
  185.  
  186. when 20095.chat."(GM) Zablokuj Pustynne Wyżyny " with pc.is_gm() and D39e54cff9138d563e0ce1144b8a19a.enabled() and D39e54cff9138d563e0ce1144b8a19a.outside() begin
  187. game.set_event_flag("disable_pustynne_wyzyny", 1)
  188. syschat("Pomyślnie zablokowano dostęp do dungeonu.")
  189. setskin(NOWINDOW)
  190. end
  191.  
  192. when 20095.chat."(GM) Odblokuj Pustynne Wyżyny " with pc.is_gm() and false == D39e54cff9138d563e0ce1144b8a19a.enabled() and D39e54cff9138d563e0ce1144b8a19a.outside() begin
  193. game.set_event_flag("disable_pustynne_wyzyny", 0)
  194. syschat("Pomyślnie odblokowano dostęp do dungeonu.")
  195. setskin(NOWINDOW)
  196. end
  197.  
  198. when 20095.chat."(GM) Rozpocznij Pustynne Wyżyny " with pc.is_gm() and D39e54cff9138d563e0ce1144b8a19a.enabled() and D39e54cff9138d563e0ce1144b8a19a.outside() begin
  199. local choice_to_stage = {1, 2, 3, 4}
  200. local choice = select("1 Poziom", "2 Poziom", "3 Poziom", "4 Poziom", "Zamknij")
  201.  
  202. if (choice == 5) then
  203. return
  204. end
  205.  
  206. d.join(222)
  207. d.setf("__level", choice_to_stage[choice])
  208.  
  209. setskin(NOWINDOW)
  210. end
  211.  
  212. when login begin
  213. if (false == pc.in_dungeon() and 222 == pc.get_map_index()) then
  214. warp_to_village()
  215. end
  216.  
  217. if (D39e54cff9138d563e0ce1144b8a19a.inside() and 0 == d.getf("__initialized")) then
  218. d.setf("__initialized", 1)
  219. local level = math.max(1, d.getf("__level"))
  220. D39e54cff9138d563e0ce1144b8a19a.prepare(level)
  221. end
  222. end
  223.  
  224. when dungeon_exit_5.timer with D39e54cff9138d563e0ce1144b8a19a.inside() begin
  225. d.exit_all()
  226. end
  227.  
  228. when kill with npc.is_pc() == false and D39e54cff9138d563e0ce1144b8a19a.inside() begin
  229. local stage = d.getf("stage")
  230.  
  231. local kill_count = d.getf("kill_count") + 1
  232. d.setf("kill_count", kill_count)
  233.  
  234. if (1 == stage) then
  235. if (kill_count >= d.getf("total_monsters_1") or d.count_monster() == 0) then
  236. D39e54cff9138d563e0ce1144b8a19a.prepare(2)
  237. d.setf("kill_count", 0)
  238. end
  239. end
  240.  
  241. if (2 == stage) then
  242. if (kill_count >= d.getf("total_monsters_2") or d.count_monster() == 0) then
  243. D39e54cff9138d563e0ce1144b8a19a.prepare(3)
  244. d.setf("kill_count", 0)
  245. end
  246. end
  247.  
  248. if (3 == stage) then
  249. if (npc.get_race() == 8034) then
  250. d.setf("kill_3_counter", d.getf("kill_3_counter") + 1)
  251.  
  252. if (d.getf("kill_3_counter") >= 6) then
  253. d.setf("kill_3_counter", 0)
  254. D39e54cff9138d563e0ce1144b8a19a.prepare(4)
  255. end
  256. end
  257. end
  258.  
  259. if (4 == stage) then
  260. if (npc.get_race() == 3902) then
  261. d.setf("kill_4_counter", d.getf("kill_4_counter") + 1)
  262.  
  263. if (d.getf("kill_4_counter") >= 1) then
  264. d.setf("kill_4_counter", 0)
  265. D39e54cff9138d563e0ce1144b8a19a.prepare(5)
  266. end
  267. end
  268. end
  269. end
  270. end
  271. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement