IF
   NumberOfTimesTalkedTo(0)
   Range([PC],12)
THEN
   RESPONSE #100
      StartDialogNoSet([PC])
END

IF
   OR(5)
      See(NearestEnemyOfType([GOODCUTOFF]))
      See(NearestEnemyOfType([GOODCUTOFF.0.0.CLERIC_ALL]))
      See(NearestEnemyOfType([GOODCUTOFF.0.0.MAGE_ALL]))
      See(NearestEnemyOfType([GOODCUTOFF.0.0.SORCERER]))
      See(NearestEnemyOfType([GOODCUTOFF.0.0.FIGHTER_ALL]))
   False()
THEN
   RESPONSE #100
END

IF
   !GlobalTimerNotExpired("BobCastAttack","LOCALS")
   HPPercentLT(Myself,10)
   HaveSpell(CLERIC_HEAL)
THEN
   RESPONSE #100
      SetGlobalTimer("BobCastAttack","LOCALS",6)
      Spell(Myself,CLERIC_HEAL)
END

IF
   !GlobalTimerNotExpired("BobCastAttack","LOCALS")
   HPPercentLT(Myself,20)
   HaveSpell(CLERIC_CURE_CRITICAL_WOUNDS)
THEN
   RESPONSE #100
      SetGlobalTimer("BobCastAttack","LOCALS",6)
      Spell(Myself,CLERIC_CURE_CRITICAL_WOUNDS)
END

IF
   !GlobalTimerNotExpired("BobCastAttack","LOCALS")
   HPPercentLT(Myself,75)
   HasItem("POTN08",Myself)
THEN
   RESPONSE #100
      SetGlobalTimer("BobCastAttack","LOCALS",6)
      UseItem("POTN08",Myself)
END

IF
   See(LastSeenBy(Myself))
   Range(LastSeenBy(Myself),4)
   HPPercentLT(Myself,20)
THEN
   RESPONSE #100
      RunAwayFrom(LastSeenBy(Myself),5)
END

IF
   !GlobalTimerNotExpired("BobCastAttack","LOCALS")
   See(LastSeenBy(Myself))
   HaveSpell(CLERIC_IRONSKIN)
THEN
   RESPONSE #100
      SetGlobalTimer("BobCastAttack","LOCALS",6)
      Spell(Myself,CLERIC_IRONSKIN)
END

IF
   !GlobalTimerNotExpired("BobCastAttack","LOCALS")
   See(LastSeenBy(Myself))
   HaveSpell(CLERIC_REGENERATE)
THEN
   RESPONSE #100
      SetGlobalTimer("BobCastAttack","LOCALS",6)
      Spell(Myself,CLERIC_REGENERATE)
END

IF
   !GlobalTimerNotExpired("BobCastAttack","LOCALS")
   See(LastSeenBy(Myself))
   Range(LastSeenBy(Myself),10)
   HaveSpell(CLERIC_DRAW_UPON_HOLY_MIGHT)
   !StateCheck(Myself,STATE_DRAWUPONHOLYMIGHT)
THEN
   RESPONSE #100
      SetGlobalTimer("BobCastAttack","LOCALS",6)
      Spell(Myself,CLERIC_DRAW_UPON_HOLY_MIGHT)
END

IF
   !GlobalTimerNotExpired("BobCastAttack","LOCALS")
   See(LastSeenBy(Myself))
   Range(LastSeenBy(Myself),5)
   HaveSpell(CLERIC_SLAY_LIVING)
   !HasBounceEffects(LastSeenBy(Myself))
   HPGT(LastSeenBy(Myself),20)
THEN
   RESPONSE #100
      SetGlobalTimer("BobCastAttack","LOCALS",6)
      Spell(LastSeenBy(Myself),CLERIC_SLAY_LIVING)
      AttackOneRound(LastSeenBy(Myself))
END

IF
   !GlobalTimerNotExpired("BobCastAttack","LOCALS")
   See(LastSeenBy(Myself))
   HaveSpell(CLERIC_FLAME_STRIKE)
   !HasBounceEffects(LastSeenBy(Myself))
THEN
   RESPONSE #100
      SetGlobalTimer("BobCastAttack","LOCALS",6)
      Spell(LastSeenBy(Myself),CLERIC_FLAME_STRIKE)
END

IF
   !GlobalTimerNotExpired("BobCastAttack","LOCALS")
   Detect(LastHitter(Myself))
   !See(LastSeenBy(Myself))
   HaveSpell(CLERIC_TRUE_SIGHT)
THEN
   RESPONSE #100
      SetGlobalTimer("BobCastAttack","LOCALS",6)
      Spell(Myself,CLERIC_TRUE_SIGHT)
END

IF
   !GlobalTimerNotExpired("BobCastAttack","LOCALS")
   See(LastSeenBy(Myself))
   HaveSpell(CLERIC_ANIMATE_DEAD)
THEN
   RESPONSE #100
      SetGlobalTimer("BobCastAttack","LOCALS",6)
      Spell(LastSeenBy(Myself),CLERIC_ANIMATE_DEAD)
END

IF
   !GlobalTimerNotExpired("BobCastAttack","LOCALS")
   See(LastSeenBy(Myself))
   HaveSpell(CLERIC_CONJURE_ANIMALS)
THEN
   RESPONSE #100
      SetGlobalTimer("BobCastAttack","LOCALS",6)
      Spell(LastSeenBy(Myself),CLERIC_CONJURE_ANIMALS)
END

IF
   See(LastSeenBy(Myself))
THEN
   RESPONSE #100
      EquipMostDamagingMelee()
      AttackReevaluate(LastSeenBy(Myself),15)
END
