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

IF
  Difficulty(EASIEST)
THEN
  RESPONSE #100
    ChangeAIScript("BPWTSIGT",DEFAULT)
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([EVILCUTOFF],79)
    Heard([NEUTRAL],79)
  Allegiance(Myself,NEUTRAL)
  !Global("BP_PlotMan","LOCALS",1)
THEN
  RESPONSE #100
    Enemy()
END

IF
  GlobalTimerNotExpired("BPCHASE","LOCALS")
  Global("BPCHASER","LOCALS",1)
  OR(2)
    See([GOODCUTOFF])
    See(LastHitter(Myself))
  !General(Myself,HUMANOID)
  !General(Myself,GIANTHUMANOID)
THEN
  RESPONSE #100
    DisplayStringHead(Myself,@0)
    SetGlobal("BPCHASER","LOCALS",0)
    AttackReevaluate(LastSeenBy(Myself),15)
END

IF
  GlobalTimerExpired("BPCHASE","LOCALS")
  Global("BPCHASER","LOCALS",1)
  !See([GOODCUTOFF])
  !See(LastHitter(Myself))
THEN
  RESPONSE #100
    SetGlobal("BPCHASER","LOCALS",0)
    ClearActions(Myself)
    Continue()
END

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

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

IF
  TookDamage()
  Global("BPCHASER","LOCALS",0)
  !See(LastHitter(Myself))
  !See([GOODCUTOFF])
THEN
  RESPONSE #75
    DisplayStringHead(Myself,@1)
    SetGlobalTimer("BPCHASE","LOCALS",12)
    SetGlobal("BPCHASER","LOCALS",1)
    MoveToObject(LastHitter(Myself))
  RESPONSE #25
    DisplayStringHead(Myself,@1)
    RunAwayFrom(LastHitter(Myself),45)
END

IF
  CheckStatGT(Myself,10,180)
  CheckStatGT(Myself,5,INT)
  OR(2)
    See(LastAttackerOf(Myself))
    See(LastHitter(Myself))
  CheckStatLT(LastSeenBy(Myself),11,180)
  !GlobalTimerNotExpired("BPCHASE","LOCALS")
THEN
  RESPONSE #100
    SetGlobalTimer("BPCHASE","LOCALS",TWO_ROUNDS)
    DisplayStringHead(Myself,@2)
    EquipMostDamagingMelee()
    MoveToObject(LastSeenBy(Myself))
    AttackOneRound(LastSeenBy(Myself))
END

IF
  CheckStatGT(Myself,10,180)
  CheckStatGT(Myself,5,INT)
  OR(2)
    See(TenthNearest([GOODCUTOFF]))
    See(TenthNearest([PC]))
  CheckStatLT(LastSeenBy(Myself),11,180)
  !GlobalTimerNotExpired("BPCHASE","LOCALS")
THEN
  RESPONSE #100
    SetGlobalTimer("BPCHASE","LOCALS",TWO_ROUNDS)
    DisplayStringHead(Myself,@2)
    EquipMostDamagingMelee()
    MoveToObject(LastSeenBy(Myself))
    AttackOneRound(LastSeenBy(Myself))
END

IF
  CheckStatGT(Myself,10,180)
  CheckStatGT(Myself,5,INT)
  See(TenthNearest)
  CheckStatLT(TenthNearest,11,180)
  !GlobalTimerNotExpired("BPCHASE","LOCALS")
THEN
  RESPONSE #100
    SetGlobalTimer("BPCHASE","LOCALS",ONE_ROUND)
    DisplayStringHead(Myself,@2)
    MoveToObject(TenthNearest)
END

//////////////CLOUDLIKE  EFFECTS//////////////////////

IF
  CheckStat(Myself,11,180) // I'm in a stinking cloud
  CheckStatGT(Myself,5,INT)
  !StateCheck(Myself,STATE_SLEEPING) // not yet affected
  CheckStatGT(Myself,4,SAVEVSSPELL) //and I got a reasonable chance of failing a save throw (25%+)
  OR(2)
    Detect(NearestEnemyOfType([0.0.MORNINGSTAR.FAIRY_NYMPH.65]))
    Detect(NearestMyGroupOfType([0.0.MORNINGSTAR.FAIRY_NYMPH.65]))
  Range(LastSeenBy(Myself),16)
THEN
  RESPONSE #100
    SetInterrupt(FALSE)
    RunAwayFrom(LastSeenBy(Myself),30)
    SetInterrupt(TRUE)
END

IF
  CheckStatGT(Myself,11,180) // I'm in a web,entangle, or grease spell
  CheckStatLT(Myself,15,180)
  CheckStatGT(Myself,5,INT)
  CheckStatLT(Myself,1,131) // I don't have free action
  CheckStatLT(Myself,1,WEB) //and not webbed up
  CheckStatLT(Myself,1,ENTANGLE) //nor entangled --I can move
  CheckStatGT(Myself,4,SAVEVSSPELL) //and I got a reasonable chance of failing a save throw (25%+)
  OR(3)
    Detect([0.0.MORNINGSTAR.FAIRY_NYMPH.65])
    Detect(NearestEnemyOfType([0.0.MORNINGSTAR.FAIRY_NYMPH.65]))
    Detect(NearestMyGroupOfType([0.0.MORNINGSTAR.FAIRY_NYMPH.65]))
  Range(LastSeenBy(Myself),16)
THEN
  RESPONSE #100
    SetInterrupt(FALSE)
    RunAwayFrom(LastSeenBy(Myself),30)
    SetInterrupt(TRUE)
