IF
	NumberOfTimesTalkedTo(0)
	See([PC])
THEN
	RESPONSE #100
		StartDialogueNoSet([PC])
END

IF
	StateCheck(Myself,STATE_PANIC)
THEN
	RESPONSE #100
		RandomWalkContinuous()
END

IF
	See(NearestEnemyOf(Myself))
	!StateCheck(Myself,STATE_MIRRORIMAGE)
	HaveSpell(WIZARD_MIRROR_IMAGE)  // SPWI212.SPL (Mirror Image)
THEN
	RESPONSE #100
		Spell(Myself,WIZARD_MIRROR_IMAGE)  // SPWI212.SPL (Mirror Image)
END

IF
	See(NearestEnemyOf(Myself))
	HitBy([ANYONE],MISSILE)
	HaveSpell(WIZARD_PROTECTION_FROM_NORMAL_MISSILES)  // SPWI311.SPL (Protection From Normal Missiles)
THEN
	RESPONSE #100
		Spell(Myself,WIZARD_PROTECTION_FROM_NORMAL_MISSILES)  // SPWI311.SPL (Protection From Normal Missiles)
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(WIZARD_MINOR_GLOBE_OF_INVULNERABILITY)  // SPWI406.SPL (Minor Globe of Invulnerability)
THEN
	RESPONSE #100
		Spell(Myself,WIZARD_MINOR_GLOBE_OF_INVULNERABILITY)  // SPWI406.SPL (Minor Globe of Invulnerability)
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(WIZARD_GREASE)  // SPWI101.SPL (Grease)
	!Range(LastSeenBy(Myself),20)
	!CheckStatGT(LastSeenBy(Myself),0,GREASE)
THEN
	RESPONSE #100
		Spell(LastSeenBy(Myself),WIZARD_GREASE)  // SPWI101.SPL (Grease)
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(WIZARD_GREASE)  // SPWI101.SPL (Grease)
THEN
	RESPONSE #100
		SpellPoint([2317.2095],WIZARD_GREASE)  // SPWI101.SPL (Grease)
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(WIZARD_DIRE_CHARM)  // SPWI316.SPL (Dire Charm)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),WIZARD_DIRE_CHARM)  // SPWI316.SPL (Dire Charm)
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(WIZARD_HORROR)  // SPWI205.SPL (Horror)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),WIZARD_HORROR)  // SPWI205.SPL (Horror)
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(WIZARD_STINKING_CLOUD)  // SPWI213.SPL (Stinking Cloud)
	!Range(NearestEnemyOf(Myself),12)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),WIZARD_STINKING_CLOUD)  // SPWI213.SPL (Stinking Cloud)
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(WIZARD_MAGIC_MISSILE)  // SPWI112.SPL (Magic Missile)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),WIZARD_MAGIC_MISSILE)  // SPWI112.SPL (Magic Missile)
END

IF
	Heard([ANYONE],111)
THEN
	RESPONSE #100
		MoveToObject(NearestEnemyOf(Myself))
END

IF
	AttackedBy([GOODCUTOFF],DEFAULT)
	!Allegiance(Myself,ENEMY)
THEN
	RESPONSE #100
		Enemy()
END

IF
	See(NearestEnemyOf(Myself))
	InWeaponRange(LastSeenBy(Myself))
THEN
	RESPONSE #100
		AttackReevaluate(NearestEnemyOf(Myself),30)
END

