Informations
Jump to content

Lorem Ipsum...

Click to Dismiss this Notification
Ładowanie danych...

Recommended Posts

In this guide, we will demonstrate how to disable player versus player (PvP) interactions on specific farming maps within your C++ game source code. This is particularly useful for mitigating player conflicts in designated farming zones.

Implementation Steps

1. Open the Battle File
Begin by opening the battle.cpp file in your project.

2. Locate the Attackable Function
Search for the following function definition:

 
bool battle_is_attackable(LPCHARACTER ch, LPCHARACTER victim)
    

3. Modify the Function
Within this function, find the following conditional statement:

 
This is the hidden content, please

Add the following switch-case statement right after it:

 
This is the hidden content, please

Explanation

This snippet checks the current map index of the character attempting to attack. If the map index corresponds to any of the designated farming zones (113, 219, 240, 351, 352), and both the attacker and the victim are players, the function will return false, thus disabling PvP interactions on those maps.

By following these simple steps, you will effectively prevent players from engaging in combat in specific farming areas, allowing for a more peaceful gameplay experience in those zones.

Link to comment
Share on other sites


Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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.

spacer.png

Disable AdBlock
The popup will be closed in 5 seconds...