Jump to content

Bloquear Entrada Em Mapas


tierrilopes
 Share

Recommended Posts

Serve para bloquear a entrada em mapas através do nível da personagem.

 

Ir até ao ficheiro game/src/char.cpp

Procurar por:

 

bool CAN_ENTER_ZONE(const LPCHARACTER& ch, int map_index)

{

switch (map_index)

{

case 351:

case 352:

if (ch->GetLevel() < 100)

return false;

break;

 

case 301:

case 302:

case 303:

case 304:

if (ch->GetLevel() < 90)

return false;

 

Adicionar mais mapas e níveis consoante desejado. Exemplo:

bool CAN_ENTER_ZONE(const LPCHARACTER& ch, int map_index)
{
switch (map_index)
{
case 351:
case 352:
	if (ch->GetLevel() < 100)
		return false;
	break;

case 301:
case 302:
case 303:
case 304:
	if (ch->GetLevel() < 90)
		return false;
	break;

case 208:
case 216:
	if (ch->GetLevel() < 75)
		return false;
	break;

case 217:
	if (ch->GetLevel() < 50)
		return false;
	break;

case 66:
	if (ch->GetLevel() < 40)
		return false;
	break;
}

return true;
}

  • Like 1
Link to comment
Share on other sites

  • 5 months later...

 

 

Também podias ensinar a Por mapas apenas para gm

 

Que Ficaria assim :

 

bool CAN_ENTER_ZONE(const LPCHARACTER& ch, int map_index)

{

switch (map_index)

{

 

case indexmap:

if(ch->IsGM())

return true;

break;

 

 

Ou

bool CAN_ENTER_ZONE(const LPCHARACTER& ch, int map_index)
{
switch (map_index)
{

         case indexmap:
                      if(!ch->IsGM())
                            return false;
                       break;

Link to comment
Share on other sites

 

 

Ou

 

bool CAN_ENTER_ZONE(const LPCHARACTER& ch, int map_index)

{

switch (map_index)

{

 

case indexmap:

if(!ch->IsGM())

return false;

break;

 

 

Tambem usa o return false

 

Na Minha opinião assim ficaria melhor

bool CAN_ENTER_ZONE(const LPCHARACTER& ch, int map_index)
{
   switch (map_index)
   {

case indexmap:
if(false == ch->IsGM())
return false;
break;

 

 

 

 

 

Link to comment
Share on other sites

  • 5 months later...

 

I did not understand your question, could you explain it better, please?

Ok. For the moment you need build the source to add a new map, in this system.

 

I ask, is possible to do this system but with a table (navicat) , to add map and level, like this, you don't need build source.

Link to comment
Share on other sites

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
 Share

×
×
  • Create New...