Jump to content
  • 0
Sign in to follow this  
Cripplez

solved [Help] Join dungeon alone

Question

Hello, I'm trying to write a quest for a dungeon and I want that you can do it alone or with party.

 

		when npc.click begin etc etc
			if not party.is_party() then
					d.join (MAP_INDEX)
				return
				
			elseif not party.is_leader() then
				say ( "Only party leader can start dungeon" )
				return
			end
				
			d.new_jump_party (MAP_INDEX, 8437, 10666)
		end	

 

Is this the only way to do it? Or I could do something better?

with d.new_jump_party i can choose the index map and coords x y, but with d.join I can only select map index and it will teleport me at the town.txt of the map index.

Is there a way to select the coords for d.join too?

Share this post


Link to post

7 answers to this question

Recommended Posts

  • 1

Amm my bad, you actually have to multiply coordinates by 100... I modified source to avoid this so I thought it is like that originally. Your function should look like this:

d.new_jump (MAP_INDEX, 4411 * 100, 12282 * 100)

 

  • Love 1

Share this post


Link to post
  • 0
d.new_jump(map_index, (map_base_x + x_coordinate) * 100, (map_base_y + y_coordinate) * 100)

Map base coordinates without 00 at the end. 

  • Love 1

Share this post


Link to post
  • 0
17 hours ago, Heathcliff™ said:

You only need to put a starting coordinate into the Town.txt and then you can use d.join() function without coordinates if I'm right.

