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
- -- 1층이 아닐 때만 밖으로 내보낸다.
- -- 층 범위
- -- 1층 88 577 236 737
- -- 2층 91 343 238 504
- -- 3층 104 107 248 269
- 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((5376+532)*100, (512+596+4)*100, 65)
- end
- pc.set_warp_location(65, 5376+532, 512+596+4)
- elseif pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 then
- pc.set_warp_location(65, 5376+532, 512+596+4)
- end
- end
- when deviltower_man.chat.locale.deviltower_man_chat begin
- if pc.get_level() < 40 then
- say(locale.deviltower_man_say_you_cant)
- else
- say(locale.deviltower_man_say)
- local s = select(locale.deviltower_enter,locale.deviltower_no_enter)
- if s == 1 then
- pc.warp(216500,727000)
- end
- end
- end
- when devil_stone1.kill begin
- timer("devil_stone1_1", 6)
- end
- when devil_stone1_1.timer begin
- local mapto7 = pc.count_item(30302) -- 혹시 있을찌 모를 진사귀지도타워 지우기
- pc.remove_item(30302,mapto7)
- local boxto7 = pc.count_item(30300) -- 혹시 있을찌 모를 알수없는상자 지우기
- pc.remove_item(30300,boxto7)
- d.new_jump_all(66, special.devil_tower[1][1], special.devil_tower[1][2])
- d.regen_file("data/dungeon/deviltower2_regen.txt")
- d.set_warp_at_eliminate(4, d.get_map_index(), special.devil_tower[2][1], special.devil_tower[2][2], "data/dungeon/deviltower3_regen.txt")
- end
- when devil_stone3.kill 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() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
- d.setf("level", 4)
- -- 잡다한 몹을 리젠하고 가짜 돌과 진짜 돌을 만듬
- --d.regen_file("data/dungeon/deviltower4_regen.txt")
- local positions = deviltower_zone.get_4floor_stone_pos()
- for i = 1, 6 do
- chat(positions[i][1], positions[i][2])
- d.set_unique("fake" .. i , d.spawn_mob(8017, positions[i][1], positions[i][2]))
- end
- chat(positions[7][1], positions[7][2])
- local vid = d.spawn_mob(8017, positions[7][1], positions[7][2])
- chat(vid)
- d.set_unique("real", vid)
- server_loop_timer('devil_stone4_update', 10, pc.get_map_index())
- server_timer('devil_stone4_fail1', 5*60, pc.get_map_index())
- d.notice("선택의 관문 4층입니다.");
- d.notice("수많은 메틴석이 여러분의 눈과 귀를 현혹하고 있습니다.");
- d.notice("이중 진짜 메틴석을 15분 내로 찾아 격파하십시오!");
- d.notice("그것 만이 이 선택의 관문을 빠져나가는 길입니다.");
- end
- when devil_stone4_fail1.server_timer begin
- if d.select(get_server_timer_arg()) then
- d.notice("10분 남았습니다.")
- server_timer('devil_stone4_fail2', 5*60, get_server_timer_arg())
- end
- end
- when devil_stone4_fail2.server_timer begin
- if d.select(get_server_timer_arg()) then
- d.notice("5분 남았습니다.")
- server_timer('devil_stone4_fail', 5*60, get_server_timer_arg())
- end
- end
- when devil_stone4_fail.server_timer begin
- if d.select(get_server_timer_arg()) then
- d.notice("시간제한에 다되어 실패했습니다.")
- d.exit_all()
- clear_server_timer('devil_stone4_update', get_server_timer_arg())
- end
- end
- when devil_stone4_update.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("가짜 메틴석이 사라집니다....");
- end
- end
- end
- else
- server_timer("devil_stone4_end", 5, get_server_timer_arg())
- d.kill_all()
- d.notice("현명한 판단력과 뛰어난 육감으로 진짜 메틴석을 격파하였습니다!");
- d.notice("잠시후 5층으로 이동합니다.")
- clear_server_timer('devil_stone4_fail1', get_server_timer_arg())
- clear_server_timer('devil_stone4_fail2', get_server_timer_arg())
- clear_server_timer('devil_stone4_fail', get_server_timer_arg())
- end
- else
- server_timer('devil_stone4_stop_timer', 1, get_server_timer_arg())
- end
- end
- when devil_stone4_stop_timer.server_timer begin
- clear_server_timer('devil_stone4_update', get_server_timer_arg())
- end
- when devil_stone4_end.server_timer begin
- if d.select(get_server_timer_arg()) then
- d.setf("level", 5)
- d.setf("stone_count", 5)
- d.notice("봉인의 관문, 5층입니다.")
- d.notice("이곳의 수많은 몬스터들이 6층으로 올라가는 결계석을 치키고 있습니다.")
- d.notice("그리고 결계를 해제할 수 있는 열쇠는 일부 몬스터가 가지고 있습니다.")
- d.notice("20분 내에 결계를 해제하여 6층으로 진행하십시오!")
- d.jump_all(special.devil_tower[4][1], special.devil_tower[4][2])
- server_timer('devil_stone5_fail1', 5*60, get_server_timer_arg())
- clear_server_timer('devil_stone4_update', get_server_timer_arg())
- -- 5 층은 계속 리젠
- d.set_regen_file("data/dungeon/deviltower5_regen.txt")
- -- 5층 봉인석 리젠
- 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_fail1.server_timer begin
- if d.select(get_server_timer_arg()) then
- d.notice("15분 남았습니다.")
- server_timer('devil_stone5_fail2', 5*60, get_server_timer_arg())
- end
- end
- when devil_stone5_fail2.server_timer begin
- if d.select(get_server_timer_arg()) then
- d.notice("10분 남았습니다.")
- server_timer('devil_stone5_fail3', 5*60, get_server_timer_arg())
- end
- end
- when devil_stone5_fail3.server_timer begin
- if d.select(get_server_timer_arg()) then
- d.notice("5분 남았습니다.")
- server_timer('devil_stone5_fail', 5*60, get_server_timer_arg())
- end
- end
- when devil_stone5_fail.server_timer begin
- if d.select(get_server_timer_arg()) then
- d.notice("시간제한에 다되어 실패했습니다.")
- d.exit_all()
- end
- end
- when 1062.kill with pc.in_dungeon() 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 devil_stone5.take with item.vnum == 50084 begin
- npc.purge()
- item.remove()
- d.setf("stone_count", d.getf("stone_count") - 1)
- if d.getf("stone_count") <= 0 then
- d.setf("level", 6)
- d.clear_regen()
- d.regen_file("data/dungeon/deviltower6_regen.txt")
- d.notice("모든 결계의 봉인이 해제되었습니다. 6층으로 이동합니다.")
- d.notice("사귀왕이 지키고 있는 6층의 모든 몬스터를 제거하십시오.")
- d.jump_all(special.devil_tower[5][1], special.devil_tower[5][2])
- local timer_arg = d.get_map_index()
- clear_server_timer('devil_stone5_fail1', timer_arg)
- clear_server_timer('devil_stone5_fail2', timer_arg)
- clear_server_timer('devil_stone5_fail3', timer_arg)
- clear_server_timer('devil_stone5_fail', timer_arg)
- else
- d.notice("봉인을 해제하였습니다! "..d.getf("stone_count").."개 남았습니다.")
- end
- end
- when devil_stone6.kill begin
- -- 여기서 연금술사가 있는 맵으로 워프를 합시다
- -- 아니면 연금술사 만들어주던지
- --d.jump_all(special.devil_tower[6][1], special.devil_tower[6][2])
- d.kill_all()
- -- d.set_warp_at_eliminate(3*60, 65, 5376+532, 512+596+4)
- d.check_eliminated()
- local reward_alchemist = {20074, 20075, 20076}
- d.spawn_mob(reward_alchemist[number(1,3)], 425, 216);
- d.setqf2("deviltower_zone", "can_refine", 1)
- end
- --------------------------------------
- -- 6층 진입부터 7층 직전 까지
- --------------------------------------
- when 20074.chat."탑의 상층에 대해서.." with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and npc.lock() begin
- say("사귀탑 무기 대장장이")
- say("7층으로 가는 방법이 발견되었다네")
- say("들어가기위해선 상당한 능력과 기술이 요한다네")
- say("흠....")
- say("내가 자네가 위층에 올라갈수 있는지 살펴보니..")
- wait()
- if pc.level >=75 then
- say("사귀탑 무기 대장장이")
- say("충분히 올라갈 자격이 있구먼")
- say("내가 올려 보내주겠네..")
- timer("devil_jump_7", 6)
- npc.unlock()
- d.purge()
- return
- end
- say("사귀탑 무기 대장장이")
- say("아직 자네의 수련도가 부족하여")
- say("올라가기 어려울듯 허이...")
- say("수련을 쌓고 오게")
- say("")
- wait()
- pc.warp(590500, 110500)
- end
- when 20075.chat."탑의 상층에 대해서.." with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and npc.lock() begin
- say("사귀탑 무기 대장장이")
- say("사귀탑 방어구 대장장이")
- say("7층으로 가는 방법이 발견되었다네")
- say("들어가기위해선 상당한 능력과 기술이 요한다네")
- say("흠....")
- say("내가 자네가 위층에 올라갈수 있는지 살펴보니..")
- wait()
- if pc.level >=75 then
- say("사귀탑 무기 대장장이")
- say("충분히 올라갈 자격이 있구먼")
- say("내가 올려 보내주겠네..")
- timer("devil_jump_7", 6)
- npc.unlock()
- d.purge()
- return
- end
- say("사귀탑 무기 대장장이")
- say("아직 자네의 수련도가 부족하여")
- say("올라가기 어려울듯 허이...")
- say("수련을 쌓고 오게")
- say("")
- wait()
- pc.warp(590500, 110500)
- end
- when 20076.chat."탑의 상층에 대해서.." with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and npc.lock() begin
- say("사귀탑 무기 대장장이")
- say("사귀탑 악세사리 대장장이")
- say("7층으로 가는 방법이 발견되었다네")
- say("들어가기위해선 상당한 능력과 기술이 요한다네")
- say("흠....")
- say("내가 자네가 위층에 올라갈수 있는지 살펴보니..")
- wait()
- if pc.level >=75 then
- say("사귀탑 무기 대장장이")
- say("충분히 올라갈 자격이 있구먼")
- say("내가 올려 보내주겠네..")
- timer("devil_jump_7", 6)
- npc.unlock()
- d.purge()
- return
- end
- say("사귀탑 무기 대장장이")
- say("아직 자네의 수련도가 부족하여")
- say("올라가기 어려울듯 허이...")
- say("수련을 쌓고 오게")
- say("")
- wait()
- pc.warp(590500, 110500)
- 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() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
- local cont = d.getf("7_stone_kill") + 1
- d.setf("7_stone_kill", cont)
- if cont >= 4 then
- d.setf("7_stone_kill", 0)
- d.regen_file("data/dungeon/deviltower7_regen.txt")
- end
- end
- when 8019.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
- game.drop_item(30300, 1)
- d.clear_regen()
- d.kill_all()
- say("상자를 열어보자")
- say("")
- d.spawn_mob(33001, 620, 635)
- end
- when 30300.use with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
- pc.remove_item("30300", 1)
- local pct = number(1,10)
- if pct == 1 then
- game.drop_item(30302, 1) -- 진짜 지도 드롭
- d.notice("윗층으로의 지도가 나타났다");
- else
- game.drop_item(30301, 1) -- 가짜지도 드롭
- d.regen_file("data/dungeon/deviltower7_regen.txt")
- end
- end
- when 33001.chat."왠 해골이..." with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
- say("내가 사귀타워의 공략에 실패했나 보군..")
- say("아무리 봐도 내가 밖으로 빠저나갈 방법이 없는 것 같아..")
- say("여기 누워있는 해골처럼 되는 것이 아닐까..")
- say("그런데 누구의 해골이지???")
- say("")
- wait()
- say("해골을 뒤져볼까요?")
- say("")
- if 1 == select("네", "아니요") then
- say("...")
- say("뒤적뒤적")
- say("....")
- say("쿡!")
- wait()
- d.exit_all()
- end
- end
- when 30302.use with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
- -- 8층으로 워프
- if d.getf("level") != 7 then
- say("이 지도는 지금 전혀 맞지 않는 것 같다")
- say("")
- pc.remove_item("30302", 1)
- return
- end
- say("이 지도만 있으면 바로 여기를 통과 할수 있어")
- say("")
- pc.remove_item("30302", 1)
- timer("devil_jump_8", 6)
- d.clear_regen()
- end
- --------------------------------------------
- -- 8층 진입부터 9층 까지
- --------------------------------------------
- when devil_jump_8.timer begin
- d.setf("level", 8)
- d.jump_all(2048+590, 6656+403)
- d.set_regen_file("data/dungeon/deviltower8_regen.txt")
- pc.remove_item(30302, pc.count_item(30302)) -- 진 사귀타워 지우기
- end
- when 1040.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 and d.getf("level") == 8 begin
- if number(1, 5) == 1 then
- if number(1, 10) == 1 then
- game.drop_item(30304, 1) -- 진짜 열쇠 드롭
- d.clear_regen()
- d.kill_all()
- d.spawn_mob(20366, 640, 460)
- else
- game.drop_item(30303, 1) -- 가짜 열쇠 드롭
- end
- end
- end
- when 20366.take with item.vnum == 30304 and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
- -- 봉인 해체 9층 ㄱㄱ
- d.clear_regen()
- d.kill_all()
- npc.purge()
- item.remove()
- timer("devil_jump_9", 6)
- end
- when 20366.chat."여기서 포기!!?" with pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
- say("")
- say("더 이상은 힘들군, 비석의 힘을 빌려 여기를 벗어나야겠어..")
- say("")
- wait()
- d.exit_all()
- end
- ---------------------------------------------
- -- 9층 진입부터 완료까지
- ---------------------------------------------
- when devil_jump_9.timer begin
- d.setf("level", 9)
- d.jump_all(2048+590, 6656+155)
- d.regen_file("data/dungeon/deviltower9_regen.txt")
- end
- when 1093.kill with pc.in_dungeon() and pc.get_map_index() >= 660000 and pc.get_map_index() < 670000 begin
- d.kill_all()
- d.setqf2("deviltower_zone", "9_done", 1)
- notice_multiline(locale.deviltower_Notice_final, d.notice)
- server_timer("devil_end_jump", 60, d.get_map_index())
- end
- when devil_end_jump.server_timer begin
- if d.select (get_server_timer_arg()) then
- d.clear_regen()
- d.exit_all()
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement