Jump to content

Dungeon quest


Lyn2

Recommended Posts

Boas noites. Eu duvido que alguém tenha disponibilidade para ajudar ou fazer um tut de como criar uma dungeon simples.

A minha dúvida é, eu quero fazer uma quest Dungeon num mapa pequenino. Exemplo , matar os 10 monstros e passar para a segunda ronda, matar x's monstros e passar para a terceira, no máximo 5 rondas. Tentei criar uma dungeon, já feita do NewAge, porém ele teleporta para o mapa, mas não faz mais nada. 

Mas se deixar ele padrão, ele vai para a torre, faz tudo direitinho. Mas a minha intenção é fazer uma dungeon noutro mapa e não na torre. 

quest lv_30_wo begin
	state start begin
		function  ()
            if pc.in_dungeon() and pc.get_map_index() >= 8907100 and pc.get_map_index() < 1167600 then
                return true
            else
                return false
            end            
        end
		
		when 20060.click begin
			local ilosc = 1
			local id_przep = 19
			
			say_title(mob_name(20060)..": ")
			say("Witaj "..pc.getname().."! ")
			say("")
			say("Aby dostaæ siê na dungeon musisz spe³niæ, ")
			say("moje wymagania ! ")
			say("Wymagania: ")
			say_green("- Musisz mieæ 30 Lv. + ")
			say_green("- Musisz mieæ "..item_name(id_przep).." "..ilosc.."x. ")
			say("")
			say_red("Czy chcia³ byœ wejœæ na Dungeon? ")
			say("")
			local s = select("Tak ", " Nie")
			if s == 1 then 
				if pc.count_item(id_przep) >= ilosc then 
					if pc.get_level() >= 10 then 
						pc.remove_item(id_przep, ilosc)
						pc.setqf("dungstart", 1)
						d.join(354)	
					else
						chat("|cFF00ff33[Informacja]|h|cFFFFFFFF|h Não tens nível suficiente. ")
					end
				else
					chat("|cFF00ff33[Informacja]|h|cFFFFFFFF|h Nie masz "..item_name(id_przep).." w Ekwipunku. ")
				end
			end
		end
		
		when login with lv_30_wo.inlv_30_wo() and pc.getqf("dungstart") == 1 begin
			d.notice("|cFFff6600[Wie¿a Orków]|h|cFFFFFFFF|h  Witaj w Wie¿y Orków. ")
			d.notice("|cFFff6600[Wie¿a Orków]|h|cFFFFFFFF|h  Aby dostaæ siê do przywódcy pokonaj potwory ! ")
			d.notice("|cFFff6600[Wie¿a Orków]|h|cFFFFFFFF|h  Na wyzwanie masz 30min. ")
			d.setf("lv_30_wo1", 0)
			d.setf("lv_30_wo2", 0)
			d.setf("lv_30_wo3", 0)
			d.regen_file("data/kamil/30/1.txt")
			pc.setqf("dungstart", 0)
			d.setf("level_wo", 1)
			timer('zabezpiecz_czas1', 5*60)
		end
		
		when 651.kill or 652.kill or 653.kill or 654.kill or 655.kill or 656.kill or 657.kill with lv_30_wo.inlv_30_wo() and d.getf("level_wo") == 1 begin
			d.setf("lv_30_wo1", d.getf("lv_30_wo1")+1)
			if d.getf("lv_30_wo1") >= 201 then
				d.kill_all()
				d.clear_regen()
				d.setf("level_wo", 2)
				d.notice("|cFFff6600[Wie¿a Orków]|h|cFFFFFFFF|h Brawo pokona³eœ orków ale to dopiero poczatek! ")
				timer("timer_lv_30_wo1", 5)
			end
		end
		
		when timer_lv_30_wo1.timer with lv_30_wo.inlv_30_wo() and d.getf("level_wo") == 2 begin
			d.spawn_mob(8008, 144, 638)
			d.spawn_mob(8008, 175, 640)
			d.spawn_mob(8008, 174, 666)
			d.spawn_mob(8008, 151, 670)
			d.setf("level_wo", 3)
			d.notice("|cFFff6600[Wie¿a Orków]|h|cFFFFFFFF|h Zniszcz Metiny Duszy ")
		end
		
		when 8008.kill with lv_30_wo.inlv_30_wo() and d.getf("level_wo") == 3 begin
			d.setf("lv_30_wo2", d.getf("lv_30_wo2")+1)
			if d.getf("lv_30_wo2") >= 4 then
				d.kill_all()
				d.setf("level_wo", 4)
				d.notice("|cFFff6600[Wie¿a Orków]|h|cFFFFFFFF|h Brawo pokona³eœ Metiny Duszy! ")
				timer("timer_lv_30_wo2", 5)
			end
		end
		
		when timer_lv_30_wo2.timer with lv_30_wo.inlv_30_wo() and d.getf("level_wo") == 4 begin
			d.regen_file("data/kamil/30/1.txt")
			d.setf("level_wo", 5)
			d.notice("|cFFff6600[Wie¿a Orków]|h|cFFFFFFFF|h Zabij wszystkie potwory. ")
		end
		
		when 651.kill or 652.kill or 653.kill or 654.kill or 655.kill or 656.kill or 657.kill with lv_30_wo.inlv_30_wo() and d.getf("level_wo") == 5 begin
			d.setf("lv_30_wo3", d.getf("lv_30_wo3")+1)
			if d.getf("lv_30_wo3") >= 201 then
				d.kill_all()
				d.clear_regen()
				d.setf("level_wo", 6)
				d.notice("|cFFff6600[Wie¿a Orków]|h|cFFFFFFFF|h Brawo pokona³eœ orków za 20sec. pojawi siê przywódca! ")
				timer("timer_lv_30_wo3", 20)
			end
		end
		
		when timer_lv_30_wo3.timer with lv_30_wo.inlv_30_wo() and d.getf("level_wo") == 6 begin
			d.spawn_mob(692, 144, 638)
			d.setf("level_wo", 7)
			d.notice("|cFFff6600[Wie¿a Orków]|h|cFFFFFFFF|h Pokonaj przywódcê! ")
		end

		when 692.kill with lv_30_wo.inlv_30_wo() and d.getf("level_wo") == 7 begin
			d.notice("|cFFff6600[Wie¿a Orków]|h|cFFFFFFFF|h Gratulacje uda³o wam siê! Zostaniecie wyteleportowani za 30 sec. ")
			timer('wyjscie', 30)
		end
		
		when wyjscie.timer with lv_30_wo.inlv_30_wo() and d.getf("level_wo") == 7 begin
			d.exit_all()
			d.notice("|cFFff6600[Wie¿a Orków]|h|cFFFFFFFF|h Nie uda³o siê, zostaniecie wylogowani!")
		end
		
		
		when zabezpiecz_czas1.timer with lv_30_wo.inlv_30_wo() and d.getf("level_wo") >= 1  begin
			d.notice("|cFFff6600[Wie¿a Orków]|h|cFFFFFFFF|h Pozosta³o 25 minut! ")
			timer('zabezpiecz_czas2', 5*60)
		end
		when zabezpiecz_czas2.timer with lv_30_wo.inlv_30_wo() and d.getf("level_wo") >= 1  begin
			d.notice("|cFFff6600[Wie¿a Orków]|h|cFFFFFFFF|h Pozosta³o 20 minut! ")
			timer('zabezpiecz_czas3', 5*60)
		end
		when zabezpiecz_czas3.timer with lv_30_wo.inlv_30_wo() and d.getf("level_wo") >= 1  begin
			d.notice("|cFFff6600[Wie¿a Orków]|h|cFFFFFFFF|h Pozosta³o 15 minut! ")
			timer('zabezpiecz_czas4', 5*60)
		end
		when zabezpiecz_czas4.timer with lv_30_wo.inlv_30_wo() and d.getf("level_wo") >= 1  begin
			d.notice("|cFFff6600[Wie¿a Orków]|h|cFFFFFFFF|h Pozosta³o 10 minut! ")
			timer('zabezpiecz_czas5', 5*60)
		end
		when zabezpiecz_czas5.timer with lv_30_wo.inlv_30_wo() and d.getf("level_wo") >= 1  begin
			d.notice("|cFFff6600[Wie¿a Orków]|h|cFFFFFFFF|h Pozosta³o 5 minut! ")
			timer('zabezpiecz_czas6', 5*60)
		end
		when zabezpiecz_czas6.timer with lv_30_wo.inlv_30_wo() begin
			d.exit_all()
			d.notice("|cFFff6600[Wie¿a Orków]|h|cFFFFFFFF|h Nie uda³o siê, zostaniecie wylogowani!")
		end
	end
