IF
  Die()
THEN
  RESPONSE #100
    Shout(66)
END

IF
  Global("BPCHARM","LOCALS",1)
  !StateCheck(Myself,STATE_CHARMED)
THEN
  RESPONSE #100
    SetGlobal("BPCHARM","LOCALS",0)
    ClearActions(Myself)
    Continue()
END

IF
  OR(2)
    Heard([NEUTRAL],79)
    Heard([EVILCUTOFF],79)
  Allegiance(Myself,NEUTRAL)
  !Global("BP_PlotMan","LOCALS",1)
THEN
  RESPONSE #100
    Enemy()
END

IF
  !Allegiance(Myself,ENEMY)
  !Allegiance(Myself,PC)
  OR(2)
    AttackedBy([GOODCUTOFF],DEFAULT)
    Allegiance(LastAttackerOf(Myself),GOODCUTOFF)
THEN
  RESPONSE #100
    Shout(151)
    Enemy()
    Continue()
END

IF
  !Allegiance(Myself,ENEMY)
  !Allegiance(Myself,GOODCUTOFF)
  OR(2)
    HitBy([GOODCUTOFF],CRUSHING)
    Allegiance(LastHitter(Myself),GOODCUTOFF)
THEN
  RESPONSE #100
    Shout(151)
    Enemy()
    Continue()
END

IF
  !Allegiance(Myself,EVILCUTOFF)
THEN
  RESPONSE #100
END

IF
  TargetUnreachable([GOODCUTOFF])
  !See([GOODCUTOFF])
THEN
  RESPONSE #100
END

IF
  !GlobalTimerNotExpired("BPTS","LOCALS")
  Global("BPWatch1","LOCALS",1)
THEN
  RESPONSE #100
    SetGlobal("BPWatch1","LOCALS",0)
    SmallWait(6)
    ClearActions(Myself)
    Continue()
END

IF
  !GlobalTimerNotExpired("BPRW","LOCALS")
  Global("BPWatch","LOCALS",1)
THEN
  RESPONSE #100
    SetGlobal("BPWatch","LOCALS",0)
    SmallWait(6)
END

IF
  ActionListEmpty()
  !GlobalTimerNotExpired("BPT","LOCALS")
  !Detect([GOODCUTOFF])
  !StateCheck(Myself,STATE_INVISIBLE)
  !StateCheck(Myself,STATE_IMPROVEDINVISIBILITY)
  RandomNumLT(10,6)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Hide()
END

IF
  ActionListEmpty()
  HaveSpell(NPC_SET_BOMB_TRAP)
  !GlobalTimerNotExpired("BPTS","LOCALS")
  !Detect([GOODCUTOFF])
  RandomNumLT(12,7)
THEN
  RESPONSE #70
    SetGlobal("BPWatch1","LOCALS",1)
    SetGlobalTimer("BPTS","LOCALS",ONE_ROUND)
    CreateCreatureObjectOffset("SNARE4",Myself,[-5.-5])
    RemoveSpell(NPC_SET_BOMB_TRAP)
    RandomWalkContinuous()
  RESPONSE #30
    RemoveSpell(NPC_SET_BOMB_TRAP)
    SetGlobal("BPWatch1","LOCALS",1)
    SetGlobalTimer("BPTS","LOCALS",4)
    RandomWalkContinuous()
END

IF
  ActionListEmpty()
  HaveSpell(NPC_SET_TIME_TRAP)
  !GlobalTimerNotExpired("BPTS","LOCALS")
  !Detect([GOODCUTOFF])
  RandomNumLT(14,8)
THEN
  RESPONSE #70
    SetGlobal("BPWatch1","LOCALS",1)
    SetGlobalTimer("BPTS","LOCALS",ONE_ROUND)
    ApplySpell(Myself,NPC_SET_TIME_TRAP)
    SmallWait(10)
    RemoveSpell(NPC_SET_TIME_TRAP)
    RandomWalkContinuous()
  RESPONSE #30
    RemoveSpell(NPC_SET_TIME_TRAP)
    SetGlobal("BPWatch1","LOCALS",1)
    SetGlobalTimer("BPTS","LOCALS",4)
    RandomWalkContinuous()
END

IF
  ActionListEmpty()
  HaveSpell(NPC_SET_SPIKE_TRAP)
  !GlobalTimerNotExpired("BPTS","LOCALS")
  !Detect([GOODCUTOFF])
  RandomNumLT(10,6)
THEN
  RESPONSE #70
    SetGlobal("BPWatch1","LOCALS",1)
    SetGlobalTimer("BPTS","LOCALS",ONE_ROUND)
    CreateCreatureObjectOffset("SNARE3",Myself,[-5.-5])
    RemoveSpell(NPC_SET_SPIKE_TRAP)
    RandomWalkContinuous()
  RESPONSE #30
    RemoveSpell(NPC_SET_SPIKE_TRAP)
    SetGlobal("BPWatch1","LOCALS",1)
    SetGlobalTimer("BPTS","LOCALS",4)
    RandomWalkContinuous()
END

IF
  ActionListEmpty()
  HaveSpell(NPC_SET_SNARE)
  !GlobalTimerNotExpired("BPTS","LOCALS")
  !Detect([GOODCUTOFF])
  LevelLT(Myself,21)
  RandomNumLT(8,5)
THEN
  RESPONSE #60
    SetGlobal("BPWatch1","LOCALS",1)
    SetGlobalTimer("BPTS","LOCALS",ONE_ROUND)
    CreateCreatureObjectOffset("SNARE1B",Myself,[-5.-5])
    RemoveSpell(NPC_SET_SNARE)
    RandomWalkContinuous()
  RESPONSE #40
    RemoveSpell(NPC_SET_SNARE)
    SetGlobal("BPWatch1","LOCALS",1)
    SetGlobalTimer("BPTS","LOCALS",4)
    RandomWalkContinuous()
END

IF
  ActionListEmpty()
  HaveSpell(NPC_SET_SNARE)
  !GlobalTimerNotExpired("BPTS","LOCALS")
  !Detect([GOODCUTOFF])
  LevelGT(Myself,20)
  RandomNumLT(8,5)
THEN
  RESPONSE #70
    SetGlobalTimer("BPTS","LOCALS",ONE_ROUND)
    SetGlobal("BPWatch1","LOCALS",1)
    CreateCreatureObjectOffset("SNARE1C",Myself,[-5.-5])
    RemoveSpell(NPC_SET_SNARE)
    RandomWalkContinuous()
  RESPONSE #30
    RemoveSpell(NPC_SET_SNARE)
    SetGlobal("BPWatch1","LOCALS",1)
    SetGlobalTimer("BPTS","LOCALS",4)
    RandomWalkContinuous()
END

IF
  StateCheck(Myself,STATE_INVISIBLE)
  !GlobalTimerNotExpired("BPRW","LOCALS")
  !Detect([GOODCUTOFF])
THEN
  RESPONSE #100
    SetGlobal("BPWatch","LOCALS",1)
    SetGlobalTimer("BPRW","LOCALS",3)
    RandomWalkContinuous()
END

IF
  CheckStatGT(Myself,24,DETECTILLUSIONS)
  CheckStatLT(Myself,40,DETECTILLUSIONS)
  !GlobalTimerNotExpired("BPT","LOCALS")
  Detect([GOODCUTOFF])
  Exists(LastAttackerOf(Myself))
  OR(8)
    !See([GOODCUTOFF])
    !See(LastAttackerOf(Myself))
    StateCheck(NearestEnemyOf(Myself),STATE_MIRRORIMAGE)
    StateCheck(NearestEnemyOf(Myself),STATE_ILLUSIONS)
    StateCheck(NearestEnemyOf(Myself),STATE_BLUR)
    Gender(NearestEnemyOf(Myself),ILLUSIONARY)
    Specifics(NearestEnemyOf(Myself),SIMULACRUM)
    Specifics(NearestEnemyOf(Myself),NEEDS_BREACH)
  RandomNumLT(99,56)
THEN
  RESPONSE #35
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    DisplayStringHead(Myself,@0)
    DisplayString(Myself,31858)
    ReallyForceSpell(Myself,NPC_THIEF_ILLUSIONS)
  RESPONSE #65
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    DisplayStringHead(Myself,31859)
END

