Jump to content

Relog In Dungeon


Recommended Posts

Dungeon.cpp:

We are looking for :

 

deadEvent = event_create (dungeon_dead_event, info, PASSES_PER_SEC (10));

 

PASSES_PER_SEC (10)); // 10 seconds
PASSES_PER_SEC (300)); // 5 minutes


Will be like:

 

deadEvent = event_create (dungeon_dead_event, info, PASSES_PER_SEC (300));


The session will be destroyed in 5 minutes.

Into quest from the respective dungeon you have to save logout and login, you can use questFlag.

  • Love 8
Link to comment
Share on other sites

  • Premium

Quest part:

function GetPartyMapIndex()
  	return party.getf("dungeon_index");
end -- function

function HasDungeon()
	return d.find(quest.GetPartyMapIndex());
end -- function

function GetPartyFloor()
  	return d.getf_from_map_index("floor", quest.GetPartyMapIndex());
end -- function

function IsSameLeaderDungeon()
	return d.getf_from_map_index("party_leader_pid", quest.GetPartyMapIndex()) == party.get_leader_pid();
end -- function

when NPC.chat."I want to go back into the dungeon" with party.is_party() and quest.HasDungeon() and quest.IsSameLeaderDungeon() begin
	local floor = quest.GetPartyFloor();
	local spawn_coordinates = Dungeon.GetData()[floor];
	pc.warp(spawn_coordinates["x"] * 100, spawn_coordinates["y"] * 100, quest.GetPartyMapIndex());
	--[[
		my settings use coordinates based on floors and keys. Like this 

		function GetData()
			local array = {
				[1] = {["x"] = 19850, ["y"] = 98254}, -- Floor 1 spawn coordinates.
				[2] = {["x"] = 19850, ["y"] = 98254}, -- Floor 2 spawn coordinates.
				..etc.
			};

			return array;
		end -- function
	]]

end -- when

That's how I do in my quests, please refrain from C/Pasting without minimal Lua knowledge.

His code is useless, cpp part is not necessary. Because if a group is still inside the dungeon the instance doesn't get destroyed, thus you can go back.

 

Useful functions:

function SetPartyMapIndex(index)
  	party.setf("dungeon_index", index); -- Call quest.SetPartyMapIndex(d.get_map_index()) upon entering the dungeon with the party leader. (Doing it once is enough).
end -- function

function IncreaseFloor()
	d.setf("floor", d.getf("floor")+1); -- Call it everytime the group gets to a new floor of the dungeon.
end -- function

function SetLeaderPid()
	d.setf("party_leader_pid", party.get_leader_pid()); -- Call it upon entering the dungeon with the party leader.
end -- function

 

  • Love 6

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

vor 3 Stunden schrieb Syreldar:

Quest part:


function HasDungeon()
	return d.find(party.getf("dungeon_index"));
end -- function

function GetPartyMapIndex()
  	return party.getf("dungeon_index");
end -- function

function GetPartyFloor()
  	return d.getf_from_map_index("floor", quest.GetPartyMapIndex());
end -- function

function IsSameLeaderDungeon()
	return d.getf_from_map_index("party_leader_pid", quest.GetPartyMapIndex()) == party.get_leader_pid();
end -- function

when NPC.chat."I want to go back into the dungeon" with party.is_party() and quest.HasDungeon() and quest.IsSameLeaderDungeon() begin
	local floor = quest.GetPartyFloor();
	local spawn_coordinates = Dungeon.GetData()[floor];
	pc.warp(spawn_coordinates["x"] * 100, spawn_coordinates["y"] * 100, quest.GetPartyMapIndex());
	--[[
		my settings use coordinates based on floors and keys. Like this 

		function GetData()
			local array = {
				[1] = {["x"] = 19850, ["y"] = 98254}, -- Floor 1 spawn coordinates.
				[2] = {["x"] = 19850, ["y"] = 98254}, -- Floor 2 spawn coordinates.
				..etc.
			};

			return array;
		end -- function
	]]

end -- when

That's how I do in my quests, please refrain from C/Pasting without minimal Lua knowledge.

