IF
	Global("WENT_MELEE","LOCALS",0)
	!HaveSpell(WIZARD_MORDENKAINENS_FORCE_MISSILES)
THEN
	RESPONSE #100
		SetGlobal("WENT_MELEE","LOCALS",1)
		EquipMostDamagingMelee()
		Continue()
END

IF
	!Global("CREATURE_STATE_VARBit1","LOCALS",1)
THEN
	RESPONSE #100
		SetGlobal("CREATURE_STATE_VARBit1","LOCALS",1)
		SetGlobalTimer("#localtimer","LOCALS",7)
		Continue()
END

IF
	Global("BODY_COUNT","GLOBAL",0)
	!GlobalTimerNotExpired("#localtimer","LOCALS")
	Detect([PC])
THEN
	RESPONSE #50
		DisplayStringHead(Myself,23650) // "I think you better slow it down, Murdaugh."
		SetGlobalTimer("#localtimer","LOCALS",7)
		Continue()
	RESPONSE #50
		DisplayStringHead(Myself,23652) // "Why don't you lay off the wine and sing us a tune?"
		SetGlobalTimer("#localtimer","LOCALS",7)
		Continue()
	RESPONSE #50
		DisplayStringHead(Myself,23651) // "Honestly, Murdaugh. Are you trying to drink yourself blind?"
		SetGlobalTimer("#localtimer","LOCALS",7)
		Continue()
	RESPONSE #50
		DisplayStringHead(Myself,24033) // "Surely your innards must be pickled by now."
		SetGlobalTimer("#localtimer","LOCALS",7)
		Continue()
	RESPONSE #250
		SetGlobalTimer("#localtimer","LOCALS",7)
		Continue()
END

IF
	Global("BODY_COUNT","GLOBAL",1)
	!GlobalTimerNotExpired("#localtimer","LOCALS")
	Detect([PC])
THEN
	RESPONSE #25
		DisplayStringHead(Myself,24034) // "I heard that ruffian Digby was found dead in the forest."
		SetGlobalTimer("#localtimer","LOCALS",7)
		Continue()
	RESPONSE #25
		DisplayStringHead(Myself,24035) // "Emmerich said an animal tore out the poor fool's throat."
		SetGlobalTimer("#localtimer","LOCALS",7)
		Continue()
	RESPONSE #25
		DisplayStringHead(Myself,24036) // "I guess Digby should've heeded Emmerich's warnings."
		SetGlobalTimer("#localtimer","LOCALS",7)
		Continue()
	RESPONSE #300
		SetGlobalTimer("#localtimer","LOCALS",7)
		Continue()
END

IF
	Global("BODY_COUNT","GLOBAL",2)
	!GlobalTimerNotExpired("#localtimer","LOCALS")
	Detect([PC])
THEN
	RESPONSE #25
		DisplayStringHead(Myself,24037) // "First Digby... now Dolan. I wonder who's next?"
		SetGlobalTimer("#localtimer","LOCALS",7)
		Continue()
	RESPONSE #25
		DisplayStringHead(Myself,24038) // "Both brothers killed by the same beast? Strange indeed."
		SetGlobalTimer("#localtimer","LOCALS",7)
		Continue()
	RESPONSE #25
		DisplayStringHead(Myself,24039) // "I wonder if Doogal will stick around now that his brothers are dead?"
		SetGlobalTimer("#localtimer","LOCALS",7)
		Continue()
	RESPONSE #300
		SetGlobalTimer("#localtimer","LOCALS",7)
		Continue()
END

IF
	Global("BODY_COUNT","GLOBAL",3)
	!GlobalTimerNotExpired("#localtimer","LOCALS")
	Detect([PC])
THEN
	RESPONSE #25
		DisplayStringHead(Myself,24040) // "Purvis sure has been getting a lot of business these days."
		SetGlobalTimer("#localtimer","LOCALS",7)
		Continue()
	RESPONSE #25
		DisplayStringHead(Myself,24073) // "I tell you... that's no ordinary wolf doing all the killing."
		SetGlobalTimer("#localtimer","LOCALS",7)
		Continue()
	RESPONSE #25
		DisplayStringHead(Myself,24074) // "Poor Doogal. Oh well... those brothers always did stick together."
		SetGlobalTimer("#localtimer","LOCALS",7)
		Continue()
	RESPONSE #300
		SetGlobalTimer("#localtimer","LOCALS",7)
		Continue()
END

IF
	HasItem("EXTHEAL",Myself) // Potion of Extra Healing
	HPPercentLT(Myself,25)
THEN
	RESPONSE #100
		UseItem("EXTHEAL",Myself) // Potion of Extra Healing
		Continue()
