/* CONTENTS */
/* Dream timer */
/* PC talks */
///* setting the timer */
///* Friend talks */

/* Dream timer */
IF %BGT_VAR%
InParty(Myself)
Global("X#DreamTimerStarted","GLOBAL",0)
THEN
RESPONSE #100
RealSetGlobalTimer("X#DreamTalk","GLOBAL",180)
SetGlobal("X#DreamTimerStarted","GLOBAL",1)
END

/* PC talks */
///* setting the timer */
IF %BGT_VAR%
InParty(Myself)
Global("X#SkFriendTalk","GLOBAL",0)
THEN
RESPONSE #100
IncrementGlobal("X#SkFriendTalk","GLOBAL",1)
RealSetGlobalTimer("X#SkFriendTalkTime","GLOBAL",1800)
END

///* Friend talks */
IF %BGT_VAR%
RealGlobalTimerExpired("X#SkFriendTalkTime","GLOBAL")
Global("X#SkFriendCheck","GLOBAL",0)
InParty(Myself)
CombatCounter(0)
!See([ENEMY])
!StateCheck(Player1,CD_STATE_NOTVALID)
!StateCheck(Myself,CD_STATE_NOTVALID)
OR(2)
Global("X#SkFriendTalk","GLOBAL",1)
Global("X#SkFriendTalk","GLOBAL",3)
THEN
RESPONSE #100
SetGlobal("X#SkFriendCheck","GLOBAL",1)
IncrementGlobal("X#SkFriendTalk","GLOBAL",1)
END

IF %BGT_VAR%
Global("X#SkFriendCheck","GLOBAL",1)
OR(2)
Global("X#SkFriendTalk","GLOBAL",2)
Global("X#SkFriendTalk","GLOBAL",4)
InParty(Myself)
CombatCounter(0)
!See([ENEMY])
!StateCheck(Player1,CD_STATE_NOTVALID)
!StateCheck(Myself,CD_STATE_NOTVALID)
THEN
RESPONSE #100
PlaySong(0)
PlaySound("skie99")
StartDialogueNoSet(Player1)
END

IF %BGT_VAR%
RealGlobalTimerExpired("X#SkFriendTalkTime","GLOBAL")
InParty("eldoth")
Global("X#SkFriendTalk","GLOBAL",5)
InParty(Myself)
CombatCounter(0)
!See([ENEMY])
See("eldoth")
!StateCheck(Myself,CD_STATE_NOTVALID)
!StateCheck(Player1,CD_STATE_NOTVALID)
!StateCheck("eldoth",CD_STATE_NOTVALID)
THEN
RESPONSE #100
IncrementGlobal("X#SkFriendTalk","GLOBAL",1)
END

IF %BGT_VAR%
InParty("eldoth")
Global("X#SkFriendTalk","GLOBAL",6)
InParty(Myself)
CombatCounter(0)
!See([ENEMY])
See("eldoth")
!StateCheck(Myself,CD_STATE_NOTVALID)
!StateCheck(Player1,CD_STATE_NOTVALID)
!StateCheck("eldoth",CD_STATE_NOTVALID)
THEN
RESPONSE #100
PlaySong(0)
PlaySound("skie99")
StartDialogueNoSet(Player1)
END
