Jump to content
×
×
  • Create New...

C++ Remove collision


Recommended Posts

Centre de Téléchargement

Télécharger ( Interne )

Bonjour, ce partage consiste à enlever la collision entre joueurs, pnj, pet, monture, magasin ainsi que pendant les OX event.

Commençons le tutoriel.

Source client UserInterface/Locale_inc.h

Ajouter à l'intérieur :

#define REMOVE_MOUNTS_COLLISION // Remove mounts collision
#define REMOVE_PETS_COLLISION // Remove pets collision
#define REMOVE_SHOPS_COLLISION // Remove shops collision
#define REMOVE_SAFEZONE_COLLISION // Remove safezone collision
#define REMOVE_OX_PLAYER_COLLISION // Remove ox player collision

 

Source client GameLib/ActorInstanceCollisionDetection.cpp

Ajouter tout en haut :

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

Checher :

BOOL CActorInstance::TestActorCollision(CActorInstance & rVictim)

Ajouter au dessus :

BOOL CActorInstance::IsInSafeZone(CActorInstance& ptr)
{
	const TPixelPosition& c_rkPPosCur = ptr.NEW_GetCurPixelPositionRef();
	if (CPythonBackground::Instance().isAttrOn(c_rkPPosCur.x, c_rkPPosCur.y, (1 << 2)))
		return true;

	return false;
}

Checher :

BOOL CActorInstance::TestActorCollision(CActorInstance & rVictim)
{
	if (rVictim.IsDead())
		return false;

Ajouter en dessous :

#ifdef REMOVE_SAFEZONE_COLLISION
	if (IsInSafeZone(rVictim))
		return false;
#endif

#ifdef REMOVE_PETS_COLLISION
	if (rVictim.GetRace()>=34001 && rVictim.GetRace()<=34099) // Mob Vnum
		return false;
#endif

#ifdef REMOVE_SHOPS_COLLISION
	if (rVictim.GetRace()>=30000 && rVictim.GetRace()<=30001) // Mob Vnum
		return false;
#endif

#ifdef REMOVE_MOUNTS_COLLISION
	if (rVictim.GetRace()>=20101 && rVictim.GetRace()<=20299) // Mob Vnum
		return false;
#endif

#ifdef REMOVE_OX_PLAYER_COLLISION
	const char* strMapEventOx = "metin2_map_oxevent";
	std::string stringName = CPythonBackground::Instance().GetWarpMapName();

	if (strMapEventOx == stringName)
	{
	#ifdef ENABLE_WOLFMAN_CHARACTER
		if (0 <= rVictim.GetRace() && rVictim.GetRace() <= 8)
	#else
		if (0 <= rVictim.GetRace() && rVictim.GetRace() <= 7)
	#endif
			return false;
	}
#endif

 

Source client GameLib/ActorInstance.h

Chercher :

public:
	BOOL TestActorCollision(CActorInstance & rVictim );
	BOOL TestPhysicsBlendingCollision(CActorInstance & rVictim);

Ajouter en dessous :

BOOL IsInSafeZone(CActorInstance& ptr);
Succès ! Le tutoriel prend fin ici, n'oubliez pas de recompiler vos source client, Enjoy.
  • Funky Emulation 4
  • J'adore 1
  • J'aime 1
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
 Share



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.