• 0

# 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

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?

## Recommended Posts

• 1
• VIP

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)`

• 0

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.

• 0
• VIP
`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.

• 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```

• 0
• VIP
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

• 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

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")
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

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

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

• 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

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Restore formatting

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

1. 4

2. 46

3. 2

4. 4

5. 6

6. 46

7. 624

8. 3

9. 6