Jump to content

core_dumped blazing purgatory?


Recommended Posts

quest flame_dungeon begin
state start begin
	function get_settings()
		local flame_dungeon_settings = {}
		flame_dungeon_settings.map_index = 75
		flame_dungeon_settings.base_cord = {7424, 6144 } --Base Kordinaten
		flame_dungeon_settings.outside_entry_pos = {62,6142,7068} -- Mapindex, Exit Position (Feuerland)
		flame_dungeon_settings.start_position = { 345,549 } --Startposition
		flame_dungeon_settings.need_level = 105 -- Ab wann ist der Dungeon betretbar.
		flame_dungeon_settings.need_level_group = 100 -- Benötigte Level für Gruppenmitglieder
		
		flame_dungeon_settings.need_items = 71095 --Benötigte items zum eintritt
		flame_dungeon_settings.need_itemsc = 1 --Benötigte item anzahl zum eintritt

		flame_dungeon_settings.wait_duration_user = 60*30 --Wartezeit bis zum nächten run (Userbezogen)
		flame_dungeon_settings.wait_duration_core = 0 --Wartezeit bis zum nächten run (Channelbezogen)  ->>>>> NICHT EINGEBAUT
		flame_dungeon_settings.max_out_party = 60*5 --Maximale zeit für das wiederbetreten des Dungeons
		
		flame_dungeon_settings.zone_b_vnum_drop = 30329 --Vnum von item Zone b
		flame_dungeon_settings.zone_e_vnum_drop = 30330 --Vnum von item Zone e
		
		flame_dungeon_settings.zone_d_lvl5_vnumf = 6009 --Vnum vom (fake) Boss
		flame_dungeon_settings.zone_d_lvl6_vnumr = 6051 --Vnum vom (right) Boss
		flame_dungeon_settings.zone_d_lvl6_vnumr_pos = {470,175} --Position of right boss
		
		flame_dungeon_settings.bossroom_entry_pos = {8109,6867} --Jump Kordinaten zur Bosszone
		flame_dungeon_settings.boss_pos = {686,637} --Endboss position
		flame_dungeon_settings.boss_vnum = 6091 --Endboss vnum
		
		--Brücken Ende
		flame_dungeon_settings.indoors_vnum = 20388
		flame_dungeon_settings.idoors_zone_new = { {"A",268,447,4},{"B",234,359,3}, {"C",300,264,6},{"D",454,217,4},{"E",470,355,3},{"F",467,469,2} }
		
		--Brücke Anfang
		flame_dungeon_settings.doors_vnum = 20387
		flame_dungeon_settings.doors_zone_new = { {"A",320,394,4},{"B",293,359,3},{"C",333,321,6},{"D",378,320,4},{"E",400,355,3},{"F",394,401,6} }
		
		--Zone B Säule
		 flame_dungeon_settings.level2_vnum = 20386
		 flame_dungeon_settings.level2_kords = {195,352,1}
		 
		 --Zone E Säulen
		flame_dungeon_settings.level6_vnum = 20386
		flame_dungeon_settings.kords = { {486, 345},{511, 336},{525, 349},{521, 365},{503, 372},{486, 365},{500, 354}}
		
		--Zone F Metinsein
		flame_dungeon_settings.metinstone_vnum = 8057
		flame_dungeon_settings.metinstone_pos = {511,480}
		
		
		return flame_dungeon_settings
	end
	function is_flame_dungeon()
		local set = flame_dungeon.get_settings()
		local map = pc.get_map_index()
		if map >= (set.map_index * 10000) and map < (set.map_index * 10000 + 9000) then
			return true
		else
			return false
		end
	end
	function clear_alls()
		local d_index = d.get_map_index()
		clear_server_timer("time_",d_index)
		clear_server_timer("time_1",d_index)
		clear_server_timer("time_2",d_index)
		clear_server_timer("time_3",d_index)
		clear_server_timer("time_4",d_index)
		clear_server_timer("time_5",d_index)
		clear_server_timer("time_exit_all",d_index)
		d.setf("level",1)
		d.setf("missi_finish",0)
		d.setf("stone_count",0)
		d.setf("kill_count",0)
		d.setf("key_count",0)
		d.setf("spawn_right_mob",0)
		d.setf("check_items",0)
		d.setf("party_leader_pid",0)
		d.setf("status",0)
		--local x = "Area_zones"..d_index
		--LIB_table_del(x)
		local set = flame_dungeon.get_settings()
		local o = set.doors_zone_new
		--local lib_name = "zone_"..d_index.."_"
		for i = 1, table.getn(o), 1 do
			d.setf("have_zone_"..o[i][1].."",0)
			d.setf("have_zonei_"..o[i][1].."",0)
			--LIB_variable_add(lib_name..o[i][1].."_enabled",0)
			--d.setf("zone_"..o[i][1].."_enabled",0)
		end
	end
	--GM start
	when 20394.chat."GM: Flame_Dungeon duration" with pc.is_gm() begin
		pc.setqf("duration",0)
		set_skin(NOWINDOW)
	end
	when 9010.chat."GM: Flame_Dungeon -> Exit all now" with pc.is_gm() begin
		d.notice("Zeit ist abgelaufen. Alle werden hinausteleportiert in 10 Sekunden.")
		server_timer("time_exit_all",10,d.get_map_index())
		setskin(NOWINDOW)
	end
	--GM end
	
	when 20394.chat."Deiner Gruppe wieder beitreten" with (party.is_party() and party.getf("flame_dungeon_map_index") >= 1) begin
		local n = party.getf("flame_dungeon_map_index")
		local set = flame_dungeon.get_settings()
		local cord = set.base_cord
		local start_pos = set.start_position
		say("debug: "..pc.getqf("can_enter").."")
		if pc.getqf("out_party_time") < get_global_time() then
			say_npc()
			say("")
			say("Ich kann dich nicht deiner Gruppe wieder")
			say("beitreten lassen.")
			say("")
		return
		end
		if pc.getqf("can_enter") == 0 then
			say_npc()
			say("")
			say("Ich kann dich nicht deiner Gruppe wieder")
			say("beitreten lassen.")
			say("Du  hattest beim eintreten keinen")
			say("Passierschein dabei.")
			say("")
		return
		end
		if n == 0 then
			setskin(NOWINDOW)
			return
		else
			say_npc()
			say("")
			say("Möchtest du deiner Gruppe wieder beitreten?")
			if select("Ja","Nein") == 1 then
				pc.setqf("can_rejoin",1)
				pc.warp((cord[1] + start_pos[1])*100,(cord[2] + start_pos[2])*100,n)
			end
		end
	end
	when 20394.chat."Flamen Dungeon betreten" begin --with party.getf("flame_dungeon_map_index") == 0 begin
		local set = flame_dungeon.get_settings()
		-- if is_test_server() then
		-- say_npc()
		-- say("")
		-- say("Is Developer Server")
		-- say("")
		-- say("Will use this?")
		-- if select("Yes","No") == 1 then
			-- flame_dungeon.make_dungeon()
			-- return
			-- end
		-- else
			-- wait()
		-- end
		if pc.getqf("duration") >= get_global_time() then
			say_npc()
			say("")
			say("Du musst dich noch gedulden.")
			say("")
			say("Verb. Zeit: "..LIB_duration(pc.getqf("duration")).."")
			return
		end
		if pc.get_level() < set.need_level then
			say_npc()
			say("")
			say("Dein Level ist noch zu niedrig")
			say("um den Dungeon zu betreten.")
			say("")
			say_reward("Benötigt wird: "..set.need_level.." Level.")
			return
		end
		if pc.count_item(set.need_items) == 0 then
			say_npc()
			say("")
			say("Du hast keinen "..item_name(set.need_items).."")
			say("bei dir. Komme wieder wenn einen hast.")
			say_item(set.need_itemsc.."x "..item_name(set.need_items), set.need_items,"")
			say("")
			return
		end
		if not party.is_leader() then
			say_npc()
			say("")
			say("Nur der Gruppenanführer kann")
			say("euch hineinbringen.")
			say("")
			return
		end
		--New Party Func
		-- if flame_dungeon.check_party() == false and party.get_near_count() >= 2 then
			-- return
		-- end
		-- if flame_dungeon.set_party_flagsuser() == false then
			-- return
		-- end
		-- Ist alles in when Login vereint nun.
		
		say_npc()
		say("Ich lasse euch eintreten.")
		say("")
		wait()
		--LIB_party_remove_item(set.need_items,set.need_itemsc)
		flame_dungeon.make_dungeon()
	end
	when logout begin
		if flame_dungeon.is_flame_dungeon() == true then
		local set = flame_dungeon.get_settings()
		pc.setqf("out_party_time",get_global_time() + set.max_out_party)
			if d.getf("status") == 0 then
				pc.setqf("can_enter",0)
			end
		end
	end
	when login begin
		local set = flame_dungeon.get_settings()
		local backk = set.outside_entry_pos
		local old_item_need_count = pc.count_item(set.need_items)
		if set.map_index == pc.get_map_index() then
			--chat("#debug flame# mapindex "..set.map_index.." == "..pc.get_map_index().."")
			pc.warp(backk[2] * 100,backk[3] * 100)
			return
		end
		
		if flame_dungeon.is_flame_dungeon() == true then
			pc.set_warp_location(backk[1], backk[2],backk[3])
			if d.getf("party_leader_pid") != party.get_leader_pid() then
				chat("#debug flame# leader_pid -> "..d.getf("party_leader_pid").." "..party.get_leader_pid().."")
				chat("Outside, your Group is not on this Dungeon")
				d.exit()
				return
			end
			if pc.get_level() < set.need_level_group and party.is_party() and not party.is_leader() then
				d.exit()
			end
			-- if d.getf("check_items") == 0 then
			-- d.setf("check_items",1)
			-- d.set_item_group ("need_items", 1, set.need_items, set.need_itemsc)
			-- d.exit_all_by_item_group ("need_items")
			-- d.delete_item_in_item_group_from_all ("need_items")
			-- end 
			if pc.getqf("can_enter") == 1 then
				return
			elseif pc.count_item(set.need_items) >= set.need_itemsc and pc.getqf("can_enter") == 0 then
				local h = set.wait_duration_user + get_global_time()
				pc.setqf("duration",h)
				pc.remove_item(set.need_items,set.need_itemsc)
				pc.setqf("can_enter",1)
			else
				pc.setqf("can_enter",0)
				d.exit()
			end
			pc.setqf("can_rejoin",0)
			chat("Ihr habt 60 Minuten zeit für den Run!")
			-- local new_item_need_count = pc.count_item(set.need_items)
			-- chat("#debug item check "..new_item_need_count -1 .." "..new_item_need_count.."")
			-- if (old_item_need_count -1) == (new_item_need_count) then
			-- pc.setqf("can_enter",1)
			-- end
		end
	end
	function make_dungeon()
		local set = flame_dungeon.get_settings()
		local cord = set.base_cord
		local start_pos = set.start_position
		d.new_jump_party(set.map_index,(cord[1] + start_pos[1]), (cord[2] + start_pos[2]))
		flame_dungeon.clear_alls()
		for i = 65, 70, 1 do
			d.setf("random_zone_"..i.."",i)		
		end
		flame_dungeon.respawn_main_npc()
		server_timer("time_",60*15,d.get_map_index())
		party.setf("flame_dungeon_map_index",d.get_map_index())
		d.setf("party_leader_pid",party.get_leader_pid())
		d.setf("status",1)
	end
	when time_.server_timer begin
		if d.select(get_server_timer_arg()) then
			d.notice("Verleib. Zeit: 45 Minuten.")
			server_timer("time_1",60*15,d.get_map_index())
		end
	end
	
	when time_1.server_timer begin
		if d.select(get_server_timer_arg()) then
			d.notice("Verleib. Zeit: 30 Minuten.")
			server_timer("time_2",60*15,d.get_map_index())
		end
	end
	when time_2.server_timer begin
		if d.select(get_server_timer_arg()) then
			d.notice("Verleib. Zeit: 15 Minuten.")
			server_timer("time_3",60*10,d.get_map_index())
		end
	end
	when time_3.server_timer begin
		if d.select(get_server_timer_arg()) then
			d.notice("Verleib. Zeit: 5 Minuten. Nach 5 Minunten, werden alle hinausteleportiert.")
			server_timer("time_4",60*4,d.get_map_index())
		end
	end
	when time_3.server_timer begin
		if d.select(get_server_timer_arg()) then
			d.notice("Verleib. Zeit: 1 Minuten. Nach 1 Minunte, werden alle hinausteleportiert.")
			server_timer("time_5",60*1,d.get_map_index())
		end
	end
	
	when time_5.server_timer begin
		if d.select(get_server_timer_arg()) then
			d.notice("Zeit ist abgelaufen. Alle werden hinausteleportiert in 10 Sekunden.")
			server_timer("time_exit_all",10,d.get_map_index())
		end
	end
	when time_exit_all.server_timer begin
		if d.select(get_server_timer_arg()) then
		flame_dungeon.clear_alls()
		d.exit_all()
		end
	end
		
	function respawn_main_npc()
		local set = flame_dungeon.get_settings()
		local o = set.doors_zone_new
		for i = 1, table.getn(o), 1 do
			d.setf("have_zone_"..o[i][1].."",0)
			d.setf("have_zonei_"..o[i][1].."",0)
			--chat("-> "..d.getf ("have_zone_"..o[i][1].."").."")
		end
		d.clear_regen()
		d.kill_all()
		--d.purge() --Stürzt Core ab -,-
		d.regen_file("data/dungeon/flame_dungeon/main_npc.txt")
		flame_dungeon.create_doors()
	end
	function give_names_notice()
		local set = flame_dungeon.get_settings()
		local group_pid_name = LIB_SQL_get_player_name_by_id(d.getf("party_leader_pid"))
		notice_all("Die Gruppe von "..group_pid_name.." haben "..mob_name(set.boss_vnum).." besiegt.")
	end
	function create_doors()
		local fr_a = flame_dungeon.get_settings()	
		--local lib_name = "zone_"..d.get_map_index().."_"
		local x = "Area_zones"..d.get_map_index() 
		local t = {}
		for i = 65, 70, 1 do
			local v = d.getf("random_zone_"..i.."")
			if v >= 1 then
			table.insert(t,table.getn(t) +1, string.char(v))
			end
		end
		
		--local t = LIB_table_get(x)
		if table.getn(t) == 0 then
			return
		end
		for i = 1, table.getn(t), 1 do
			--chat("Door "..t[i].."")
			local o = fr_a.doors_zone_new
			local ioo = fr_a.idoors_zone_new
			for x = 1, table.getn(o), 1 do
				--chat("get zone -> "..t[i].." "..LIB_variable_get(lib_name..t[i].."_enabled").."")
				--if tonumber(LIB_variable_get(lib_name..t[i].."_enabled")) == tonumber(0) then
					--chat("have_zone_ -> "..t[i].." == "..o[x][1].."")
					if t[i] == o[x][1] then 
						--d.notice("have_zone_ -> "..o[x][1].." == "..d.getf("have_zone_"..o[x][1].."").."")
						if d.getf("have_zone_"..o[x][1].."") == 0 then
							--say("outdoor: "..o[x][1].." "..o[x][2].." "..o[x][3].." "..o[x][4].."")
							d.set_unique("zone_"..o[x][1].."", d.spawn_mob_dir(fr_a.doors_vnum, o[x][2],o[x][3],o[x][4]))
							d.setf("have_zone_"..o[x][1].."",1)
						end
					end
					if t[i] == ioo[x][1] then
						--d.notice("have_zonei_ -> "..ioo[x][1].." == "..d.getf("have_zonei_"..ioo[x][1].."").."")
						if d.getf("have_zonei_"..ioo[x][1].."") == 0 then
							--say("indor: "..ioo[x][1].." "..ioo[x][2].." "..ioo[x][3].." "..ioo[x][4].."")
							d.set_unique("zonei_"..ioo[x][1].."", d.spawn_mob_dir(fr_a.indoors_vnum, ioo[x][2],ioo[x][3],ioo[x][4]))
							d.setf("have_zonei_"..ioo[x][1].."",1)
						end
					end
				--end
			end
		end
	end
	
	function get_random_zone_mission_rov()
		local set = flame_dungeon.get_settings()
		--local lib_name = "zone_"..d.get_map_index().."_"
		--local x = "Area_zones"..d.get_map_index() 
		--local t = LIB_table_get(x)
		local t = {}
		for i = 65, 70, 1 do
			local v = d.getf("random_zone_"..i.."")
			if v >= 1 then
			table.insert(t,table.getn(t) +1, string.char(v))
			end
		end
		
		if table.getn(t) == 0 then
			return
		end
		d.setf("missi_finish",1)
		local w = t[number(1,table.getn(t))]
		local rechar = string.byte(w)
		--LIB_table_remove(x,w)
		--d.notice("Rechar: "..rechar.."")
		d.setf("random_zone_"..rechar.."",0)
		if w == "A" then
			d.setf("status",d.getf("status") +1)
			d.setf("level",2)
			--d.notice("#debug# Aufgabe A: -> "..w.."")
			d.regen_file("data/dungeon/flame_dungeon/zone_a.txt")
			d.purge_unique("zonei_"..w.."")
			d.purge_unique("zone_"..w.."")
			--d.setf("zone_"..w.."_enabled",1)
			--LIB_variable_add(lib_name..w.."_enabled",1)
			d.notice("Aufgabe: Tötet alle Monster.")
			--kill all the monsters
		elseif w == "B" then
			d.setf("status",d.getf("status") +1)
			d.setf("level",3)
			--d.notice("#debug# Aufgabe B: -> "..w.."")
			d.set_regen_file("data/dungeon/flame_dungeon/zone_b.txt")
			d.purge_unique("zonei_"..w.."")
			d.purge_unique("zone_"..w.."")
			d.setf("stone_count", 0)
			d.setf("kill_count",0)
			--d.setf("zone_"..w.."_enabled",1)
			--LIB_variable_add(lib_name..w.."_enabled",1)
			d.spawn_mob_dir(set.level2_vnum, set.level2_kords[1],set.level2_kords[2],set.level2_kords[3])
			d.notice("Aufgabe: Finde das Goldene "..item_name(set.zone_b_vnum_drop).." und verwendet es,")
			d.notice("um den verborgenen Mechanismus in der "..mob_name(20386).." auszulösen.")
			--Find the Golden Cog Wheel and use it to trigger the hidden mechanism in the isfet stele
		elseif w == "C" then
			d.setf("status",d.getf("status") +1)
			d.setf("level",4)
			--d.notice("#dbug# Aufgabe C: -> "..w.."")
			d.regen_file("data/dungeon/flame_dungeon/zone_c.txt")
			d.purge_unique("zonei_"..w.."")
			d.purge_unique("zone_"..w.."")
			--d.setf("zone_"..w.."_enabled",1)
			--LIB_variable_add(lib_name..w.."_enabled",1)
			d.notice("Aufgabe: Dringt tief ein und vernichtet alle Monster.")
			
		elseif w == "D" then
			d.setf("status",d.getf("status") +1)
			d.setf("level",5)
			--d.notice("#debug# Aufgabe D: -> "..w.."")
			d.set_regen_file("data/dungeon/flame_dungeon/zone_d.txt")
			d.purge_unique("zonei_"..w.."")
			d.purge_unique("zone_"..w.."")
			--d.setf("zone_"..w.."_enabled",1)
			--LIB_variable_add(lib_name..w.."_enabled",1)
			d.setf("spawn_right_mob",0)
			d.notice("Aufgabe: besiegt "..mob_name(6009)..", den Hüter des Feuers.")
			--defeat the Ignitor, Guardin of the Fire
		elseif w == "E" then
			d.setf("status",d.getf("status") +1)
			d.setf("level",6)
			--d.notice("#debug# Aufgabe E: -> "..w.."")
			d.set_regen_file("data/dungeon/flame_dungeon/zone_e.txt")
			d.purge_unique("zonei_"..w.."")
			d.purge_unique("zone_"..w.."")
			local t = set.kords
			d.setf("kill_count",0)
			d.setf("key_count",0)
			--d.setf("zone_"..w.."_enabled",1)
			--LIB_variable_add(lib_name..w.."_enabled",1)
			d.setf("stone_count", table.getn(t))
			for i = 1, table.getn(t), 1 do
				--say(""..t[i][1].." "..t[i][2].."")
				d.spawn_mob_dir(set.level6_vnum, t[i][1],t[i][2],1)
			end
			d.notice("Sucht den "..item_name(set.zone_e_vnum_drop).." und legt sie auf den die "..table.getn(t).." "..mob_name(20386).." in der richtigen ordnung,")
			d.notice("wer den "..item_name(set.zone_e_vnum_drop).." in den falschen "..mob_name(20386).." legt, wird dieser zerbrechen.")
			--Search of the Maat Stone and place them on the seven isfet stelen in the corect order. if you use the Mat stone on the incorrect stele, it will break
			
		elseif w == "F" then
			d.setf("status",d.getf("status") +1)
			d.setf("level",7)
			--d.notice("#debug# Aufgabe F: -> "..w.."")
			d.set_regen_file("data/dungeon/flame_dungeon/zone_f.txt")
			d.purge_unique("zonei_"..w.."")
			d.purge_unique("zone_"..w.."")
			--d.setf("zone_"..w.."_enabled",1)
			--LIB_variable_add(lib_name..w.."_enabled",1)
			d.notice("Aufgabe: Nur diejenigen die im Stande sind das Fegefeuer des Metins zu vereiteln, werden hier bestehen.")
			--Only those who shy not from the singing heat will be able to defeat the purgatory Fire Metin
			d.spawn_mob_dir(set.metinstone_vnum, set.metinstone_pos[1],set.metinstone_pos[2],1)
		
		end
		
	end
	function get_finish_mission_check()
		local set = flame_dungeon.get_settings()
		local l = d.getf("level")
		local missi = d.getf("missi_finish")
		--say("level -> "..l.."")
		--say("missi -> "..missi.."")
		if l == 2 then -- Zone A 
			--say_reward("zone a")
			--say("count_monster -> "..d.count_monster().."")
			if missi == 1 and d.count_monster() == 0 then
				flame_dungeon.respawn_main_npc()
			--	d.notice("Es wurden alle Monster zerstört.")
			--	d.notice("Ein neues Siegel wird gebrochen.")
				flame_dungeon.get_random_zone_mission_rov()
			end
		
		elseif l == 3 then -- Zone B
			--say_reward("Zone b")
			if missi == 2 then
				flame_dungeon.respawn_main_npc()
			--	d.notice("Diese Aufgabe habt ihr auch erfolgreich gemeistert")
			--	d.notice("Ein weitere Siegel wird gebrochen.")
				flame_dungeon.get_random_zone_mission_rov()
			end
		
		elseif l == 4 then -- Zone C
			--say_reward("Zone c")
			--say("count_monster -> "..d.count_monster().."")
			if missi == 1 and d.count_monster() == 0 then
				flame_dungeon.respawn_main_npc()
			--	d.notice("Es wurden alle Monster zerstört.")
			--	d.notice("Ein neues Siegel wird gebrochen.")
				flame_dungeon.get_random_zone_mission_rov()
			end
		
		elseif l == 5 then -- Zone D
			--say_reward("Zone d")
			if missi == 3 then
				flame_dungeon.respawn_main_npc()
			--	d.notice("Sehr gut. Ihr habt den richtige Boss getötet?")
				flame_dungeon.get_random_zone_mission_rov()
			end
			
		
		elseif l == 6 then -- Zone E
			--say_reward("Zone e")
			if missi == 4 then
				flame_dungeon.respawn_main_npc()
			--	d.notice("Ihr habt alle Siegel zerstört.")
				flame_dungeon.get_random_zone_mission_rov()
			end
		
		
		elseif l == 7 then -- Zone F
			--say_reward("Zone f")
			if missi == 5 then
				flame_dungeon.respawn_main_npc()
			--	d.notice("Ihr habt den Metinstein zerstört.")
				flame_dungeon.get_random_zone_mission_rov()
				
			end
			set_skin(NOWINDOW)

		end
	end

	when 20385.click  begin
		if flame_dungeon.is_flame_dungeon() == true then
			--say("#debug# status -> "..d.getf("status").."")
			--local x = "Area_zones"..d.get_map_index() 
			--local t = LIB_table_get(x)
			local t = {}
			for i = 65, 70, 1 do
				local v = d.getf("random_zone_"..i.."")
				if v >= 1 then
				table.insert(t,table.getn(t) +1, string.char(v))
				end
			end
			if table.getn(t) == 0 and d.getf("status") >= 6 then
			d.setf("level",8)
			say_npc()
			say("")
			say("Ihr habt alle aufgaben beendet")
			say("Seit ihr bereit für den Bossraum?")
			say("")
			if select("Ja, sind wir","Nein") == 1 then
				if d.getf("level") == 8 then --Bugusing check!
					d.setf("level",9)
					d.setf("status",0)
					local set = flame_dungeon.get_settings()
					local w = set.bossroom_entry_pos
					local b = set.boss_pos
					
					d.jump_all(w[1],w[2])
					flame_dungeon.respawn_main_npc()
					d.spawn_mob_dir(set.boss_vnum, b[1] + number(1,2) ,b[2],1 - number(1,2))
					d.regen_file("data/dungeon/flame_dungeon/zone_boss.txt")
					return
				end
			else
				return
			end
		end
		if d.getf("missi_finish") == 0 then
			flame_dungeon.get_random_zone_mission_rov()
		else
			flame_dungeon.get_finish_mission_check()
		end
		end
	end
	when kill begin
		if flame_dungeon.is_flame_dungeon() == true then 
			local set = flame_dungeon.get_settings()
			if d.getf("level") == 3 then --Zone B
				local pct = number(1,100)
				if npc.get_race() == 6003 then
					local c = d.getf("kill_count") +1
					d.setf("kill_count",c)
					if c >= 25 then	
						pct = 1
						d.setf("kill_count",0)
					end	
				end
				if pct == 1 then	
					game.drop_item(set.zone_b_vnum_drop,1)	
				end
			elseif d.getf("level") == 5 then --Zone D
				local pct = number(1,25)
				local race = npc.get_race()
				local c = d.getf("kill_count") +1
				d.setf("kill_count",c)
				if race == set.zone_d_lvl5_vnumf then
					if c >= 10 then	
						pct = 1
					end
					if pct == 1 and d.getf("spawn_right_mob") == 0 then
						--d.notice("Spawn right mob")
						d.setf("spawn_right_mob",1)
						local p = set.zone_d_lvl6_vnumr_pos
						chat("")
						d.spawn_mob_dir(set.zone_d_lvl6_vnumr, p[1],p[2],1)
					end
				elseif race == set.zone_d_lvl6_vnumr then
					flame_dungeon.respawn_main_npc()
					d.setf("missi_finish",3)
				end
			elseif d.getf("level") == 6 then --Zone E
				local pct = number(1,100)
				if pct <= 5 then	
					game.drop_item(set.zone_e_vnum_drop,1)	
				end
				if npc.get_race() == 6002 then
					local c = d.getf("kill_count") +1
					d.setf("kill_count",c)
					if c >= 15 then	
						game.drop_item(set.zone_e_vnum_drop,1)	
						d.setf("kill_count",0)
					end
				end
			elseif d.getf("level") == 7 then --Zone F
				if npc.get_race() == set.metinstone_vnum then
					flame_dungeon.respawn_main_npc()
					d.setf("missi_finish",5)
				end
			elseif d.getf("level") == 9 then --Boss Zone
				
				if npc.get_race() == set.boss_vnum then
					flame_dungeon.give_names_notice()
					d.notice("Alle werden in 1 Minute hinausteleportiert.")
					d.setf("party_leader_pid",0)
					party.setf("flame_dungeon_map_index",0)
					flame_dungeon.respawn_main_npc()
					server_timer("time_exit_all",60,d.get_map_index())
					
				end
			end
			
		end
	end
	
	when 20386.take begin
		local vnum = item.get_vnum()
		local set = flame_dungeon.get_settings()
		if vnum == set.zone_b_vnum_drop and d.getf("level") == 3 then --Zone B
			local pct = number(1,20)
			local c = d.getf("stone_count") +1
			d.setf("stone_count",c)
			if c >= 8 then
				pct = 1
			end
			if pct == 1 then
				item.remove()
				flame_dungeon.respawn_main_npc()
				d.setf("missi_finish",2)
				npc.purge()
			else
				syschat("Das ist das falsche "..item_name(set.zone_b_vnum_drop)..".")
				item.remove()
			end
		elseif vnum == set.zone_e_vnum_drop and d.getf("level") == 6 then --Zone E
			local k = d.getf("key_count") +1
			d.setf("key_count",k)
			local r_flame_dungeon = number(1,5)
			if k >= 7 then
				r_flame_dungeon = 1
			end
			if r_flame_dungeon == 1 then
				npc.purge()
				local c = d.getf("stone_count") -1
				d.setf("stone_count",c)
				if c <= 0 then
					flame_dungeon.respawn_main_npc()
					--d.notice("Das war der letzte")
					item.remove()
					d.setf("missi_finish",4)
				else
					--syschat("Das war der richtige. Ihr müsst noch weitere ".. c .." zerstören")
					item.remove()
					d.setf("key_count",0)
				end
			else
				syschat("Der "..item_name(set.zone_e_vnum_drop).." ist zerbrochen.")
				item.remove()
				
			end
		end
	end
