Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- quest deviltower_zone begin
- state start begin
- when login begin
- if pc.get_map_index() == 66 then
- if pc.get_level() < 40 then
- warp_to_village()
- else
- if pc.get_x() < 2048+88 or pc.get_y() < 6656+577 or pc.get_x() > 2048+236 or pc.get_y() > 6656+737 then
- pc.warp(590500, 110500)
- end
- pc.set_warp_location(65, 5905, 1105)
- end
- elseif pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 then
- if pc.get_level() < 40 then
- warp_to_village()
- else
- pc.set_warp_location(65, 5905, 1105)
- end
- end
- end
- when logout begin
- -- metin and key
- if pc.count_item(30300) >= 1 then
- pc.remove_item(30300, pc.count_item(30300))
- end
- if pc.count_item(30302) >= 1 then
- pc.remove_item(30302, pc.count_item(30302))
- end
- end
- when 20348.chat."Do Wieży Demonów..." begin
- if pc.get_level() < 40 then
- say_title("Strażnik Wieży Demonów")
- say("Chyba zgłupiałeś... Masz za mały poziom")
- say("Wróć do mnie, gdy osiągniesz 40 poziom postaci.")
- else
- say_title("Strażnik Wieży Demonów")
- say("Ta wieża jest opanowana przez demony. Na jej")
- say("szczyt mogą dostać się jedynie najsilniejsi.")
- say("Chodzą słuchy, że jeszcze nikt nie wyszedł z niej")
- say("żywy. Czy nadal chcesz wejść do Wieży")
- say("Demonów?")
- local s = select("Wejdź ","Nie wchodź ")
- if s == 2 then
- return
- end
- -- warp into!
- pc.warp(216500,727000)
- end
- end
- when 8015.kill with pc.get_map_index() == 66 begin
- timer("devil_stone1_1", 3)
- end
- when devil_stone1_1.timer begin
- d.new_jump_all(66, special.devil_tower[2][1], special.devil_tower[2][2])
- d.regen_file("data/dungeon/deviltower3_regen.txt")
- end
- when devil_stone3.kill with pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
- d.set_warp_at_eliminate(4, d.get_map_index(), special.devil_tower[3][1], special.devil_tower[3][2], "data/dungeon/deviltower4_regen.txt")
- d.check_eliminated()
- end
- function get_4floor_stone_pos()
- local positions =
- {
- {368, 629}, {419, 630}, {428, 653}, {422, 679},
- {395, 689}, {369, 679}, {361, 658},
- }
- for i = 1, 6 do
- local j = number(i, 7)
- if i != j then
- local t = positions[i];
- positions[i] = positions[j];
- positions[j] = t;
- end
- end
- return positions
- end
- when 8016.kill with pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
- d.setf("level", 4)
- local positions = deviltower_zone.get_4floor_stone_pos()
- for i = 1, 6 do
- d.set_unique("fake" .. i , d.spawn_mob(8017, positions[i][1], positions[i][2]))
- end
- local vid = d.spawn_mob(8017, positions[7][1], positions[7][2])
- d.set_unique("real", vid)
- server_loop_timer('devil_stone4_11_updat', 10, pc.get_map_index())
- server_timer('devil_stone4_11_faill1', 5*60, pc.get_map_index())
- d.notice("Dotarłeś do Bramy Wyboru na 3. piętrze. Wiele");
- d.notice("kamieni Metin będzie drażnić Twoje oczy i uszy.");
- d.notice("Znajdź właściwy kamień Metin i zniszcz go w ciągu");
- d.notice("15 minut! To jedyny sposób aby przejść dalej.");
- end
- when devil_stone4_11_faill1.server_timer begin
- if d.select(get_server_timer_arg()) then
- if d.getf("level") == 4 then
- d.notice("Pozostało 10 minut!")
- server_timer('devil_stone4_11_faill2', 5*60, get_server_timer_arg())
- end
- end
- end
- when devil_stone4_11_faill2.server_timer begin
- if d.select(get_server_timer_arg()) then
- if d.getf("level") == 4 then
- d.notice("Pozostało 5 minut!")
- server_timer('devil_stone4_11_faill', 5*60, get_server_timer_arg())
- end
- end
- end
- when devil_stone4_11_faill.server_timer begin
- if d.select(get_server_timer_arg()) then
- if d.getf("level") == 4 then
- d.notice("Czas się skończył.")
- d.clear_regen()
- d.exit_all()
- clear_server_timer('devil_stone4_11_updat', get_server_timer_arg())
- end
- end
- end
- when devil_stone4_11_updat.server_timer begin
- if d.select(get_server_timer_arg()) then
- if not d.is_unique_dead("real") then
- for i = 1, 6 do
- if d.getf("fakedead" .. i) == 0 then
- if d.unique_get_hp_perc("fake" .. i) < 50 then
- d.purge_unique("fake" .. i)
- d.setf("fakedead" .. i, 1)
- d.notice("Fałszywe kamienie Metin znikają...");
- end
- end
- end
- else
- server_timer('devil_stone5_11_tp', 5, get_server_timer_arg())
- d.notice("Wykazałeś się doskonałym słuchem i instynktem");
- d.notice("Zniszczyłeś prawidłowy kamień Metin! Za chwilę ")
- d.notice("dotrzesz na 5. piętro!")
- d.purge()
- end
- else
- server_timer('devil_stone4_11_stop_timers', 1, get_server_timer_arg())
- end
- end
- when devil_stone4_11_stop_timers.server_timer begin
- clear_server_timer('devil_stone4_11_updat', get_server_timer_arg())
- end
- when devil_stone5_11_tp.server_timer begin
- if d.select(get_server_timer_arg()) then
- clear_server_timer('devil_stone4_11_updat', get_server_timer_arg())
- clear_server_timer('devil_stone4_11_faill1', get_server_timer_arg())
- clear_server_timer('devil_stone4_11_faill2', get_server_timer_arg())
- clear_server_timer('devil_stone4_11_faill', get_server_timer_arg())
- d.setf("level", 5)
- d.notice("Dotarłeś do zamkniętej Bramy na 4. piętrze!")
- d.notice("Znajduje się tu wiele potworów, które strzegą ")
- d.notice("tajemniczych kamieni - będziesz ich potrzebował.")
- d.notice("Bez nich nie dostaniesz się na 5. poziom Wieży.")
- d.notice("Zdobądź Kamienie od potworów i użyj ich, aby")
- d.notice("odblokować Starożytne Pieczęcie. Na wykonanie")
- d.notice("tego zadania masz tylko 20 minut - spiesz się!")
- d.jump_all(special.devil_tower[4][1], special.devil_tower[4][2])
- server_timer('devil_stone5_11_faill1', 5*60, get_server_timer_arg())
- clear_server_timer('devil_stone4_11_updat', get_server_timer_arg())
- d.set_regen_file("data/dungeon/deviltower5_regen.txt")
- d.spawn_mob(20073, 421, 452)
- d.spawn_mob(20073, 380, 460)
- d.spawn_mob(20073, 428, 414)
- d.spawn_mob(20073, 398, 392)
- d.spawn_mob(20073, 359, 426)
- end
- end
- when devil_stone5_11_faill1.server_timer begin
- if d.select(get_server_timer_arg()) then
- if d.getf("level") == 5 then
- d.notice("Pozostało 15 minut!")
- server_timer('devil_stone5_11_faill2', 5*60, get_server_timer_arg())
- end
- end
- end
- when devil_stone5_11_faill2.server_timer begin
- if d.select(get_server_timer_arg()) then
- if d.getf("level") == 5 then
- d.notice("Pozostało 10 minut!")
- server_timer('devil_stone5_11_faill3', 5*60, get_server_timer_arg())
- end
- end
- end
- when devil_stone5_11_faill3.server_timer begin
- if d.select(get_server_timer_arg()) then
- if d.getf("level") == 5 then
- d.notice("Pozostało 5 minut!")
- server_timer('devil_stone5_11_faill', 5*60, get_server_timer_arg())
- end
- end
- end
- when devil_stone5_11_faill.server_timer begin
- if d.select(get_server_timer_arg()) then
- if d.getf("level") == 5 then
- d.notice("Czas się skończył.")
- d.exit_all()
- end
- end
- end
- when 1062.kill with pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 5 begin
- local KILL_COUNT_FOR_DROP_KEY = 50
- local n =d.getf("count") + 1
- d.setf("count", n)
- if n == KILL_COUNT_FOR_DROP_KEY then
- game.drop_item(50084, 1)
- d.setf("count", 0)
- end
- end
- when 20073.take with item.vnum == 50084 and pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 5 begin
- npc.purge()
- item.remove()
- d.setf("stone_counts", d.getf("stone_counts") + 1)
- if d.getf("stone_counts") <= 4 then
- d.notice("Otworzyłeś pieczęć! Pozostało jeszcze: "..5 - d.getf("stone_counts").."!")
- elseif d.getf("stone_counts") > 4 then
- d.clear_regen()
- d.kill_all()
- d.notice("Wszystkie Starożytne Pieczęci zostały otwarte.")
- d.notice("Teraz dotrzesz na 5. poziom Wieży Demonów. ")
- clear_server_timer('devil_stone5_11_faill1', get_server_timer_arg())
- clear_server_timer('devil_stone5_11_faill2', get_server_timer_arg())
- clear_server_timer('devil_stone5_11_faill3', get_server_timer_arg())
- clear_server_timer('devil_stone5_11_faill', get_server_timer_arg())
- d.setf("level", 6)
- d.setf("stone_counts", 0)
- d.jump_all(special.devil_tower[5][1], special.devil_tower[5][2])
- d.regen_file("data/dungeon/deviltower6_regen.txt")
- d.notice("Zabij wszystkie potwory na 5. piętrze, jednak ")
- d.notice("uważaj Piętro to należy do Króla Demonów! ")
- end
- end
- when 1092.kill with pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 6 begin
- d.setqf("can_refine", 1)
- d.kill_all()
- d.notice("Zabiłeś wszystkie potwory, jako nagrodę otrzymasz")
- d.notice("możliwość ulepszenia jednego z Twoich przedmiotów")
- d.notice("u Kowala. Po prostu przeciągnij przedmiot,")
- d.notice("który chcesz ulepszyć na Kowala.")
- local reward_alchemist = {20074, 20075, 20076}
- d.spawn_mob(reward_alchemist[number(1,3)], 425, 216);
- end
- when 20074.chat."Opcja 'Wyższe piętro'" or 20075.chat."Opcja 'Wyższe piętro'" or 20076.chat."Opcja 'Wyższe piętro'" with pc.is_gm() begin
- say_title(mob_name(20074))
- say("Co chcesz zrobić z opcją 'Wyższe piętro'?")
- local s = select("Blokuj", "Odblokuj", "Anuluj")
- if s == 3 then
- return
- elseif s == 1 then
- if d.getf("can_warp") == 1 then
- say_title(mob_name(20074))
- say("Opcja 'Wyższe piętro' jest zablokowana.")
- return
- end
- say_title(mob_name(20074))
- say("Opcja 'Wyższe piętro' została zablokowana.")
- d.setf("can_warp", 1)
- return
- elseif s == 2 then
- if d.getf("can_warp") == 0 then
- say_title(mob_name(20074))
- say("Opcja 'Wyższe piętro' jest odblokowana.")
- return
- end
- say_title(mob_name(20074))
- say("Opcja 'Wyższe piętro' została odblokowana.")
- d.setf("can_warp", 0)
- return
- end
- end
- when 20074.chat."Wyższe piętro" with pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 6 and npc.lock() and d.getf("can_warp") == 0 begin
- say_title(mob_name(20074))
- say("Co?! Chcesz udać się na 6. poziom Wieży? ")
- say("Wyprawa na wyższe poziomy wymaga")
- say("naprawdę dobrego przygotowania.")
- say("Jeżeli osiągnąłeś 75. poziom mogę ")
- say("przenieść Cię na wyższe piętro.")
- wait()
- if pc.level >=75 then
- say_title(mob_name(20074))
- say("Masz odpowiedni poziom i dlatego masz spore ")
- say("szanse na przetrwanie na wyższych piętrach.")
- say("Możesz wejść.")
- local s= select("Wchodzę ", "Zostaję ")
- if s==2 then
- return
- end
- timer("devil_jump_7", 6)
- npc.unlock()
- d.purge()
- return
- end
- say_title(mob_name(20074))
- say("Nie mogę Ciebie wpuścić na wyższe piętro")
- say("Twoje doświadczenie nie wystarcza, aby tam")
- say("przetrwać. Wróć tutaj po osiągnięciu co najmniej")
- say("75 poziomie.")
- return
- end
- when 20075.chat."Wyższe piętro" with pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 6 and npc.lock() and d.getf("can_warp") == 0 begin
- say_title(mob_name(20075))
- say("Co?! Chcesz udać się na 6. poziom Wieży? ")
- say("Wyprawa na wyższe poziomy wymaga")
- say("naprawdę dobrego przygotowania.")
- say("Jeżeli osiągnąłeś 75. poziom mogę ")
- say("przenieść Cię na wyższe piętro.")
- wait()
- if pc.level >=75 then
- say_title(mob_name(20075))
- say("Masz odpowiedni poziom i dlatego masz spore ")
- say("szanse na przetrwanie na wyższych piętrach.")
- say("Możesz wejść.")
- local s= select("Wchodzę ", "Zostaję ")
- if s==2 then
- return
- end
- timer("devil_jump_7", 6)
- npc.unlock()
- d.purge()
- return
- end
- say_title(mob_name(20075))
- say("Nie mogę Ciebie wpuścić na wyższe piętro")
- say("Twoje doświadczenie nie wystarcza, aby tam")
- say("przetrwać. Wróć tutaj po osiągnięciu co najmniej")
- say("75 poziomie.")
- return
- end
- when 20076.chat."Wyższe piętro" with pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 6 and npc.lock() and d.getf("can_warp") == 0 begin
- say_title(mob_name(20076))
- say("Co?! Chcesz udać się na 6. poziom Wieży? ")
- say("Wyprawa na wyższe poziomy wymaga")
- say("naprawdę dobrego przygotowania.")
- say("Jeżeli osiągnąłeś 75. poziom mogę ")
- say("przenieść Cię na wyższe piętro.")
- wait()
- if pc.level >=75 then
- say_title(mob_name(20076))
- say("Masz odpowiedni poziom i dlatego masz spore ")
- say("szanse na przetrwanie na wyższych piętrach.")
- say("Możesz wejść.")
- local s= select("Wchodzę ", "Zostaję ")
- if s==2 then
- return
- end
- timer("devil_jump_7", 6)
- npc.unlock()
- d.purge()
- return
- end
- say_title(mob_name(20076))
- say("Nie mogę Ciebie wpuścić na wyższe piętro")
- say("Twoje doświadczenie nie wystarcza, aby tam")
- say("przetrwać. Wróć tutaj po osiągnięciu co najmniej")
- say("75 poziomie.")
- return
- end
- when devil_jump_7.timer begin
- d.clear_regen()
- d.spawn_mob(8018, 639, 658)
- d.spawn_mob(8018, 611, 637)
- d.spawn_mob(8018, 596, 674)
- d.spawn_mob(8018, 629, 670)
- d.setf("level", 7)
- d.jump_all(2048+590, 6656+638)
- end
- when 8018.kill with pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 7 begin
- local cont = d.getf("7_stone_kill") + 1
- d.setf("7_stone_kill", cont)
- if cont >= 4 then
- d.notice("Bijcie teraz Metiny Morderstwa, aby odszukać prawidłową mapę.")
- elseif cont >= 3 then
- d.notice("Został wam jeszcze "..4-d.getf("7_stone_kill").." metin.")
- else
- d.notice("Zostały wam jeszcze "..4-d.getf("7_stone_kill").." metiny.")
- end
- if cont >= 4 then
- d.setf("7_stone_kill", 0)
- d.set_regen_file("data/dungeon/deviltower7_regen.txt")
- end
- end
- when 8019.kill with pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 7 begin
- game.drop_item(30300, 1)
- end
- when 30300.use with pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 7 begin
- pc.remove_item("30300", 1)
- local pct = number(1,3)
- if pct == 1 then
- game.drop_item(30302, 1)
- d.clear_regen()
- else
- -- nothing happens cause the items isnt used in the game
- -- game.drop_item(30301, 1)
- end
- end
- when 30302.use with pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 7 begin
- if d.getf( "level" ) != 7 then
- pc.remove_item("30302", 1)
- chat("Bugowanie Wieży Demonów jest zabronione!")
- return
- end
- say_title("Informacja")
- say("Ta mapa przeniesie Cię na 7. poziom Wieży")
- say("Demonów.")
- pc.remove_item("30302", 1)
- timer("devil_jump_8", 6)
- d.clear_regen()
- end
- when devil_jump_8.timer begin
- d.setf("level", 8)
- local plusone = d.getf("check") +1
- d.setf("check", plusone)
- d.notice("Znajdź odpowieni klucz!")
- d.notice("Potrzebujesz klucza Zin-Bong-In aby")
- d.notice("móc otworzyć pieczęć Sa-Soein i dostać ")
- d.notice("się na następne piętro Wieży.")
- d.jump_all(2048+590, 6656+403)
- d.set_regen_file("data/dungeon/deviltower8_regen.txt")
- d.spawn_mob(20366, 640, 460)
- local _count = pc.count_item(30302)
- pc.remove_item(30302,_count)
- if d.getf("check") != 1 then
- d.notice("Wykryto bug! Wasza wyprawa się kończy.")
- timer("devil_jump_8_bug", 3)
- end
- end
- when devil_jump_8_bug.timer begin
- d.clear_regen()
- d.exit_all()
- end
- when 1040.kill with pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 8 begin
- local pct1 = number(1, 4)
- if pct1 == 1 then
- local pct2 = number(1, 4)
- if pct2 == 1 then
- game.drop_item(30304, 1)
- else
- game.drop_item(30303, 1)
- end
- else
- return
- end
- end
- when 20366.take with item.vnum == 30304 and pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 8 begin
- npc.purge()
- item.remove()
- timer("devil_jump_9", 6)
- end
- when devil_jump_9.timer begin
- d.setf("level", 9)
- d.notice("Zabij Umarłego Rozpruwacza!")
- d.jump_all(2048+590, 6656+155)
- d.regen_file("data/dungeon/deviltower9_regen.txt")
- end
- when 1093.kill with pc.in_dungeon() == true and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 9 begin
- if number(2,5) == 5 then
- game.drop_item_with_ownership(30319)
- end
- d.kill_all()
- d.setf("level", 0)
- notice_all("Umarły Rozpruwacz został pokonany przez "..pc.get_name().."!")
- timer("devil_end_jump", 60)
- end
- when devil_end_jump.timer begin
- d.clear_regen()
- d.exit_all()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement