PARAM 0 visibility 10 PARAM 1 shootrange 5.5 PARAM 2 engagedist 4.0 #start state state Base { Conditions { if LevelValue "Ogre" != 0 goto Patrol } Actions { Disable DontPush IgnoreWallSplines #CheckWallSplines Respawnable "origin" NoAttack SetHitPoints "default 9.0" } } state Patrol { Conditions { if LevelValue "Ogre" != 1 goto ManageState if GotOpponent == 1 goto StartFight } Actions { Enable NoAttack "false" BlockAttacks "false" FollowPlayer "Run" } } #get to the main path state StartFight { Conditions { if LevelValue "Ogre" != 1 goto ManageState if GotOpponent == 0 goto Patrol } Actions { GoToLevelPath SetState "ApproachOpponent" } } #follow the opponent till we get in range state ApproachAttack { Conditions { if LevelValue "Ogre" != 1 goto ManageState if GotOpponent == 0 goto Patrol if Timer > 0.5 goto Think } Actions { ResetTimer FollowAttack } } state ApproachOpponent { Conditions { if LevelValue "Ogre" != 1 goto ManageState if GotOpponent == 0 goto Patrol if OpponentRange < 5.0 goto AttackOpp } Actions { FollowAttack } } state Think { Conditions { if LevelValue "Ogre" != 1 goto ManageState if GotOpponent == 0 goto Patrol if OpponentRange > 5.0 goto ApproachOpponent if CircleClockwise "4096" == 1 goto CirclePlayerClockwise if CircleAntiClockwise "4096" == 1 goto CirclePlayerAntiClockwise if Random < 0.6 goto AttackOpp if PreviousResult > 0.0 goto Wait } Actions { FaceOpponent "1.0" } } state Wait { Conditions { if LevelValue "Ogre" != 1 goto ManageState if OpponentRange > 5.0 goto ApproachOpponent } Actions { FaceOpponent "mintime 0.6" "maxtime 1.4" Setstate "Think" } } state AttackOpp { Conditions { if LevelValue "Ogre" != 1 goto ManageState if Timer > 1.0 goto Wait } Actions { ResetTimer EngageOpponent "goalrange engagedist" "firerange shootrange" "instant" "exit" Delay 0.7 BlockAttacks "false" } } state CirclePlayerClockwise { Conditions { if LevelValue "Ogre" != 1 goto ManageState if GotOpponent == 0 goto Patrol if OpponentRange > 5.0 goto ApproachOpponent if CircleClockwise "1024" == 0 goto Think } Actions { CircleOpponent "1.6" "walk" "facing" "CLOCKWISE" } } state CirclePlayerAntiClockwise { Conditions { if LevelValue "Ogre" != 1 goto ManageState if GotOpponent == 0 goto Patrol if OpponentRange > 5.0 goto ApproachOpponent if CircleAntiClockwise "1024" == 0 goto Think } Actions { CircleOpponent "1.6" "walk" "facing" "ANTICLOCKWISE" } } state TakenHit { Conditions { if LevelValue "Ogre" != 1 goto ManageState if Timer > 1.5 and if GotOpponent == 0 goto Patrol if Timer > 1.5 and if GotOpponent == 1 goto StartFight } Actions { ResetTimer #BlockAttacks } } state Blocking { Conditions { if LevelValue "Ogre" != 1 goto ManageState if GotOpponent == 0 goto Patrol if Timer > 0.3 goto AttackOpp } Actions { ResetTimer } } state RespawnOff { Conditions { } Actions { Respawnable "false" NoAttack KillMe } } state ManageState { Conditions { if LevelValue "Ogre" == 0 goto Base if LevelValue "Ogre" == 2 goto RespawnOff } Actions { } } state Killed { COnditions { } Actions { SetLevelValue "type Ogre" "value 0" } }