IF
    InParty(Myself)
    Global("HexxatRomanceActive","GLOBAL",2)
    OR(2)
        Global("DornRomanceActive","GLOBAL",1)
        Global("DornRomanceActive","GLOBAL",2)
THEN
    RESPONSE #100
        SetGlobal("DornRomanceActive","GLOBAL",3)
END

IF
    InParty(Myself)
    Global("HexxatRomanceActive","GLOBAL",2)
    OR(2)
        Global("RasaadRomanceActive","GLOBAL",1)
        Global("RasaadRomanceActive","GLOBAL",2)
THEN
    RESPONSE #100
        SetGlobal("RasaadRomanceActive","GLOBAL",3)
END

IF
    InParty(Myself)
    Global("HexxatRomanceActive","GLOBAL",2)
    OR(2)
        Global("AnomenRomanceActive","GLOBAL",1)
        Global("AnomenRomanceActive","GLOBAL",2)
THEN
    RESPONSE #100
        SetGlobal("AnomenRomanceActive","GLOBAL",3)
END

IF
    InParty(Myself)
    Global("ohh_hexxatjoined","LOCALS",0)
THEN
    RESPONSE #100
        SetGlobal("ohh_hexxatjoined","LOCALS",1)
END

IF
    HasItemEquiped("ohhexam0",Myself)  // Hexxat's Amulet
THEN
    RESPONSE #100
        TransformItem("ohhexam0","ohhexam1")  // Hexxat's Amulet
END

IF
    HasItemEquiped("ohhexam4",Myself)  // Hexxat's Amulet
    Global("OHH_RESTORE_HEXXAT","GLOBAL",1)
    InParty(Myself)
THEN
    RESPONSE #100
        ActionOverride(Player1,TransformItem("ohhcask2","ohhcask"))  // Hexxat's Coffin
        ActionOverride(Player2,TransformItem("ohhcask2","ohhcask"))  // Hexxat's Coffin
        ActionOverride(Player3,TransformItem("ohhcask2","ohhcask"))  // Hexxat's Coffin
        ActionOverride(Player4,TransformItem("ohhcask2","ohhcask"))  // Hexxat's Coffin
        ActionOverride(Player5,TransformItem("ohhcask2","ohhcask"))  // Hexxat's Coffin
        ActionOverride(Player6,TransformItem("ohhcask2","ohhcask"))  // Hexxat's Coffin
        TransformItem("ohhexam4","ohhexam1")  // Hexxat's Amulet
        CreateVisualEffectObject("SPDISPMA",Myself)
        PlaySound("mstchng")
        SetGlobal("OHH_RESTORE_HEXXAT","GLOBAL",0)
        JoinParty()
END

IF
    HasItemEquiped("ohhexam4",Myself)  // Hexxat's Amulet
    !Global("OHH_RESTORE_HEXXAT","GLOBAL",1)
    Range([PC],3)
    !Global("OHH_mazzyfight","GLOBAL",1)
    !Global("OHH_valygarfight","GLOBAL",1)
    !Global("OHH_keldornfight","GLOBAL",1)
    InParty(Myself)
THEN
    RESPONSE #100
        ActionOverride(Player1,TransformItem("ohhcask","ohhcask2"))  // Empty Casket
        ActionOverride(Player2,TransformItem("ohhcask","ohhcask2"))  // Empty Casket
        ActionOverride(Player3,TransformItem("ohhcask","ohhcask2"))  // Empty Casket
        ActionOverride(Player4,TransformItem("ohhcask","ohhcask2"))  // Empty Casket
        ActionOverride(Player5,TransformItem("ohhcask","ohhcask2"))  // Empty Casket
        ActionOverride(Player6,TransformItem("ohhcask","ohhcask2"))  // Empty Casket
        SetGlobalTimer("OHH_RESTORE","GLOBAL",ONE_HOUR)
        Kill(Myself)
END

IF
    OR(2)
        HP(Myself,1)
        StateCheck(Myself,STATE_REALLY_DEAD)
    HasItemEquiped("ohhexam1",Myself)  // Hexxat's Amulet
THEN
    RESPONSE #100
        TransformItem("ohhexam1","ohhexam4")  // Hexxat's Amulet
        DropInventory()
END

IF
    OR(2)
        HP(Myself,1)
        StateCheck(Myself,STATE_REALLY_DEAD)
    HasItemEquiped("ohhexam2",Myself)  // Hexxat's Amulet
THEN
    RESPONSE #100
        TransformItem("ohhexam2","ohhexam4")  // Hexxat's Amulet
        DropInventory()
END

IF
    Delay(3)
    OR(3)
        HP(Myself,1)
        StateCheck(Myself,STATE_REALLY_DEAD)
        !GlobalTimerExpired("OHH_IT_BURNS","LOCALS")
    HasItemEquiped("ohhexam3",Myself)  // Hexxat's Amulet
THEN
    RESPONSE #100
        CreateVisualEffectObject("spsetsh",Myself)
        PlaySound("EFF_M108")
        SmallWait(2)
        VerbalConstant(Myself,HURT)
        Continue()
END

IF
    OR(3)
        HP(Myself,1)
        StateCheck(Myself,STATE_REALLY_DEAD)
        GlobalTimerExpired("OHH_IT_BURNS","LOCALS")
    HasItemEquiped("ohhexam3",Myself)  // Hexxat's Amulet
THEN
    RESPONSE #100
        TransformItem("ohhexam3","ohhexam4")  // Hexxat's Amulet
END

IF
    HasItemEquiped("ohhexam1",Myself)  // Hexxat's Amulet
    HasItemEquiped("ohhcloak",Myself)  // Cloak of Dragomir
THEN
    RESPONSE #100
        TransformItem("ohhexam1","ohhexam2")  // Hexxat's Amulet
END

IF
    HasItemEquiped("ohhexam3",Myself)  // Hexxat's Amulet
    HasItemEquiped("ohhcloak",Myself)  // Cloak of Dragomir
    !AreaCheck("oh5500")  // Dorn - Lunia
THEN
    RESPONSE #100
        TransformItem("ohhexam3","ohhexam2")  // Hexxat's Amulet
END

IF
    HasItemEquiped("ohhexam2",Myself)  // Hexxat's Amulet
    !HasItemEquiped("ohhcloak",Myself)  // Cloak of Dragomir
THEN
    RESPONSE #100
        TransformItem("ohhexam2","ohhexam1")  // Hexxat's Amulet
END

IF
    HasItemEquiped("ohhexam1",Myself)  // Hexxat's Amulet
    !HasItemEquiped("ohhcloak",Myself)  // Cloak of Dragomir
    AreaType(OUTDOOR)
    !AreaCheck("ar1404")  // Shadow Temple Land shadowed
    TimeGT(DAWN_START)
    TimeLT(DUSK_END)
THEN
    RESPONSE #100
        SetGlobalTimer("OHH_IT_BURNS","LOCALS",THREE_ROUNDS)
        TransformItem("ohhexam1","ohhexam3")  // Hexxat's Amulet
        CreateVisualEffectObject("SPSMKJET",Myself)
END

IF
    HasItemEquiped("ohhexam4",Myself)  // Hexxat's Amulet
    !Global("OHH_RESTORE_HEXXAT","GLOBAL",1)
    GlobalTimerNotExpired("OHH_RESTORE","GLOBAL")
