IF
	HPPercentLT(Myself,40)
	See(NearestEnemyOf(Myself))
THEN
	RESPONSE #100
		Help()
		Continue()
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(CLERIC_DRAW_UPON_HOLY_MIGHT)
	!StateCheck(Myself,STATE_DRAWUPONHOLYMIGHT)
THEN
	RESPONSE #100
		Spell(Myself,CLERIC_DRAW_UPON_HOLY_MIGHT)
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(CLERIC_AURA_OF_PROTECTION)
	NumCreatureGT([ENEMY],6)
	NumInPartyGT(2)
THEN
	RESPONSE #100
		Spell(Myself,CLERIC_AURA_OF_PROTECTION)
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(CLERIC_DEFENSIVE_HARMONY)
	NumCreatureGT([ENEMY],6)
	NumInPartyGT(2)
THEN
	RESPONSE #100
		Spell(Myself,CLERIC_DEFENSIVE_HARMONY)
		Continue()
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(CLERIC_WARD_OF_PROTECTION)
	CheckStatGT(Myself,4,ARMORCLASS)
THEN
	RESPONSE #100
		Spell(Myself,CLERIC_WARD_OF_PROTECTION)
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(CLERIC_STONE_SKIN)
	NumCreatureGT([ENEMY],5)
THEN
	RESPONSE #100
		Spell(Myself,CLERIC_STONE_SKIN)
		Continue()
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(CLERIC_COMMAND)
	!General(NearestEnemyOf(Myself),UNDEAD)
	!Class(LastAttackerOf([ALLY]),BASILISK)
	!Class(LastAttackerOf([ALLY]),BASILISK_GREATER)
	!Race(NearestEnemyOf(Myself),DOPPLEGANGER)
	!Race(NearestEnemyOf(Myself),DEMONIC)
	!Class(LastAttackerOf([ALLY]),SKELETON_WARRIOR)
	!StateCheck(NearestEnemyOf(Myself),STATE_SLEEPING)
	!StateCheck(NearestEnemyOf(Myself),STATE_HELPLESS)
	!StateCheck(NearestEnemyOf(Myself),STATE_STUNNED)
	!StateCheck(NearestEnemyOf(Myself),STATE_CHARMED)
	!StateCheck(NearestEnemyOf(Myself),STATE_SLOWED)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),CLERIC_COMMAND)
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(CLERIC_BLIGHT)
	!StateCheck(NearestEnemyOf(Myself),STATE_SLEEPING)
	!StateCheck(NearestEnemyOf(Myself),STATE_HELPLESS)
	!StateCheck(NearestEnemyOf(Myself),STATE_STUNNED)
	!StateCheck(NearestEnemyOf(Myself),STATE_CHARMED)
	!StateCheck(NearestEnemyOf(Myself),STATE_SLOWED)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),CLERIC_BLIGHT)
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(CLERIC_MAGIC_STONE)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),CLERIC_MAGIC_STONE)
	RESPONSE #100
		Spell(SecondNearestEnemyOf(Myself),CLERIC_MAGIC_STONE)
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(CLERIC_ARMOR_MELT)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),CLERIC_ARMOR_MELT)
	RESPONSE #100
		Spell(SecondNearestEnemyOf(Myself),CLERIC_ARMOR_MELT)
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(CLERIC_CHARM_PERSON)
	!General(NearestEnemyOf(Myself),UNDEAD)
	!Class(LastAttackerOf([ALLY]),BASILISK)
	!Class(LastAttackerOf([ALLY]),BASILISK_GREATER)
	!Race(NearestEnemyOf(Myself),DOPPLEGANGER)
	!Race(NearestEnemyOf(Myself),DEMONIC)
	!Class(LastAttackerOf([ALLY]),SKELETON_WARRIOR)
	!StateCheck(NearestEnemyOf(Myself),STATE_PANIC)
	!StateCheck(NearestEnemyOf(Myself),STATE_FEEBLEMINDED)
	!StateCheck(NearestEnemyOf(Myself),STATE_SLEEPING)
	!StateCheck(NearestEnemyOf(Myself),STATE_HELPLESS)
	!StateCheck(NearestEnemyOf(Myself),STATE_STUNNED)
	!StateCheck(NearestEnemyOf(Myself),STATE_CHARMED)
	!StateCheck(NearestEnemyOf(Myself),STATE_BLIND)
	!StateCheck(NearestEnemyOf(Myself),STATE_SLOWED)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),CLERIC_CHARM_PERSON)
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(CLERIC_HOLD_PERSON)
	!General(NearestEnemyOf(Myself),UNDEAD)
	!General(NearestEnemyOf(Myself),GIANTHUMANOID)
	!General(NearestEnemyOf(Myself),ANIMAL)
	!Class(LastAttackerOf([ALLY]),BASILISK)
	!Class(LastAttackerOf([ALLY]),BASILISK_GREATER)
	!Race(NearestEnemyOf(Myself),DOPPLEGANGER)
	!Race(NearestEnemyOf(Myself),DEMONIC)
	!Class(LastAttackerOf([ALLY]),SKELETON_WARRIOR)
	!StateCheck(NearestEnemyOf(Myself),STATE_PANIC)
	!StateCheck(NearestEnemyOf(Myself),STATE_FEEBLEMINDED)
	!StateCheck(NearestEnemyOf(Myself),STATE_SLEEPING)
	!StateCheck(NearestEnemyOf(Myself),STATE_HELPLESS)
	!StateCheck(NearestEnemyOf(Myself),STATE_STUNNED)
	!StateCheck(NearestEnemyOf(Myself),STATE_CHARMED)
	!StateCheck(NearestEnemyOf(Myself),STATE_BLIND)
	!StateCheck(NearestEnemyOf(Myself),STATE_SLOWED)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),CLERIC_HOLD_PERSON)