END

IF
	HaveSpell(WIZARD_SEVEN_EYES)
	See(NearestEnemyOf(Myself))
THEN
	RESPONSE #100
		ForceSpell(Myself,WIZARD_SEVEN_EYES)
		RemoveSpell(WIZARD_SEVEN_EYES)
		Wait(2)
END

IF
	Allegiance(Myself,EVILCUTOFF)
	OR(2)
		!GlobalTimerNotExpired("OH_Cast","LOCALS")
		CheckStatGT(Myself,0,AURACLEANSING)
	HaveSpell(WIZARD_ORACLE)
	CheckStat(Myself,0,TRUE_SIGHT)
	See([GOODCUTOFF.0.0.0.0.ILLUSIONARY])
	CheckStatLT(Myself,50,SPELLFAILUREMAGE)
	!StateCheck(Myself,STATE_SILENCED)
	!CheckStatGT(Myself,0,CLERIC_INSECT_PLAGUE)
THEN
	RESPONSE #100
		SetGlobalTimer("OH_Cast","LOCALS",6)
		Spell(Myself,WIZARD_ORACLE)
END

IF
	Allegiance(Myself,EVILCUTOFF)
	OR(2)
		!GlobalTimerNotExpired("OH_Cast","LOCALS")
		CheckStatGT(Myself,0,AURACLEANSING)
	!GlobalTimerNotExpired("OH_TStop","LOCALS")
	HaveSpell(WIZARD_SPELL_THRUST)
	See(Player1)
	!StateCheck(LastSeenBy(Myself),STATE_NOT_TARGETABLE)
	!CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_IMMUNITY)
	OR(4)
		CheckStat(LastSeenBy(Myself),1,MINORGLOBE)
		CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_DEFLECTION)
		CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_TURNING)
		CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_IMMUNITY)
	CheckStatLT(Myself,50,SPELLFAILUREMAGE)
	!CheckStatGT(Myself,0,CLERIC_INSECT_PLAGUE)
	!StateCheck(Myself,STATE_SILENCED)
THEN
	RESPONSE #100
		SetGlobalTimer("OH_Cast","LOCALS",6)
		Spell(LastSeenBy(Myself),WIZARD_SPELL_THRUST)
END

IF
	Allegiance(Myself,EVILCUTOFF)
	OR(2)
		!GlobalTimerNotExpired("OH_Cast","LOCALS")
		CheckStatGT(Myself,0,AURACLEANSING)
	!GlobalTimerNotExpired("OH_TStop","LOCALS")
	HaveSpell(WIZARD_SPELL_THRUST)
	See(Player2)
	!StateCheck(LastSeenBy(Myself),STATE_NOT_TARGETABLE)
	!CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_IMMUNITY)
	OR(4)
		CheckStat(LastSeenBy(Myself),1,MINORGLOBE)
		CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_DEFLECTION)
		CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_TURNING)
		CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_IMMUNITY)
	CheckStatLT(Myself,50,SPELLFAILUREMAGE)
	!CheckStatGT(Myself,0,CLERIC_INSECT_PLAGUE)
	!StateCheck(Myself,STATE_SILENCED)
THEN
	RESPONSE #100
		SetGlobalTimer("OH_Cast","LOCALS",6)
		Spell(LastSeenBy(Myself),WIZARD_SPELL_THRUST)
END

IF
	Allegiance(Myself,EVILCUTOFF)
	OR(2)
		!GlobalTimerNotExpired("OH_Cast","LOCALS")
		CheckStatGT(Myself,0,AURACLEANSING)
	!GlobalTimerNotExpired("OH_TStop","LOCALS")
	HaveSpell(WIZARD_SPELL_THRUST)
	See(Player3)
	!StateCheck(LastSeenBy(Myself),STATE_NOT_TARGETABLE)
	!CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_IMMUNITY)
	OR(4)
		CheckStat(LastSeenBy(Myself),1,MINORGLOBE)
		CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_DEFLECTION)
		CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_TURNING)
		CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_IMMUNITY)
	CheckStatLT(Myself,50,SPELLFAILUREMAGE)
	!CheckStatGT(Myself,0,CLERIC_INSECT_PLAGUE)
	!StateCheck(Myself,STATE_SILENCED)
THEN
	RESPONSE #100
		SetGlobalTimer("OH_Cast","LOCALS",6)
		Spell(LastSeenBy(Myself),WIZARD_SPELL_THRUST)
END