THEN
    RESPONSE #100
        DisplayStringHead(Player1,98353)  // The spell fizzles and Hexxat reverts to her mist form. It appears you will have to wait for her to regenerate in her casket.
        Continue()
END

IF
    HasItemEquiped("ohhexam4",Myself)  // Hexxat's Amulet
    !Global("OHH_RESTORE_HEXXAT","GLOBAL",1)
    !Range(Player1,3)
    !Global("OHH_mazzyfight","GLOBAL",1)
    !Global("OHH_valygarfight","GLOBAL",1)
    !Global("OHH_keldornfight","GLOBAL",1)
    InParty(Myself)
THEN
    RESPONSE #100
        MoveToObjectNoInterrupt(Player1)
END

IF
    HasItemEquiped("ohhexam4",Myself)  // Hexxat's Amulet
    OR(3)
        Global("OHH_mazzyfight","GLOBAL",1)
        Global("OHH_valygarfight","GLOBAL",1)
        Global("OHH_keldornfight","GLOBAL",1)
    !InParty(Myself)
THEN
    RESPONSE #100
        SetGlobal("OHH_hexxatfightdead","GLOBAL",1)
        ActionOverride(Player1,DestroyItem("ohhbag"))  // Dragomir's Respite
        ActionOverride(Player2,DestroyItem("ohhbag"))  // Dragomir's Respite
        ActionOverride(Player3,DestroyItem("ohhbag"))  // Dragomir's Respite
        ActionOverride(Player4,DestroyItem("ohhbag"))  // Dragomir's Respite
        ActionOverride(Player5,DestroyItem("ohhbag"))  // Dragomir's Respite
        ActionOverride(Player6,DestroyItem("ohhbag"))  // Dragomir's Respite
        EscapeAreaDestroy(3)
END

IF
    Global("ohh_dom","LOCALS",0)
    LevelGT(Myself,13)
THEN
    RESPONSE #100
        AddSpecialAbility("spin883")  // Domination
        SetGlobal("ohh_dom","LOCALS",1)
END

IF
    Global("ohh_dom","LOCALS",1)
    LevelGT(Myself,23)
THEN
    RESPONSE #100
        AddSpecialAbility("spin883")  // Domination
        SetGlobal("ohh_dom","LOCALS",2)
END

IF
    HasItemEquiped("ohhexam1",Myself)  // Hexxat's Amulet
    AreaCheck("oh5500")  // Dorn - Lunia
THEN
    RESPONSE #100
        SetGlobalTimer("OHH_IT_BURNS","LOCALS",THREE_ROUNDS)
        TransformItem("ohhexam1","ohhexam3")  // Hexxat's Amulet
        CreateVisualEffectObject("SPSMKJET",Myself)
END

IF
    HasItemEquiped("ohhexam2",Myself)  // Hexxat's Amulet
    AreaCheck("oh5500")  // Dorn - Lunia
THEN
    RESPONSE #100
        TransformItem("ohhexam2","ohhexam5")  // Hexxat's Amulet
END

IF
    HasItemEquiped("ohhexam3",Myself)  // Hexxat's Amulet
    HasItemEquiped("ohhcloak",Myself)  // Cloak of Dragomir
    AreaCheck("oh5500")  // Dorn - Lunia
THEN
    RESPONSE #100
        TransformItem("ohhexam3","ohhexam5")  // Hexxat's Amulet
END

IF
    HasItemEquiped("ohhexam5",Myself)  // Hexxat's Amulet
    !HasItemEquiped("ohhcloak",Myself)  // Cloak of Dragomir
    AreaCheck("oh5500")  // Dorn - Lunia
THEN
    RESPONSE #100
        SetGlobalTimer("OHH_IT_BURNS","LOCALS",THREE_ROUNDS)
        TransformItem("ohhexam5","ohhexam3")  // Hexxat's Amulet
        CreateVisualEffectObject("SPSMKJET",Myself)
END

IF
    HasItemEquiped("ohhexam5",Myself)  // Hexxat's Amulet
    !AreaCheck("oh5500")  // Dorn - Lunia
THEN
    RESPONSE #100
        TransformItem("ohhexam5","ohhexam1")  // Hexxat's Amulet
END

IF
    HasItem("ohhbag",Myself)  // Dragomir's Respite
THEN
    RESPONSE #100
        GiveItem("ohhbag",Player1)  // Dragomir's Respite
        DisplayStringHead(Myself,81936)  // I need you to hold on to this for me.
END

IF
    InParty(Myself)
    Global("OHH_QUEST1_EXPERIENCE","LOCALS",0)
THEN
    RESPONSE #100
        SetGlobal("OHH_QUEST1_EXPERIENCE","LOCALS",1)
        AddexperienceParty(10000)
END

IF
    Global("OHH_hexxat","OH7000",2)  // Hexxat - Top Left Quarter (Dragomir)
    Range([PC],15)
    See([PC])
THEN
    RESPONSE #100
        StartDialogueNoSet(Player1)
END

IF
    Global("OHH_hexmove","OH7000",1)  // Hexxat - Top Left Quarter (Dragomir)
THEN
    RESPONSE #100
        MoveToPointNoInterrupt([2198.1534])
        SetGlobal("OHH_hexmove","OH7000",2)  // Hexxat - Top Left Quarter (Dragomir)
END

IF
    !PartyHasItem("ohhcloak")  // Cloak of Dragomir
    Global("OHH_pickup","LOCALS",0)
    Global("OHH_hexmove","OH7000",2)  // Hexxat - Top Left Quarter (Dragomir)
    !InParty("hexxat")  // Hexxat
THEN
    RESPONSE #100
        PickUpItem("ohhcloak")  // Cloak of Dragomir
        SetGlobal("OHH_contactedL","GLOBAL",1)
        SetGlobal("OHH_pickup","LOCALS",1)
        RealSetGlobalTimer("OHH_hexxatcoronettimer","GLOBAL",FOUR_HOURS)
        EscapeAreaMove("AR0406",600,1045,SW)  // Copper Coronet
END

IF
    !HasItem("ohhcloak",Myself)  // Cloak of Dragomir
    PartyHasItem("ohhcloak")  // Cloak of Dragomir
    Global("OHH_hexmove","OH7000",2)  // Hexxat - Top Left Quarter (Dragomir)
    Global("OHH_cloakmissing","OH7000",0)  // Hexxat - Top Left Quarter (Dragomir)
    !InParty(Myself)
THEN
    RESPONSE #100
        SetGlobal("OHH_cloakmissing","OH7000",1)  // Hexxat - Top Left Quarter (Dragomir)
END

IF
    Global("OHH_cloakmissing","OH7000",1)  // Hexxat - Top Left Quarter (Dragomir)
    Range([PC],20)
THEN
    RESPONSE #100
        StartDialogueNoSet(LastSeenBy(Myself))
END

IF
    Global("OHH_hexxatleave","OH7000",1)  // Hexxat - Top Left Quarter (Dragomir)
THEN
    RESPONSE #100
        SetGlobal("OHH_hexxatleave","OH7000",1)  // Hexxat - Top Left Quarter (Dragomir)
        SetGlobal("OHH_contactedL","GLOBAL",1)
        RealSetGlobalTimer("OHH_hexxatcoronettimer","GLOBAL",FOUR_HOURS)
        EscapeAreaMove("AR0406",600,1045,SW)  // Copper Coronet
END

IF
    InParty("hexxat")  // Hexxat
    Global("OHH_dragorespite","GLOBAL",0)
THEN
    RESPONSE #100
        SetGlobalTimer("OHH_dragorespitetimer","GLOBAL",THREE_MINUTES)
        SetGlobal("OHH_dragorespite","GLOBAL",1)
END

IF
    InParty("hexxat")  // Hexxat
    !StateCheck("hexxat",CD_STATE_NOTVALID)  // Hexxat
    Global("OHH_dragorespite","GLOBAL",1)
    CombatCounter(0)
    GlobalTimerExpired("OHH_dragorespitetimer","GLOBAL")
THEN
    RESPONSE #100
        SetGlobal("OHH_dragorespite","GLOBAL",2)
END

IF
    InParty("hexxat")  // Hexxat
    !StateCheck("hexxat",CD_STATE_NOTVALID)  // Hexxat
    CombatCounter(0)
    Global("OHH_dragorespite","GLOBAL",2)
    See(Player1)
THEN
    RESPONSE #100
        StartDialogueNoSet(Player1)
END

IF
    !HasItemEquipedReal("ohhcloak",Myself)  // Cloak of Dragomir
    HasItem("ohhcloak",Myself)  // Cloak of Dragomir
    Global("ohh_initial_cloak","LOCALS",0)
    InParty(Myself)
THEN
    RESPONSE #100
        FillSlot(SLOT_CLOAK)
        SetGlobal("ohh_initial_cloak","LOCALS",1)
END

IF
    InParty(Myself)
    AreaCheck("OH7000")  // Hexxat - Top Left Quarter (Dragomir)
    Global("OHH_happening","GLOBAL",0)
THEN
    RESPONSE #100
        SetGlobal("OHH_happening","GLOBAL",1)
        SetGlobalTimer("OHH_happening_timer","GLOBAL",ONE_DAY)
END

IF
    CombatCounter(0)
    IfValidForPartyDialog(Myself)
    Global("OHH_happening","GLOBAL",1)
    GlobalTimerExpired("OHH_happening_timer","GLOBAL")
THEN
    RESPONSE #100
        SetGlobal("OHH_happening","GLOBAL",2)
END

IF
    CombatCounter(0)
    IfValidForPartyDialog(Myself)
    Global("OHH_happening","GLOBAL",2)
THEN
    RESPONSE #100
        Dialogue(Player1)
END

IF
    Global("OHH_cabrina","GLOBAL",0)
    InParty(Myself)
THEN
    RESPONSE #100
        SetGlobal("OHH_cabrina","GLOBAL",1)
        SetGlobalTimer("OHH_cabrinatimer","GLOBAL",SEVEN_DAYS)
END

IF
    Global("OHH_cabrina","GLOBAL",1)
    GlobalTimerExpired("OHH_cabrinatimer","GLOBAL")
    InParty("hexxat")  // Hexxat
    CombatCounter(0)
    !StateCheck("hexxat",CD_STATE_NOTVALID)  // Hexxat
    OR(2)
        TimeGT(DUSK_START)
        TimeLT(DAWN_START)
    OR(7)
        AreaCheck("ar0020")  // City Gates
        AreaCheck("ar0300")  // The Docks
        AreaCheck("ar0400")  // Slums
        AreaCheck("ar0500")  // Bridge District
        AreaCheck("ar0700")  // Waukeen's Promenade
        AreaCheck("ar0900")  // Temple District
        AreaCheck("ar1000")  // Government District
THEN
    RESPONSE #100
        SetGlobal("OHH_cabrina","GLOBAL",2)
        CreateCreatureObjectOffset("ohhcabri",Player1,[15.15])  // Cabrina
END

IF
    InParty("hexxat")  // Hexxat
    IfValidForPartyDialog("hexxat")  // Hexxat
    CombatCounter(0)
    Global("OHH_cabrina","GLOBAL",3)
    OR(2)
        !GlobalTimerNotExpired("OHH_shouremindertimer","GLOBAL")
        Global("OHH_shoureminder","GLOBAL",3)
    OR(2)
        Global("OHH_shoureminder","GLOBAL",2)
        Global("OHH_shoureminder","GLOBAL",3)
    AreaCheck("ar0800")  // Graveyard
THEN
    RESPONSE #100
        StartDialogueNoSet(Player1)
END

IF
    InParty("hexxat")  // Hexxat
    IfValidForPartyDialog("hexxat")  // Hexxat
    CombatCounter(0)
    Global("OHH_cabrina","GLOBAL",7)
    OR(2)
        Global("OHH_alqadimreminder","GLOBAL",3)
        !GlobalTimerNotExpired("OHH_alqadimremindertimer","GLOBAL")
    OR(2)
        Global("OHH_alqadimreminder","GLOBAL",3)
        Global("OHH_alqadimreminder","GLOBAL",2)
    AreaCheck("ar0800")  // Graveyard
THEN
    RESPONSE #100
        StartDialogueNoSet(Player1)
END

IF
    Global("OHH_shoureminder","GLOBAL",1)
    GlobalTimerExpired("OHH_shouremindertimer","GLOBAL")
    InParty(Myself)
    Global("OHH_cabrina","GLOBAL",3)
    !StateCheck(Myself,CD_STATE_NOTVALID)
THEN
    RESPONSE #100
        SetGlobal("OHH_shoureminder","GLOBAL",2)
END

IF
    Dead("umberhulk1")
    Dead("umberhulk2")
    Dead("umberhulk3")
    Dead("umberhulk4")
    Dead("ohhgoxxa")  // Goxxa the Alhoon - Alhoon
    Dead("ohhmind1")
    Dead("ohhmind2")
    InParty("hexxat")  // Hexxat
    !StateCheck("hexxat",CD_STATE_NOTVALID)  // Hexxat
    CombatCounter(0)
    Global("OHH_postscholarfight","OH7100",0)  // Hexxat - Bottom Left Quarter (Shou Lung)
THEN
    RESPONSE #100
        EraseJournalEntry(84971)  // Hexxat's request The leader of the ghost monks, Keno, will allow me to move freely through the crypt—if I help him thwart the mind flayers who currently run rampant in the tomb's Crypt of Scholars.
        AddJournalEntry(85120,QUEST)  // Hexxat's request With the mind flayers eliminated, I am now able to travel freely through Nan Kung Chi's tomb. For Hexxat to be able to open a necrotic portal for us back to Amn, we must first acquire the scepter known as the Claw of the Black Leopard.
        SetGlobal("OHH_postscholarfight","OH7100",1)  // Hexxat - Bottom Left Quarter (Shou Lung)
        ActionOverride("OHHKENO",MoveToObject("hexxat"))  // Hexxat
        ActionOverride("OHHGM01",MoveToObject("hexxat"))  // Hexxat
        ActionOverride("OHHGM02",MoveToObject("hexxat"))  // Hexxat
        ActionOverride("OHHGM03",MoveToObject("hexxat"))  // Hexxat
        Wait(2)
END