END

IF
	Class(LastAttackerOf([ALLY]),MAGE)
	HaveSpell(CLERIC_SILENCE_15_FOOT)
THEN
	RESPONSE #100
		Spell(ThirdNearestEnemyOf(Myself),CLERIC_SILENCE_15_FOOT)
END

IF
	Class(LastAttackerOf([ALLY]),BARD)
	HaveSpell(CLERIC_SILENCE_15_FOOT)
THEN
	RESPONSE #100
		Spell(ThirdNearestEnemyOf(Myself),CLERIC_SILENCE_15_FOOT)
END

IF
	Class(LastAttackerOf([ALLY]),CLERIC_MAGE)
	HaveSpell(CLERIC_SILENCE_15_FOOT)
THEN
	RESPONSE #100
		Spell(ThirdNearestEnemyOf(Myself),CLERIC_SILENCE_15_FOOT)
END

IF
	Class(LastAttackerOf([ALLY]),CLERIC)
	HaveSpell(CLERIC_SILENCE_15_FOOT)
THEN
	RESPONSE #100
		Spell(ThirdNearestEnemyOf(Myself),CLERIC_SILENCE_15_FOOT)
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(CLERIC_HOLD_ANIMAL)
	!StateCheck(NearestEnemyOf(Myself),STATE_CHARMED)
	!StateCheck(NearestEnemyOf(Myself),STATE_HELPLESS)
	!StateCheck(NearestEnemyOf(Myself),STATE_STUNNED)
	General(NearestEnemyOf(Myself),ANIMAL)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),CLERIC_HOLD_ANIMAL)
END

IF
	Class(LastAttackerOf([ALLY]),MAGE)
	HaveSpell(CLERIC_MISCAST_MAGIC)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),CLERIC_MISCAST_MAGIC)
		Continue()
END

IF
	Class(LastAttackerOf([ALLY]),BARD)
	HaveSpell(CLERIC_MISCAST_MAGIC)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),CLERIC_MISCAST_MAGIC)
		Continue()
END

IF
	Class(LastAttackerOf([ALLY]),CLERIC_MAGE)
	HaveSpell(CLERIC_MISCAST_MAGIC)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),CLERIC_MISCAST_MAGIC)
		Continue()
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(CLERIC_RIGID_THINKING)
	!StateCheck(NearestEnemyOf(Myself),STATE_CHARMED)
	!General(NearestEnemyOf(Myself),UNDEAD)
	!Class(LastAttackerOf([ALLY]),BASILISK)
	!Class(LastAttackerOf([ALLY]),BASILISK_GREATER)
	!StateCheck(NearestEnemyOf(Myself),STATE_CONFUSED)
	!StateCheck(NearestEnemyOf(Myself),STATE_SLEEPING)
	!StateCheck(NearestEnemyOf(Myself),STATE_HELPLESS)
	!StateCheck(NearestEnemyOf(Myself),STATE_STUNNED)
	!Race(NearestEnemyOf(Myself),DOPPLEGANGER)
	!Race(NearestEnemyOf(Myself),DEMONIC)
	!StateCheck(NearestEnemyOf(Myself),STATE_PANIC)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),CLERIC_RIGID_THINKING)
END

IF
	See(NearestEnemyOf(Myself))
	NumCreatureGT([ENEMY],6)
	NumCreatureLT([ALLY],7)
	HaveSpell(CLERIC_ANIMAL_SUMMONING_1)
THEN
	RESPONSE #100
		Spell(ThirdNearestEnemyOf(Myself),CLERIC_ANIMAL_SUMMONING_1)
		Continue()
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(CLERIC_MENTAL_DOMINATION)
	!Race(NearestEnemyOf(Myself),DOPPLEGANGER)
	!StateCheck(NearestEnemyOf(Myself),STATE_CHARMED)
	!General(NearestEnemyOf(Myself),UNDEAD)
	!Class(LastAttackerOf([ALLY]),BASILISK)
	!Class(LastAttackerOf([ALLY]),BASILISK_GREATER)
	!StateCheck(NearestEnemyOf(Myself),STATE_CONFUSED)
	!StateCheck(NearestEnemyOf(Myself),STATE_SLEEPING)
	!StateCheck(NearestEnemyOf(Myself),STATE_HELPLESS)
	!StateCheck(NearestEnemyOf(Myself),STATE_STUNNED)
	!StateCheck(NearestEnemyOf(Myself),STATE_PANIC)
	!StateCheck(NearestEnemyOf(Myself),STATE_FEEBLEMINDED)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),CLERIC_MENTAL_DOMINATION)
		Continue()
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(CLERIC_FLAME_STRIKE)
THEN
	RESPONSE #100
		ActionOverride(Myself,Spell(FifthNearestEnemyOf(Myself),0))
END

IF
	See(NearestEnemyOf(Myself))
	NumCreatureGT([ENEMY],7)
	NumCreatureLT([ALLY],6)
	HaveSpell(0)
THEN
	RESPONSE #100
		Spell(ThirdNearestEnemyOf(Myself),0)
		Continue()
END

IF
	See(NearestEnemyOf(Myself))
	Race(GroupOf,WYVERN)
	HaveSpell(CLERIC_AERIAL_SERVANT)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),CLERIC_AERIAL_SERVANT)
END

IF
	See(NearestEnemyOf(Myself))
	Race(GroupOf,LYCANTHROPE)
	HaveSpell(CLERIC_AERIAL_SERVANT)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),CLERIC_AERIAL_SERVANT)
END

IF
	See(NearestEnemyOf(Myself))
	Class(LastAttackerOf([ALLY]),DEATHKNIGHT)
	HaveSpell(CLERIC_AERIAL_SERVANT)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),CLERIC_AERIAL_SERVANT)
END

IF
	See(NearestEnemyOf(Myself))
	Class(LastAttackerOf([ALLY]),TANARI)
	HaveSpell(CLERIC_AERIAL_SERVANT)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),CLERIC_AERIAL_SERVANT)
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(CLERIC_HOLD_MONSTER)
	!StateCheck(NearestEnemyOf(Myself),STATE_SLEEPING)
	!StateCheck(NearestEnemyOf(Myself),STATE_HELPLESS)
	!StateCheck(NearestEnemyOf(Myself),STATE_STUNNED)
	General(NearestEnemyOf(Myself),MONSTER)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),CLERIC_HOLD_MONSTER)
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(CLERIC_CONFUSION)
	HPGT(NearestEnemyOf(Myself),20)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),CLERIC_CONFUSION)
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(3502)
	General(NearestEnemyOf(Myself),UNDEAD)
	!StateCheck(NearestEnemyOf(Myself),STATE_SLEEPING)
	!StateCheck(NearestEnemyOf(Myself),STATE_HELPLESS)
	!StateCheck(NearestEnemyOf(Myself),STATE_STUNNED)
	!StateCheck(NearestEnemyOf(Myself),STATE_CHARMED)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),3502)
		Continue()
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(3503)
	General(NearestEnemyOf(Myself),UNDEAD)
	!StateCheck(NearestEnemyOf(Myself),STATE_SLEEPING)
	!StateCheck(NearestEnemyOf(Myself),STATE_HELPLESS)
	!StateCheck(NearestEnemyOf(Myself),STATE_STUNNED)
	!StateCheck(NearestEnemyOf(Myself),STATE_CHARMED)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),3503)
		Continue()
