IF %BGT_VAR%
Global("P#CoranMatch","GLOBAL",1)
Global("P#CoranFriend","GLOBAL",1)
Global("P#CFlirtTalk","GLOBAL",0)
InParty(Myself)
THEN
RESPONSE #100
RealSetGlobalTimer("P#CFlirtTalkTime","GLOBAL",5)
SetGlobal("P#CFlirtTalk","GLOBAL",1)
END

IF %BGT_VAR%
RealGlobalTimerExpired("P#CFlirtTalkTime","GLOBAL")
Global("P#CFlirtTalk","GLOBAL",1)
!Global("P#CoranRomanceInactive","GLOBAL",1)
!Global("P#CoranDisableFlirts","GLOBAL",1)
Global("P#CoSunrise","GLOBAL",0)
AreaType(FOREST)
TimeOfDay(MORNING)
PartyRested()
InParty(Myself)
CombatCounter(0)
!See([ENEMY])
THEN
RESPONSE #100
IncrementGlobal("P#CoSunrise","GLOBAL",1)
END

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

IF %BGT_VAR%
RealGlobalTimerExpired("P#CFlirtTalkTime","GLOBAL")
InParty(Myself)
Global("P#CFlirtTalk","GLOBAL",1)
!Global("P#CoranRomanceInactive","GLOBAL",1)
!Global("P#CoranDisableFlirts","GLOBAL",1)
Global("P#CoRain","GLOBAL",0)
GlobalGT("P#CoranLover","GLOBAL",0)
!AreaType(DUNGEON)
OR(3)
 AreaType(OUTDOOR)
 AreaType(WEATHER)
 AreaType(FOREST)
THEN
RESPONSE #100
Weather(RAIN)
RealSetGlobalTimer("P#CoWeatherChange","GLOBAL",5)
IncrementGlobal("P#CoRain","GLOBAL",1)
END

IF %BGT_VAR%
RealGlobalTimerExpired("P#CoWeatherChange","GLOBAL")
Global("P#CFlirtTalk","GLOBAL",1)
!Global("P#CoranRomanceInactive","GLOBAL",1)
!Global("P#CoranDisableFlirts","GLOBAL",1)
Global("P#CoRain","GLOBAL",1)
GlobalGT("P#CoranLover","GLOBAL",0)
!AreaType(DUNGEON)
OR(3)
 AreaType(OUTDOOR)
 AreaType(WEATHER)
 AreaType(FOREST)
InParty(Myself)
CombatCounter(0)
!See([ENEMY])
!StateCheck(Player1,CD_STATE_NOTVALID)
!StateCheck(Myself,CD_STATE_NOTVALID)
THEN
RESPONSE #100
IncrementGlobal("P#CoRain","GLOBAL",1)
END

IF %BGT_VAR%
Global("P#CoRain","GLOBAL",2)
InParty(Myself)
!StateCheck(Player1,CD_STATE_NOTVALID)
!StateCheck(Myself,CD_STATE_NOTVALID)
THEN
RESPONSE #100
Dialogue(Player1)
END

/* Repetitive Flirts */

/* Early in Romance */
IF %BGT_VAR%
Global("P#CoranMatch","GLOBAL",1)
!Global("P#CoranRomanceInactive","GLOBAL",1)
!Global("P#CoranDisableFlirts","GLOBAL",1)
Global("X#CoranCheckFlirtEarly","GLOBAL",0)
Global("P#CoranLover","GLOBAL",0)
InParty(Myself)
THEN
RESPONSE #100
RealSetGlobalTimer("X#CoranFlirtEarlyTime","GLOBAL",300)
SetGlobal("X#CoranCheckFlirtEarly","GLOBAL",1)
END

IF %BGT_VAR%
RealGlobalTimerExpired("X#CoranFlirtEarlyTime","GLOBAL")
Global("P#CoranMatch","GLOBAL",1)
Global("P#CoranLover","GLOBAL",0)
!Global("P#CoranRomanceInactive","GLOBAL",1)
Global("X#CoranFlirtEarly","GLOBAL",0)
InParty(Myself)
CombatCounter(0)
!See([ENEMY])
!StateCheck(Player1,CD_STATE_NOTVALID)
!StateCheck(Myself,CD_STATE_NOTVALID)
THEN
RESPONSE #100
SetGlobal("X#CoranFlirtEarly","GLOBAL",1)
END

IF %BGT_VAR%
Global("X#CoranFlirtEarly","GLOBAL",1)
InParty(Myself)
!StateCheck(Player1,CD_STATE_NOTVALID)
!StateCheck(Myself,CD_STATE_NOTVALID)
THEN
RESPONSE #100
PlaySong(0)
PlaySound("coranf")
StartDialogueNoSet(Player1)
END