IF
    InParty("hexxat")  // Hexxat
    !StateCheck("hexxat",CD_STATE_NOTVALID)  // Hexxat
    CombatCounter(0)
    Global("OHH_postscholarfight","OH7100",1)  // Hexxat - Bottom Left Quarter (Shou Lung)
    OR(2)
        See("ohhkeno")  // Keno
        Dead("ohhkeno")  // Keno
THEN
    RESPONSE #100
        StartDialogueNoSet(Player1)
END

IF
    Global("OHH_kichichallenge","OH7100",3)  // Hexxat - Bottom Left Quarter (Shou Lung)
    Global("OHH_kichicomment","LOCALS",0)
    InParty(Myself)
    !StateCheck(Myself,CD_STATE_NOTVALID)
THEN
    RESPONSE #100
        SetGlobal("OHH_kichicomment","LOCALS",1)
END

IF
    Global("OHH_kichicomment","LOCALS",1)
    InParty(Myself)
    !StateCheck(Myself,CD_STATE_NOTVALID)
THEN
    RESPONSE #100
        Dialogue(Player1)
END

IF
    PartyHasItem("ohhclaw")  // The Claw of the Black Leopard
    Global("OHH_QUEST2_EXPERIENCE","LOCALS",0)
THEN
    RESPONSE #100
        SetGlobal("OHH_QUEST2_EXPERIENCE","LOCALS",1)
        AddexperienceParty(15000)
END

IF
    Dead("ohhkung")  // Nan Kung Chi
    PartyHasItem("ohhclaw")  // The Claw of the Black Leopard
    CombatCounter(0)
    InParty(Myself)
    !StateCheck(Myself,CD_STATE_NOTVALID)
    Global("OHH_kungdead","OH7100",0)  // Hexxat - Bottom Left Quarter (Shou Lung)
THEN
    RESPONSE #100
        SetGlobal("OHH_kungdead","OH7100",1)  // Hexxat - Bottom Left Quarter (Shou Lung)
        EraseJournalEntry(85120)  // Hexxat's request With the mind flayers eliminated, I am now able to travel freely through Nan Kung Chi's tomb. For Hexxat to be able to open a necrotic portal for us back to Amn, we must first acquire the scepter known as the Claw of the Black Leopard.
        EraseJournalEntry(83513)  // Hexxat's request A locked door lies 'twixt me and the Claw of the Black Leopard. A ghost called Ki Chin Sang claims he will supply the key if I survive a challenge. To initiate the challenge, I must open one of the sarcophagi in the hall outside.
        EraseJournalEntry(85169)  // Hexxat's request One way or the other, I must acquire the key to Nan Kung Chi's burial chamber. Otherwise, the Claw of the Black Leopard will remain ever out of reach.
        AddJournalEntry(103116,QUEST)  // Hexxat's Request Now that the Claw of the Black Leopard is in our possession, Hexxat is anxious to return to Athkatla. There, she will rendezvous with a representative of her mysterious employer, L.
END

IF
    CombatCounter(0)
    InParty(Myself)
    !StateCheck(Myself,CD_STATE_NOTVALID)
    Global("OHH_kungdead","OH7100",1)  // Hexxat - Bottom Left Quarter (Shou Lung)
THEN
    RESPONSE #100
        Dialogue(Player1)
END

IF
    Global("OHH_kungdead","OH7100",2)  // Hexxat - Bottom Left Quarter (Shou Lung)
    Global("OHH_kungdead_JOURNAL","LOCALS",0)
    OR(2)
        Global("HexxatRomanceActive","GLOBAL",1)
        Global("HexxatRomanceActive","GLOBAL",2)
THEN
    RESPONSE #100
        SetGlobal("OHH_kungdead_JOURNAL","LOCALS",1)
        AddJournalEntry(85170,INFO)  // After defeating Nan Kung Chi and his mummies, Hexxat and I took a moment to talk about her past. Against my better judgment, I find myself drawn to her. 
END

IF
    Global("OHH_kungdead","OH7100",2)  // Hexxat - Bottom Left Quarter (Shou Lung)
    Global("OHH_kungdead_JOURNAL","LOCALS",0)
    OR(2)
        Global("HexxatRomanceActive","GLOBAL",0)
        Global("HexxatRomanceActive","GLOBAL",3)
THEN
    RESPONSE #100
        SetGlobal("OHH_kungdead_JOURNAL","LOCALS",1)
        AddJournalEntry(85171,INFO)  // After using her skills to obtain the Claw of the Black Leopard, Hexxat and I took a moment to talk about her past. Hers was not an easy life... but then, whose was? 
END

IF
    OR(5)
        Global("OHH_leaving","LOCALS",1)
        Global("OHH_leaving","LOCALS",2)
        Global("OHH_leaving","LOCALS",3)
        Global("OHH_leaving","LOCALS",4)
        Global("OHH_leaving","LOCALS",5)
    AreaCheck("OH7100")  // Hexxat - Bottom Left Quarter (Shou Lung)
    InParty(Myself)
    GlobalTimerExpired("OHH_leavingtimer","LOCALS")
THEN
    RESPONSE #100
        Dialogue(Player1)
END

IF
    Global("OHH_cabrina","GLOBAL",4)
    InParty(Myself)
    PartyHasItem("ohhclaw")  // The Claw of the Black Leopard
THEN
    RESPONSE #100
        SetGlobal("OHH_cabrina","GLOBAL",5)
        SetGlobalTimer("OHH_cabrinatimer","GLOBAL",SEVEN_DAYS)
END

IF
    Global("OHH_cabrina","GLOBAL",5)
    GlobalTimerExpired("OHH_cabrinatimer","GLOBAL")
    InParty("hexxat")  // Hexxat
    !StateCheck("hexxat",CD_STATE_NOTVALID)  // Hexxat
    OR(2)
        TimeGT(DUSK_START)
        TimeLT(DAWN_START)
    OR(7)
        AreaCheck("ar0020")  // City Gates
        AreaCheck("ar0300")  // The Docks
        AreaCheck("ar0400")  // Slums
        AreaCheck("ar0500")  // Bridge District
        AreaCheck("ar0700")  // Waukeen's Promenade
        AreaCheck("ar0900")  // Temple District
        AreaCheck("ar1000")  // Government District
THEN
    RESPONSE #100
        SetGlobal("OHH_cabrina","GLOBAL",6)
        CreateCreatureObjectOffset("ohhcabri",Player1,[15.15])  // Cabrina
END

IF
    Global("OHH_cabrina","GLOBAL",7)
    Global("OHH_alqadi_JOURNAL","LOCALS",0)
    OR(2)
        Global("HexxatRomanceActive","GLOBAL",1)
        Global("HexxatRomanceActive","GLOBAL",2)
THEN
    RESPONSE #100
        SetGlobal("OHH_alqadi_JOURNAL","LOCALS",1)
        AddJournalEntry(85173,INFO)  // Hexxat's received another assignment from L—to retrieve an item called the Shroud of the Unproved from a tomb in Zakhara. I've no problem with that, which is more than I can say with Cabrina herself. Her interactions with Hexxat are... not entirely of a professional nature.
END

IF
    Global("OHH_cabrina","GLOBAL",7)
    Global("OHH_alqadi_JOURNAL","LOCALS",0)
    OR(2)
        Global("HexxatRomanceActive","GLOBAL",0)
        Global("HexxatRomanceActive","GLOBAL",3)
