1217 lines
46 KiB
Lua
1217 lines
46 KiB
Lua
--- Lua 스크립트 암호화
|
|
function get_module_name()
|
|
return "ETC_dungeon_prop"
|
|
end
|
|
|
|
|
|
-- 제어장치 및 코어 점령시 호출될 함수.
|
|
-- 내부적으로 서버에서 제공하는 소유권 변경 함수 및 주변 몹 리젠 함수( respawn_near_mob( range ) )가 사용됨.
|
|
function casting_tactical_position( dungeon_id, position_id )
|
|
|
|
-- 호출된 지점의 (제어장치 혹은 던전 코어) 소유권을 변경시키는 부분
|
|
change_tactical_position_owner( dungeon_id, position_id )
|
|
|
|
-- 변경된 지점 주변의 가디언을 리젠
|
|
respawn_guardian_object( dungeon_id, position_id )
|
|
|
|
|
|
end
|
|
|
|
-- 던전 출구 클릭시 필드로 텔레포트 시켜 주는 일반 함수.
|
|
function exit_dungeon( dungeon_id )
|
|
|
|
-- 잃어버린 던전1
|
|
if dungeon_id == 130000 then
|
|
-- TO DO : 던전 입구 쪽의 텔레포트 좌표 넣어야 함
|
|
warp( 155817 + math.random(0,60) , 103724 + math.random(0,60) )
|
|
|
|
-- 잃어버린 던전2
|
|
elseif dungeon_id == 130600 then
|
|
-- TO DO : 던전 입구 쪽의 텔레포트 좌표 넣어야 함
|
|
warp( 152309 + math.random(0,60) , 102886 + math.random(0,60) )
|
|
|
|
-- 수정 계곡1
|
|
elseif dungeon_id == 130300 then
|
|
-- TO DO : 던전 입구 쪽의 텔레포트 좌표 넣어야 함
|
|
warp( 103210 + math.random(0,60) , 100366 + math.random(0,60) )
|
|
|
|
-- 수정 계곡2
|
|
elseif dungeon_id == 130500 then
|
|
-- TO DO : 던전 입구 쪽의 텔레포트 좌표 넣어야 함
|
|
warp( 99757 + math.random(0,60) , 103236 + math.random(0,60) )
|
|
|
|
-- 메마른 달빛의 유적1
|
|
elseif dungeon_id == 130400 then
|
|
-- TO DO : 던전 입구 쪽의 텔레포트 좌표 넣어야 함
|
|
warp( 132995 + math.random(0,60) , 87096 + math.random(0,60) )
|
|
|
|
-- 메마른 달빛의 유적2
|
|
elseif dungeon_id == 130700 then
|
|
-- TO DO : 던전 입구 쪽의 텔레포트 좌표 넣어야 함
|
|
warp( 130842 + math.random(0,60) , 79586 + math.random(0,60) )
|
|
|
|
-- 팔미르 제 1 유적
|
|
elseif dungeon_id == 130800 then
|
|
-- TO DO : 던전 입구 쪽의 텔레포트 좌표 넣어야 함
|
|
warp( 132680 + math.random(0,60) , 128030 + math.random(0,60) )
|
|
|
|
-- 팔미르 제 2 유적
|
|
elseif dungeon_id == 130900 then
|
|
-- TO DO : 던전 입구 쪽의 텔레포트 좌표 넣어야 함
|
|
warp( 137441 + math.random(0,60) , 128115 + math.random(0,60) )
|
|
|
|
-- 잃어버린 비밀의 섬(백룡의 쉼터)
|
|
elseif dungeon_id == 121000 then
|
|
-- TO DO : 던전 입구 쪽의 텔레포트 좌표 넣어야 함
|
|
warp( 91942 + math.random(0,60) , 117103 + math.random(0,60) )
|
|
|
|
-- 잃어버린 비밀의 섬(흑룡의 그늘)
|
|
elseif dungeon_id == 122000 then
|
|
-- TO DO : 던전 입구 쪽의 텔레포트 좌표 넣어야 함
|
|
warp( 85752 + math.random(0,60) , 118062 + math.random(0,60) )
|
|
|
|
-- 잃어버린 비밀의 섬(사룡의 심장)
|
|
elseif dungeon_id == 123000 then
|
|
-- TO DO : 던전 입구 쪽의 텔레포트 좌표 넣어야 함
|
|
warp( 91998 + math.random(0,60) , 124400 + math.random(0,60) )
|
|
|
|
-- 엘 카시아 워프 프랍 (엘 카시아 -> 마르두카 폭포 필드)
|
|
elseif dungeon_id == 120700 then
|
|
-- TO DO : 던전 입구 쪽의 텔레포트 좌표 넣어야 함
|
|
warp( 146015 + math.random(0,61) , 135591+ math.random(0,10) )
|
|
|
|
-- 숨겨진 팔미르 던전 워프 프랍 (숨겨진 팔미르 입구 -> 팔미르 제 1 실 입구 필드)
|
|
elseif dungeon_id == 120292 then
|
|
-- TO DO : 던전 입구 쪽의 텔레포트 좌표 넣어야 함
|
|
warp( 132680 + math.random(0,60) , 128030 + math.random(0,60) )
|
|
|
|
-- 숨겨진 수정 계곡 던전 워프 프랍 (숨겨진 수정 계곡 입구 -> 수정 계곡 입구 필드)
|
|
elseif dungeon_id == 70192 then
|
|
-- TO DO : 던전 입구 쪽의 텔레포트 좌표 넣어야 함
|
|
warp( 103234+ math.random(0,60) , 100310 + math.random(0,60) )
|
|
|
|
-- 고대인의 유적 던전 워프 프랍 (고대인의 유적 -> 사이라그 폐허 필드)
|
|
elseif dungeon_id == 121100 then
|
|
-- TO DO : 던전 입구 쪽의 텔레포트 좌표 넣어야 함
|
|
warp( 108674+ math.random(0,60) , 76570 + math.random(0,60) )
|
|
|
|
|
|
-- Sky Forteress
|
|
elseif dungeon_id == 10600 then
|
|
warp( 108674+ math.random(0,60) , 76570 + math.random(0,60) )
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
function common_warp_gate( x, y )
|
|
warp( x + math.random(0,10) , y + math.random(0,10), gv("layer") )
|
|
end
|
|
|
|
function warp_gate( prop_id )
|
|
|
|
|
|
-- 나비스 라미아 갑판
|
|
if prop_id == 130881 then
|
|
if find_item ( 1000077 ) == 1 or 1 == 1 then -- 고리수정
|
|
warp( 190072 + math.random(0,10) , 34171+ math.random(0,10), gv("layer") ) -- 텔레포트 좌표
|
|
else
|
|
cprint( "@1233" ) -- '워프게이트 사용을 위한 허가를 받지 못했습니다.'
|
|
end
|
|
end
|
|
|
|
-- 나비스 라미아 조타실
|
|
if prop_id == 130882 then
|
|
|
|
-- 퀘스트 도중 다시 처음부터 시작 할때 진행 불가
|
|
--if quest_progress2 == 2 then
|
|
|
|
-- 첫번째 퀘스트 시작전이면(수행중이면)
|
|
--if quest_progress2 == 1 then
|
|
|
|
-- 텔레포트 좌표
|
|
warp( 189645 + math.random(0,10) , 36119+ math.random(0,10), gv("layer") )
|
|
|
|
--else
|
|
--cprint( "@1233" )
|
|
--end
|
|
end
|
|
|
|
-- 나비스 라미아 주방
|
|
if prop_id == 130883 then
|
|
-- 퀘스트 상태 체크 get_quest_progress(ID)
|
|
-- 반환값 -1 : 아무것도 아님 / 0 : 수락가 / 1 : 수행중 / 2 : 종료가능 / 255 : 이미종료
|
|
local quest_progress3 = get_quest_progress(1247) -- 유령선 나비스라미아: 진행 3
|
|
-- 퀘스트 도중 다시 처음부터 시작 할때 진행 불가
|
|
if quest_progress3 == 2 or quest_progress3 == 255 or 1 == 1 then
|
|
warp( 190018 + math.random(0,10) , 37865+ math.random(0,10), gv("layer") ) -- 텔레포트 좌표
|
|
else
|
|
cprint( "@1233" )
|
|
end
|
|
end
|
|
|
|
end
|
|
|
|
function parallelworld_exit()
|
|
if get_quest_progress(4009) == 1 then -- [일일]틈새조사 : 타임어택
|
|
dlg_special( 'confirm_window', 'exit_indun( 0 )', '@9911' )
|
|
else
|
|
dlg_special( 'confirm_window', 'exit_indun( 0 )', '@9906' )
|
|
end
|
|
end
|
|
|
|
function quest_start_4009()
|
|
delete_item( get_item_handle( 2016026 ), 1 )
|
|
warp_to_instance_dungeon(70000)
|
|
end
|
|
|
|
function on_create_parallelworld_instance( dungeon_id, layer )
|
|
local state_code = get_local_info() -- 국가코드
|
|
local current_time = get_os_date( "%Y-%m-%d %H:%M:%S" ) -- 현재 시간
|
|
|
|
-- check 가 1이 되야 이벤트 리스폰. 수정체 소환 이벤트
|
|
local check = 0
|
|
|
|
-- 북미 이벤트 (2월 1일 ~ 9월 29일) :
|
|
if ( state_code == 4 or state_code == 8 or state_code == 128 or state_code == 16384 or state_code == 32768 or state_code == 65536 )
|
|
and '2017-09-12 08:00:00' <= current_time and current_time < '2017-10-24 08:00:00' then
|
|
check = 1
|
|
elseif state_code == 256 and '2016-02-29 08:00:00' <= current_time and current_time < '2016-03-21 08:00:00' then
|
|
check = 1
|
|
end
|
|
|
|
if dungeon_id == 60000 then
|
|
add_instance_dungeon_monster( 60001, 60000, layer )
|
|
add_instance_dungeon_monster( 60002, 60000, layer )
|
|
add_instance_dungeon_monster( 60003, 60000, layer )
|
|
add_instance_dungeon_monster( 60004, 60000, layer )
|
|
add_instance_dungeon_monster( 60005, 60000, layer )
|
|
|
|
-- 수정체 소환
|
|
if check == 1 then
|
|
add_instance_dungeon_monster( 60051, 60000, layer )
|
|
end
|
|
|
|
elseif dungeon_id == 70000 then
|
|
broadcast_notice( 1, "@9915", 70000, layer )
|
|
|
|
add_instance_dungeon_monster( 70001, 70000, layer )
|
|
add_instance_dungeon_monster( 70002, 70000, layer )
|
|
add_instance_dungeon_monster( 70003, 70000, layer )
|
|
add_instance_dungeon_monster( 70004, 70000, layer )
|
|
add_instance_dungeon_monster( 70005, 70000, layer )
|
|
|
|
-- 수정체 소환
|
|
if check == 1 then
|
|
add_instance_dungeon_monster( 70051, 70000, layer )
|
|
end
|
|
end
|
|
end
|
|
|
|
function parallelworld_check_respawn_group_clear_1( respawn_group, x, y, layer )
|
|
|
|
local left_monster_count = get_alive_instance_respawn_group_monster_count( 60000, layer, respawn_group ) -- 패러렐 월드<1>
|
|
|
|
-- 카운트 처리
|
|
if left_monster_count == 0 then
|
|
if respawn_group == 60001 then
|
|
local text = sconv( "@9910", "#@boss_no@#", tostring( 1 ) )
|
|
broadcast_notice( 1, text, 60000, layer )
|
|
|
|
add_instance_dungeon_monster( 60006, 60000, layer )
|
|
add_instance_dungeon_monster( 60007, 60000, layer )
|
|
add_instance_dungeon_monster( 60008, 60000, layer )
|
|
add_instance_dungeon_monster( 60009, 60000, layer )
|
|
add_instance_dungeon_monster( 60010, 60000, layer )
|
|
|
|
elseif respawn_group == 60006 then
|
|
local text = sconv( "@9910", "#@boss_no@#", tostring( 2 ) )
|
|
broadcast_notice( 1, text, 60000, layer )
|
|
|
|
add_instance_dungeon_monster( 60011, 60000, layer )
|
|
add_instance_dungeon_monster( 60012, 60000, layer )
|
|
add_instance_dungeon_monster( 60013, 60000, layer )
|
|
add_instance_dungeon_monster( 60014, 60000, layer )
|
|
add_instance_dungeon_monster( 60015, 60000, layer )
|
|
|
|
elseif respawn_group == 60011 then
|
|
local text = sconv( "@9910", "#@boss_no@#", tostring( 3 ) )
|
|
broadcast_notice( 1, text, 60000, layer )
|
|
|
|
add_instance_dungeon_monster( 60016, 60000, layer )
|
|
add_instance_dungeon_monster( 60017, 60000, layer )
|
|
add_instance_dungeon_monster( 60018, 60000, layer )
|
|
add_instance_dungeon_monster( 60019, 60000, layer )
|
|
add_instance_dungeon_monster( 60020, 60000, layer )
|
|
|
|
elseif respawn_group == 60016 then
|
|
local text = sconv( "@9910", "#@boss_no@#", tostring( 4 ) )
|
|
broadcast_notice( 1, text, 60000, layer )
|
|
|
|
add_instance_dungeon_monster( 60021, 60000, layer )
|
|
add_instance_dungeon_monster( 60022, 60000, layer )
|
|
add_instance_dungeon_monster( 60023, 60000, layer )
|
|
add_instance_dungeon_monster( 60024, 60000, layer )
|
|
add_instance_dungeon_monster( 60025, 60000, layer )
|
|
|
|
elseif respawn_group == 60021 then
|
|
local text = sconv( "@9910", "#@boss_no@#", tostring( 5 ) )
|
|
broadcast_notice( 1, text, 60000, layer )
|
|
|
|
add_instance_dungeon_monster( 60026, 60000, layer )
|
|
add_instance_dungeon_monster( 60027, 60000, layer )
|
|
add_instance_dungeon_monster( 60028, 60000, layer )
|
|
add_instance_dungeon_monster( 60029, 60000, layer )
|
|
add_instance_dungeon_monster( 60030, 60000, layer )
|
|
|
|
elseif respawn_group == 60026 then
|
|
broadcast_notice( 1, "@9913", 60000, layer )
|
|
end
|
|
end
|
|
end
|
|
|
|
function parallelworld_check_respawn_group_clear_2( respawn_group, x, y, layer )
|
|
|
|
local left_monster_count = get_alive_instance_respawn_group_monster_count( 70000, layer, respawn_group ) -- 패러렐 월드<2>
|
|
|
|
-- 카운트 처리
|
|
if left_monster_count == 0 then
|
|
if respawn_group == 70001 then
|
|
local text = sconv( "@9905", "#@boss_no@#", tostring( 1 ) )
|
|
broadcast_notice( 1, text, 70000, layer )
|
|
do_each_player_in_instance_dungeon( 70000, layer, "set_quest_status( 4009, 1, 1 )" )
|
|
|
|
add_instance_dungeon_monster( 70006, 70000, layer )
|
|
add_instance_dungeon_monster( 70007, 70000, layer )
|
|
add_instance_dungeon_monster( 70008, 70000, layer )
|
|
add_instance_dungeon_monster( 70009, 70000, layer )
|
|
add_instance_dungeon_monster( 70010, 70000, layer )
|
|
|
|
elseif respawn_group == 70006 then
|
|
local text = sconv( "@9905", "#@boss_no@#", tostring( 2 ) )
|
|
broadcast_notice( 1, text, 70000, layer )
|
|
do_each_player_in_instance_dungeon( 70000, layer, "set_quest_status( 4009, 2, 1 )" )
|
|
|
|
add_instance_dungeon_monster( 70011, 70000, layer )
|
|
add_instance_dungeon_monster( 70012, 70000, layer )
|
|
add_instance_dungeon_monster( 70013, 70000, layer )
|
|
add_instance_dungeon_monster( 70014, 70000, layer )
|
|
add_instance_dungeon_monster( 70015, 70000, layer )
|
|
|
|
elseif respawn_group == 70011 then
|
|
local text = sconv( "@9905", "#@boss_no@#", tostring( 3 ) )
|
|
broadcast_notice( 1, text, 70000, layer )
|
|
do_each_player_in_instance_dungeon( 70000, layer, "set_quest_status( 4009, 3, 1 )" )
|
|
|
|
add_instance_dungeon_monster( 70016, 70000, layer )
|
|
add_instance_dungeon_monster( 70017, 70000, layer )
|
|
add_instance_dungeon_monster( 70018, 70000, layer )
|
|
add_instance_dungeon_monster( 70019, 70000, layer )
|
|
add_instance_dungeon_monster( 70020, 70000, layer )
|
|
|
|
elseif respawn_group == 70016 then
|
|
local text = sconv( "@9905", "#@boss_no@#", tostring( 4 ) )
|
|
broadcast_notice( 1, text, 70000, layer )
|
|
do_each_player_in_instance_dungeon( 70000, layer, "set_quest_status( 4009, 4, 1 )" )
|
|
|
|
add_instance_dungeon_monster( 70021, 70000, layer )
|
|
add_instance_dungeon_monster( 70022, 70000, layer )
|
|
add_instance_dungeon_monster( 70023, 70000, layer )
|
|
add_instance_dungeon_monster( 70024, 70000, layer )
|
|
add_instance_dungeon_monster( 70025, 70000, layer )
|
|
|
|
elseif respawn_group == 70021 then
|
|
local text = sconv( "@9905", "#@boss_no@#", tostring( 5 ) )
|
|
broadcast_notice( 1, text, 70000, layer )
|
|
do_each_player_in_instance_dungeon( 70000, layer, "set_quest_status( 4009, 5, 1 )" )
|
|
|
|
add_instance_dungeon_monster( 70026, 70000, layer )
|
|
add_instance_dungeon_monster( 70027, 70000, layer )
|
|
add_instance_dungeon_monster( 70028, 70000, layer )
|
|
add_instance_dungeon_monster( 70029, 70000, layer )
|
|
add_instance_dungeon_monster( 70030, 70000, layer )
|
|
|
|
elseif respawn_group == 70026 then
|
|
broadcast_notice( 1, "@9914", 70000, layer )
|
|
do_each_player_in_instance_dungeon( 70000, layer, "set_quest_status( 4009, 6, 1 )" )
|
|
end
|
|
end
|
|
end
|
|
|
|
function on_leave_vulcanus( layer )
|
|
|
|
|
|
end
|
|
|
|
--=================================================================================
|
|
|
|
function enter_to_secret_dungeon( prop_id )
|
|
|
|
if prop_id == 120291 then
|
|
|
|
-- 숨겨진 팔미르 유적 ID 70120201
|
|
dlg_special( 'confirm_window', 'warp_to_secret_dungeon(120201)', '@728\v#@dungeon_name@#\v@70120201' )
|
|
|
|
elseif prop_id == 100191 then
|
|
|
|
-- 숨겨진 백룡의 쉼터 ID 70100101
|
|
dlg_special( 'confirm_window', 'warp_to_secret_dungeon(100101)', '@728\v#@dungeon_name@#\v@70100101' )
|
|
|
|
elseif prop_id == 90191 then
|
|
|
|
-- 숨겨진 흑룡의 그늘 ID 70090101
|
|
dlg_special( 'confirm_window', 'warp_to_secret_dungeon(90101)', '@728\v#@dungeon_name@#\v@70090101' )
|
|
|
|
elseif prop_id == 80191 then
|
|
|
|
-- 숨겨진 사룡의 심장 ID 70080101
|
|
dlg_special( 'confirm_window', 'warp_to_secret_dungeon(80101)', '@728\v#@dungeon_name@#\v@70080101' )
|
|
|
|
elseif prop_id == 110191 then
|
|
|
|
-- 숨겨진 엘카시아 ID 70110101
|
|
dlg_special( 'confirm_window', 'warp_to_secret_dungeon(110101)', '@728\v#@dungeon_name@#\v@70110101' )
|
|
|
|
elseif prop_id == 70191 then
|
|
|
|
-- 숨겨진 수정계곡 ID 70070101
|
|
dlg_special( 'confirm_window', 'warp_to_secret_dungeon(70101)', '@728\v#@dungeon_name@#\v@70070101' )
|
|
|
|
else
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
--------------------------------------------------------------------------------------------------------------------------
|
|
function exit_instance_dungeon( prop_id )
|
|
|
|
if prop_id == 126027 then
|
|
dlg_special( 'confirm_window', 'exit_indun(100101)', '@9807\v#@dungeon_name@#\v@80020000' ) -- 불카누스 던전을 나가겠습니까?
|
|
elseif prop_id == 126023 then
|
|
dlg_special( 'confirm_window', 'exit_indun(100101)', '@9807\v#@dungeon_name@#\v@80020000' ) -- 불카누스 던전을 나가겠습니까?
|
|
elseif prop_id == 60154 or prop_id == 60102 then
|
|
dlg_special( 'confirm_window', 'exit_indun( 30000 )', '@9832\v#@dungeon_name@#\v@80030000' ) -- 30000 인던 큐브릭 ID
|
|
elseif prop_id == 60166 then
|
|
dlg_special( 'confirm_window', 'exit_indun( 40000 )', '@9832\v#@dungeon_name@#\v@80040000' ) -- 메마른 달빛 지하기지 출구 --warp(133066 , 87015 )
|
|
elseif prop_id == 60167 then
|
|
dlg_special( 'confirm_window', 'exit_indun( 41001 )', '@9832\v#@dungeon_name@#\v@80041001' ) -- 발모어 탄광 지하기지 출구 --warp(155868 , 103644 )
|
|
elseif prop_id == 60168 then
|
|
dlg_special( 'confirm_window', 'exit_indun( 42001 )', '@9832\v#@dungeon_name@#\v@80042001' ) -- 수정계곡 지하기지 출구 --warp(103282 , 100401 )
|
|
elseif prop_id == 60169 then
|
|
dlg_special( 'confirm_window', 'exit_indun( 43001 )', '@9832\v#@dungeon_name@#\v@80043001' ) -- 팔미르 지하기지 출구 --warp(132695 , 128105 )
|
|
elseif prop_id == 60191 then
|
|
dlg_special( 'confirm_window', 'exit_indun( 50000 )', '@9853\v#@dungeon_name@#\v@80050000' ) -- 서커스 출구 --warp(132695 , 128105 )
|
|
else
|
|
|
|
end
|
|
end
|
|
|
|
--------------------------------------------------------------------------------------------------------------------------
|
|
function exit_indun_confirm()
|
|
dlg_special( 'confirm_window', 'exit_indun( 0 )', '@9920' )
|
|
end
|
|
|
|
function exit_indun( dungeon_id )
|
|
local hx = gv('hx') or get_flag('hx')
|
|
local hy = gv('hy') or get_flag('hy')
|
|
warp( hx, hy, 0 )
|
|
end
|
|
|
|
|
|
|
|
function Call_Main_Chest( monster_handle )
|
|
|
|
local monster_id = get_monster_id( monster_handle )
|
|
local layer = ghv( monster_handle, 'layer' )
|
|
|
|
local quest_progress3644 = get_quest_progress(3644) -- [일일]던전 토벌: 메두사 사냥
|
|
local quest_progress3645 = get_quest_progress(3645) -- [일일]던전 토벌: 블랙 위도우 사냥
|
|
local quest_progress3646 = get_quest_progress(3646) -- [일일]던전 토벌: 본 드래곤 사냥
|
|
local quest_progress3647 = get_quest_progress(3647) -- [일일]던전 토벌: 미크로랍토르 사냥
|
|
-- 반환값 -1 : 아무것도 아님 / 0 : 수락가 / 1 : 수행중 / 2 : 종료가능 / 100 : 실패 / 255 : 이미종료
|
|
local X_pos = gv('x')
|
|
local Y_pos = gv('y')
|
|
|
|
if monster_id == 20190001 or monster_id == 20190006 --메던 지하기지 1단계
|
|
or monster_id == 20190028 or monster_id == 20190033 --메던 지하기지 2단계
|
|
or monster_id == 20190055 or monster_id == 20190060 --메던 지하기지 3단계
|
|
or monster_id == 20190082 or monster_id == 20190087 then --메던 지하기지 4단계
|
|
|
|
local monster_count = get_instance_dungeon_flag( 40000, layer, 'check_open_prop')
|
|
if monster_count == 2 then
|
|
set_instance_dungeon_flag( 40000, layer, 'check_open_prop', 1)
|
|
elseif monster_count == 1 then
|
|
add_field_prop ( 60170, 60000, 38719, 22938, layer )
|
|
set_instance_dungeon_flag( 40000, layer, 'check_open_prop', 0)
|
|
|
|
if get_instance_dungeon_type_id( 40000, layer ) == 3 then
|
|
add_field_prop( 9002, 0, 38881, 22826, layer, -3, 0, 0, 0, 1, 1, 1 ) --보스 생성 프랍
|
|
broadcast_notice( 1, "@90610144", 40000, layer ) -- 프랍 클릭하면 보스 나온다는 메세지?
|
|
end
|
|
end
|
|
|
|
if monster_id == 20190001 or monster_id == 20190028 or monster_id == 20190055 or monster_id == 20190082 then
|
|
do_each_player_in_instance_dungeon( 40000, layer, "set_quest_status( 3644, 1, 1 )", X_pos, Y_pos )
|
|
--[[ if get_quest_status( 3644 , 1 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3644 , 1 ) + 1
|
|
set_quest_status( 3644, 1, A_day_A_quest )
|
|
end ]]
|
|
--[[ elseif quest_progress3644 == 1 and monster_id == 20190028 then
|
|
if get_quest_status( 3644 , 1 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3644 , 1 ) + 1
|
|
set_quest_status( 3644, 1, A_day_A_quest )
|
|
end
|
|
elseif quest_progress3644 == 1 and monster_id == 20190055 then
|
|
if get_quest_status( 3644 , 1 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3644 , 1 ) + 1
|
|
set_quest_status( 3644, 1, A_day_A_quest )
|
|
end
|
|
elseif quest_progress3644 == 1 and monster_id == 20190082 then
|
|
if get_quest_status( 3644 , 1 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3644 , 1 ) + 1
|
|
set_quest_status( 3644, 1, A_day_A_quest )
|
|
end ]]
|
|
elseif monster_id == 20190006 or monster_id == 20190033 or monster_id == 20190060 or monster_id == 20190087 then
|
|
do_each_player_in_instance_dungeon( 40000, layer, "set_quest_status( 3644, 2, 1 )", X_pos, Y_pos )
|
|
--[[ if get_quest_status( 3644 , 2 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3644 , 2 ) + 1
|
|
set_quest_status( 3644, 2, A_day_A_quest )
|
|
end
|
|
elseif quest_progress3644 == 1 and monster_id == 20190033 then
|
|
if get_quest_status( 3644 , 2 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3644 , 2 ) + 1
|
|
set_quest_status( 3644, 2, A_day_A_quest )
|
|
end
|
|
elseif quest_progress3644 == 1 and monster_id == 20190060 then
|
|
if get_quest_status( 3644 , 2 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3644 , 2 ) + 1
|
|
set_quest_status( 3644, 2, A_day_A_quest )
|
|
end
|
|
elseif quest_progress3644 == 1 and monster_id == 20190087 then
|
|
if get_quest_status( 3644 , 2 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3644 , 2 ) + 1
|
|
set_quest_status( 3644, 2, A_day_A_quest )
|
|
end ]]
|
|
end
|
|
|
|
elseif monster_id == 20190025 or monster_id == 20190008 --탄광 지하기지 1단계
|
|
or monster_id == 20190052 or monster_id == 20190035 --탄광 지하기지 2단계
|
|
or monster_id == 20190079 or monster_id == 20190062 --탄광 지하기지 3단계
|
|
or monster_id == 21190106 or monster_id == 20190089 then --탄광 지하기지 4단계
|
|
|
|
local monster_count = get_instance_dungeon_flag( 41001, layer, 'check_open_prop')
|
|
if monster_count == 2 then
|
|
set_instance_dungeon_flag( 41001, layer, 'check_open_prop', 1)
|
|
elseif monster_count == 1 then
|
|
add_field_prop ( 60171, 60000, 40379, 9573, layer )
|
|
set_instance_dungeon_flag( 41001, layer, 'check_open_prop', 0)
|
|
|
|
if get_instance_dungeon_type_id( 41001, layer ) == 3 then
|
|
add_field_prop( 9003, 0, 40487, 9490, layer, -3, 0, 0, 0, 1, 1, 1 ) --보스 생성 프랍
|
|
broadcast_notice( 1, "@90610144", 40001, layer ) -- 프랍 클릭하면 보스 나온다는 메세지?
|
|
end
|
|
end
|
|
|
|
if monster_id == 20190025 or monster_id == 20190052 or monster_id == 20190079 or monster_id == 21190106 then
|
|
do_each_player_in_instance_dungeon( 41001, layer, "set_quest_status( 3645, 1, 1 )", X_pos, Y_pos )
|
|
--[[ if get_quest_status( 3645 , 1 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3645 , 1 ) + 1
|
|
set_quest_status( 3645, 1, A_day_A_quest )
|
|
end
|
|
elseif quest_progress3645 == 1 and monster_id == 20190052 then
|
|
if get_quest_status( 3645 , 1 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3645 , 1 ) + 1
|
|
set_quest_status( 3645, 1, A_day_A_quest )
|
|
end
|
|
elseif quest_progress3645 == 1 and monster_id == 20190079 then
|
|
if get_quest_status( 3645 , 1 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3645 , 1 ) + 1
|
|
set_quest_status( 3645, 1, A_day_A_quest )
|
|
end
|
|
elseif quest_progress3645 == 1 and monster_id == 21190106 then
|
|
if get_quest_status( 3645 , 1 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3645 , 1 ) + 1
|
|
set_quest_status( 3645, 1, A_day_A_quest )
|
|
end ]]
|
|
elseif monster_id == 20190008 or monster_id == 20190035 or monster_id == 20190062 or monster_id == 20190089 then
|
|
do_each_player_in_instance_dungeon( 41001, layer, "set_quest_status( 3645, 2, 1 )", X_pos, Y_pos )
|
|
--[[ if get_quest_status( 3645 , 2 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3645 , 2 ) + 1
|
|
set_quest_status( 3645, 2, A_day_A_quest )
|
|
end
|
|
elseif quest_progress3645 == 1 and monster_id == 20190035 then
|
|
if get_quest_status( 3645 , 2 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3645 , 2 ) + 1
|
|
set_quest_status( 3645, 2, A_day_A_quest )
|
|
end
|
|
elseif quest_progress3645 == 1 and monster_id == 20190062 then
|
|
if get_quest_status( 3645 , 2 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3645 , 2 ) + 1
|
|
set_quest_status( 3645, 2, A_day_A_quest )
|
|
end
|
|
elseif quest_progress3645 == 1 and monster_id == 20190089 then
|
|
if get_quest_status( 3645 , 2 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3645 , 2 ) + 1
|
|
set_quest_status( 3645, 2, A_day_A_quest )
|
|
end ]]
|
|
end
|
|
|
|
elseif monster_id == 20190026 or monster_id == 20190012
|
|
or monster_id == 20190053 or monster_id == 20190039
|
|
or monster_id == 20190080 or monster_id == 20190066
|
|
or monster_id == 21190107 or monster_id == 20190093 then
|
|
|
|
local monster_count = get_instance_dungeon_flag( 42001, layer, 'check_open_prop')
|
|
if monster_count == 2 then
|
|
set_instance_dungeon_flag( 42001, layer, 'check_open_prop', 1)
|
|
elseif monster_count == 1 then
|
|
add_field_prop ( 60172, 60000, 61784, 31019, layer )
|
|
set_instance_dungeon_flag( 42001, layer, 'check_open_prop', 0)
|
|
|
|
if get_instance_dungeon_type_id( 42001, layer ) == 3 then
|
|
add_field_prop( 9004, 0, 61621, 30896, layer, -3, 0, 0, 0, 1, 1, 1 ) --보스 생성 프랍
|
|
broadcast_notice( 1, "@90610144", 42001, layer ) -- 프랍 클릭하면 보스 나온다는 메세지?
|
|
end
|
|
end
|
|
|
|
if monster_id == 20190026 or monster_id == 20190053 or monster_id == 20190080 or monster_id == 21190107 then
|
|
do_each_player_in_instance_dungeon( 42001, layer, "set_quest_status( 3646, 1, 1 )", X_pos, Y_pos )
|
|
--[[ if get_quest_status( 3646 , 1 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3646 , 1 ) + 1
|
|
set_quest_status( 3646, 1, A_day_A_quest )
|
|
end
|
|
elseif quest_progress3646 == 1 and monster_id == 20190053 then
|
|
if get_quest_status( 3646 , 1 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3646 , 1 ) + 1
|
|
set_quest_status( 3646, 1, A_day_A_quest )
|
|
end
|
|
elseif quest_progress3646 == 1 and monster_id == 20190080 then
|
|
if get_quest_status( 3646 , 1 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3646 , 1 ) + 1
|
|
set_quest_status( 3646, 1, A_day_A_quest )
|
|
end
|
|
elseif quest_progress3646 == 1 and monster_id == 21190107 then
|
|
if get_quest_status( 3646 , 1 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3646 , 1 ) + 1
|
|
set_quest_status( 3646, 1, A_day_A_quest )
|
|
end ]]
|
|
elseif monster_id == 20190012 or monster_id == 20190039 or monster_id == 20190066 or monster_id == 20190093 then
|
|
do_each_player_in_instance_dungeon( 42001, layer, "set_quest_status( 3646, 2, 1 )", X_pos, Y_pos )
|
|
--[[ if get_quest_status( 3646 , 2 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3646 , 2 ) + 1
|
|
set_quest_status( 3646, 2, A_day_A_quest )
|
|
end
|
|
elseif quest_progress3646 == 1 and monster_id == 20190039 then
|
|
if get_quest_status( 3646 , 2 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3646 , 2 ) + 1
|
|
set_quest_status( 3646, 2, A_day_A_quest )
|
|
end
|
|
elseif quest_progress3646 == 1 and monster_id == 20190066 then
|
|
if get_quest_status( 3646 , 2 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3646 , 2 ) + 1
|
|
set_quest_status( 3646, 2, A_day_A_quest )
|
|
end
|
|
elseif quest_progress3646 == 1 and monster_id == 20190093 then
|
|
if get_quest_status( 3646 , 2 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3646 , 2 ) + 1
|
|
set_quest_status( 3646, 2, A_day_A_quest )
|
|
end ]]
|
|
end
|
|
|
|
elseif monster_id == 20190027 or monster_id == 20190010
|
|
or monster_id == 20190054 or monster_id == 20190037
|
|
or monster_id == 20190081 or monster_id == 20190064
|
|
or monster_id == 21190108 or monster_id == 20190091 then
|
|
|
|
local monster_count = get_instance_dungeon_flag( 43001, layer, 'check_open_prop')
|
|
if monster_count == 2 then
|
|
set_instance_dungeon_flag( 43001, layer, 'check_open_prop', 1)
|
|
elseif monster_count == 1 then
|
|
add_field_prop ( 60173, 60000, 53659, 4147, layer )
|
|
set_instance_dungeon_flag( 43001, layer, 'check_open_prop', 0)
|
|
|
|
if get_instance_dungeon_type_id( 43001, layer ) == 3 then
|
|
add_field_prop( 9005, 0, 53512, 4356, layer, -3, 0, 0, 0, 1, 1, 1 ) --보스 생성 프랍
|
|
broadcast_notice( 1, "@90610144", 43001, layer ) -- 프랍 클릭하면 보스 나온다는 메세지?
|
|
end
|
|
end
|
|
|
|
if monster_id == 20190027 or monster_id == 20190054 or monster_id == 20190081 or monster_id == 21190108 then
|
|
do_each_player_in_instance_dungeon( 43001, layer, "set_quest_status( 3647, 1, 1 )", X_pos, Y_pos )
|
|
--[[ if get_quest_status( 3647 , 1 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3647 , 1 ) + 1
|
|
set_quest_status( 3647, 1, A_day_A_quest )
|
|
end
|
|
elseif quest_progress3647 == 1 and monster_id == 20190054 then
|
|
if get_quest_status( 3647 , 1 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3647 , 1 ) + 1
|
|
set_quest_status( 3647, 1, A_day_A_quest )
|
|
end
|
|
elseif quest_progress3647 == 1 and monster_id == 20190081 then
|
|
if get_quest_status( 3647 , 1 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3647 , 1 ) + 1
|
|
set_quest_status( 3647, 1, A_day_A_quest )
|
|
end
|
|
elseif quest_progress3647 == 1 and monster_id == 21190108 then
|
|
if get_quest_status( 3647 , 1 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3647 , 1 ) + 1
|
|
set_quest_status( 3647, 1, A_day_A_quest )
|
|
end ]]
|
|
elseif monster_id == 20190010 or monster_id == 20190037 or monster_id == 20190064 or monster_id == 20190091 then
|
|
do_each_player_in_instance_dungeon( 43001, layer, "set_quest_status( 3647, 2, 1 )", X_pos, Y_pos )
|
|
--[[ if get_quest_status( 3647 , 2 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3647 , 2 ) + 1
|
|
set_quest_status( 3647, 2, A_day_A_quest )
|
|
end
|
|
elseif quest_progress3647 == 1 and monster_id == 20190037 then
|
|
if get_quest_status( 3647 , 2 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3647 , 2 ) + 1
|
|
set_quest_status( 3647, 2, A_day_A_quest )
|
|
end
|
|
elseif quest_progress3647 == 1 and monster_id == 20190064 then
|
|
if get_quest_status( 3647 , 2 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3647 , 2 ) + 1
|
|
set_quest_status( 3647, 2, A_day_A_quest )
|
|
end
|
|
elseif quest_progress3647 == 1 and monster_id == 20190091 then
|
|
if get_quest_status( 3647 , 2 ) == 0 then
|
|
local A_day_A_quest = get_quest_status( 3647 , 2 ) + 1
|
|
set_quest_status( 3647, 2, A_day_A_quest )
|
|
end ]]
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
function Open_Chest( prop_id )
|
|
|
|
local count = find_item( 601100310 )
|
|
|
|
if prop_id == 60157 or prop_id == 60159 or prop_id == 60161 or prop_id == 60162 or prop_id == 60163 then
|
|
|
|
if count >= 1 then
|
|
-- 만족하면 열쇠 수거하고
|
|
delete_item( get_item_handle( 601100310 ), 1 )
|
|
end
|
|
end
|
|
|
|
|
|
end
|
|
|
|
function Open_main_Chest( prop_id )
|
|
|
|
local index_num_1 = math.random ( 0, 2 )
|
|
|
|
if prop_id == 60176 then -- 메두사의 투구가 나오는 프랍
|
|
|
|
if index_num_1 == 0 then
|
|
|
|
insert_item(601100355, 1)
|
|
|
|
elseif index_num_1 == 1 then
|
|
|
|
insert_item(601100355, 1)
|
|
insert_item(601100355, 1)
|
|
|
|
elseif index_num_1 == 2 then
|
|
|
|
insert_item(601100355, 1)
|
|
insert_item(601100355, 1)
|
|
insert_item(601100355, 1)
|
|
|
|
end
|
|
|
|
elseif prop_id == 60179 then -- 블랙 위도우의 부츠가 나오는 프랍
|
|
|
|
if index_num_1 == 0 then
|
|
|
|
insert_item(601100357, 1)
|
|
|
|
elseif index_num_1 == 1 then
|
|
|
|
insert_item(601100357, 1)
|
|
insert_item(601100357, 1)
|
|
|
|
elseif index_num_1 == 2 then
|
|
|
|
insert_item(601100357, 1)
|
|
insert_item(601100357, 1)
|
|
insert_item(601100357, 1)
|
|
|
|
end
|
|
|
|
elseif prop_id == 60182 then -- 본 드래곤의 아머가 나오는 프랍
|
|
|
|
if index_num_1 == 0 then
|
|
|
|
insert_item(math.random ( 601100358, 601100361 ), 1)
|
|
|
|
elseif index_num_1 == 1 then
|
|
|
|
insert_item(math.random ( 601100358, 601100361 ), 1)
|
|
insert_item(math.random ( 601100358, 601100361 ), 1)
|
|
|
|
elseif index_num_1 == 2 then
|
|
|
|
insert_item(math.random ( 601100358, 601100361 ), 1)
|
|
insert_item(math.random ( 601100358, 601100361 ), 1)
|
|
insert_item(math.random ( 601100358, 601100361 ), 1)
|
|
|
|
end
|
|
|
|
elseif prop_id == 60185 then -- 미크로랍토르의 글러브가 나오는 프랍
|
|
|
|
if index_num_1 == 0 then
|
|
|
|
insert_item(601100356, 1)
|
|
|
|
elseif index_num_1 == 1 then
|
|
|
|
insert_item(601100356, 1)
|
|
insert_item(601100356, 1)
|
|
|
|
elseif index_num_1 == 2 then
|
|
|
|
insert_item(601100356, 1)
|
|
insert_item(601100356, 1)
|
|
insert_item(601100356, 1)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
cprint( "@690000089" )
|
|
|
|
end
|
|
|
|
function Call_Script_Witch_Death( monster_handle )
|
|
|
|
local monster_id = get_monster_id( monster_handle )
|
|
local quest_progress3648 = get_quest_progress(3648) -- [반복]지하 기지 소탕
|
|
-- 반환값 -1 : 아무것도 아님 / 0 : 수락가 / 1 : 수행중 / 2 : 종료가능 / 100 : 실패 / 255 : 이미종료
|
|
|
|
if monster_id == 20190002 or monster_id == 20190029 or monster_id == 20190056 or monster_id == 20190083 then
|
|
|
|
if quest_progress3648 == 1 then
|
|
if get_quest_status( 3648 , 1 ) < 50 then
|
|
local A_day_A_quest = get_quest_status( 3648 , 1 ) + 1
|
|
set_quest_status( 3648, 1, A_day_A_quest )
|
|
end
|
|
end
|
|
|
|
elseif monster_id == 20190003 or monster_id == 20190030 or monster_id == 20190057 or monster_id == 20190084 then
|
|
|
|
if quest_progress3648 == 1 then
|
|
if get_quest_status( 3648 , 2 ) < 50 then
|
|
local A_day_A_quest = get_quest_status( 3648 , 2 ) + 1
|
|
set_quest_status( 3648, 2, A_day_A_quest )
|
|
end
|
|
end
|
|
|
|
elseif monster_id == 20190004 or monster_id == 20190031 or monster_id == 20190058 or monster_id == 20190085 then
|
|
|
|
if quest_progress3648 == 1 then
|
|
if get_quest_status( 3648 , 3 ) < 50 then
|
|
local A_day_A_quest = get_quest_status( 3648 , 3 ) + 1
|
|
set_quest_status( 3648, 3, A_day_A_quest )
|
|
end
|
|
end
|
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
-- 서버 시작할 때 스크립트를 통해 추가 할 프랍들이 있으면 여기에 추가한다.
|
|
function add_global_prop()
|
|
|
|
-- 칠흑의숲 -> 붉은 거미 서커스 워프 프랍
|
|
add_field_prop( 60192, 0, 163100, 116110, 0, 0, 0 ,0, 0.45 , 1, 1, 1)
|
|
add_field_prop( 60193, 0, 35527, 121011, 0, 0, 0 ,0, 1.5 , 1, 1, 1)
|
|
|
|
|
|
end
|
|
|
|
function summon_boss( X_pos, Y_pos, Mob_id )
|
|
|
|
local state_code = get_local_info()
|
|
--add_instance_dungeon_monster( 50049, 50000, gv('layer'))
|
|
if state_code == 1 or 16 then
|
|
add_npc( X_pos, Y_pos, Mob_id, 1, 0, gv('layer') )
|
|
else
|
|
add_npc( X_pos, Y_pos, Mob_id+7, 1, 0, gv('layer') )
|
|
end
|
|
|
|
end
|
|
|
|
|
|
------------------------------------------------------------------------------------------------------------
|
|
function NPC_bulcanus_joinitem_sell()
|
|
--------------------------------------------------------------------------------------------------------------------------
|
|
dlg_title( "@90605268" )
|
|
dlg_text( "@90605790" )
|
|
|
|
local progress = get_quest_progress(3367)
|
|
if progress == 255 then
|
|
dlg_menu( "@9811", 'NPC_bulcanus_get_ticket()' ) -- 사자의 혼을 받는다
|
|
end
|
|
dlg_menu( "@90010002", '' )
|
|
dlg_show()
|
|
end
|
|
--------------------------------------------------------------------------------------------------------------------------
|
|
function NPC_bulcanus_get_ticket()
|
|
--------------------------------------------------------------------------------------------------------------------------
|
|
local current_time = get_os_date( "%Y-%m-%d" )
|
|
local t_flag = get_flag( "vulcanus_date" )
|
|
dlg_title( "@90605268" )
|
|
if t_flag == nill or t_flag < current_time then
|
|
set_flag( "vulcanus_date" , current_time )
|
|
insert_item( 2013889, 1 )
|
|
dlg_text( "@90610860" ) -- 여기 있어요!<br>수량이 부족한 관계로 1일1개 밖에는 드릴수 없어요.
|
|
else
|
|
dlg_text( "@90610861" ) -- 오늘은 이미 받으셨어요.<br>수량이 부족한 관계로 1일 1개 밖에는 드릴수 없어요.
|
|
end
|
|
dlg_menu( "@90010002", '' )
|
|
dlg_show()
|
|
end
|
|
|
|
--------------------------------------------------------------------------------------------------------------------------
|
|
function NPC_bulcanus_best_record()
|
|
--------------------------------------------------------------------------------------------------------------------------
|
|
local best_vul_record = get_global_variable( "best_vul_record" )
|
|
local best_vul_record_name = get_global_variable("best_vul_record_name")
|
|
|
|
dlg_title( "@90605268" )
|
|
|
|
if best_vul_record == nil or best_vul_record == "" then
|
|
dlg_text( "@90605863" )
|
|
else
|
|
local country_time = get_os_date("%H",0)
|
|
local print_best_vul_record = best_vul_record +(24 -country_time) * 3600
|
|
dlg_text( sconv("@90605862", "#@user_name@#", get_global_variable( "best_vul_record_name" ), "#@vul_record@#", get_os_date("%X",print_best_vul_record)) )
|
|
end
|
|
|
|
dlg_menu( "@90010002", '' )
|
|
dlg_show()
|
|
|
|
end
|
|
|
|
------------------------------------------------------------------------------------------------------------
|
|
function vulcanus_get_room_pos( floor, room ) -- 각층 각방 x y 좌표
|
|
--------------------------------------------------------------------------------------------------------------------------
|
|
local pdata={ 197393,28580, 198814,28457, 200543,28458, 202065,28458,
|
|
197047,25954, 198661,25929, 200362,25962, 202169,26121,
|
|
197303,23750, 198586,23765, 200390,23677, 202114,23701,
|
|
206474,27625, 0,0, 0,0, 0,0,
|
|
}
|
|
local x = pdata[ floor*8-7+room*2 ]
|
|
local y = pdata[ floor*8-7+room*2+1]
|
|
return x,y
|
|
end
|
|
|
|
------------------------------------------------------------------------------------------------------------
|
|
function vulcanus_get_clear_reward( layer, floor ) -- 각 방 클리어 보상 Exp,JP,Gold
|
|
--------------------------------------------------------------------------------------------------------------------------
|
|
local pdata =
|
|
{ -- F1, F2, F3 F4 F1, F2, F3 F4
|
|
19956, 24454, 29555, 58378, 38548, 44904, 51743, 132405, -- 1 40 ~
|
|
57408, 64815, 72956, 214137, 76854, 85198, 94077, 269109, -- 3 60 ~
|
|
91139, 99583, 108495, 314787, 113358, 122679, 132349, 427830, -- 5 80 ~
|
|
131787, 141445, 151556, 561177, 175584, 187230, 199491, 700102, -- 7 100 ~
|
|
237120, 251671, 266785, 988754, 292792, 306274, 320012, 1169043, -- 9 120 ~
|
|
377019, 392723, 408832, 1785194, 470027, 527619, 620635, 3387588, -- 11 140 ~
|
|
769704, 1541102, 3173438, 6718169, 1219563, 1800319, 3922638, 12356309, -- 13 160 ~
|
|
1829344, 2700478, 5883957, 18534463, 2744016, 4050717, 8825935, 27801694, -- 15 180 ~
|
|
4116024, 6076075, 13238902, 41702541, 6174036, 9114112, 19858353, 62553811, -- 17 200 ~
|
|
9261054, 13671168, 29787529, 93830716, 13891581, 20506752, 44681293, 140746074 , -- 19 220 ~
|
|
}
|
|
|
|
local lvl = get_instance_dungeon_type_id( 20000, layer )
|
|
local idx = lvl*4+floor
|
|
local exp = pdata[ idx ]
|
|
local jp = exp / 8
|
|
local gold = 31200 * ( 1+ lvl/3)
|
|
if floor==2 then
|
|
gold = gold + 2100
|
|
elseif floor==3 then
|
|
gold = gold + 4200
|
|
elseif floor==4 then
|
|
gold = (gold + 4200 )*2
|
|
end
|
|
return exp, jp, gold
|
|
end
|
|
|
|
--------------------------------------------------------------------------------------------------------------------------
|
|
function get_vulcanus_room_number(floor) -- 아직 클리어하지 않은 방을 찾는다.
|
|
--------------------------------------------------------------------------------------------------------------------------
|
|
local layer = get_value('layer')
|
|
local room = 0
|
|
if floor < 4 then
|
|
local room_list = {}
|
|
local room_count = 0
|
|
local flag = 'Vul' .. tostring( floor )
|
|
local fv = get_instance_dungeon_flag( 20000, layer, flag )
|
|
if fv == 15 then
|
|
return
|
|
end
|
|
if fv==nil or fv=="" then
|
|
fv = 0
|
|
end
|
|
if fv==0 or fv==2 or fv==4 or fv==8 or fv==6 or fv==10 or fv==12 or fv==14 then
|
|
room_list[ room_count + 1 ] = 0
|
|
room_count = room_count + 1
|
|
end
|
|
if fv==0 or fv==1 or fv==4 or fv==8 or fv==5 or fv==9 or fv==12 or fv==13 then
|
|
room_list[ room_count + 1 ] = 1
|
|
room_count = room_count + 1
|
|
end
|
|
if fv==0 or fv==1 or fv==2 or fv==8 or fv==3 or fv==9 or fv==10 or fv==11 then
|
|
room_list[ room_count + 1 ] = 2
|
|
room_count = room_count + 1
|
|
end
|
|
if fv==0 or fv==1 or fv==2 or fv==4 or fv==3 or fv==5 or fv==6 or fv==7 then
|
|
room_list[ room_count + 1 ] = 3
|
|
room_count = room_count + 1
|
|
end
|
|
local select = math.random( 1, room_count )
|
|
room = room_list[select]
|
|
|
|
end
|
|
return room
|
|
end
|
|
|
|
|
|
--------------------------------------------------------------------------------------------------------------------------
|
|
function enter_vulcanus() -- 필드에 있는 불카누스 프랍 클릭시
|
|
--------------------------------------------------------------------------------------------------------------------------
|
|
local quest_progress_3367 = get_quest_progress(3367) -- 반환값 -1 : 아무것도 아님 / 0 : 수락가 / 1 : 수행중 / 2 : 종료가능 / 100 : 실패 / 255 : 이미종료
|
|
if quest_progress_3367 == 1 then
|
|
set_quest_status( 3367, 1, 1 )
|
|
cprint( "@90604746" ) -- <(version:8.1)><#6DD66D>새로운 게이트를 발견하였습니다.
|
|
return
|
|
end
|
|
local lv = get_value( 'level' )
|
|
if lv<30 then
|
|
cprint( "@9251" ) --<#ff0000>불카누스 던전은 최소 레벨 30 이상부터 입장 가능합니다.
|
|
end
|
|
local base_type = math.floor(lv/10)-4
|
|
if base_type < 0 then
|
|
base_type = 0
|
|
end
|
|
if base_type > 16 then -- 일단 13까지 밖에 없기 때문에 10(easy),11(normal),12(hard),13(veryhard)
|
|
base_type = 16
|
|
end
|
|
|
|
local menu1 = '@9526| (Level' .. (base_type+3) * 10 ..')'
|
|
local menu2 = '@9527| (Level' .. (base_type+4) * 10 ..')'
|
|
local menu3 = '@9528| (Level' .. (base_type+5) * 10 ..')'
|
|
--local menu4 = '<@FF8080>|@9528| (Level' .. (base_type+6) * 10 ..')'
|
|
|
|
local trigger1 = 'enter_vulcanus_confirm(' .. base_type .. ')'
|
|
local trigger2 = 'enter_vulcanus_confirm(' .. base_type+1 .. ')'
|
|
local trigger3 = 'enter_vulcanus_confirm(' .. base_type+2 .. ')'
|
|
--local trigger4 = 'enter_vulcanus_confirm(' .. base_type+3 .. ')'
|
|
--dlg_special_menu( '@9525', 'Warp', menu1, trigger1, menu2, trigger2, menu3, trigger3, menu4, trigger4 )
|
|
dlg_special_menu( '@9525', 'Warp', menu1, trigger1, menu2, trigger2, menu3, trigger3 )
|
|
|
|
end
|
|
|
|
--------------------------------------------------------------------------------------------------------------------------
|
|
function enter_vulcanus_confirm(sub_type) -- vulcanus_enter_confirm() 으로 변경
|
|
--------------------------------------------------------------------------------------------------------------------------
|
|
local party_id = get_value('party_id')
|
|
if party_id ~= 0 then
|
|
cprint( "@9247" ) --파티 상태에서는 입장 불가함
|
|
return
|
|
end
|
|
|
|
local item_count = find_item( 2013889 )
|
|
if item_count < 1 then
|
|
cprint( "@9810" )
|
|
return
|
|
end
|
|
warp_to_instance_dungeon(20000,sub_type)
|
|
delete_item( get_item_handle(2013889),1)
|
|
--vulcanus_warp_confirm(1)
|
|
open_title(1)
|
|
|
|
end
|
|
|
|
|
|
--------------------------------------------------------------------------------------------------------------------------
|
|
function enter_other_indun( dungeon_id, cur_floor, next_floor, cur_item_count, next_item_count )
|
|
vulcanus_warp (cur_floor)
|
|
end
|
|
--------------------------------------------------------------------------------------------------------------------------
|
|
function vulcanus_warp (floor) -- 불카누스 던전 내부 프랍 클릭,
|
|
--------------------------------------------------------------------------------------------------------------------------
|
|
local flag = 'Vul' .. tostring(floor )
|
|
local floor_flag = get_instance_dungeon_flag( 20000 , gv( 'layer' ), flag )
|
|
local cur = floor
|
|
local nxt = floor +1
|
|
local nxt_flr = floor+1
|
|
local menu2 = '@9800\v#@next_floor@#\v' .. nxt
|
|
if floor_flag == 15 then
|
|
dlg_special_menu( '@170126024', 'Warp',menu2, 'vulcanus_warp_confirm(' .. nxt .. ')' )
|
|
else
|
|
local menu1 = '@9799\v#@current_floor@#\v' .. cur
|
|
dlg_special_menu( '@170126024', 'Warp', menu1, 'vulcanus_warp_confirm(' .. cur .. ')', menu2, 'vulcanus_warp_confirm(' .. nxt .. ')' )
|
|
end
|
|
end
|
|
|
|
--------------------------------------------------------------------------------------------------------------------------
|
|
function vulcanus_warp_confirm(floor,layer)
|
|
--------------------------------------------------------------------------------------------------------------------------
|
|
if layer == nil then
|
|
layer = get_value('layer')
|
|
end
|
|
|
|
local room = get_vulcanus_room_number(floor)
|
|
local x,y = vulcanus_get_room_pos( floor, room )
|
|
warp( x, y, layer )
|
|
|
|
send_mission_title( '@1224' ) -- 미션 제목은 항상 '모든 몬스터를 섬멸하라'
|
|
local exp, jp, gold = vulcanus_get_clear_reward( layer, floor )
|
|
local reward_string = '@1225'
|
|
reward_string = reward_string .. '\v#@reward_exp@#\v' .. exp
|
|
reward_string = reward_string .. '\v#@reward_jp@#\v' .. jp
|
|
reward_string = reward_string .. '\v#@reward_gold@#\v' .. gold
|
|
send_mission_reward( reward_string )
|
|
|
|
if floor == 4 then
|
|
send_mission_objective( 0, 1, '@1226' ) -- 불카누스를 처치하라
|
|
cprint( '@90604914' ) --<(version:7.3)><#6DD66D>나는.. 불카누스다. 나의 의지를 깨운 너는....너는 누구.... 인가. 열쇠를 소지한 자.. 인가?
|
|
cprint( '@90604915' ) --<(version:7.3)><#6DD66D>그렇다면, 내가 숨겨 논 기록을...... 되찾은 자로군. 시간이 없으니...... 너의 지식을 보겠다.
|
|
|
|
local monster = 22000414
|
|
local progress1 = get_quest_progress(4047)
|
|
local progress2 = get_quest_progress(4048)
|
|
local progress3 = get_quest_progress(4049)
|
|
local progress4 = get_quest_progress(4050)
|
|
local lvl = get_instance_dungeon_type_id( 20000, layer )
|
|
if (progress1 == 1 or progress2 == 1 or progress3 == 1 or progress4 == 1) and lvl >= 14 then
|
|
local qcv = get_flag('q_cbk')
|
|
if qcv == nil or qcv == "" then
|
|
qcv = 0
|
|
end
|
|
|
|
local rnd = math.random(1, 10-qcv)
|
|
if rnd == 1 then
|
|
add_npc( 205940, 26915, monster, 1, 0, layer )
|
|
qcv = 0
|
|
elseif qcv < 7 then
|
|
qcv = qcv + 1
|
|
end
|
|
set_flag('q_cbk',qcv)
|
|
|
|
end
|
|
|
|
else
|
|
send_mission_objective( 0, 6, '@1224' ) -- 미션 목표도 항상 '모든 몬스터를 섬멸하라'에 최대 몬스터 수는 6(4층인 경우만 1이 됨)
|
|
end
|
|
send_mission_objective_progress( 0, 0 )
|
|
end
|
|
|
|
|
|
------------------------------------------------------------------------------------------------------------
|
|
function on_create_vulcanus_instance( layer ) -- 최초 던전 생성시 호출
|
|
------------------------------------------------------------------------------------------------------------
|
|
set_instance_dungeon_flag( 20000, layer, 'Vul1', 0 )
|
|
set_instance_dungeon_flag( 20000, layer, 'Vul2', 0 )
|
|
set_instance_dungeon_flag( 20000, layer, 'Vul3', 0 )
|
|
set_instance_dungeon_flag( 20000, layer, 'date', get_os_time() )
|
|
|
|
add_field_prop( 126023, 0, 197460, 28579, layer, 10)
|
|
add_field_prop( 126023, 0, 198873, 28457, layer, 10)
|
|
add_field_prop( 126023, 0, 200546, 28391, layer, 10)
|
|
add_field_prop( 126023, 0, 202068, 28403, layer, 10)
|
|
add_field_prop( 126023, 0, 197026, 25926, layer, 10)
|
|
add_field_prop( 126023, 0, 198651, 25901, layer, 10)
|
|
add_field_prop( 126023, 0, 200339, 25945, layer, 10)
|
|
add_field_prop( 126023, 0, 202194, 26114, layer, 10)
|
|
add_field_prop( 126023, 0, 197324, 23734, layer, 10)
|
|
add_field_prop( 126023, 0, 198566, 23754, layer, 10)
|
|
add_field_prop( 126023, 0, 200370, 23657, layer, 10)
|
|
add_field_prop( 126023, 0, 202125, 23673, layer, 10)
|
|
end
|
|
|
|
------------------------------------------------------------------------------------------------------------
|
|
function on_leave_vulcanus( layer ) -- 이탈시호출
|
|
------------------------------------------------------------------------------------------------------------
|
|
send_mission_title( '' )
|
|
end
|
|
|
|
------------------------------------------------------------------------------------------------------------
|
|
function on_join_vulcanus( layer ) -- 각 방마다 호출
|
|
------------------------------------------------------------------------------------------------------------
|
|
vulcanus_warp_confirm(1,layer)
|
|
--do_each_player_in_instance_dungeon( 20000, layer, "open_title(1)" )
|
|
end
|
|
|
|
------------------------------------------------------------------------------------------------------------
|
|
function vulcanus_check_respawn_group_clear( respawn, x, y, layer ) -- 몬스터 죽을 때마다 호출
|
|
------------------------------------------------------------------------------------------------------------
|
|
local pdata={ --respawn prop z, fl bit monster_count
|
|
20001, 126024, 10, 1, 1, 6,
|
|
20002, 126024, 10, 1, 2, 6,
|
|
20003, 126024, 10, 1, 4, 6,
|
|
20004, 126024, 10, 1, 8, 6,
|
|
20005, 126025, 10, 2, 1, 6,
|
|
20006, 126025, 10, 2, 2, 6,
|
|
20007, 126025, 10, 2, 4, 6,
|
|
20008, 126025, 10, 2, 8, 6,
|
|
20009, 126026, 10, 3, 1, 6,
|
|
20010, 126026, 10, 3, 2, 6,
|
|
20011, 126026, 10, 3, 4, 6,
|
|
20012, 126026, 10, 3, 8, 6,
|
|
20013, 126027, 35, 4, 1, 1, }
|
|
local idx = 0
|
|
local total = table.getn( pdata) / 6
|
|
for i = 1, total do
|
|
if pdata[i*6-5] == respawn then
|
|
idx = i
|
|
break
|
|
end
|
|
end
|
|
if idx == 0 then
|
|
return
|
|
end
|
|
|
|
local prop = pdata[idx*6-4]
|
|
local offset = pdata[idx*6-3]
|
|
local floor = pdata[idx*6-2]
|
|
local bit = pdata[idx*6-1]
|
|
local monster = pdata[idx*6-0]
|
|
|
|
local left_monster = get_alive_instance_respawn_group_monster_count( 20000, layer, respawn )
|
|
broadcast_mission_objective_progress( 1, 0, monster - left_monster, 20000, layer )
|
|
if left_monster ~= 0 then
|
|
return
|
|
end
|
|
|
|
if floor==4 then
|
|
do_each_player_in_instance_dungeon( 20000, layer, "update_title_condition( 9002002, 1 )" ) -- 불카누스 사냥 시 호칭 부여
|
|
else
|
|
local floor_clear_flag = get_instance_dungeon_flag( 20000, layer, 'Vul' .. floor )
|
|
floor_clear_flag = floor_clear_flag + bit
|
|
set_instance_dungeon_flag( 20000, layer, 'Vul'..floor, floor_clear_flag )
|
|
do_each_player_in_instance_dungeon( 20000, layer, "cprint('@9813');cprint('@9250')" )
|
|
end
|
|
|
|
-- 보상 지급 스크립트
|
|
local exp, jp, gold = vulcanus_get_clear_reward( layer, floor )
|
|
local reward_handler = 'add_exp_jp( ' .. exp .. ', ' .. jp .. ', false, false ); insert_gold( ' .. gold .. ', true )'
|
|
do_each_player_in_instance_dungeon( 20000, layer, reward_handler )
|
|
|
|
broadcast_mission_title( 1, '', 20000, layer ) -- 미션창 숨김
|
|
add_field_prop( prop, 0, x, y, layer, offset ) -- 다음방으로 가는 프랍 생성
|
|
|
|
|
|
|
|
end
|
|
|