Jump to content

[C++] Stop collision with arguments [++ bonus ]


VegaS™
 Share

Recommended Posts

collision or crash is an event in which two or more bodies exert forces on each other for a relatively short time. Although the most common colloquial use of the word "collision" refers to incidents in which two or more objects collide, the scientific use of the word "collision" implies nothing about the magnitude of the force.

Some examples of physical interactions that scientists would consider collisions:

  • An insect touches its antenna to the leaf of a plant. The antenna is said to collide with leaf.

  • A cat walks delicately through the grass. Each contact that its paws make with the ground is a collision. Each brush of its fur against a blade of grass is a collision.


 

[File: src/Client/Source/GameLib/ActorInstanceCollisionDetection.cpp]

 

//1.) Search:

​ #include "../eterLib/GrpMath.h" ​

//2.) Add bellow:

#include "../UserInterface/PythonBackground.h"
#include "../UserInterface/Locale_inc.h"

//3.) Search:

BOOL CActorInstance::TestActorCollision(CActorInstance & rVictim)
{

//4.) Add bellow:

#ifdef ENABLE_STOP_COLISSION_GLOBAL
/*********************************************************************
* date		: 2016.02.16
* function	: Stop Colission
* developer	: VegaS
* skype		: sacadatt.amazon
* description : Checks if the victim is one of the examples below you can easily configure. If the victim was found 
				success as vnum site / breed ve you could go through it no longer block.
*/	
/************
* The first value is the minimum value and the second value is the maximum value of pet vnum (mob_proto) - change 34051 with your max vnum of pet */	
	int pListPet[2] = {34001, 34051};	
/************
* You can add whatever you like vnum of npc or monster (mob_proto) */
	int pListGlobal[] = {9001, 9002, 9003, 9004, 9005, 9006, 20011, 20091, 20092, 20093, 20094, 20095, 30000};
/************
* You can add what mapname you want for enable this stop collission global like pet / npc */	
	const char* strMapListGlobal[] = {"metin2_map_a1", "metin2_map_a3", "metin2_map_b1", "metin2_map_b3", "metin2_map_c1", "metin2_map_c3", 
									"season2/metin2_map_skipia_dungeon_01", "season2/metin2_map_skipia_dungeon_02", "metin2_map_duel"};	
/************
* Location name of the map where the event takes place ox */		
	const char* strMapEventOx = "season1/metin2_map_oxevent";								
	
	
	std::string stringName = CPythonBackground::Instance().GetWarpMapName();
	
	for (int i = 0; i < _countof(strMapListGlobal); i++)
	{
#ifdef ENABLE_STOP_COLLISION_PLAYER_OX
		if (strMapEventOx == stringName) // Check if u are place in map ox
		{	
			if (0 <= rVictim.GetRace() && rVictim.GetRace() <= 7) // Check if the victim through which pass over a player (change 7 with 8 if u have wolfman)
				return FALSE;	// Stop collission for player --> You can go through players now successfully without lock yourself		
		}
#endif		
		if (strMapListGlobal[i] == stringName) // Check if you are in one of the maps listed in the global list
		{
			for (int i = 0; i < _countof(pListGlobal); i++)
			{
				if (rVictim.GetRace() == pListGlobal[i] || pListPet[0] <= rVictim.GetRace() && rVictim.GetRace() <= pListPet[1]) // Verify that the victim is npc vnum listed above, or if a pet.
					return FALSE;	// Stop collission for global vnum like a pet or npc							
			}
		}	
	}	
#endif		

[File: src/Client/Source/UserInterface/Locale_inc.h]

 

//1.) Search:

#define ENABLE_COSTUME_SYSTEM

//2.) Add bellow:

#ifndef ENABLE_STOP_COLISSION_GLOBAL
	#define ENABLE_STOP_COLISSION_GLOBAL
	#define ENABLE_STOP_COLLISION_PLAYER_OX
#endif
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.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...