//dream script
IF
InParty(Myself)
Global("DreamTimerStarted","GLOBAL",0)
THEN
RESPONSE #100
RealSetGlobalTimer("DreamTalk","GLOBAL",18)
SetGlobal("DreamTimerStarted","GLOBAL",1)
END

//CoranReturnsBabyNotInRomance

IF 
OR(2)
!Global("CoranRomanceMatch","GLOBAL",1)
!Global("CoranRomancePath","GLOBAL",7)
Global("CoranHasBaby","GLOBAL",1)
OR(2)
GlobalGT("Chapter","GLOBAL",6)
GlobalTimerExpired("ReturnNamara","GLOBAL")
OR(15)      //checking for island areas and Durlag
!AreaCheck("ARU008")
!AreaCheck("ARW000")
!AreaCheck("ARW500")
!AreaCheck("AR7223")
!AreaCheck("ARD006")
!AreaCheck("ARD007")
!AreaCheck("ARD008")
!AreaCheck("ARD009")
!AreaCheck("ARD010")
!AreaCheck("ARD011")
!AreaCheck("ARD012")
!AreaCheck("ARD013")
!AreaCheck("ARD014")
!AreaCheck("ARD015")
!AreaCheck("ARD016")
Global("CNRBabeBack","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("CNRBabeBack","GLOBAL",1)
StartDialogueNoSet(Player1)
END

//CoranLeavesParty
IF
Global("CoranMoves","GLOBAL",4)
THEN
RESPONSE #100
SetGlobal("CoranHasBaby","GLOBAL",2)
TakePartyItem("X#CBABY")
TakePartyItem("X#CBOOK")
TakePartyItem("X#CMILK")
DestroyItem("X#CBABY")
DestroyItem("X#CBOOK")
DestroyItem("X#CMILK")
EscapeAreaMove("AR7203",368,402,2)
END

//AlimonyPayments
IF
Global("CoranHasBaby","GLOBAL",2)
GlobalTimerExpired("Alimony","GLOBAL")
THEN
RESPONSE #100
DisplayStringHead("coran", ~Coran had set aside money for child support~)
TakePartyGold(100)
SetGlobalTimer("Alimony","GLOBAL",604800)
END

//CoranQuestPrompt

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("QuestTimerStarted","GLOBAL",0)
Global("BRIEL_STAY","GLOBAL",1)
THEN
RESPONSE #100
RealSetGlobalTimer("CORAN_ASK_BABY","GLOBAL",3600)
SetGlobal("QuestTimerStarted","GLOBAL",1)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
!AreaCheck("AR7203")
RealGlobalTimerExpired("CORAN_ASK_BABY","GLOBAL")
Global("BRIEL_STAY","GLOBAL",1)
Global("CORAN_BABY","GLOBAL",0)
Alignment("CORAN",CHAOTIC_GOOD)
Global("CoranHasBaby","GLOBAL",0)
See(Player1)
THEN
RESPONSE #100
SetGlobal("CORAN_BABY","GLOBAL",1)
RealSetGlobalTimer("CQuestTalkTime","GLOBAL",10)
StartDialogueNoSet(Player1)
END

IF 
InParty(Myself) CombatCounter(0) !See([ENEMY])
RealGlobalTimerExpired("CQuestTalkTime","GLOBAL")
Global("CORAN_BABY","GLOBAL",1)
THEN
RESPONSE #100
IncrementGlobal("CORAN_BABY","GLOBAL",1)
RealSetGlobalTimer("CFriendTalkTime","GLOBAL",1800)
END

//CoranRepeat

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("RepeatTimerStarted","GLOBAL",0)
Global("BRIEL_STAY","GLOBAL",1)
Global("CoranRepeat","GLOBAL",1)
THEN
RESPONSE #100
RealSetGlobalTimer("COBABY_AGAIN","GLOBAL",3600)
SetGlobal("RepeatTimerStarted","GLOBAL",1)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
OR(15)      //checking for island areas and Durlag
!AreaCheck("ARU008")
!AreaCheck("ARW000")
!AreaCheck("ARW500")
!AreaCheck("AR7223")
!AreaCheck("ARD006")
!AreaCheck("ARD007")
!AreaCheck("ARD008")
!AreaCheck("ARD009")
!AreaCheck("ARD010")
!AreaCheck("ARD011")
!AreaCheck("ARD012")
!AreaCheck("ARD013")
!AreaCheck("ARD014")
!AreaCheck("ARD015")
!AreaCheck("ARD016")
RealGlobalTimerExpired("COBABY_AGAIN","GLOBAL")
Global("BRIEL_STAY","GLOBAL",1)
Global("CBABY_AGAIN","GLOBAL",0)
Alignment("CORAN",CHAOTIC_GOOD)
Global("CoranHasBaby","GLOBAL",0)
See(Player1)
THEN
RESPONSE #100
SetGlobal("CBABY_AGAIN","GLOBAL",1)
RealSetGlobalTimer("CRepeatTalkTime","GLOBAL",10)
StartDialogueNoSet(Player1)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
RealGlobalTimerExpired("CRepeatTalkTime","GLOBAL")
Global("CBABY_AGAIN","GLOBAL",1)
THEN
RESPONSE #100
IncrementGlobal("CBABY_AGAIN","GLOBAL",1)
END

//CoranComplains

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("ComplainTimerStarted","GLOBAL",0)
Global("BRIEL_STAY","GLOBAL",1)
Global("COWillComplain","GLOBAL",1)
THEN
RESPONSE #100
RealSetGlobalTimer("CORAN_COMPLAINS","GLOBAL",14400)
SetGlobal("ComplainTimerStarted","GLOBAL",1)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
OR(15)      //checking for island areas and Durlag
!AreaCheck("ARU008")
!AreaCheck("ARW000")
!AreaCheck("ARW500")
!AreaCheck("AR7223")
!AreaCheck("ARD006")
!AreaCheck("ARD007")
!AreaCheck("ARD008")
!AreaCheck("ARD009")
!AreaCheck("ARD010")
!AreaCheck("ARD011")
!AreaCheck("ARD012")
!AreaCheck("ARD013")
!AreaCheck("ARD014")
!AreaCheck("ARD015")
!AreaCheck("ARD016")
RealGlobalTimerExpired("CORAN_COMPLAINS","GLOBAL")
Global("BRIEL_STAY","GLOBAL",1)
Global("CB_COMPLAINS","GLOBAL",0)
Alignment("CORAN",CHAOTIC_GOOD)
Global("CoranHasBaby","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("CB_COMPLAINS","GLOBAL",1)
RealSetGlobalTimer("CComplainTalkTime","GLOBAL",10)
StartDialogueNoSet(Player1)
END

IF 
InParty(Myself) CombatCounter(0) !See([ENEMY])
RealGlobalTimerExpired("CComplainTalkTime","GLOBAL")
Global("CB_COMPLAINS","GLOBAL",1)
THEN
RESPONSE #100
IncrementGlobal("CB_COMPLAINS","GLOBAL",1)
END

//CoranQuits

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("QuitTimerStarted","GLOBAL",0)
Global("BRIEL_STAY","GLOBAL",1)
Global("COWillQuit","GLOBAL",1)
!Global("CoranMatch","GLOBAL",1)
THEN
RESPONSE #100
RealSetGlobalTimer("CORANBABY_QUITS","GLOBAL",72000)
SetGlobal("QuitTimerStarted","GLOBAL",1)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
OR(15)      //checking for island areas and Durlag
!AreaCheck("ARU008")
!AreaCheck("ARW000")
!AreaCheck("ARW500")
!AreaCheck("AR7223")
!AreaCheck("ARD006")
!AreaCheck("ARD007")
!AreaCheck("ARD008")
!AreaCheck("ARD009")
!AreaCheck("ARD010")
!AreaCheck("ARD011")
!AreaCheck("ARD012")
!AreaCheck("ARD013")
!AreaCheck("ARD014")
!AreaCheck("ARD015")
!AreaCheck("ARD016")
RealGlobalTimerExpired("CORANBABY_QUITS","GLOBAL")
Global("BRIEL_STAY","GLOBAL",1)
Global("CB_QUITS","GLOBAL",0)
Alignment("CORAN",CHAOTIC_GOOD)
Global("CoranHasBaby","GLOBAL",0)
See(Player1)
THEN
RESPONSE #100
SetGlobal("CB_QUITS","GLOBAL",1)
RealSetGlobalTimer("CQuitTalkTime","GLOBAL",10)
StartDialogueNoSet(Player1)
END

IF 
InParty(Myself) CombatCounter(0) !See([ENEMY])
RealGlobalTimerExpired("CQuitTalkTime","GLOBAL")
Global("CB_QUITS","GLOBAL",1)
THEN
RESPONSE #100
IncrementGlobal("CB_QUITS","GLOBAL",1)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("BRIEL_STAY","GLOBAL",1)
Global("CoranPrompted","GLOBAL",1)
Alignment("CORAN",CHAOTIC_GOOD)
See(Player1)
THEN
RESPONSE #100
SetGlobal("CoranPrompted","GLOBAL",2)
StartDialogueNoSet(Player1)
END


//lulliby talk for male
IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Gender(Player1,MALE)
Global("Lulm","GLOBAL",0)
Alignment("CORAN",CHAOTIC_GOOD)
Global("CoranHasBaby","GLOBAL",1)
See(Player1)
PartyRested()
THEN
RESPONSE #100
SetGlobal("Lulm","GLOBAL",1)
RealSetGlobalTimer("CFriendTalkTime","GLOBAL",10)
StartDialogueNoSet(Player1)
END

IF 
InParty(Myself) CombatCounter(0) !See([ENEMY])
RealGlobalTimerExpired("CFriendTalkTime","GLOBAL")
Global("Lulm","GLOBAL",1)
THEN
RESPONSE #100
IncrementGlobal("Lulm","GLOBAL",1)
RealSetGlobalTimer("CFriendTalkTime","GLOBAL",1800)
END

//lulliby talk for female
IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Gender(Player1,FEMALE)
Global("Lulf","GLOBAL",0)
!InParty("SAFANA")
Alignment("CORAN",CHAOTIC_GOOD)
Global("CoranHasBaby","GLOBAL",1)
See(Player1)
PartyRested()
THEN
RESPONSE #100
SetGlobal("Lulf","GLOBAL",1)
RealSetGlobalTimer("CFriendTalkTime","GLOBAL",10)
StartDialogueNoSet(Player1)
END

IF 
InParty(Myself) CombatCounter(0) !See([ENEMY])
RealGlobalTimerExpired("CFriendTalkTime","GLOBAL")
Global("Lulf","GLOBAL",1)
THEN
RESPONSE #100
IncrementGlobal("Lulf","GLOBAL",1)
RealSetGlobalTimer("CFriendTalkTime","GLOBAL",1800)
END

//chat w safana at waking
IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("COSA2","LOCALS",1)
Global("COSA3","LOCALS",0)
InParty("SAFANA")
Global("SAFGM","GLOBAL",0)
OR(2)
!Global("CoranMatch","GLOBAL",1)
!Global("CoranRomancePath","GLOBAL",1)
PartyRested()
THEN
RESPONSE #100
SetGlobal("SAFGM","GLOBAL",1)
RealSetGlobalTimer("CSTalkTime","GLOBAL",10)
Interact(Player1)
END

IF 
InParty(Myself) CombatCounter(0) !See([ENEMY])
RealGlobalTimerExpired("CSTalkTime","GLOBAL")
Global("SAFGM","GLOBAL",1)
THEN
RESPONSE #100
IncrementGlobal("SAFGM","GLOBAL",1)
RealSetGlobalTimer("CFriendTalkTime","GLOBAL",1800)
END

//Chat w PC
IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
PartyHasItem("MISC52") //wyvern head
Global("COPC1","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("COPC1","GLOBAL",1)
RealSetGlobalTimer("CWyvernTalkTime","GLOBAL",10)
Interact(Player1)
END

IF 
InParty(Myself) CombatCounter(0) !See([ENEMY])
RealGlobalTimerExpired("CWyvernTalkTime","GLOBAL")
Global("COPC1","GLOBAL",1)
THEN
RESPONSE #100
IncrementGlobal("COPC1","GLOBAL",1)
RealSetGlobalTimer("CFriendTalkTime","GLOBAL",18)
END

//Coran Friend Talks

IF 
InParty(Myself)
Global("CoranFriend","GLOBAL",0)
Global("CFriendTalk","GLOBAL",0)
THEN
RESPONSE #100
IncrementGlobal("CFriendTalk","GLOBAL",1)
RealSetGlobalTimer("CFriendTalkTime","GLOBAL",1800)
END

IF 
InParty(Myself) CombatCounter(0) !See([ENEMY])
RealGlobalTimerExpired("CFriendTalkTime","GLOBAL")
Global("CoranFriend","GLOBAL",0)
See(Player1)
OR(4)
Global("CFriendTalk","GLOBAL",1)
Global("CFriendTalk","GLOBAL",3)
Global("CFriendTalk","GLOBAL",5)
Global("CFriendTalk","GLOBAL",7)
THEN
RESPONSE #100
RealSetGlobalTimer("CFriendlyTalkTime","GLOBAL",1)
IncrementGlobal("CFriendTalk","GLOBAL",1)
Interact(Player1)
END

IF 
InParty(Myself)
RealGlobalTimerExpired("CFriendlyTalkTime","GLOBAL")
OR(2)
Global("CoranFriend","GLOBAL",0)
Global("CoranFriend","GLOBAL",1)
OR(4)
Global("CFriendTalk","GLOBAL",2)
Global("CFriendTalk","GLOBAL",4)
Global("CFriendTalk","GLOBAL",6)
Global("CFriendTalk","GLOBAL",8)
THEN
RESPONSE #100
IncrementGlobal("CFriendTalk","GLOBAL",1)
RealSetGlobalTimer("CFriendTalkTime","GLOBAL",1800)
END
