IF
	See("FlamingFist2")
	Allegiance("FlamingFist2",ENEMY)
	HaveSpell(CLERIC_CURE_LIGHT_WOUNDS)
	HPPercentLT(Myself,50)
THEN
	RESPONSE #100
		Spell(Myself,CLERIC_CURE_LIGHT_WOUNDS)
END

IF
	See("FlamingFist2")
	Allegiance("FlamingFist2",ENEMY)
	HaveSpell(CLERIC_COMMAND)
	!StateCheck("FlamingFist2",STATE_SLEEPING)
	!StateCheck("FlamingFist2",STATE_HELPLESS)
THEN
	RESPONSE #100
		Spell("FlamingFist2",CLERIC_COMMAND)
END

IF
	See("FlamingFist2")
	Allegiance("FlamingFist2",ENEMY)
THEN
	RESPONSE #100
		Attack("FlamingFist2")
END

IF
	!UnselectableVariable(0)
	Global("Kivanfight","GLOBAL",0)
THEN
	RESPONSE #100
		MakeUnselectable(0)
END

IF
	UnselectableVariable(0)
	See("Kivan")
	Global("Kivanfight","GLOBAL",1)
THEN
	RESPONSE #100
		MakeUnselectable(5000)
END

IF
	!UnselectableVariable(0)
	Dead("Kivan") // Kivan
	Global("Kivanfight","GLOBAL",1)
THEN
	RESPONSE #100
		SetGlobal("Kivanfight","GLOBAL",0)
		MakeUnselectable(0)
END

IF
	!UnselectableVariable(0)
	!See("Kivan")
THEN
	RESPONSE #100
		MakeUnselectable(0)
END

IF
	Global("Kivanfight","GLOBAL",1)
	HaveSpell(CLERIC_CURE_LIGHT_WOUNDS)
	HPPercentLT(Myself,50)
THEN
	RESPONSE #100
		Spell(Myself,CLERIC_CURE_LIGHT_WOUNDS)
END

IF
	Global("Kivanfight","GLOBAL",1)
	See("Kivan")
	HaveSpell(CLERIC_HOLD_PERSON)
	!StateCheck("Kivan",STATE_SLEEPING)
	!StateCheck("Kivan",STATE_HELPLESS)
THEN
	RESPONSE #100
		Spell("Kivan",CLERIC_HOLD_PERSON)
END

IF
	Global("Kivanfight","GLOBAL",1)
	See("Kivan")
	HaveSpell(CLERIC_COMMAND)
	!StateCheck("Kivan",STATE_SLEEPING)
	!StateCheck("Kivan",STATE_HELPLESS)
THEN
	RESPONSE #100
		Spell("Kivan",CLERIC_COMMAND)
END

IF
	Global("Kivanfight","GLOBAL",1)
	See("Kivan")
	HaveSpell(CLERIC_MAGIC_STONE)
THEN
	RESPONSE #100
		Spell("Kivan",CLERIC_MAGIC_STONE)
END

IF
	Global("Kivanfight","GLOBAL",1)
	See("Kivan")
	HaveSpell(CLERIC_CALL_LIGHTNING)
THEN
	RESPONSE #100
		Spell("Kivan",CLERIC_CALL_LIGHTNING)
END

IF
	Global("Kivanfight","GLOBAL",1)
	See("Kivan")
THEN
	RESPONSE #100
		Attack("Kivan")
END


