Jump to content

Maps' minimum level check


Syreldar

Recommended Posts

  • Premium

M2 Download Center

This is the hidden content, please
( Internal )

This quest will warp to the village whoever logins into a map which minimum level required is higher than the player's level.

This basically fixes those who abuse the Wedding Ring or the Warp Scrolls to go to maps they normally shouldn't be able to go into.

For example: if a player logins into the Grotto of Exile but his level is less than 75, he will be teleported back to his village.

The maps and the minimum levels are fully customizable.

Have fun!

This is the hidden content, please

Edited by Syreldar
  • Metin2 Dev 24
  • Eyes 1
  • Dislove 1
  • Good 6
  • Love 1
  • Love 31

 

"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

  • 2 years later...
  • Premium
7 hours ago, C. Alexandru Sorin said:

better, 


when login or levelup begin

? Please..you always login into a map, levelup is useless here.

 

"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

  • Premium
20 hours ago, C. Alexandru Sorin said:

some guys have some quest with ``reborn`` ( set again lv 1) . after that they can stay in the map and can do levelup faster.

it is good to be there, maybe someone need this. by the way, Very nice work!

Levelup only triggers if the level you are is greater than the level you were before, hence is called LEVEL UP not LEVEL DOWN or ONLEVEL so levelup is still useless here. It's the reborn system that should make you re-log upon use.

 

"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
On 3/13/2019 at 10:50 AM, Syreldar said:

Levelup only triggers if the level you are is greater than the level you were before, hence is called LEVEL UP not LEVEL DOWN or ONLEVEL so levelup is still useless here. It's the reborn system that should make you re-log upon use.

 

@C. Alexandru Sorin knew what he said, once player level is resetted to 1 for example and after that he levelup to 2 the quest gets triggered and the player is warped home.

  • Confused 1
Link to comment
Share on other sites

  • 2 weeks later...
  • Bronze
2 hours ago, WeedHex said:

Better from c++.

When login  begin triggered every time, same for the lua local and if.

Why not from c++ directly?

Better you go and live inside c++, there is no reason to make it via c++ and also no signifiant speed improvement. Via quest you can edit easily.

Link to comment
Share on other sites

  • Premium
2 hours ago, WeedHex said:

Better from c++.

When login  begin triggered every time, same for the lua local and if.

Why not from c++ directly?

Sure, let's write each and every quest/dungeon/function directly inside the source. It will be fun i bet.

 

?

  • Love 2

 

"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

  • Forum Moderator
8 hours ago, WeedHex said:

Why not from c++ directly?

Not everything should be written in source, but here's a method. (2 years ago - i posted it in another forum)

//@Src/Server/game/src/input_login.cpp
// Add to the beginning of the file:
inline bool AllowedToWarp(const DWORD dwMapIndex, const DWORD dwLevel)
{
	struct set_struct
	{
		const unsigned short map_index;
		const unsigned short minimum_level;
	}
	set_fields[] =
	{
		{ 91, 75 },  // Grotto of Exile 1st Floor
		{ 82, 75 },  // Grotto of Exile 2nd Floor
		{ 216, 75 }, // Devils Catacomb
		{ 218, 90 }, // Cape Dragon Head
		{ 219, 90 }, // Dawn Mist Wood
		{ 220, 90 }, // Mount Thunder
		{ 221, 90 }  // Bay Black Sand
	};
	
	for (unsigned short i = 0; i < _countof(set_fields); ++i)
	{
		if (dwMapIndex == set_fields[i].map_index && dwLevel < set_fields[i].minimum_level)
			return false;
    }
	
	return true;
}
//1.) Search for:
	ch->SendGreetMessage();
//2.) Add after:
	if (!AllowedToWarp(ch->GetMapIndex(), ch->GetLevel()))
		ch->GoHome();
  • Love 7
Link to comment
Share on other sites

  • 1 month 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.