Yes this is what I'm doing now, but if i have a dungeon that i don't want to start at the coordinates of Town.txt i need another solution :(

17 hours ago, Sonitex said:

d.new_jump(map_index, map_base_x + x_coordinate, map_base_y + y_coordinate)

Map base coordinates without 00 at the end.

I tried this but didn't work, the syser from core says map index 0, I think because the quest makes the index * 10000 +1, so it is a temporary index and the command d.new_jump can't find it?

quest test_dungeon_1 begin
	state start begin
	
		function test_dungeon(arg)
			local setting = {
								["MAP_INDEX"] = 217, 
							}
			return rawget(setting, arg)
		end
		
		function test_dungeon_index(int1) 
			local DUNGEON_INDEX = test_dungeon_1.test_dungeon("MAP_INDEX")
			return int1 >= (DUNGEON_INDEX * 10000) and pc.in_dungeon() and int1 < (DUNGEON_INDEX + 1) * 10000
		end

 

Share this post


Link to post
  • 0
31 minutes ago, Cripplez said:

Yes this is what I'm doing now, but if i have a dungeon that i don't want to start at the coordinates of Town.txt i need another solution :(

I tried this but didn't work, the syser from core says map index 0, I think because the quest makes the index * 10000 +1, so it is a temporary index and the command d.new_jump can't find it?


quest test_dungeon_1 begin
	state start begin
	
		function test_dungeon(arg)
			local setting = {
								["MAP_INDEX"] = 217, 
							}
			return rawget(setting, arg)
		end
		
		function test_dungeon_index(int1) 
			local DUNGEON_INDEX = test_dungeon_1.test_dungeon("MAP_INDEX")
			return int1 >= (DUNGEON_INDEX * 10000) and pc.in_dungeon() and int1 < (DUNGEON_INDEX + 1) * 10000
		end

 

Post full quest 

Share this post


Link to post
  • 0
3 hours ago, Sonitex said:

Post full quest 

quest test_dungeon_floor begin
	state start begin
	
		--** FUNCTION - SETTINGS
		function test_dungeon(arg)
			local setting = {
								["MAP_INDEX"] = 216, 
								["LIMIT_TIME"] = 3, 
								["WAITING_TIME"] = 1,
								["LEVEL_PLAYER"] = 80,
								["BOSS_CHARON"] = 2597,
								["BOSS_AZRAEL"] = 2598,
								["BOSS_TARTAROS"] = 2591,
								["METIN"] = 8035,
								["key cristal"] = 30315,
								["totem"] = 30312,
								['item_map'] = 30322,
								['item_metin'] = 30321,
								['x'] = 3072, 
								['y'] = 12032,
							}
			return rawget(setting, arg)
		end
		
		function test_dungeon_index(int1) 
			local DUNGEON_INDEX = test_dungeon_floor.test_dungeon("MAP_INDEX")
			return int1 >= (DUNGEON_INDEX * 10000) and pc.in_dungeon() and int1 < (DUNGEON_INDEX + 1) * 10000
		end
		
		--** END FUNCTION 
		
		
		--** LOGIN / LOGOUT
		when login with test_dungeon_floor.test_dungeon_index(pc.get_map_index()) begin
			pc.set_warp_location (65, 5908, 1112)
			local CONTROL_LEVEL = test_dungeon_floor.test_dungeon("LEVEL_PLAYER")
			if d.getf ("test_load_regen") == 0 then
				d.set_regen_file("data/dungeon/test/floor_3_test.txt")
				d.setf ("test_load_regen", 1)
			elseif pc.get_level() < CONTROL_LEVEL then
				warp_to_village()
			end
			chat ( "chat chat" )
			chat ( "chat chat" )
			timer ("time_test_dungeon_floor", 30*60)
		end
		
		when logout with test_dungeon_floor.test_dungeon_index(pc.get_map_index()) begin
			local WAITING_TIME = test_dungeon_floor.test_dungeon("WAITING_TIME")
			pc.setqf ( "waiting_time_test_dungeon_floor", get_global_time() + (WAITING_TIME * 60))
		end
		--** END LOGIN / LOGOUT
		
		
		
		when 20351.chat."quest test" begin
			local RESULT_WAITING, PLAYER_LEVEL = math.floor ((pc.getqf ( "waiting_time_test_dungeon_floor" ) - get_global_time())/60), test_dungeon_floor.test_dungeon("LEVEL_PLAYER")
			say_title("quest test")
			if pc.get_level() < PLAYER_LEVEL then
				say("cant join, level too low")
				return
			end
			
			if pc.getqf ( "waiting_time_test_dungeon_floor" ) > get_global_time() then
				say ( "wait time, cant join again yet" )
				say_reward ( "time to wait: "..RESULT_WAITING.." minuti" )
				return
			end	
			
			if pc.count_item(test_dungeon_floor.test_dungeon('item_map')) == 0 then
				return
			end
			
				say("chat chat")
				say("chat chat")
				local s = select("yes, warp to map","No")
					if s == 2 then
				return
			end
				pc.warp(315500,1210200)
			end
		
		
		
			when 30101.take with item.get_vnum() == test_dungeon_floor.test_dungeon('key_cristal') and pc.get_map_index() == test_dungeon_floor.test_dungeon('MAP_INDEX') begin
				local ENTRY_KEY, PLAYER_LEVEL, LIMIT_TIME, MAP_INDEX  = test_dungeon_floor.test_dungeon("key_cristal"), test_dungeon_floor.test_dungeon("LEVEL_PLAYER"), test_dungeon_floor.test_dungeon("LIMIT_TIME"), test_dungeon_floor.test_dungeon("MAP_INDEX")
				say_title(mob_name(30101))
				say ( "chat" )
				wait()
				say_title ( "information" )
				say_reward ( "chat chat" )
				say_reward ( "chat chat" )
				if select ( "yes start dungeon", "No, not ready" ) == 2 then 
					return 
				end
				
				if not party.is_party() then
					--**pc.remove_item (ENTRY_KEY)
					d.join (MAP_INDEX)
					return
					
				elseif not party.is_leader() then
					return
				end
				
				--**pc.remove_item (ENTRY_KEY)
				d.new_jump_party (MAP_INDEX, 4411, 12282)
			end	
		--**END NPC Entrata Dungeon Azrael
		
		
		--** TIMER
		when time_test_dungeon_floor.timer with test_dungeon_floor.test_dungeon_index(pc.get_map_index()) begin
			d.exit_all()
		end
		--**END TIMER
		
		
		
		--** 3 Floor
		when 30322.use with test_dungeon_floor.test_dungeon_index(pc.get_map_index()) begin
			item.remove()
			timer("enter_floor_5", 3)
		end
		
		
		--** 5 Floor
		when enter_floor_5.timer with test_dungeon_floor.test_dungeon_index(pc.get_map_index()) begin
			d.jump_all(test_dungeon_floor.test_dungeon('x')+845, test_dungeon_floor.test_dungeon('y')+900)
			d.clear_regen()
			d.kill_all()
			d.regen_file("data/dungeon/test/floor_5_test.txt")
		end
		
		when 30102.take with item.get_vnum() == test_dungeon_floor.test_dungeon('totem') begin
			pc.remove_item(item.get_vnum(), 1)
			timer("enter_floor_6", 3)	
		end
		
		
		--** 6 Floor
		when enter_floor_6.timer with test_dungeon_floor.test_dungeon_index(pc.get_map_index()) begin
			d.jump_all(test_dungeon_floor.test_dungeon('x')+1300, test_dungeon_floor.test_dungeon('y')+700)
			d.clear_regen()
			d.kill_all()
			d.regen_file("data/dungeon/test/floor_6_test.txt")
		end	
		
		
		--** 7 Floor
		when enter_floor_7.timer with test_dungeon_floor.test_dungeon_index(pc.get_map_index()) begin
			d.jump_all(test_dungeon_floor.test_dungeon('x')+75, test_dungeon_floor.test_dungeon('y')+1155)
			d.clear_regen()
			d.kill_all()
			d.regen_file("data/dungeon/test/floor_7_test.txt")
		end
		
		
		
		--** KILL
		when kill with test_dungeon_floor.test_dungeon_index(pc.get_map_index()) begin
			local VNUM_CHARON, VNUM_AZRAEL, VNUM_TARTAROS, VNUM_METIN = test_dungeon_floor.test_dungeon("BOSS_CHARON"), test_dungeon_floor.test_dungeon("BOSS_AZRAEL"), test_dungeon_floor.test_dungeon("BOSS_TARTAROS"), test_dungeon_floor.test_dungeon("METIN")
			if npc.get_race() == VNUM_CHARON then
				timer("enter_floor_7", 5)
				
			elseif npc.get_race() ==  VNUM_AZRAEL then	
				d.kill_all()
				timer ( "test_dungeon_floor_exit", 30 )
				
			elseif npc.get_race() ==  VNUM_TARTAROS then	
				game.drop_item_with_ownership(test_dungeon_floor.test_dungeon('totem'), 1)

			elseif npc.get_race() ==  VNUM_METIN then	
				game.drop_item_with_ownership(test_dungeon_floor.test_dungeon('item_metin'), 1)
			end
		end
		--** END KILL
		when test_dungeon_floor_exit.timer begin
			d.exit_all()
		end	
	end
end

 

Share this post


Link to post
  • 0
13 minutes ago, Sonitex said:

Amm my bad, you actually have to multiply coordinates by 100... I modified source to avoid this so I thought it is like that originally. Your function should look like this:


d.new_jump (MAP_INDEX, 4411 * 100, 12282 * 100)

 

Thank you! It worked now :D

  • Love 1

Share this post


Link to post

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
Sign in to follow this  
  • Recently Browsing   0 members

    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.