IF
	Allegiance(Myself,EVILCUTOFF)
	OR(2)
		!GlobalTimerNotExpired("OH_Cast","LOCALS")
		CheckStatGT(Myself,0,AURACLEANSING)
	!GlobalTimerNotExpired("OH_TStop","LOCALS")
	HaveSpell(WIZARD_SPELL_THRUST)
	See(Player4)
	!StateCheck(LastSeenBy(Myself),STATE_NOT_TARGETABLE)
	!CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_IMMUNITY)
	OR(4)
		CheckStat(LastSeenBy(Myself),1,MINORGLOBE)
		CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_DEFLECTION)
		CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_TURNING)
		CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_IMMUNITY)
	CheckStatLT(Myself,50,SPELLFAILUREMAGE)
	!CheckStatGT(Myself,0,CLERIC_INSECT_PLAGUE)
	!StateCheck(Myself,STATE_SILENCED)
THEN
	RESPONSE #100
		SetGlobalTimer("OH_Cast","LOCALS",6)
		Spell(LastSeenBy(Myself),WIZARD_SPELL_THRUST)
END

IF
	Allegiance(Myself,EVILCUTOFF)
	OR(2)
		!GlobalTimerNotExpired("OH_Cast","LOCALS")
		CheckStatGT(Myself,0,AURACLEANSING)
	!GlobalTimerNotExpired("OH_TStop","LOCALS")
	HaveSpell(WIZARD_SPELL_THRUST)
	See(Player5)
	!StateCheck(LastSeenBy(Myself),STATE_NOT_TARGETABLE)
	!CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_IMMUNITY)
	OR(4)
		CheckStat(LastSeenBy(Myself),1,MINORGLOBE)
		CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_DEFLECTION)
		CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_TURNING)
		CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_IMMUNITY)
	CheckStatLT(Myself,50,SPELLFAILUREMAGE)
	!CheckStatGT(Myself,0,CLERIC_INSECT_PLAGUE)
	!StateCheck(Myself,STATE_SILENCED)
THEN
	RESPONSE #100
		SetGlobalTimer("OH_Cast","LOCALS",6)
		Spell(LastSeenBy(Myself),WIZARD_SPELL_THRUST)
END

IF
	Allegiance(Myself,EVILCUTOFF)
	OR(2)
		!GlobalTimerNotExpired("OH_Cast","LOCALS")
		CheckStatGT(Myself,0,AURACLEANSING)
	!GlobalTimerNotExpired("OH_TStop","LOCALS")
	HaveSpell(WIZARD_SPELL_THRUST)
	See(Player6)
	!StateCheck(LastSeenBy(Myself),STATE_NOT_TARGETABLE)
	!CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_IMMUNITY)
	OR(4)
		CheckStat(LastSeenBy(Myself),1,MINORGLOBE)
		CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_DEFLECTION)
		CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_TURNING)
		CheckStatGT(LastSeenBy(Myself),0,WIZARD_SPELL_IMMUNITY)
	CheckStatLT(Myself,50,SPELLFAILUREMAGE)
	!CheckStatGT(Myself,0,CLERIC_INSECT_PLAGUE)
	!StateCheck(Myself,STATE_SILENCED)
THEN
	RESPONSE #100
		SetGlobalTimer("OH_Cast","LOCALS",6)
		Spell(LastSeenBy(Myself),WIZARD_SPELL_THRUST)
END

IF
	Allegiance(Myself,EVILCUTOFF)
	OR(2)
		!GlobalTimerNotExpired("OH_Cast","LOCALS")
		CheckStatGT(Myself,0,AURACLEANSING)
	!GlobalTimerNotExpired("OH_TStop","LOCALS")
	HaveSpell(WIZARD_SECRET_WORD)
	See(Player1)
	!StateCheck(LastSeenBy(Myself),STATE_NOT_TARGETABLE)
	!CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_IMMUNITY)
	OR(5)
		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,WIZARD_SPELL_IMMUNITY)
		CheckStatGT(LastSeenBy(Myself),0,MINORGLOBE)
	CheckStatLT(Myself,50,SPELLFAILUREMAGE)
	!CheckStatGT(Myself,0,CLERIC_INSECT_PLAGUE)
	!StateCheck(Myself,STATE_SILENCED)
THEN
	RESPONSE #100
		SetGlobalTimer("OH_Cast","LOCALS",6)
		Spell(LastSeenBy(Myself),WIZARD_SECRET_WORD)
END

