IF
	See(NearestEnemyOf(Myself))
	Global("Prep","LOCALS",0)
THEN
	RESPONSE #100
		ApplySpell(Myself,WIZARD_STONE_SKIN)
		ApplySpell(Myself,WIZARD_GLOBE_OF_INVULNERABILITY)
		ReallyForceSpell(NearestEnemyOf(Myself),WIZARD_CHAIN_LIGHTNING)
		SetGlobal("Prep","LOCALS",1)
END

IF
	Detect([PC])
	!See(LastSeenBy(Myself))
THEN
	RESPONSE #100
		ForceSpell(Myself,WIZARD_TRUE_SIGHT)
END

IF
	!HasBounceEffects(Myself)
	!HasImmunityEffects(Myself)
	HaveSpell(WIZARD_SPELL_TURNING)
THEN
	RESPONSE #100
		Spell(Myself,WIZARD_SPELL_TURNING)
END

IF
	See(NearestEnemyOf(Myself))
	CheckStatLT(Myself,1,STONESKINS)
	TookDamage()
	Global("Prep2","LOCALS",0)
	HaveSpell(WIZARD_STONE_SKIN)
THEN
	RESPONSE #100
		ReallyForceSpell(Myself,WIZARD_STONE_SKIN)
		SetGlobal("Prep2","LOCALS",1)
END

IF
	See(NearestEnemyOf(Myself))
	CheckStatLT(Myself,1,STONESKINS)
	HitBy([ANYONE],CRUSHING)
	Global("Prep2","LOCALS",1)
THEN
	RESPONSE #100
		ApplySpell(Myself,WIZARD_PROTECTION_FROM_MAGIC_WEAPONS)
		SetGlobal("Prep2","LOCALS",2)
END

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

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

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(WIZARD_DISINTEGRATE)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),WIZARD_DISINTEGRATE)
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_CHAOS)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),WIZARD_CHAOS)
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_FLAME_ARROW)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),WIZARD_FLAME_ARROW)
END

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

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

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

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

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

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


