#--------------------------------------------- # Start state #--------------------------------------------- state Base { Conditions { } Actions { Disable #enabled in code and script set to WaitForPlayerInRange # SetHitPoints "default 8" SetHitPoints "default 1" # Don't use the ring targeting system NoRingSeg } } state Sleep { Conditions { } Actions { Idle "mintime 0.25" "maxtime 0.75" SetMessage "name OGREALLOWTHROW" "value 1" SetState "PickupRock" } } #--------------------------------------------- # Wait for the player to be in range #--------------------------------------------- state WaitForPlayerInRange { Conditions { if PlayerRangeP1 < 40.0 goto PickupRock if PlayerRangeP2 < 40.0 goto PickupRock } Actions { } } #--------------------------------------------- # Picks up a rock ready for attack #--------------------------------------------- state PickupRock { Conditions { } Actions { PrimeBow SetCreautreFlagOff "2" SetCreautreFlagOn "3" SetFaceAngle "32767" Idle "mintime 0.5" "maxtime 0.5" MessageWait "OGREALLOWTHROW" "1.0" SetMessage "name OGREALLOWTHROW" "value 0" SetCreautreFlagOff "3" SetState "Think" } } #--------------------------------------------- # Decides what action to take #--------------------------------------------- state Think { Conditions { if Random < 0.03 goto TargetLake if PreviousResult < 1.1 goto TargetPlayer #if Message "OGRETARGETICE" == 0.0 goto TargetPlayer #if Message "OGRETARGETICE" == 1.0 goto TargetLake } Actions { } } #--------------------------------------------- # Get a player as a target #--------------------------------------------- state TargetPlayer { Conditions { } Actions { GetPlayerOpponent SetCreautreFlagOff "2" Setmessage "name OGRETARGETICE" "value 1.0" Idle "mintime 1.0" "maxtime 1.0" SetState "ThrowAtPlayer" } } #--------------------------------------------- # Throw the rock at the player #--------------------------------------------- state ThrowAtPlayer { Conditions { } Actions { PressActionButton SetState "Wait" } } #--------------------------------------------- # Get a locator as a target #--------------------------------------------- state TargetLake { Conditions { #if GotLocator == 0.0 goto TargetPlayer if LevelValue "Ogrt" !=1 goto TargetPlayer } Actions { #TargetRandomLocator "name Ogre" "range 40.0" SetLevelValue "type Ogrt" "value 0.0" SetCreautreFlagOn "2" Setmessage "name OGRETARGETICE" "value 0.0" Idle "mintime 1.0" "maxtime 1.0" SetState "ThrowAtLake" } } #--------------------------------------------- # Throw the rock at the lake #--------------------------------------------- state ThrowAtLake { Conditions { } Actions { PressActionButton SetState "Wait" } } #--------------------------------------------- # Waits before picking up the next rock #--------------------------------------------- state Wait { Conditions { if Timer > 2.0 goto WaitForPlayerInRange } Actions { ResetTimer SetMessage "name OGREALLOWTHROW" "value 1" } } #--------------------------------------------- # Called when the character is hit #--------------------------------------------- state TakenHit { Conditions { if Message "OGREALLOWTHROW" == 0.0 goto AttackAttacker } Actions { ResetTimer SetInvulnerableTime "1.7" Idle "mintime 1.0" "maxtime 1.0" SetState "WaitForPlayerInRange" } } #--------------------------------------------- # Attacks the character who attacked it #--------------------------------------------- state AttackAttacker { Conditions { } Actions { SetCreautreFlagOff "2" SetNamedPlayerOpponent "Susan" Idle "mintime 0.5" "maxtime 0.5" SetState "ThrowAtPlayer" } }