IF
    See(NearestEnemyOf(Myself))
    See(NearestMyGroupOfType)
    Global("prep","LOCALS",0)
THEN
    RESPONSE #100
        ReallyForceSpell(Myself,CLERIC_CHANT)
        ReallyForceSpell(Myself,CLERIC_STRENGTH_OF_ONE)
        SetGlobal("prep","LOCALS",1)
END

IF
    Detect([PC])
    !See(LastSeenBy(Myself))
    HaveSpell(CLERIC_TRUE_SIGHT)
THEN
    RESPONSE #100
        Spell(Myself,CLERIC_TRUE_SIGHT)
END

IF
    See(NearestEnemyOf(Myself))
    HaveSpell(CLERIC_DEFENSIVE_HARMONY)
    !Range(NearestEnemyOf(Myself),7)
THEN
    RESPONSE #100
        Spell(Myself,CLERIC_DEFENSIVE_HARMONY)
END

IF
    See(NearestEnemyOf(Myself))
    See(NearestMyGroupOfType)
    HaveSpell(CLERIC_MASS_CURE)
    HPPercentLT(Myself,80)
    OR(3)
        HPPercentLT(LastSeenBy(Myself),80)
        HPPercentLT(SecondNearestMyGroupOfType,80)
        HPPercentLT(ThirdNearestMyGroupOfType,80)
THEN
    RESPONSE #100
        Spell(LastSeenBy(Myself),CLERIC_MASS_CURE)
END

IF
    See(NearestEnemyOf(Myself))
    See(NearestMyGroupOfType)
    HPPercentLT(LastSeenBy(Myself),60)
    HaveSpell(CLERIC_CURE_SERIOUS_WOUNDS)
THEN
    RESPONSE #100
        Spell(LastSeenBy(Myself),CLERIC_CURE_SERIOUS_WOUNDS)
END

IF
    See(NearestEnemyOf(Myself))
    !Range(LastSeenBy(Myself),4)
    HPPercentLT(Myself,60)
    HaveSpell(CLERIC_CURE_SERIOUS_WOUNDS)
THEN
    RESPONSE #100
        Spell(Myself,CLERIC_CURE_SERIOUS_WOUNDS)
END

IF
    See(NearestEnemyOf(Myself))
    HaveSpell(CLERIC_DRAW_UPON_HOLY_MIGHT)
THEN
    RESPONSE #100
        Spell(Myself,CLERIC_DRAW_UPON_HOLY_MIGHT)
        ApplySpell(Myself,CLERIC_RIGHTEOUS_MAGIC)
        EquipMostDamagingMelee()
        AttackOneRound(NearestEnemyOf(Myself))
END

IF
    !See(NearestEnemyOf(Myself))
    HaveSpell(CLERIC_HOLY_POWER)
THEN
    RESPONSE #100
        Spell(Myself,CLERIC_HOLY_POWER)
END

IF
    See(NearestEnemyOf(Myself))
THEN
    RESPONSE #100
        EquipMostDamagingMelee()
        AttackOneRound(NearestEnemyOf(Myself))
END

IF
    !See([ANYONE])
    HaveSpell(CLERIC_ZONE_OF_SWEET_AIR)
    HPPercentLT(Myself,75)
THEN
    RESPONSE #100
        Spell([ANYONE],0)
END

IF
    !See([ANYONE])
    HaveSpell(CLERIC_ANIMATE_DEAD)
THEN
    RESPONSE #100
        Spell([ANYONE],0)
END

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