IF
  CheckStatGT(Myself,39,DETECTILLUSIONS)
  CheckStatLT(Myself,60,DETECTILLUSIONS)
  !GlobalTimerNotExpired("BPT","LOCALS")
  Detect([GOODCUTOFF])
  Exists(LastAttackerOf(Myself))
  OR(8)
    !See([GOODCUTOFF])
    !See(LastAttackerOf(Myself))
    StateCheck(NearestEnemyOf(Myself),STATE_MIRRORIMAGE)
    StateCheck(NearestEnemyOf(Myself),STATE_ILLUSIONS)
    StateCheck(NearestEnemyOf(Myself),STATE_BLUR)
    Gender(NearestEnemyOf(Myself),ILLUSIONARY)
    Specifics(NearestEnemyOf(Myself),SIMULACRUM)
    Specifics(NearestEnemyOf(Myself),NEEDS_BREACH)
  RandomNumLT(99,56)
THEN
  RESPONSE #50
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    DisplayStringHead(Myself,@0)
    DisplayString(Myself,31858)
    ReallyForceSpell(Myself,NPC_THIEF_ILLUSIONS)
  RESPONSE #50
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    DisplayStringHead(Myself,31859)
END

IF
  CheckStatGT(Myself,59,DETECTILLUSIONS)
  !GlobalTimerNotExpired("BPT","LOCALS")
  Detect([GOODCUTOFF])
  Exists(LastAttackerOf(Myself))
  OR(8)
    !See([GOODCUTOFF])
    !See(LastAttackerOf(Myself))
    StateCheck(NearestEnemyOf(Myself),STATE_MIRRORIMAGE)
    StateCheck(NearestEnemyOf(Myself),STATE_ILLUSIONS)
    StateCheck(NearestEnemyOf(Myself),STATE_BLUR)
    Gender(NearestEnemyOf(Myself),ILLUSIONARY)
    Specifics(NearestEnemyOf(Myself),SIMULACRUM)
    Specifics(NearestEnemyOf(Myself),NEEDS_BREACH)
  RandomNumLT(99,56)
THEN
  RESPONSE #70
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    DisplayStringHead(Myself,@0)
    DisplayString(Myself,31858)
    ReallyForceSpell(Myself,NPC_THIEF_ILLUSIONS)
  RESPONSE #30
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    DisplayStringHead(Myself,31859)
END

IF
  !Detect([GOODCUTOFF])
THEN
  RESPONSE #100
END

IF
  TargetUnreachable(LastSeenBy(Myself))
  Delay(3)
THEN
  RESPONSE #100
    ClearActions(Myself)
    Continue()
END

IF
  Range(NearestEnemyOf(Myself),2)
  OR(2)
    CheckStatGT(NearestEnemyOf(Myself),0,121)
    CheckStatGT(NearestEnemyOf(Myself),0,125)
THEN
  RESPONSE #80
    RunAwayFrom(NearestEnemyOf(Myself),4)
  RESPONSE #20
    Continue()
END

IF
  HasItem("potn52",Myself)
  !GlobalTimerNotExpired("BPT","LOCALS")
  HPPercentLT(Myself,70)
THEN
  RESPONSE #100
    DisplayStringHead(Myself,46150)
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    UseItem("potn52",Myself)
END

IF
  HasItem("potn55",Myself)
  !GlobalTimerNotExpired("BPT","LOCALS")
  HPPercentLT(Myself,60)
THEN
  RESPONSE #100
    DisplayStringHead(Myself,46150)
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    UseItem("potn55",Myself)
END

IF
  ActionListEmpty()
  HPPercentLT(Myself,35)
  See([EVILCUTOFF])
  !GlobalTimerNotExpired("BPW","LOCALS")
  !HasItem("POTN55",Myself)
  !HasItem("POTN52",Myself)
THEN
  RESPONSE #30
    SetGlobalTimer("BPW","LOCALS",ONE_ROUND)
    DisplayStringHead(Myself,72808)
    Shout(123)
  RESPONSE #70
    Continue()
END

IF
  HasItem("POTN17",Myself) 
  StateCheck(Myself,STATE_POISONED)
  !GlobalTimerNotExpired("POT","LOCALS")
THEN
  RESPONSE #100
    SetGlobalTimer("POT","LOCALS",ONE_ROUND)
    UseItem("POTN17",Myself)
END

IF
  HasItem("POTN20",Myself)
  StateCheck(Myself,STATE_POISONED)
  !GlobalTimerNotExpired("POT","LOCALS")
THEN
  RESPONSE #100
    SetGlobalTimer("POT","LOCALS",ONE_ROUND)
    UseItem("POTN20",Myself)
END