end

 

Meti corretamente na pasta Data etc tudo direitinho, mudei as coordenadas e o Index e não faz mais nada. 

 

Acreditem que eu odeio pedir ajuda, mas desta vez tou nas aranhas mesmo :( 

Link to comment

Escrevi isto num instante. Se quiseres aprender a construir dungeons, esta é, a meu ver, uma base simples e facil de entender.

quest my_simple_dungeon begin
	state start begin

		function setting()
			return {
				["MAP_INDEX"] = 0,
				["ENTRY_POS"] = {0, 0},
				["FLOORS"] = {
					{0, 0}, -- 1
					{0, 0}, -- 2
					-- etc
				},
				["TASKS"] = {
					{101, 20},
					{102, 30},
					-- etc
				},
				-- etc
			}
		end

		function in_dungeon()
			local dunMapIdx = my_simple_dungeon.setting().MAP_INDEX
			return pc.get_map_index() >= dunMapIdx * 10000 and pc.get_map_index() < (dunMapIdx + 1) * 10000
		end

		function join()
			local setting = my_simple_dungeon.setting()

			if party.is_party() then
				d.new_jump_party(setting.MAP_INDEX, setting.ENTRY_POS[1], setting.ENTRY_POS[2])
			else
				d.join(setting.MAP_INDEX)
			end
		end

		when MY_DUNGEON_GUARDIAN.chat."Dungeon" begin
			say("Entrar?")

			if select("Y", "N") == 2 then
				return
			end

			my_simple_dungeon.join()
		end

		when login with my_simple_dungeon.in_dungeon() begin
			local setting = my_simple_dungeon.setting()

			if d.getf("level") == 0 then
			--	d.regen_file(".../regen_1.txt")
			--	d.spawn_mob(0, 0, 0) -- vnum, x, y
				d.notice("Mata "..setting.TASKS[1][2].." "..mob_name(setting.TASKS[1][1]))
				d.setf("level", 1)
			end

		end

		when kill with not npc.is_pc() and my_simple_dungeon.in_dungeon() begin
			local level = d.getf("level")
			local tasks = my_simple_dungeon.setting().TASKS

			if npc.get_race() ~= tasks[level][1] then
				return
			end

			local killCount = d.getf("kill_count") + 1

			if killCount < tasks[level][2] then
				d.setf("kill_count", killCount)
				return
			end

			d.notice("Nivel "..level.." completo. 5 segundos para subir.")
			d.setf("kill_count", 0)
			server_timer("my_simple_dungeon_jump_timer", 5, d.get_map_index())
		end

		when my_simple_dungeon_jump_timer.server_timer with d.select(get_server_timer_arg()) begin
			local setting = my_simple_dungeon.setting()
			local nextLevel = d.getf("level") + 1
			local task = setting.TASKS[nextLevel]

			d.setf("level", nextLevel)
			d.notice("Mata "..task[2].." "..mob_name(task[1]))
			-- d.regen_file(".../regen_"..nextLevel..".txt")
			-- d.spawn_mob(0, 0, 0) -- vnum, x, y
			d.jump_all(setting.FLOORS[nextLevel][1], setting.FLOORS[nextLevel][2])
		end

	end
end

 

Edited by PACI
Link to comment

Sorry por o doublepost.

 

Esqueces-te de meter no ultimo nível 

            d.setf("level", 2)

eu bem andava aqui as voltas e ele não fazia mais nada nem moobs apareciam, nem imaginas quantas horas tive a ver o que seria haha mas mesmo assim ja adicionei algumas funções como:

            d.kill_all()
            d.clear_regen()

Mas como disses-te, esta quest serve como base hehe abraço! 

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