GetCombatState - Actor
Revision as of 11:05, 3 November 2013 by imported>Xander9009 (Added an example using the player.)
Member of: Actor Script
Gets the actor's current combat state.
Syntax
int Function GetCombatState() native
Parameters
None.
Return Value
The actor's current combat state, which is one of the following values:
- 0: Not in combat
- 1: In combat
- 2: Searching
Examples
; Is the pirate searching?
if (FilthyPirate.GetCombatState() == 2) ; 2 is "search"
Debug.Trace("Careful! That filthy pirate is looking around...")
endIf
;Is the player in combat?
If ( Game.GetPlayer().GetCombatState() == 0 ) ;State is 0, so player is peaceful
Debug.Notification("Player is not in combat")
Else ;State is not 0, so player is not peaceful
Debug.Notification("Player is in combat")
EndIf