IF
  ActionListEmpty()
  StateCheck(Myself,STATE_POISONED)
  !GlobalTimerNotExpired("POIS","LOCALS")
  See([EVILCUTOFF])
  !HasItem("POTN17",Myself)
  !HasItem("POTN20",Myself)
THEN
  RESPONSE #100
    Shout(83)
    DisplayStringHead(Myself,@1)
    SetGlobalTimer("POIS","LOCALS",ONE_ROUND)
END

IF
  ActionListEmpty()
  HaveSpell(WARRIOR_RESIST_MAGIC)
  CheckStatLT(Myself,50,RESISTMAGIC)
  !GlobalTimerNotExpired("BPT","LOCALS")
  RandomNum(3,1)
  OR(5)
    See([GOODCUTOFF.0.0.CLERIC_ALL])
    See([GOODCUTOFF.0.0.BARD_ALL])
    See([GOODCUTOFF.0.0.DRUID_ALL])
    See([GOODCUTOFF.0.0.LONG_BOW])
    See([GOODCUTOFF.0.0.SORCERER])
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(Myself,WARRIOR_RESIST_MAGIC)
END

IF
  ActionListEmpty()
  HaveSpell(WARRIOR_HARDINESS)
  !GlobalTimerNotExpired("BPT","LOCALS")
  !GlobalTimerNotExpired("HARD","LOCALS")
  !CombatCounter(0)
  RandomNumLT(16,6)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    DisplayStringHead(Myself,63953)
    Spell(Myself,WARRIOR_HARDINESS)
    SetGlobalTimer("HARD","LOCALS",ONE_TURN)
END

IF
  ActionListEmpty()
  HasItem("potn10",Myself)
  !GlobalTimerNotExpired("BPT","LOCALS")
  !StateCheck(Myself,STATE_IMPROVEDINVISIBILITY)
  !StateCheck(Myself,STATE_INVISIBLE)
  RandomNumLT(62,21)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    DisplayStringHead(Myself,46150)
    UseItem("potn10",Myself)
END

IF
  ActionListEmpty()
  HasItem("POTN44",Myself)  // ~Potion of Strength~
  !GlobalTimerNotExpired("BPT","LOCALS")
  !CheckStatGT(Myself,17,STR)
  RandomNum(4,1)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    UseItem("POTN44",Myself)  // ~Potion of Strength~
    DisplayStringHead(Myself,46150)  // ~quaffs a potion~
END

IF
  ActionListEmpty()
  HasItem("POTN19",Myself)  // ~Potion of Agility~
  !GlobalTimerNotExpired("BPT","LOCALS")
  CheckStatLT(Myself,18,DEX)
  RandomNumLT(43,11)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    UseItem("POTN19",Myself)  // ~Potion of Agility~
    DisplayStringHead(Myself,46150)  // ~quaffs a potion~
END

IF
  ActionListEmpty()
  HasItem("POTN28",Myself)  // ~Potion of Fortitude~
  !GlobalTimerNotExpired("BPT","LOCALS")
  !CheckStatLT(Myself,18,CON)
  RandomNumLT(46,12)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    UseItem("POTN28",Myself)  // ~Potion of Fortitude~
    DisplayStringHead(Myself,46150)  // ~quaffs a potion~
END

IF
  ActionListEmpty()
  HasItem("POTN31",Myself)  // ~Potion of Insulation~
  !GlobalTimerNotExpired("BPT","LOCALS")
  CheckStatLT(Myself,30,RESISTELECTRICITY)
  OR(5)
    See([GOODCUTOFF.0.0.CLERIC_ALL])
    See([GOODCUTOFF.0.0.BARD_ALL])
    See([GOODCUTOFF.0.0.DRUID_ALL])
    See([GOODCUTOFF.0.0.LONG_BOW])
    See([GOODCUTOFF.0.0.SORCERER])
  RandomNumLT(66,12)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    UseItem("POTN31",Myself)  // ~Potion of Insulation~
    DisplayStringHead(Myself,46150)  // ~quaffs a potion~
END

IF
  ActionListEmpty()
  OR(2)
    Class(Myself,FIGHTER_THIEF)
    Class(Myself,FIGHTER_MAGE_THIEF)
  HitBy([GOODCUTOFF],CRUSHING)
  !GlobalTimerNotExpired("RANG","LOCALS")
  !StateCheck(Myself,STATE_POISONED)
  OR(2)
    See(LastAttackerOf(Myself))
    See(LastHitter(Myself))
  !Range(LastSeenBy(Myself),7)
  !TargetUnreachable(LastSeenBy(Myself))
  !InWeaponRange(LastSeenBy(Myself))
  HPGT(LastSeenBy(Myself),0)