end
end

./qc flame_dungeon.lua and i get :

QUEST : flame_dungeon
STATE : start
FUNCTION get_settings()
FUNCTION is_flame_dungeon()
FUNCTION clear_alls()
WHEN  : 20394.chat ("GM: Flame_Dungeon duration")
        with pc . is_gm ( )
WHEN  : 9010.chat ("GM: Flame_Dungeon -> Exit all now")
        with pc . is_gm ( )
WHEN  : 20394.chat ("Deiner Gruppe wieder beitreten")
        with ( party . is_party ( ) and party . getf ( "flame_dungeon_map_index" ) >= 1 )
WHEN  : 20394.chat ("Flamen Dungeon betreten")
WHEN  : logout
WHEN  : login
FUNCTION make_dungeon()
WHEN  : time_.server_timer
WHEN  : time_1.server_timer
WHEN  : time_2.server_timer
WHEN  : time_3.server_timer
WHEN  : time_3.server_timer
WHEN  : time_5.server_timer
WHEN  : time_exit_all.server_timer
FUNCTION respawn_main_npc()
FUNCTION give_names_notice()
FUNCTION create_doors()
FUNCTION get_random_zone_mission_rov()
FUNCTION get_finish_mission_check()
WHEN  : 20385.click
WHEN  : kill
WHEN  : 20386.take
Calls undeclared function! :
LIB_SQL_get_player_name_by_id
LIB_duration
say_npc
set_skin
string.byte
string.char
Abort (core dumped)

