#--------------------------------------------- # Start state #--------------------------------------------- state Base { Conditions { ###################################################### # On leave re-start, the script is reset so need to # go back to faking the death ###################################################### if Message "GINARRBRIK_DEAD" == 1.0 goto DeadOnTree if Message "GINARRBRIK_DEAD" == 0.0 goto Disable } Actions { CollidePriority } } #--------------------------------------------- # Disables ginarrbrik #--------------------------------------------- state Disable { Conditions { } Actions { NoRingSeg Disable MessageWait "ACTIVATE_GINARRBRIK" "1.0" Enable setState Think } } #--------------------------------------------- # Runs along the path - to get around the tree # after the cutscene #--------------------------------------------- state RunRoundTree { Conditions { if Timer > 1.75 goto Think } Actions { ResetTimer FollowPath "RUN" } } #--------------------------------------------- # Decides how to attack the opponenet #--------------------------------------------- state Think { Conditions { if Message "ACTIVATE_GINARRBRIK" == 0.0 goto Base if BossOpponentRange > 4.0 goto MoveToOpponenet if OpponentInSight != 1.0 goto MoveToOpponenet if BossOpponentRange < 2.0 goto Attack if Random < 0.1 goto CircleClockwise if PreviousResult < 0.2 goto CircleAntiClockwise if PreviousResult < 1.0 goto Attack } Actions { ResetTimer FaceOpponent "120.0" } } #--------------------------------------------- # Moves towards the opponent #--------------------------------------------- state MoveToOpponenet { Conditions { if Message "ACTIVATE_GINARRBRIK" == 0.0 goto Base if BossOpponentRange < 2.0 and if OpponentInSight == 1.0 goto Attack if Timer > 2.0 and if BossOpponentRange < 6.0 goto Attack } Actions { ResetTimer FollowOpponent "RUN" } } #--------------------------------------------- # Attacks the opponent #--------------------------------------------- state Attack { Conditions { if Timer > 1.0 goto Think } Actions { ResetTimer EngageOpponent "goalrange 0.0" "firerange 200" "instant" } } #--------------------------------------------- # Cicles around the opponenet clockwise #--------------------------------------------- state CircleClockwise { Conditions { if Timer > 1.0 goto Think } Actions { ResetTimer CircleOpponent "1.6" "walk" "facing" "CLOCKWISE" } } #--------------------------------------------- # Cicles around the opponenet anticlockwise #--------------------------------------------- state CircleAntiClockwise { Conditions { if Timer > 1.0 goto Think } Actions { ResetTimer CircleOpponent "1.6" "walk" "facing" "ANTICLOCKWISE" } } #--------------------------------------------- # Enters this state when tied to a tree #--------------------------------------------- state TiedToTree { Conditions { } Actions { } } #--------------------------------------------- # Enters this state when dazed under the tree #--------------------------------------------- state Dazed { Conditions { } Actions { SnapToLocator "name" "GINARRBRIK" SetBlockAttacks "FALSE" } } #--------------------------------------------- # Enters this state when dazed under the tree #--------------------------------------------- state BeardOnFire { Conditions { if Timer > 5.0 goto Think } Actions { ResetTimer } } #--------------------------------------------- # Runs to the tree ready to climb #--------------------------------------------- state RunToTree { Conditions { } Actions { GoToLocator "name" "GBJumpPos" "xz_rangecheck" SetState ClimbTree } } #--------------------------------------------- # Waits for the climb animation to end #--------------------------------------------- state ClimbTree { Conditions { if CheckCreatureFlag "0" == 0 goto InTreeIdle } Actions { SetCreautreFlagOn "0" } } #--------------------------------------------- # Sits in the tree ready to throw knifes #--------------------------------------------- state InTreeIdle { Conditions { if Timer > 0.1 and if OpponentDotProd > 0.0 and if CheckCreatureFlag "1" == 1 goto ThrowKnifes if Timer > 5.0 goto GetOutOfTree } Actions { ResetTimer } } #--------------------------------------------- # Throws knifes #--------------------------------------------- state ThrowKnifes { Conditions { } Actions { PressActionButton SetState InTreeIdle } } #--------------------------------------------- # Tells the level code to get out of the tree #--------------------------------------------- state GetOutOfTree { Conditions { } Actions { SetCreautreFlagOff "1" } } #--------------------------------------------- # Dead on tree state #--------------------------------------------- state DeadOnTree { Conditions { } Actions { Enable NoAttack } }