THEN
  RESPONSE #50
    DisplayStringHead(Myself,@2)
    SetGlobalTimer("RANG","LOCALS",ONE_ROUND)
  RESPONSE #50
    DisplayStringHead(Myself,@3)
    SetGlobalTimer("RANG","LOCALS",ONE_ROUND)
  RESPONSE #25
    DisplayStringHead(Myself,@4)
    SetGlobalTimer("RANG","LOCALS",ONE_ROUND)
  RESPONSE #25
    DisplayStringHead(Myself,@5)
    SetGlobalTimer("RANG","LOCALS",ONE_ROUND)
  RESPONSE #50
    DisplayStringHead(Myself,@6)
    SetGlobalTimer("RANG","LOCALS",THREE_ROUNDS)
    EquipMostDamagingMelee()
    MoveToObject(LastSeenBy(Myself))
    AttackReevaluate(LastSeenBy(Myself),180)
END

IF
  See(NearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
    Continue()
END

IF
  RandomNumLT(32,21)
  OR(3)
    Heard(ThirdNearest([EVILCUTOFF]),124)
    Heard(SecondNearest([EVILCUTOFF]),124)
    Heard([EVILCUTOFF],124)
  HPGT(LastHeardBy(Myself),1)
  Range(LastHeardBy(Myself),20)
  HPGT(LastHitter(LastHeardBy(Myself)),1)
  !See(LastHitter(LastHeardBy(Myself)))
  HPGT(LastAttackerOf(LastHeardBy(Myself)),1)
  !See(LastAttackerOf(LastHeardBy(Myself)))
  False()
THEN
  RESPONSE #100
    Continue()
END

IF
  RandomNumLT(31,21)
  OR(6)
    See(NearestEnemyOf(Myself))
    See(WeakestOf)
    See(WorstAC)
    See(MostDamagedOf)
    See(LastAttackerOf(Myself))
    See(LastHitter(Myself))
  RandomNumLT(28,22)
  OR(4)
    See([GOODCUTOFF.0.0.0.0.SUMMONED_DEMON])
    See([GOODCUTOFF.0.0.0.0.SUMMONED])
    See([GOODCUTOFF.0.0.0.SIMULACRUM])
    See([GOODCUTOFF.0.0.0.0.ILLUSIONARY])
  RandomNumLT(29,23)
  OR(7)
    See([PC.0.0.RANGER_ALL])
    See([PC.0.0.PALADIN_ALL])
    See([PC.0.0.BARD_ALL])
    See([PC.0.0.DRUID_ALL])
    See([PC.0.0.CLERIC_ALL])
    See([PC.0.0.LONG_BOW])
    See([PC.0.0.SORCERER])
  RandomNumLT(30,16)
  See(Protagonist)
  RandomNumLT(26,10)
  OR(4)
    See([GOODCUTOFF.0.0.RANGER_ALL])
    See([GOODCUTOFF.0.0.DRUID_ALL])
    See([GOODCUTOFF.0.0.PALADIN_ALL])
    See([GOODCUTOFF.0.0.CLERIC_ALL])
  RandomNumLT(27,10)
  OR(3)
    See([GOODCUTOFF.0.0.MONK])
    See([GOODCUTOFF.0.0.BARD_ALL])
    See([GOODCUTOFF.0.0.THIEF_ALL])
  RandomNumLT(24,9)
  OR(3)
    See(StrongestOf)
    See(BestAC)
    See(LeastDamagedOf)
  RandomNumLT(25,9)
  See(WeakestOf)
  RandomNumLT(23,8)
  See(WorstAC)
  RandomNumLT(21,8)
  See(MostDamagedOf)
  RandomNumLT(32,11)
  OR(2)
    See(TenthNearest([GOODCUTOFF.0.0.LONG_BOW]))
    See(TenthNearest([GOODCUTOFF.0.0.SORCERER]))
  RandomNumLT(20,8)
  See(TenthNearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
    Continue()
END

IF
  OR(3)
    Allegiance(LastSeenBy(Myself),ENEMY)
    Allegiance(LastSeenBy(Myself),EVILCUTOFF)
    Allegiance(LastSeenBy(Myself),GOODBUTRED)
THEN
  RESPONSE #100
END

IF
  StateCheck(LastSeenBy(Myself),STATE_CHARMED)
THEN
  RESPONSE #80
    Continue()
  RESPONSE #20
END

IF
  ActionListEmpty()
  OR(2)
    StateCheck(Myself,STATE_INVISIBLE)
    StateCheck(Myself,STATE_IMPROVEDINVISIBILITY)
  HPPercentGT(Myself,25)
THEN
  RESPONSE #100
    EquipMostDamagingMelee()
    MoveToObject(LastSeenBy(Myself))
    SmallWait(25)
    AttackOneRound(LastSeenBy(Myself))
END

IF
  ActionListEmpty()
  HaveSpell(ASSASSIN_POISON)
  CheckStat(LastSeenBy(Myself),0,128)
  CheckStat(Myself,0,SCRIPTINGSTATE4)
  !GlobalTimerNotExpired("BPT","LOCALS")
  RandomNumLT(42,28)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(Myself,ASSASSIN_POISON)
    DisplayStringHead(Myself,52056)
    AttackOneRound(LastSeenBy(Myself))
    AttackReevaluate(LastSeenBy(Myself),45)
END

IF
  ActionListEmpty()
  HPPercentLT(Myself,35)
  !GlobalTimerNotExpired("BPW","LOCALS")
  Detect(NearestEnemyOf(Myself))
  !StateCheck(Myself,STATE_INVISIBLE)
  !StateCheck(Myself,STATE_IMPROVEDINVISIBILITY)
THEN
  RESPONSE #70
    SetGlobalTimer("BPW","LOCALS",ONE_ROUND)
    DisplayStringHead(Myself,49767)
    Shout(124)
    RunAwayFromNoInterrupt(NearestEnemyOf(Myself),90)
  RESPONSE #10
    SetGlobalTimer("BPW","LOCALS",9)
    DisplayStringHead(Myself,@7)
    Shout(124)
    EquipMostDamagingMelee()
    Attack(LastHitter(Myself))
  RESPONSE #20
    SetGlobalTimer("BPW","LOCALS",9)
    DisplayStringHead(Myself,49766)
    Shout(123)
    AttackReevaluate(LastSeenBy(Myself),45)
END

IF
  ActionListEmpty()
  CheckStatGT(LastSeenBy(Myself),10,180)
  CheckStatLT(Myself,11,180)
THEN
  RESPONSE #100
    EquipRanged()
    AttackOneRound(LastSeenBy(Myself))
  RESPONSE #50
    EquipRanged()
    AttackOneRound(LastSeenBy(Myself))
    AttackOneRound(LastSeenBy(Myself))
END

IF
  ActionListEmpty()
  OR(3)
    !Range(NearestEnemyOf(Myself),5)
    CheckStatGT(NearestEnemyOf(Myself),0,121)
    CheckStatGT(LastSeenBy(Myself),0,125)
THEN
  RESPONSE #100
    EquipRanged()
    AttackOneRound(LastSeenBy(Myself))
  RESPONSE #50
    EquipRanged()
    AttackOneRound(LastSeenBy(Myself))
    AttackOneRound(LastSeenBy(Myself))
END

IF
  OR(2)
    CheckStatGT(NearestEnemyOf(Myself),0,121)
    CheckStatGT(LastSeenBy(Myself),0,125)
THEN
  RESPONSE #25
    Continue()
  RESPONSE #75
END

IF
  ActionListEmpty()
  !Range(LastSeenBy(Myself),10)
THEN
  RESPONSE #60
    EquipMostDamagingMelee()
    AttackOneRound(NearestEnemyOf(Myself))
  RESPONSE #30
    EquipMostDamagingMelee()
    AttackOneRound(NearestEnemyOf(Myself))
    AttackOneRound(NearestEnemyOf(Myself))
  RESPONSE #90
    EquipMostDamagingMelee()
    MoveToObjectNoInterrupt(LastSeenBy(Myself))
    AttackReevaluate(LastSeenBy(Myself),135)
END

IF
  ActionListEmpty()
THEN
  RESPONSE #100
    EquipMostDamagingMelee()
    AttackOneRound(LastSeenBy(Myself))
  RESPONSE #50
    EquipMostDamagingMelee()
    AttackOneRound(LastSeenBy(Myself))
    AttackOneRound(LastSeenBy(Myself))
END
