//MosEisley_B state Base { Conditions { } Actions { SetState "CheckEmpty" } } state CheckEmpty { Conditions { if HasTakeOverTarget == 1 goto Move if HasTakeOverTarget == 0 goto CheckFight } Actions { SetLocator SetTakeOverTarget "type=ATST" "maxrange=10" ResetTimer "mintime=0" "maxtime=5" } } state Move { Conditions { if TakenOver == 1 goto CheckFight //if already has taken something over if TakeOverRange < 1.5 goto TakeOver if TakenOver "TakeoverTarget" == 1 goto CheckFight if HasTakeOverTarget == 0 goto CheckFight if CannotReachDestination == 1 goto CheckFight } Actions { FollowCharacter "TakeOverTarget" "RUN" "ignore_radius" "can_go_off_path" } } state TakeOver { Conditions { } Actions { SetLocator TakeOver AlertCreatures SetState "TakenOverMove" } } state TakenOverMove { Conditions { } Actions { GetLocatorFromGroup "name=AtstFight" "random" GoToLocator "0.5" SetState "TakenOverFight" } } state CheckFight { Conditions { if Timer > 15 goto CheckEmpty if GotOpponent == 0 goto FollowPlayer } Actions { ClearTakeOverTarget SetLocator PrefersPlayers "FALSE" EngageOpponent "goalrange 1.5" "firerange=3" } } state FollowPlayer { Conditions { if GotOpponent == 1 goto CheckFight if Timer > 15 goto CheckEmpty } Actions { FollowPlayer } } state TakenOverFight { Conditions { if TakenOver == 0 goto CheckFight if EitherPlayerInTriggerArea "Spawn" == 0 goto TakenOver_GoToOrigin if GotLocator == 0 goto TakenOverMove if LocatorRangeXZ > 5 goto TakenOverMove if Timer > 20 goto TakenOverMove ;if HeadTurnRestricted == 1 goto TakenOverMove } Actions { ResetTimer "mintime=0" "maxtime=4" PrefersPlayers EngageOpponent "goalrange=3" "firerange=5.0" "static" } } state TakenOver_GoToOrigin { Conditions { if EitherPlayerInTriggerArea "Spawn" == 1 goto TakenOverFight } Actions { GoToOrigin } } state TakenHit { Conditions { if TakenOver == 1 goto TakenOverFight if TakenOver == 0 goto CheckFight } Actions { ClearTakeOverTarget ResetTimer "mintime=0" "maxtime=5" } } ;Just been kicked out... run away state ReleasedTakeOver { Conditions { if Timer > 12 goto CheckFight } Actions { ResetTimer "mintime=1" "maxtime=3" SetOpponent "opponent=player" RetreatFromOpponent "20" } }