IF
	!GlobalTimerNotExpired("Cast","LOCALS")
	See(NearestEnemyOf(Myself))
	!StateCheck(LastSeenBy(Myself),STATE_REALLY_DEAD)
	HasItem("wand10",Myself) // Wand of Monster Summoning
THEN
	RESPONSE #100
		SetGlobalTimer("Cast","LOCALS",6)
		DisplayStringHead(Myself,31971) // uses a wand
		UseItem("wand10",Myself) // Wand of Monster Summoning
		Continue()
END

IF
	!GlobalTimerNotExpired("Cast","LOCALS")
	Allegiance(Myself,ENEMY)
	HasItem("wand02",Myself) // Wand of Fear
	OR(6)
		!See(NearestEnemyOf(Myself))
		StateCheck(NearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(NearestEnemyOf(Myself),STATE_PANIC)
		HasBounceEffects(NearestEnemyOf(Myself))
		!Allegiance(NearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,4)
	OR(6)
		!See(SecondNearestEnemyOf(Myself))
		StateCheck(SecondNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(SecondNearestEnemyOf(Myself),STATE_PANIC)
		HasBounceEffects(SecondNearestEnemyOf(Myself))
		!Allegiance(SecondNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,5)
	OR(6)
		!See(ThirdNearestEnemyOf(Myself))
		StateCheck(ThirdNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(ThirdNearestEnemyOf(Myself),STATE_PANIC)
		HasBounceEffects(ThirdNearestEnemyOf(Myself))
		!Allegiance(ThirdNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,6)
	OR(6)
		!See(FourthNearestEnemyOf(Myself))
		StateCheck(FourthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(FourthNearestEnemyOf(Myself),STATE_PANIC)
		HasBounceEffects(FourthNearestEnemyOf(Myself))
		!Allegiance(FourthNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,7)
	OR(6)
		!See(FifthNearestEnemyOf(Myself))
		StateCheck(FifthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(FifthNearestEnemyOf(Myself),STATE_PANIC)
		HasBounceEffects(FifthNearestEnemyOf(Myself))
		!Allegiance(FifthNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,8)
	OR(6)
		!See(SixthNearestEnemyOf(Myself))
		StateCheck(SixthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(SixthNearestEnemyOf(Myself),STATE_PANIC)
		HasBounceEffects(SixthNearestEnemyOf(Myself))
		!Allegiance(SixthNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,9)
	OR(5)
		!See(SeventhNearestEnemyOf(Myself))
		StateCheck(SeventhNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(SeventhNearestEnemyOf(Myself),STATE_PANIC)
		HasBounceEffects(SeventhNearestEnemyOf(Myself))
		!Allegiance(SeventhNearestEnemyOf(Myself),GOODCUTOFF)
	OR(5)
		!See(EighthNearestEnemyOf(Myself))
		StateCheck(EighthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(EighthNearestEnemyOf(Myself),STATE_PANIC)
		HasBounceEffects(EighthNearestEnemyOf(Myself))
		!Allegiance(EighthNearestEnemyOf(Myself),GOODCUTOFF)
	OR(5)
		!See(NinthNearestEnemyOf(Myself))
		StateCheck(NinthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(NinthNearestEnemyOf(Myself),STATE_PANIC)
		HasBounceEffects(NinthNearestEnemyOf(Myself))
		!Allegiance(NinthNearestEnemyOf(Myself),GOODCUTOFF)
	OR(5)
		!See(TenthNearestEnemyOf(Myself))
		StateCheck(TenthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(TenthNearestEnemyOf(Myself),STATE_PANIC)
		HasBounceEffects(TenthNearestEnemyOf(Myself))
		!Allegiance(TenthNearestEnemyOf(Myself),GOODCUTOFF)
	False()
THEN
	RESPONSE #100
		Continue()
END

IF
	!GlobalTimerNotExpired("Cast","LOCALS")
	Allegiance(Myself,ENEMY)
	HasItem("wand02",Myself) // Wand of Fear
	See(LastSeenBy(Myself))
	!StateCheck(LastSeenBy(Myself),STATE_REALLY_DEAD)
	!StateCheck(LastSeenBy(Myself),STATE_PANIC)
	!HasBounceEffects(LastSeenBy(Myself))
	Allegiance(LastSeenBy(Myself),GOODCUTOFF)
THEN
	RESPONSE #100
		SetGlobalTimer("Cast","LOCALS",6)
		DisplayStringHead(Myself,31971) // uses a wand
		UseItem("wand02",LastSeenBy(Myself)) // Wand of Fear
		Continue()
END

IF
	!GlobalTimerNotExpired("Cast","LOCALS")
	Allegiance(Myself,ENEMY)
	HasItem("wand04",Myself) // Wand of Paralyzation
	OR(6)
		!See(NearestEnemyOf(Myself))
		StateCheck(NearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(NearestEnemyOf(Myself),STATE_STUNNED)
		HasBounceEffects(NearestEnemyOf(Myself))
		!Allegiance(NearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,4)
	OR(6)
		!See(SecondNearestEnemyOf(Myself))
		StateCheck(SecondNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(SecondNearestEnemyOf(Myself),STATE_STUNNED)
		HasBounceEffects(SecondNearestEnemyOf(Myself))
		!Allegiance(SecondNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,5)
	OR(6)
		!See(ThirdNearestEnemyOf(Myself))
		StateCheck(ThirdNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(ThirdNearestEnemyOf(Myself),STATE_STUNNED)
		HasBounceEffects(ThirdNearestEnemyOf(Myself))
		!Allegiance(ThirdNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,6)
	OR(6)
		!See(FourthNearestEnemyOf(Myself))
		StateCheck(FourthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(FourthNearestEnemyOf(Myself),STATE_STUNNED)
		HasBounceEffects(FourthNearestEnemyOf(Myself))
		!Allegiance(FourthNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,7)
	OR(6)
		!See(FifthNearestEnemyOf(Myself))
		StateCheck(FifthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(FifthNearestEnemyOf(Myself),STATE_STUNNED)
		HasBounceEffects(FifthNearestEnemyOf(Myself))
		!Allegiance(FifthNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,8)
	OR(6)
		!See(SixthNearestEnemyOf(Myself))
		StateCheck(SixthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(SixthNearestEnemyOf(Myself),STATE_STUNNED)
		HasBounceEffects(SixthNearestEnemyOf(Myself))
		!Allegiance(SixthNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,9)
	OR(5)
		!See(SeventhNearestEnemyOf(Myself))
		StateCheck(SeventhNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(SeventhNearestEnemyOf(Myself),STATE_STUNNED)
		HasBounceEffects(SeventhNearestEnemyOf(Myself))
		!Allegiance(SeventhNearestEnemyOf(Myself),GOODCUTOFF)
	OR(5)
		!See(EighthNearestEnemyOf(Myself))
		StateCheck(EighthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(EighthNearestEnemyOf(Myself),STATE_STUNNED)
		HasBounceEffects(EighthNearestEnemyOf(Myself))
		!Allegiance(EighthNearestEnemyOf(Myself),GOODCUTOFF)
	OR(5)
		!See(NinthNearestEnemyOf(Myself))
		StateCheck(NinthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(NinthNearestEnemyOf(Myself),STATE_STUNNED)
		HasBounceEffects(NinthNearestEnemyOf(Myself))
		!Allegiance(NinthNearestEnemyOf(Myself),GOODCUTOFF)
	OR(5)
		!See(TenthNearestEnemyOf(Myself))
		StateCheck(TenthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(TenthNearestEnemyOf(Myself),STATE_STUNNED)
		HasBounceEffects(TenthNearestEnemyOf(Myself))
		!Allegiance(TenthNearestEnemyOf(Myself),GOODCUTOFF)
	False()
THEN
	RESPONSE #100
		Continue()
END

IF
	!GlobalTimerNotExpired("Cast","LOCALS")
	Allegiance(Myself,ENEMY)
	HasItem("wand04",Myself) // Wand of Paralyzation
	See(LastSeenBy(Myself))
	!StateCheck(LastSeenBy(Myself),STATE_REALLY_DEAD)
	!StateCheck(LastSeenBy(Myself),STATE_STUNNED)
	!HasBounceEffects(LastSeenBy(Myself))
	Allegiance(LastSeenBy(Myself),GOODCUTOFF)
THEN
	RESPONSE #100
		SetGlobalTimer("Cast","LOCALS",6)
		DisplayStringHead(Myself,31971) // uses a wand
		UseItem("wand04",LastSeenBy(Myself)) // Wand of Paralyzation
		Continue()
END

IF
	!GlobalTimerNotExpired("Cast","LOCALS")
	Allegiance(Myself,ENEMY)
	OR(4)
		HasItem("wand05",Myself)
		HasItem("wand06",Myself)
		HasItem("wand07",Myself)
		HasItem("wand09",Myself)
	OR(5)
		!See(NearestEnemyOf(Myself))
		StateCheck(NearestEnemyOf(Myself),STATE_REALLY_DEAD)
		HasBounceEffects(NearestEnemyOf(Myself))
		!Allegiance(NearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,4)
	OR(5)
		!See(SecondNearestEnemyOf(Myself))
		StateCheck(SecondNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		HasBounceEffects(SecondNearestEnemyOf(Myself))
		!Allegiance(SecondNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,5)
	OR(5)
		!See(ThirdNearestEnemyOf(Myself))
		StateCheck(ThirdNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		HasBounceEffects(ThirdNearestEnemyOf(Myself))
		!Allegiance(ThirdNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,6)
	OR(5)
		!See(FourthNearestEnemyOf(Myself))
		StateCheck(FourthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		HasBounceEffects(FourthNearestEnemyOf(Myself))
		!Allegiance(FourthNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,7)
	OR(5)
		!See(FifthNearestEnemyOf(Myself))
		StateCheck(FifthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		HasBounceEffects(FifthNearestEnemyOf(Myself))
		!Allegiance(FifthNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,8)
	OR(5)
		!See(SixthNearestEnemyOf(Myself))
		StateCheck(SixthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		HasBounceEffects(SixthNearestEnemyOf(Myself))
		!Allegiance(SixthNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,9)
	OR(4)
		!See(SeventhNearestEnemyOf(Myself))
		StateCheck(SeventhNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		HasBounceEffects(SeventhNearestEnemyOf(Myself))
		!Allegiance(SeventhNearestEnemyOf(Myself),GOODCUTOFF)
	OR(4)
		!See(EighthNearestEnemyOf(Myself))
		StateCheck(EighthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		HasBounceEffects(EighthNearestEnemyOf(Myself))
		!Allegiance(EighthNearestEnemyOf(Myself),GOODCUTOFF)
	OR(4)
		!See(NinthNearestEnemyOf(Myself))
		StateCheck(NinthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		HasBounceEffects(NinthNearestEnemyOf(Myself))
		!Allegiance(NinthNearestEnemyOf(Myself),GOODCUTOFF)
	OR(4)
		!See(TenthNearestEnemyOf(Myself))
		StateCheck(TenthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		HasBounceEffects(TenthNearestEnemyOf(Myself))
		!Allegiance(TenthNearestEnemyOf(Myself),GOODCUTOFF)
	False()
THEN
	RESPONSE #100
		Continue()
END

IF
	!GlobalTimerNotExpired("Cast","LOCALS")
	Allegiance(Myself,ENEMY)
	HasItem("wand05",Myself)
	See(LastSeenBy(Myself))
	!StateCheck(LastSeenBy(Myself),STATE_REALLY_DEAD)
	!HasBounceEffects(LastSeenBy(Myself))
	Allegiance(LastSeenBy(Myself),GOODCUTOFF)
THEN
	RESPONSE #100
		SetGlobalTimer("Cast","LOCALS",6)
		DisplayStringHead(Myself,31971) // uses a wand
		UseItem("wand05",LastSeenBy(Myself))
		Continue()
END

IF
	!GlobalTimerNotExpired("Cast","LOCALS")
	Allegiance(Myself,ENEMY)
	HasItem("wand06",Myself)
	See(LastSeenBy(Myself))
	!StateCheck(LastSeenBy(Myself),STATE_REALLY_DEAD)
	!HasBounceEffects(LastSeenBy(Myself))
	Allegiance(LastSeenBy(Myself),GOODCUTOFF)
THEN
	RESPONSE #100
		SetGlobalTimer("Cast","LOCALS",6)
		DisplayStringHead(Myself,31971) // uses a wand
		UseItem("wand06",LastSeenBy(Myself))
		Continue()
END

IF
	!GlobalTimerNotExpired("Cast","LOCALS")
	Allegiance(Myself,ENEMY)
	HasItem("wand07",Myself)
	See(LastSeenBy(Myself))
	!StateCheck(LastSeenBy(Myself),STATE_REALLY_DEAD)
	!HasBounceEffects(LastSeenBy(Myself))
	Allegiance(LastSeenBy(Myself),GOODCUTOFF)
THEN
	RESPONSE #100
		SetGlobalTimer("Cast","LOCALS",6)
		DisplayStringHead(Myself,31971) // uses a wand
		UseItem("wand07",LastSeenBy(Myself))
		Continue()
END

IF
	!GlobalTimerNotExpired("Cast","LOCALS")
	Allegiance(Myself,ENEMY)
	HasItem("wand09",Myself)
	See(LastSeenBy(Myself))
	!StateCheck(LastSeenBy(Myself),STATE_REALLY_DEAD)
	!HasBounceEffects(LastSeenBy(Myself))
	Allegiance(LastSeenBy(Myself),GOODCUTOFF)
THEN
	RESPONSE #100
		SetGlobalTimer("Cast","LOCALS",6)
		DisplayStringHead(Myself,31971) // uses a wand
		UseItem("wand09",LastSeenBy(Myself))
		Continue()
END

IF
	!GlobalTimerNotExpired("Cast","LOCALS")
	Allegiance(Myself,ENEMY)
	HasItem("wand08",Myself) // Wand of Sleep
	OR(6)
		!See(NearestEnemyOf(Myself))
		StateCheck(NearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(NearestEnemyOf(Myself),STATE_SLEEPING)
		HasBounceEffects(NearestEnemyOf(Myself))
		!Allegiance(NearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,4)
	OR(6)
		!See(SecondNearestEnemyOf(Myself))
		StateCheck(SecondNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(SecondNearestEnemyOf(Myself),STATE_SLEEPING)
		HasBounceEffects(SecondNearestEnemyOf(Myself))
		!Allegiance(SecondNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,5)
	OR(6)
		!See(ThirdNearestEnemyOf(Myself))
		StateCheck(ThirdNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(ThirdNearestEnemyOf(Myself),STATE_SLEEPING)
		HasBounceEffects(ThirdNearestEnemyOf(Myself))
		!Allegiance(ThirdNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,6)
	OR(6)
		!See(FourthNearestEnemyOf(Myself))
		StateCheck(FourthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(FourthNearestEnemyOf(Myself),STATE_SLEEPING)
		HasBounceEffects(FourthNearestEnemyOf(Myself))
		!Allegiance(FourthNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,7)
	OR(6)
		!See(FifthNearestEnemyOf(Myself))
		StateCheck(FifthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(FifthNearestEnemyOf(Myself),STATE_SLEEPING)
		HasBounceEffects(FifthNearestEnemyOf(Myself))
		!Allegiance(FifthNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,8)
	OR(6)
		!See(SixthNearestEnemyOf(Myself))
		StateCheck(SixthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(SixthNearestEnemyOf(Myself),STATE_SLEEPING)
		HasBounceEffects(SixthNearestEnemyOf(Myself))
		!Allegiance(SixthNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,9)
	OR(5)
		!See(SeventhNearestEnemyOf(Myself))
		StateCheck(SeventhNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(SeventhNearestEnemyOf(Myself),STATE_SLEEPING)
		HasBounceEffects(SeventhNearestEnemyOf(Myself))
		!Allegiance(SeventhNearestEnemyOf(Myself),GOODCUTOFF)
	OR(5)
		!See(EighthNearestEnemyOf(Myself))
		StateCheck(EighthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(EighthNearestEnemyOf(Myself),STATE_SLEEPING)
		HasBounceEffects(EighthNearestEnemyOf(Myself))
		!Allegiance(EighthNearestEnemyOf(Myself),GOODCUTOFF)
	OR(5)
		!See(NinthNearestEnemyOf(Myself))
		StateCheck(NinthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(NinthNearestEnemyOf(Myself),STATE_SLEEPING)
		HasBounceEffects(NinthNearestEnemyOf(Myself))
		!Allegiance(NinthNearestEnemyOf(Myself),GOODCUTOFF)
	OR(5)
		!See(TenthNearestEnemyOf(Myself))
		StateCheck(TenthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		StateCheck(TenthNearestEnemyOf(Myself),STATE_SLEEPING)
		HasBounceEffects(TenthNearestEnemyOf(Myself))
		!Allegiance(TenthNearestEnemyOf(Myself),GOODCUTOFF)
	False()
THEN
	RESPONSE #100
		Continue()
END

IF
	!GlobalTimerNotExpired("Cast","LOCALS")
	Allegiance(Myself,ENEMY)
	HasItem("wand08",Myself) // Wand of Sleep
	See(LastSeenBy(Myself))
	!StateCheck(LastSeenBy(Myself),STATE_REALLY_DEAD)
	!StateCheck(LastSeenBy(Myself),STATE_SLEEPING)
	!HasBounceEffects(LastSeenBy(Myself))
	Allegiance(LastSeenBy(Myself),GOODCUTOFF)
THEN
	RESPONSE #100
		SetGlobalTimer("Cast","LOCALS",6)
		DisplayStringHead(Myself,31971) // uses a wand
		UseItem("wand08",LastSeenBy(Myself)) // Wand of Sleep
		Continue()
END

IF
	Class(Myself,CLERIC_ALL)
	!GlobalTimerNotExpired("Cast","LOCALS")
	Allegiance(Myself,ENEMY)
	HasItem("wand11",Myself) // Wand of the Heavens
	OR(7)
		!See(NearestEnemyOf(Myself))
		StateCheck(NearestEnemyOf(Myself),STATE_REALLY_DEAD)
		CheckStatGT(NearestEnemyOf(Myself),50,RESISTMAGICFIRE)
		HasImmunityEffects(NearestEnemyOf(Myself))
		HasBounceEffects(NearestEnemyOf(Myself))
		!Allegiance(NearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,4)
	OR(7)
		!See(SecondNearestEnemyOf(Myself))
		StateCheck(SecondNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		CheckStatGT(SecondNearestEnemyOf(Myself),50,RESISTMAGICFIRE)
		HasImmunityEffects(SecondNearestEnemyOf(Myself))
		HasBounceEffects(SecondNearestEnemyOf(Myself))
		!Allegiance(SecondNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,5)
	OR(7)
		!See(ThirdNearestEnemyOf(Myself))
		StateCheck(ThirdNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		CheckStatGT(ThirdNearestEnemyOf(Myself),50,RESISTMAGICFIRE)
		HasImmunityEffects(ThirdNearestEnemyOf(Myself))
		HasBounceEffects(ThirdNearestEnemyOf(Myself))
		!Allegiance(ThirdNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,6)
	OR(7)
		!See(FourthNearestEnemyOf(Myself))
		StateCheck(FourthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		CheckStatGT(FourthNearestEnemyOf(Myself),50,RESISTMAGICFIRE)
		HasImmunityEffects(FourthNearestEnemyOf(Myself))
		HasBounceEffects(FourthNearestEnemyOf(Myself))
		!Allegiance(FourthNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,7)
	OR(7)
		!See(FifthNearestEnemyOf(Myself))
		StateCheck(FifthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		CheckStatGT(FifthNearestEnemyOf(Myself),50,RESISTMAGICFIRE)
		HasImmunityEffects(FifthNearestEnemyOf(Myself))
		HasBounceEffects(FifthNearestEnemyOf(Myself))
		!Allegiance(FifthNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,8)
	OR(7)
		!See(SixthNearestEnemyOf(Myself))
		StateCheck(SixthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		CheckStatGT(SixthNearestEnemyOf(Myself),50,RESISTMAGICFIRE)
		HasImmunityEffects(SixthNearestEnemyOf(Myself))
		HasBounceEffects(SixthNearestEnemyOf(Myself))
		!Allegiance(SixthNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,9)
	OR(6)
		!See(SeventhNearestEnemyOf(Myself))
		StateCheck(SeventhNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		CheckStatGT(SeventhNearestEnemyOf(Myself),50,RESISTMAGICFIRE)
		HasImmunityEffects(SeventhNearestEnemyOf(Myself))
		HasBounceEffects(SeventhNearestEnemyOf(Myself))
		!Allegiance(SeventhNearestEnemyOf(Myself),GOODCUTOFF)
	OR(6)
		!See(EighthNearestEnemyOf(Myself))
		StateCheck(EighthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		CheckStatGT(EighthNearestEnemyOf(Myself),50,RESISTMAGICFIRE)
		HasImmunityEffects(EighthNearestEnemyOf(Myself))
		HasBounceEffects(EighthNearestEnemyOf(Myself))
		!Allegiance(EighthNearestEnemyOf(Myself),GOODCUTOFF)
	OR(6)
		!See(NinthNearestEnemyOf(Myself))
		StateCheck(NinthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		CheckStatGT(NinthNearestEnemyOf(Myself),50,RESISTMAGICFIRE)
		HasImmunityEffects(NinthNearestEnemyOf(Myself))
		HasBounceEffects(NinthNearestEnemyOf(Myself))
		!Allegiance(NinthNearestEnemyOf(Myself),GOODCUTOFF)
	OR(6)
		!See(TenthNearestEnemyOf(Myself))
		StateCheck(TenthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		CheckStatGT(TenthNearestEnemyOf(Myself),50,RESISTMAGICFIRE)
		HasImmunityEffects(TenthNearestEnemyOf(Myself))
		HasBounceEffects(TenthNearestEnemyOf(Myself))
		!Allegiance(TenthNearestEnemyOf(Myself),GOODCUTOFF)
	OR(4)
		!See(NearestEnemyOf(Myself))
		StateCheck(NearestEnemyOf(Myself),STATE_REALLY_DEAD)
		!Allegiance(NearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,4)
	OR(4)
		!See(SecondNearestEnemyOf(Myself))
		StateCheck(SecondNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		!Allegiance(SecondNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,5)
	OR(4)
		!See(ThirdNearestEnemyOf(Myself))
		StateCheck(ThirdNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		!Allegiance(ThirdNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,6)
	OR(4)
		!See(FourthNearestEnemyOf(Myself))
		StateCheck(FourthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		!Allegiance(FourthNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,7)
	OR(4)
		!See(FifthNearestEnemyOf(Myself))
		StateCheck(FifthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		!Allegiance(FifthNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,8)
	OR(4)
		!See(SixthNearestEnemyOf(Myself))
		StateCheck(SixthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		!Allegiance(SixthNearestEnemyOf(Myself),GOODCUTOFF)
		RandomNumGT(10,9)
	OR(3)
		!See(SeventhNearestEnemyOf(Myself))
		StateCheck(SeventhNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		!Allegiance(SeventhNearestEnemyOf(Myself),GOODCUTOFF)
	OR(3)
		!See(EighthNearestEnemyOf(Myself))
		StateCheck(EighthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		!Allegiance(EighthNearestEnemyOf(Myself),GOODCUTOFF)
	OR(3)
		!See(NinthNearestEnemyOf(Myself))
		StateCheck(NinthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		!Allegiance(NinthNearestEnemyOf(Myself),GOODCUTOFF)
	OR(3)
		!See(TenthNearestEnemyOf(Myself))
		StateCheck(TenthNearestEnemyOf(Myself),STATE_REALLY_DEAD)
		!Allegiance(TenthNearestEnemyOf(Myself),GOODCUTOFF)
	False()
THEN
	RESPONSE #100
		Continue()
END

IF
	Class(Myself,CLERIC_ALL)
	!GlobalTimerNotExpired("Cast","LOCALS")
	Allegiance(Myself,ENEMY)
	HasItem("wand11",Myself) // Wand of the Heavens
	See(LastSeenBy(Myself))
	Allegiance(LastSeenBy(Myself),GOODCUTOFF)
	!StateCheck(LastSeenBy(Myself),STATE_REALLY_DEAD)
THEN
	RESPONSE #100
		SetGlobalTimer("Cast","LOCALS",6)
		DisplayStringHead(Myself,31971) // uses a wand
		UseItem("wand11",LastSeenBy(Myself)) // Wand of the Heavens
		Continue()
END
