IF
    HPLT(Myself,1)
THEN
    RESPONSE #100
        SetGlobal("Preddead","GLOBAL",1)
END

IF
    !Detect([ANYONE])
THEN
    RESPONSE #70
        NoAction()
    RESPONSE #10
        MoveToPoint([2795.574])
    RESPONSE #10
        MoveToPoint([3857.1892])
    RESPONSE #10
        MoveToPoint([546.2145])
END

IF
    Heard([ANYONE],111)
THEN
    RESPONSE #100
        MoveToObject(NearestEnemyOf(Myself))
END

IF
    !See(NearestEnemyOf(Myself))
    HPPercentLT(Myself,50)
    HasItem("potn52",Myself) // Potion of Extra Healing
THEN
    RESPONSE #100
        DisplayStringHead(Myself,46150) // quaffs a potion
        UseItem("potn52",Myself) // Potion of Extra Healing
        Continue()
END

IF
    See(NearestEnemyOf(Myself))
    !Range(NearestEnemyOf(Myself),7)
THEN
    RESPONSE #100
        ForceSpell(NearestEnemyOf(Myself),EDWINA_IN_HELL)
END

IF
    See(NearestEnemyOf(Myself))
    !StateCheck(Myself,STATE_HASTED)
    HasItem("potn14",Myself) // Oil of Speed
    Range(NearestEnemyOf(Myself),7)
THEN
    RESPONSE #100
        DisplayStringHead(Myself,46150) // quaffs a potion
        UseItem("potn14",Myself) // Oil of Speed
        ForceSpell(NearestEnemyOf(Myself),EDWINA_IN_HELL)
        Continue()
END

IF
    See(NearestEnemyOf(Myself))
    !StateCheck(Myself,STATE_IMPROVEDINVISIBILITY)
    !StateCheck(Myself,STATE_INVISIBLE)
    HasItem("ring05",Myself) // Ring of Invisibility 
    Range(NearestEnemyOf(Myself),7)
THEN
    RESPONSE #30
        AttackOneRound(NearestEnemyOf(Myself))
    RESPONSE #70
        UseItem("ring05",Myself) // Ring of Invisibility 
        Continue()
END

IF
    See(NearestEnemyOf(Myself))
    Range(NearestEnemyOf(Myself),7)
THEN
    RESPONSE #70
        AttackOneRound(NearestEnemyOf(Myself))
    RESPONSE #30
        RunAwayFrom(NearestEnemyOf(Myself),10)
END

IF
    AttackedBy([ANYONE],DEFAULT)
THEN
    RESPONSE #70
        AttackOneRound(NearestEnemyOf(Myself))
    RESPONSE #30
        RunAwayFrom(NearestEnemyOf(Myself),10)
END

IF
    See(NearestEnemyOf(Myself))
    !StateCheck(Myself,STATE_IMPROVEDINVISIBILITY)
    !StateCheck(Myself,STATE_INVISIBLE)
    HasItem("potn10",Myself) // Potion of Invisibility
THEN
    RESPONSE #100
        DisplayStringHead(Myself,46150) // quaffs a potion
        UseItem("potn10",Myself) // Potion of Invisibility
        RunAwayFrom(NearestEnemyOf(Myself),10)
        Continue()
END


