Jump to content

Recommended Posts

  • Premium

Hello, recently I had a problem with players on farm maps players fight each other (even those from different kingdoms) and they can't farm.

I found this script, but i do not know how to add the kingdom and the option they can no longer push each other.

 

// for who need it too in battle.cpp search:
bool battle_is_attackable(LPCHARACTER ch, LPCHARACTER victim)

// under the
  if (victim->IsDead())
    return false;

// add
switch(ch->GetMapIndex())
{
  // index map
  case 113:
  case 219:
  case 240:
  case 351:
  case 352:
    {
      if (victim->IsPC() && ch->IsPC())
        return false;
    }
}

 

Edited by DemOnJR

plague.png.1f5de75b42146262dcd655a5a8078

Link to comment
Share on other sites

  • Premium

battle.cpp

return CPVPManager::instance().CanAttack(ch, victim);

to

    bool bIsFarmMap = false;
    switch (ch->GetMapIndex())
    {
      case 113:
      case 219:
      case 240:
      case 351:
      case 352:
      {
      	if (victim->IsPC() && ch->IsPC())
      		bIsFarmMap = true;
      }
      break;
    }
	return CPVPManager::instance().CanAttack(ch, victim, bIsFarmMap);

pvp.h

bool			CanAttack(LPCHARACTER pkChr, LPCHARACTER pkVictim);

to

bool			CanAttack(LPCHARACTER pkChr, LPCHARACTER pkVictim, bool bIsFarmMap = false);

pvp.cpp

bool CPVPManager::CanAttack(LPCHARACTER pkChr, LPCHARACTER pkVictim)

to

bool CPVPManager::CanAttack(LPCHARACTER pkChr, LPCHARACTER pkVictim, bool bIsFarmMap)

inside of body after 

		if ( LC_IsYMIR() == true || LC_IsKorea() == true )
		{
			if ( pkChr->GetPKMode() == PK_MODE_PROTECT || pkVictim->GetPKMode() == PK_MODE_PROTECT )
			{
				return false;
			}
		}

add

        if (bIsFarmMap == true)
            return false;
Spoiler

uvwYeg1.png

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • 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.