IF
	Allegiance(Myself,EVILCUTOFF)
	OR(2)
		!GlobalTimerNotExpired("OH_Cast","LOCALS")
		CheckStatGT(Myself,0,AURACLEANSING)
	!GlobalTimerNotExpired("OH_TStop","LOCALS")
	HaveSpell(WIZARD_SECRET_WORD)
	See(Player2)
	!StateCheck(LastSeenBy(Myself),STATE_NOT_TARGETABLE)
	!CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_IMMUNITY)
	OR(5)
		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,WIZARD_SPELL_IMMUNITY)
		CheckStatGT(LastSeenBy(Myself),0,MINORGLOBE)
	CheckStatLT(Myself,50,SPELLFAILUREMAGE)
	!CheckStatGT(Myself,0,CLERIC_INSECT_PLAGUE)
	!StateCheck(Myself,STATE_SILENCED)
THEN
	RESPONSE #100
		SetGlobalTimer("OH_Cast","LOCALS",6)
		Spell(LastSeenBy(Myself),WIZARD_SECRET_WORD)
END

IF
	Allegiance(Myself,EVILCUTOFF)
	OR(2)
		!GlobalTimerNotExpired("OH_Cast","LOCALS")
		CheckStatGT(Myself,0,AURACLEANSING)
	!GlobalTimerNotExpired("OH_TStop","LOCALS")
	HaveSpell(WIZARD_SECRET_WORD)
	See(Player3)
	!StateCheck(LastSeenBy(Myself),STATE_NOT_TARGETABLE)
	!CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_IMMUNITY)
	OR(5)
		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,WIZARD_SPELL_IMMUNITY)
		CheckStatGT(LastSeenBy(Myself),0,MINORGLOBE)
	CheckStatLT(Myself,50,SPELLFAILUREMAGE)
	!CheckStatGT(Myself,0,CLERIC_INSECT_PLAGUE)
	!StateCheck(Myself,STATE_SILENCED)
THEN
	RESPONSE #100
		SetGlobalTimer("OH_Cast","LOCALS",6)
		Spell(LastSeenBy(Myself),WIZARD_SECRET_WORD)
END

IF
	Allegiance(Myself,EVILCUTOFF)
	OR(2)
		!GlobalTimerNotExpired("OH_Cast","LOCALS")
		CheckStatGT(Myself,0,AURACLEANSING)
	!GlobalTimerNotExpired("OH_TStop","LOCALS")
	HaveSpell(WIZARD_SECRET_WORD)
	See(Player4)
	!StateCheck(LastSeenBy(Myself),STATE_NOT_TARGETABLE)
	!CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_IMMUNITY)
	OR(5)
		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,WIZARD_SPELL_IMMUNITY)
		CheckStatGT(LastSeenBy(Myself),0,MINORGLOBE)
	CheckStatLT(Myself,50,SPELLFAILUREMAGE)
	!CheckStatGT(Myself,0,CLERIC_INSECT_PLAGUE)
	!StateCheck(Myself,STATE_SILENCED)
THEN
	RESPONSE #100
		SetGlobalTimer("OH_Cast","LOCALS",6)
		Spell(LastSeenBy(Myself),WIZARD_SECRET_WORD)
END

IF
	Allegiance(Myself,EVILCUTOFF)
	OR(2)
		!GlobalTimerNotExpired("OH_Cast","LOCALS")
		CheckStatGT(Myself,0,AURACLEANSING)
	!GlobalTimerNotExpired("OH_TStop","LOCALS")
	HaveSpell(WIZARD_SECRET_WORD)
	See(Player5)
	!StateCheck(LastSeenBy(Myself),STATE_NOT_TARGETABLE)
	!CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_IMMUNITY)
	OR(5)
		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,WIZARD_SPELL_IMMUNITY)
		CheckStatGT(LastSeenBy(Myself),0,MINORGLOBE)
	CheckStatLT(Myself,50,SPELLFAILUREMAGE)
	!CheckStatGT(Myself,0,CLERIC_INSECT_PLAGUE)
	!StateCheck(Myself,STATE_SILENCED)
THEN
	RESPONSE #100
		SetGlobalTimer("OH_Cast","LOCALS",6)
		Spell(LastSeenBy(Myself),WIZARD_SECRET_WORD)
END

IF
	Allegiance(Myself,EVILCUTOFF)
	OR(2)
		!GlobalTimerNotExpired("OH_Cast","LOCALS")
		CheckStatGT(Myself,0,AURACLEANSING)
	!GlobalTimerNotExpired("OH_TStop","LOCALS")
	HaveSpell(WIZARD_SECRET_WORD)
	See(Player6)
	!StateCheck(LastSeenBy(Myself),STATE_NOT_TARGETABLE)
	!CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_IMMUNITY)
	OR(5)
		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,WIZARD_SPELL_IMMUNITY)
		CheckStatGT(LastSeenBy(Myself),0,MINORGLOBE)
	CheckStatLT(Myself,50,SPELLFAILUREMAGE)
	!CheckStatGT(Myself,0,CLERIC_INSECT_PLAGUE)
	!StateCheck(Myself,STATE_SILENCED)
