IF
  OR(11)
    See(TenthNearestEnemyOf(Myself))
    See(NinthNearestEnemyOf(Myself))
    See(EighthNearestEnemyOf(Myself))
    See(SeventhNearestEnemyOf(Myself))
    See(SixthNearestEnemyOf(Myself))
    See(FifthNearestEnemyOf(Myself))
    See(FourthNearestEnemyOf(Myself))
    See(ThirdNearestEnemyOf(Myself))
    See(SecondNearestEnemyOf(Myself))
    See(NearestEnemyOf(Myself))
    See(LastAttackerOf(Myself))
  False()
THEN
  RESPONSE #100
    Continue()
END

IF
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    !CheckStatGT(TenthNearestEnemyOf(Myself),99,RESISTCRUSHING)
  CheckStat(TenthNearestEnemyOf(Myself),0,SANCTUARY)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    CheckStatLT(TenthNearestEnemyOf(Myself),3,128)
  See(TenthNearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
    Continue()
END

IF
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    !CheckStatGT(NinthNearestEnemyOf(Myself),99,RESISTCRUSHING)
  CheckStat(NinthNearestEnemyOf(Myself),0,SANCTUARY)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    CheckStatLT(NinthNearestEnemyOf(Myself),3,128)
  See(NinthNearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
    Continue()
END

IF
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    !CheckStatGT(EighthNearestEnemyOf(Myself),99,RESISTCRUSHING)
  CheckStat(EighthNearestEnemyOf(Myself),0,SANCTUARY)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    CheckStatLT(EighthNearestEnemyOf(Myself),3,128)
  See(EighthNearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
    Continue()
END

IF
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    !CheckStatGT(SeventhNearestEnemyOf(Myself),99,RESISTCRUSHING)
  CheckStat(SeventhNearestEnemyOf(Myself),0,SANCTUARY)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    CheckStatLT(SeventhNearestEnemyOf(Myself),3,128)
  See(SeventhNearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
    Continue()
END

IF
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    !CheckStatGT(SixthNearestEnemyOf(Myself),99,RESISTCRUSHING)
  CheckStat(SixthNearestEnemyOf(Myself),0,SANCTUARY)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    CheckStatLT(SixthNearestEnemyOf(Myself),3,128)
  See(SixthNearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
    Continue()
END

IF
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    !CheckStatGT(FifthNearestEnemyOf(Myself),99,RESISTCRUSHING)
  CheckStat(FifthNearestEnemyOf(Myself),0,SANCTUARY)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    CheckStatLT(FifthNearestEnemyOf(Myself),3,128)
  See(FifthNearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
    Continue()
END

IF
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    !CheckStatGT(FourthNearestEnemyOf(Myself),99,RESISTCRUSHING)
  CheckStat(FourthNearestEnemyOf(Myself),0,SANCTUARY)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    CheckStatLT(FourthNearestEnemyOf(Myself),3,128)
  See(FourthNearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
    Continue()
END

IF
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    !CheckStatGT(ThirdNearestEnemyOf(Myself),99,RESISTCRUSHING)
  CheckStat(ThirdNearestEnemyOf(Myself),0,SANCTUARY)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    CheckStatLT(ThirdNearestEnemyOf(Myself),3,128)
  See(ThirdNearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
    Continue()
END

IF
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    !CheckStatGT(SecondNearestEnemyOf(Myself),99,RESISTCRUSHING)
  CheckStat(SecondNearestEnemyOf(Myself),0,SANCTUARY)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    CheckStatLT(SecondNearestEnemyOf(Myself),3,128)
  See(SecondNearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
    Continue()
END

IF
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    !CheckStatGT(NearestEnemyOf(Myself),99,RESISTCRUSHING)
  CheckStat(NearestEnemyOf(Myself),0,SANCTUARY)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    CheckStatLT(NearestEnemyOf(Myself),3,128)
  See(NearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
    Continue()
END

IF
  OR(2)
    GlobalTimerNotExpired("IL","LOCALS")
    CheckStatLT(TenthNearestEnemyOf(Myself),-5,ARMORCLASS)
  !StateCheck(TenthNearestEnemyOf(Myself),STATE_MIRRORIMAGE)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    !CheckStatGT(TenthNearestEnemyOf(Myself),99,RESISTCRUSHING)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquiped("AMUL21",TenthNearestEnemyOf(Myself)) // Amulet of Power
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("BLUN12",TenthNearestEnemyOf(Myself)) // Mace of Disruption +1
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("BLUN25",TenthNearestEnemyOf(Myself)) // Mace of Disruption +2
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("HAMM10",TenthNearestEnemyOf(Myself))
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("HAMM11",TenthNearestEnemyOf(Myself)) // Runehammer +5
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("SW1H61",TenthNearestEnemyOf(Myself)) // Angurvadal +5
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("SW1H69",TenthNearestEnemyOf(Myself)) // Spectral Brand +5
  CheckStat(TenthNearestEnemyOf(Myself),0,SANCTUARY)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    CheckStatLT(TenthNearestEnemyOf(Myself),3,128)
  See(TenthNearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
    Continue()
END

IF
  OR(2)
    GlobalTimerNotExpired("IL","LOCALS")
    CheckStatLT(NinthNearestEnemyOf(Myself),-5,ARMORCLASS)
  !StateCheck(NinthNearestEnemyOf(Myself),STATE_MIRRORIMAGE)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    !CheckStatGT(NinthNearestEnemyOf(Myself),99,RESISTCRUSHING)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquiped("AMUL21",NinthNearestEnemyOf(Myself)) // Amulet of Power
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("BLUN12",NinthNearestEnemyOf(Myself)) // Mace of Disruption +1
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("BLUN25",NinthNearestEnemyOf(Myself)) // Mace of Disruption +2
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("HAMM10",NinthNearestEnemyOf(Myself))
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("HAMM11",NinthNearestEnemyOf(Myself)) // Runehammer +5
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("SW1H61",NinthNearestEnemyOf(Myself)) // Angurvadal +5
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("SW1H69",NinthNearestEnemyOf(Myself)) // Spectral Brand +5
  CheckStat(NinthNearestEnemyOf(Myself),0,SANCTUARY)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    CheckStatLT(NinthNearestEnemyOf(Myself),3,128)
  See(NinthNearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
    Continue()
END

IF
  OR(2)
    GlobalTimerNotExpired("IL","LOCALS")
    CheckStatLT(EighthNearestEnemyOf(Myself),-5,ARMORCLASS)
  !StateCheck(EighthNearestEnemyOf(Myself),STATE_MIRRORIMAGE)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    !CheckStatGT(EighthNearestEnemyOf(Myself),99,RESISTCRUSHING)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquiped("AMUL21",EighthNearestEnemyOf(Myself)) // Amulet of Power
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("BLUN12",EighthNearestEnemyOf(Myself)) // Mace of Disruption +1
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("BLUN25",EighthNearestEnemyOf(Myself)) // Mace of Disruption +2
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("HAMM10",EighthNearestEnemyOf(Myself))
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("HAMM11",EighthNearestEnemyOf(Myself)) // Runehammer +5
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("SW1H61",EighthNearestEnemyOf(Myself)) // Angurvadal +5
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("SW1H69",EighthNearestEnemyOf(Myself)) // Spectral Brand +5
  CheckStat(EighthNearestEnemyOf(Myself),0,SANCTUARY)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    CheckStatLT(EighthNearestEnemyOf(Myself),3,128)
  See(EighthNearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
    Continue()
END

IF
  OR(2)
    GlobalTimerNotExpired("IL","LOCALS")
    CheckStatLT(SeventhNearestEnemyOf(Myself),-5,ARMORCLASS)
  !StateCheck(SeventhNearestEnemyOf(Myself),STATE_MIRRORIMAGE)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    !CheckStatGT(SeventhNearestEnemyOf(Myself),99,RESISTCRUSHING)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquiped("AMUL21",SeventhNearestEnemyOf(Myself)) // Amulet of Power
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("BLUN12",SeventhNearestEnemyOf(Myself)) // Mace of Disruption +1
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("BLUN25",SeventhNearestEnemyOf(Myself)) // Mace of Disruption +2
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("HAMM10",SeventhNearestEnemyOf(Myself))
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("HAMM11",SeventhNearestEnemyOf(Myself)) // Runehammer +5
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("SW1H61",SeventhNearestEnemyOf(Myself)) // Angurvadal +5
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("SW1H69",SeventhNearestEnemyOf(Myself)) // Spectral Brand +5
  CheckStat(SeventhNearestEnemyOf(Myself),0,SANCTUARY)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    CheckStatLT(SeventhNearestEnemyOf(Myself),3,128)
  See(SeventhNearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
    Continue()
END

IF
  OR(2)
    GlobalTimerNotExpired("IL","LOCALS")
    CheckStatLT(SixthNearestEnemyOf(Myself),-5,ARMORCLASS)
  !StateCheck(SixthNearestEnemyOf(Myself),STATE_MIRRORIMAGE)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    !CheckStatGT(SixthNearestEnemyOf(Myself),99,RESISTCRUSHING)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquiped("AMUL21",SixthNearestEnemyOf(Myself)) // Amulet of Power
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("BLUN12",SixthNearestEnemyOf(Myself)) // Mace of Disruption +1
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("BLUN25",SixthNearestEnemyOf(Myself)) // Mace of Disruption +2
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("HAMM10",SixthNearestEnemyOf(Myself))
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("HAMM11",SixthNearestEnemyOf(Myself)) // Runehammer +5
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("SW1H61",SixthNearestEnemyOf(Myself)) // Angurvadal +5
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("SW1H69",SixthNearestEnemyOf(Myself)) // Spectral Brand +5
  CheckStat(SixthNearestEnemyOf(Myself),0,SANCTUARY)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    CheckStatLT(SixthNearestEnemyOf(Myself),3,128)
  See(SixthNearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
    Continue()
END

IF
  OR(2)
    GlobalTimerNotExpired("IL","LOCALS")
    CheckStatLT(FifthNearestEnemyOf(Myself),-5,ARMORCLASS)
  !StateCheck(FifthNearestEnemyOf(Myself),STATE_MIRRORIMAGE)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    !CheckStatGT(FifthNearestEnemyOf(Myself),99,RESISTCRUSHING)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquiped("AMUL21",FifthNearestEnemyOf(Myself)) // Amulet of Power
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("BLUN12",FifthNearestEnemyOf(Myself)) // Mace of Disruption +1
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("BLUN25",FifthNearestEnemyOf(Myself)) // Mace of Disruption +2
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("HAMM10",FifthNearestEnemyOf(Myself))
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("HAMM11",FifthNearestEnemyOf(Myself)) // Runehammer +5
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("SW1H61",FifthNearestEnemyOf(Myself)) // Angurvadal +5
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("SW1H69",FifthNearestEnemyOf(Myself)) // Spectral Brand +5
  CheckStat(FifthNearestEnemyOf(Myself),0,SANCTUARY)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    CheckStatLT(FifthNearestEnemyOf(Myself),3,128)
  See(FifthNearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
    Continue()
END

IF
  OR(2)
    GlobalTimerNotExpired("IL","LOCALS")
    CheckStatLT(FourthNearestEnemyOf(Myself),-5,ARMORCLASS)
  !StateCheck(FourthNearestEnemyOf(Myself),STATE_MIRRORIMAGE)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    !CheckStatGT(FourthNearestEnemyOf(Myself),99,RESISTCRUSHING)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquiped("AMUL21",FourthNearestEnemyOf(Myself)) // Amulet of Power
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("BLUN12",FourthNearestEnemyOf(Myself)) // Mace of Disruption +1
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("BLUN25",FourthNearestEnemyOf(Myself)) // Mace of Disruption +2
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("HAMM10",FourthNearestEnemyOf(Myself))
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("HAMM11",FourthNearestEnemyOf(Myself)) // Runehammer +5
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("SW1H61",FourthNearestEnemyOf(Myself)) // Angurvadal +5
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("SW1H69",FourthNearestEnemyOf(Myself)) // Spectral Brand +5
  CheckStat(FourthNearestEnemyOf(Myself),0,SANCTUARY)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    CheckStatLT(FourthNearestEnemyOf(Myself),3,128)
  See(FourthNearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
    Continue()
END

IF
  OR(2)
    GlobalTimerNotExpired("IL","LOCALS")
    CheckStatLT(ThirdNearestEnemyOf(Myself),-5,ARMORCLASS)
  !StateCheck(ThirdNearestEnemyOf(Myself),STATE_MIRRORIMAGE)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    !CheckStatGT(ThirdNearestEnemyOf(Myself),99,RESISTCRUSHING)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquiped("AMUL21",ThirdNearestEnemyOf(Myself)) // Amulet of Power
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("BLUN12",ThirdNearestEnemyOf(Myself)) // Mace of Disruption +1
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("BLUN25",ThirdNearestEnemyOf(Myself)) // Mace of Disruption +2
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("HAMM10",ThirdNearestEnemyOf(Myself))
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("HAMM11",ThirdNearestEnemyOf(Myself)) // Runehammer +5
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("SW1H61",ThirdNearestEnemyOf(Myself)) // Angurvadal +5
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("SW1H69",ThirdNearestEnemyOf(Myself)) // Spectral Brand +5
  CheckStat(ThirdNearestEnemyOf(Myself),0,SANCTUARY)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    CheckStatLT(ThirdNearestEnemyOf(Myself),3,128)
  See(ThirdNearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
    Continue()
END

IF
  OR(2)
    GlobalTimerNotExpired("IL","LOCALS")
    CheckStatLT(SecondNearestEnemyOf(Myself),-5,ARMORCLASS)
  !StateCheck(SecondNearestEnemyOf(Myself),STATE_MIRRORIMAGE)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    !CheckStatGT(SecondNearestEnemyOf(Myself),99,RESISTCRUSHING)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquiped("AMUL21",SecondNearestEnemyOf(Myself)) // Amulet of Power
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("BLUN12",SecondNearestEnemyOf(Myself)) // Mace of Disruption +1
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("BLUN25",SecondNearestEnemyOf(Myself)) // Mace of Disruption +2
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("HAMM10",SecondNearestEnemyOf(Myself))
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("HAMM11",SecondNearestEnemyOf(Myself)) // Runehammer +5
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("SW1H61",SecondNearestEnemyOf(Myself)) // Angurvadal +5
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("SW1H69",SecondNearestEnemyOf(Myself)) // Spectral Brand +5
  CheckStat(SecondNearestEnemyOf(Myself),0,SANCTUARY)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    CheckStatLT(SecondNearestEnemyOf(Myself),3,128)
  See(SecondNearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
    Continue()
END

IF
  OR(2)
    GlobalTimerNotExpired("IL","LOCALS")
    CheckStatLT(NearestEnemyOf(Myself),-5,ARMORCLASS)
  !StateCheck(NearestEnemyOf(Myself),STATE_MIRRORIMAGE)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    !CheckStatGT(NearestEnemyOf(Myself),99,RESISTCRUSHING)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquiped("AMUL21",NearestEnemyOf(Myself)) // Amulet of Power
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("BLUN12",NearestEnemyOf(Myself)) // Mace of Disruption +1
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("BLUN25",NearestEnemyOf(Myself)) // Mace of Disruption +2
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("HAMM10",NearestEnemyOf(Myself))
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("HAMM11",NearestEnemyOf(Myself)) // Runehammer +5
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("SW1H61",NearestEnemyOf(Myself)) // Angurvadal +5
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Allow them to notice anti-undead items quickly
    !HasItemEquipedReal("SW1H69",NearestEnemyOf(Myself)) // Spectral Brand +5
  CheckStat(NearestEnemyOf(Myself),0,SANCTUARY)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    CheckStatLT(NearestEnemyOf(Myself),3,128)
  See(NearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
    Continue()
END

IF
  HitBy([ANYONE],CRUSHING)
  Range(LastAttackerOf(Myself),5)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    !CheckStatGT(LastAttackerOf(Myself),99,RESISTCRUSHING)
  OR(2)
    GlobalTimerNotExpired("IS","LOCALS") // Will notice weapon immunities quickly
    CheckStatLT(LastAttackerOf(Myself),3,128)
  See(LastAttackerOf(Myself))
  False()
THEN
  RESPONSE #100
    Continue()
END

IF
  ActionListEmpty()
  !Allegiance(LastSeenBy(Myself),ENEMY)
  Allegiance(Myself,ENEMY)
THEN
  RESPONSE #100
    AttackOneRound(LastSeenBy(Myself))
END

IF
  ActionListEmpty()
  Global("Seen","LOCALS",1)
  !See(NearestEnemyOf(Myself))
  !See(SecondNearestEnemyOf(Myself))
  !See(ThirdNearestEnemyOf(Myself))
  !See(FourthNearestEnemyOf(Myself))
  !See(FifthNearestEnemyOf(Myself))
  !See(SixthNearestEnemyOf(Myself))
  !See(SeventhNearestEnemyOf(Myself))
  !See(EighthNearestEnemyOf(Myself))
  !See(NinthNearestEnemyOf(Myself))
  !See(TenthNearestEnemyOf(Myself))
  !StateCheck(Player1,STATE_INVISIBLE)
  CheckStat(Player1,0,SANCTUARY)
  Exists(Player1)
THEN
  RESPONSE #100
    MoveToObject(Player1)
END

IF
  ActionListEmpty()
  Global("Seen","LOCALS",1)
  !See(NearestEnemyOf(Myself))
  !See(SecondNearestEnemyOf(Myself))
  !See(ThirdNearestEnemyOf(Myself))
  !See(FourthNearestEnemyOf(Myself))
  !See(FifthNearestEnemyOf(Myself))
  !See(SixthNearestEnemyOf(Myself))
  !See(SeventhNearestEnemyOf(Myself))
  !See(EighthNearestEnemyOf(Myself))
  !See(NinthNearestEnemyOf(Myself))
  !See(TenthNearestEnemyOf(Myself))
  !StateCheck(Player2,STATE_INVISIBLE)
  CheckStat(Player2,0,SANCTUARY)
  Exists(Player2)
THEN
  RESPONSE #100
    MoveToObject(Player2)
END

IF
  ActionListEmpty()
  Global("Seen","LOCALS",1)
  !See(NearestEnemyOf(Myself))
  !See(SecondNearestEnemyOf(Myself))
  !See(ThirdNearestEnemyOf(Myself))
  !See(FourthNearestEnemyOf(Myself))
  !See(FifthNearestEnemyOf(Myself))
  !See(SixthNearestEnemyOf(Myself))
  !See(SeventhNearestEnemyOf(Myself))
  !See(EighthNearestEnemyOf(Myself))
  !See(NinthNearestEnemyOf(Myself))
  !See(TenthNearestEnemyOf(Myself))
  !StateCheck(Player3,STATE_INVISIBLE)
  CheckStat(Player3,0,SANCTUARY)
  Exists(Player3)
THEN
  RESPONSE #100
    MoveToObject(Player3)
END

IF
  ActionListEmpty()
  Global("Seen","LOCALS",1)
  !See(NearestEnemyOf(Myself))
  !See(SecondNearestEnemyOf(Myself))
  !See(ThirdNearestEnemyOf(Myself))
  !See(FourthNearestEnemyOf(Myself))
  !See(FifthNearestEnemyOf(Myself))
  !See(SixthNearestEnemyOf(Myself))
  !See(SeventhNearestEnemyOf(Myself))
  !See(EighthNearestEnemyOf(Myself))
  !See(NinthNearestEnemyOf(Myself))
  !See(TenthNearestEnemyOf(Myself))
  !StateCheck(Player4,STATE_INVISIBLE)
  CheckStat(Player4,0,SANCTUARY)
  Exists(Player4)
THEN
  RESPONSE #100
    MoveToObject(Player4)
END

IF
  ActionListEmpty()
  Global("Seen","LOCALS",1)
  !See(NearestEnemyOf(Myself))
  !See(SecondNearestEnemyOf(Myself))
  !See(ThirdNearestEnemyOf(Myself))
  !See(FourthNearestEnemyOf(Myself))
  !See(FifthNearestEnemyOf(Myself))
  !See(SixthNearestEnemyOf(Myself))
  !See(SeventhNearestEnemyOf(Myself))
  !See(EighthNearestEnemyOf(Myself))
  !See(NinthNearestEnemyOf(Myself))
  !See(TenthNearestEnemyOf(Myself))
  !StateCheck(Player5,STATE_INVISIBLE)
  CheckStat(Player5,0,SANCTUARY)
  Exists(Player5)
THEN
  RESPONSE #100
    MoveToObject(Player5)
END

IF
  ActionListEmpty()
  Global("Seen","LOCALS",1)
  !See(NearestEnemyOf(Myself))
  !See(SecondNearestEnemyOf(Myself))
  !See(ThirdNearestEnemyOf(Myself))
  !See(FourthNearestEnemyOf(Myself))
  !See(FifthNearestEnemyOf(Myself))
  !See(SixthNearestEnemyOf(Myself))
  !See(SeventhNearestEnemyOf(Myself))
  !See(EighthNearestEnemyOf(Myself))
  !See(NinthNearestEnemyOf(Myself))
  !See(TenthNearestEnemyOf(Myself))
  !StateCheck(Player6,STATE_INVISIBLE)
  CheckStat(Player6,0,SANCTUARY)
  Exists(Player6)
THEN
  RESPONSE #100
    MoveToObject(Player6)
END

IF
  ActionListEmpty()
  Global("Seen","LOCALS",1)
THEN
  RESPONSE #100
    RandomWalkContinuous()
END