I know i need some new functions or something. Can some one give them to me? Big thanks :wub:

Link to comment
Share on other sites

  • Replies 9
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 months later...

Hi, i add 

 

LIB_SQL_get_player_name_by_id
LIB_duration
say_npc
set_skin
string.byte
string.char
 
and when i do ./qc i get this error:
 
WHEN  : 20385.click
WHEN  : kill
WHEN  : 20386.take
Calls undeclared function! :
flame_dungeon.clear_alls
flame_dungeon.create_doors
flame_dungeon.get_finish_mission_check
flame_dungeon.get_random_zone_mission_rov
flame_dungeon.get_settings
flame_dungeon.give_names_notice
flame_dungeon.is_flame_dungeon
flame_dungeon.make_dungeon
flame_dungeon.respawn_main_npc
Abort (core dumped)
 
anyone can help please?

 

 

Note: i fixed the core dumped adding to quest_functions

 

flame_dungeon.clear_alls
flame_dungeon.create_doors
flame_dungeon.get_finish_mission_check
flame_dungeon.get_random_zone_mission_rov
flame_dungeon.get_settings
flame_dungeon.give_names_notice
flame_dungeon.is_flame_dungeon
flame_dungeon.make_dungeon
flame_dungeon.respawn_main_npc
 
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 24

      Experimental Renderer

    2. 11

      Multi Language System

    3. 0

      [FREE DESIGN] Interface + Logo + Discord Banner and Avatar

    4. 4

      Feeding game source to LLM

    5. 0

      Quest 6/7 Problem

    6. 5

      Effect weapons

    7. 0

      [C++] Fix Core Downer Using Negative Number in GM Codes

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.