THEN
	RESPONSE #100
		SetGlobalTimer("OH_Cast","LOCALS",6)
		Spell(LastSeenBy(Myself),WIZARD_SECRET_WORD)
END

IF
	Allegiance(Myself,EVILCUTOFF)
	OR(2)
		!GlobalTimerNotExpired("OH_Cast","LOCALS")
		CheckStatGT(Myself,0,AURACLEANSING)
	!GlobalTimerNotExpired("OH_TStop","LOCALS")
	HaveSpell(WIZARD_BREACH)
	See(Player1)
	!StateCheck(LastSeenBy(Myself),STATE_NOT_TARGETABLE)
	!CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_IMMUNITY)
	OR(5)
		CheckStatGT(LastSeenBy(Myself),0,WIZARD_PROTECTION_FROM_MAGIC_WEAPONS)
		CheckStatGT(LastSeenBy(Myself),0,CLERIC_CHAOTIC_COMMANDS)
		CheckStatGT(LastSeenBy(Myself),0,WIZARD_PROTECTION_FROM_MAGIC_ENERGY)
		CheckStatGT(LastSeenBy(Myself),0,STONESKINS)
		CheckStatGT(LastSeenBy(Myself),0,WIZARD_FIRE_SHIELD)
	CheckStatLT(Myself,50,SPELLFAILUREMAGE)
	!CheckStatGT(Myself,0,CLERIC_INSECT_PLAGUE)
	!StateCheck(Myself,STATE_SILENCED)
THEN
	RESPONSE #100
		SetGlobalTimer("OH_Cast","LOCALS",6)
		Spell(LastSeenBy(Myself),WIZARD_BREACH)
END

IF
	Allegiance(Myself,EVILCUTOFF)
	OR(2)
		!GlobalTimerNotExpired("OH_Cast","LOCALS")
		CheckStatGT(Myself,0,AURACLEANSING)
	!GlobalTimerNotExpired("OH_TStop","LOCALS")
	HaveSpell(WIZARD_BREACH)
	See(Player2)
	!StateCheck(LastSeenBy(Myself),STATE_NOT_TARGETABLE)
	!CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_IMMUNITY)
	OR(5)
		CheckStatGT(LastSeenBy(Myself),0,WIZARD_PROTECTION_FROM_MAGIC_WEAPONS)
		CheckStatGT(LastSeenBy(Myself),0,CLERIC_CHAOTIC_COMMANDS)
		CheckStatGT(LastSeenBy(Myself),0,WIZARD_PROTECTION_FROM_MAGIC_ENERGY)
		CheckStatGT(LastSeenBy(Myself),0,STONESKINS)
		CheckStatGT(LastSeenBy(Myself),0,WIZARD_FIRE_SHIELD)
	CheckStatLT(Myself,50,SPELLFAILUREMAGE)
	!CheckStatGT(Myself,0,CLERIC_INSECT_PLAGUE)
	!StateCheck(Myself,STATE_SILENCED)
THEN
	RESPONSE #100
		SetGlobalTimer("OH_Cast","LOCALS",6)
		Spell(LastSeenBy(Myself),WIZARD_BREACH)
END

IF
	Allegiance(Myself,EVILCUTOFF)
	OR(2)
		!GlobalTimerNotExpired("OH_Cast","LOCALS")
		CheckStatGT(Myself,0,AURACLEANSING)
	!GlobalTimerNotExpired("OH_TStop","LOCALS")
	HaveSpell(WIZARD_BREACH)
	See(Player3)
	!StateCheck(LastSeenBy(Myself),STATE_NOT_TARGETABLE)
	!CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_IMMUNITY)
	OR(5)
		CheckStatGT(LastSeenBy(Myself),0,WIZARD_PROTECTION_FROM_MAGIC_WEAPONS)
		CheckStatGT(LastSeenBy(Myself),0,CLERIC_CHAOTIC_COMMANDS)
		CheckStatGT(LastSeenBy(Myself),0,WIZARD_PROTECTION_FROM_MAGIC_ENERGY)
		CheckStatGT(LastSeenBy(Myself),0,STONESKINS)
		CheckStatGT(LastSeenBy(Myself),0,WIZARD_FIRE_SHIELD)
	CheckStatLT(Myself,50,SPELLFAILUREMAGE)
	!CheckStatGT(Myself,0,CLERIC_INSECT_PLAGUE)
	!StateCheck(Myself,STATE_SILENCED)
