IF
	ActionListEmpty()
	Global("gh_Summon","LOCALS",0)
THEN
	RESPONSE #100
		FaceObject("CUCHOIN")
		SetGlobal("gh_Summon","LOCALS",1)
		Continue()
END

IF
	HotKey(E)
	Global("gh_AIOffSwitch","LOCALS",1)
THEN
	RESPONSE #100
		SetGlobal("gh_AIOffSwitch","LOCALS",0)
		DisplayStringHead(Myself,16469) // On
END

IF
	ActionListEmpty()
	!Range("CUCHOIN",10)
	!See("CUCHOIN")
	CombatCounter(0)
	!Exists([EVILCUTOFF])
THEN
	RESPONSE #100
		SetGlobal("gh_SummonInFormation","LOCALS",1)
		FollowObjectFormation("CUCHOIN",3,3)
END

IF
	Global("gh_SummonInFormation","LOCALS",1)
	OR(2)
		Exists([EVILCUTOFF])
		!CombatCounter(0)
THEN
	RESPONSE #100
		SetGlobal("gh_SummonInFormation","LOCALS",0)
		ClearActions(Myself)
		Continue()
END

IF
	ActionListEmpty()
	!GlobalTimerNotExpired("gh_ActionIsInterruptable","LOCALS")
	!Allegiance(LastSeenBy(Myself),GOODCUTOFF)
	Detect([EVILCUTOFF])
THEN
	RESPONSE #100
		SetGlobalTimer("gh_ActionIsInterruptable","LOCALS",6)
		AttackOneRound(LastSeenBy(Myself))
END

IF
	ActionListEmpty()
	See(NearestEnemyOf(Myself))
	!InParty(LastSeenBy(Myself))
	!Allegiance(LastSeenBy(Myself),GOODCUTOFF)
THEN
	RESPONSE #100
		AttackOneRound(NearestEnemyOf(Myself))
END


