IF
  Global("tartarsee","GLOBAL",0)
  See([PC])
  Range([PC],25)
THEN
  RESPONSE #100
    StartDialogNoSet([PC])
    SetGlobal("tartarsee","GLOBAL",1)
END

IF
  Global("preptime","LOCALS",0)
  See(NearestEnemyOf(Myself))
  Range(NearestEnemyOf(Myself),20)
THEN
  RESPONSE #100
    ApplySpell(Myself,WIZARD_ABSOLUTE_IMMUNITY)
    ForceSpell(NearestEnemyOf(Myself),WIZARD_ENERGY_DRAIN)
    ForceSpell(SecondNearestEnemyOf(Myself),WIZARD_ENERGY_DRAIN)
    ForceSpell(NearestEnemyOf(Myself),2326)//WIZARD_DISPEL_MAGIC)
    SetGlobalTimer("poisoner","GLOBAL",20)
    SetGlobalTimer("fearme","GLOBAL",14)
    SetGlobalTimer("prismatic","GLOBAL",30)
    SetGlobal("preptime","LOCALS",1)
END

IF
  Global("tartardeath","GLOBAL",0)
  HPLT(Myself,50)
THEN
  RESPONSE #100
    ReallyForceSpell(Myself,CLERIC_CURE_CRITICAL_WOUNDS)
    ReallyForceSpell(Myself,WIZARD_STONE_SKIN)
    ReallyForceSpell(Myself,WIZARD_SUN_FIRE)
    SetGlobal("tartardeath","GLOBAL",1)
END

IF
  Global("fear","LOCALS",0)
  GlobalTimerExpired("fearme","GLOBAL")
THEN
  RESPONSE #100
    ForceSpell(NearestEnemyOf(Myself),WIZARD_NPC_SYMBOL_FEAR)
    ForceSpell(SecondNearestEnemyOf(Myself),WIZARD_NPC_SYMBOL_FEAR)
    SetGlobal("fear","LOCALS",1)
END

IF
  Global("prison","LOCALS",0)
  GlobalTimerExpired("poisoner","GLOBAL")
THEN
  RESPONSE #100
    ReallyForceSpell(NearestEnemyOf(Myself),CLERIC_POISON)
    ReallyForceSpell(SecondNearestEnemyOf(Myself),CLERIC_POISON)
    ReallyForceSpell(ThirdNearestEnemyOf(Myself),CLERIC_POISON)
    SetGlobal("prison","LOCALS",1)
END

IF
  Global("sphere","LOCALS",0)
  GlobalTimerExpired("prismatic","GLOBAL")
  Range(NearestEnemyOf(Myself),6)
THEN
  RESPONSE #100
    ReallyForceSpell(NearestEnemyOf(Myself),WIZARD_PRISMATIC_SPRAY)
    SetGlobalTimer("prismatic2","GLOBAL",12)
    SetGlobal("sphere","LOCALS",1)
END

IF
  Global("sphere2","GLOBAL",0)
  GlobalTimerExpired("prismatic2","GLOBAL")
THEN
  RESPONSE #100
    ReallyForceSpell(NearestEnemyOf(Myself),WIZARD_PRISMATIC_SPRAY)
    ReallyForceSpell(Myself,WIZARD_SUN_FIRE)
    SetGlobal("sphere2","GLOBAL",1)
END

IF
  See(NearestEnemyOf(Myself))
  Range(NearestEnemyOf(Myself),15)
THEN
  RESPONSE #100
    Attack(NearestEnemyOf(Myself))
END

IF
  AttackedBy([GOODCUTOFF],DEFAULT)
THEN
  RESPONSE #100
    MoveToObject(NearestEnemyOf(Myself))
END

IF
  Global("tartarsee","GLOBAL",1)
  !Range(NearestEnemyOf(Myself),15)
THEN
  RESPONSE #100
    MoveToObject(NearestEnemyOf(Myself))
END

