Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Player in combat?

First Bot Author
Joined
Aug 7, 2013
Messages
262
1: check if local player health bar is showing, if not, return false
2: get all npcs
3: filter the npcs to only npcs that interact with the local player
4: filter the npcs based on attack options (if it cannot be attacked, it’s probably a follower)
5: return true if 1 or more npcs remain
 
Joined
Apr 18, 2015
Messages
408
How about Player#getTarget().getTarget() == Players.getLocal() ?

(Just a thought)

If the players' target's target is the player then they are in combat with eachother, right?
 
The only thing Alpha about me is my bots
Joined
Sep 22, 2014
Messages
618
How about Player#getTarget().getTarget() == Players.getLocal() ?

(Just a thought)

If the players' target's target is the player then they are in combat with eachother, right?

If the player isn't targeting anything, but something is targeting the player, this method will fail.
 
Joined
Nov 5, 2014
Messages
505
I use a query to check if any attackable NPC's within a reasonable range have the local player as their target.
 
Top