//EndorBattle state Base { Conditions { if Random < 0.2 goto ChooseNewLocator if AlwaysTrue == 1 goto Talking } Actions { } } state ResetToTalk { Conditions { } Actions { SetState "Talking" } } state Talking { Conditions { if Timer > 10 and if Random < 0.5 goto Talking if Timer > 10 goto ChooseNewLocator } Actions { ResetTimer "mintime=0" "maxtime=5" Idle } } state ChooseNewLocator { Conditions { if GotLocator == 1 goto GoToLocator if AlwaysTrue == 1 goto Talking } Actions { GetLocatorFromGroup "name=talk" "random" } } state GoToLocator { Conditions { if CannotReachDestination == 1 goto ChooseNewLocator if PathBlocked == 1 goto ChooseNewLocator } Actions { GoToLocator "Walk" SetState "Talking" } }