/* CONTENTS */
/* Dream timer */
/* Mulahey friend talk */
/* Elminster */
/* Quayle */

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

/* Mulahey friend talk */
IF %BGT_VAR%
Dead("mulahey")
InParty(Myself)
Global("X#KhFriendTalk","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("X#KhFriendTalk","GLOBAL",1)
END

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

/* Elminster */
IF %BGT_VAR%
Global("X#KhElminster","GLOBAL",0)
InParty(Myself)
CombatCounter(0)
!See([ENEMY])
OR(7)
AreaCheck("%NBaldursGate%")
AreaCheck("%NEBaldursGate%")
AreaCheck("%WBaldursGate%")
AreaCheck("%CentralBaldursGate%")
AreaCheck("%SWBaldursGate%")
AreaCheck("%BaldursGateDocks%")
AreaCheck("%BaldursGateDocks%")
THEN
RESPONSE #100
SetGlobal("X#KhElminster","GLOBAL",1)
END

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

/* Quayle */
IF %BGT_VAR%
InParty(Myself)
InParty("quayle")
AreaCheck("%CentralBaldursGate%")
CombatCounter(0)
!See([ENEMY])
Global("X#KHQU1","GLOBAL",0)
See("quayle")
!StateCheck("quayle",CD_STATE_NOTVALID)
See(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID)
!StateCheck(Myself,CD_STATE_NOTVALID)
THEN
RESPONSE #100
SetGlobal("X#KHQU1","GLOBAL",1)
END

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