THEN
	RESPONSE #100
		SetGlobalTimer("OH_Cast","LOCALS",6)
		Spell(LastSeenBy(Myself),WIZARD_BREACH)
END

IF
	Allegiance(Myself,EVILCUTOFF)
	OR(2)
		!GlobalTimerNotExpired("OH_Cast","LOCALS")
		CheckStatGT(Myself,0,AURACLEANSING)
	!GlobalTimerNotExpired("OH_TStop","LOCALS")
	HaveSpell(WIZARD_BREACH)
	See(Player4)
	!StateCheck(LastSeenBy(Myself),STATE_NOT_TARGETABLE)
	!CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_IMMUNITY)
	OR(5)
		CheckStatGT(LastSeenBy(Myself),0,WIZARD_PROTECTION_FROM_MAGIC_WEAPONS)
		CheckStatGT(LastSeenBy(Myself),0,CLERIC_CHAOTIC_COMMANDS)
		CheckStatGT(LastSeenBy(Myself),0,WIZARD_PROTECTION_FROM_MAGIC_ENERGY)
		CheckStatGT(LastSeenBy(Myself),0,STONESKINS)
		CheckStatGT(LastSeenBy(Myself),0,WIZARD_FIRE_SHIELD)
	CheckStatLT(Myself,50,SPELLFAILUREMAGE)
	!CheckStatGT(Myself,0,CLERIC_INSECT_PLAGUE)
	!StateCheck(Myself,STATE_SILENCED)
THEN
	RESPONSE #100
		SetGlobalTimer("OH_Cast","LOCALS",6)
		Spell(LastSeenBy(Myself),WIZARD_BREACH)
END

IF
	Allegiance(Myself,EVILCUTOFF)
	OR(2)
		!GlobalTimerNotExpired("OH_Cast","LOCALS")
		CheckStatGT(Myself,0,AURACLEANSING)
	!GlobalTimerNotExpired("OH_TStop","LOCALS")
	HaveSpell(WIZARD_BREACH)
	See(Player5)
	!StateCheck(LastSeenBy(Myself),STATE_NOT_TARGETABLE)
	!CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_IMMUNITY)
	OR(5)
		CheckStatGT(LastSeenBy(Myself),0,WIZARD_PROTECTION_FROM_MAGIC_WEAPONS)
		CheckStatGT(LastSeenBy(Myself),0,CLERIC_CHAOTIC_COMMANDS)
		CheckStatGT(LastSeenBy(Myself),0,WIZARD_PROTECTION_FROM_MAGIC_ENERGY)
		CheckStatGT(LastSeenBy(Myself),0,STONESKINS)
		CheckStatGT(LastSeenBy(Myself),0,WIZARD_FIRE_SHIELD)
	CheckStatLT(Myself,50,SPELLFAILUREMAGE)
	!CheckStatGT(Myself,0,CLERIC_INSECT_PLAGUE)
	!StateCheck(Myself,STATE_SILENCED)
THEN
	RESPONSE #100
		SetGlobalTimer("OH_Cast","LOCALS",6)
		Spell(LastSeenBy(Myself),WIZARD_BREACH)
END

IF
	Allegiance(Myself,EVILCUTOFF)
	OR(2)
		!GlobalTimerNotExpired("OH_Cast","LOCALS")
		CheckStatGT(Myself,0,AURACLEANSING)
	!GlobalTimerNotExpired("OH_TStop","LOCALS")
	HaveSpell(WIZARD_BREACH)
	See(Player6)
	!StateCheck(LastSeenBy(Myself),STATE_NOT_TARGETABLE)
	!CheckStat(LastSeenBy(Myself),1,WIZARD_SPELL_IMMUNITY)
	OR(5)
		CheckStatGT(LastSeenBy(Myself),0,WIZARD_PROTECTION_FROM_MAGIC_WEAPONS)
		CheckStatGT(LastSeenBy(Myself),0,CLERIC_CHAOTIC_COMMANDS)
		CheckStatGT(LastSeenBy(Myself),0,WIZARD_PROTECTION_FROM_MAGIC_ENERGY)
		CheckStatGT(LastSeenBy(Myself),0,STONESKINS)
		CheckStatGT(LastSeenBy(Myself),0,WIZARD_FIRE_SHIELD)
	CheckStatLT(Myself,50,SPELLFAILUREMAGE)
	!CheckStatGT(Myself,0,CLERIC_INSECT_PLAGUE)
	!StateCheck(Myself,STATE_SILENCED)
