Jump to content
Maintenance ×
×
×
  • Create New...
  • 0

Disable PvP on certain maps


Karbust

Question

22 answers to this question

Recommended Posts

  • 1

Server src: battle.cpp function bool battle_is_attackable(LPCHARACTER ch, LPCHARACTER victim)

Client src: InstanceBase.cpp function bool CInstanceBase::IsAttackableInstance(CInstanceBase& rkInstVictim)

  • Love 1
Link to comment
Share on other sites

  • 1
2 hours ago, charparodar said:
bool battle_is_attackable(LPCHARACTER ch, LPCHARACTER victim)
{
	switch(ch->GetMapIndex())
	{
		case 113:
		case 219:
		case 240:
		case 351:
		case 352:
			return false;
	}

 

Try

bool battle_is_attackable(LPCHARACTER ch, LPCHARACTER victim)
{
	// »ó´ëąćŔĚ Á׾úŔ¸¸é Áß´ÜÇŃ´Ů.
	if (victim->IsDead())
		return false;

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

...

 

  • Love 1
Link to comment
Share on other sites

  • 0
  • Web Developer
Just now, Aliremawi said:

open the map with world editor

choose no pvp and chose the area where you need no_pvp 

 

First: I want to disable on the whole map...

Second: That option doesn't block every kind of attack?

I want something done on source...

QJ0orbR.png

Metin2 Icon Database

Link to comment
Share on other sites

  • 0
  • Web Developer
On 16/07/2017 at 0:14 AM, Den said:

Try

bool battle_is_attackable(LPCHARACTER ch, LPCHARACTER victim)
{
	// »ó´ëąćŔĚ Á׾úŔ¸¸é Áß´ÜÇŃ´Ů.
	if (victim->IsDead())
		return false;

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

...

 

Like this monsters doesn't attack the players...

QJ0orbR.png

Metin2 Icon Database

Link to comment
Share on other sites

  • 0
  • Web Developer
Just now, Fleon said:

Then post the solution for everyone.

Are you seriously?

Did you read the whole post? Have you seen Den's posts? Have you seen the top answer? Thought soo...

QJ0orbR.png

Metin2 Icon Database

Link to comment
Share on other sites

  • 0
  • Premium
2 minutes ago, charparodar said:

Are you seriously?

Did you read the whole post? Have you seen Den's posts? Have you seen the top answer? Thought soo...

It`s not for me, i dont care.

But if you get into the solution then posting your code is a must for the others. (the whole func)

Link to comment
Share on other sites

  • 0
  • Web Developer
On 16/07/2017 at 0:22 AM, Den said:

Try

bool battle_is_attackable(LPCHARACTER ch, LPCHARACTER victim)
{
	// »ó´ëąćŔĚ Á׾úŔ¸¸é Áß´ÜÇŃ´Ů.
	if (victim->IsDead())
		return false;

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

...

 

This code with the top answer is the solution...

QJ0orbR.png

Metin2 Icon Database

Link to comment
Share on other sites

  • 0
  • Premium
6 minutes ago, charparodar said:

This code with the top answer is the solution...

A typical user doesnt read that far, he goes to the bottom of the page to see if it`s solved or not, it`s a common behavior.

Thanks for sharing, at least i hope now this question will not be spammed for at least 1/2 week

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
  • Recently Browsing   0 members

    • No registered users viewing this page.


  • Activity

    1. 0

      erorrs after update granny to 2.9

    2. 0

      Navicat Premium 16.1.1 x64

    3. 5

      problem Dargon Soul Changre Attribute

    4. 5

      problem Dargon Soul Changre Attribute

    5. 41

      Global Chat

    6. 5

      problem Dargon Soul Changre Attribute

    7. 2

      Startup Loading Window Library

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.