IF
    OR(2)
		!GlobalTimerNotExpired("CAST","LOCALS")
        CheckStatGT(Myself,0,WIZARD_IMPROVED_ALACRITY)
	HaveSpell(WIZARD_SUNFIRE)
	Range(NearestEnemyOf(Myself),15)
	OR(2)
		CheckStatLT(NearestEnemyOf(Myself),50,RESISTFIRE)
		Range(ThirdNearestEnemyOf(Myself),15)
THEN
    RESPONSE #100
        SetGlobalTimer("CAST","LOCALS",6)
        Spell(LastSeenBy(Myself),WIZARD_SUNFIRE)
END

IF
    OR(2)
		!GlobalTimerNotExpired("CAST","LOCALS")
        CheckStatGT(Myself,0,WIZARD_IMPROVED_ALACRITY)
	HaveSpell(WIZARD_CONE_OF_COLD)
	OR(7)
		!See(NearestEnemyOf(Myself))
		!Range(LastSeenBy(Myself),7)
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTCOLD)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(7)
		!See(SecondNearestEnemyOf(Myself))
		!Range(LastSeenBy(Myself),7)
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTCOLD)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(7)
		!See(ThirdNearestEnemyOf(Myself))
		!Range(LastSeenBy(Myself),7)
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTCOLD)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(7)
		!See(FourthNearestEnemyOf(Myself))
		!Range(LastSeenBy(Myself),7)
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTCOLD)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(7)
		!See(FifthNearestEnemyOf(Myself))
		!Range(LastSeenBy(Myself),7)
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTCOLD)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(7)
		!See(SixthNearestEnemyOf(Myself))
		!Range(LastSeenBy(Myself),7)
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTCOLD)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(7)
		!See(SeventhNearestEnemyOf(Myself))
		!Range(LastSeenBy(Myself),7)
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTCOLD)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(7)
		!See(EighthNearestEnemyOf(Myself))
		!Range(LastSeenBy(Myself),7)
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTCOLD)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(7)
		!See(NinthNearestEnemyOf(Myself))
		!Range(LastSeenBy(Myself),7)
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTCOLD)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(7)
		!See(TenthNearestEnemyOf(Myself))
		!Range(LastSeenBy(Myself),7)
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTCOLD)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	See(NearestEnemyOf(Myself))
	False()
THEN
	RESPONSE #100
		Continue()
END

IF
    OR(2)
		!GlobalTimerNotExpired("CAST","LOCALS")
        CheckStatGT(Myself,0,WIZARD_IMPROVED_ALACRITY)
	HaveSpell(WIZARD_CONE_OF_COLD)
	See(LastSeenBy(Myself))
	Range(LastSeenBy(Myself),7)
	!HasBounceEffects(LastSeenBy(Myself))
	!HasImmunityEffects(LastSeenBy(Myself))
	!CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
	!CheckStatGT(LastSeenBy(Myself),60,RESISTCOLD)
    !HasItemEquiped("clck26",LastSeenBy(Myself))
THEN
    RESPONSE #100
        SetGlobalTimer("CAST","LOCALS",6)
        Spell(LastSeenBy(Myself),WIZARD_CONE_OF_COLD)
    RESPONSE #10
        SetGlobalTimer("CAST","LOCALS",6)
        SpellNoDec(LastSeenBy(Myself),WIZARD_CONE_OF_COLD)
END