THEN
    RESPONSE #100
        SetGlobal("OHH_alqadi_JOURNAL","LOCALS",1)
        AddJournalEntry(85174,INFO)  // Hexxat's received another assignment from L—to retrieve an item called the Shroud of the Unproved from a tomb in Zakhara.
END

IF
    Global("OHH_alqadimreminder","GLOBAL",1)
    GlobalTimerExpired("OHH_alqadimremindertimer","GLOBAL")
    Global("OHH_cabrina","GLOBAL",7)
    InParty(Myself)
    !StateCheck(Myself,CD_STATE_NOTVALID)
THEN
    RESPONSE #100
        SetGlobal("OHH_alqadimreminder","GLOBAL",2)
END

IF
    Global("OHH_alqadimreminder","GLOBAL",2)
    Global("OHH_cabrina","GLOBAL",7)
    InParty(Myself)
    !StateCheck(Myself,CD_STATE_NOTVALID)
THEN
    RESPONSE #100
        Dialogue(Player1)
END

IF
    Global("OHH_provetheunproved","OH7200",1)  // Hexxat - Bottom Right Quarter (Zakhara)
    InParty(Myself)
    !StateCheck("hexxat",CD_STATE_NOTVALID)  // Hexxat
THEN
    RESPONSE #100
        Dialogue(Player1)
END

IF
    Dead("ohhraffi")  // Raffiyah
    Global("OHH_RAFFIDEAD","LOCALS",0)
THEN
    RESPONSE #100
        SetGlobal("OHH_RAFFIDEAD","LOCALS",1)
        AddJournalEntry(85189,INFO)  // Raffiyah, killer of the Unproved and his mother Badiat, has been transformed into a giant spider who stands guard over her victim. Killing her was a mercy, I think.
END

IF
    PartyHasItem("ohhshrou")  // Shroud of the Unproved
    Global("OHH_shroud","OH7200",0)  // Hexxat - Bottom Right Quarter (Zakhara)
THEN
    RESPONSE #100
        SetGlobal("OHH_shroud","OH7200",1)  // Hexxat - Bottom Right Quarter (Zakhara)
        AddXPObject(Player1,22000)
        AddXPObject(Player2,22000)
        AddXPObject(Player3,22000)
        AddXPObject(Player4,22000)
        AddXPObject(Player5,22000)
        AddXPObject(Player6,22000)
        Continue()
END

IF
    Global("OHH_shroud","OH7200",1)  // Hexxat - Bottom Right Quarter (Zakhara)
    CombatCounter(0)
    InParty(Myself)
    AreaCheck("OH7200")  // Hexxat - Bottom Right Quarter (Zakhara)
THEN
    RESPONSE #100
        Dialogue(Player1)
END

IF
    OR(6)
        Global("OHH_shroud","OH7200",1)  // Hexxat - Bottom Right Quarter (Zakhara)
        Global("OHH_shroud","OH7200",2)  // Hexxat - Bottom Right Quarter (Zakhara)
        Global("OHH_shroud","OH7200",3)  // Hexxat - Bottom Right Quarter (Zakhara)
        Global("OHH_shroud","OH7200",4)  // Hexxat - Bottom Right Quarter (Zakhara)
        Global("OHH_shroud","OH7200",5)  // Hexxat - Bottom Right Quarter (Zakhara)
        Global("OHH_shroud","OH7200",6)  // Hexxat - Bottom Right Quarter (Zakhara)
    RealGlobalTimerExpired("OHH_leavingtimer","LOCALS")
    InParty(Myself)
    AreaCheck("OH7200")  // Hexxat - Bottom Right Quarter (Zakhara)
THEN
    RESPONSE #100
        Dialogue(Player1)
END

IF
    InParty(Myself)
    PartyHasItem("ohhshrou")  // Shroud of the Unproved
    !AreaCheck("OH7200")  // Hexxat - Bottom Right Quarter (Zakhara)
    !StateCheck(Myself,CD_STATE_NOTVALID)
    Global("OHH_unprovedreturn","GLOBAL",0)
THEN
    RESPONSE #100
        SetGlobal("OHH_unprovedreturn","GLOBAL",1)
END

IF
    InParty(Myself)
    !StateCheck(Myself,CD_STATE_NOTVALID)
    Global("OHH_unprovedreturn","GLOBAL",1)
THEN
    RESPONSE #100
        StartDialogueNoSet(Player1)
END

IF
    Global("OHH_cabrina","GLOBAL",10)
    !See("ohhcabri")  // Cabrina
    InParty(Myself)
    !StateCheck(Myself,CD_STATE_NOTVALID)
THEN
    RESPONSE #100
        Dialogue(Player1)
END

IF
    InParty(Myself)
    Global("OHH_hexxatromancecheck","LOCALS",0)
    Gender(Player1,FEMALE)
THEN
    RESPONSE #100
        SetInterrupt(FALSE)
        RealSetGlobalTimer("HexxatLovetalksTimer","GLOBAL",EIGHTEEN_HOURS)
        SetGlobal("HexxatRomanceActive","GLOBAL",1)
        SetGlobal("HexxatLovetalks","GLOBAL",1)
        SetGlobal("OHH_hexxatromancecheck","LOCALS",1)
        SetInterrupt(TRUE)
END

IF
    OR(2)
        Global("HexxatRomanceActive","GLOBAL",1)
        Global("HexxatRomanceActive","GLOBAL",2)
    IfValidForPartyDialog(Player1)
    IfValidForPartyDialog(Myself)
    CombatCounter(0)
    !See([ENEMY])
    !AreaType(DUNGEON)
    !Global("chapter","GLOBAL",5)
    OR(11)
        Global("HexxatLovetalks","GLOBAL",2)
        Global("HexxatLovetalks","GLOBAL",4)
        Global("HexxatLovetalks","GLOBAL",6)
        Global("HexxatLovetalks","GLOBAL",8)
        Global("HexxatLovetalks","GLOBAL",10)
        Global("HexxatLovetalks","GLOBAL",12)
        Global("HexxatLovetalks","GLOBAL",14)
        Global("HexxatLovetalks","GLOBAL",16)
        Global("HexxatLovetalks","GLOBAL",18)
        Global("HexxatLovetalks","GLOBAL",20)
        Global("HexxatLovetalks","GLOBAL",22)
THEN
    RESPONSE #100
        PlaySong(90)
        Dialogue(Player1)
END

IF
    OR(2)
        Global("HexxatRomanceActive","GLOBAL",1)
        Global("HexxatRomanceActive","GLOBAL",2)
    IfValidForPartyDialog(Player1)
    IfValidForPartyDialog(Myself)
    CombatCounter(0)
    !See([ENEMY])
    !AreaType(DUNGEON)
    !Global("chapter","GLOBAL",5)
    RealGlobalTimerExpired("HexxatLovetalksTimer","GLOBAL")
    OR(8)
        Global("HexxatLovetalks","GLOBAL",1)
        Global("HexxatLovetalks","GLOBAL",5)
        Global("HexxatLovetalks","GLOBAL",7)
        Global("HexxatLovetalks","GLOBAL",9)
        Global("HexxatLovetalks","GLOBAL",13)
        Global("HexxatLovetalks","GLOBAL",15)
        Global("HexxatLovetalks","GLOBAL",19)
        Global("HexxatLovetalks","GLOBAL",21)
