IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("DreamTimerStarted","GLOBAL",0)
THEN
RESPONSE #100
RealSetGlobalTimer("DreamTalk","GLOBAL",180)
SetGlobal("DreamTimerStarted","GLOBAL",1)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("ImPCTimerStarted","GLOBAL",0)
THEN
RESPONSE #100
RealSetGlobalTimer("ImFriendTalkTime","GLOBAL",400)
SetGlobal("ImPCTimerStarted","GLOBAL",1)
END


IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
!StateCheck(Player1,STATE_SLEEPING)
RealGlobalTimerExpired("ImFriendTalkTime","GLOBAL")
See(Player1)
CombatCounter(0)
OR(4)
AreaCheck("AR6600")
AreaCheck("AR6900")
AreaCheck("AR9700")
AreaCheck("AR3200")
OR(2)
Global("ImFriendTalk","GLOBAL",0)
Global("ImFriendTalk","GLOBAL",2)
THEN
RESPONSE #100
IncrementGlobal("ImFriendTalk","GLOBAL",1)
RealSetGlobalTimer("ImFriendlyTalkTime","GLOBAL",10)
Interact(Player1)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
RealGlobalTimerExpired("ImFriendlyTalkTime","GLOBAL")
OR(2)
Global("ImFriendTalk","GLOBAL",1)
Global("ImFriendTalk","GLOBAL",3)
THEN
RESPONSE #100
RealSetGlobalTimer("ImFriendTalkTime","GLOBAL",1800)
IncrementGlobal("ImFriendTalk","GLOBAL",1)
END


IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("ImoenBereg","GLOBAL",0)
Global("IMPC3","LOCALS",0)
AreaCheck("AR6700")
See(Player1)
THEN
RESPONSE #100
SetGlobal("ImoenBereg","GLOBAL",1)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("ImoenBereg","GLOBAL",1)
Global("IMPC3","LOCALS",0)
AreaCheck("AR6700")
See(Player1)
THEN
RESPONSE #100
StartDialogueNoSet(Player1)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("ImoenGift","GLOBAL",0)
Global("IMPC4","LOCALS",0)
AreaCheck("AR7705")
See(Player1)
THEN
RESPONSE #100
SetGlobal("ImoenGift","GLOBAL",1)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("ImoenGift","GLOBAL",1)
Global("IMPC4","LOCALS",0)
AreaCheck("AR7705")
See(Player1)
THEN
RESPONSE #100
StartDialogueNoSet(Player1)
SetGlobal("ImoenGift","GLOBAL",2)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("Chapter","Global",2)
Global("DREAM","Global",2)
Global("IMPC5","LOCALS",0)
PartyRested()
See(Player1)
THEN
RESPONSE #100
SetGlobal("IMDREAM2","GLOBAL",1)
StartDialogueNoSet(Player1)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("Chapter","Global",4)
Global("DREAM","Global",4)
Global("IMPC6","LOCALS",0)
PartyRested()
See(Player1)
THEN
RESPONSE #100
SetGlobal("IMDREAM4","GLOBAL",1)
StartDialogueNoSet(Player1)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("IMPC8","GLOBAL",0)
!Class("imoen2","MAGE_ALL")
Dead("tarnesh")
PartyHasItem("SCRLTAR")
THEN
RESPONSE #100
SetGlobal("IMPC8","GLOBAL",1)
RealSetGlobalTimer("ImTarneshBook","GLOBAL",18000)
StartDialogueNoSet(Player1)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
RealGlobalTimerExpired("ImTarneshBook","GLOBAL")
Global("IMPC7","GLOBAL",1)
Dead("tarnesh")
THEN
RESPONSE #100
SetGlobal("IMPC7","GLOBAL",2)
Interact(Player1)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("ImoenFIRE","GLOBAL",0)
OR(2)
See("cutspy")
See("X#poe")
THEN
RESPONSE #100
SetGlobal("ImoenFIRE","GLOBAL",1)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("ImoenFIRE","GLOBAL",1)
AreaCheck("AR3400")
See(Player1)
THEN
RESPONSE #100
RealSetGlobalTimer("ImFireTimer","GLOBAL",10)
StartDialogueNoSet(Player1)
END

IF
InParty(Myself)
RealGlobalTimerExpired("ImFireTimer","GLOBAL")
Global("ImoenFIRE","GLOBAL",1)
THEN
RESPONSE #100
IncrementGlobal("ImoenFIRE","GLOBAL",1)
END



//Quayle//
IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("QuayleImoenCK","GLOBAL",0)
AreaCheck("AR6509")
InParty("Quayle")
THEN
RESPONSE #100
SetGlobal("QuayleImoenCK","GLOBAL",1)
StartDialogueNoSet("Quayle")
END

//Skie//
IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
InParty("Skie")
Global("IMSK4","GLOBAL",0)
AreaType(CITY)
THEN
RESPONSE #100
SetGlobal("IMSK4","GLOBAL",1)
Interact(Player1)
END

//Pink Xan dialogues

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("PinkTimerStarted","GLOBAL",0)
Global("XanComplain","GLOBAL",1)
THEN
RESPONSE #100
RealSetGlobalTimer("XANBACK","GLOBAL",10)
SetGlobal("PinkTimerStarted","GLOBAL",1)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
RealGlobalTimerExpired("XANBACK","GLOBAL")
InParty("XAN")
See("XAN")
!StateCheck("XAN",STATE_SLEEPING)
OR(2)
Global("XanComplain","GLOBAL",1)
Global("XanComplain","GLOBAL",3)
See(Player1)
THEN
RESPONSE #100
IncrementGlobal("XanComplain","GLOBAL",1)
RealSetGlobalTimer("PinkTalkTime","GLOBAL",10)
Interact(Player1)
END

IF 
InParty(Myself) CombatCounter(0) !See([ENEMY])
RealGlobalTimerExpired("PinkTalkTime","GLOBAL")
Global("XanComplain","GLOBAL",2)
THEN
RESPONSE #100
RealSetGlobalTimer("XANBACK","GLOBAL",3600)
END


