IF
  See(NearestEnemyOf(Myself))
  HPLT(Myself,30)
 !StateCheck(Myself,STATE_INVISIBLE)
THEN
  RESPONSE #100
    SetInterrupt(FALSE)
    ReallyForceSpell(Myself,WIZARD_INVISIBILITY)
    RunAwayFromNoInterrupt(NearestEnemyOf(Myself),120)
    SetInterrupt(TRUE)
END

IF
  AttackedBy([ANYONE],DEFAULT)
  !HPLT(Myself,40)
THEN
  RESPONSE #100
    ReallyForceSpellRES("SK#Fade",Myself)  // ~Fade~
    AttackOneRound(LastAttackerOf(Myself))
END

IF
  AttackedBy([ANYONE],DEFAULT)
  HPLT(Myself,40)
  HPGT(Myself,29)
THEN
  RESPONSE #100
ForceSpell(LastAttackerOf(Myself),CLERIC_ENERGY_DRAIN)
ReallyForceSpellRES("SK#FForm",Myself)  // ~Fire Wraith~
AttackOneRound(LastAttackerOf(Myself))
//    AttackReevaluate(LastAttackerOf(Myself))
END

IF
  Exists([ENEMY.UNDEAD])
  OR(12)
    Race(LastSeenBy(Myself),LICH)
    Race(LastSeenBy(Myself),DEMILICH)
    Class(LastSeenBy(Myself),VAMPIRE)
    Class(LastSeenBy(Myself),VAMPYRE)
    Class(LastSeenBy(Myself),SHADOW)
    Class(LastSeenBy(Myself),SPECTRE)
    Class(LastSeenBy(Myself),WRAITH)
    Class(LastSeenBy(Myself),ZOMBIE_NORMAL)
    Class(LastSeenBy(Myself),SKELETON)
    Class(LastSeenBy(Myself),SKELETON_WARRIOR)
    Class(LastSeenBy(Myself),SKELETON_BANEGUARD)
    Class(LastSeenBy(Myself),GHOUL)
THEN
  RESPONSE #100
    EquipMostDamagingMelee()
    AttackOneRound(LastSeenBy(Myself))
END

IF
  !Exists([ENEMY.UNDEAD])
  See([ENEMY.0.TROLL])
  HP(LastSeenBy(Myself),1)
THEN
  RESPONSE #100
    MoveToObject([ENEMY.0.TROLL])
    ForceSpell(LastSeenBy(Myself),WIZARD_BURNING_HANDS)
END

IF
  Exists([ENEMY])
  See(NearestEnemyOf(Myself))
THEN
  RESPONSE #100
    EquipMostDamagingMelee()
    AttackOneRound(LastSeenBy(Myself))
END

IF
  Detect([EVILCUTOFF])
  !InParty([EVILCUTOFF])
  OR(6)
    !See(LastSeenBy(Myself))
    See(NearestEnemyOfType([EVILCUTOFF.0.0.0.0.ILLUSIONARY]))
    StateCheck([EVILCUTOFF],STATE_INVISIBLE)
    StateCheck([EVILCUTOFF],STATE_IMPROVEDINVISIBILITY)
    StateCheck([EVILCUTOFF],STATE_MIRRORIMAGE)
    StateCheck([EVILCUTOFF],STATE_BLUR)
  !HPLT(LastSeenBy(Myself),1)
  !GlobalTimerNotExpired("GBClrTrueSght","LOCALS")
THEN
  RESPONSE #100
    ApplySpell(Myself,CLERIC_TRUE_SIGHT)
    SetGlobalTimer("GBClrTrueSght","LOCALS",TWELVE_MINUTES)
END

IF
  OR(2)
    HitBy([ANYTHING],COLD)
    HitBy([ANYTHING],MAGICCOLD)
  !GlobalTimerNotExpired("GBWizBlueShld","LOCALS")
THEN
  RESPONSE #100
    SetGlobalTimer("GBWizBlueShld","LOCALS",150)
    SelectWeaponAbility(SLOT_SHIELD,1)
    UseItem("SHGHOST",Myself)
END

