Jump to content

Recommended Posts

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Premium

MapEditor  -> Block-PvP on the zone that you want block.

 

Or if you can't use W.E. you can make new checks from battle files.

You make a bool  IsInPvpMap(GetMapIndex()) and block in every damage function if is there.

Link to comment
https://metin2.dev/topic/18918-bloq-ataq-duel-pvp-in-map/#findComment-103021
Share on other sites

3 hours ago, WeedHex said:

MapEditor  -> Block-PvP on the zone that you want block.

 

Or if you can't use W.E. you can make new checks from battle files.

You make a bool  IsInPvpMap(GetMapIndex()) and block in every damage function if is there.

Example in source code

 

bool battle_is_attackable(LPCHARACTER ch, LPCHARACTER victim)
{
	if (victim->IsDead())
		return false;

	switch(ch->GetMapIndex())
	{
		case 4:
		case 113:
		case 351:
		case 352:
		{
		if (victim->IsPC())
			return false;
		}
	}

	// ¾ÈÀüÁö´ë¸é Áß´Ü
	{
		SECTREE	*sectree = NULL;

		sectree	= ch->GetSectree();
		if (sectree && sectree->IsAttr(ch->GetX(), ch->GetY(), ATTR_BANPK))
			return false;

		sectree = victim->GetSectree();
		if (sectree && sectree->IsAttr(victim->GetX(), victim->GetY(), ATTR_BANPK))
			return false;
	}
#ifdef NEW_ICEDAMAGE_SYSTEM
	if (!battle_is_icedamage(ch, victim))
		return false;
#endif
	// ³»°¡ Á×¾úÀ¸¸é Áß´ÜÇÑ´Ù.
	if (ch->IsStun() || ch->IsDead())
		return false;

	if (ch->IsPC() && victim->IsPC())
	{
		CGuild* g1 = ch->GetGuild();
		CGuild* g2 = victim->GetGuild();

		if (g1 && g2)
		{
			if (g1->UnderWar(g2->GetID()))
				return true;
		}
	}

	if (IS_CASTLE_MAP(ch->GetMapIndex()) && false==castle_can_attack(ch, victim))
			return false;

	if (CArenaManager::instance().CanAttack(ch, victim) == true)
		return true;

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

 

Function bloq duel

 

    switch(ch->GetMapIndex())
    {
        case 4:
        case 113:
        case 351:
        case 352:
        {
        if (victim->IsPC())
            return false;
        }
    }

 

is correct?

Link to comment
https://metin2.dev/topic/18918-bloq-ataq-duel-pvp-in-map/#findComment-103025
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.