Jump to content

Searching for a solution


Recommended Posts

  • Forum Moderator

I didn't test it, but you can try.

//@Srcs\Client\UserInterface\InstanceBase.cpp
//@bool CInstanceBase::IsAttackableInstance(CInstanceBase& rkInstVictim)
//Search for:
	if (GetVirtualID() == rkInstVictim.GetVirtualID())
		return false;
//Add after:
	if (IsPC() && rkInstVictim.IsPC())
	{
		const std::string & c_rstrMapFileName = CPythonBackground::Instance().GetWarpMapName();
		if (!c_rstrMapFileName.compare("MAP_NAME"))
			return true;
	}
	
//@Srcs\Server\game\src\pvp.cpp
//bool CPVPManager::CanAttack(LPCHARACTER pkChr, LPCHARACTER pkVictim)
//Search for:
	if (pkChr == pkVictim)
		return false;
//Add after:
	if (pkChr->GetMapIndex() == MAP_INDEX)
		return true;

 

  • Love 2
Link to comment
Share on other sites

9 hours ago, VegaS™ said:

I didn't test it, but you can try.


//@Srcs\Client\UserInterface\InstanceBase.cpp
//@bool CInstanceBase::IsAttackableInstance(CInstanceBase& rkInstVictim)
//Search for:
	if (GetVirtualID() == rkInstVictim.GetVirtualID())
		return false;
//Add after:
	if (IsPC() && rkInstVictim.IsPC())
	{
		const std::string & c_rstrMapFileName = CPythonBackground::Instance().GetWarpMapName();
		if (!c_rstrMapFileName.compare("MAP_NAME"))
			return true;
	}
	
//@Srcs\Server\game\src\pvp.cpp
//bool CPVPManager::CanAttack(LPCHARACTER pkChr, LPCHARACTER pkVictim)
//Search for:
	if (pkChr == pkVictim)
		return false;
//Add after:
	if (pkChr->GetMapIndex() == MAP_INDEX)
		return true;

 

thanks Vegas i will test it and post here the result

Link to comment
Share on other sites

11 hours ago, ridetpro said:

// void CInputLogin::Entergame(LPDESC d, const char* data)
// End of the function

if (ch->GetMapIndex() == <number>)
{
	ch->SetObserverMode(true);
}

Not tested.

didn't work

i ask how to make all players in certain map fight each other, not login in observer mode

Link to comment
Share on other sites

  • Active Member
On 9/6/2018 at 5:04 AM, MaJeStiC said:

*tested  works attack but no dmg

Because you need serverside too

VegaS is bored and shares cancer

 

EDIT:

this is the code that I wrote long time ago(6 Octombrie 2017) for a client (rumble event fight etc)

 

bool CInstanceBase::IsAttackableInstance(CInstanceBase& rkInstVictim)
{
	if (__IsMainInstance())
	{
		CPythonPlayer& rkPlayer=CPythonPlayer::Instance();
		if(rkPlayer.IsObserverMode())
			return false;
	}

	if (GetVirtualID() == rkInstVictim.GetVirtualID())
		return false;

	if (IsStone())
	{
		if (rkInstVictim.IsPC())
			return true;
	}
	else if (IsPC())
	{
		if (rkInstVictim.IsStone())
			return true;

		if (rkInstVictim.IsPC())
		{
#ifdef ENABLE_RUMBLE_EVENT
			std::string strMapName = CPythonBackground::Instance().GetWarpMapName();
			if (strMapName == "metin2_map_name")
				return true;
#endif
bool battle_is_attackable(LPCHARACTER ch, LPCHARACTER victim)
{
	// 상대방이 죽었으면 중단한다.
	if (victim->IsDead())
		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;
	}
	

	// 내가 죽었으면 중단한다.
	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;
		}
	}

#ifdef ENABLE_RUMBLE_EVENT
	// rumble event can attack in a map by Exygo // 6 Octombrie 2017
	if (ch->IsPC() && victim->IsPC() && ch->GetMapIndex() == 41) // map index
			return true;
	//
#endif

 

  • Love 4
Link to comment
Share on other sites

10 hours ago, Exygo said:

Because you need serverside too

VegaS is bored and shares cancer

 

EDIT:

this is the code that I wrote long time ago(6 Octombrie 2017) for a client (rumble event fight etc)

 


bool CInstanceBase::IsAttackableInstance(CInstanceBase& rkInstVictim)
{
	if (__IsMainInstance())
	{
		CPythonPlayer& rkPlayer=CPythonPlayer::Instance();
		if(rkPlayer.IsObserverMode())
			return false;
	}

	if (GetVirtualID() == rkInstVictim.GetVirtualID())
		return false;

	if (IsStone())
	{
		if (rkInstVictim.IsPC())
			return true;
	}
	else if (IsPC())
	{
		if (rkInstVictim.IsStone())
			return true;

		if (rkInstVictim.IsPC())
		{
#ifdef ENABLE_RUMBLE_EVENT
			std::string strMapName = CPythonBackground::Instance().GetWarpMapName();
			if (strMapName == "metin2_map_name")
				return true;
#endif

bool battle_is_attackable(LPCHARACTER ch, LPCHARACTER victim)
{
	// 상대방이 죽었으면 중단한다.
	if (victim->IsDead())
		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;
	}
	

	// 내가 죽었으면 중단한다.
	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;
		}
	}

#ifdef ENABLE_RUMBLE_EVENT
	// rumble event can attack in a map by Exygo // 6 Octombrie 2017
	if (ch->IsPC() && victim->IsPC() && ch->GetMapIndex() == 41) // map index
			return true;
	//
#endif

 

same result no dmg

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



  • Similar Content

  • Activity

    1. 4

      Feeding game source to LLM

    2. 0

      Quest 6/7 Problem

    3. 5

      Effect weapons

    4. 0

      [C++] Fix Core Downer Using Negative Number in GM Codes

    5. 3

      Crystal Metinstone

    6. 4

      Feeding game source to LLM

    7. 113

      Ulthar SF V2 (TMP4 Base)

    8. 4

      Feeding game source to LLM

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.