//Tatooine_D state Base { Conditions { if OriginRange > 0.25 goto Base if Timer > 10 and if GotOpponent == 1 goto ZapOpponent } Actions { ResetTimer "mintime=1" "maxtime=5" GoToOrigin "Walk" "waittime=10" } } ============================= state ZapOpponent { Conditions { if OpponentContext "DEACTIVATED" == 1 goto RunToOrigin if GotOpponent == 0 goto RunToOrigin if CannotReachDestination == 1 goto RunToOrigin } Actions { AttackOpponent } } state RunToOrigin { Conditions { } Actions { GoToOrigin SetState "Base" } } ============================= state TakenHit { Conditions { } Actions { SetState "RunAway" } } state RunAway { Conditions { if Timer > 5 and if LastAttackerRange > 2.5 goto WaitForAWhile } Actions { ResetTimer MoveAwayFromLastAttacker "99" } } state WaitForAWhile { Conditions { if Timer < 5 and if LastAttackerRange < 1.5 goto RunAway if Timer > 10 goto Base } Actions { ResetTimer FacePlayer } }