Jump to content

Empire and local towns check by c++


Go to solution Solved by Cunoo,

Recommended Posts

  • Active Member

Hello guys,

have someone some function which will check empire of player via server source when player login?

It must work like: If player is in Pyungmoo then it will check his empire and if player empire != Pyungmoo then it will warp player to his local town etc. It must check local towns with player empire. 

I need to have this function because when you change the empire via quest, player can disconnect his account in changing empire state by connecting to server again and then when he login he has empire changed but he will still in town of another empire.

Thanks for possible answers!

Sincerely,

ReFresh

Edited by ReFresh

I'll be always helpful! 👊 

Link to comment
Share on other sites

10 hours ago, ReFresh said:

Hello guys,

have someone some function which will check empire of player via server source when player login?

It must work like: If player is in Pyungmoo then it will check his empire and if player empire != Pyungmoo then it will warp player to his local town etc. It must check local towns with player empire. 

I need to have this function because when you change the empire via quest, player can disconnect his account in changing empire state by connecting to server again and then when he login he has empire changed but he will still in town of another empire.

Thanks for possible answers!

Sincerely,

ReFresh

I don't have source check, but I think you can do it with quest specifically in empire change quest with simple check.. I think could be do at least 2+ variant.. Simple variant is add automatic warp in your new empire.. I think you dont must totally logout account, because warp too reload all needed informations..

Link to comment
Share on other sites

  • Contributor

Doing such things meant to be in quests as Cunoo said.

Here is an example code:

quest back_to_your_town begin
	state start begin
		when login begin
			-- As i remember warp_to_village will teleport to your own home town but if not, just use pc.warp...
			if pc.get_map_index() == 41 and pc.get_empire() != 3 then
				warp_to_village();
			elseif pc.get_map_index() == 21 and pc.get_empire() != 2 then
				warp_to_village();
			elseif pc.get_map_index() == 1 and pc.get_empire() != 1 then
				warp_to_village();
			end
		end
	end
end

 

  • Metin2 Dev 1
  • Love 3
Link to comment
Share on other sites

  • Active Member
12 hours ago, Cunoo said:

I don't have source check, but I think you can do it with quest specifically in empire change quest with simple check.. I think could be do at least 2+ variant.. Simple variant is add automatic warp in your new empire.. I think you dont must totally logout account, because warp too reload all needed informations..

@CunooI wasn't talking about account logging out. I was talking about: You can change empire normally with warp to the new empire town, it works right but when player disconnect his account by turning off internet connection or by login to the same account again, it will result in disconnection before "warp function" is triggered, so player won't be warped to the new empire town.

4 hours ago, TMP4 said:

Doing such things meant to be in quests as Cunoo said.

Here is an example code:

quest back_to_your_town begin
	state start begin
		when login begin
			-- As i remember warp_to_village will teleport to your own home town but if not, just use pc.warp...
			if pc.get_map_index() == 41 and pc.get_empire() != 3 then
				warp_to_village();
			elseif pc.get_map_index() == 21 and pc.get_empire() != 2 then
				warp_to_village();
			elseif pc.get_map_index() == 1 and pc.get_empire() != 1 then
				warp_to_village();
			end
		end
	end
end

 

@TMP4 Good idea, I'll try.

  • Metin2 Dev 1

I'll be always helpful! 👊 

Link to comment
Share on other sites

24 minutes ago, ReFresh said:

@CunooI wasn't talking about account logging out. I was talking about: You can change empire normally with warp to the new empire town, it works right but when player disconnect his account by turning off internet connection or by login to the same account again, it will result in disconnection before "warp function" is triggered, so player won't be warped to the new empire town.

@TMP4 Good idea, I'll try.

Yes but now you cant go in enemy empire.. Thats what u want?

Link to comment
Share on other sites

  • Solution

One little think.. 😄

quest back_to_your_town begin
	state start begin
		when login with not pc.is_gm() begin
			if pc.get_map_index() == 41 and pc.get_empire() != 3 then
				warp_to_village();
			elseif pc.get_map_index() == 21 and pc.get_empire() != 2 then
				warp_to_village();
			elseif pc.get_map_index() == 1 and pc.get_empire() != 1 then
				warp_to_village();
			end
		end
	end
end

 

  • Metin2 Dev 1
  • Good 1
  • Love 1
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.