/* CONTENTS */
/* Dream timer */
/* start talk timer */
/* Friend talk */
/* Chapter5 */
/* Script checking Garrick's presence in the party when doing Nashkel mines */

/* 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

/* start talk timer */
IF %BGT_VAR%
InParty(Myself)
Global("X#GaPCTimerStarted","GLOBAL",0)
THEN
RESPONSE #100
RealSetGlobalTimer("X#GaFriendTalkTime","GLOBAL",1800)
SetGlobal("X#GaPCTimerStarted","GLOBAL",1)
END

/* Friend talk */
IF %BGT_VAR%
RealGlobalTimerExpired("X#GaFriendTalkTime","GLOBAL")
Global("X#GaFriendTalk","GLOBAL",0)
InParty(Myself)
CombatCounter(0)
!See([ENEMY])
!StateCheck(Player1,CD_STATE_NOTVALID)
!StateCheck(Myself,CD_STATE_NOTVALID)
THEN
RESPONSE #100
SetGlobal("X#GaFriendTalk","GLOBAL",1)
END

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

/* Chapter5 */
IF %BGT_VAR%
GlobalGT("Chapter","GLOBAL",%tutu_chapter_4%)
Global("X#GarriWar","GLOBAL",0)
InParty(Myself)
CombatCounter(0)
!See([ENEMY])
!StateCheck(Player1,CD_STATE_NOTVALID)
!StateCheck(Myself,CD_STATE_NOTVALID)
THEN
RESPONSE #100
SetGlobal("X#GarriWar","GLOBAL",1)
END

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

/* Script checking Garrick's presence in the party when doing Nashkel mines */
IF %BGT_VAR%
GlobalLT("Chapter","GLOBAL",%tutu_chapter_3%)
Global("X#GarrickSavesMines","LOCALS",0)
InParty(Myself)
OR(4)
AreaCheck("%NashkelMines_L1%")
AreaCheck("%NashkelMines_L2%")
AreaCheck("%NashkelMines_L3%")
AreaCheck("%NashkelMines_L4%")
THEN
RESPONSE #100
SetGlobal("X#GarrickSavesMines","LOCALS",1)
END

/* Nashkel mine banter */
IF %BGT_VAR%
GlobalGT("Chapter","GLOBAL",%tutu_chapter_2%)
Global("X#GarrickSavesMines","LOCALS",1)
Global("X#GarriNashkel","GLOBAL",0)
InParty(Myself)
CombatCounter(0)
!See([ENEMY])
!StateCheck(Player1,CD_STATE_NOTVALID)
!StateCheck(Myself,CD_STATE_NOTVALID)
THEN
RESPONSE #100
SetGlobal("X#GarriNashkel","GLOBAL",1)
END

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