#--------------------------------------------- # Start state #--------------------------------------------- state Base { Conditions { } Actions { Disable SetHitPoints "default 3" # Don't use the ring targeting system NoRingSeg MessageWait "FINALATTACK" "1.0" Idle "mintime 1.0" "maxtime 3.0" SetState "EnableCharacter" } } #--------------------------------------------- # Enables the character #--------------------------------------------- state EnableCharacter { Conditions { } Actions { DontPush Enable SetState "WanderToBank" } } #--------------------------------------------- # Wait for the player to be in range #--------------------------------------------- state WanderToBank { Conditions { } Actions { GotoLocator "xz_rangecheck" SetState "Idle" } } #--------------------------------------------- # Wait for the player to be in range #--------------------------------------------- state Idle { Conditions { if PlayerRangeP1 < 20.0 goto LoadBow if PlayerRangeP2 < 20.0 goto LoadBow } Actions { SetNoOpponent } } #--------------------------------------------- # Primes the bow ready for attack #--------------------------------------------- state LoadBow { Conditions { if Timer > 0.5 goto Think } Actions { ResetTimer PrimeBow } } #--------------------------------------------- # Decides what action to take #--------------------------------------------- state Think { Conditions { if OpponentRange > 20 goto Idle if Random < 0.7 goto AttackOpp } Actions { GetPlayerOpponent FaceOpponent "1.4" } } #--------------------------------------------- # Fire the bow #--------------------------------------------- state AttackOpp { Conditions { if GotOpponent == 0 goto Think if Timer > 1.0 goto LoadBow } Actions { ResetTimer EngageOpponent "goalrange 0.0" "firerange 20.0" FaceOpponent "1.4" } }