Jump to content

Help Doungeon quest TIMER / ...


Recommended Posts

Hi. After a period in which I cleaned up the server and put in two months of work, I reached dungeons. For the dragon's dungeon, none of my files worked.

I downloaded a simple file from the internet which I modified and it's working perfectly.

1) I want to add a TIME for when the dungeon should end and I don't know how to do that.

2) I want to have a waiting time after the dungeon is finished.

3) I want it to be possible to enter both as a group and solo.

Here is my file. Thank you and much respect. 🙂

quest orktal_dungeon begin
	state start begin
		when 20090.chat."Dungeon RUN" with pc.get_map_index() == 73 begin
			if pc.get_level() < 75 then -- Daca jucatorul este sub nivel 15
				say_title("DR:")--Text cu nume NPC
				say("[ENTER]Nivelul tau este prea scazut")-- Text cu paragraf
			elseif pc.get_level() > 150 then--Daca jucatorul este peste nivel 75
				say_title("DR:")--Text cu nume NPC
				say("[ENTER]Nivelul tau este prea mare")-- Text cu paragraf
			else-- Daca jucatorul are inter lv 15 si lv 75 ( alles andere )
				d.new_jump(150, 843500, 1066800)-- Teleport pe harta ( Dungeon Map )
			end
		end

--[STAGE 1] Inceput
		when login or enter with orktal_dungeon.isInDungeon(150) begin-- Când jucatorul se conecteaza ?i se afla pe indexul har?ii temni?ei
			d.set_warp_location(73, 2418, 12750)--Se seteaza locatia
			d.regen_file("data/dungeon/dragon_lair/metins.txt")--Regenfile [STAGE 1]
			d.notice("Distruge toate pietrele de metin.")-- Text
			d.setf("orktal_stage01", 1)--Setul de nivel 1 pentru interogare
			d.setf("monster_counter01", 4)--Contor setat cu valoarea 3
		end

		when 8031.kill or 8032.kill or 8033.kill or 8034.kill with d.getf("orktal_stage01") == 1 begin-- Declan?atorul de ucidere a fost interogat cu semnalizarea misiunii
			local count = d.getf("monster_counter01") -1-- Variabila setata sa numere ?i scazând -1 din a treia
			d.setf("monster_counter01", count)-- Questflag pentru numarare pe misiune
			if count >= 1 then-- Întreba?i daca valoarea numarului este mai mare decât 1
				d.notice("Ramas: "..count.."")-- Ie?ire text calculata cu valoarea curenta -1
			elseif count == 0 then-- este contorul 0
				d.notice("Sarcina 1 finalizata.")-- Ie?ire ca a?i finalizat nivelul
				d.setf("orktal_stage02", 1)--Indicatorul de cautare nivelul 2 setat pentru interogare
				d.setf("monster_counter02", 1)--Contor setat cu valoarea 100
				d.regen_file("data/dungeon/dragon_lair/boss.txt")--Regenfile [STAGE 2]
			end
		end
--[STAGE 1] Sfarsit


-- [STAGE 2] Inceput
		when 2493.kill with d.getf("orktal_stage02") == 1 begin
			local count = d.getf("orktal_stage02") -1
			d.setf("monster_counter02", count)
			if count >= 1 then
				d.notice("Ramas: "..count.."")
			elseif count == 0 then
				d.notice("Sarcina 2 finalizata.")
				server_timer("orkdungeon_exit", 20 , d.get_map_index())--Cateva secunde pentru iesire
			end
		end
--[STAGE 2] Sfarsit


-- Începe Temnita Rush Teleport
		when orkdungeon_exit.server_timer begin
			if d.select(get_server_timer_arg()) then
				orktal_dungeon.clearDungeon()
				d.exit_all()
			end
		end
-- Temnita Rush Teleport se termina

-- Verificare de securitate la deconectare
		when logout begin
			if orktal_dungeon.isInDungeon() then
				orktal_dungeon.clearDungeon()
			end
		end
-- Sfâr?itul verificarii de securitate

	end--State start





-- FUNCTIONS BEGIN
	state __FUNCTIONS__ begin
		function isInDungeon(idx)
			return pc.get_map_index() >= (idx * 10000) and pc.get_map_index() < ((idx+1) * 10000)-- Calculul indexului har?ii pentru interogarea de securitate
		end
		function clearDungeon()
			d.setf("orktal_stage01", 0)
			d.setf("orktal_stage02", 0)
			d.kill_all()
			d.clear_regen()
			d.clear_regen()
			clear_server_timer("orkdungeon_exit", get_server_timer_arg())
		end
	end
-- FUNCTIONS END

end--Quest

 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Update. I make a timer with chatgpt xD and is working. And i change some..

