Jump to content

[HELP] Object Collision


Recommended Posts

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Contributor

Client source, ActorInstanceCollisionDetection.cpp

Search for: 

BOOL CActorInstance::TestActorCollision(CActorInstance& rVictim)

Write your conditions inside that function.

 

Example: 

Disable collision with pets:

	if (rVictim.GetRace() >= 34001 && rVictim.GetRace() <= 34099)
		return FALSE;

 

To disable collision with stones, just add another condition with the vnum range of the stones or individually if you only want it disabled for specific stones. NOTE: You should add a check to see if the player is attacking or not. I have never disabled the collision with metin stones so I am unsure if you'll be able to attack them anymore without a check.

 

Untested Example for all metin stones(at least I think that's all of them):

	if (!isAttacking() && rVictim.GetRace() >= 8001 && rVictim.GetRace() <= 8206)
		return false;

 

I advise you against disabling collision with houses and other objects since you'll just go right through them so they become useless.

 

That can be done from __TestObjectCollision

 

If you have any questions, let me know here or on Discord: Amun#3808

Good luck !

Edited by Amun
Added example for stones.
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



×
×
  • 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.