THEN
    RESPONSE #100
        IncrementGlobal("HexxatLovetalks","GLOBAL",1)
END

IF
    OR(2)
        Global("HexxatRomanceActive","GLOBAL",1)
        Global("HexxatRomanceActive","GLOBAL",2)
    IfValidForPartyDialog(Player1)
    IfValidForPartyDialog(Myself)
    CombatCounter(0)
    !See([ENEMY])
    !AreaType(DUNGEON)
    AreaType(OUTDOOR)
    !Global("chapter","GLOBAL",5)
    Global("HexxatLovetalks","GLOBAL",3)
    RealGlobalTimerExpired("HexxatLovetalksTimer","GLOBAL")
    OR(3)
        TimeOfDay(DAY)
        TimeOfDay(DUSK)
        TimeOfDay(MORNING)
THEN
    RESPONSE #100
        IncrementGlobal("HexxatLovetalks","GLOBAL",1)
END

IF
    OR(2)
        Global("HexxatRomanceActive","GLOBAL",1)
        Global("HexxatRomanceActive","GLOBAL",2)
    IfValidForPartyDialog(Player1)
    IfValidForPartyDialog(Myself)
    CombatCounter(0)
    !See([ENEMY])
    !AreaType(DUNGEON)
    !Global("chapter","GLOBAL",5)
    Global("HexxatLovetalks","GLOBAL",11)
    RealGlobalTimerExpired("HexxatLovetalksTimer","GLOBAL")
    OR(9)
        AreaType(FOREST)
        AreaCheck("AR1100")  // Umar Hills
        AreaCheck("AR1200")  // Windspear Hills
        AreaCheck("AR1400")  // Shadow Temple Land (restored, Ranger)
        AreaCheck("AR1700")  // Small Teeth Pass
        AreaCheck("AR1800")  // North Forest
        AreaCheck("AR1900")  // Druid Grove Area
        AreaCheck("AR2500")  // Elven Temple at Underdark Exit
        AreaCheck("AR2600")  // Thetyr Wood
THEN
    RESPONSE #100
        IncrementGlobal("HexxatLovetalks","GLOBAL",1)
END

IF
    Global("HexxatRomanceActive","GLOBAL",2)
    InParty(Myself)
    !Global("chapter","GLOBAL",5)
    Global("HexxatLovetalks","GLOBAL",17)
    OR(2)
        Global("ohh_daybreak","LOCALS",0)
        Global("ohh_daybreak","LOCALS",3)
    RealGlobalTimerExpired("HexxatLovetalksTimer","GLOBAL")
    TimeOfDay(NIGHT)
THEN
    RESPONSE #100
        SetGlobal("ohh_daybreak","LOCALS",1)
        SetGlobalTimer("ohh_daybreaktimer","LOCALS",ONE_HOUR)
END

IF
    OR(2)
        Global("HexxatRomanceActive","GLOBAL",1)
        Global("HexxatRomanceActive","GLOBAL",2)
    IfValidForPartyDialog(Player1)
    IfValidForPartyDialog(Myself)
    CombatCounter(0)
    !See([ENEMY])
    !AreaType(DUNGEON)
    !Global("chapter","GLOBAL",5)
    Global("ohh_daybreak","LOCALS",1)
    !GlobalTimerExpired("ohh_daybreaktimer","GLOBAL")
    TimeOfDay(MORNING)
THEN
    RESPONSE #100
        SetGlobal("ohh_daybreak","LOCALS",2)
        IncrementGlobal("HexxatLovetalks","GLOBAL",1)
END

IF
    Global("HexxatRomanceActive","GLOBAL",2)
    InParty(Myself)
    !Global("chapter","GLOBAL",5)
    Global("HexxatLovetalks","GLOBAL",18)
    Global("ohh_daybreak","LOCALS",1)
    GlobalTimerExpired("ohh_daybreaktimer","GLOBAL")
THEN
    RESPONSE #100
        SetGlobal("ohh_daybreak","LOCALS",3)
END

IF
    OR(2)
        Global("HexxatRomanceActive","GLOBAL",1)
        Global("HexxatRomanceActive","GLOBAL",2)
    IfValidForPartyDialog(Player1)
    IfValidForPartyDialog(Myself)
    Global("OHH_BodhiDeadTalk","GLOBAL",0)
    Dead("c6bodhi")  // Bodhi
THEN
    RESPONSE #100
        SetGlobal("OHH_BodhiDeadTalk","GLOBAL",1)
        RealSetGlobalTimer("OHH_BodhiDeadTalkTimer","GLOBAL",THREE_HOURS)
END

IF
    OR(2)
        Global("HexxatRomanceActive","GLOBAL",1)
        Global("HexxatRomanceActive","GLOBAL",2)
    IfValidForPartyDialog(Player1)
    IfValidForPartyDialog(Myself)
    CombatCounter(0)
    !See([ENEMY])
    !AreaType(DUNGEON)
    Global("OHH_BodhiDeadTalk","GLOBAL",1)
    RealGlobalTimerExpired("OHH_BodhiDeadTalkTimer","GLOBAL")
THEN
    RESPONSE #100
        IncrementGlobal("OHH_BodhiDeadTalk","GLOBAL",1)
END

IF
    OR(2)
        Global("HexxatRomanceActive","GLOBAL",1)
        Global("HexxatRomanceActive","GLOBAL",2)
    IfValidForPartyDialog(Player1)
    IfValidForPartyDialog(Myself)
    CombatCounter(0)
    !See([ENEMY])
    !AreaType(DUNGEON)
    Global("OHH_BodhiDeadTalk","GLOBAL",2)
THEN
    RESPONSE #100
        PlaySong(90)
        Dialogue(Player1)
END

IF
    OR(2)
        Global("HexxatRomanceActive","GLOBAL",1)
        Global("HexxatRomanceActive","GLOBAL",2)
    IfValidForPartyDialog(Player1)
    IfValidForPartyDialog(Myself)
    Global("OHH_HexxatMotherTalk","GLOBAL",0)
    Global("OHH_mother","OH7100",2)  // Hexxat - Bottom Left Quarter (Shou Lung)
THEN
    RESPONSE #100
        SetGlobal("OHH_HexxatMotherTalk","GLOBAL",1)
        RealSetGlobalTimer("OHH_HexxatMotherTalkTimer","GLOBAL",NINE_HOURS)
END

IF
    OR(2)
        Global("HexxatRomanceActive","GLOBAL",1)
        Global("HexxatRomanceActive","GLOBAL",2)
    IfValidForPartyDialog(Player1)
    IfValidForPartyDialog(Myself)
    CombatCounter(0)
    !See([ENEMY])
    !AreaType(DUNGEON)
    !Global("chapter","GLOBAL",5)
    Global("OHH_HexxatMotherTalk","GLOBAL",1)
    RealGlobalTimerExpired("OHH_HexxatMotherTalkTimer","GLOBAL")
THEN
    RESPONSE #100
        IncrementGlobal("OHH_HexxatMotherTalk","GLOBAL",1)
END