His code is useless, cpp part is not necessary. Because if a group is still inside the dungeon the instance doesn't get destroyed, thus you can go back.

 

Useful functions:


function SetPartyMapIndex(index)
  	party.setf("dungeon_index", index); -- Call quest.SetPartyMapIndex(d.get_map_index()) upon entering the dungeon with the party leader. (Doing it once is enough).
end -- function

function IncreaseFloor()
	d.setf("floor", d.getf("floor")+1); -- Call it everytime the group gets to a new floor of the dungeon.
end -- function

function SetLeaderPid()
	d.setf("party_leader_pid", party.get_leader_pid()); -- Call it upon entering the dungeon with the party leader.
end -- function

 

Thanks for the Release

Link to comment
Share on other sites

  • Premium
2 minutes ago, avertuss said:

@Syreldar

what if we have dungeon for player without party? 

Then his change is fine.

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

14 hours ago, hachiwari said:

Wtf? And after 300 seconds dungeon_dead_event will be executed even though you are logged in, because this he dont check if dunegon is empty..

So you would get kicked out every 10 seconds without this change?...

 

9 minutes ago, avertuss said:

@Syreldar

what if we have dungeon for player without party? 

Use questflag instead of partyflag when returning the dungeon index(store it whenever you login into the dungeon itself)

  • Love 1
Link to comment
Share on other sites

  • Bronze
8 minutes ago, Syreldar said:

Then his change is fine.

Your party functions to go back into the dungeon are completly fine while the dungeon is written properly using server timers and so on. Either way these functions are useless. We both know that and i bet most of all have dungeons based on "timer" and so on :) 

As long as I'll be a threat for you , i will always be your target :3

Link to comment
Share on other sites

  • Premium
Just now, Braxy said:

Your party functions to go back into the dungeon are completly fine while the dungeon is written properly using server timers and so on. Either way these functions are useless. We both know that and i bet most of all have dungeons based on "timer" and so on :) 

Uh no it has nothing to do with timers. If the instance is alive you can go back to it.

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • Bronze
16 minutes ago, Syreldar said:

Uh no it has nothing to do with timers. If the instance is alive you can go back to it.

Im not so sure about it. For example, the dungeon is in a timer phase that checks each 10 seconds whether all mobs are killed or not. Well that timer is not a server_timer, it is a timer that has been set to the leader of the group. If the specified player is discconected, he has the oportunity to get back in the instance but in the mean time the other players are stuck due to the timer that is active just on the Leader. This case scenario can happen also with a group player not just the leader, and he aint comming back for example, well this thing will ruin the run for good :) 

As long as I'll be a threat for you , i will always be your target :3

Link to comment
Share on other sites

You need edit jump to new jump.. or not "save" actually floor :) (where new jump -> here is saved floor)

If you have server timers + new jump  = Shutdown core with dungeon  (You need edit all server_timers and edit jump_all to new_jump_all) 
(Not good to use if you can't use it :) )

 

Result: You need to customize full tower quest for good functionality.

Link to comment
Share on other sites

  • Premium
10 hours ago, gummyantifi said:

You need edit jump to new jump.. or not "save" actually floor :) (where new jump -> here is saved floor)

If you have server timers + new jump  = Shutdown core with dungeon  (You need edit all server_timers and edit jump_all to new_jump_all) 
(Not good to use if you can't use it :) )

 

Result: You need to customize full tower quest for good functionality.

..no. What I did is totally fine to make players go back to their places, unless your server is trash.

  • Love 1

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

12 hours ago, gummyantifi said:

You need edit jump to new jump.. or not "save" actually floor :) (where new jump -> here is saved floor)

If you have server timers + new jump  = Shutdown core with dungeon  (You need edit all server_timers and edit jump_all to new_jump_all) 
(Not good to use if you can't use it :) )

 

Result: You need to customize full tower quest for good functionality.

this is the same method officials use I believe, no reason to think there will be inconsistencies(which in fact there won't)

Link to comment
Share on other sites

  • 1 year later...

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.