I still have to do:

A) I want to have a waiting time after the dungeon is finished. (Cooldown)

B) I want it to be possible to enter both as a group and solo.

Thank you and much respect.

quest DragonLair_dungeon begin
	state start begin
		when 20090.chat."Dungeon RUN" with pc.get_map_index() == 73 begin
			if pc.get_level() < 75 then -- Daca jucatorul este sub nivel 15
				say_title("DR:")--Text cu nume NPC
				say("[ENTER]Nivelul tau este prea scazut")-- Text cu paragraf
			elseif pc.get_level() > 150 then--Daca jucatorul este peste nivel 75
				say_title("DR:")--Text cu nume NPC
				say("[ENTER]Nivelul tau este prea mare")-- Text cu paragraf
			else-- Daca jucatorul are inter lv 15 si lv 75 ( alles andere )
				d.new_jump(150, 843500, 1066800)-- Teleport pe harta ( Dungeon Map )
				server_timer("timelimit_dungeon_exit", 60, d.get_map_index()) -- Seteaza un timer de 1 minut pentru a termina temnita
				
			end
		end

--[STAGE 1] Inceput
		when login or enter with DragonLair_dungeon.isInDungeon(150) begin-- Când jucatorul se conecteaza ?i se afla pe indexul har?ii temni?ei
			d.set_warp_location(73, 2418, 12750)--Se seteaza locatia
			d.regen_file("data/dungeon/dragon_lair/metins.txt")--Regenfile [STAGE 1]
			d.notice("Distruge toate pietrele de metin.")-- Text
			d.setf("DragonLair_stage01", 1)--Setul de nivel 1 pentru interogare
			d.setf("kill_counter01", 4)--Contor setat cu valoarea 3
		end

		when 8031.kill or 8032.kill or 8033.kill or 8034.kill with d.getf("DragonLair_stage01") == 1 begin-- Declan?atorul de ucidere a fost interogat cu semnalizarea misiunii
			local count = d.getf("kill_counter01") -1-- Variabila setata sa numere ?i scazând -1 din a treia
			d.setf("kill_counter01", count)-- Questflag pentru numarare pe misiune
			if count >= 1 then-- Întreba?i daca valoarea numarului este mai mare decât 1
				d.notice("Ramas: "..count.."")-- Ie?ire text calculata cu valoarea curenta -1
			elseif count == 0 then-- este contorul 0
				d.notice("Sarcina 1 finalizata.")-- Ie?ire ca a?i finalizat nivelul
				d.setf("DragonLair_stage02", 1)--Indicatorul de cautare nivelul 2 setat pentru interogare
				d.setf("kill_counter02", 1)--Contor setat cu valoarea 100
				d.regen_file("data/dungeon/dragon_lair/boss.txt")--Regenfile [STAGE 2]
			end
		end
--[STAGE 1] Sfarsit

-- [STAGE 2] Inceput
		when 2493.kill with d.getf("DragonLair_stage02") == 1 begin
			local count = d.getf("DragonLair_stage02") -1
			d.setf("kill_counter02", count)
			if count >= 1 then
				d.notice("Ramas: "..count.."")
			elseif count == 0 then
				d.notice("Sarcina 2 finalizata.")
				server_timer("end_dungeon_exit", 20 , d.get_map_index())--Cateva secunde pentru iesire
			end
		end
--[STAGE 2] Sfarsit

-- Functie terminare limita de timp dungeon
		when timelimit_dungeon_exit.server_timer begin
			if d.select(get_server_timer_arg()) then
				DragonLair_dungeon.clearDungeon()
				d.exit_all()
			end
		end

-- Functie iesire terminare dungeon
		when end_dungeon_exit.server_timer begin
			if d.select(get_server_timer_arg()) then
				DragonLair_dungeon.clearDungeon()
				d.exit_all()
			end
		end

-- Verificare de securitate la deconectare
		when logout begin
			if DragonLair_dungeon.isInDungeon() then
				DragonLair_dungeon.clearDungeon()
			end
		end


	end

-- FUNCTIONS BEGIN
	state __FUNCTIONS__ begin
		function isInDungeon(idx)
			return pc.get_map_index() >= (idx * 10000) and pc.get_map_index() < ((idx+1) * 10000)-- Calculul indexului har?ii pentru interogarea de securitate
		end
		function clearDungeon()
			d.setf("DragonLair_stage01", 0)
			d.setf("DragonLair_stage02", 0)
			d.kill_all()
			d.clear_regen()
			d.clear_regen()
			clear_server_timer("end_dungeon_exit", get_server_timer_arg())
		end
	end
-- FUNCTIONS END

end--Quest

 

Edited by rawn3cr0
im a n00b at english
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



×
×
  • 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.