IF
  See(NearestEnemyOf(Myself))
  HaveSpell(WIZARD_SHADOW_DOOR)
THEN
  RESPONSE #100
    Spell(Myself,WIZARD_SHADOW_DOOR)
END

IF
  See(NearestEnemyOf(Myself))
  HaveSpell(WIZARD_NPC_SYMBOL_STUN)
THEN
  RESPONSE #100
    Spell(NearestEnemyOf(Myself),WIZARD_NPC_SYMBOL_STUN)
END

IF
  See(NearestEnemyOf(Myself))
  HaveSpell(WIZARD_CHAIN_LIGHTNING)
  GlobalLT("chain","LOCALS",2)
THEN
  RESPONSE #100
    Spell(NearestEnemyOf(Myself),WIZARD_CHAIN_LIGHTNING)
    IncrementGlobal("chain","LOCALS",1)
END

IF
  See(NearestEnemyOf(Myself))
  HaveSpell(WIZARD_MAZE)
THEN
  RESPONSE #100
    Spell(NearestEnemyOf(Myself),WIZARD_MAZE)
END

IF
  See(NearestEnemyOfType([0.0.0.LONG_BOW]))
  HaveSpell(WIZARD_RUBY_RAY_OF_REVERSAL)
THEN
  RESPONSE #100
    Spell(LastSeenBy(Myself),WIZARD_RUBY_RAY_OF_REVERSAL)
END

IF
  See(NearestEnemyOf(Myself))
  HaveSpell(WIZARD_NPC_SYMBOL_FEAR)
THEN
  RESPONSE #100
    Spell(NearestEnemyOf(Myself),WIZARD_NPC_SYMBOL_FEAR)
END

IF
  See(NearestEnemyOf(Myself))
  !StateCheck(LastSeenBy(Myself),STATE_STUNNED)
  HaveSpell(WIZARD_POWER_WORD_STUN)
THEN
  RESPONSE #100
    Spell(NearestEnemyOf(Myself),WIZARD_POWER_WORD_STUN)
END

IF
  See(NearestEnemyOf(Myself))
  HaveSpell(WIZARD_SUN_FIRE)
THEN
  RESPONSE #100
    Spell(Myself,WIZARD_SUN_FIRE)
END

IF
  See(NearestEnemyOf(Myself))
  HaveSpell(WIZARD_MISLEAD)
THEN
  RESPONSE #100
    Spell(Myself,WIZARD_MISLEAD)
END

IF
  See(NearestEnemyOf(Myself))
  HaveSpell(WIZARD_TRUE_SIGHT)
THEN
  RESPONSE #100
    Spell(NearestEnemyOf(Myself),WIZARD_TRUE_SIGHT)
END

IF
  See(NearestEnemyOfType([0.0.0.LONG_BOW]))
  HaveSpell(WIZARD_RUBY_RAY_OF_REVERSAL)
  OR(2)
    HasBounceEffects(LastSeenBy(Myself))
    HasImmunityEffects(LastSeenBy(Myself))
THEN
  RESPONSE #100
    Spell(LastSeenBy(Myself),WIZARD_RUBY_RAY_OF_REVERSAL)
END

IF
  See(NearestEnemyOf(Myself))
  HaveSpell(WIZARD_DISINTEGRATE)
THEN
  RESPONSE #100
    Spell(NearestEnemyOf(Myself),WIZARD_DISINTEGRATE)
END

IF
  See(NearestEnemyOf(Myself))
  HaveSpell(WIZARD_CHAIN_LIGHTNING)
THEN
  RESPONSE #100
    Spell(NearestEnemyOf(Myself),WIZARD_CHAIN_LIGHTNING)
END

IF
  See(NearestEnemyOf(Myself))
  HaveSpell(WIZARD_CHAOS)
THEN
  RESPONSE #100
    Spell(NearestEnemyOf(Myself),WIZARD_CHAOS)
END

IF
  See(NearestEnemyOf(Myself))
  HaveSpell(WIZARD_DOMINATION)
THEN
  RESPONSE #100
    Spell(NearestEnemyOf(Myself),WIZARD_DOMINATION)
END

IF
  See(NearestEnemyOf(Myself))
  HaveSpell(WIZARD_FLAME_ARROW)
THEN
  RESPONSE #100
    Spell(NearestEnemyOf(Myself),WIZARD_FLAME_ARROW)
END

IF
  See(NearestEnemyOf(Myself))
  HaveSpell(WIZARD_MELF_ACID_ARROW)
THEN
  RESPONSE #100
    Spell(NearestEnemyOf(Myself),WIZARD_MELF_ACID_ARROW)
END

IF
  See(NearestEnemyOf(Myself))
  HaveSpell(WIZARD_MAGIC_MISSILE)
THEN
  RESPONSE #100
    Spell(NearestEnemyOf(Myself),WIZARD_MAGIC_MISSILE)
END
