IF
  See(NearestEnemyOf(Myself))
  !GlobalTimerNotExpired("prep","LOCALS")
THEN
  RESPONSE #100
    SetGlobalTimer("prep","LOCALS",1000)
    DisplayString(Myself,2469)  // ~Spell Trigger - Protection from Magical Weapons~
    ReallyForceSpell(Myself,WIZARD_PROTECTION_FROM_MAGIC_WEAPONS)
    DisplayString(Myself,29736)  // ~Contingency - Stoneskin~
    ReallyForceSpell(Myself,WIZARD_STONE_SKIN)
END

IF
  Allegiance(Myself,GOODCUTOFF)
  !See([ENEMY])
  CombatCounter(0)
  !Range(Player1,20)
THEN
  RESPONSE #100
    MoveToObject(Player1)
END

IF
  Allegiance(Myself,ENEMY)
  Delay(6)
  !GlobalTimerNotExpired("Spell","LOCALS")
  OR(2)
    NumCreatureLT([ENEMY.0.DEMONIC],3)
    NumCreatureVsPartyLT([ENEMY.0.DEMONIC],1)
  HaveSpellRES("GATE3")
  !Range(NearestEnemyOf(Myself),10)
  OR(2)
    NumInPartyAliveGT(2)
    DifficultyGT(EASY)
THEN
  RESPONSE #100
    SetGlobalTimer("Spell","LOCALS",6)
    SpellRES("GATE3",Myself)  // ~Gate~
  RESPONSE #100
    Continue()
END

IF
  HaveSpell(CLERIC_IRONSKIN)
  !Allegiance(Myself,GOODCUTOFF)
  CheckStatLT(Myself,1,STONESKINS)
  !GlobalTimerNotExpired("Spell","LOCALS")
  !GlobalTimerNotExpired("IronSkins","LOCALS")
  !DifficultyLT(NORMAL)
THEN
  RESPONSE #100
    SetGlobalTimer("Spell","LOCALS",6)
    SetGlobalTimer("IronSkins","LOCALS",15)
    SpellNoDec(Myself,CLERIC_IRONSKIN)
END

IF
  Allegiance(Myself,GOODCUTOFF)
  AttackedBy([ANYONE],DEFAULT)
  Allegiance(LastAttackerOf(Myself),GOODCUTOFF)
  Global("LetItGoOnce","LOCALS",0)
THEN
  RESPONSE #100
    SetGlobal("LetItGoOnce","LOCALS",1)
    SetGlobalTimer("GetMadNow","LOCALS",6)
END

IF
  Allegiance(Myself,GOODCUTOFF)
  AttackedBy([ANYONE],DEFAULT)
  Allegiance(LastAttackerOf(Myself),GOODCUTOFF)
  Global("LetItGoOnce","LOCALS",1)
  GlobalTimerExpired("GetMadNow","LOCALS")
THEN
  RESPONSE #100
    SetGlobal("LetItGoOnce","LOCALS",0)
    Enemy()
END

IF
  HPPercentLT(Myself,40)
  HaveSpell(CLERIC_CURE_SERIOUS_WOUNDS)
  See(NearestEnemyOf(Myself))
  OR(2)
    !Range(NearestEnemyOf(Myself),10)
    CheckStatGT(Myself,0,STONESKINS)
  !GlobalTimerNotExpired("Spell","LOCALS")
THEN
  RESPONSE #25
    SetGlobalTimer("Spell","LOCALS",6)
    Spell(Myself,CLERIC_CURE_SERIOUS_WOUNDS)
  RESPONSE #25
    SetGlobalTimer("Spell","LOCALS",6)
    RemoveSpell(CLERIC_CURE_SERIOUS_WOUNDS)
    ForceSpell(Myself,CLERIC_CURE_SERIOUS_WOUNDS)
  RESPONSE #50
    Continue()
END

IF
  !GlobalTimerNotExpired("Spell","LOCALS")
  !GlobalTimerNotExpired("PushAway","LOCALS")
  See(NearestEnemyOf(Myself))
  OR(6)
    CheckStat(LastSeenBy(Myself),1,SCRIPTINGSTATE4)
    CheckStat(LastSeenBy(Myself),2,SCRIPTINGSTATE4)
    CheckStatGT(LastSeenBy(Myself),4,NUMBEROFATTACKS)
    StateCheck(LastSeenBy(Myself),STATE_HASTED)
    CheckStatGT(LastSeenBy(Myself),0,121)
    Range(ThirdNearestEnemyOf(Myself),8)
  Range(LastSeenBy(Myself),8)
  !Class(LastSeenBy(Myself),LONG_BOW)
  !HPPercentLT(LastSeenBy(Myself),50)
  !StateCheck(LastSeenBy(Myself),STATE_HELPLESS)
  !StateCheck(LastSeenBy(Myself),STATE_STUNNED)
  !StateCheck(LastSeenBy(Myself),STATE_PANIC)
  !StateCheck(LastSeenBy(Myself),STATE_SLEEPING)
  !StateCheck(LastSeenBy(Myself),STATE_REALLY_DEAD)  // LastSeenBy(Myself)
THEN
  RESPONSE #50
    SetGlobalTimer("Spell","LOCALS",6)
    SetGlobalTimer("PushAway","LOCALS",18)
    FaceObject(LastSeenBy(Myself))
    ForceSpellRES("BALORTK1",LastSeenBy(Myself))  // ~Telekinesis~
  RESPONSE #100
    Continue()
END

IF
  !HPPercentLT(Myself,30)
  !Range(SixthNearestEnemyOf(Myself),10)
  OR(4)
    Class(SixthNearestEnemyOf(Myself),MAGE_ALL)
    Class(SixthNearestEnemyOf(Myself),CLERIC_ALL)
    HPPercentLT(SixthNearestEnemyOf(Myself),25)
    CheckStatGT(SixthNearestEnemyOf(Myself),0,ARMORCLASS)
  !HPGT(SixthNearestEnemyOf(Myself),75)
  !CheckStat(SixthNearestEnemyOf(Myself),2,SCRIPTINGSTATE4)
  !CheckStatGT(SixthNearestEnemyOf(Myself),4,NUMBEROFATTACKS)
  !CheckStatGT(SixthNearestEnemyOf(Myself),0,121)
  !StateCheck(SixthNearestEnemyOf(Myself),STATE_HELPLESS)
  !StateCheck(SixthNearestEnemyOf(Myself),STATE_STUNNED)
  !StateCheck(SixthNearestEnemyOf(Myself),STATE_PANIC)
  !StateCheck(SixthNearestEnemyOf(Myself),STATE_SLEEPING)
  HPGT(SixthNearestEnemyOf(Myself),0)
  See(SixthNearestEnemyOf(Myself))
THEN
  RESPONSE #100
    SetGlobal("FoundOneToPull","LOCALS",1)
    Continue()
END

IF
  !HPPercentLT(Myself,30)
  !Range(ThirdNearestEnemyOf(Myself),10)
  OR(4)
    Class(ThirdNearestEnemyOf(Myself),MAGE_ALL)
    Class(ThirdNearestEnemyOf(Myself),CLERIC_ALL)
    HPPercentLT(ThirdNearestEnemyOf(Myself),25)
    CheckStatGT(ThirdNearestEnemyOf(Myself),0,ARMORCLASS)
  !HPGT(ThirdNearestEnemyOf(Myself),75)
  !CheckStat(ThirdNearestEnemyOf(Myself),2,SCRIPTINGSTATE4)
  !CheckStatGT(ThirdNearestEnemyOf(Myself),4,NUMBEROFATTACKS)
  !CheckStatGT(ThirdNearestEnemyOf(Myself),0,121)
  !StateCheck(ThirdNearestEnemyOf(Myself),STATE_HELPLESS)
  !StateCheck(ThirdNearestEnemyOf(Myself),STATE_STUNNED)
  !StateCheck(ThirdNearestEnemyOf(Myself),STATE_PANIC)
  !StateCheck(ThirdNearestEnemyOf(Myself),STATE_SLEEPING)
  HPGT(ThirdNearestEnemyOf(Myself),0)
  See(ThirdNearestEnemyOf(Myself))
THEN
  RESPONSE #100
    SetGlobal("FoundOneToPull","LOCALS",1)
    Continue()
END

IF
  !HPPercentLT(Myself,30)
  !Range(SecondNearestEnemyOf(Myself),10)
  OR(4)
    Class(SecondNearestEnemyOf(Myself),MAGE_ALL)
    Class(SecondNearestEnemyOf(Myself),CLERIC_ALL)
    HPPercentLT(SecondNearestEnemyOf(Myself),25)
    CheckStatGT(SecondNearestEnemyOf(Myself),0,ARMORCLASS)
  !HPGT(SecondNearestEnemyOf(Myself),75)
  !CheckStat(SecondNearestEnemyOf(Myself),2,SCRIPTINGSTATE4)
  !CheckStatGT(SecondNearestEnemyOf(Myself),4,NUMBEROFATTACKS)
  !CheckStatGT(SecondNearestEnemyOf(Myself),0,121)
  !StateCheck(SecondNearestEnemyOf(Myself),STATE_HELPLESS)
  !StateCheck(SecondNearestEnemyOf(Myself),STATE_STUNNED)
  !StateCheck(SecondNearestEnemyOf(Myself),STATE_PANIC)
  !StateCheck(SecondNearestEnemyOf(Myself),STATE_SLEEPING)
  HPGT(SecondNearestEnemyOf(Myself),0)
  See(SecondNearestEnemyOf(Myself))
THEN
  RESPONSE #100
    SetGlobal("FoundOneToPull","LOCALS",1)
    Continue()
END

IF
  !HPPercentLT(Myself,30)
  !Range(NearestEnemyOf(Myself),10)
  OR(4)
    Class(NearestEnemyOf(Myself),LONG_BOW)
    Class(NearestEnemyOf(Myself),CLERIC_ALL)
    HPPercentLT(NearestEnemyOf(Myself),25)
    CheckStatGT(NearestEnemyOf(Myself),0,ARMORCLASS)
  !HPGT(NearestEnemyOf(Myself),75)
  !CheckStat(NearestEnemyOf(Myself),2,SCRIPTINGSTATE4)
  !CheckStatGT(NearestEnemyOf(Myself),4,NUMBEROFATTACKS)
  !CheckStatGT(NearestEnemyOf(Myself),0,121)
  !StateCheck(NearestEnemyOf(Myself),STATE_HELPLESS)
  !StateCheck(NearestEnemyOf(Myself),STATE_STUNNED)
  !StateCheck(NearestEnemyOf(Myself),STATE_PANIC)
  !StateCheck(NearestEnemyOf(Myself),STATE_SLEEPING)
  HPGT(NearestEnemyOf(Myself),0)  // earestEnemyOf(Myself))
  See(NearestEnemyOf(Myself))
THEN
  RESPONSE #100
    SetGlobal("FoundOneToPull","LOCALS",1)
    Continue()
END

IF
  Range(SecondNearestEnemyOf(Myself),8)
  Global("FoundOneToPull","LOCALS",1)
THEN
  RESPONSE #100
    SetGlobal("FoundOneToPull","LOCALS",0)
    Continue()
END

IF
  HPPercentGT(Myself,30)
  Global("FoundOneToPull","LOCALS",1)
  !GlobalTimerNotExpired("Spell","LOCALS")
  !GlobalTimerNotExpired("PullTowards","LOCALS")
THEN
  RESPONSE #50
    SetGlobal("FoundOneToPull","LOCALS",0)
    SetGlobalTimer("Spell","LOCALS",6)
    SetGlobalTimer("PullTowards","LOCALS",18)
    FaceObject(LastSeenBy(Myself))
    ForceSpellRES("BALORTK2",LastSeenBy(Myself))
  RESPONSE #100
    Continue()
END

IF
  Allegiance(Myself,GOODCUTOFF)
  CombatCounter(0)
  !See(NearestEnemyOf(Myself))
THEN
  RESPONSE #100
    NoAction()
END