END

IF
  CheckStat(Myself,15,180) // I'm in an Ice Storm
  CheckStatGT(Myself,5,INT)
  CheckStatLT(Myself,100,RESISTCOLD) // Not Immune
  OR(3)
    Detect([0.0.MORNINGSTAR.FAIRY_NYMPH.65])
    Detect(NearestEnemyOfType([0.0.MORNINGSTAR.FAIRY_NYMPH.65]))
    Detect(NearestMyGroupOfType([0.0.MORNINGSTAR.FAIRY_NYMPH.65]))
  Range(LastSeenBy(Myself),16)
THEN
  RESPONSE #100
    SetInterrupt(FALSE)
    RunAwayFrom(LastSeenBy(Myself),30)
    SetInterrupt(TRUE)
END

IF
  CheckStat(Myself,16,180) // I'm in a Cloudkill or Death Fog
  CheckStatGT(Myself,5,INT)
  CheckStatLT(Myself,100,RESISTPOISON) // Not Immune
  OR(3)
    Detect([0.0.MORNINGSTAR.FAIRY_NYMPH.65])
    Detect(NearestEnemyOfType([0.0.MORNINGSTAR.FAIRY_NYMPH.65]))
    Detect(NearestMyGroupOfType([0.0.MORNINGSTAR.FAIRY_NYMPH.65]))
  Range(LastSeenBy(Myself),16)
THEN
  RESPONSE #100
    SetInterrupt(FALSE)
    RunAwayFrom(LastSeenBy(Myself),30)
    SetInterrupt(TRUE)
END

IF
  CheckStat(Myself,17,180) // I'm in a Death Fog
  CheckStatGT(Myself,5,INT)
  CheckStatLT(Myself,100,RESISTACID) // Not Immune
  OR(3)
    Detect([0.0.MORNINGSTAR.FAIRY_NYMPH.65])
    Detect(NearestEnemyOfType([0.0.MORNINGSTAR.FAIRY_NYMPH.65]))
    Detect(NearestMyGroupOfType([0.0.MORNINGSTAR.FAIRY_NYMPH.65]))
  Range(LastSeenBy(Myself),16)
THEN
  RESPONSE #100
    SetInterrupt(FALSE)
    RunAwayFrom(LastSeenBy(Myself),30)
    SetInterrupt(TRUE)
END

IF
  CheckStat(Myself,18,180) // Incendiary Cloud, Meteor Swarm or Fire Storm -- bad stuff
  CheckStatGT(Myself,5,INT)
  CheckStatLT(Myself,100,RESISTFIRE) // Not Immune
  OR(3)
    Detect([0.0.MORNINGSTAR.FAIRY_NYMPH.65])
    Detect(NearestEnemyOfType([0.0.MORNINGSTAR.FAIRY_NYMPH.65]))
    Detect(NearestMyGroupOfType([0.0.MORNINGSTAR.FAIRY_NYMPH.65]))
  Range(LastSeenBy(Myself),16)
THEN
  RESPONSE #100
    SetInterrupt(FALSE)
    RunAwayFrom(LastSeenBy(Myself),30)
    SetInterrupt(TRUE)
END

// This is to try and keep them from going back in to whomp somebody
IF
  CheckStatLT(Myself,11,180) // No longer in the cloud effects
  CheckStatGT(Myself,5,INT)
  OR(3)
    Detect([0.0.MORNINGSTAR.FAIRY_NYMPH.65])
    Detect(NearestEnemyOfType([0.0.MORNINGSTAR.FAIRY_NYMPH.65]))
    Detect(NearestMyGroupOfType([0.0.MORNINGSTAR.FAIRY_NYMPH.65]))
  !Range(LastSeenBy(Myself),16)
  Exists([EVILCUTOFF])
  !Range(NearestEnemyOf(Myself),2)
THEN
  RESPONSE #100
    EquipRanged()  //use your bow, then
    SmallWait(3)
    Continue()
END

//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////

IF
  OR(2)
    !Allegiance(Myself,EVILCUTOFF)
    !Detect([GOODCUTOFF])
THEN
  RESPONSE #100
END

IF
  CheckStat(Myself,1,127)
  See([EVILCUTOFF.0.0.MAGE_ALL.0.ILLUSIONARY])
  Range(LastSeenBy(Myself),2)
THEN
  RESPONSE #100
    ChangeSpecifics(LastSeenBy(Myself),NEEDS_BREACH)
    ChangeGender(LastSeenBy(Myself),EXTRA2)
    ActionOverride(LastSeenBy(Myself),ChangeAIScript("BPMISLED",OVERRIDE))
    SpellNoDecRES("SPMISLED",Myself)
    RunAwayFrom(LastSeenBy(Myself),20)
END

IF
  General(Myself,UNDEAD)
  OR(2)
    TurnedBy([GOODCUTOFF.0.0.CLERIC_ALL])
    TurnedBy([GOODCUTOFF.0.0.PALADIN_ALL])
  Global("BPTURNED","LOCALS",0)
  !GlobalTimerNotExpired("BPTT","LOCALS")
THEN
  RESPONSE #100
    SetGlobal("BPTURNED","LOCALS",1)
    SetGlobalTimer("BPTT","LOCALS",FIVE_ROUNDS)
END

IF
  General(Myself,UNDEAD)
  OR(2)
    TurnedBy([GOODCUTOFF.0.0.CLERIC_ALL])
    TurnedBy([GOODCUTOFF.0.0.PALADIN_ALL])
  Global("BPTURNED","LOCALS",1)
  OR(2)
    !GlobalTimerNotExpired("BPTT","LOCALS")
    TookDamage()
THEN
  RESPONSE #100
    SetGlobalTimer("BPTT","LOCALS",0)
    SetGlobal("BPTURNED","LOCALS",0)
END

IF
  Range(NearestEnemyOf(Myself),2)
  OR(2)
    CheckStatGT(NearestEnemyOf(Myself),0,121)
    CheckStatGT(NearestEnemyOf(Myself),0,125)
THEN
  RESPONSE #70
    RunAwayFrom(NearestEnemyOf(Myself),5)
  RESPONSE #30
    Continue()
END

IF
  General(Myself,UNDEAD)
  Global("BPTURNED","LOCALS",1)
  See([GOODCUTOFF])
  Range(LastSeenBy(Myself),15)
  !AttackedBy(LastSeenBy(Myself),DEFAULT)
THEN
  RESPONSE #100
    RunAwayFrom(LastSeenBy(Myself),10)
END

IF
  General(Myself,UNDEAD)
  Global("BPTURNED","LOCALS",1)
THEN
  RESPONSE #100
END

IF
  Global("SNAFU","LOCALS",0)
  OR(4)
    CheckStatGT(Myself,1,120)
    CheckStatGT(Myself,60,SPELLFAILUREMAGE)
    CheckStatGT(Myself,0,SCRIPTINGSTATE4)
    StateCheck(Myself,STATE_SILENCED)
THEN
  RESPONSE #100
    SetGlobal("SNAFU","LOCALS",1)
END

IF
  Global("SNAFU","LOCALS",1)
  CheckStatLT(Myself,2,120)
  CheckStatLT(Myself,61,SPELLFAILUREMAGE)
  CheckStat(Myself,0,SCRIPTINGSTATE4)
  !StateCheck(Myself,STATE_SILENCED)
THEN
  RESPONSE #100
    SetGlobal("SNAFU","LOCALS",0)
END

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

IF
  ActionListEmpty()
  HaveSpell(WIZARD_DIMENSION_DOOR)
  !GlobalTimerNotExpired("BPDD","LOCALS")
  Global("SNAFU","LOCALS",0)
  Range(NearestEnemyOf(Myself),5)
  !Range([EVILCUTOFF],5)
  HPPercentLT(Myself,50)
  OR(2)
    See(TenthNearestMyGroupOfType([EVILCUTOFF]))
    See(LastSummonerOf(Myself))
  !Range(LastSeenBy(Myself),10)
THEN
  RESPONSE #80
    Spell(LastSeenBy(Myself),WIZARD_DIMENSION_DOOR)
    SetGlobalTimer("BPDD","LOCALS",TWO_ROUNDS)
  RESPONSE #20
    Continue()
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_MISLEAD)
  !GlobalTimerNotExpired("BPT","LOCALS")
  Global("SNAFU","LOCALS",0)
  RandomNumLT(100,34)
  CheckStat(Myself,0,127)
  !StateCheck(Myself,0x400010)
  !Specifics(Myself,207)
  NumCreatureLT([EVILCUTOFF.0.0.0.207],1)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(Myself,WIZARD_MISLEAD)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_SHADOW_DOOR)
  !GlobalTimerNotExpired("BPT","LOCALS")
  !GlobalTimerNotExpired("BPIP","LOCALS")
  Global("SNAFU","LOCALS",0)
  RandomNumLT(4,3)
  !StateCheck(Myself,0x400010)
  AttackedBy([ANYTHING],DEFAULT)
  !StateCheck(Myself,STATE_BLUR)
  !StateCheck(Myself,STATE_MIRRORIMAGE)
  !StateCheck(Myself,0x400010)
  CheckStatLT(Myself,76,SPELLFAILUREMAGE)
  CheckStatLT(NearestEnemyOf,1,SEEINVISIBLE)
  CheckStatLT(SecondNearestEnemyOf,1,SEEINVISIBLE)
  CheckStatLT(ThirdNearestEnemyOf,1,SEEINVISIBLE)
THEN
  RESPONSE #100
    SetGlobalTimer("BPIP","LOCALS",15)
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(Myself,WIZARD_SHADOW_DOOR)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_SPELL_DEFLECTION)
  !GlobalTimerNotExpired("BPT","LOCALS")
  Global("SNAFU","LOCALS",0)
  RandomNumLT(5,3)
  OR(5)
    Exists(NearestEnemyOfType([GOODCUTOFF.0.0.LONG_BOW]))
    Exists(NearestEnemyOfType([GOODCUTOFF.0.0.CLERIC_ALL]))
    Exists(NearestEnemyOfType([GOODCUTOFF.0.0.BARD_ALL]))
    Exists(NearestEnemyOfType([GOODCUTOFF.0.0.DRUID_ALL]))
    Exists(NearestEnemyOfType([GOODCUTOFF.0.0.SORCERER]))
  CheckStat(Myself,0,129)
  CheckStat(Myself,0,164)
  CheckStat(Myself,0,116)
  CheckStatLT(Myself,1,116)
  CheckStatLT(Myself,75,SPELLFAILUREMAGE)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(Myself,WIZARD_SPELL_DEFLECTION)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_IMPROVED_INVISIBILITY)
  !GlobalTimerNotExpired("BPT","LOCALS")
  !GlobalTimerNotExpired("BPIP","LOCALS")
  Global("SNAFU","LOCALS",0)
  RandomNumLT(10,4)
  AttackedBy([ANYTHING],DEFAULT)
  !StateCheck(Myself,STATE_BLUR)
  !StateCheck(Myself,STATE_MIRRORIMAGE)
  !StateCheck(Myself,0x400010)
  CheckStatLT(Myself,75,SPELLFAILUREMAGE)
  CheckStatLT(NearestEnemyOf,1,SEEINVISIBLE)
  CheckStatLT(SecondNearestEnemyOf,1,SEEINVISIBLE)
  CheckStatLT(ThirdNearestEnemyOf,1,SEEINVISIBLE)
THEN
  RESPONSE #100
    SetGlobalTimer("BPIP","LOCALS",15)
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(Myself,WIZARD_IMPROVED_INVISIBILITY)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_HASTE)
  !GlobalTimerNotExpired("BPT","LOCALS")
  Global("SNAFU","LOCALS",0)
  RandomNumLT(15,5)
  !StateCheck(Myself,STATE_HASTED)
  CheckStat(Myself,0,IMPROVEDHASTE)
  CheckStatLT(Myself,75,SPELLFAILUREMAGE)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(Myself,WIZARD_HASTE)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_PROTECTION_FROM_NORMAL_WEAPONS)
  !GlobalTimerNotExpired("BPT","LOCALS")
  Global("SNAFU","LOCALS",0)
  RandomNumLT(13,4)
  CheckStatLT(Myself,1,181)
  CheckStatLT(Myself,1,128)
  Range(LastAttackerOf(Myself),3)
  CheckStatLT(LastAttackerOf(Myself),1,109)
  CheckStatLT(Myself,75,SPELLFAILUREMAGE)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(Myself,WIZARD_PROTECTION_FROM_NORMAL_WEAPONS)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_PROTECTION_FROM_ELECTRICITY)
  !GlobalTimerNotExpired("BPT","LOCALS")
  Global("SNAFU","LOCALS",0)
  CheckStatLT(Myself,100,RESISTELECTRICITY)
  OR(2)
    HitBy([ANYONE],ELECTRICITY)
    RandomNumLT(17,4)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(Myself,WIZARD_PROTECTION_FROM_ELECTRICITY)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_GHOST_ARMOR)
  !GlobalTimerNotExpired("BPT","LOCALS")
  Global("SNAFU","LOCALS",0)
  RandomNumLT(19,6)
  CheckStatLT(Myself,4,SCRIPTINGSTATE5)
  CheckStatGT(Myself,2,ARMORCLASS)
  OR(2)
    NumCreatureGT([GOODCUTOFF],2)
    Range(NearestEnemyOf(Myself),6)
  CheckStatLT(Myself,75,SPELLFAILUREMAGE)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(Myself,WIZARD_GHOST_ARMOR)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_MIRROR_IMAGE)
  !GlobalTimerNotExpired("BPT","LOCALS")
  Global("SNAFU","LOCALS",0)
  RandomNumLT(22,5)
  OR(6)
    Range([GOODCUTOFF.0.0.THIEF_ALL],4)
    Range([GOODCUTOFF.0.0.FIGHTER_ALL],4)
    Range([GOODCUTOFF.0.0.PALADIN_ALL],4)
    Range([GOODCUTOFF.0.0.MONK],4)
    See([GOODCUTOFF.0.0.RANGER_ALL])
    HitBy([ANYONE],MISSILE)
  !StateCheck(Myself,STATE_MIRRORIMAGE)
  !StateCheck(Myself,STATE_BLUR)
  !StateCheck(Myself,0x400010)
  CheckStatLT(Myself,75,SPELLFAILUREMAGE)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(Myself,WIZARD_MIRROR_IMAGE)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_BLUR)
  !GlobalTimerNotExpired("BPT","LOCALS")
  Global("SNAFU","LOCALS",0)
  RandomNumLT(23,5)
  OR(6)
    Range([GOODCUTOFF.0.0.THIEF_ALL],4)
    Range([GOODCUTOFF.0.0.FIGHTER_ALL],4)
    Range([GOODCUTOFF.0.0.PALADIN_ALL],4)
    Range([GOODCUTOFF.0.0.MONK],4)
    See([GOODCUTOFF.0.0.RANGER_ALL])
    HitBy([ANYONE],MISSILE)
  !StateCheck(Myself,STATE_BLUR)
  !StateCheck(Myself,STATE_MIRRORIMAGE)
  !StateCheck(Myself,0x400010)
  NumCreatureGT([EVILCUTOFF],2)
  CheckStatLT(Myself,75,SPELLFAILUREMAGE)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(Myself,WIZARD_BLUR)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_HASTE)
  !GlobalTimerNotExpired("BPT","LOCALS")
  Global("SNAFU","LOCALS",0)
  RandomNumLT(17,4)
  OR(2)
    CheckStatGT(Myself,0,IMPROVEDHASTE)
    StateCheck(Myself,STATE_HASTED)
  Detect(NearestMyGroupOfType([EVILCUTOFF]))
  Range(LastSeenBy(Myself),10)
  !StateCheck(LastSeenBy(Myself),STATE_HASTED)
  CheckStat(LastSeenBy(Myself),0,IMPROVEDHASTE)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(LastSeenBy(Myself),WIZARD_HASTE)
END

IF
  OR(3)
    !Race(NearestEnemyOf(Myself),MORNINGSTAR)
    !Class(NearestEnemyOf(Myself),FAIRY_NYMPH)
    !Specifics(NearestEnemyOf(Myself),65)
  See(NearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
    Continue()
END

IF
  RandomNumLT(31,21)
  OR(8)
    See(NearestEnemyOf(Myself))
    See(MostDamagedOf)
    See(WorstAC)
    See(LastTargetedBy(Myself))
    See(LastAttackerOf(Myself))
    See(LastHitter(Myself))
    See([0.0.0.0.0.0.LAWFUL_GOOD])
    See([0.0.0.PALADIN_ALL])
  RandomNumLT(27,22)
  OR(3)
    See([GOODCUTOFF.0.0.0.0.SUMMONED])
    See([GOODCUTOFF.0.0.0.SIMULACRUM])
    See([GOODCUTOFF.0.0.0.0.ILLUSIONARY])
  RandomNumLT(29,24)
  OR(10)
    See([PC.0.0.BARD_ALL])
    See([PC.0.0.DRUID_ALL])
    See([PC.0.0.RANGER_ALL])
    See([PC.0.0.MAGE_ALL])
    See([PC.0.0.SORCERER])
    See([PC.0.0.CLERIC_ALL])
    See([PC.0.0.CLERIC_MAGE])
    See([PC.0.0.CLERIC_RANGER])
    See([PC.0.0.PALADIN_ALL])
    See([PC.0.0.CLERIC.0.0.MASK_GOOD])
  RandomNumLT(30,16)
  See(Nearest)
  RandomNumLT(26,14)
  OR(3)
    See([GOODCUTOFF.0.0.RANGER_ALL])
    See([GOODCUTOFF.0.0.PALADIN_ALL])
    See([GOODCUTOFF.0.0.CLERIC.0.0.MASK_GOOD])
  RandomNumLT(28,10)
  OR(3)
    See([GOODCUTOFF.0.0.MONK])
    See([GOODCUTOFF.0.0.THIEF_ALL])
    See([GOODCUTOFF.0.0.BARD_ALL])
  RandomNumLT(24,9)
  OR(3)
    See(StrongestOf)
    See(BestAC)
    See(LeastDamagedOf)
  RandomNumLT(25,9)
  See(WeakestOf)
  RandomNumLT(23,8)
  See(WorstAC)
  RandomNumLT(22,8)
  See(MostDamagedOf)
  RandomNumLT(32,11)
  See(TenthNearest([GOODCUTOFF.0.0.PALADIN_ALL]))
  RandomNumLT(34,12)
  See(TenthNearest([GOODCUTOFF.0.0.MAGE_ALL]))
  RandomNumLT(35,12)
  See(TenthNearest([GOODCUTOFF.0.0.CLERIC_ALL]))
  RandomNumLT(33,12)
  See(TenthNearest([0.0.0.0.0.0.LAWFUL_GOOD]))
  False()
THEN
  RESPONSE #100
    Continue()
END

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

IF
  ActionListEmpty()
  OR(2)
    Global("SNAFU","LOCALS",1)
    HasItem("GHOULT",Myself)
  !HaveAnySpells()
THEN
  RESPONSE #30
    AttackOneRound(LastSeenBy(Myself))
  RESPONSE #70
    Continue()
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_SECRET_WORD)
  !GlobalTimerNotExpired("BPT","LOCALS")
  RandomNumLT(55,33)
  CheckStat(LastSeenBy(Myself),0,164)
  OR(5)
    CheckStatGT(LastSeenBy(Myself),0,129)
    CheckStatGT(LastSeenBy(Myself),0,116)
    CheckStatGT(LastSeenBy(Myself),0,MINORGLOBE)
    CheckStatGT(LastSeenBy(Myself),0,162)
    CheckStatGT(LastSeenBy(Myself),0,177)
    Specifics(LastSeenBy(Myself),20)
  !Specifics(LastSeenBy(Myself),218)
  CheckStatLT(Myself,76,SPELLFAILUREMAGE)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(LastSeenBy(Myself),WIZARD_SECRET_WORD)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_BREACH)
  !GlobalTimerNotExpired("BPT","LOCALS")
  RandomNumLT(56,36)
  CheckStat(LastSeenBy(Myself),0,164)
  CheckStat(LastSeenBy(Myself),0,177)
  OR(5)
    CheckStatGT(LastSeenBy(Myself),0,STONESKINS)
    CheckStatGT(LastSeenBy(Myself),0,SHIELDGLOBE)
    Specifics(LastSeenBy(Myself),205)
    CheckStatGT(LastSeenBy(Myself),0,128)
    CheckStatGT(LastSeenBy(Myself),0,181)
  CheckStat(LastSeenBy(Myself),0,177)
  CheckStatLT(Myself,76,SPELLFAILUREMAGE)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(LastSeenBy(Myself),WIZARD_BREACH)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_CHAOS)
  !GlobalTimerNotExpired("BPT","LOCALS")
  RandomNumLT(62,38)
  !General(LastSeenBy(Myself),UNDEAD)
  !StateCheck(LastSeenBy(Myself),STATE_CONFUSED)
  CheckStatLT(LastSeenBy(Myself),76,RESISTMAGIC)
  CheckStatLT(Myself,76,SPELLFAILUREMAGE)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(LastSeenBy(Myself),WIZARD_CHAOS)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_EMOTION_HOPELESSNESS)
  !GlobalTimerNotExpired("BPT","LOCALS")
  RandomNumLT(44,26)
  !StateCheck(LastSeenBy(Myself),STATE_SLEEPING)
  !StateCheck(LastSeenBy(Myself),STATE_HELPLESS)
  !General(LastSeenBy(Myself),UNDEAD)
  !StateCheck(LastSeenBy(Myself),STATE_CONFUSED)
  CheckStatLT(LastSeenBy(Myself),76,RESISTMAGIC)
  CheckStatLT(Myself,76,SPELLFAILUREMAGE)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(LastSeenBy(Myself),WIZARD_EMOTION_HOPELESSNESS)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_INVISIBLE_STALKER)
  !GlobalTimerNotExpired("BPT","LOCALS")
  RandomNumLT(100,46)
  NumCreatureLT([EVILCUTOFF.0.0.0.0.SUMMONED],7)
  !Range(NearestEnemyOf(Myself),4)
  CheckStatLT(Myself,75,SPELLFAILUREMAGE)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(LastSeenBy(Myself),WIZARD_INVISIBLE_STALKER)
END

IF
  ActionListEmpty()
  HaveSpellRES("SUMSHAD")
  !GlobalTimerNotExpired("BPT","LOCALS")
  !GlobalTimerNotExpired("SHAD","LOCALS")
  RandomNumLT(102,62)
  OR(2)
    !AreaType(OUTDOOR)
    !TimeOfDay(DAY)
  NumCreatureLT([EVILCUTOFF.0.SHADOW.0.0.SUMMONED],5)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    SpellRES("SUMSHAD",LastSeenBy(Myself))
    SetGlobalTimer("SHAD","LOCALS",FOUR_ROUNDS)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_CLOUDKILL)
  !GlobalTimerNotExpired("BPT","LOCALS")
  RandomNumLT(98,54)
  OR(2)
    !Range(LastSeenBy(Myself),15)
    CheckStatGT(Myself,74,RESISTPOISON)
  OR(4)
    !Exists(NearestMyGroupOfType)
    Range(NearestMyGroupOfType,3)
    CheckStatGT(NearestMyGroupOfType,49,RESISTPOISON)
    CheckStatGT(NearestMyGroupOfType,49,RESISTMAGIC)
  OR(4)
    !Exists(SecondNearestMyGroupOfType)
    !Range(SecondNearestMyGroupOfType,4)
    CheckStatGT(SecondNearestMyGroupOfType,49,RESISTPOISON)
    CheckStatGT(SecondNearestMyGroupOfType,49,RESISTMAGIC)
  OR(4)
    !Exists(ThirdNearestMyGroupOfType)
    Range(ThirdNearestMyGroupOfType,5)
    CheckStatGT(ThirdNearestMyGroupOfType,49,RESISTPOISON)
    CheckStatGT(ThirdNearestMyGroupOfType,49,RESISTMAGIC)
  OR(2)
    NumCreature([EVILCUTOFF.0.0.0.0.SUMMONED],0)
    Range(NearestMyGroupOfType([EVILCUTOFF.0.0.0.0.SUMMONED]),4)
  OR(2)
    Gender(LastSeenBy(Myself),SUMMONED)
    CheckStatLT(LastSeenBy(Myself),76,RESISTPOISON)
  !StateCheck(LastSeenBy(Myself),0x00400010)
  CheckStatGT(LastSeenBy(Myself),5,SAVEVSBREATH)
  CheckStatLT(LastSeenBy(Myself),76,RESISTMAGIC)
THEN
  RESPONSE #100
    Spell(LastSeenBy(Myself),WIZARD_CLOUDKILL)
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_ANIMATE_DEAD)
  RandomNumLT(68,36)
  !GlobalTimerNotExpired("BPT","LOCALS")
  NumCreatureLT([EVILCUTOFF.0.0.0.0.SUMMONED],7)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(LastSeenBy(Myself),WIZARD_ANIMATE_DEAD)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_GREATER_MALISON)
  !GlobalTimerNotExpired("BPT","LOCALS")
  RandomNumLT(72,37)
  CheckStat(LastSeenBy(Myself),0,129)
  CheckStatLT(LastSeenBy(Myself),1,180)
  CheckStatLT(LastSeenBy(Myself),76,RESISTMAGIC)
  CheckStatLT(Myself,76,SPELLFAILUREMAGE)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(LastSeenBy(Myself),WIZARD_GREATER_MALISON)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_CONTAGION)
  !GlobalTimerNotExpired("BPT","LOCALS")
  RandomNumLT(74,38)
  CheckStat(LastSeenBy(Myself),0,129)
  CheckStatLT(LastSeenBy(Myself),1,134)
  !General(LastSeenBy(Myself),UNDEAD)
  !HasBounceEffects(LastSeenBy(Myself))
  CheckStatGT(LastSeenBy(Myself),5,SAVEVSSPELL)
  CheckStatLT(LastSeenBy(Myself),76,RESISTMAGIC)
  CheckStatLT(Myself,76,SPELLFAILUREMAGE)