END

IF
	See(NearestEnemyOf(Myself))
	HaveSpell(3501)
	HPPercentGT(Myself,20)
	HPGT(NearestEnemyOf(Myself),10)
THEN
	RESPONSE #100
		Spell(NearestEnemyOf(Myself),3501)
END

IF
	HaveSpell(CLERIC_ANIMATE_DEAD)
THEN
	RESPONSE #100
		RemoveSpell(CLERIC_ANIMATE_DEAD)
END

IF
	HaveSpell(CLERIC_SHILLELAGH)
THEN
	RESPONSE #100
		RemoveSpell(CLERIC_SHILLELAGH)
END

IF
	HaveSpell(INNATE_SUMMON_GHAST)
THEN
	RESPONSE #100
		RemoveSpell(INNATE_SUMMON_GHAST)
END

IF
	HaveSpell(CLERIC_SPIRITUAL_HAMMER)
THEN
	RESPONSE #100
		RemoveSpell(CLERIC_SPIRITUAL_HAMMER)
END

IF
	HaveSpell(CLERIC_FLAME_BLADE)
THEN
	RESPONSE #100
		RemoveSpell(CLERIC_FLAME_BLADE)
END

IF
	HaveSpell(CLERIC_CURE_DISEASE)
THEN
	RESPONSE #100
		RemoveSpell(CLERIC_CURE_DISEASE)
END

IF
	HaveSpell(CLERIC_CALL_UNDEAD)
THEN
	RESPONSE #100
		RemoveSpell(CLERIC_CALL_UNDEAD)
END

IF
	HaveSpell(CLERIC_ARMOR_OF_DARKNESS)
THEN
	RESPONSE #100
		RemoveSpell(CLERIC_ARMOR_OF_DARKNESS)
END

IF
	HaveSpell(CLERIC_DARK_RITUAL)
THEN
	RESPONSE #100
		RemoveSpell(CLERIC_DARK_RITUAL)
END

IF
	HPPercentLT(Myself,20)
	HaveSpell(CLERIC_HEAL)
THEN
	RESPONSE #100
		RunAwayFrom(LastAttackerOf(Myself),10)
		Spell(Myself,CLERIC_HEAL)
END

IF
	HPPercentLT(Myself,30)
	HaveSpell(CLERIC_CURE_CRITICAL_WOUNDS)
THEN
	RESPONSE #100
		RunAwayFrom(LastAttackerOf(Myself),15)
		Spell(Myself,CLERIC_CURE_CRITICAL_WOUNDS)
END

IF
	HPPercentLT(Myself,35)
	HaveSpell(CLERIC_CURE_SERIOUS_WOUNDS)
THEN
	RESPONSE #100
		RunAwayFrom(LastAttackerOf(Myself),10)
		Spell(Myself,CLERIC_CURE_SERIOUS_WOUNDS)
END

IF
	HPPercentLT(Myself,40)
	HaveSpell(3504)
THEN
	RESPONSE #100
		RunAwayFrom(LastAttackerOf(Myself),10)
		Spell(Myself,3504)
END

IF
	HPPercentLT(Myself,55)
	HaveSpell(INNATE_CURE_LIGHT_WOUNDS)
THEN
	RESPONSE #100
		RunAwayFrom(LastAttackerOf(Myself),10)
		Spell(Myself,INNATE_CURE_LIGHT_WOUNDS)
END

IF
	HPPercentLT(Myself,50)
	HaveSpell(CLERIC_CURE_LIGHT_WOUNDS)
THEN
	RESPONSE #100
		RunAwayFrom(LastAttackerOf(Myself),10)
		Spell(Myself,CLERIC_CURE_LIGHT_WOUNDS)
END

IF
	Heard([PC],2)
	HaveSpell(INNATE_CURE_LIGHT_WOUNDS)
THEN
	RESPONSE #100
		Spell(LastHeardBy(Myself),INNATE_CURE_LIGHT_WOUNDS)
END

IF
	Heard([PC],2)
	HaveSpell(CLERIC_CURE_LIGHT_WOUNDS)
THEN
	RESPONSE #100
		Spell(LastHeardBy(Myself),CLERIC_CURE_LIGHT_WOUNDS)
END

IF
	HPPercentLT(Myself,30)
	HasItem("SCRL56",Myself) // Cure Serious Wounds
