Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --
- -- Copyright (c) 2020 by Adams <lukasz.adamski@eterprime.eu>
- --
- -- Niniejszy kod jest chroniony prawem autorskim.
- -- Wszelkie kopiowanie oraz używanie bez zgody autora
- -- zabronione pod pieczą Kodeksu Karnego - ustaw o prawie autorskim.
- --
- -- Nazwa dungeonu : dungeon_pustynne_wyzyny
- -- Identyfikator : D39e54cff9138d563e0ce1144b8a19a
- -- Data utworzenia : 17/01/2020 15:31:41
- --
- quest D39e54cff9138d563e0ce1144b8a19a begin
- state start begin
- function enabled()
- return (0 == game.get_event_flag("disable_pustynne_wyzyny"))
- end
- function inside()
- return (pc.in_dungeon() and pc.get_map_index() >= (222 * 10000) and pc.get_map_index() < (223 * 10000))
- end
- when 20095.chat."Pustynne Wyżyny <Lv.95>" begin
- say_title("Pustynne Wyżyny")
- say("Dungeon w którym musisz")
- say("Zmierzyć sie z potężnym Smokiem")
- say("Podołasz temu wyzwaniu?")
- say("Liczymy na ciebie powodzenia.")
- say("")
- wait()
- if pc.get_level() < 95 then
- say_title(mob_name(20095)..":")
- say("Poziom Twojej postaci jest za niski!")
- return
- end
- if pc.count_item(70030) < 3 then
- say_title(mob_name(20095)..":")
- say("Musisz posiadać 3x przepustkę.")
- say_item_vnum(70030)
- say("")
- say("Wróć jak zbierzesz wszystkie")
- else
- say_title(mob_name(20095)..":")
- say("Spełniasz wymagania, chcesz wejsc?")
- local answer = select("Chce dolaczyc sam!", "Dolacze z grupa!", "Nie")
- if answer == 1 then
- if party.is_party() then
- say_title(mob_name(20095)..":")
- say("Nie możesz być w grupie !")
- else
- pc.remove_item(70030, 3)
- d.join(222)
- pc.setqf("pustynne_wyzyny_dungeon_enter", 1)
- end
- end
- if answer == 2 then
- if party.is_party() then
- if not party.is_leader() then
- say_title(mob_name(20095)..":")
- say("")
- say("Musisz byc liderem!")
- return
- end
- if party.get_near_count() < 2 or party.get_near_count() > 2 then
- say_title(mob_name(20095)..":")
- say("")
- say("Wymagana ilość członków grupy: 2.")
- else
- pc.remove_item(70030, 3)
- d.join(222)
- d.new_jump_party(222, 280, 140)
- pc.setqf("pustynne_wyzyny_dungeon_enter", 1)
- chat("[2]Poziom grupy to: "..poziom_grupy.."")
- end
- else
- say_title(mob_name(20095)..":")
- say("Nie posiadasz grupy!")
- return
- end
- end
- if answer == 3 then
- say_title(mob_name(20095)..":")
- say("")
- say("Mam nadzieje że wrócisz.")
- end
- end
- end
- when login with pc.in_dungeon() and pc.get_map_index() >= (222 * 10000) begin
- if pc.get_level() < 95 then
- say("Poziom Twojej postaci jest za niski!")
- say("Za 10 sek zostaniesz wyrzucony.")
- timer("wyzyny_kick", 10)
- end
- if pc.getqf("wyzyny_enter") == 1 then
- pc.delqf("wyzyny_enter")
- end
- end
- when wyzyny_kick.timer begin
- pc.delqf("wyzyny__enter")
- d.exit()
- end
- function outside()
- return (false == pc.in_dungeon())
- end
- function prepare(stage)
- if (d.getf("stage") == stage) then
- return
- end
- if (is_test_server()) then
- d.notice("[debug]: Current dungeon stage is " .. stage)
- end
- d.setf("stage", stage)
- if (1 == stage) then
- d.notice("(Dungeon): Pokonajcie wszystkich przeciwników.")
- d.notice("Udało Ci się dostać na Pustynne Wyżyny. Świetnie, jednak to dopiero początek... Zniszcz wszystkie")
- d.notice("potwory i metiny aby rozwścieczyć bossa.")
- d.regen_file("data/dungeon/dung160/regen1.txt")
- d.setf("total_monsters_1", d.count_monster())
- end
- if (2 == stage) then
- d.notice("(Dungeon): Pokonajcie wszystkich przeciwników.")
- d.notice("Zabiłeś Pełzacze Żołnierzy. Na następnej platformie zjawiły się pełzacze by pomścić swoich kolegów.")
- d.notice("Zniszcz ich.")
- d.regen_file("data/dungeon/dung160/regen2.txt")
- d.setf("total_monsters_2", d.count_monster())
- end
- if (3 == stage) then
- d.spawn_mob(8034, 219, 188)
- d.spawn_mob(8034, 152, 162)
- d.spawn_mob(8034, 110, 202)
- d.spawn_mob(8034, 193, 143)
- d.spawn_mob(8034, 100, 122)
- d.spawn_mob(8034, 217, 68)
- d.notice("Udało Ci się zabić wszystkie zbiegłe Pełzacze. Teraz na ziemie spadło 6 metinów. Znajdź je i")
- d.notice("zniszcz.")
- end
- if (4 == stage) then
- d.spawn_mob(3902, 101, 127)
- d.notice("Zniszczyliście wszystkie metiny! Rozwścieczony Eoten wyszedł z ukrycia!")
- end
- if (5 == stage) then
- d.clear_regen()
- d.kill_all()
- timer("dungeon_exit_5", 30)
- d.notice("Pokonaliście wszystkie potwory oraz bossa! Gratulacje!")
- end
- end
- function set(list)
- local set = {}
- for _, l in ipairs(list) do
- set[l] = true
- end
- return set
- end
- function foreach(fn)
- local vid = pc.get_vid()
- local pids = {}
- if (party.is_party()) then
- pids = _party.get_member_pids()
- else
- pids = {vid}
- end
- for i = 1, table.getn(pids) do
- if (pc.select(pids[i])) then
- fn()
- end
- end
- pc.select(vid)
- end
- when 20095.chat."(GM) Zablokuj Pustynne Wyżyny " with pc.is_gm() and D39e54cff9138d563e0ce1144b8a19a.enabled() and D39e54cff9138d563e0ce1144b8a19a.outside() begin
- game.set_event_flag("disable_pustynne_wyzyny", 1)
- syschat("Pomyślnie zablokowano dostęp do dungeonu.")
- setskin(NOWINDOW)
- end
- when 20095.chat."(GM) Odblokuj Pustynne Wyżyny " with pc.is_gm() and false == D39e54cff9138d563e0ce1144b8a19a.enabled() and D39e54cff9138d563e0ce1144b8a19a.outside() begin
- game.set_event_flag("disable_pustynne_wyzyny", 0)
- syschat("Pomyślnie odblokowano dostęp do dungeonu.")
- setskin(NOWINDOW)
- end
- when 20095.chat."(GM) Rozpocznij Pustynne Wyżyny " with pc.is_gm() and D39e54cff9138d563e0ce1144b8a19a.enabled() and D39e54cff9138d563e0ce1144b8a19a.outside() begin
- local choice_to_stage = {1, 2, 3, 4}
- local choice = select("1 Poziom", "2 Poziom", "3 Poziom", "4 Poziom", "Zamknij")
- if (choice == 5) then
- return
- end
- d.join(222)
- d.setf("__level", choice_to_stage[choice])
- setskin(NOWINDOW)
- end
- when login begin
- if (false == pc.in_dungeon() and 222 == pc.get_map_index()) then
- warp_to_village()
- end
- if (D39e54cff9138d563e0ce1144b8a19a.inside() and 0 == d.getf("__initialized")) then
- d.setf("__initialized", 1)
- local level = math.max(1, d.getf("__level"))
- D39e54cff9138d563e0ce1144b8a19a.prepare(level)
- end
- end
- when dungeon_exit_5.timer with D39e54cff9138d563e0ce1144b8a19a.inside() begin
- d.exit_all()
- end
- when kill with npc.is_pc() == false and D39e54cff9138d563e0ce1144b8a19a.inside() begin
- local stage = d.getf("stage")
- local kill_count = d.getf("kill_count") + 1
- d.setf("kill_count", kill_count)
- if (1 == stage) then
- if (kill_count >= d.getf("total_monsters_1") or d.count_monster() == 0) then
- D39e54cff9138d563e0ce1144b8a19a.prepare(2)
- d.setf("kill_count", 0)
- end
- end
- if (2 == stage) then
- if (kill_count >= d.getf("total_monsters_2") or d.count_monster() == 0) then
- D39e54cff9138d563e0ce1144b8a19a.prepare(3)
- d.setf("kill_count", 0)
- end
- end
- if (3 == stage) then
- if (npc.get_race() == 8034) then
- d.setf("kill_3_counter", d.getf("kill_3_counter") + 1)
- if (d.getf("kill_3_counter") >= 6) then
- d.setf("kill_3_counter", 0)
- D39e54cff9138d563e0ce1144b8a19a.prepare(4)
- end
- end
- end
- if (4 == stage) then
- if (npc.get_race() == 3902) then
- d.setf("kill_4_counter", d.getf("kill_4_counter") + 1)
- if (d.getf("kill_4_counter") >= 1) then
- d.setf("kill_4_counter", 0)
- D39e54cff9138d563e0ce1144b8a19a.prepare(5)
- end
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement