IF
  Global("xyxInitialized","LOCALS",0)
THEN
  RESPONSE #100
    SetGlobalTimer("xyxImmunity","LOCALS",6)
    SetGlobalTimer("xyxManeuver","LOCALS",18)
    SetGlobal("xyxInitialized","LOCALS",1)
    Continue()
END

IF
  CheckStatLT(Myself,100,RESISTSLASHING)
  OR(4)
    CheckStat(LastAttackerOf(Myself),5,SCRIPTINGSTATE4)
    CheckStat(LastAttackerOf(Myself),4,SCRIPTINGSTATE4)
    CheckStat(NearestEnemyOf(Myself),5,SCRIPTINGSTATE4)
    CheckStat(NearestEnemyOf(Myself),4,SCRIPTINGSTATE4)
THEN
  RESPONSE #100
    SetGlobalTimer("xyxGasseousForm","LOCALS",6)
    ForceSpellRES("BODGASF",Myself)  // <Invalid Strref -1>
    RunAwayFrom(NearestEnemyOf(Myself),90)
END

IF
  HPPercentLT(Myself,50)
  CheckStatLT(Myself,100,RESISTSLASHING)
THEN
  RESPONSE #100
    SetGlobalTimer("xyxGasseousForm","LOCALS",6)
    ForceSpellRES("BODGASF",Myself)  // <Invalid Strref -1>
    Continue()
END

IF
  CheckStat(Myself,100,RESISTSLASHING)
  OR(2)
    HPPercentLT(Myself,100)
    GlobalTimerNotExpired("xyxGasseousForm","LOCALS")
  See(NearestEnemyOf(Myself))
THEN
  RESPONSE #100
    RunAwayFrom(NearestEnemyOf(Myself),45)
  RESPONSE #100
    RandomWalkContinuous()
END

IF
  !See(NearestEnemyOf(Myself))
  CheckStat(Myself,100,RESISTSLASHING)
  OR(2)
    HPPercentLT(Myself,100)
    GlobalTimerNotExpired("xyxGasseousForm","LOCALS")
THEN
  RESPONSE #100
    NoAction()
  RESPONSE #100
    RandomWalk()
END

IF
  GlobalTimerExpired("xyxManeuver","LOCALS")
THEN
  RESPONSE #100
    SetGlobalTimer("xyxManeuver","LOCALS",11)
    RandomWalkContinuous()
END

IF
  StateCheck(Myself,STATE_BLIND)
  !See(NearestEnemyOf(Myself))
THEN
  RESPONSE #100
    RandomWalkContinuous()
  RESPONSE #100
    MoveToObject(Player1)
END

IF
  !See(NearestEnemyOf(Myself))
  CheckStatLT(Myself,100,RESISTSLASHING)
  Global("KRBODBAT","GLOBAL",0)
THEN
  RESPONSE #100
    ForceSpellRES("SPINKRBT",Myself)  // ~Transform Into Bat~
    Continue()
END

IF
  !See(NearestEnemyOf(Myself))
  !RandomNumGT(6,1)
  !GlobalTimerNotExpired("xyxGasseousForm","LOCALS")
THEN
  RESPONSE #100
    MoveToObject(Player1)
END

IF
  !See(NearestEnemyOf(Myself))
  !RandomNumGT(6,2)
  !GlobalTimerNotExpired("xyxGasseousForm","LOCALS")
THEN
  RESPONSE #100
    MoveToObject(Player2)
END

IF
  !See(NearestEnemyOf(Myself))
  !RandomNumGT(6,3)
  !GlobalTimerNotExpired("xyxGasseousForm","LOCALS")
THEN
  RESPONSE #100
    MoveToObject(Player3)
END

IF
  !See(NearestEnemyOf(Myself))
  !RandomNumGT(6,4)
  !GlobalTimerNotExpired("xyxGasseousForm","LOCALS")
THEN
  RESPONSE #100
    MoveToObject(Player4)
END

IF
  !See(NearestEnemyOf(Myself))
  !RandomNumGT(6,5)
  !GlobalTimerNotExpired("xyxGasseousForm","LOCALS")
THEN
  RESPONSE #100
    MoveToObject(Player5)
END

IF
  !See(NearestEnemyOf(Myself))
  !RandomNumGT(6,6)
  !GlobalTimerNotExpired("xyxGasseousForm","LOCALS")
THEN
  RESPONSE #100
    MoveToObject(Player6)
END

IF
  CheckStatLT(Myself,100,RESISTSLASHING)
  Global("KRBODBAT","GLOBAL",0)
  !GlobalTimerNotExpired("xyxVampireDomination","LOCALS")
  !GlobalTimerExpired("xyxImmunity","LOCALS")
  See(NearestEnemyOf(Myself))
  OR(16)
    CheckStatGT(LastSeenBy(Myself),0,116)
    CheckStatGT(LastSeenBy(Myself),0,129)
    CheckStatGT(LastSeenBy(Myself),0,164)
    CheckStatGT(LastSeenBy(Myself),0,164)
    StateCheck(LastSeenBy(Myself),STATE_BERSERK)
    CheckStat(LastSeenBy(Myself),1,SCRIPTINGSTATE3)
    Class(LastSeenBy(Myself),MONK)
    HasItemEquiped("HELM06",LastSeenBy(Myself))
    HasItemEquiped("NPCHAN",LastSeenBy(Myself))
    HasItemEquiped("SHLD25",LastSeenBy(Myself))
    HasItemEquipedReal("REAVER",LastSeenBy(Myself))
    HasItemEquipedReal("SPER07",LastSeenBy(Myself))
    HasItemEquipedReal("STAF11",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H35",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H54",LastSeenBy(Myself))
    HasItemEquipedReal("SW2H14",LastSeenBy(Myself))
  See(ThirdNearestEnemyOf(Myself))
  OR(16)
    CheckStatGT(LastSeenBy(Myself),0,116)
    CheckStatGT(LastSeenBy(Myself),0,129)
    CheckStatGT(LastSeenBy(Myself),0,164)
    CheckStatGT(LastSeenBy(Myself),0,164)
    StateCheck(LastSeenBy(Myself),STATE_BERSERK)
    CheckStat(LastSeenBy(Myself),1,SCRIPTINGSTATE3)
    Class(LastSeenBy(Myself),MONK)
    HasItemEquiped("HELM06",LastSeenBy(Myself))
    HasItemEquiped("NPCHAN",LastSeenBy(Myself))
    HasItemEquiped("SHLD25",LastSeenBy(Myself))
    HasItemEquipedReal("REAVER",LastSeenBy(Myself))
    HasItemEquipedReal("SPER07",LastSeenBy(Myself))
    HasItemEquipedReal("STAF11",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H35",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H54",LastSeenBy(Myself))
    HasItemEquipedReal("SW2H14",LastSeenBy(Myself))
  See(SixthNearestEnemyOf(Myself))
  OR(16)
    CheckStatGT(LastSeenBy(Myself),0,116)
    CheckStatGT(LastSeenBy(Myself),0,129)
    CheckStatGT(LastSeenBy(Myself),0,164)
    CheckStatGT(LastSeenBy(Myself),0,164)
    StateCheck(LastSeenBy(Myself),STATE_BERSERK)
    CheckStat(LastSeenBy(Myself),1,SCRIPTINGSTATE3)
    Class(LastSeenBy(Myself),MONK)
    HasItemEquiped("HELM06",LastSeenBy(Myself))
    HasItemEquiped("NPCHAN",LastSeenBy(Myself))
    HasItemEquiped("SHLD25",LastSeenBy(Myself))
    HasItemEquipedReal("REAVER",LastSeenBy(Myself))
    HasItemEquipedReal("SPER07",LastSeenBy(Myself))
    HasItemEquipedReal("STAF11",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H35",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H54",LastSeenBy(Myself))
    HasItemEquipedReal("SW2H14",LastSeenBy(Myself))
  See(NearestEnemyOf(Myself))
  OR(12)
    StateCheck(LastSeenBy(Myself),STATE_BERSERK)
    CheckStat(LastSeenBy(Myself),1,SCRIPTINGSTATE3)
    Class(LastSeenBy(Myself),MONK)
    HasItemEquiped("HELM06",LastSeenBy(Myself))
    HasItemEquiped("NPCHAN",LastSeenBy(Myself))
    HasItemEquiped("SHLD25",LastSeenBy(Myself))
    HasItemEquipedReal("REAVER",LastSeenBy(Myself))
    HasItemEquipedReal("SPER07",LastSeenBy(Myself))
    HasItemEquipedReal("STAF11",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H35",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H54",LastSeenBy(Myself))
    HasItemEquipedReal("SW2H14",LastSeenBy(Myself))
  See(ThirdNearestEnemyOf(Myself))
  OR(12)
    StateCheck(LastSeenBy(Myself),STATE_BERSERK)
    CheckStat(LastSeenBy(Myself),1,SCRIPTINGSTATE3)
    Class(LastSeenBy(Myself),MONK)
    HasItemEquiped("HELM06",LastSeenBy(Myself))
    HasItemEquiped("NPCHAN",LastSeenBy(Myself))
    HasItemEquiped("SHLD25",LastSeenBy(Myself))
    HasItemEquipedReal("REAVER",LastSeenBy(Myself))
    HasItemEquipedReal("SPER07",LastSeenBy(Myself))
    HasItemEquipedReal("STAF11",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H35",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H54",LastSeenBy(Myself))
    HasItemEquipedReal("SW2H14",LastSeenBy(Myself))
  See(SixthNearestEnemyOf(Myself))
  OR(12)
    StateCheck(LastSeenBy(Myself),STATE_BERSERK)
    CheckStat(LastSeenBy(Myself),1,SCRIPTINGSTATE3)
    Class(LastSeenBy(Myself),MONK)
    HasItemEquiped("HELM06",LastSeenBy(Myself))
    HasItemEquiped("NPCHAN",LastSeenBy(Myself))
    HasItemEquiped("SHLD25",LastSeenBy(Myself))
    HasItemEquipedReal("REAVER",LastSeenBy(Myself))
    HasItemEquipedReal("SPER07",LastSeenBy(Myself))
    HasItemEquipedReal("STAF11",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H35",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H54",LastSeenBy(Myself))
    HasItemEquipedReal("SW2H14",LastSeenBy(Myself))
  See(NearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
END

IF
  CheckStatLT(Myself,100,RESISTSLASHING)
  Global("KRBODBAT","GLOBAL",0)
  !GlobalTimerNotExpired("xyxVampireDomination","LOCALS")
  !GlobalTimerExpired("xyxImmunity","LOCALS")
  !StateCheck(LastSeenBy(Myself),STATE_BERSERK)
  !CheckStat(LastSeenBy(Myself),1,SCRIPTINGSTATE3)
  !Class(LastSeenBy(Myself),MONK)
  !HasItemEquiped("HELM06",LastSeenBy(Myself))
  !HasItemEquiped("NPCHAN",LastSeenBy(Myself))
  !HasItemEquiped("SHLD25",LastSeenBy(Myself))
  !HasItemEquipedReal("REAVER",LastSeenBy(Myself))
  !HasItemEquipedReal("SPER07",LastSeenBy(Myself))
  !HasItemEquipedReal("STAF11",LastSeenBy(Myself))
  !HasItemEquipedReal("SW1H35",LastSeenBy(Myself))
  !HasItemEquipedReal("SW1H54",LastSeenBy(Myself))
  !HasItemEquipedReal("SW2H14",LastSeenBy(Myself))
THEN
  RESPONSE #100
    SetGlobalTimer("xyxVampireDomination","LOCALS",6)
    ForceSpell(LastSeenBy(Myself),VAMPIRE_DOMINATION)
END

IF
  CheckStatLT(Myself,100,RESISTSLASHING)
  Global("KRBODBAT","GLOBAL",0)
  !GlobalTimerNotExpired("xyxVampireDomination","LOCALS")
  GlobalTimerExpired("xyxImmunity","LOCALS")
  See(NearestEnemyOf(Myself))
  OR(21)
    CheckStatLT(LastSeenBy(Myself),4,SAVEVSSPELL)
    CheckStatGT(LastSeenBy(Myself),25,RESISTMAGIC)
    StateCheck(LastSeenBy(Myself),STATE_BERSERK)
    CheckStat(LastSeenBy(Myself),1,SCRIPTINGSTATE3)
    Class(LastSeenBy(Myself),MONK)
    CheckStatGT(LastSeenBy(Myself),0,119)
    CheckStat(LastSeenBy(Myself),4,162)
    HasItemEquiped("HELM06",LastSeenBy(Myself))
    HasItemEquiped("NPCHAN",LastSeenBy(Myself))
    HasItemEquiped("SHLD25",LastSeenBy(Myself))
    HasItemEquipedReal("REAVER",LastSeenBy(Myself))
    HasItemEquipedReal("SPER07",LastSeenBy(Myself))
    HasItemEquipedReal("STAF11",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H35",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H54",LastSeenBy(Myself))
    HasItemEquipedReal("SW2H14",LastSeenBy(Myself))
    HasItemEquipedReal("MISCBC",LastSeenBy(Myself))
    Race(LastSeenBy(Myself),PLANATAR)
    Race(LastSeenBy(Myself),DARKPLANATAR)
    Race(LastSeenBy(Myself),SOLAR)
    Race(LastSeenBy(Myself),ANTISOLAR)
  See(ThirdNearestEnemyOf(Myself))
  OR(21)
    CheckStatLT(LastSeenBy(Myself),4,SAVEVSSPELL)
    CheckStatGT(LastSeenBy(Myself),25,RESISTMAGIC)
    StateCheck(LastSeenBy(Myself),STATE_BERSERK)
    CheckStat(LastSeenBy(Myself),1,SCRIPTINGSTATE3)
    Class(LastSeenBy(Myself),MONK)
    CheckStatGT(LastSeenBy(Myself),0,119)
    CheckStat(LastSeenBy(Myself),4,162)
    HasItemEquiped("HELM06",LastSeenBy(Myself))
    HasItemEquiped("NPCHAN",LastSeenBy(Myself))
    HasItemEquiped("SHLD25",LastSeenBy(Myself))
    HasItemEquipedReal("REAVER",LastSeenBy(Myself))
    HasItemEquipedReal("SPER07",LastSeenBy(Myself))
    HasItemEquipedReal("STAF11",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H35",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H54",LastSeenBy(Myself))
    HasItemEquipedReal("SW2H14",LastSeenBy(Myself))
    HasItemEquipedReal("MISCBC",LastSeenBy(Myself))
    Race(LastSeenBy(Myself),PLANATAR)
    Race(LastSeenBy(Myself),DARKPLANATAR)
    Race(LastSeenBy(Myself),SOLAR)
    Race(LastSeenBy(Myself),ANTISOLAR)
  See(SixthNearestEnemyOf(Myself))
  OR(21)
    CheckStatLT(LastSeenBy(Myself),4,SAVEVSSPELL)
    CheckStatGT(LastSeenBy(Myself),25,RESISTMAGIC)
    StateCheck(LastSeenBy(Myself),STATE_BERSERK)
    CheckStat(LastSeenBy(Myself),1,SCRIPTINGSTATE3)
    Class(LastSeenBy(Myself),MONK)
    CheckStatGT(LastSeenBy(Myself),0,119)
    CheckStat(LastSeenBy(Myself),4,162)
    HasItemEquiped("HELM06",LastSeenBy(Myself))
    HasItemEquiped("NPCHAN",LastSeenBy(Myself))
    HasItemEquiped("SHLD25",LastSeenBy(Myself))
    HasItemEquipedReal("REAVER",LastSeenBy(Myself))
    HasItemEquipedReal("SPER07",LastSeenBy(Myself))
    HasItemEquipedReal("STAF11",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H35",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H54",LastSeenBy(Myself))
    HasItemEquipedReal("SW2H14",LastSeenBy(Myself))
    HasItemEquipedReal("MISCBC",LastSeenBy(Myself))
    Race(LastSeenBy(Myself),PLANATAR)
    Race(LastSeenBy(Myself),DARKPLANATAR)
    Race(LastSeenBy(Myself),SOLAR)
    Race(LastSeenBy(Myself),ANTISOLAR)
  See(NearestEnemyOf(Myself))
  OR(21)
    CheckStatLT(LastSeenBy(Myself),1,SAVEVSSPELL)
    CheckStatGT(LastSeenBy(Myself),75,RESISTMAGIC)
    StateCheck(LastSeenBy(Myself),STATE_BERSERK)
    CheckStat(LastSeenBy(Myself),1,SCRIPTINGSTATE3)
    Class(LastSeenBy(Myself),MONK)
    CheckStatGT(LastSeenBy(Myself),0,119)
    CheckStat(LastSeenBy(Myself),4,162)
    HasItemEquiped("HELM06",LastSeenBy(Myself))
    HasItemEquiped("NPCHAN",LastSeenBy(Myself))
    HasItemEquiped("SHLD25",LastSeenBy(Myself))
    HasItemEquipedReal("REAVER",LastSeenBy(Myself))
    HasItemEquipedReal("SPER07",LastSeenBy(Myself))
    HasItemEquipedReal("STAF11",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H35",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H54",LastSeenBy(Myself))
    HasItemEquipedReal("SW2H14",LastSeenBy(Myself))
    HasItemEquipedReal("MISCBC",LastSeenBy(Myself))
    Race(LastSeenBy(Myself),PLANATAR)
    Race(LastSeenBy(Myself),DARKPLANATAR)
    Race(LastSeenBy(Myself),SOLAR)
    Race(LastSeenBy(Myself),ANTISOLAR)
  See(ThirdNearestEnemyOf(Myself))
  OR(21)
    CheckStatLT(LastSeenBy(Myself),1,SAVEVSSPELL)
    CheckStatGT(LastSeenBy(Myself),75,RESISTMAGIC)
    StateCheck(LastSeenBy(Myself),STATE_BERSERK)
    CheckStat(LastSeenBy(Myself),1,SCRIPTINGSTATE3)
    Class(LastSeenBy(Myself),MONK)
    CheckStatGT(LastSeenBy(Myself),0,119)
    CheckStat(LastSeenBy(Myself),4,162)
    HasItemEquiped("HELM06",LastSeenBy(Myself))
    HasItemEquiped("NPCHAN",LastSeenBy(Myself))
    HasItemEquiped("SHLD25",LastSeenBy(Myself))
    HasItemEquipedReal("REAVER",LastSeenBy(Myself))
    HasItemEquipedReal("SPER07",LastSeenBy(Myself))
    HasItemEquipedReal("STAF11",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H35",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H54",LastSeenBy(Myself))
    HasItemEquipedReal("SW2H14",LastSeenBy(Myself))
    HasItemEquipedReal("MISCBC",LastSeenBy(Myself))
    Race(LastSeenBy(Myself),PLANATAR)
    Race(LastSeenBy(Myself),DARKPLANATAR)
    Race(LastSeenBy(Myself),SOLAR)
    Race(LastSeenBy(Myself),ANTISOLAR)
  See(SixthNearestEnemyOf(Myself))
  OR(21)
    CheckStatLT(LastSeenBy(Myself),1,SAVEVSSPELL)
    CheckStatGT(LastSeenBy(Myself),75,RESISTMAGIC)
    StateCheck(LastSeenBy(Myself),STATE_BERSERK)
    CheckStat(LastSeenBy(Myself),1,SCRIPTINGSTATE3)
    Class(LastSeenBy(Myself),MONK)
    CheckStatGT(LastSeenBy(Myself),0,119)
    CheckStat(LastSeenBy(Myself),4,162)
    HasItemEquiped("HELM06",LastSeenBy(Myself))
    HasItemEquiped("NPCHAN",LastSeenBy(Myself))
    HasItemEquiped("SHLD25",LastSeenBy(Myself))
    HasItemEquipedReal("REAVER",LastSeenBy(Myself))
    HasItemEquipedReal("SPER07",LastSeenBy(Myself))
    HasItemEquipedReal("STAF11",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H35",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H54",LastSeenBy(Myself))
    HasItemEquipedReal("SW2H14",LastSeenBy(Myself))
    HasItemEquipedReal("MISCBC",LastSeenBy(Myself))
    Race(LastSeenBy(Myself),PLANATAR)
    Race(LastSeenBy(Myself),DARKPLANATAR)
    Race(LastSeenBy(Myself),SOLAR)
    Race(LastSeenBy(Myself),ANTISOLAR)
  See(NearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
END

IF
  CheckStatLT(Myself,100,RESISTSLASHING)
  Global("KRBODBAT","GLOBAL",0)
  !GlobalTimerNotExpired("xyxVampireDomination","LOCALS")
  GlobalTimerExpired("xyxImmunity","LOCALS")
  !CheckStatLT(LastSeenBy(Myself),1,SAVEVSSPELL)
  !CheckStatGT(LastSeenBy(Myself),75,RESISTMAGIC)
  !StateCheck(LastSeenBy(Myself),STATE_BERSERK)
  !CheckStat(LastSeenBy(Myself),1,SCRIPTINGSTATE3)
  !Class(LastSeenBy(Myself),MONK)
  !CheckStatGT(LastSeenBy(Myself),0,119)
  !CheckStat(LastSeenBy(Myself),4,162)
  !HasItemEquiped("HELM06",LastSeenBy(Myself))
  !HasItemEquiped("NPCHAN",LastSeenBy(Myself))
  !HasItemEquiped("SHLD25",LastSeenBy(Myself))
  !HasItemEquipedReal("REAVER",LastSeenBy(Myself))
  !HasItemEquipedReal("SPER07",LastSeenBy(Myself))
  !HasItemEquipedReal("STAF11",LastSeenBy(Myself))
  !HasItemEquipedReal("SW1H35",LastSeenBy(Myself))
  !HasItemEquipedReal("SW1H54",LastSeenBy(Myself))
  !HasItemEquipedReal("SW2H14",LastSeenBy(Myself))
  !HasItemEquipedReal("MISCBC",LastSeenBy(Myself))
  !Race(LastSeenBy(Myself),PLANATAR)
  !Race(LastSeenBy(Myself),DARKPLANATAR)
  !Race(LastSeenBy(Myself),SOLAR)
  !Race(LastSeenBy(Myself),ANTISOLAR)
THEN
  RESPONSE #100
    SetGlobalTimer("xyxVampireDomination","LOCALS",6)
    ForceSpell(LastSeenBy(Myself),VAMPIRE_DOMINATION)
END

IF
  CheckStatLT(Myself,100,RESISTSLASHING)
  Global("KRBODBAT","GLOBAL",0)
  !GlobalTimerNotExpired("xyxVampireFear","LOCALS")
  !GlobalTimerExpired("xyxImmunity","LOCALS")
  See(NearestEnemyOf(Myself))
THEN
  RESPONSE #100
    SetGlobalTimer("xyxVampireFear","LOCALS",6)
    ForceSpell(LastSeenBy(Myself),VAMPIRE_FEAR)
END

IF
  CheckStatLT(Myself,100,RESISTSLASHING)
  Global("KRBODBAT","GLOBAL",0)
  !GlobalTimerNotExpired("xyxVampireFear","LOCALS")
  GlobalTimerExpired("xyxImmunity","LOCALS")
  See(SixthNearestEnemyOf(Myself))
  CheckStatLT(LastSeenBy(Myself),6,SAVEVSSPELL)
  See(NearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
END

IF
  CheckStatLT(Myself,100,RESISTSLASHING)
  Global("KRBODBAT","GLOBAL",0)
  !GlobalTimerNotExpired("xyxVampireFear","LOCALS")
  GlobalTimerExpired("xyxImmunity","LOCALS")
  !CheckStatLT(LastSeenBy(Myself),6,SAVEVSSPELL)
  CheckStat(LastSeenBy(Myself),0,178)
  !Range(LastSeenBy(Myself),0)
THEN
  RESPONSE #100
    SetGlobalTimer("xyxVampireFear","LOCALS",6)
    ForceSpell(LastSeenBy(Myself),VAMPIRE_FEAR)
END

IF
  CheckStatLT(Myself,100,RESISTSLASHING)
  Global("KRBODBAT","GLOBAL",0)
  !GlobalTimerExpired("xyxImmunity","LOCALS")
  See(SixthNearestEnemyOf(Myself))
  OR(7)
    CheckStatLT(LastSeenBy(Myself),-8,ARMORCLASS)
    StateCheck(LastSeenBy(Myself),STATE_MIRRORIMAGE)
    CheckStatGT(LastSeenBy(Myself),0,STONESKINS)
    CheckStatGT(LastSeenBy(Myself),2,128)
    HasItemEquiped("AMUL21",LastSeenBy(Myself))
    HasItemEquipedReal("BLUN25",LastSeenBy(Myself))
    Gender(LastSeenBy(Myself),SUMMONED)
  See(SixthNearestEnemyOf(Myself))
  OR(5)
    CheckStatLT(LastSeenBy(Myself),-13,ARMORCLASS)
    StateCheck(LastSeenBy(Myself),STATE_MIRRORIMAGE)
    CheckStatGT(LastSeenBy(Myself),2,128)
    HasItemEquiped("AMUL21",LastSeenBy(Myself))
    HasItemEquipedReal("BLUN25",LastSeenBy(Myself))
  See(SixthNearestEnemyOf(Myself))
  OR(2)
    CheckStatLT(LastSeenBy(Myself),-18,ARMORCLASS)
    CheckStatGT(LastSeenBy(Myself),2,128)
  See(NearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
END

IF
  CheckStatLT(Myself,100,RESISTSLASHING)
  Global("KRBODBAT","GLOBAL",0)
  GlobalTimerExpired("xyxImmunity","LOCALS")
  See(SixthNearestEnemyOf(Myself))
  OR(13)
    CheckStatLT(LastSeenBy(Myself),-8,ARMORCLASS)
    StateCheck(LastSeenBy(Myself),STATE_MIRRORIMAGE)
    CheckStatGT(LastSeenBy(Myself),0,STONESKINS)
    CheckStatGT(LastSeenBy(Myself),25,RESISTSLASHING)
    CheckStatGT(LastSeenBy(Myself),2,128)
    HasItemEquiped("AMUL21",LastSeenBy(Myself))
    HasItemEquipedReal("BLUN25",LastSeenBy(Myself))
    HasItemEquipedReal("DEVA",LastSeenBy(Myself))
    HasItemEquipedReal("HAMM10",LastSeenBy(Myself))
    HasItemEquipedReal("HAMM11",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H61",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H69",LastSeenBy(Myself))
    Gender(LastSeenBy(Myself),SUMMONED)
  See(SixthNearestEnemyOf(Myself))
  OR(11)
    CheckStatLT(LastSeenBy(Myself),-13,ARMORCLASS)
    StateCheck(LastSeenBy(Myself),STATE_MIRRORIMAGE)
    CheckStatGT(LastSeenBy(Myself),100,RESISTSLASHING)
    CheckStatGT(LastSeenBy(Myself),2,128)
    HasItemEquiped("AMUL21",LastSeenBy(Myself))
    HasItemEquipedReal("BLUN25",LastSeenBy(Myself))
    HasItemEquipedReal("DEVA",LastSeenBy(Myself))
    HasItemEquipedReal("HAMM10",LastSeenBy(Myself))
    HasItemEquipedReal("HAMM11",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H61",LastSeenBy(Myself))
    HasItemEquipedReal("SW1H69",LastSeenBy(Myself))
  See(SixthNearestEnemyOf(Myself))
  OR(2)
    CheckStatLT(LastSeenBy(Myself),-18,ARMORCLASS)
    CheckStatGT(LastSeenBy(Myself),2,128)
  See(NearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
END

IF
  CheckStatLT(Myself,100,RESISTSLASHING)
  Global("KRBODBAT","GLOBAL",0)
  OR(2)
    !GlobalTimerExpired("xyxImmunity","LOCALS")
    CheckStatLT(LastSeenBy(Myself),3,128)
  !Range(LastSeenBy(Myself),20)
THEN
  RESPONSE #100
    ForceSpellRES("SPINKRBT",Myself)  // ~Transform Into Bat~
    MoveToObject(LastSeenBy(Myself))
    ForceSpellRES("SPINKRVA",Myself)  // ~Gaseous Form~
    AttackOneRound(LastSeenBy(Myself))
END

IF
  OR(2)
    CheckStat(Myself,100,RESISTSLASHING)
    Global("KRBODBAT","GLOBAL",1)
  OR(2)
    !GlobalTimerExpired("xyxImmunity","LOCALS")
    CheckStatLT(LastSeenBy(Myself),3,128)
  !Range(LastSeenBy(Myself),4)
THEN
  RESPONSE #100
    MoveToObject(LastSeenBy(Myself))
    ForceSpellRES("SPINKRVA",Myself)  // ~Gaseous Form~
    AttackOneRound(LastSeenBy(Myself))
END

IF
  OR(2)
    CheckStat(Myself,100,RESISTSLASHING)
    Global("KRBODBAT","GLOBAL",1)
  OR(2)
    !GlobalTimerExpired("xyxImmunity","LOCALS")
    CheckStatLT(LastSeenBy(Myself),3,128)
THEN
  RESPONSE #100
    ForceSpellRES("SPINKRVA",Myself)  // ~Gaseous Form~
    AttackOneRound(LastSeenBy(Myself))
END

IF
  CheckStatLT(Myself,100,RESISTSLASHING)
  Global("KRBODBAT","GLOBAL",0)
  OR(2)
    !GlobalTimerExpired("xyxImmunity","LOCALS")
    CheckStatLT(LastSeenBy(Myself),3,128)
THEN
  RESPONSE #100
    AttackOneRound(LastSeenBy(Myself))
END

IF
  CheckStatLT(Myself,100,RESISTSLASHING)
  Global("KRBODBAT","GLOBAL",0)
  GlobalTimerExpired("xyxImmunity","LOCALS")
  See(NearestEnemyOf(Myself))
  OR(2)
    !StateCheck(LastSeenBy(Myself),STATE_CHARMED)
    CheckStatLT(LastSeenBy(Myself),3,128)
  See(ThirdNearestEnemyOf(Myself))
  OR(2)
    !StateCheck(LastSeenBy(Myself),STATE_CHARMED)
    CheckStatLT(LastSeenBy(Myself),3,128)
  See(SixthNearestEnemyOf(Myself))
  OR(2)
    !StateCheck(LastSeenBy(Myself),STATE_CHARMED)
    CheckStatLT(LastSeenBy(Myself),3,128)
  See(NearestEnemyOf(Myself))
  False()
THEN
  RESPONSE #100
END

IF
  OR(2)
    CheckStat(Myself,100,RESISTSLASHING)
    Global("KRBODBAT","GLOBAL",1)
  OR(2)
    !GlobalTimerExpired("xyxImmunity","LOCALS")
    CheckStatLT(LastSeenBy(Myself),3,128)
THEN
  RESPONSE #100
    ForceSpellRES("SPINKRVA",Myself)  // ~Gaseous Form~
    AttackOneRound(LastSeenBy(Myself))
END

IF
  CheckStatLT(Myself,100,RESISTSLASHING)
  Global("KRBODBAT","GLOBAL",0)
  OR(2)
    !GlobalTimerExpired("xyxImmunity","LOCALS")
    CheckStatLT(LastSeenBy(Myself),3,128)
THEN
  RESPONSE #100
    AttackOneRound(LastSeenBy(Myself))
END

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

