Jump to content
  • 0

Devils Catacomb quest


flygun

Question

  • Former Staff

hello guys i got problem with the devilscave quest

before the last floor

when 2595 is killed

the quest don't teleport me to the last floor

 

sorry for bad english

-------------------------------
---Devils Catacomb quest-------
-------------------------------  
quest devilscave1 begin
    state start begin    
        when login begin
            if pc.get_map_index() == 206 then
                pc.set_warp_location(206, 3148, 12098)
            end
        end    
        when 20351.chat." سرداب الموت  (lv.80)" begin
            if pc.get_level() < 80 and pc.count_item(30320) >= 1 then
                say_title(" حارس السرداب ")
                    say(" قف مكانك! ")
                say(" هل تريد ان تنتقل بهاذي السهوله؟ ")
                say_reward(" يجب ان يكون معك رأس منكمش ")
                say_reward(" هل تريد معرفة شكله لامشكله !")
                say(" هذا شكله ")
                                say("")
                                say_item_vnum(30320)
            elseif pc.get_level() > 79 and pc.count_item(30320) < 1 then
                say_title(" حارس السراديب ")
                    say(" قف مكانك! ")
                say(" هل تريد ان تنتقل بهاذي السهوله؟ ")
                say_reward(" يجب ان يكون معك رأس منكمش ")
                say_reward(" هل تريد معرفة شكله لامشكله !")
                say(" هذا شكله ")
                                say("")
                                say_item_vnum(30320)
            elseif pc.get_level() > 79 and pc.count_item(30320) > 0 then
                say_title(" حارس السراديب ")
                    say(" أوه رائع! ")
                say("")
                say(" الان يمكنك الانتقال ")
                say(" فرأس المنكمش احتاجه لكي انقلك ")
                say(" نعم لم أسمع هل تقول لماذا؟...")
                say("")
                wait()
                say_title(" لأستطيع ادخلك بدونه ")
                say("")
                say(" فأرواح الشياطين تحمي السرداب "..game.get_event_flag("dcgamer").."  ")
                say(" "..game.get_event_flag("dc_geschaft").." فلذالك طلبت منك ان تحضره لي ")
                say(" لكي !")
                wait()
                say_title(" يحميك من أرواح الشياطين ")
                say("")
                say_reward(" ان عيني القناع تشع نور ?")
                say_reward(" و الشياطين لاتحب النور "..game.get_event_flag("dc_versuche")..". s")
                say_reward(" لا أريد ان اكثر الكلام تفضل بي الدخول....")
                say("")
                local dc_login = select(" نعم اريد الدخول!", " لاأريد الدخول ")
                if dc_login == 1 then
                    pc.remove_item("30320", 1)
                    pc.warp(314800, 1209800)
                elseif dc_login == 2 then
                    return
                end
            end
        end            
--Ebene 1        
        when login with pc.get_map_index() == 206 begin
            game.set_event_flag(("dcgamer"), game.get_event_flag("dcgamer")+1)
            game.set_event_flag(("dc_versuche"), game.get_event_flag("dc_versuche")+1)            
            say_title(" سرداب الموت: ")
            say(" سرداب الموت جد خطير كن حذرا")
                    say(" سرداب الموت جدا خطير ارجو الانتباه...")
            say_item(" مفتاح بلور الروح  ", 30311, "") --Die "--" vor say_item entfernen wenn beim Login text das Item als Bild angezeigt werden soll das man braucht
            say(" هذا المفتاح ينقلك للطابق الثاني!")
            say("")
            say_reward(" يمكنك الحصول على مفتاح بلور الروح  !")
            say_reward(" من الوحوش و الشياطين الموجودة في طريقك ")
            say(" حظا موفقا! ")
            pc.setqf("sksgedroppt", 0)
        end
        when kill with not npc.is_pc() and pc.get_map_index() == 206 begin
            local sks = number(1,15)
            if sks==1 and pc.getqf("sksgedroppt")==0 then
                pc.setqf("sksgedroppt", 1)
                chat(" لقد سقط مفتاح بلور الروح قم بإدخاله في تمثال السرداب السري ! ")
                game.drop_item(30311, 1)    
            else
                chat(" أوه ,, تبا لم يكن معه مفتاح بلور الروح  ")
            end
        end
        when 30101.take with item.vnum == 30311 begin
            item.remove()
            d.new_jump_all(206, 3636, 12086)
            d.notice("  تم فتح تمثال سرداب الموتى ! ")
            d.notice(" امامك 10 دقائق لكي تعثر على حجر العبور! ")
            d.regen_file("data/dungeon/devilcave/dc_regen_ebene2.txt")
            d.spawn_mob(30104, 741, 221)
        end                          
--Ebene 2
        when 30104.chat." الصعود(لطابق 3) " begin
            npc.purge()
            say_reward(" حسنا سوف يتم نقلك ")
            say(" حظا موفق...")
            wait()
            d.new_jump_all(206, 4427, 12284)
            d.setf("goto_ebene3", 0)
            d.notice(" عليك كسر الماتين الصحيح  ...")
            d.notice(" عليك الاسراع  ")
                        d.notice(" بإيجاد الماتين  ")
            d.regen_file("data/dungeon/devilcave/dc_regen_ebene3.txt")
            local metindv = number(1,4)
            if metindv==1 then
                d.spawn_mob(11508, 1351, 348)
                d.spawn_mob(11508, 1148, 350)
                d.spawn_mob(11508, 1151, 155)
                d.spawn_mob(11509, 1351, 149)
            end
            if metindv==2 then
                d.spawn_mob(11508, 1351, 348)
                d.spawn_mob(11508, 1148, 350)
                d.spawn_mob(11509, 1151, 155)
                d.spawn_mob(11508, 1351, 149)
            end
            if metindv==3 then
                d.spawn_mob(11508, 1351, 348)
                d.spawn_mob(11509, 1148, 350)
                d.spawn_mob(11508, 1151, 155)
                d.spawn_mob(11508, 1351, 149)
            end
            if metindv==4 then
                d.spawn_mob(11509, 1351, 348)
                d.spawn_mob(11508, 1148, 350)
                d.spawn_mob(11508, 1151, 155)
                d.spawn_mob(11508, 1351, 149)
            end
        end            
        when 11508.kill with pc.in_dungeon() begin
            d.notice(" لقد حطمت الماتين الخاطئ ركز اكثر ")
        end
        when 11509.kill with pc.in_dungeon() begin
            d.notice(" لقد حطمت الماتين الصحيح بنجاح ")
            timer("devils_catacomb_goto_ebene4", 5)
        end    

        
--Ebene 4 (Labyrinth)
        when devils_catacomb_goto_ebene4.timer begin
            d.new_jump_all(206, 3143, 12657)
            d.setf("labyrinth", 1)
                        d.spawn_mob(693, 70, 578)                        
            if game.get_event_flag("dc_is_wartung") == 1 then
                d.spawn_mob(20023, 72, 586)
            end
        end            
        when 20352.chat." الصعود (لطابق 5)!" with pc.in_dungeon() begin
            npc.purge()
            say_title(".....")
            d.notice(" لقد نجحت في تجاوز هذا المستوى سيتم نقلك للطابق السادس...")
            timer("devils_catacomb_goto_ebene5", 5)
        end
--Ebene 6 (Tartaros)
        when devils_catacomb_goto_ebene5.timer begin
            d.new_jump_all(206, 3917, 12925)
            d.notice(" عليك أن تقتل وقح الظلام قائد الزومبي! ")
            d.notice(" ثم يمكنك تجاوز هذا الطابق ")
            d.spawn_mob(30102, 848, 739)
            d.regen_file("data/dungeon/devilcave/dc_regen_ebene5.txt")
            local tartaros = number(1,4)
            if tartaros==1 then
                d.spawn_mob(2591, 991, 848)
            end
            if tartaros==2 then
                d.spawn_mob(2591, 999, 652)
            end
            if tartaros==3 then
                d.spawn_mob(2591, 848, 577)
            end
            if tartaros==4 then
                d.spawn_mob(2591, 703, 644)
            end
            if tartaros==5 then
                d.spawn_mob(2591, 692, 817)
            end
        end            
        when 2591.kill with pc.in_dungeon() begin
            game.set_event_flag((""..pc.get_name().."ap_send"), game.get_event_flag(""..pc.get_name().."ap_send") + 5)
            local Reward = 5
            local Achievement = "H?llenbastard"
            local killcount = pc.getqf("2591")
            local actual_achievement_points = pc.getqf("achievement_points")
            pc.setqf("2591", killcount + 1)
            --pc.setqf("achievement_points", actual_achievement_points + Reward)
            cmdchat("achievement ".. Achievement .."_get?tet#".. killcount + 1  .."%".. actual_achievement_points + Reward .."")
            d.notice("  لقد سقط المفتاح عليك ان تفتح الحجر الكبير في الأعلى ! ")
            game.drop_item(30312, 1)
        end    
        when 30102.take with item.vnum == 30312 begin
            item.remove()
            npc.purge()
            say_reward("..تم فتح الحجر سوف يتم نقلكم.")
            d.notice("  لقد تم فتح الحجر سوف يتم نقلك! ")
            timer("devils_catacomb_goto_ebene6", 5)
        end
--Ebene 7 (Charon)
        when devils_catacomb_goto_ebene6.timer begin
            d.new_jump_all(206, 4411, 12736)
            d.notice("  الطابق 7 انه طابق خطير عليك قتل شريرون! ")
            d.regen_file("data/dungeon/devilcave/dc_regen_ebene6.txt")
        end        
        when 2595.kill with pc.in_dungeon() begin
            game.set_event_flag((""..pc.get_name().."ap_send"), game.get_event_flag(""..pc.get_name().."ap_send") + 8)
            local Reward = 8
            local Achievement = "Charon"
            local killcount = pc.getqf("2595")
            local actual_achievement_points = pc.getqf("achievement_points")
            pc.setqf("2595", killcount + 1)
            --pc.setqf("achievement_points", actual_achievement_points + Reward)
            cmdchat("achievement ".. Achievement .."_get?tet#".. killcount + 1  .."%".. actual_achievement_points + Reward .."")
            chat("Du hast einen Schrumpfkopf bekommen!")
                        pc.give_item2(50037, 1 )
            d.notice(" لقد إنتصرت على شريرون... ")
            d.notice(" ستواجه الآن فرعائيل زعيم السرداب ")
            timer("devils_catacomb_goto_ebene7", 10)
        end
--Ebene 8 (Azrael)
        when devils_catacomb_goto_ebene7.timer begin
            d.new_jump_all(206, 3147, 13191)
            d.notice("~~T?tet Azrael nur dann bekommt ihr eine Belohnung!~~")
            d.regen_file("data/dungeon/devilcave/dc_regen_ebene7.txt")
        end
        when 2598.kill with pc.in_dungeon() begin
            game.set_event_flag((""..pc.get_name().."ap_send"), game.get_event_flag(""..pc.get_name().."ap_send") + 25)
            local Reward = 25
            local Achievement = "Azrael"
            local killcount = pc.getqf("2598")
            local actual_achievement_points = pc.getqf("achievement_points")
            pc.setqf("2598", killcount + 1)
            --pc.setqf("achievement_points", actual_achievement_points + Reward)
            cmdchat("achievement ".. Achievement .."_get?tet#".. killcount + 1  .."%".. actual_achievement_points + Reward .."")
            game.set_event_flag(("dc_geschaft"), game.get_event_flag("dc_geschaft")+1)
            local level = pc.get_level()            
            d.notice(" لقد تم قتل فرعائيل زعيم السرداب!!")
            d.kill_all()
            d.kill_all()
            notice_all(" قام بقتل فرعائيل اللاعب "..pc.get_name().." ومستواه lv."..(level).." ونبارك له ! ")
            d.spawn_mob(20518, 74, 1159)    
            pc.give_item2(50186)
            d.setf("dc_belohnung", 1)
        end
        when 20518.chat." الخروج من سرداب الموت " with pc.in_dungeon() begin
            say_title(" رجل عجوز: ")
            say("")
            say(" أهلا أيها البطل لقد شاهدت معركتك ")
            say(" لقد أثبت للعالم أنك شجاع  ")
            say_reward(" هل تريد الخروج من هنا ؟ ")
            say("")
            local dc_left = select(" نعم ", " لا ")
            if dc_left == 1 then
                pc.warp(591100, 99200)
            else
                return
            end            
        end
    end
end   
Link to comment
  • Answers 3
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

3 answers to this question

Recommended Posts

  • 0

use oficial quest, from 40k leaked.

 

quest devilcatacomb_zone begin
	state start begin
	
	function is_closed()
		return (game.get_event_flag("dc_closed") > 0)    --close dialog
	end
	
	function setting()
		return
		{

		["base"]={["x"] = 3072  , ["y"]= 12032 ,},
		["floor1_s"] = { ["x"] = 20, ["y"] = 20, },
		["floor1_e"] = { ["x"] = 500, ["y"] = 470,},
		["floor2_s"] = { ["x"] = 510, ["y"] = 18, },
		["floor2_e"] = { ["x"] = 978, ["y"] = 470,},
		["floor1_entry"] = {["x"] = 73, ["y"] = 63,},
		["floor2_entry"] = {["x"] = 550, ["y"] = 45,},
		["floor3_entry"] = {["x"] = 1378, ["y"] = 249,},
		["floor4_entry"] = {["x"] = 70, ["y"] = 592,},
		["floor5_entry"] = {["x"] = 846, ["y"] = 898},
		["floor6_entry"] = {["x"] = 1362, ["y"] = 666},
		["floor7_entry"] = {["x"] = 73, ["y"] = 1156},

		["map_idx"] = 216,
		["rag"] = 30311,

		["devil_king"] = 2591,

		["reapers_credit1"] = 30319,
		["reapers_credit2"] = 30320,
		["reapers_credit3"] = 76002,

		["floor3_stone"] = 8038,  
		["floor3_stone_pos"] = {
				{1366,	150},
				{1366,	351},
				{1234,	365},
				{1234,	140},
				{1150,	135},
				{1130,	365},
				{1135,	253}
		},

		["mob_regen_file_path"] = "data/dungeon/devilcatacomb/",
		["floor4_regen_file"] = {"devilcatacomb_floor4_regen1.txt",
		                       "devilcatacomb_floor4_regen2.txt",
							   "devilcatacomb_floor4_regen3.txt",
							   "devilcatacomb_floor4_regen4.txt",
							   "devilcatacomb_floor4_regen5.txt"} ,

		["credit_stone"] = 30101,
		["credit_stone_pos"] = {307,323},
		["floor2_stone"] = 30103,
		["floor2_stone_pos"] = {741,217},
		["floor2_merchant_npc"] = 20368,
		["floor2_merchant_npc_pos"] = {734,214},
		
		["floor4_npc"] = 30104,
		["floor4_npc_pos"] = {500, 717},

		["devil_king_pos"] = {{673,829},{691,638},{848,568},{1026,642},{1008,862}},

		["unlock_stone"] = 30312,
		["floor5_stone"] = 30102,
		["floor5_stone_pos"] = {848, 735},

		["devil_great_king"] = 2597 ,
		["devil_great_king_pos"] = {1303,704},
		["devil_emperor"] = 2598,
		["devil_emperor_pos"] = {74,1103},

		["dc2_door_set_size"] = {4,2,3,2},
		["dc2_door_set1"] = {
								{{30111,    566,    117,    5},{30112,  562,    311,    5,},{30118, 663,    434,    7},{30119,  881,    434,    7}},
								{{30116,    743,    390,    3},{30119,  612,    251,    1,}},
								{{30113,    654,    211,    5},{30111,  707,    338,    7,},{30112, 775,    336,    7}},
								{{30117,    733,    294,    3},{30113,  694,    271,    1,}}
							},
		["dc2_door_set2"] = {
								{{30115,    942,    141,    5},{30116,  942,    245,    5},{30117,  942,    321,    5},{30115,  763,    64, 7}},
								{{30118,    643,    116,    3},{30114,  900,    167,    1}},
								{{30114,    850,    293,    5},{30113,  715,    164,    7},{30114,  817,    162,    7}},
								{{30111,    802,    277,    1},{30112,  800,    241,    1}}
							},
		}
	end
		when login begin
			local setting = devilcatacomb_zone.setting()
			local idx = pc.get_map_index()
			if idx >= (setting.map_idx * 10000) and idx < ((setting.map_idx + 1) * 10000) then
