IF
    See(NearestEnemyOf(Myself))
    Global("Prep","LOCALS",0)
    !Dead("yself)")
THEN
    RESPONSE #100
        ApplySpell(Myself,WIZARD_STONE_SKIN)
        SetGlobal("Prep","LOCALS",1)
END

IF
    See(NearestEnemyOf(Myself))
    StateCheck(Myself,STATE_SILENCED)
    HaveSpell(WIZARD_VOCALIZE)
THEN
    RESPONSE #100
        Spell(Myself,WIZARD_VOCALIZE)
END

IF
    Allegiance(Myself,ENEMY)
    Detect([PC])
    !See(LastSeenBy(Myself))
    HaveSpell(WIZARD_TRUE_SIGHT)
THEN
    RESPONSE #100
        Spell(Myself,WIZARD_TRUE_SIGHT)
END

IF
    See(NearestEnemyOf(Myself))
    CheckStatLT(Myself,1,STONESKINS)
    TookDamage()
    Global("Prep2","LOCALS",0)
    !Dead("yself)")
THEN
    RESPONSE #100
        DisplayString(Myself,3302) // Chain Contingency - Spell Turning
        ApplySpell(NearestEnemyOf(Myself),WIZARD_SPELL_TURNING)
        DisplayString(Myself,40240) // Chain Contingency - Mislead
        ApplySpell(SecondNearestEnemyOf(Myself),WIZARD_MISLEAD)
        SetGlobal("Prep2","LOCALS",1)
END

IF
    See(NearestEnemyOf(Myself))
    Global("SpellTrigger","LOCALS",0)
    !Dead("yself)")
THEN
    RESPONSE #100
        DisplayString(Myself,39968) // Spell Trigger - Fired
        DisplayString(Myself,40248) // Spell Trigger - True Sight
        ReallyForceSpell(NearestEnemyOf(Myself),WIZARD_TRUE_SIGHT)
        DisplayString(Myself,40249) // Spell Trigger - Dispel Magic
        ReallyForceSpell(NearestEnemyOf(Myself),WIZARD_DISPEL_MAGIC)
        SetGlobal("SpellTrigger","LOCALS",1)
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_NPC_SYMBOL_FEAR)
THEN
    RESPONSE #100
        Spell(NearestEnemyOf(Myself),WIZARD_NPC_SYMBOL_FEAR)
END

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

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

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

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

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

IF
    See(NearestEnemyOf(Myself))
    HaveSpell(WIZARD_SLOW)
THEN
    RESPONSE #100
        Spell(NearestEnemyOf(Myself),WIZARD_SLOW)
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_LARLOCH_MINOR_DRAIN)
THEN
    RESPONSE #100
        Spell(NearestEnemyOf(Myself),WIZARD_LARLOCH_MINOR_DRAIN)
END

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

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

IF
    See(NearestEnemyOf(Myself))
THEN
    RESPONSE #100
        AttackReevaluate(NearestEnemyOf(Myself),15)
END