THEN
	RESPONSE #100
		SetGlobalTimer("OH_Cast","LOCALS",6)
		Spell(LastSeenBy(Myself),WIZARD_BREACH)
END

IF
	HaveSpell(WIZARD_MORDENKAINENS_FORCE_MISSILES)
	See(NearestEnemyOf(Myself))
THEN
	RESPONSE #100
		ForceSpell(LastSeenBy(Myself),WIZARD_MORDENKAINENS_FORCE_MISSILES)
		RemoveSpell(WIZARD_MORDENKAINENS_FORCE_MISSILES)
		Wait(2)
END

IF
	HaveSpell(WIZARD_IRON_BODY)
	See("Murdaugh")
	Allegiance(Myself,ENEMY)
THEN
	RESPONSE #100
		ForceSpell(LastSeenBy(Myself),WIZARD_IRON_BODY)
		RemoveSpell(WIZARD_IRON_BODY)
		Wait(2)
END

IF
	HaveSpell(WIZARD_ABI_DALZIMS_HORRID_WILTING)
	See(NearestEnemyOf(Myself))
THEN
	RESPONSE #100
		ForceSpell(LastSeenBy(Myself),WIZARD_ABI_DALZIMS_HORRID_WILTING)
		RemoveSpell(WIZARD_ABI_DALZIMS_HORRID_WILTING)
		Wait(2)
END

IF
	HaveSpell(WIZARD_TROLLISH_FORTITUDE)
	See(NearestEnemyOf(Myself))
THEN
	RESPONSE #100
		ForceSpell(Myself,WIZARD_TROLLISH_FORTITUDE)
		RemoveSpell(WIZARD_TROLLISH_FORTITUDE)
		Wait(2)
END

IF
	HaveSpell(WIZARD_SUFFOCATE)
	See(NearestEnemyOf(Myself))
THEN
	RESPONSE #100
		ForceSpell(LastSeenBy(Myself),WIZARD_SUFFOCATE)
		RemoveSpell(WIZARD_SUFFOCATE)
		Wait(2)
END

IF
	HaveSpell(WIZARD_FINGER_OF_DEATH)
	See(NearestEnemyOf(Myself))
THEN
	RESPONSE #100
		ForceSpell(LastSeenBy(Myself),WIZARD_FINGER_OF_DEATH)
		RemoveSpell(WIZARD_FINGER_OF_DEATH)
		Wait(2)
END

IF
	HaveSpell(WIZARD_FLESH_TO_STONE)
	See(NearestEnemyOf(Myself))
THEN
	RESPONSE #100
		ForceSpell(LastSeenBy(Myself),WIZARD_FLESH_TO_STONE)
		RemoveSpell(WIZARD_FLESH_TO_STONE)
		Wait(2)
END

IF
	HaveSpell(WIZARD_MAGIC_MISSILE)
	See(NearestEnemyOf(Myself))
THEN
	RESPONSE #100
		ForceSpell(LastSeenBy(Myself),WIZARD_MAGIC_MISSILE)
		RemoveSpell(WIZARD_MAGIC_MISSILE)
		Wait(2)
END

IF
	HaveSpell(WIZARD_POWER_WORD_STUN)
	See(NearestEnemyOf(Myself))
	!StateCheck(LastSeenBy(Myself),STATE_STUNNED)
THEN
	RESPONSE #100
		ForceSpell(LastSeenBy(Myself),WIZARD_POWER_WORD_STUN)
		RemoveSpell(WIZARD_POWER_WORD_STUN)
		Wait(2)
END

IF
	HaveSpell(WIZARD_AGANNAZAR_SCORCHER)
	See(NearestEnemyOf(Myself))
THEN
	RESPONSE #100
		ForceSpell(LastSeenBy(Myself),WIZARD_AGANNAZAR_SCORCHER)
		RemoveSpell(WIZARD_AGANNAZAR_SCORCHER)
		Wait(2)
END

IF
	HaveSpell(WIZARD_CONFUSION)
	See(NearestEnemyOf(Myself))
	!StateCheck(LastSeenBy(Myself),STATE_CONFUSED)
THEN
	RESPONSE #100
		ForceSpell(LastSeenBy(Myself),WIZARD_CONFUSION)
		RemoveSpell(WIZARD_CONFUSION)
		Wait(2)
END

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

IF
	Global("MOVEMENT_LIST_0_LOC","LOCALS",0)
	ActionListEmpty()
	!GlobalTimerNotExpired("MOVEMENT_LIST_0_TIMER","LOCALS")
