Jump to content
drunksigma

Can't get attacking entity with auto retaliate off

Recommended Posts

I tried using the Combat class and also iterating through all npcs in the area and checked if they are in combat and is interacting with me.

The problem seems to occur when their hp bar disapears.

Is there a way i can get an entity that is following and attacking me while i  don't attack it?

 

This is an example of what i have tried so far.

RSNPC[] npcarray = NPCs.getAll();
			println(npcarray.length);
			if(npcarray.length>0)
				for(RSNPC index : npcarray) {
					
					if(index.equals(null))
						println("null");
					else if(index.isInCombat() && index.isInteractingWithMe()){
						println(index.getName());
					}
					
				}
			println("");
			
			General.sleep(500, 1000);

 

Share this post


Link to post
Share on other sites

They could be animation with other players. What i have done so far is looked at what my character does for anmiation with equiped weapon and used that to know if i am being attacked but the problem is that i have to do that for every weapon since the weapon type determines the blocking animation.

Share this post


Link to post
Share on other sites
4 minutes ago, drunksigma said:

They could be animation with other players. What i have done so far is looked at what my character does for anmiation with equiped weapon and used that to know if i am being attacked but the problem is that i have to do that for every weapon since the weapon type determines the blocking animation.

Not if they are also interacting with you. Have to check both.

  • Thanks 1

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

×