IF
    OR(2)
        Global("HexxatRomanceActive","GLOBAL",1)
        Global("HexxatRomanceActive","GLOBAL",2)
    IfValidForPartyDialog(Player1)
    IfValidForPartyDialog(Myself)
    CombatCounter(0)
    !See([ENEMY])
    !AreaType(DUNGEON)
    !Global("chapter","GLOBAL",5)
    Global("OHH_HexxatMotherTalk","GLOBAL",2)
THEN
    RESPONSE #100
        PlaySong(90)
        Dialogue(Player1)
END

IF
    IfValidForPartyDialog("hexxat")  // Hexxat
    IfValidForPartyDialog("Anomen")  // Anomen
    OR(2)
        Global("HexxatRomanceActive","GLOBAL",1)
        Global("HexxatRomanceActive","GLOBAL",2)
    GlobalGT("HexxatLovetalks","GLOBAL",9)
    OR(2)
        Global("AnomenRomanceActive","GLOBAL",1)
        Global("AnomenRomanceActive","GLOBAL",2)
    Global("OHH_anomenconflict","GLOBAL",0)
THEN
    RESPONSE #100
        SetGlobal("OHH_anomenconflict","GLOBAL",1)
        RealSetGlobalTimer("OHH_anomenconflict_timer","GLOBAL",NINE_HOURS)
        Continue()
END

IF
    IfValidForPartyDialog("hexxat")  // Hexxat
    IfValidForPartyDialog("Anomen")  // Anomen
    OR(2)
        Global("HexxatRomanceActive","GLOBAL",1)
        Global("HexxatRomanceActive","GLOBAL",2)
    OR(2)
        Global("AnomenRomanceActive","GLOBAL",1)
        Global("AnomenRomanceActive","GLOBAL",2)
    Global("OHH_anomenconflict","GLOBAL",1)
    RealGlobalTimerExpired("OHH_anomenconflict_timer","GLOBAL")
THEN
    RESPONSE #100
        SetGlobal("OHH_anomenconflict","GLOBAL",2)
        Continue()
END

IF
    IfValidForPartyDialog("hexxat")  // Hexxat
    IfValidForPartyDialog("Anomen")  // Anomen
    CombatCounter(0)
    !AreaType(DUNGEON)
    !See([ENEMY])
    Global("OHH_anomenconflict","GLOBAL",2)
THEN
    RESPONSE #100
        ActionOverride("anomen",Dialogue("hexxat"))  // Hexxat
END

IF
    IfValidForPartyDialog("hexxat")  // Hexxat
    IfValidForPartyDialog("dorn")  // Dorn
    OR(2)
        Global("HexxatRomanceActive","GLOBAL",1)
        Global("HexxatRomanceActive","GLOBAL",2)
    GlobalGT("HexxatLovetalks","GLOBAL",9)
    OR(2)
        Global("DornRomanceActive","GLOBAL",1)
        Global("DornRomanceActive","GLOBAL",2)
    GlobalGT("DornLovetalks","GLOBAL",9)
    Global("OHH_dornconflict","GLOBAL",0)
THEN
    RESPONSE #100
        SetGlobal("OHH_dornconflict","GLOBAL",1)
        RealSetGlobalTimer("OHH_dornconflict_timer","GLOBAL",NINE_HOURS)
        Continue()
END

IF
    IfValidForPartyDialog("hexxat")  // Hexxat
    IfValidForPartyDialog("dorn")  // Dorn
    OR(2)
        Global("HexxatRomanceActive","GLOBAL",1)
        Global("HexxatRomanceActive","GLOBAL",2)
    OR(2)
        Global("DornRomanceActive","GLOBAL",1)
        Global("DornRomanceActive","GLOBAL",2)
    Global("OHH_dornconflict","GLOBAL",1)
    RealGlobalTimerExpired("OHH_dornconflict_timer","GLOBAL")
THEN
    RESPONSE #100
        SetGlobal("OHH_dornconflict","GLOBAL",2)
        Continue()
END

IF
    IfValidForPartyDialog("hexxat")  // Hexxat
    IfValidForPartyDialog("dorn")  // Dorn
    CombatCounter(0)
    !AreaType(DUNGEON)
    !See([ENEMY])
    Global("OHH_dornconflict","GLOBAL",2)
THEN
    RESPONSE #100
        ActionOverride("dorn",Dialogue("hexxat"))  // Hexxat
END

IF
    IfValidForPartyDialog("hexxat")  // Hexxat
    IfValidForPartyDialog("Rasaad")  // Rasaad
    OR(2)
        Global("HexxatRomanceActive","GLOBAL",1)
        Global("HexxatRomanceActive","GLOBAL",2)
    GlobalGT("hexxatLovetalks","GLOBAL",9)
    OR(2)
        Global("RasaadRomanceActive","GLOBAL",1)
        Global("RasaadRomanceActive","GLOBAL",2)
    Global("OHH_rasaadconflict","GLOBAL",0)
THEN
    RESPONSE #100
        SetGlobal("OHH_rasaadconflict","GLOBAL",1)
        RealSetGlobalTimer("OHH_rasaadconflict_timer","GLOBAL",NINE_HOURS)
        Continue()
END

IF
    IfValidForPartyDialog("hexxat")  // Hexxat
    IfValidForPartyDialog("Rasaad")  // Rasaad
    OR(2)
        Global("HexxatRomanceActive","GLOBAL",1)
        Global("HexxatRomanceActive","GLOBAL",2)
    OR(2)
        Global("RasaadRomanceActive","GLOBAL",1)
        Global("RasaadRomanceActive","GLOBAL",2)
    Global("OHH_rasaadconflict","GLOBAL",1)
    RealGlobalTimerExpired("OHH_rasaadconflict_timer","GLOBAL")
THEN
    RESPONSE #100
        SetGlobal("OHH_rasaadconflict","GLOBAL",2)
        Continue()
END

IF
    IfValidForPartyDialog("hexxat")  // Hexxat
    IfValidForPartyDialog("Rasaad")  // Rasaad
    CombatCounter(0)
    !AreaType(DUNGEON)
    !See([ENEMY])
    Global("OHH_rasaadconflict","GLOBAL",2)
THEN
    RESPONSE #100
        ActionOverride("rasaad",Dialogue(Player1))
END

IF
    InParty(Myself)
    Global("OHH_mazzyfight","GLOBAL",1)
THEN
    RESPONSE #100
        SetInterrupt(FALSE)
        LeaveParty()
        SetLeavePartyDialogFile()
        ChangeAIScript("",DEFAULT)
        ChangeAIScript("useitem",GENERAL)
        ChangeAIScript("ohhmaz2",SPECIFICS)
        ActionOverride("mazzy",LeaveParty())
        ActionOverride("mazzy",SetLeavePartyDialogFile())
        ActionOverride("mazzy",ChangeAIScript("",DEFAULT))
        ActionOverride("mazzy",ChangeAIScript("useitem",GENERAL))
        ActionOverride("mazzy",ChangeAIScript("ohhmaz",SPECIFICS))
        SetInterrupt(TRUE)
END

IF
    InParty(Myself)
    Global("OHH_valygarfight","GLOBAL",1)