IF
  See(SixthNearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
END

IF
  Range(LastAttackerOf(Myself),8)
  HPGT(LastAttackerOf(Myself),0)  // astAttackerOf(Myself))
  Global("CloseCombat","LOCALS",1)
  !StateCheck(LastAttackerOf(Myself),STATE_PANIC)
  !StateCheck(LastAttackerOf(Myself),STATE_STUNNED)
  !StateCheck(LastAttackerOf(Myself),STATE_HELPLESS)
  !StateCheck(LastAttackerOf(Myself),STATE_SLEEPING)
  OR(2)
    !Gender(LastAttackerOf(Myself),SUMMONED)
    LevelGT(LastAttackerOf(Myself),10)
  !Gender(LastAttackerOf(Myself),17)
  See(LastAttackerOf(Myself))
  False()
THEN
  RESPONSE #100
END

IF
  Allegiance(Myself,EVILCUTOFF)
  !StateCheck(SecondNearest([GOODCUTOFF.0.0.CLERIC_ALL]),STATE_SILENCED)
  !StateCheck(SecondNearest([GOODCUTOFF.0.0.CLERIC_ALL]),STATE_STUNNED)
  !StateCheck(SecondNearest([GOODCUTOFF.0.0.CLERIC_ALL]),STATE_PANIC)
  !StateCheck(SecondNearest([GOODCUTOFF.0.0.CLERIC_ALL]),STATE_SLEEPING)
  CheckStatLT(SecondNearest([GOODCUTOFF.0.0.CLERIC_ALL]),100,SPELLFAILUREPRIEST)
  See(SecondNearest([GOODCUTOFF.0.0.CLERIC_ALL]))
  False()
THEN
  RESPONSE #100
END

IF
  Allegiance(Myself,EVILCUTOFF)
  !StateCheck([GOODCUTOFF.0.0.CLERIC_ALL],STATE_SILENCED)
  !StateCheck([GOODCUTOFF.0.0.CLERIC_ALL],STATE_STUNNED)
  !StateCheck([GOODCUTOFF.0.0.CLERIC_ALL],STATE_PANIC)
  !StateCheck([GOODCUTOFF.0.0.CLERIC_ALL],STATE_SLEEPING)
  CheckStatLT([GOODCUTOFF.0.0.CLERIC_ALL],100,SPELLFAILUREPRIEST)
  See([GOODCUTOFF.0.0.CLERIC_ALL])
  False()
THEN
  RESPONSE #100
END

IF
  Allegiance(Myself,EVILCUTOFF)
  !StateCheck(SecondNearest([GOODCUTOFF.0.0.MAGE_ALL]),STATE_SILENCED)
  !StateCheck(SecondNearest([GOODCUTOFF.0.0.MAGE_ALL]),STATE_STUNNED)
  !StateCheck(SecondNearest([GOODCUTOFF.0.0.MAGE_ALL]),STATE_PANIC)
  !StateCheck(SecondNearest([GOODCUTOFF.0.0.MAGE_ALL]),STATE_SLEEPING)
  CheckStatLT(SecondNearest([GOODCUTOFF.0.0.MAGE_ALL]),100,SPELLFAILUREMAGE)
  See(SecondNearest([GOODCUTOFF.0.0.MAGE_ALL]))
  False()
THEN
  RESPONSE #100
END

IF
  Allegiance(Myself,EVILCUTOFF)
  !StateCheck([GOODCUTOFF.0.0.MAGE_ALL],STATE_SILENCED)
  !StateCheck([GOODCUTOFF.0.0.MAGE_ALL],STATE_STUNNED)
  !StateCheck([GOODCUTOFF.0.0.MAGE_ALL],STATE_PANIC)
  !StateCheck([GOODCUTOFF.0.0.MAGE_ALL],STATE_SLEEPING)
  CheckStatLT([GOODCUTOFF.0.0.MAGE_ALL],100,SPELLFAILUREMAGE)
  See([GOODCUTOFF.0.0.MAGE_ALL])
  False()
THEN
  RESPONSE #100
END

IF
  Allegiance(Myself,GOODCUTOFF)
  Range(LastAttackerOf(Player1),15)
  HPGT(LastAttackerOf(Player1),0)
  !StateCheck(LastAttackerOf(Player1),STATE_PANIC)
  !StateCheck(LastAttackerOf(Player1),STATE_STUNNED)
  !StateCheck(LastAttackerOf(Player1),STATE_HELPLESS)
  !StateCheck(LastAttackerOf(Player1),STATE_SLEEPING)
  !Gender(LastAttackerOf(Player1),17)
  See(LastAttackerOf(Player1))
  False()
THEN
  RESPONSE #100
END

IF
  !CheckStatGT(SixthNearestEnemyOf(Myself),0,128)
  !Gender(SixthNearestEnemyOf(Myself),17)
  OR(2)
    !Gender(SixthNearestEnemyOf(Myself),SUMMONED)
    LevelGT(SixthNearestEnemyOf(Myself),10)
  OR(3)
    CheckStatGT(SixthNearestEnemyOf(Myself),0,ARMORCLASS)
    HPPercentLT(SixthNearestEnemyOf(Myself),30)
    StateCheck(SixthNearestEnemyOf(Myself),STATE_STUNNED)
  !CheckStatLT(SixthNearestEnemyOf(Myself),-9,ARMORCLASS)
  !StateCheck(SixthNearestEnemyOf(Myself),STATE_HELPLESS)
  See(SixthNearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
END

IF
  !CheckStatGT(ThirdNearestEnemyOf(Myself),0,128)
  !Gender(ThirdNearestEnemyOf(Myself),17)
  OR(2)
    !Gender(ThirdNearestEnemyOf(Myself),SUMMONED)
    LevelGT(ThirdNearestEnemyOf(Myself),10)
  OR(3)
    CheckStatGT(ThirdNearestEnemyOf(Myself),0,ARMORCLASS)
    HPPercentLT(ThirdNearestEnemyOf(Myself),30)
    StateCheck(ThirdNearestEnemyOf(Myself),STATE_STUNNED)
  !CheckStatLT(ThirdNearestEnemyOf(Myself),-9,ARMORCLASS)
  See(ThirdNearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
END

IF
  !CheckStatGT(SecondNearestEnemyOf(Myself),0,128)
  !Gender(SecondNearestEnemyOf(Myself),17)
  OR(2)
    !Gender(SecondNearestEnemyOf(Myself),SUMMONED)
    LevelGT(SecondNearestEnemyOf(Myself),10)
  OR(3)
    CheckStatGT(SecondNearestEnemyOf(Myself),0,ARMORCLASS)
    HPPercentLT(SecondNearestEnemyOf(Myself),30)
    StateCheck(SecondNearestEnemyOf(Myself),STATE_STUNNED)
  !CheckStatLT(SecondNearestEnemyOf(Myself),-9,ARMORCLASS)
  See(SecondNearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
END

IF
  !CheckStatGT(NearestEnemyOf(Myself),0,128)
  !Gender(NearestEnemyOf(Myself),17)
  OR(2)
    !Gender(NearestEnemyOf(Myself),SUMMONED)
    LevelGT(NearestEnemyOf(Myself),10)
  OR(3)
    CheckStatGT(NearestEnemyOf(Myself),0,ARMORCLASS)
    HPPercentLT(NearestEnemyOf(Myself),30)
    StateCheck(NearestEnemyOf(Myself),STATE_STUNNED)
  !CheckStatLT(NearestEnemyOf(Myself),-9,ARMORCLASS)
  See(NearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
END

IF
  Range(SecondNearestEnemyOf(Myself),8)
  CheckStatGT(SecondNearestEnemyOf(Myself),4,NUMBEROFATTACKS)
  !StateCheck(SecondNearestEnemyOf(Myself),STATE_PANIC)
  !StateCheck(SecondNearestEnemyOf(Myself),STATE_STUNNED)
  !StateCheck(SecondNearestEnemyOf(Myself),STATE_HELPLESS)
  !StateCheck(SecondNearestEnemyOf(Myself),STATE_SLEEPING)
  See(SecondNearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
END

IF
  Range(NearestEnemyOf(Myself),8)
  CheckStatGT(NearestEnemyOf(Myself),4,NUMBEROFATTACKS)
  !StateCheck(NearestEnemyOf(Myself),STATE_PANIC)
  !StateCheck(NearestEnemyOf(Myself),STATE_STUNNED)
  !StateCheck(NearestEnemyOf(Myself),STATE_HELPLESS)
  !StateCheck(NearestEnemyOf(Myself),STATE_SLEEPING)
  See(NearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
END

IF
  Allegiance(Myself,EVILCUTOFF)
  HPPercentGT(Myself,50)
  !CheckStatGT([GOODCUTOFF.0.0.CLERIC_ALL],0,128)
  !Gender(Nearest([GOODCUTOFF.0.0.CLERIC_ALL]),17)
  OR(2)
    CheckStatGT([GOODCUTOFF.0.0.CLERIC_ALL],0,ARMORCLASS)
    HPPercentLT([GOODCUTOFF.0.0.CLERIC_ALL],30)
  !CheckStatLT([GOODCUTOFF.0.0.CLERIC_ALL],-9,ARMORCLASS)
  !StateCheck([GOODCUTOFF.0.0.CLERIC_ALL],STATE_HELPLESS)
  Range([GOODCUTOFF.0.0.CLERIC_ALL],15)
  See([GOODCUTOFF.0.0.CLERIC_ALL])
  False()
THEN
  RESPONSE #100
END

IF
  Allegiance(Myself,EVILCUTOFF)
  HPPercentGT(Myself,50)
  !CheckStatGT([GOODCUTOFF.0.0.LONG_BOW],0,128)
  !Gender([GOODCUTOFF.0.0.LONG_BOW],17)
  OR(2)
    CheckStatGT([GOODCUTOFF.0.0.LONG_BOW],0,ARMORCLASS)
    HPPercentLT([GOODCUTOFF.0.0.LONG_BOW],30)
  !CheckStatLT([GOODCUTOFF.0.0.LONG_BOW],-9,ARMORCLASS)
  !StateCheck([GOODCUTOFF.0.0.LONG_BOW],STATE_HELPLESS)
  Range([GOODCUTOFF.0.0.LONG_BOW],15)
  See([GOODCUTOFF.0.0.LONG_BOW])
  False()
THEN
  RESPONSE #100
END

IF
  Allegiance(Myself,ENEMY)
  Allegiance(LastSeenBy(Myself),EVILCUTOFF)
  See([GOODCUTOFF])
THEN
  RESPONSE #100
    MoveToObject([GOODCUTOFF])
END

IF
  Allegiance(Myself,ENEMY)
  OR(2)
    !Allegiance(LastSeenBy(Myself),GOODCUTOFF)
    !See([GOODCUTOFF])
THEN
  RESPONSE #100
    MoveToObject(Player1)
END

IF
  Allegiance(Myself,GOODCUTOFF)
  !Allegiance(LastSeenBy(Myself),EVILCUTOFF)
  See([EVILCUTOFF])
THEN
  RESPONSE #100
    MoveToObject([EVILCUTOFF])
END

IF
  Allegiance(Myself,GOODCUTOFF)
  OR(2)
    !Allegiance(LastSeenBy(Myself),EVILCUTOFF)
    !See([EVILCUTOFF])
THEN
  RESPONSE #100
    MoveToObject(Player1)
END

IF
  Allegiance(Myself,GOODCUTOFF)
  InParty(LastSeenBy(Myself))
THEN
  RESPONSE #100
    RandomWalkContinuous()
END

IF
  StateCheck(LastSeenBy(Myself),STATE_DEAD)
THEN
  RESPONSE #100
    RandomWalkContinuous()
END

IF
  Allegiance(Myself,ENEMY)
  !Range(NearestEnemyOf(Myself),10)
  !GlobalTimerNotExpired("Spell","LOCALS")
  !NumCreatureGT([EVILCUTOFF.UNDEAD.0.0.0.SUMMONED],4)
  !Class(LastSeenBy(Myself),CLERIC_ALL)
  !Class(LastSeenBy(Myself),PALADIN_ALL)
THEN
  RESPONSE #50
    SetGlobalTimer("Spell","LOCALS",6)
    ForceSpell(LastSeenBy(Myself),CLERIC_ANIMATE_DEAD)
  RESPONSE #50
    SetGlobalTimer("Spell","LOCALS",6)
    SpellNoDec(LastSeenBy(Myself),CLERIC_ANIMATE_DEAD)
  RESPONSE #200
    Continue()
END

IF
  !Allegiance(Myself,GOODCUTOFF)
  !Range(NearestEnemyOf(Myself),10)
  !CheckStatGT(LastSeenBy(Myself),50,RESISTMAGIC)
  CheckStatLT(LastSeenBy(Myself),75,RESISTPOISON)
  !Race(LastSeenBy(Myself),DEMONIC)
  !Race(LastSeenBy(Myself),SOLAR)
  !Race(LastSeenBy(Myself),ANTISOLAR)
  !Race(LastSeenBy(Myself),PLANATAR)
  !Race(LastSeenBy(Myself),DARKPLANATAR)
  !Race(LastSeenBy(Myself),ELEMENTAL)
  !General(LastSeenBy(Myself),UNDEAD)
  !GlobalTimerNotExpired("Spell","LOCALS")
  !GlobalTimerNotExpired("Cloudkill","LOCALS")
THEN
  RESPONSE #50
    SetGlobalTimer("Spell","LOCALS",6)
    SpellNoDec(NearestEnemyOf(Myself),WIZARD_CLOUDKILL)
  RESPONSE #50
    SetGlobalTimer("Spell","LOCALS",6)
    SpellNoDec(NearestEnemyOf(Myself),WIZARD_CLOUDKILL)
  RESPONSE #200
    Continue()
END

IF
  !CheckStatGT(LastSeenBy(Myself),0,128)
THEN
  RESPONSE #100
    AttackOneRound(LastSeenBy(Myself))
END

IF
  True()
THEN
  RESPONSE #100
    RandomWalk()
END

