Jump to content

Bloquear Entrada Em Mapas


tierrilopes

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

 

 

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
  • 5 months later...

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
×
×
  • Create New...