THEN
	RESPONSE #100
		RunAwayFrom(LastAttackerOf(Myself),10)
		UseItem("SCRL56",Myself) // Cure Serious Wounds
END

IF
	HPPercentLT(Myself,25)
	HasItem("SCRL61",Myself) // Cure Critical Wounds
THEN
	RESPONSE #100
		RunAwayFrom(LastAttackerOf(Myself),10)
		UseItem("SCRL61",Myself) // Cure Critical Wounds
END

IF
	HPPercentLT(Myself,45)
	HasItem("POTN08",Myself) // Potion of Healing
THEN
	RESPONSE #100
		UseItem("POTN08",Myself) // Potion of Healing
END

IF
	HPPercentLT(Myself,25)
	HasItem("POTN108",Myself) // Greater Potion of Healing
THEN
	RESPONSE #100
		UseItem("POTN108",Myself) // Greater Potion of Healing
END

IF
	HPPercentLT(Myself,50)
	HasItem("POTN17",Myself) // Elixir of Health
THEN
	RESPONSE #100
		UseItem("POTN17",Myself) // Elixir of Health
END

IF
	HPPercentLT(Myself,35)
	HasItem("POTN42",Myself) // Potion of Regeneration 
THEN
	RESPONSE #100
		UseItem("POTN42",Myself) // Potion of Regeneration 
END

IF
	HitBy([ANYONE],POISON)
	HasItem("POTN20",Myself) // Antidote
THEN
	RESPONSE #100
		UseItem("POTN20",Myself) // Antidote
END

IF
	HitBy([ANYONE],POISON)
	HaveSpell(INNATE_SLOW_POISON)
THEN
	RESPONSE #100
		Spell(Myself,INNATE_SLOW_POISON)
END

IF
	HitBy([ANYONE],POISON)
	HaveSpell(CLERIC_NEUTRALIZE_POISON)
THEN
	RESPONSE #100
		Spell(Myself,CLERIC_NEUTRALIZE_POISON)
END

IF
	HitBy([ANYONE],POISON)
	HaveSpell(CLERIC_SLOW_POISON)
THEN
	RESPONSE #100
		Spell(Myself,CLERIC_SLOW_POISON)
END

IF
	HitBy([ANYONE],POISON)
	HasItem("SCRL59",Myself) // Neutralize Poison
THEN
	RESPONSE #100
		UseItem("SCRL59",Myself) // Neutralize Poison
END

IF
	HitBy([ANYONE],POISON)
THEN
	RESPONSE #100
		Shout(1)
		Continue()
END

IF
	Delay(2)
	HPPercentLT(Myself,35)
THEN
	RESPONSE #95
		Shout(2)
		Continue()
	RESPONSE #5
		VerbalConstant(Myself,HURT)
		Shout(2)
		Continue()
END

IF
	HPLT(Player1,1)
	HaveSpell(CLERIC_RAISE_DEAD)
	!See([ENEMY])
THEN
	RESPONSE #100
		Spell(Player1,CLERIC_RAISE_DEAD)
END

IF
	HPLT(Player2,1)
	HaveSpell(CLERIC_RAISE_DEAD)
	!See([ENEMY])
THEN
	RESPONSE #100
		Spell(Player2,CLERIC_RAISE_DEAD)
END

IF
	HPLT(Player3,1)
	HaveSpell(CLERIC_RAISE_DEAD)
	!See([ENEMY])
THEN
	RESPONSE #100
		Spell(Player3,CLERIC_RAISE_DEAD)
END

IF
	HPLT(Player4,1)
	HaveSpell(CLERIC_RAISE_DEAD)
	!See([ENEMY])
THEN
	RESPONSE #100
		Spell(Player4,CLERIC_RAISE_DEAD)
END

IF
	HPLT(Player5,1)
	HaveSpell(CLERIC_RAISE_DEAD)
	!See([ENEMY])
THEN
	RESPONSE #100
		Spell(Player5,CLERIC_RAISE_DEAD)
END

IF
	HPLT(Player6,1)
	HaveSpell(CLERIC_RAISE_DEAD)
	!See([ENEMY])
THEN
	RESPONSE #100
		Spell(Player6,CLERIC_RAISE_DEAD)
END

IF
	HPLT(Player1,1)
	!HaveSpell(CLERIC_RAISE_DEAD)
	HaveSpell(CLERIC_RESSURECTION)
	!See([ENEMY])