--				pc.set_warp_location(65, 5914, 992)         -----------¾Æ±Íµ¿±¼ ÁÂÇ¥·Î
				local level = d.getf("level")
				-- warp locationÀÌ 0,0 ÀÌ¸é ½Ã½ºÅÛ »óÀ¸·Î, Á¾·á ½Ã, Á¾·á À§Ä¡¸¦ ½ÃÀÛ À§Ä¡·Î ÀúÀåÇÑ´Ù.
				d.set_warp_location (0, 0, 0)
					
				if level == 2 then
					say(gameforge.devilcatacomb_zone._10_say)
					say(string.format(gameforge.devilcatacomb_zone._20_say, 60))
				elseif level == pc.getqf ("level") then
--					say ("³«¿ÀµÇÁö ¾Ê±â À§ÇØ µ¿·áµé°ú ÇÕ·ùÇϽʽÿÀ.")
					say(gameforge.devilcatacomb_zone._30_say)
				else
					say(gameforge.devilcatacomb_zone._40_say)
--					say ("´ç½ÅÀº ³«¿ÀµÇ¾ú½À´Ï´Ù. ¿ë½ÅÀÇ ÈûÀ» ºô¾î Àá½Ã µÚ µ¿±¼ ¹ÛÀ¸·Î À̵¿ÇÕ´Ï´Ù.")
					timer ("devilcatacomb_ban_timer", 5)
				end
			end
			if idx == setting.map_idx then
				pc.setf("devilcatacomb_zone","last_exit_time", get_global_time())
				-- 2ÃþÀÌ»óÀ̸é, ÂѰܳª
				if pc.get_x() < setting.floor1_s.x + setting.base.x
					or pc.get_y() < setting.floor1_s.y + setting.base.y
					or pc.get_x() > setting.floor1_e.x + setting.base.x
					or pc.get_y() > setting.floor1_e.y + setting.base.y
				then
					-- ¾Æ±Íµ¿±¼ ÀÔ±¸·Î
--					if not is_test_server() then
						say(gameforge.devilcatacomb_zone._40_say)
						timer ("devilcatacomb_ban_timer", 5)
--					end
				else 
					-- ¾Æ±Íµ¿±¼ ÀÔ±¸·Î
