IF
	!GlobalTimerNotExpired("CAST","LOCALS")
    HasItem("WAND06",Myself) // Wand of Frost
    See(NearestEnemyOf(Myself))
	OR(10)
		HasItemEquiped("clck26",LastSeenBy(Myself))
        CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_DEFLECTION)
        CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_TURNING)
        CheckStatGT(LastSeenBy(Myself),0,CLERIC_SHIELD_OF_THE_ARCHONS)
        CheckStatGT(LastSeenBy(Myself),0,MINORGLOBE)
        CheckStatGT(LastSeenBy(Myself),0,SHIELDGLOBE)
        CheckStatGT(LastSeenBy(Myself),75,RESISTCOLD)
        CheckStatGT(LastSeenBy(Myself),75,RESISTMAGIC)
        StateCheck(LastSeenBy(Myself),STATE_IMPROVEDINVISIBILITY)
        CheckStatGT(LastSeenBy(Myself),0,SANCTUARY)
	See(SecondNearestEnemyOf(Myself))
	OR(10)
		HasItemEquiped("clck26",LastSeenBy(Myself))
        CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_DEFLECTION)
        CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_TURNING)
        CheckStatGT(LastSeenBy(Myself),0,CLERIC_SHIELD_OF_THE_ARCHONS)
        CheckStatGT(LastSeenBy(Myself),0,MINORGLOBE)
        CheckStatGT(LastSeenBy(Myself),0,SHIELDGLOBE)
        CheckStatGT(LastSeenBy(Myself),75,RESISTCOLD)
        CheckStatGT(LastSeenBy(Myself),75,RESISTMAGIC)
        StateCheck(LastSeenBy(Myself),STATE_IMPROVEDINVISIBILITY)
        CheckStatGT(LastSeenBy(Myself),0,SANCTUARY)
	See(ThirdNearestEnemyOf(Myself))
	OR(10)
		HasItemEquiped("clck26",LastSeenBy(Myself))
        CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_DEFLECTION)
        CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_TURNING)
        CheckStatGT(LastSeenBy(Myself),0,CLERIC_SHIELD_OF_THE_ARCHONS)
        CheckStatGT(LastSeenBy(Myself),0,MINORGLOBE)
        CheckStatGT(LastSeenBy(Myself),0,SHIELDGLOBE)
        CheckStatGT(LastSeenBy(Myself),75,RESISTCOLD)
        CheckStatGT(LastSeenBy(Myself),75,RESISTMAGIC)
        StateCheck(LastSeenBy(Myself),STATE_IMPROVEDINVISIBILITY)
        CheckStatGT(LastSeenBy(Myself),0,SANCTUARY)
	See(FourthNearestEnemyOf(Myself))
	OR(10)
		HasItemEquiped("clck26",LastSeenBy(Myself))
        CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_DEFLECTION)
        CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_TURNING)
        CheckStatGT(LastSeenBy(Myself),0,CLERIC_SHIELD_OF_THE_ARCHONS)
        CheckStatGT(LastSeenBy(Myself),0,MINORGLOBE)
        CheckStatGT(LastSeenBy(Myself),0,SHIELDGLOBE)
        CheckStatGT(LastSeenBy(Myself),75,RESISTCOLD)
        CheckStatGT(LastSeenBy(Myself),75,RESISTMAGIC)
        StateCheck(LastSeenBy(Myself),STATE_IMPROVEDINVISIBILITY)
        CheckStatGT(LastSeenBy(Myself),0,SANCTUARY)
	See(FifthNearestEnemyOf(Myself))
	OR(10)
		HasItemEquiped("clck26",LastSeenBy(Myself))
        CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_DEFLECTION)
        CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_TURNING)
        CheckStatGT(LastSeenBy(Myself),0,CLERIC_SHIELD_OF_THE_ARCHONS)
        CheckStatGT(LastSeenBy(Myself),0,MINORGLOBE)
        CheckStatGT(LastSeenBy(Myself),0,SHIELDGLOBE)
        CheckStatGT(LastSeenBy(Myself),75,RESISTCOLD)
        CheckStatGT(LastSeenBy(Myself),75,RESISTMAGIC)
        StateCheck(LastSeenBy(Myself),STATE_IMPROVEDINVISIBILITY)
        CheckStatGT(LastSeenBy(Myself),0,SANCTUARY)
	See(SixthNearestEnemyOf(Myself))
	OR(10)
		HasItemEquiped("clck26",LastSeenBy(Myself))
        CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_DEFLECTION)
        CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_TURNING)
        CheckStatGT(LastSeenBy(Myself),0,CLERIC_SHIELD_OF_THE_ARCHONS)
        CheckStatGT(LastSeenBy(Myself),0,MINORGLOBE)
        CheckStatGT(LastSeenBy(Myself),0,SHIELDGLOBE)
        CheckStatGT(LastSeenBy(Myself),75,RESISTCOLD)
        CheckStatGT(LastSeenBy(Myself),75,RESISTMAGIC)
        StateCheck(LastSeenBy(Myself),STATE_IMPROVEDINVISIBILITY)
        CheckStatGT(LastSeenBy(Myself),0,SANCTUARY)
	See(SeventhNearestEnemyOf(Myself))
	OR(10)
		HasItemEquiped("clck26",LastSeenBy(Myself))
        CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_DEFLECTION)
        CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_TURNING)
        CheckStatGT(LastSeenBy(Myself),0,CLERIC_SHIELD_OF_THE_ARCHONS)
        CheckStatGT(LastSeenBy(Myself),0,MINORGLOBE)
        CheckStatGT(LastSeenBy(Myself),0,SHIELDGLOBE)
        CheckStatGT(LastSeenBy(Myself),75,RESISTCOLD)
        CheckStatGT(LastSeenBy(Myself),75,RESISTMAGIC)
        StateCheck(LastSeenBy(Myself),STATE_IMPROVEDINVISIBILITY)
        CheckStatGT(LastSeenBy(Myself),0,SANCTUARY)
	See(EighthNearestEnemyOf(Myself))
	OR(10)
		HasItemEquiped("clck26",LastSeenBy(Myself))
        CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_DEFLECTION)
        CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_TURNING)
        CheckStatGT(LastSeenBy(Myself),0,CLERIC_SHIELD_OF_THE_ARCHONS)
        CheckStatGT(LastSeenBy(Myself),0,MINORGLOBE)
        CheckStatGT(LastSeenBy(Myself),0,SHIELDGLOBE)
        CheckStatGT(LastSeenBy(Myself),75,RESISTCOLD)
        CheckStatGT(LastSeenBy(Myself),75,RESISTMAGIC)
        StateCheck(LastSeenBy(Myself),STATE_IMPROVEDINVISIBILITY)
        CheckStatGT(LastSeenBy(Myself),0,SANCTUARY)
	See(NinthNearestEnemyOf(Myself))
	OR(10)
		HasItemEquiped("clck26",LastSeenBy(Myself))
        CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_DEFLECTION)
        CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_TURNING)
        CheckStatGT(LastSeenBy(Myself),0,CLERIC_SHIELD_OF_THE_ARCHONS)
        CheckStatGT(LastSeenBy(Myself),0,MINORGLOBE)
        CheckStatGT(LastSeenBy(Myself),0,SHIELDGLOBE)
        CheckStatGT(LastSeenBy(Myself),75,RESISTCOLD)
        CheckStatGT(LastSeenBy(Myself),75,RESISTMAGIC)
        StateCheck(LastSeenBy(Myself),STATE_IMPROVEDINVISIBILITY)
        CheckStatGT(LastSeenBy(Myself),0,SANCTUARY)
	See(TenthNearestEnemyOf(Myself))
	OR(10)
		HasItemEquiped("clck26",LastSeenBy(Myself))
        CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_DEFLECTION)
        CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_TURNING)
        CheckStatGT(LastSeenBy(Myself),0,CLERIC_SHIELD_OF_THE_ARCHONS)
        CheckStatGT(LastSeenBy(Myself),0,MINORGLOBE)
        CheckStatGT(LastSeenBy(Myself),0,SHIELDGLOBE)
        CheckStatGT(LastSeenBy(Myself),75,RESISTCOLD)
        CheckStatGT(LastSeenBy(Myself),75,RESISTMAGIC)
        StateCheck(LastSeenBy(Myself),STATE_IMPROVEDINVISIBILITY)
        CheckStatGT(LastSeenBy(Myself),0,SANCTUARY)
	See(NearestEnemyOf(Myself))
	False()
