IF
InParty("O#Xan")
Global("O#XanSieneAppeared","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("O#XanSieneAppeared","GLOBAL",1)
CreateCreature("O#Siene",[2050.1630],3)
Continue()
END

IF
InParty("O#Xan")
Global("O#XanEncounterToB3","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("O#XanEncounterToB3","GLOBAL",1)
RealSetGlobalTimer("O#XanRicarToBTimer2","GLOBAL",50)
Continue()
END

IF
InParty("O#Xan")
Global("O#XanEncounterToB3","GLOBAL",1)
RealGlobalTimerExpired("O#XanRicarToBTimer2","GLOBAL")
OR(2)
Global("O#XanBondedPathAlive","GLOBAL",2)
RealGlobalTimerExpired("O#XanToBRicarTimer","GLOBAL")
CombatCounter(0)
THEN
RESPONSE #100
SetGlobal("O#XanEncounterToB3","GLOBAL",2)
CreateCreatureObjectOffset("O#Ricar",Player1,[100.100]) 
ActionOverride("O#Ricar",Dialogue(Player1))
END

IF
Global("O#XanSieneAppeared","GLOBAL",9)
Global("O#XanXanexchanged","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("O#XanXanexchanged","GLOBAL",1)
RealSetGlobalTimer("O#XanMercenaryRTimer","GLOBAL",30)
END

IF
RealGlobalTimerExpired("O#XanMercenaryRTimer","GLOBAL")
Global("O#XanXanexchanged","GLOBAL",1)
!StateCheck(Player1,CD_STATE_NOTVALID) 
CombatCounter(0)
THEN
RESPONSE #100
SetGlobal("O#XanXanexchanged","GLOBAL",2)
CreateCreatureObjectOffset("O#Merc",Player1,[100.100]) 
ActionOverride("O#Merc",Dialogue(Player1))
END

IF
GlobalTimerExpired("O#XanexchangedEscapedTimer","GLOBAL")
Global("O#XanexchangedEscaped","GLOBAL",1)
!StateCheck(Player1,CD_STATE_NOTVALID) 
CombatCounter(0)
THEN
RESPONSE #100
SetGlobal("O#XanexchangedEscaped","GLOBAL",2)
MoveGlobalObjectOffScreen("O#Xan",Player1)
ActionOverride("O#Xan",Dialogue(Player1))
END

IF
Global("O#XanToBFirstPartDone","GLOBAL",4)
THEN
RESPONSE #100
SetGlobal("O#XanToBFirstPartDone","GLOBAL",5)
CreateCreature("O#Vel",[420.2602],0)
CreateCreature("O#Khalid",[376.2604],0)
CreateCreature("O#Merc",[370.2542],0)
CreateCreature("O#Merc1",[410.2552],0)
CreateCreature("O#Merc2",[450.2542],0)
END