--					pc.set_warp_location(65, 5914, 992)
					say(gameforge.devilcatacomb_zone._50_say)
				end
			end
		end

		when logout begin
			local idx = pc.get_map_index()
			local setting = devilcatacomb_zone.setting()
			if idx == setting.map_idx or idx >= (setting.map_idx * 10000) and idx < ((setting.map_idx + 1) * 10000) then
				pc.setf("devilcatacomb_zone","last_exit_time", get_global_time())
			end
		end

		when devilcatacomb_ban_timer.timer begin
			pc.warp((5914)*100, (992)*100, 65)
		end

		when warp_timer.timer begin
			local level = d.getf("level")
			local level_switch = {
				[3] = gameforge.devilcatacomb_zone._60_say,
				[4] = gameforge.devilcatacomb_zone._70_say,
				[5] = gameforge.devilcatacomb_zone._80_say,
				[6] = gameforge.devilcatacomb_zone._90_say,
			}
			local t = 3600 -(get_global_time() - d.getf("enter_time"))
			local t_r = math.mod (t, 60)
			local t_m = (t - t_r) / 60
			d.notice ( level_switch[level] )
			d.notice(string.format(gameforge.devilcatacomb_zone._20_say, t_m))
			d.set_warp_location (0, 0, 0)
		end

		when devilcatacomb_man.chat.gameforge.devilcatacomb_zone._100_npcChat with not devilcatacomb_zone.is_closed() begin
			local setting = devilcatacomb_zone.setting()
			if pc.get_level() < 75 then
				say(gameforge.devilcatacomb_zone._110_say)
			elseif pc.getf("deviltower_zone","9_done") == 0 then
				say(gameforge.devilcatacomb_zone._120_say)
			elseif ((get_global_time() - pc.getf("devilcatacomb_zone","last_exit_time")) < 1800) then
				say(gameforge.devilcatacomb_zone._130_say)
			else
				say(gameforge.devilcatacomb_zone._140_say)
				local s = select(gameforge.devilcatacomb_zone._150_select, gameforge.devilcatacomb_zone._160_select)
				if s == 1 then
					pc.warp ((setting.floor1_entry.x + setting.base.x )* 100, (setting.floor1_entry.y + setting.base.y) * 100)
				end
			end
		end
	
		-- ¸ó½ºÅÍ°¡ Á×À¸¸é ¹ß»ýÇÏ´Â À̺¥Æ®.
		when kill begin
			local setting = devilcatacomb_zone.setting()
			-- ¾Æ±Íµ¿±¼ 1ÃþÀ̸é 1% È®·ü·Î ±Ý½Ã°ÇÀ» µå¶øÇÑ´Ù.
			if pc.get_x() > setting.floor1_s.x + setting.base.x
					and pc.get_y() > setting.floor1_s.y + setting.base.y
					and pc.get_x() < setting.floor1_e.x + setting.base.x
					and pc.get_y() < setting.floor1_e.y + setting.base.y then
				local j = number(1, 100)
				if j == 1 then
					game.drop_item (setting.rag, 1)
				end
			end
		end

	function spawn_doors ()
		local setting = devilcatacomb_zone.setting()
		for i = 1, 4 do
			local mob_set = setting.dc2_door_set1[i]
			local set_size = setting.dc2_door_set_size[i]
			for j = 1, set_size do
				d.set_unique (i.."_1_"..j, d.spawn_mob_dir (mob_set[j][1], mob_set[j][2], mob_set[j][3], mob_set[j][4]))
			end
			mob_set = setting.dc2_door_set2[i]
			for j = 1, set_size do
				d.set_unique (i.."_2_"..j, d.spawn_mob_dir (mob_set[j][1], mob_set[j][2], mob_set[j][3], mob_set[j][4]))
			end
		end
	end
		-- ±Ý½Ã°ÇÀ» ³ªÂûÀÎÁõ¼®¿¡ µå·¡±×Çϸé 2ÃþÀ¸·Î º¸³½´Ù. 2ÃþºÎÅÍ´Â ´øÀüÀÌ´Ù.
		when devilcatacomb_credit_stone. take  begin
			local setting = devilcatacomb_zone.setting()
		
			if item.vnum == setting.rag then 
				if not party.is_party() then
					say(gameforge.devilcatacomb_zone._170_say)
					return
				elseif party.is_in_dungeon() then
					say(gameforge.devilcatacomb_zone._180_say)
					return
				end

				item.remove()
				say(gameforge.devilcatacomb_zone._190_say)
				wait()
				say(gameforge.devilcatacomb_zone._200_say)
				wait()
				d.new_jump_party (setting.map_idx, setting.floor2_entry.x + setting.base.x  , setting.floor2_entry.y + setting.base.y )
				d.setqf2("devilcatacomb_zone","level", 2)
				d.setf ("level",2)
				d.regen_file (setting.mob_regen_file_path.."dc_2f_regen.txt")
				
				d.spawn_mob (setting.floor2_merchant_npc, setting.floor2_merchant_npc_pos[1], setting.floor2_merchant_npc_pos[2])
				d.spawn_mob (setting.floor2_stone, setting.floor2_stone_pos[1], setting.floor2_stone_pos[2])
				
				devilcatacomb_zone.spawn_doors ()
				server_timer('devilcatacomb_45m_left_timer',60 * 15, d.get_map_index())
				d.setf("enter_time", get_global_time())
			end	
		end
		
		when devilcatacomb_45m_left_timer.server_timer begin
			if d.select(get_server_timer_arg()) then
				d.notice(string.format(gameforge.devilcatacomb_zone._20_say, 45))
				server_timer('devilcatacomb_30m_left_timer', 60 * 15, get_server_timer_arg())
			end
		end

		when devilcatacomb_30m_left_timer.server_timer begin
			if d.select(get_server_timer_arg()) then
				d.notice(string.format(gameforge.devilcatacomb_zone._20_say, 30))
				server_timer('devilcatacomb_15m_left_timer', 60 * 15, get_server_timer_arg())
			end
		end
	
		when devilcatacomb_15m_left_timer.server_timer begin
			if d.select(get_server_timer_arg()) then
				d.notice(string.format(gameforge.devilcatacomb_zone._20_say, 15))
				server_timer('devilcatacomb_5m_left_timer', 60 * 10, get_server_timer_arg())
			end
		end

		when devilcatacomb_5m_left_timer.server_timer begin
			if d.select(get_server_timer_arg()) then
				d.notice(string.format(gameforge.devilcatacomb_zone._20_say, 5))
				server_timer('devilcatacomb_1m_left_timer', 60 * 4, get_server_timer_arg())
			end
		end
		
		when devilcatacomb_1m_left_timer.server_timer begin
			if d.select(get_server_timer_arg()) then
				d.notice(string.format(gameforge.devilcatacomb_zone._20_say, 1))
				server_timer ("devilcatacomb_0m_left_timer", 60 * 1, get_server_timer_arg())
			end
		end
		
		when devilcatacomb_0m_left_timer.server_timer begin
			if d.select(get_server_timer_arg()) then
				d.notice (gameforge.devilcatacomb_zone._210_dNotice)
				d.set_warp_location (65, 5914, 992)
				server_timer('devilcatacomb_exit_timer', 7, get_server_timer_arg())
			end
		end
	
	function is_dc2_doors_clear ()
		local setting = devilcatacomb_zone.setting()
		local clear = true
		for i = 1, 4 do
			local set_clear = true
			local mob_set = setting.dc2_door_set1[i]
			local set_size = setting.dc2_door_set_size[i]
			for j = 1, set_size do
				set_clear = set_clear and d.is_unique_dead (i.."_1_"..j)
			end
			if not set_clear then
				set_clear = true
				mob_set = setting.dc2_door_set2[i]
				for j = 1, set_size do
					set_clear = set_clear and d.is_unique_dead (i.."_2_"..j)
				end
			end
			clear = clear and set_clear
		end

		return clear
	end
	
		-- ÇöȲ¼®À» Ŭ¸¯Çϸé 3Ãþ ÁøÀÔ ¿©ºÎ¸¦ ¼±ÅÃÇÒ ¼ö ÀÖ°í
		-- ÁøÀԽà »ç½ÅÀÇÁõÇ¥¸¦ °Ë»çÇÑ´Ù.
		-- »ç½ÅÀÇ ÁõÇ¥°¡ ¾ø´Ù¸é ¹ÛÀ¸·Î ¿öÇÁµÈ´Ù.
		when devilcatacomb_floor2_stone.click begin
			local setting = devilcatacomb_zone.setting()
			
			if d.getf("devilcatacomb_floor2_stone_clicked") == 0 then
				if not devilcatacomb_zone.is_dc2_doors_clear () then
					say(gameforge.devilcatacomb_zone._220_say)
					wait ()
					return
				end
				say(gameforge.devilcatacomb_zone._230_say)
				wait()
				say(gameforge.devilcatacomb_zone._240_say)
				wait()
				local s = select(gameforge.devilcatacomb_zone._150_select, gameforge.devilcatacomb_zone._160_select)
				if s == 1 then
					if d.getf("devilcatacomb_floor2_stone_clicked") == 0 then
						d.setf("devilcatacomb_floor2_stone_clicked", 1)
						d.setqf2("devilcatacomb_zone","last_exit_time", get_global_time())
						d.set_item_group ("reapers_credit", 3, setting.reapers_credit3, 1, setting.reapers_credit2, 1, setting.reapers_credit1, 1)
						d.say_diff_by_item_group("reapers_credit", gameforge.devilcatacomb_zone._250_say, gameforge.devilcatacomb_zone._260_say)
						timer ("devilcatacomb_floor3_enter_timer", 7)
					end
				end
			else
				say(gameforge.devilcatacomb_zone._270_say)
			end
		end
		
		when devilcatacomb_floor3_enter_timer.timer begin
			local setting = devilcatacomb_zone.setting()
			d.set_warp_location (65, 5914, 992)
			d.exit_all_by_item_group ("reapers_credit")
			d.delete_item_in_item_group_from_all ("reapers_credit")
			d.purge ()
			d.jump_all (setting.floor3_entry.x + setting.base.x , setting.floor3_entry.y + setting.base.y)
			d.setf("level",3)
			d.setqf2("devilcatacomb_zone","level", 3)
			d.regen_file (setting.mob_regen_file_path.."dc_3f_regen.txt")
			timer("warp_timer",3)
			
			local position = setting.floor3_stone_pos
		
			local n = number(1,7)
			for i = 1, 7 do
				if (i != n)
				then
					d.set_unique("fake"..i, d.spawn_mob( setting.floor3_stone, position[i][1], position[i][2]))
				end
			end
		
			local vid = d.spawn_mob( setting.floor3_stone, position[n][1], position[n][2])
			d.set_unique ("real",vid)
			if (is_test_server()) then
				-- real stone pos
				chat (position[n][1],position[n][2])
			end
	
		end

		when devilcatacomb3_stone.kill begin
			local setting = devilcatacomb_zone.setting()
			-- µ¹ÀÌ Æı«µÇ¸é ÁøÂ¥°¡ Á×¾ú´ÂÁö È®ÀÎÇغ»´Ù.
			-- ÁøÂ¥°¡ Á×¾úÀ¸¸é 4ÃþÀ¸·Î À̵¿ÇÑ´Ù.
			if d.is_unique_dead("real") then
				d.notice(gameforge.devilcatacomb_zone._280_dNotice)
				
				d.setf ("level",4)
				d.setqf2("devilcatacomb_zone","level", 4)
				timer ("devilcatacomb_floor4_enter_timer", 3)
			else
				d.notice(gameforge.devilcatacomb_zone._290_dNotice)
			end
		end

		when devilcatacomb_floor4_enter_timer.timer begin
			local setting = devilcatacomb_zone.setting()
			local i = number (1, 5)
			timer("warp_timer",3)
			d.purge ()
			d.jump_all (setting.floor4_entry.x + setting.base.x , setting.floor4_entry.y + setting.base.y)
			d.regen_file (setting.mob_regen_file_path.."dc_4f_regen.txt")
			d.regen_file (setting.mob_regen_file_path..setting.floor4_regen_file[i])
			if (is_test_server()) then
				d.notice (setting.floor4_regen_file[i])
			end
			d.spawn_mob (setting.floor4_npc, setting.floor4_npc_pos[1], setting.floor4_npc_pos[2])
		end

		-- devilcatacomb_floor4_stone´Â Ŭ¸¯ ½Ã 4Ãþ¿¡¼­ 5ÃþÀ¸·Î À̵¿½ÃÅ°´Â npcÀÌ´Ù.
		when devilcatacomb_floor4_stone.click begin
			local setting = devilcatacomb_zone.setting()
			local n = number (1,5)
			say(gameforge.devilcatacomb_zone._300_say)
			wait()
			if (is_test_server()) then
				-- devil_king pos
				chat (setting.devil_king_pos[n][1], setting.devil_king_pos[n][2])
			end
			d.purge ()
			d.jump_all (setting.floor5_entry.x + setting.base.x, setting.floor5_entry.y + setting.base.y )
			d.setf ("level",5)
			d.setqf2("devilcatacomb_zone","level", 5)
			timer("warp_timer",3)
			d.regen_file (setting.mob_regen_file_path.."dc_5f_regen.txt")
			d.spawn_mob (setting.devil_king, setting.devil_king_pos[n][1], setting.devil_king_pos[n][2])
			d.spawn_mob (setting.floor5_stone, setting.floor5_stone_pos[1], setting.floor5_stone_pos[2])
		end
		
		-- ¾Æ±Í¿Õ(2591)ÀÌ Á×À¸¸é ºÀÀÎÇØü¼® µå¶ø
		when devilcatacomb_devil_king.kill begin
			local setting = devilcatacomb_zone.setting()
			game.drop_item (setting.unlock_stone, 1)
		end

		-- »ç½Å±ÝÁ¦ºñ(30102)¿¡ ±ÝÁ¦ÇØü¼®ºÀÀ» µå·¡±×ÇÏ¸é ¸ðµç ¸ó½ºÅ͸¦ Á×ÀÌ°í
		-- 6ÃþÀ¸·Î À̵¿Çϴ ŸÀ̸Ӹ¦ µ¿ÀÛ½ÃŲ´Ù.
		when devilcatacomb_floor5_stone.take begin
			local setting = devilcatacomb_zone.setting()
			if item.vnum == setting.unlock_stone then
				item.remove ()
				d.notice(gameforge.devilcatacomb_zone._310_dNotice)
				-- 6ÃþÀ¸·Î À̵¿
				d.clear_regen()
				d.purge()
				timer("devilcatacomb_floor6_timer",2)
			end
		end

		when devilcatacomb_floor6_timer.timer begin
			local setting = devilcatacomb_zone.setting()
			d.setf("level",6)
			d.setqf2("devilcatacomb_zone","level", 6)
			d.jump_all (setting.floor6_entry.x + setting.base.x, setting.floor6_entry.y + setting.base.y )
			d.regen_file (setting.mob_regen_file_path.."dc_6f_regen.txt")
			d.spawn_mob (setting.devil_great_king, setting.devil_great_king_pos[1], setting.devil_great_king_pos[2])
			timer("warp_timer",3)
		end
		
		-- ¾Æ°É(2597)ÀÌ Á×À¸¸é, 6ÃþÀÇ Å¸À̸Ó1ÀÌ µ¿ÀÛÇÑ´Ù.
		when devilcatacomb_devil_great_king.kill begin
			server_timer ("floor6_eli_check_timer_1", 5,d.get_map_index())
		end

		-- 6ÃþÀÇ Å¸À̸Ó1Àº ´øÀüÀÇ ¸ðµç ¸ó½ºÅÍ ¼ýÀÚ¸¦ º¸°í,
		-- 0À̸é 7ÃþÀ¸·Î ¿öÇÁÇϴ ŸÀ̸Ӹ¦ µ¿ÀÛÇÑ´Ù.
		-- ¹Ù·Î 7ÃþÀ¸·Î °¡Áö ¾Ê´Â ÀÌÀ¯´Â, À¯Àú¿¡°Ô ÁغñÇÒ ½Ã°£À» ÁÖ±â À§Çؼ­ÀÌ´Ù.
		-- 1À̸é ŸÀ̸Ó2¸¦ µ¿ÀÛ½ÃŲ´Ù.
		-- ŸÀ̸Ó1À» recursiveÇÏ°Ô µ¿ÀÛ½ÃÅ°Áö ¾ÊÀº °ÍÀº,
		-- ±×·² °æ¿ì resetÇÑ Å¸À̸Ó1ÀÌ µ¿ÀÛÇÏÁö ¾Ê¾Ò±â ¶§¹®ÀÌ´Ù.
		when floor6_eli_check_timer_1.server_timer begin
			if d.select(get_server_timer_arg()) then
				if d.count_monster() == 0 then
					say_in_map (get_server_timer_arg(), gameforge.devilcatacomb_zone._320_say)
					server_timer ("devilcatacomb_floor7_timer", 3, get_server_timer_arg())
				else
					server_timer ("floor6_eli_check_timer_2", 5, get_server_timer_arg())
				end
			end
		end

		when floor6_eli_check_timer_2.server_timer begin
			if d.select(get_server_timer_arg()) then
				if d.count_monster() == 0 then
					say_in_map (get_server_timer_arg(), gameforge.devilcatacomb_zone._320_say)
					server_timer("devilcatacomb_floor7_timer", 3, get_server_timer_arg())
				else
					server_timer ("floor6_eli_check_timer_1", 5, get_server_timer_arg())
				end
			end
		end
		
		when devilcatacomb_floor7_timer.server_timer begin
			if d.select(get_server_timer_arg()) then
				local setting = devilcatacomb_zone.setting()

				d.setf("level",7)
				d.setqf2("devilcatacomb_zone","level", 7)
				d.jump_all (setting.floor7_entry.x + setting.base.x, setting.floor7_entry.y + setting.base.y )
				d.regen_file (setting.mob_regen_file_path.."dc_7f_regen.txt")
				d.spawn_mob (setting.devil_emperor, setting.devil_emperor_pos[1], setting.devil_emperor_pos[2])
				server_timer ("devilcatacomb_floor7_say_timer", 2, get_server_timer_arg())
			end	
		end

		when devilcatacomb_floor7_say_timer.server_timer begin
			if d.select(get_server_timer_arg()) then

				local t = 3600 -(get_global_time() - d.getf("enter_time"))
				local t_r = math.mod (t, 60)
				local t_m = (t - t_r) / 60
				d.notice(gameforge.devilcatacomb_zone._330_dNotice)
				d.notice(string.format(gameforge.devilcatacomb_zone._20_say, t_m))
				d.set_warp_location (0, 0, 0)
			end
		end

		-- 6Ãþ°ú ¸¶Âù°¡Áö·Î »ç¸¶ÈÖ(2598)ÀÌ Á×À¸¸é
		-- 7ÃþÀÇ Å¸À̸Ӱ¡ ÀÛµ¿ÇÑ´Ù.
		when devilcatacomb_devil_emperor.kill begin
			server_timer ("floor7_eli_check_timer_1", 5, d.get_map_index())
		end
		
		-- 7ÃþÀÇ Å¸À̸Ӵ 6Ãþ ŸÀÌ¸Ó¿Í ºñ½ÁÇϸç,
		-- ¸ó½ºÅÍ ¼ýÀÚ°¡ 0À̸é exit ŸÀ̸Ӹ¦ ¹ß»ý½ÃŲ´Ù.
		-- ¹Ù·Î exitÇÏÁö ¾Ê´Â ÀÌÀ¯´Â, À¯Àúµé¿¡°Ô ÁغñÇÒ ½Ã°£À» ÁÖ±â À§Çؼ­ÀÌ´Ù.
		when floor7_eli_check_timer_1.server_timer begin
			if d.select(get_server_timer_arg()) then
				if d.count_monster() == 0 then
					d.set_warp_location (65, 5914, 992)
					d.setqf2("devilcatacomb_zone","done", 1)
					say_in_map (get_server_timer_arg(), gameforge.devilcatacomb_zone._340_say)
					clear_server_timer ("devilcatacomb_0m_left_timer", get_server_timer_arg())
					server_timer("devilcatacomb_exit_timer", 60, get_server_timer_arg())
				else
					server_timer ("floor7_eli_check_timer_2", 5, get_server_timer_arg())
				end
			end
		end

		when floor7_eli_check_timer_2.server_timer begin
			if d.select(get_server_timer_arg()) then
				if d.count_monster() == 0 then
					d.set_warp_location (65, 5914, 992)
					d.setqf2("devilcatacomb_zone","done", 1)
					say_in_map (get_server_timer_arg(), gameforge.devilcatacomb_zone._340_say)
					clear_server_timer ("devilcatacomb_0m_left_timer", get_server_timer_arg())
					server_timer("devilcatacomb_exit_timer", 60, get_server_timer_arg())
				else
					server_timer ("floor7_eli_check_timer_1", 5, get_server_timer_arg())
				end
			end
		end

		when devilcatacomb_exit_timer.server_timer begin
			if d.select(get_server_timer_arg()) then
				d.setqf2("devilcatacomb_zone","level", 0)
				d.setqf2("devilcatacomb_zone","last_exit_time", get_global_time())
				clear_server_timer("devilcatacomb_5m_left_timer", get_server_timer_arg())
				clear_server_timer("devilcatacomb_1m_left_timer", get_server_timer_arg())
				clear_server_timer("devilcatacomb_0m_left_timer", get_server_timer_arg())
				clear_server_timer("floor6_eli_check_timer_1", get_server_timer_arg())
				clear_server_timer("floor6_eli_check_timer_2", get_server_timer_arg())
				clear_server_timer("floor7_eli_check_timer_1", get_server_timer_arg())
				clear_server_timer("floor7_eli_check_timer_2", get_server_timer_arg())
				clear_server_timer("devilcatacomb_floor7_say_timer", get_server_timer_arg())
				clear_server_timer("devilcatacomb_floor7_timer", 3, get_server_timer_arg())
				d.clear_regen()
				d.exit_all()
			end
		end
	end  --state
end   --quest

:D

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.