THEN
    RESPONSE #100
        SetInterrupt(FALSE)
        LeaveParty()
        SetLeavePartyDialogFile()
        ChangeAIScript("",DEFAULT)
        ChangeAIScript("useitem",GENERAL)
        ChangeAIScript("ohhval2",SPECIFICS)
        ActionOverride("valygar",LeaveParty())
        ActionOverride("valygar",SetLeavePartyDialogFile())
        ActionOverride("valygar",ChangeAIScript("",DEFAULT))
        ActionOverride("valygar",ChangeAIScript("useitem",GENERAL))
        ActionOverride("valygar",ChangeAIScript("ohhval",SPECIFICS))
        SetInterrupt(TRUE)
END

IF
    InParty(Myself)
    Global("OHH_keldornfight","GLOBAL",1)
THEN
    RESPONSE #100
        SetInterrupt(FALSE)
        LeaveParty()
        SetLeavePartyDialogFile()
        ChangeAIScript("",DEFAULT)
        ChangeAIScript("useitem",GENERAL)
        ChangeAIScript("ohhkeld2",SPECIFICS)
        ActionOverride("keldorn",LeaveParty())
        ActionOverride("keldorn",SetLeavePartyDialogFile())
        ActionOverride("keldorn",ChangeAIScript("",DEFAULT))
        ActionOverride("keldorn",ChangeAIScript("useitem",GENERAL))
        ActionOverride("keldorn",ChangeAIScript("ohhkeld",SPECIFICS))
        SetInterrupt(TRUE)
END

IF
    Global("OHH_keldornfight","GLOBAL",2)
    InParty(Myself)
    CombatCounter(0)
THEN
    RESPONSE #100
        StartDialogueNoSet(Player1)
END

IF
    Global("OHH_hexxatleaves","GLOBAL",1)
    InParty(Myself)
THEN
    RESPONSE #100
        LeaveParty()
        SetLeavePartyDialogFile()
        ChangeAIScript("",DEFAULT)
        SetGlobal("OHH_hexxatjoined","LOCALS",0)
        SetGlobal("OHH_hexxatleaves","GLOBAL",0)
        EscapeAreaMove("AR0406",600,1045,SW)  // Copper Coronet
END

IF
    Global("OH_UnderdarkComments","GLOBAL",1)
    IfValidForPartyDialog(Myself)
    Delay(2)
    !IfValidForPartyDialog("dorn")  // Dorn
    !IfValidForPartyDialog("rasaad")  // Rasaad
    !IfValidForPartyDialog("neera")  // Neera
THEN
    RESPONSE #100
        StartDialogueNoSet(Player1)
END

IF
    Global("OH_Tanner","AR0502",1)  // Tanner's Hideout Cellar
    IfValidForPartyDialog(Myself)
    Delay(2)
    !IfValidForPartyDialog("dorn")  // Dorn
    !IfValidForPartyDialog("rasaad")  // Rasaad
    !IfValidForPartyDialog("neera")  // Neera
THEN
    RESPONSE #100
        StartDialogueNoSet(Player1)
END

IF
    Global("OH_Adalon","AR2102",1)  // Adalon's Cave
    IfValidForPartyDialog(Myself)
    !IfValidForPartyDialog("rasaad")  // Rasaad
    !IfValidForPartyDialog("neera")  // Neera
THEN
    RESPONSE #100
        StartDialogueNoSet(Player1)
END

IF
    Global("ohh_cabrina_discuss_line","GLOBAL",1)
    IfValidForPartyDialog(Myself)
THEN
    RESPONSE #100
        Dialogue(Player1)
END

IF
    HasItemEquiped("ohhexam9",Myself)  // Hexxat's Amulet
    !StateCheck(Myself,STATE_REALLY_DEAD)
THEN
    RESPONSE #100
        Kill(Myself)
        LeaveParty()
END

IF
    AreaCheck("oh7000")  // Hexxat - Top Left Quarter (Dragomir)
    Global("OHH_hexxat","OH7000",0)  // Hexxat - Top Left Quarter (Dragomir)
    !StateCheck(Myself,STATE_DISEASED)
THEN
    RESPONSE #100
        Deactivate(Myself)
END

IF
    Global("OH_journal_check_85172","LOCALS",0)
    PartyHasItem("ohhclaw")  // The Claw of the Black Leopard
    !AreaCheck("oh7100")  // Hexxat - Bottom Left Quarter (Shou Lung)
THEN
    RESPONSE #100
        EraseJournalEntry(85172)  // Hexxat's request Now that we've acquired the Claw of the Black Leopard, Hexxat is anxious to return to Amn and rendezvous with her contact, Cabrina.
        SetGlobal("OH_journal_check_85172","LOCALS",1)
END

IF
    Global("BD_JOINXP","LOCALS",0)
    InParty(Myself)
    XPGT(Player1,1249999)
    XPLT(Myself,1250000)
THEN
    RESPONSE #100
        SetInterrupt(FALSE)
        SetGlobal("BD_JOINXP","LOCALS",1)
        ChangeStat(Myself,XP,1250000,SET)
        SetInterrupt(TRUE)
END

IF
    Global("BD_JOINXP","LOCALS",0)
    InParty(Myself)
    XPGT(Player1,999999)
    XPLT(Myself,1000000)
THEN
    RESPONSE #100
        SetInterrupt(FALSE)
        SetGlobal("BD_JOINXP","LOCALS",1)
        ChangeStat(Myself,XP,1000000,SET)
        SetInterrupt(TRUE)
END

IF
    Global("BD_JOINXP","LOCALS",0)
    InParty(Myself)
    XPGT(Player1,749999)
    XPLT(Myself,750000)
THEN
    RESPONSE #100
        SetInterrupt(FALSE)
        SetGlobal("BD_JOINXP","LOCALS",1)
        ChangeStat(Myself,XP,750000,SET)
        SetInterrupt(TRUE)
END

IF
    Global("BD_JOINXP","LOCALS",0)
    InParty(Myself)
    XPGT(Player1,499999)
    XPLT(Myself,500000)
THEN
    RESPONSE #100
        SetInterrupt(FALSE)
        SetGlobal("BD_JOINXP","LOCALS",1)
        ChangeStat(Myself,XP,500000,SET)
        SetInterrupt(TRUE)
END

IF
    Global("BD_JOINXP","LOCALS",0)
    InParty(Myself)
    XPGT(Player1,249999)
    XPLT(Myself,250000)
THEN
    RESPONSE #100
        SetInterrupt(FALSE)
        SetGlobal("BD_JOINXP","LOCALS",1)
        ChangeStat(Myself,XP,250000,SET)
        SetInterrupt(TRUE)
END

IF
    Global("BD_JOINXP","LOCALS",0)
    InParty(Myself)
    XPGT(Player1,124999)
    XPLT(Myself,125000)
THEN
    RESPONSE #100
        SetInterrupt(FALSE)
        SetGlobal("BD_JOINXP","LOCALS",1)
        ChangeStat(Myself,XP,125000,SET)
        SetInterrupt(TRUE)
END

IF
    Global("BD_JOINXP","LOCALS",0)
    InParty(Myself)
    XPLT(Player1,89001)
THEN
    RESPONSE #100
        SetInterrupt(FALSE)
        SetGlobal("BD_JOINXP","LOCALS",1)
        SetInterrupt(TRUE)
END

IF
    !InParty(Myself)
    CheckSpellState(Myself,STORY_MODE)
THEN
    RESPONSE #100
        ReallyForceSpellDeadRES("OHSMODE3",Myself)  // No such index
        Continue()
END

