ActorAIState
Usage:
ActorAIState(Actor, State)
Description:
The ActorAIState command returns the current AI mode of an actor. There are various possible states:
0 - Wait in current position, attack any valid targets who come into range
1 - Patrol - walk to destination, then set destination to new waypoint if available
2 - Run - same as Patrol but running instead of walking
3 - Chase and attack target
4 - For actors who are paused at a waypoint while on patrol
5 - Pet mode - actor will follow leader and attack leader's target (actor MUST have a leader to use this)
6 - Pet attack mode - actor is chasing and attacking the leader's target
7 - Pet wait mode - actor waits in current position and does absolutely nothing
Example:
Function Main()
// Give an NPC a boost if it is attacking
State = ActorAIState(Actor())
If (State == 3 | State == 6)
SetAttribute(Actor(), "Health", Attribute(Actor(), "Health") + 20)
EndIf
Return()
End Function
Comments (0)
You don't have permission to comment on this page.