/* Late in Romnace */
IF %BGT_VAR%
Global("P#CoranMatch","GLOBAL",1)
Global("P#CoranFriend","GLOBAL",1)
!Global("P#CoranRomanceInactive","GLOBAL",1)
!Global("P#CoranDisableFlirts","GLOBAL",1)
Global("X#CoranCheckFlirtLate","GLOBAL",0)
GlobalGT("P#CoranLover","GLOBAL",0)
InParty(Myself)
THEN
RESPONSE #100
RealSetGlobalTimer("X#CoranFlirtLateTime","GLOBAL",300)
SetGlobal("X#CoranCheckFlirtLate","GLOBAL",1)
END

IF %BGT_VAR%
Global("X#CoranFlirtLate","GLOBAL",0)
GlobalGT("P#CoranLover","GLOBAL",0)
RealGlobalTimerExpired("X#CoranFlirtLateTime","GLOBAL")
Global("P#CoranMatch","GLOBAL",1)
!Global("P#CoranRomanceInactive","GLOBAL",1)
!Global("P#CoranDisableFlirts","GLOBAL",1)
InParty(Myself)
CombatCounter(0)
!See([ENEMY])
!StateCheck(Player1,CD_STATE_NOTVALID)
!StateCheck(Myself,CD_STATE_NOTVALID)
THEN
RESPONSE #100
SetGlobal("X#CoranFlirtLate","GLOBAL",1)
END

IF %BGT_VAR%
Global("X#CoranFlirtLate","GLOBAL",1)
InParty(Myself)
!StateCheck(Player1,CD_STATE_NOTVALID)
!StateCheck(Myself,CD_STATE_NOTVALID)
THEN
RESPONSE #100
PlaySong(0)
PlaySound("coranf")
StartDialogueNoSet(Player1)
END

/* Coran Farewell Talk */
IF %BGT_VAR%
AreaCheck("%Undercity%")
Global("P#CoranFarewell","GLOBAL",0)
Global("P#CoranMatch","GLOBAL",1)
!Global("P#CoranRomanceInactive","GLOBAL",1)
InParty(Myself)
CombatCounter(0)
!See([ENEMY])
!StateCheck(Player1,CD_STATE_NOTVALID)
!StateCheck(Myself,CD_STATE_NOTVALID)
THEN
RESPONSE #100
IncrementGlobal("P#CoranFarewell","GLOBAL",1)
END

IF %BGT_VAR%
Global("P#CoranFarewell","GLOBAL",1)
InParty(Myself)
!StateCheck(Player1,CD_STATE_NOTVALID)
!StateCheck(Myself,CD_STATE_NOTVALID)
THEN
RESPONSE #100
PlaySong(0)
PlaySound("coranf")
StartDialogueNoSet(Player1)
END

/* Commitment Flirt 2 */
IF %BGT_VAR%
Global("P#CoranRomancePath","GLOBAL",7)
InParty(Myself)
RealGlobalTimerExpired("P#CFlirtTalkTime","GLOBAL")
!Global("P#CoranRomanceInactive","GLOBAL",1)
!Global("P#CoranDisableFlirts","GLOBAL",1)
Global("X#CoranDungeonFlirt","GLOBAL",0)
GlobalGT("P#CoranLover","GLOBAL",0)
AreaType(DUNGEON)
THEN
RESPONSE #100
PlaySong(0)
PlaySound("coranf")
SetGlobal("X#CoranDungeonFlirt","GLOBAL",1)
END

IF %BGT_VAR%
Global("X#CoranDungeonFlirt","GLOBAL",1)
InParty(Myself)
!StateCheck(Player1,CD_STATE_NOTVALID)
!StateCheck(Myself,CD_STATE_NOTVALID)
THEN
RESPONSE #100
PlaySong(0)
PlaySound("coranf")
StartDialogueNoSet(Player1)
END

/* Commitment Flirt 3 */
IF %BGT_VAR%
Global("P#CoranRomancePath","GLOBAL",7)
InParty(Myself)
RealGlobalTimerExpired("P#CFlirtTalkTime","GLOBAL")
!Global("P#CoranRomanceInactive","GLOBAL",1)
!Global("P#CoranDisableFlirts","GLOBAL",1)
Global("X#CoranLilacFlirt","GLOBAL",0)
GlobalGT("P#CoranLover","GLOBAL",0)
OR(2)
AreaType(FOREST)
AreaType(OUTDOOR)
!AreaType(CITY)
OR(2)
TimeOfDay(MORNING)
Time(DAWN_START)
THEN
RESPONSE #100
SetGlobal("X#CoranLilacFlirt","GLOBAL",1)
END

IF %BGT_VAR%
Global("X#CoranLilacFlirt","GLOBAL",1)
InParty(Myself)
!StateCheck(Player1,CD_STATE_NOTVALID)
!StateCheck(Myself,CD_STATE_NOTVALID)
THEN
RESPONSE #100
PlaySong(0)
PlaySound("coranf")
StartDialogueNoSet(Player1)
END
