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

[HELP] Object Collision


Jettyx

Question

  • Answers 1
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

1 answer to this question

Recommended Posts

  • 0
  • Premium

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

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


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.