THEN
  RESPONSE #100
    Spell(LastSeenBy(Myself),WIZARD_CONTAGION)
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_SLOW)
  !GlobalTimerNotExpired("BPT","LOCALS")
  RandomNumLT(54,32)
  !StateCheck(LastSeenBy(Myself),STATE_SLOWED)
  CheckStatLT(LastSeenBy(Myself),1,131)
  CheckStatLT(LastSeenBy(Myself),76,RESISTMAGIC)
  CheckStatLT(Myself,76,SPELLFAILUREMAGE)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(LastSeenBy(Myself),WIZARD_SLOW)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_HOLD_PERSON)
  !GlobalTimerNotExpired("BPT","LOCALS")
  RandomNumLT(79,42)
  CheckStat(LastSeenBy(Myself),0,129)
  CheckStat(LastSeenBy(Myself),0,131)
  General(LastSeenBy(Myself),HUMANOID)
  !StateCheck(LastSeenBy(Myself),STATE_HELPLESS)
  CheckStat(LastSeenBy(Myself),0,HELD)
  CheckStatLT(LastSeenBy(Myself),76,RESISTMAGIC)
  CheckStatLT(Myself,76,SPELLFAILUREMAGE)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(LastSeenBy(Myself),WIZARD_HOLD_PERSON)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_STINKING_CLOUD)
  !GlobalTimerNotExpired("BPT","LOCALS")
  RandomNumLT(66,33)
  !Range(LastSeenBy(Myself),15)
  OR(4)
    !Exists(NearestMyGroupOfType)
    Range(NearestMyGroupOfType,4)
    CheckStatGT(NearestMyGroupOfType,0,131)
    CheckStatGT(NearestMyGroupOfType,49,RESISTMAGIC)
  OR(4)
    !Exists(SecondNearestMyGroupOfType)
    Range(SecondNearestMyGroupOfType,4)
    CheckStatGT(SecondNearestMyGroupOfType,0,131)
    CheckStatGT(SecondNearestMyGroupOfType,49,RESISTMAGIC)
  !StateCheck(LastSeenBy(Myself),STATE_HELPLESS)
  !StateCheck(LastSeenBy(Myself),STATE_SLEEPING)
  CheckStatGT(LastSeenBy(Myself),5,SAVEVSDEATH)
  !StateCheck(LastSeenBy(Myself),270381)
  !StateCheck(LastSeenBy(Myself),0x80100000)
  CheckStatLT(LastSeenBy(Myself),76,RESISTMAGIC)
  CheckStatLT(Myself,76,SPELLFAILUREMAGE)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(LastSeenBy(Myself),WIZARD_STINKING_CLOUD)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_HORROR)
  !GlobalTimerNotExpired("BPT","LOCALS")
  RandomNumLT(88,32)
  !StateCheck(LastSeenBy(Myself),STATE_PANIC)
  CheckStat(LastSeenBy(Myself),0,178)
  CheckStatLT(LastSeenBy(Myself),76,RESISTMAGIC)
  CheckStatGT(LastSeenBy(Myself),8,SAVEVSSPELL)
  CheckStatLT(Myself,76,SPELLFAILUREMAGE)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(LastSeenBy(Myself),WIZARD_HORROR)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_MELF_ACID_ARROW)
  !GlobalTimerNotExpired("BPT","LOCALS")
  RandomNumLT(68,28)
  CheckStat(LastSeenBy(Myself),0,129)
  CheckStatLT(LastSeenBy(Myself),51,RESISTACID)
  !HasBounceEffects(LastSeenBy(Myself))
  CheckStatLT(LastSeenBy(Myself),76,RESISTMAGIC)
  CheckStatLT(Myself,75,SPELLFAILUREMAGE)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(LastSeenBy(Myself),WIZARD_MELF_ACID_ARROW)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_SPOOK)
  !GlobalTimerNotExpired("BPT","LOCALS")
  RandomNumLT(92,28)
  CheckStat(LastSeenBy(Myself),0,129)
  CheckStat(LastSeenBy(Myself),0,178)
  !StateCheck(LastSeenBy(Myself),270381)
  !StateCheck(LastSeenBy(Myself),0x80100000)
  CheckStatLT(LastSeenBy(Myself),76,RESISTMAGIC)
  CheckStatGT(LastSeenBy(Myself),8,SAVEVSSPELL)
  CheckStatLT(Myself,75,SPELLFAILUREMAGE)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(LastSeenBy(Myself),WIZARD_SPOOK)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_COLOR_SPRAY)
  !GlobalTimerNotExpired("BPT","LOCALS")
  RandomNumLT(99,37)
  !StateCheck(LastSeenBy(Myself),STATE_SLEEPING)
  OR(5)
    Range(NearestMyGroupOfType,1) // I'm the caster, or right next to them
    !Range(NearestMyGroupOfType,8) // Range is 15 which means about 8 in script-measure
    CheckStatGT(NearestMyGroupOfType,4,LEVEL) // unconsciousness only affects up to 4 HD in spell effects
    CheckStatGT(NearestMyGroupOfType,4,LEVEL2) // accounts for dual classed
    CheckStatLT(NearestMyGroupOfType,8,SAVEVSSPELL) // A -3 save, so a 50/50 chance
  OR(5)
    Range(SecondNearestMyGroupOfType,1) // I'm the caster, or right next to them
    !Range(SecondNearestMyGroupOfType,8) // Range is 15 which means about 8 in script-measure
    CheckStatGT(SecondNearestMyGroupOfType,4,LEVEL) // unconsciousness only affects up to 4 HD in spell effects
    CheckStatGT(SecondNearestMyGroupOfType,4,LEVEL2) // accounts for dual classed
    CheckStatLT(SecondNearestMyGroupOfType,8,SAVEVSSPELL) // A -3 save, so a 50/50 chance
  CheckStatLT(LastSeenBy(Myself),5,LEVEL)
  CheckStatLT(LastSeenBy(Myself),76,RESISTMAGIC)
  CheckStatGT(LastSeenBy(Myself),8,SAVEVSSPELL)
  CheckStatLT(Myself,76,SPELLFAILUREMAGE)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(LastSeenBy(Myself),WIZARD_COLOR_SPRAY)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_BLINDNESS)
  !GlobalTimerNotExpired("BPT","LOCALS")
  RandomNumLT(98,32)
  CheckStat(LastSeenBy(Myself),0,129)
  !StateCheck(LastSeenBy(Myself),STATE_BLIND)
  !HasBounceEffects(LastSeenBy(Myself))
  !General(LastSeenBy(Myself),UNDEAD)
  CheckStatLT(LastSeenBy(Myself),76,RESISTMAGIC)
  CheckStatGT(LastSeenBy(Myself),10,SAVEVSSPELL)
  CheckStatLT(Myself,75,SPELLFAILUREMAGE)
