IF
	OR(4)
		See([ANYONE])
		See([0.0.DEMONIC.0.0.0.LAWFUL_EVIL])
		See([0.0.0.TANARI.0.0.LAWFUL_EVIL])
		See([0.0.0.0.0.SUMMONED_DEMON.LAWFUL_EVIL])
	OR(2)
		!Alignment(LastSeenBy(Myself),CHAOTIC_EVIL)
		!Race(LastSeenBy(Myself),DEMONIC)
	!Name("ICSALFIR",LastSeenBy(Myself))
	Range(LastSeenBy(Myself),20)
	!StateCheck(Myself,STATE_INVISIBLE)
THEN
	RESPONSE #100
		ReallyForceSpell(Myself,WIZARD_INVISIBILITY)
		RunAwayFrom(LastSeenBy(Myself),30)
END

IF
	See(NearestEnemyOf(Myself))
	!GlobalTimerNotExpired("Prep","LOCALS")
THEN
	RESPONSE #100
		SetGlobalTimer("Prep","LOCALS",1000)
		ReallyForceSpell(Myself,WIZARD_LUCK)
		ReallyForceSpell(Myself,WIZARD_SHIELD)
END

IF
	See(NearestEnemyOf(Myself))
	!DifficultyLT(NORMAL)
	HasBounceEffects(LastSeenBy(Myself))
	HaveSpell(WIZARD_SPELL_THRUST)
	RandomNum(2,1)
	!GlobalTimerNotExpired("Thrust","LOCALS")
	!StateCheck(Myself,STATE_INVISIBLE)
THEN
	RESPONSE #100
		SetGlobalTimer("Thrust","LOCALS",15)
		Spell(NearestEnemyOf(Myself),WIZARD_SPELL_THRUST)
END

IF
	OR(4)
		See([ANYONE])
		See([0.0.DEMONIC.0.0.0.LAWFUL_EVIL])
		See([0.0.0.TANARI.0.0.LAWFUL_EVIL])
		See([0.0.0.0.0.SUMMONED_DEMON.LAWFUL_EVIL])
	OR(2)
		!Alignment(LastSeenBy(Myself),CHAOTIC_EVIL)
		!Race(LastSeenBy(Myself),DEMONIC)
	!Name("ICSALFIR",LastSeenBy(Myself))
	!HasBounceEffects(LastSeenBy(Myself))
	!GlobalTimerNotExpired("Barrage","LOCALS")
	!StateCheck(Myself,STATE_INVISIBLE)
	RandomNum(2,1)
THEN
	RESPONSE #100
		SetGlobalTimer("Barrage","LOCALS",12)
		ForceSpell(LastSeenBy(Myself),WIZARD_MELF_ACID_ARROW)
	RESPONSE #100
		SetGlobalTimer("Barrage","LOCALS",12)
		ForceSpell(LastSeenBy(Myself),WIZARD_DEAFNESS)
	RESPONSE #100
		SetGlobalTimer("Barrage","LOCALS",12)
		ForceSpell(LastSeenBy(Myself),WIZARD_MAGIC_MISSILE)
	RESPONSE #100
		SetGlobalTimer("Barrage","LOCALS",12)
		ForceSpell(LastSeenBy(Myself),WIZARD_LARLOCH_MINOR_DRAIN)
	RESPONSE #100
		SetGlobalTimer("Barrage","LOCALS",12)
		ForceSpell(LastSeenBy(Myself),WIZARD_CHROMATIC_ORB)
	RESPONSE #100
		SetGlobalTimer("Barrage","LOCALS",12)
		ForceSpell(LastSeenBy(Myself),WIZARD_RAY_OF_ENFEEBLEMENT)
END

IF
	OR(4)
		See([ANYONE])
		See([0.0.DEMONIC.0.0.0.LAWFUL_EVIL])
		See([0.0.0.TANARI.0.0.LAWFUL_EVIL])
		See([0.0.0.0.0.SUMMONED_DEMON.LAWFUL_EVIL])
	OR(2)
		!Alignment(LastSeenBy(Myself),CHAOTIC_EVIL)
		!Race(LastSeenBy(Myself),DEMONIC)
	!Name("ICSALFIR",LastSeenBy(Myself))
	Range(LastSeenBy(Myself),10)
	StateCheck(Myself,STATE_INVISIBLE)
THEN
	RESPONSE #100
		AttackOneRound(LastSeenBy(Myself))
		RunAwayFrom(LastSeenBy(Myself),30)
	RESPONSE #100
		RunAwayFrom(LastSeenBy(Myself),30)
END

IF
	OR(4)
		See([ANYONE])
		See([0.0.DEMONIC.0.0.0.LAWFUL_EVIL])
		See([0.0.0.TANARI.0.0.LAWFUL_EVIL])
		See([0.0.0.0.0.SUMMONED_DEMON.LAWFUL_EVIL])
	OR(2)
		!Alignment(LastSeenBy(Myself),CHAOTIC_EVIL)
		!Race(LastSeenBy(Myself),DEMONIC)
	!Name("ICSALFIR",LastSeenBy(Myself))
	!Range(LastSeenBy(Myself),10)
	StateCheck(Myself,STATE_INVISIBLE)
THEN
	RESPONSE #100
		AttackOneRound(LastSeenBy(Myself))
		RunAwayFrom(LastSeenBy(Myself),30)
	RESPONSE #50
		RunAwayFrom(LastSeenBy(Myself),30)
END

IF
	True()
THEN
	RESPONSE #100
		RunAwayFrom(NearestEnemyOf(Myself),15)
END
