IF
Dead("O#Xan")
!InPartyAllowDead("O#Xan")
GlobalLT("Chapter","GLOBAL",8)
Global("O#XanRomanceActive","GLOBAL",2)
!Global("O#XanMoonbladeExtinguished","GLOBAL",3)
Global("O#XanBackFromTheDead","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("O#XanBackFromTheDead","GLOBAL",1)
SetGlobal("O#XanRomanceActive","GLOBAL",3)
END

IF
GlobalGT("O#XanRicarQuest","GLOBAL",10)
Dead("O#DrowF")
OR(7)
AreaCheck("AR0020")
AreaCheck("AR0300")
AreaCheck("AR0400")
AreaCheck("AR0500")
AreaCheck("AR0700")
AreaCheck("AR0900")
AreaCheck("AR1000")
Global("O#XanRicarQRevenge","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("O#XanRicarQRevenge","GLOBAL",1)
RealSetGlobalTimer("O#XanRicarQRevengeTimer","GLOBAL",200)
END

IF
Global("O#XanRicarQRevenge","GLOBAL",1)
RealGlobalTimerExpired("O#XanRicarQRevengeTimer","GLOBAL")
OR(7)
AreaCheck("AR0020")
AreaCheck("AR0300")
AreaCheck("AR0400")
AreaCheck("AR0500")
AreaCheck("AR0700")
AreaCheck("AR0900")
AreaCheck("AR1000")
THEN
RESPONSE #100
SetGlobal("O#XanRicarQRevenge","GLOBAL",2)
ClearAllActions()
StartCutSceneMode()
StartCutScene("O#Cut2g")
END

IF
Global("O#XanQuest4","GLOBAL",6)
PartyRested()
AreaType(OUTDOOR)
OR(3)
Global("Chapter","GLOBAL",2)
Global("Chapter","GLOBAL",3)
Global("Chapter","GLOBAL",6)
THEN
RESPONSE #100
CreateCreatureObjectOffset("O#Hiel",Player1,[30.25]) 
CreateCreatureObjectOffset("O#Aegnor",Player1,[40.70]) 
CreateCreatureObjectOffset("O#Verell",Player1,[15.65]) 
CreateCreatureObjectOffset("O#Naiz",Player1,[65.35])
SetGlobal("O#XanQuest4","GLOBAL",7)
ActionOverride("O#Hiel",StartDialogueNoSet(Player1))
END