THEN
  RESPONSE #100
    Spell(LastSeenBy(Myself),WIZARD_BLINDNESS)
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_VAMPIRIC_TOUCH)
  !GlobalTimerNotExpired("BPT","LOCALS")
  !GlobalTimerNotExpired("BPVampT","LOCALS")
  OR(2)
    HPPercentLT(Myself,75)
    RandomNumLT(94,32)
  CheckStat(LastSeenBy(Myself),0,129)
  Range(LastSeenBy(Myself),4)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    SetGlobalTimer("BPVampT","LOCALS",ONE_HOUR)
    Spell(LastSeenBy(Myself),WIZARD_VAMPIRIC_TOUCH)
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_GHOUL_TOUCH)
  !GlobalTimerNotExpired("BPT","LOCALS")
  RandomNumLT(96,32)
  CheckStat(LastSeenBy(Myself),0,128)
  !HasItem("PHANBLAD",Myself)
  !HasItem("GHOULT",Myself)
  Range(LastSeenBy(Myself),4)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    Spell(Myself,WIZARD_GHOUL_TOUCH)
    AttackOneRound(LastSeenBy(Myself))
END

IF
  ActionListEmpty()
  HaveSpell(WIZARD_LARLOCH_MINOR_DRAIN)
  !GlobalTimerNotExpired("BPT","LOCALS")
  !GlobalTimerNotExpired("BPVampT","LOCALS")
  RandomNumLT(97,25)
  HPPercentLT(Myself,90)
THEN
  RESPONSE #100
    SetGlobalTimer("BPT","LOCALS",ONE_ROUND)
    SetGlobalTimer("BPVampT","LOCALS",ONE_TURN)
    Spell(LastSeenBy(Myself),WIZARD_LARLOCH_MINOR_DRAIN)
END

IF
  OR(2)
    StateCheck(Myself,STATE_INVISIBLE)
    StateCheck(Myself,STATE_IMPROVEDINVISIBILITY)
  GlobalTimerNotExpired("BPIP","LOCALS")
THEN
  RESPONSE #15
    Continue()
  RESPONSE #60
    IncrementGlobal("BPIP","LOCALS",-1)
  RESPONSE #90
    RunAwayFrom(NearestEnemyOf(Myself),10)
END

IF
  Global("BPMRC","LOCALS",0)
  OR(3)
    Class(Myself,MAGE_ALL)
    Class(Myself,BARD)
    Class(Myself,SORCERER)
THEN
  RESPONSE #100
    SetGlobal("BPMRC","LOCALS",1)
END

IF
  Global("BPMRC","LOCALS",0)
THEN
  RESPONSE #100
    ChangeClass(Myself,MAGE)
    SetGlobal("BPMRC","LOCALS",1)
END

IF
  ActionListEmpty()
  HPPercentLT(Myself,25)
  Range(LastHitter(Myself),10)
  !GlobalTimerNotExpired("BPW","LOCALS")
THEN
  RESPONSE #30
    Shout(124)
    SetGlobalTimer("BPW","LOCALS",10)
    RunAwayFrom(LastHitter(Myself),40)
  RESPONSE #10
    Shout(124)
    SetGlobalTimer("BPW","LOCALS",10)
    Attack(LastHitter(Myself))
  RESPONSE #40
    Shout(124)
    SetGlobalTimer("BPW","LOCALS",10)
    AttackReevaluate(LastSeenBy(Myself),15)
END

IF
  ActionListEmpty()
  !HasItem("GHOULT",Myself)
  CheckStatGT(LastSeenBy(Myself),10,180)
  CheckStatLT(Myself,11,180)
THEN
  RESPONSE #100
    EquipRanged()
    AttackOneRound(LastSeenBy(Myself))
END

IF
  ActionListEmpty()
  !HasItem("GHOULT",Myself)
  OR(3)
    !Range(NearestEnemyOf(Myself),5)
    CheckStatGT(LastSeenBy(Myself),0,121)
    CheckStatGT(LastSeenBy(Myself),0,125)
THEN
  RESPONSE #100
    SetGlobalTimer("BPDD","LOCALS",ONE_ROUND)
    EquipRanged()
    AttackReevaluate(LastSeenBy(Myself),45)
END

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

IF
  ActionListEmpty()
  !Range(LastSeenBy(Myself),8)
THEN
  RESPONSE #90
    SetGlobalTimer("BPDD","LOCALS",ONE_ROUND)
    EquipMostDamagingMelee()
    AttackReevaluate(NearestEnemyOf(Myself),45)
  RESPONSE #40
    SetGlobalTimer("BPDD","LOCALS",ONE_ROUND)
    EquipMostDamagingMelee()
    AttackReevaluate(LastSeenBy(Myself),75)
END

IF
  ActionListEmpty()
THEN
  RESPONSE #100
    SetGlobalTimer("BPDD","LOCALS",ONE_ROUND)
    EquipMostDamagingMelee()
    AttackReevaluate(LastSeenBy(Myself),45)
END