THEN
	RESPONSE #100
		Spell(Player1,CLERIC_RESSURECTION)
END

IF
	HPLT(Player2,1)
	!HaveSpell(CLERIC_RAISE_DEAD)
	HaveSpell(CLERIC_RESSURECTION)
	!See([ENEMY])
THEN
	RESPONSE #100
		Spell(Player2,CLERIC_RESSURECTION)
END

IF
	HPLT(Player3,1)
	!HaveSpell(CLERIC_RAISE_DEAD)
	HaveSpell(CLERIC_RESSURECTION)
	!See([ENEMY])
THEN
	RESPONSE #100
		Spell(Player3,CLERIC_RESSURECTION)
END

IF
	HPLT(Player4,1)
	!HaveSpell(CLERIC_RAISE_DEAD)
	HaveSpell(CLERIC_RESSURECTION)
	!See([ENEMY])
THEN
	RESPONSE #100
		Spell(Player4,CLERIC_RESSURECTION)
END

IF
	HPLT(Player5,1)
	!HaveSpell(CLERIC_RAISE_DEAD)
	HaveSpell(CLERIC_RESSURECTION)
	!See([ENEMY])
THEN
	RESPONSE #100
		Spell(Player5,CLERIC_RESSURECTION)
END

IF
	HPLT(Player6,1)
	!HaveSpell(CLERIC_RAISE_DEAD)
	HaveSpell(CLERIC_RESSURECTION)
	!See([ENEMY])
THEN
	RESPONSE #100
		Spell(Player6,CLERIC_RESSURECTION)
END

IF
	AttackedBy([ANYONE],DEFAULT)
	InParty(LastAttackerOf(Myself))
THEN
	RESPONSE #100
		RunAwayFrom(LastAttackerOf(Myself),55)
END

IF
	AttackedBy([ENEMY],DEFAULT)
	Range(LastAttackerOf(Myself),5)
	!StateCheck(LastAttackerOf(Myself),STATE_PANIC)
THEN
	RESPONSE #100
		Shout(3)
		EquipMostDamagingMelee()
		AttackReevaluate(LastAttackerOf(Myself),30)
END

IF
	AttackedBy([ENEMY],DEFAULT)
THEN
	RESPONSE #100
		Shout(3)
		EquipRanged()
		AttackReevaluate(LastAttackerOf(Myself),30)
END

IF
	See(NearestEnemyOf(Myself))
	NumCreatureGT([ENEMY],6)
	HasItem("POTN11",Myself) // Potion of Invulnerability
THEN
	RESPONSE #100
		UseItem("POTN11",Myself) // Potion of Invulnerability
END

IF
	See(NearestEnemyOf(Myself))
	General(NearestEnemyOf(Myself),UNDEAD)
	!HaveSpell(3502)
	!HaveSpell(3503)
	HaveSpell(CLERIC_AID)
	!StateCheck(Myself,STATE_AID)
THEN
	RESPONSE #100
		Spell(Myself,CLERIC_AID)
		Shout(4)
		EquipMostDamagingMelee()
		ActionOverride(Myself,Attack(NearestEnemyOf(Myself)))
END

IF
	See(NearestEnemyOf(Myself))
	!InParty(NearestEnemyOf(Myself))
	Range(NearestEnemyOf(Myself),5)
THEN
	RESPONSE #100
		Shout(4)
		EquipMostDamagingMelee()
		AttackReevaluate(NearestEnemyOf(Myself),30)
END

IF
	Heard([PC],4)
	!InParty(NearestEnemyOf(LastHeardBy(Myself)))
	Range(NearestEnemyOf(LastHeardBy(Myself)),5)
	!StateCheck(NearestEnemyOf(LastHeardBy(Myself)),STATE_PANIC)
	ActionListEmpty()
THEN
	RESPONSE #100
		EquipMostDamagingMelee()
		AttackReevaluate(NearestEnemyOf(LastHeardBy(Myself)),30)
END

IF
	CheckStatLT(Myself,6,LEVEL)
THEN
	RESPONSE #100
		SetGlobal("JetLevelUp","GLOBAL",0)
END

IF
	CheckStat(Myself,6,LEVEL)
	GlobalLT("JetLevelUp","GLOBAL",1)
THEN
	RESPONSE #100
		SetGlobal("JetLevelUp","GLOBAL",1)
		ForceSpell(Myself,3507)
END