IF
    OR(2)
		!GlobalTimerNotExpired("CAST","LOCALS")
        CheckStatGT(Myself,0,WIZARD_IMPROVED_ALACRITY)
	HaveSpell(WIZARD_DOMINATION)
	OR(20)
		!See(NearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	    !CheckStatGT(LastSeenBy(Myself),10,SAVEVSSPELL)
	    StateCheck(LastSeenBy(Myself),STATE_BERSERK)
	    !CheckStat(LastSeenBy(Myself),0,SCRIPTINGSTATE3)
	    Class(LastSeenBy(Myself),MONK)
        Kit(LastSeenBy(Myself),INQUISITOR)
        HasItemEquiped("HELM06",LastSeenBy(Myself))
        HasItemEquiped("MISCBC",LastSeenBy(Myself))
        HasItemEquiped("NPCHAN",LastSeenBy(Myself))
        HasItemEquiped("REAVER",LastSeenBy(Myself))
        HasItemEquiped("SHLD25",LastSeenBy(Myself))
        HasItemEquipedReal("SPER07",LastSeenBy(Myself))
        HasItemEquipedReal("STAF11",LastSeenBy(Myself))
        HasItemEquipedReal("SW1H35",LastSeenBy(Myself))
        HasItemEquipedReal("SW1H54",LastSeenBy(Myself))
        HasItemEquipedReal("SW2H14",LastSeenBy(Myself))
	OR(20)
		!See(SecondNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	    !CheckStatGT(LastSeenBy(Myself),10,SAVEVSSPELL)
	    StateCheck(LastSeenBy(Myself),STATE_BERSERK)
	    !CheckStat(LastSeenBy(Myself),0,SCRIPTINGSTATE3)
	    Class(LastSeenBy(Myself),MONK)
        Kit(LastSeenBy(Myself),INQUISITOR)
        HasItemEquiped("HELM06",LastSeenBy(Myself))
        HasItemEquiped("MISCBC",LastSeenBy(Myself))
        HasItemEquiped("NPCHAN",LastSeenBy(Myself))
        HasItemEquiped("REAVER",LastSeenBy(Myself))
        HasItemEquiped("SHLD25",LastSeenBy(Myself))
        HasItemEquipedReal("SPER07",LastSeenBy(Myself))
        HasItemEquipedReal("STAF11",LastSeenBy(Myself))
        HasItemEquipedReal("SW1H35",LastSeenBy(Myself))
        HasItemEquipedReal("SW1H54",LastSeenBy(Myself))
        HasItemEquipedReal("SW2H14",LastSeenBy(Myself))
	OR(20)
		!See(ThirdNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	    !CheckStatGT(LastSeenBy(Myself),10,SAVEVSSPELL)
	    StateCheck(LastSeenBy(Myself),STATE_BERSERK)
	    !CheckStat(LastSeenBy(Myself),0,SCRIPTINGSTATE3)
	    Class(LastSeenBy(Myself),MONK)
        Kit(LastSeenBy(Myself),INQUISITOR)
        HasItemEquiped("HELM06",LastSeenBy(Myself))
        HasItemEquiped("MISCBC",LastSeenBy(Myself))
        HasItemEquiped("NPCHAN",LastSeenBy(Myself))
        HasItemEquiped("REAVER",LastSeenBy(Myself))
        HasItemEquiped("SHLD25",LastSeenBy(Myself))
        HasItemEquipedReal("SPER07",LastSeenBy(Myself))
        HasItemEquipedReal("STAF11",LastSeenBy(Myself))
        HasItemEquipedReal("SW1H35",LastSeenBy(Myself))
        HasItemEquipedReal("SW1H54",LastSeenBy(Myself))
        HasItemEquipedReal("SW2H14",LastSeenBy(Myself))
	OR(20)
		!See(FourthNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	    !CheckStatGT(LastSeenBy(Myself),10,SAVEVSSPELL)
	    StateCheck(LastSeenBy(Myself),STATE_BERSERK)
	    !CheckStat(LastSeenBy(Myself),0,SCRIPTINGSTATE3)
	    Class(LastSeenBy(Myself),MONK)
        Kit(LastSeenBy(Myself),INQUISITOR)
        HasItemEquiped("HELM06",LastSeenBy(Myself))
        HasItemEquiped("MISCBC",LastSeenBy(Myself))
        HasItemEquiped("NPCHAN",LastSeenBy(Myself))
        HasItemEquiped("REAVER",LastSeenBy(Myself))
        HasItemEquiped("SHLD25",LastSeenBy(Myself))
        HasItemEquipedReal("SPER07",LastSeenBy(Myself))
        HasItemEquipedReal("STAF11",LastSeenBy(Myself))
        HasItemEquipedReal("SW1H35",LastSeenBy(Myself))
        HasItemEquipedReal("SW1H54",LastSeenBy(Myself))
        HasItemEquipedReal("SW2H14",LastSeenBy(Myself))
	OR(20)
		!See(FifthNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	    !CheckStatGT(LastSeenBy(Myself),10,SAVEVSSPELL)
	    StateCheck(LastSeenBy(Myself),STATE_BERSERK)
	    !CheckStat(LastSeenBy(Myself),0,SCRIPTINGSTATE3)
	    Class(LastSeenBy(Myself),MONK)
        Kit(LastSeenBy(Myself),INQUISITOR)
        HasItemEquiped("HELM06",LastSeenBy(Myself))
        HasItemEquiped("MISCBC",LastSeenBy(Myself))
        HasItemEquiped("NPCHAN",LastSeenBy(Myself))
        HasItemEquiped("REAVER",LastSeenBy(Myself))
        HasItemEquiped("SHLD25",LastSeenBy(Myself))
        HasItemEquipedReal("SPER07",LastSeenBy(Myself))
        HasItemEquipedReal("STAF11",LastSeenBy(Myself))
        HasItemEquipedReal("SW1H35",LastSeenBy(Myself))
        HasItemEquipedReal("SW1H54",LastSeenBy(Myself))
        HasItemEquipedReal("SW2H14",LastSeenBy(Myself))
	OR(20)
		!See(SixthNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	    !CheckStatGT(LastSeenBy(Myself),10,SAVEVSSPELL)
	    StateCheck(LastSeenBy(Myself),STATE_BERSERK)
	    !CheckStat(LastSeenBy(Myself),0,SCRIPTINGSTATE3)
	    Class(LastSeenBy(Myself),MONK)
        Kit(LastSeenBy(Myself),INQUISITOR)
        HasItemEquiped("HELM06",LastSeenBy(Myself))
        HasItemEquiped("MISCBC",LastSeenBy(Myself))
        HasItemEquiped("NPCHAN",LastSeenBy(Myself))
        HasItemEquiped("REAVER",LastSeenBy(Myself))
        HasItemEquiped("SHLD25",LastSeenBy(Myself))
        HasItemEquipedReal("SPER07",LastSeenBy(Myself))
        HasItemEquipedReal("STAF11",LastSeenBy(Myself))
        HasItemEquipedReal("SW1H35",LastSeenBy(Myself))
        HasItemEquipedReal("SW1H54",LastSeenBy(Myself))
        HasItemEquipedReal("SW2H14",LastSeenBy(Myself))
	OR(20)
		!See(SeventhNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	    !CheckStatGT(LastSeenBy(Myself),10,SAVEVSSPELL)
	    StateCheck(LastSeenBy(Myself),STATE_BERSERK)
	    !CheckStat(LastSeenBy(Myself),0,SCRIPTINGSTATE3)
	    Class(LastSeenBy(Myself),MONK)
        Kit(LastSeenBy(Myself),INQUISITOR)
        HasItemEquiped("HELM06",LastSeenBy(Myself))
        HasItemEquiped("MISCBC",LastSeenBy(Myself))
        HasItemEquiped("NPCHAN",LastSeenBy(Myself))
        HasItemEquiped("REAVER",LastSeenBy(Myself))
        HasItemEquiped("SHLD25",LastSeenBy(Myself))
        HasItemEquipedReal("SPER07",LastSeenBy(Myself))
        HasItemEquipedReal("STAF11",LastSeenBy(Myself))
        HasItemEquipedReal("SW1H35",LastSeenBy(Myself))
        HasItemEquipedReal("SW1H54",LastSeenBy(Myself))
        HasItemEquipedReal("SW2H14",LastSeenBy(Myself))
	OR(20)
		!See(EighthNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	    !CheckStatGT(LastSeenBy(Myself),10,SAVEVSSPELL)
	    StateCheck(LastSeenBy(Myself),STATE_BERSERK)
	    !CheckStat(LastSeenBy(Myself),0,SCRIPTINGSTATE3)
	    Class(LastSeenBy(Myself),MONK)
        Kit(LastSeenBy(Myself),INQUISITOR)
        HasItemEquiped("HELM06",LastSeenBy(Myself))
        HasItemEquiped("MISCBC",LastSeenBy(Myself))
        HasItemEquiped("NPCHAN",LastSeenBy(Myself))
        HasItemEquiped("REAVER",LastSeenBy(Myself))
        HasItemEquiped("SHLD25",LastSeenBy(Myself))
        HasItemEquipedReal("SPER07",LastSeenBy(Myself))
        HasItemEquipedReal("STAF11",LastSeenBy(Myself))
        HasItemEquipedReal("SW1H35",LastSeenBy(Myself))
        HasItemEquipedReal("SW1H54",LastSeenBy(Myself))
        HasItemEquipedReal("SW2H14",LastSeenBy(Myself))
	OR(20)
		!See(NinthNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	    !CheckStatGT(LastSeenBy(Myself),10,SAVEVSSPELL)
	    StateCheck(LastSeenBy(Myself),STATE_BERSERK)
	    !CheckStat(LastSeenBy(Myself),0,SCRIPTINGSTATE3)
	    Class(LastSeenBy(Myself),MONK)
        Kit(LastSeenBy(Myself),INQUISITOR)
        HasItemEquiped("HELM06",LastSeenBy(Myself))
        HasItemEquiped("MISCBC",LastSeenBy(Myself))
        HasItemEquiped("NPCHAN",LastSeenBy(Myself))
        HasItemEquiped("REAVER",LastSeenBy(Myself))
        HasItemEquiped("SHLD25",LastSeenBy(Myself))
        HasItemEquipedReal("SPER07",LastSeenBy(Myself))
        HasItemEquipedReal("STAF11",LastSeenBy(Myself))
        HasItemEquipedReal("SW1H35",LastSeenBy(Myself))
        HasItemEquipedReal("SW1H54",LastSeenBy(Myself))
        HasItemEquipedReal("SW2H14",LastSeenBy(Myself))
	OR(20)
		!See(TenthNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	    !CheckStatGT(LastSeenBy(Myself),10,SAVEVSSPELL)
	    StateCheck(LastSeenBy(Myself),STATE_BERSERK)
	    !CheckStat(LastSeenBy(Myself),0,SCRIPTINGSTATE3)
	    Class(LastSeenBy(Myself),MONK)
        Kit(LastSeenBy(Myself),INQUISITOR)
        HasItemEquiped("HELM06",LastSeenBy(Myself))
        HasItemEquiped("MISCBC",LastSeenBy(Myself))
        HasItemEquiped("NPCHAN",LastSeenBy(Myself))
        HasItemEquiped("REAVER",LastSeenBy(Myself))
        HasItemEquiped("SHLD25",LastSeenBy(Myself))
        HasItemEquipedReal("SPER07",LastSeenBy(Myself))
        HasItemEquipedReal("STAF11",LastSeenBy(Myself))
        HasItemEquipedReal("SW1H35",LastSeenBy(Myself))
        HasItemEquipedReal("SW1H54",LastSeenBy(Myself))
        HasItemEquipedReal("SW2H14",LastSeenBy(Myself))
	See(NearestEnemyOf(Myself))
	False()
THEN
	RESPONSE #100
		Continue()
END

IF
    OR(2)
		!GlobalTimerNotExpired("CAST","LOCALS")
        CheckStatGT(Myself,0,WIZARD_IMPROVED_ALACRITY)
	HaveSpell(WIZARD_DOMINATION)
	See(LastSeenBy(Myself))
	!HasBounceEffects(LastSeenBy(Myself))
	!HasImmunityEffects(LastSeenBy(Myself))
	!CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
	!HasItemEquiped("clck26",LastSeenBy(Myself))
	CheckStatGT(LastSeenBy(Myself),10,SAVEVSSPELL)
	!StateCheck(LastSeenBy(Myself),STATE_BERSERK)
	CheckStat(LastSeenBy(Myself),0,SCRIPTINGSTATE3)
	!Class(LastSeenBy(Myself),MONK)
    !Kit(LastSeenBy(Myself),INQUISITOR)
    !HasItemEquiped("HELM06",LastSeenBy(Myself))
    !HasItemEquiped("MISCBC",LastSeenBy(Myself))
    !HasItemEquiped("NPCHAN",LastSeenBy(Myself))
    !HasItemEquiped("REAVER",LastSeenBy(Myself))
    !HasItemEquiped("SHLD25",LastSeenBy(Myself))
    !HasItemEquipedReal("SPER07",LastSeenBy(Myself))
    !HasItemEquipedReal("STAF11",LastSeenBy(Myself))
    !HasItemEquipedReal("SW1H35",LastSeenBy(Myself))
    !HasItemEquipedReal("SW1H54",LastSeenBy(Myself))
    !HasItemEquipedReal("SW2H14",LastSeenBy(Myself))
THEN
	RESPONSE #100
		SetGlobalTimer("CAST","LOCALS",6)
		Spell(LastSeenBy(Myself),WIZARD_DOMINATION)
END

IF
    OR(2)
		!GlobalTimerNotExpired("CAST","LOCALS")
        CheckStatGT(Myself,0,WIZARD_IMPROVED_ALACRITY)
	OR(2)
		HaveSpell(WIZARD_FLAME_ARROW)
		HaveSpell(WIZARD_AGANAZZAR_SCORCHER)
	OR(6)
		!See(NearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTFIRE)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(6)
		!See(SecondNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTFIRE)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(6)
		!See(ThirdNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTFIRE)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(6)
		!See(FourthNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTFIRE)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(6)
		!See(FifthNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTFIRE)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(6)
		!See(SixthNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTFIRE)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(6)
		!See(SeventhNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTFIRE)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(6)
		!See(EighthNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTFIRE)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(6)
		!See(NinthNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTFIRE)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(6)
		!See(TenthNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTFIRE)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	See(NearestEnemyOf(Myself))
	False()
THEN
	RESPONSE #100
		Continue()
END

IF
    OR(2)
		!GlobalTimerNotExpired("CAST","LOCALS")
        CheckStatGT(Myself,0,WIZARD_IMPROVED_ALACRITY)
    HaveSpell(WIZARD_FLAME_ARROW)
	See(LastSeenBy(Myself))
	!HasBounceEffects(LastSeenBy(Myself))
	!HasImmunityEffects(LastSeenBy(Myself))
	!CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
	!CheckStatGT(LastSeenBy(Myself),60,RESISTFIRE)
    !HasItemEquiped("clck26",LastSeenBy(Myself))
THEN
    RESPONSE #100
        SetGlobalTimer("CAST","LOCALS",6)
        Spell(LastSeenBy(Myself),WIZARD_FLAME_ARROW)
    RESPONSE #5
        SetGlobalTimer("CAST","LOCALS",6)
        SpellNoDec(LastSeenBy(Myself),WIZARD_FLAME_ARROW)
END

IF
    OR(2)
		!GlobalTimerNotExpired("CAST","LOCALS")
        CheckStatGT(Myself,0,WIZARD_IMPROVED_ALACRITY)
    HaveSpell(WIZARD_AGANAZZAR_SCORCHER)
	See(LastSeenBy(Myself))
	!HasBounceEffects(LastSeenBy(Myself))
	!HasImmunityEffects(LastSeenBy(Myself))
	!CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
	!CheckStatGT(LastSeenBy(Myself),60,RESISTFIRE)
    !HasItemEquiped("clck26",LastSeenBy(Myself))
THEN
    RESPONSE #100
        SetGlobalTimer("CAST","LOCALS",6)
        Spell(LastSeenBy(Myself),WIZARD_AGANAZZAR_SCORCHER)
    RESPONSE #10
        SetGlobalTimer("CAST","LOCALS",6)
        SpellNoDec(LastSeenBy(Myself),WIZARD_AGANAZZAR_SCORCHER)
END

IF
    OR(2)
		!GlobalTimerNotExpired("CAST","LOCALS")
        CheckStatGT(Myself,0,WIZARD_IMPROVED_ALACRITY)
	HaveSpell(WIZARD_MELF_ACID_ARROW)
	OR(6)
		!See(NearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTACID)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(6)
		!See(SecondNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTACID)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(6)
		!See(ThirdNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTACID)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(6)
		!See(FourthNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTACID)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(6)
		!See(FifthNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTACID)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(6)
		!See(SixthNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTACID)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(6)
		!See(SeventhNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTACID)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(6)
		!See(EighthNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTACID)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(6)
		!See(NinthNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTACID)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(6)
		!See(TenthNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		CheckStatGT(LastSeenBy(Myself),60,RESISTACID)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	See(NearestEnemyOf(Myself))
	False()
THEN
	RESPONSE #100
		Continue()
END

IF
    OR(2)
		!GlobalTimerNotExpired("CAST","LOCALS")
        CheckStatGT(Myself,0,WIZARD_IMPROVED_ALACRITY)
	HaveSpell(WIZARD_MELF_ACID_ARROW)
	See(LastSeenBy(Myself))
	!HasBounceEffects(LastSeenBy(Myself))
	!HasImmunityEffects(LastSeenBy(Myself))
	!CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
	!CheckStatGT(LastSeenBy(Myself),60,RESISTACID)
    !HasItemEquiped("clck26",LastSeenBy(Myself))
THEN
    RESPONSE #100
        SetGlobalTimer("CAST","LOCALS",6)
        Spell(LastSeenBy(Myself),WIZARD_MELF_ACID_ARROW)
    RESPONSE #10
        SetGlobalTimer("CAST","LOCALS",6)
        SpellNoDec(LastSeenBy(Myself),WIZARD_MELF_ACID_ARROW)
END

IF
    OR(2)
		!GlobalTimerNotExpired("CAST","LOCALS")
        CheckStatGT(Myself,0,WIZARD_IMPROVED_ALACRITY)
	OR(3)
		HaveSpell(WIZARD_MAGIC_MISSILE)
		HaveSpell(WIZARD_LARLOCH_MINOR_DRAIN)
		HaveSpell(WIZARD_CHROMATIC_ORB)
	OR(5)
		!See(NearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(5)
		!See(SecondNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(5)
		!See(ThirdNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(5)
		!See(FourthNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(5)
		!See(FifthNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(5)
		!See(SixthNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(5)
		!See(SeventhNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(5)
		!See(EighthNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(5)
		!See(NinthNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	OR(5)
		!See(TenthNearestEnemyOf(Myself))
		HasBounceEffects(LastSeenBy(Myself))
		HasImmunityEffects(LastSeenBy(Myself))
		CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
		HasItemEquiped("clck26",LastSeenBy(Myself))
	See(NearestEnemyOf(Myself))
	False()
THEN
	RESPONSE #100
		Continue()
END

IF
    OR(2)
		!GlobalTimerNotExpired("CAST","LOCALS")
        CheckStatGT(Myself,0,WIZARD_IMPROVED_ALACRITY)
    HaveSpell(WIZARD_MAGIC_MISSILE)
	See(LastSeenBy(Myself))
	!HasBounceEffects(LastSeenBy(Myself))
	!HasImmunityEffects(LastSeenBy(Myself))
	!CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
    !HasItemEquiped("clck26",LastSeenBy(Myself))
THEN
    RESPONSE #100
        SetGlobalTimer("CAST","LOCALS",6)
        Spell(LastSeenBy(Myself),WIZARD_MAGIC_MISSILE)
	RESPONSE #20
        SetGlobalTimer("CAST","LOCALS",6)
        SpellNoDec(LastSeenBy(Myself),WIZARD_MAGIC_MISSILE)
END

IF
    OR(2)
		!GlobalTimerNotExpired("CAST","LOCALS")
        CheckStatGT(Myself,0,WIZARD_IMPROVED_ALACRITY)
    HaveSpell(WIZARD_LARLOCH_MINOR_DRAIN)
	See(LastSeenBy(Myself))
	!HasBounceEffects(LastSeenBy(Myself))
	!HasImmunityEffects(LastSeenBy(Myself))
	!CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
    !HasItemEquiped("clck26",LastSeenBy(Myself))
THEN
    RESPONSE #100
        SetGlobalTimer("CAST","LOCALS",6)
        Spell(LastSeenBy(Myself),WIZARD_LARLOCH_MINOR_DRAIN)
    RESPONSE #20
        SetGlobalTimer("CAST","LOCALS",6)
        SpellNoDec(LastSeenBy(Myself),WIZARD_LARLOCH_MINOR_DRAIN)
END

IF
    OR(2)
		!GlobalTimerNotExpired("CAST","LOCALS")
        CheckStatGT(Myself,0,WIZARD_IMPROVED_ALACRITY)
    HaveSpell(WIZARD_CHROMATIC_ORB)
	See(LastSeenBy(Myself))
	!HasBounceEffects(LastSeenBy(Myself))
	!HasImmunityEffects(LastSeenBy(Myself))
	!CheckStatGT(LastSeenBy(Myself),60,RESISTMAGIC)
    !HasItemEquiped("clck26",LastSeenBy(Myself))
THEN
    RESPONSE #100
        SetGlobalTimer("CAST","LOCALS",6)
        Spell(LastSeenBy(Myself),WIZARD_CHROMATIC_ORB)
    RESPONSE #20
        SetGlobalTimer("CAST","LOCALS",6)
        SpellNoDec(LastSeenBy(Myself),WIZARD_CHROMATIC_ORB)
END
