// Yeslick, When Davaeorn Is Dead
IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Dead("Davaeorn")
AreaCheck("AR8603")
Global("YWDID","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("YWDID","GLOBAL",1)
Dialogue(Player1)
END

// Yeslick, As The Party Reach The Upper Level Of The Cloakwood Mine, and the slaves have not been freed)
IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
AreaCheck("AR8601")
Global("FREESLAV","GLOBAL",0)
Global("X#YE_FreeSlaves","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("X#YE_FreeSlaves","GLOBAL",1)
StartDialogueNoSet(Player1)
END

//if Yeslick remained in the party, slaves not freed, the mine has not been flooded then set a timer - in a day,

//SetTimer:
IF
Global("X#YE_FreeSlaves","GLOBAL",2)
InParty(Myself)
Global("CHAPTER","GLOBAL",5)
Global("FLOODED","GLOBAL",0)
Global("FREESLAV","GLOBAL",0)
Global("X#YeslickReminderFlood","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("X#YeslickReminderFlood","GLOBAL",1)
SetGlobalTimer("X#YeslickReminderFlood","GLOBAL",ONE_DAY)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("FLOODED","GLOBAL",0)
Global("FREESLAV","GLOBAL",0)
Global("X#YeslickReminderFlood","GLOBAL",1)
GlobalTimerExpired("X#YeslickReminderFlood","GLOBAL")
THEN
RESPONSE #100
SetGlobal("X#YeslickReminderFlood","GLOBAL",2)
StartDialogueNoSet(Player1)
END

//Another 2 days timer

IF
Global("X#YE_FreeSlaves","GLOBAL",2)
InParty(Myself)
Global("CHAPTER","GLOBAL",5)
Global("FLOODED","GLOBAL",0)
Global("FREESLAV","GLOBAL",0)
Global("X#YeslickReminderFlood","GLOBAL",3)
THEN
RESPONSE #100
SetGlobal("X#YeslickReminderFlood","GLOBAL",4)
SetGlobalTimer("X#YeslickReminderFlood","GLOBAL",TWO_DAYS)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("FLOODED","GLOBAL",0)
Global("FREESLAV","GLOBAL",0)
Global("X#YeslickReminderFlood","GLOBAL",4)
GlobalTimerExpired("X#YeslickReminderFlood","GLOBAL")
THEN
RESPONSE #100
SetGlobal("X#YeslickReminderFlood","GLOBAL",5)
StartDialogueNoSet(Player1)
END

// Yeslick, If the party flood the mine without freeing the slaves
IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("YITPFTMWFTS","GLOBAL",0)
Global("FLOODED","GLOBAL",1)
Global("FREESLAV","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("YITPFTMWFTS","GLOBAL",1)
StartDialogueNoSet(Player1)
END

// Yeslick, As The Party Reach The Upper Level Of The Cloakwood Mine, and the slaves have been freed, mine not flooded)
IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
AreaCheck("AR8600")
Global("FREESLAV","GLOBAL",1)
Global("X#YE_Flood","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("X#YE_Flood","GLOBAL",1)
StartDialogueNoSet(Player1)
END

// Yeslick, saved slaves, if remains in the party, then set a timer - in a day, if the mine has not been flooded
IF
InParty(Myself)
Global("CHAPTER","GLOBAL",5)
Global("FLOODED","GLOBAL",0)
Global("FREESLAV","GLOBAL",1)
Global("X#YeslickFlood1","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("X#YeslickFlood1","GLOBAL",1)
SetGlobalTimer("X#YeslickFloodTime","GLOBAL",ONE_DAY)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("X#YeslickFlood1","GLOBAL",1)
Global("FLOODED","GLOBAL",0)
Global("FREESLAV","GLOBAL",1)
GlobalTimerExpired("X#YeslickFloodTime","GLOBAL")
THEN
RESPONSE #100
SetGlobal("X#YeslickFlood1","GLOBAL",2)
StartDialogueNoSet(Player1)
END

//Four more days after previous convo

IF
InParty(Myself)
Global("FLOODED","GLOBAL",0)
Global("FREESLAV","GLOBAL",1)
Global("X#YeslickFlood1","GLOBAL",3)
THEN
RESPONSE #100
SetGlobal("X#YeslickFlood1","GLOBAL",4)
SetGlobalTimer("X#YeslickFloodTime","GLOBAL",FOUR_DAYS)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("FLOODED","GLOBAL",0)
Global("FREESLAV","GLOBAL",1)
Global("X#YeslickFlood1","GLOBAL",4)
GlobalTimerExpired("X#YeslickFloodTime","GLOBAL")
THEN
RESPONSE #100
SetGlobal("X#YeslickFlood1","GLOBAL",5)
StartDialogueNoSet(Player1)
END

// Flooded Mine, freed slaves

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
AreaCheck("AR8600")
Global("X#YeslickLiturgy","GLOBAL",0)
Global("FLOODED","GLOBAL",1)
Global("FREESLAV","GLOBAL",1)
THEN
RESPONSE #100
SetGlobal("X#YeslickLiturgy","GLOBAL",1)
StartDialogueNoSet(Player1)
END


// Yeslick, upon coming to Baldur's Gate for the first time
IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
AreaCheck("AR7800")
Global("YUCTBGFTFT","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("YUCTBGFTFT","GLOBAL",1)
StartDialogueNoSet(Player1)
END

//In Candlkeep library
IF
AreaCheck("AR6510")
Global("YWMRFTFT","GLOBAL",1)
Global("YRACTH","GLOBAL",1)
THEN
RESPONSE #100
SetGlobal("YRACTH","GLOBAL",2)
ActionOverride("Rieltar",ENEMY())
ActionOverride("Brunos",ENEMY())
ActionOverride("Tuth",ENEMY())
ActionOverride("Kestor",ENEMY())
END

// Yeslick, killed Rieltar, Brunos, Tuth, Kestor
IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("YKRBTK","GLOBAL",0)
Global("IRWAS","GLOBAL",1)
Dead("Rieltar")
Dead("Brunos")
Dead("Tuth")
Dead("Kestor")
THEN
RESPONSE #100
SetGlobal("YKRBTK","GLOBAL",1)
StartDialogueNoSet(Player1)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("YRACTH","GLOBAL",2)
Dead("Rieltar")
Dead("Brunos")
Dead("Tuth")
Dead("Kestor")
THEN
RESPONSE #100
SetGlobal("YRACTH","GLOBAL",3)
StartDialogueNoSet(Player1)
END

///

IF 
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("YChapter7","GLOBAL",0)
Global("Chapter","GLOBAL",7)
THEN
RESPONSE #100
SetGlobal("YChapter7","GLOBAL",1)
StartDialogueNoSet(Player1)
END

// Yeslick, When in the lower levels of Durlag's Tower
IF 
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("YWITLLODT","GLOBAL",0)
AreaCheck("ARD514")
THEN
RESPONSE #100
SetGlobal("YWITLLODT","GLOBAL",1)
StartDialogueNoSet(Player1)
END
