IF
	StateCheck(Myself,STATE_SLEEPING)
THEN
	RESPONSE #100
		NoAction()
END

IF
	!See([GOODCUTOFF])
	Allegiance(Myself,ENEMY)
	Range(Player1,40)
THEN
	RESPONSE #100
		MoveToObject(Player1)
END

IF
	Range(NearestEnemyOf(Myself),6)
	HPPercentLT(Myself,50)
	RandomNum(3,1)
THEN
	RESPONSE #100
		RunAwayFrom(NearestEnemyOf(Myself),45)
END

IF
	Global("BeholderBehavior","LOCALS",0)
	See([GOODCUTOFF.0.0.0.0.SUMMONED])
THEN
	RESPONSE #100
		FaceObject(LastSeenBy(Myself))
		ForceSpell(LastSeenBy(Myself),BEHOLDER_PARALYZATION)  // SPIN990.SPL (Paralyze)
		Wait(3)
		Continue()
END

IF
	Global("BeholderBehavior","LOCALS",0)
	See(SecondNearest([PC]))
	HPGT(Myself,55)
THEN
	RESPONSE #100
		FaceObject(SecondNearest([PC]))
		ForceSpell(SecondNearest([PC]),BEHOLDER_FEAR)  // SPIN981.SPL (Fear)
		Wait(2)
		Continue()
END

IF
	Global("BeholderBehavior","LOCALS",0)
	See(LeastDamagedOf(Myself))
	HPGT(Myself,45)
THEN
	RESPONSE #100
		FaceObject(LeastDamagedOf(Myself))
		ForceSpell(LeastDamagedOf(Myself),BEHOLDER_PARALYZATION)  // SPIN990.SPL (Paralyze)
		Continue()
END

IF
	Global("BeholderBehavior","LOCALS",0)
	See([PC])
	!See(LeastDamagedOf(Myself))
	HPGT(Myself,45)
THEN
	RESPONSE #100
		FaceObject([PC])
		ForceSpell([PC],BEHOLDER_PARALYZATION)  // SPIN990.SPL (Paralyze)
		Continue()
END

IF
	Global("BeholderBehavior","LOCALS",0)
	See(ThirdNearest([PC]))
	HPGT(Myself,25)
THEN
	RESPONSE #100
		FaceObject(ThirdNearest([PC]))
		ForceSpell(ThirdNearest([PC]),BEHOLDER_FLESH_TO_STONE)  // SPIN984.SPL (Flesh to Stone)
		Wait(2)
		Continue()
END

IF
	Global("BeholderBehavior","LOCALS",0)
	See([PC])
	See([PC.0.0.MAGE])
THEN
	RESPONSE #100
		FaceObject(LastSeenBy(Myself))
		ForceSpell(LastSeenBy(Myself),BEHOLDER_ANTIMAGIC_RAY)  // SPIN992.SPL (Anti-Magic Ray)
		SetGlobal("BeholderBehavior","LOCALS",1)
		Wait(2)
END

IF
	Global("BeholderBehavior","LOCALS",0)
	See([PC])
	!See([PC.0.0.MAGE])
THEN
	RESPONSE #100
		FaceObject([PC])
		ForceSpell([PC],BEHOLDER_ANTIMAGIC_RAY)  // SPIN992.SPL (Anti-Magic Ray)
		SetGlobal("BeholderBehavior","LOCALS",1)
		Wait(2)
END

IF
	Global("BeholderBehavior","LOCALS",1)
	See([GOODCUTOFF.0.0.0.0.SUMMONED])
THEN
	RESPONSE #100
		FaceObject(LastSeenBy(Myself))
		ForceSpell(LastSeenBy(Myself),BEHOLDER_PARALYZATION)  // SPIN990.SPL (Paralyze)
		Wait(3)
		Continue()
END

IF
	Global("BeholderBehavior","LOCALS",1)
	See(SecondNearest([PC]))
	HPGT(Myself,35)
THEN
	RESPONSE #100
		FaceObject(SecondNearest([PC]))
		ForceSpell(SecondNearest([PC]),BEHOLDER_SLOW)  // SPIN983.SPL (Slow)
		Wait(2)
		Continue()
END

IF
	Global("BeholderBehavior","LOCALS",1)
	See(LeastDamagedOf(Myself))
THEN
	RESPONSE #100
		FaceObject(LeastDamagedOf(Myself))
		ForceSpell(LeastDamagedOf(Myself),BEHOLDER_DEATH_RAY)  // SPIN991.SPL (Death Ray)
		Continue()
END

IF
	Global("BeholderBehavior","LOCALS",1)
	See([PC])
	!See(LeastDamagedOf(Myself))
THEN
	RESPONSE #100
		FaceObject([PC])
		ForceSpell([PC],BEHOLDER_DEATH_RAY)  // SPIN991.SPL (Death Ray)
		Continue()
END

IF
	Global("BeholderBehavior","LOCALS",1)
	See([PC])
	See([PC.0.0.MAGE])
THEN
	RESPONSE #100
		FaceObject(LastSeenBy(Myself))
		ForceSpell(LastSeenBy(Myself),BEHOLDER_ANTIMAGIC_RAY)  // SPIN992.SPL (Anti-Magic Ray)
		SetGlobal("BeholderBehavior","LOCALS",0)
		Wait(2)
END

IF
	Global("BeholderBehavior","LOCALS",1)
	See([PC])
	!See([PC.0.0.MAGE])
THEN
	RESPONSE #100
		FaceObject([PC])
		ForceSpell([PC],BEHOLDER_ANTIMAGIC_RAY)  // SPIN992.SPL (Anti-Magic Ray)
		SetGlobal("BeholderBehavior","LOCALS",0)
		Wait(2)
END