THEN
	RESPONSE #100
		SetGlobalTimer("MOVEMENT_LIST_0_TIMER","LOCALS",5)
		SetGlobal("MOVEMENT_LIST_0_LOC","LOCALS",1)
END

IF
	Global("MOVEMENT_LIST_0_LOC","LOCALS",1)
	Global("CREATURE_STATE_VARBit20","LOCALS",1)
THEN
	RESPONSE #100
		SetGlobal("MOVEMENT_LIST_0_LOC","LOCALS",2)
		IncrementGlobal("CREATURE_STATE_VARBit20","LOCALS",1)
		Continue()
END

IF
	Global("MOVEMENT_LIST_0_LOC","LOCALS",1)
	ActionListEmpty()
	!GlobalTimerNotExpired("MOVEMENT_LIST_0_TIMER","LOCALS")
THEN
	RESPONSE #100
		SetGlobal("CREATURE_STATE_VARBit20","LOCALS",1)
		SetHomeLocation([703.364])
		MoveToPoint([703.364])
END

IF
	Global("MOVEMENT_LIST_0_LOC","LOCALS",2)
	ActionListEmpty()
	!GlobalTimerNotExpired("MOVEMENT_LIST_0_TIMER","LOCALS")
THEN
	RESPONSE #100
		Face(SE)
		SetGlobal("MOVEMENT_LIST_0_LOC","LOCALS",3)
END

IF
	Global("MOVEMENT_LIST_0_LOC","LOCALS",3)
	ActionListEmpty()
	!GlobalTimerNotExpired("MOVEMENT_LIST_0_TIMER","LOCALS")
THEN
	RESPONSE #100
		SetGlobalTimer("MOVEMENT_LIST_0_TIMER","LOCALS",7)
		SetGlobal("MOVEMENT_LIST_0_LOC","LOCALS",4)
END

IF
	Global("MOVEMENT_LIST_0_LOC","LOCALS",4)
	Global("CREATURE_STATE_VARBit20","LOCALS",1)
THEN
	RESPONSE #100
		SetGlobal("MOVEMENT_LIST_0_LOC","LOCALS",5)
		IncrementGlobal("CREATURE_STATE_VARBit20","LOCALS",1)
		Continue()
END

IF
	Global("MOVEMENT_LIST_0_LOC","LOCALS",4)
	ActionListEmpty()
	!GlobalTimerNotExpired("MOVEMENT_LIST_0_TIMER","LOCALS")
THEN
	RESPONSE #100
		SetGlobal("CREATURE_STATE_VARBit20","LOCALS",1)
		SetHomeLocation([726.328])
		MoveToPoint([726.328])
END

IF
	Global("MOVEMENT_LIST_0_LOC","LOCALS",5)
	ActionListEmpty()
	!GlobalTimerNotExpired("MOVEMENT_LIST_0_TIMER","LOCALS")
THEN
	RESPONSE #100
		SetGlobalTimer("MOVEMENT_LIST_0_TIMER","LOCALS",3)
		SetGlobal("MOVEMENT_LIST_0_LOC","LOCALS",6)
END

IF
	Global("MOVEMENT_LIST_0_LOC","LOCALS",6)
	Global("CREATURE_STATE_VARBit20","LOCALS",1)
THEN
	RESPONSE #100
		SetGlobal("MOVEMENT_LIST_0_LOC","LOCALS",0)
		IncrementGlobal("CREATURE_STATE_VARBit20","LOCALS",1)
		Continue()
END

IF
	Global("MOVEMENT_LIST_0_LOC","LOCALS",6)
	ActionListEmpty()
	!GlobalTimerNotExpired("MOVEMENT_LIST_0_TIMER","LOCALS")
THEN
	RESPONSE #100
		SetGlobal("CREATURE_STATE_VARBit20","LOCALS",1)
		SetHomeLocation([788.308])
		MoveToPoint([788.308])
END

IF
	Global("CDGloom","MYAREA",2)
THEN
	RESPONSE #100
		SetGlobal("CDGloom","MYAREA",3)
		StartCutSceneMode()
		StartCutScene("cdgloom")
END

IF
	Global("CDGloom","MYAREA",4)
THEN
	RESPONSE #100
		SetGlobal("CDGloom","MYAREA",5)
		StartDialogueNoSet([PC])
END

IF
	Global("CDGloom","MYAREA",2)
THEN
	RESPONSE #100
		SetGlobal("CDGloom","MYAREA",3)
		StartCutSceneMode()
		StartCutScene("cdgloom")
END

IF
	Global("CDGloom","MYAREA",4)
THEN
	RESPONSE #100
		SetGlobal("CDGloom","MYAREA",5)
		StartDialogueNoSet([PC])
END