THEN
	RESPONSE #100
		Continue()
END

IF
	!GlobalTimerNotExpired("CAST","LOCALS")
    HasItem("WAND06",Myself) // Wand of Frost
	See(LastSeenBy(Myself))
	!HasItemEquiped("clck26",LastSeenBy(Myself))
    !CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_DEFLECTION)
    !CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_TURNING)
    !CheckStatGT(LastSeenBy(Myself),0,CLERIC_SHIELD_OF_THE_ARCHONS)
    !CheckStatGT(LastSeenBy(Myself),0,MINORGLOBE)
    !CheckStatGT(LastSeenBy(Myself),0,SHIELDGLOBE)
    !CheckStatGT(LastSeenBy(Myself),75,RESISTCOLD)
    !CheckStatGT(LastSeenBy(Myself),75,RESISTMAGIC)
    !StateCheck(LastSeenBy(Myself),STATE_IMPROVEDINVISIBILITY)
    !CheckStatGT(LastSeenBy(Myself),0,SANCTUARY)
THEN
    RESPONSE #100
        SetGlobalTimer("CAST","LOCALS",6)
        DisplayStringHead(Myself,31971) // uses a wand
        DisplayStringHead(Myself,7269) // Wand of Frost
        UseItem("WAND06",LastSeenBy(Myself)) // Wand of Frost
END
