/* Early Faldorn Mine Talk */
IF %BGT_VAR%
Global("X#ReportAmarande","GLOBAL",1)
GlobalLT("Chapter","GLOBAL",%tutu_chapter_4%)
Global("X#FaMines","GLOBAL",0)
InParty(Myself)
!StateCheck(Myself,CD_STATE_NOTVALID)
InMyArea(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID)
CombatCounter(0)
!See([ENEMY])
THEN
RESPONSE #100
SetGlobal("X#FaMines","GLOBAL",1)
RealSetGlobalTimer("X#FaMineTime","GLOBAL",300)
END

IF %BGT_VAR%
Global("X#FaMines","GLOBAL",1)
RealGlobalTimerExpired("X#FaMineTime","GLOBAL")
InParty(Myself)
!StateCheck(Myself,CD_STATE_NOTVALID)
InMyArea(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID)
CombatCounter(0)
!See([ENEMY])
THEN
RESPONSE #100
SetGlobal("X#FaMines","GLOBAL",2)
END

IF %BGT_VAR%
Global("X#FaMines","GLOBAL",2)
InParty(Myself)
!StateCheck(Myself,CD_STATE_NOTVALID)
InMyArea(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID)
THEN
RESPONSE #100
StartDialogueNoSet(Player1)
END

/* do not kill bears! 1 */
IF %BGT_VAR%
AreaType(FOREST)
Global("X#FalBear","GLOBAL",0)
OR(4)
NumDead("bearbl",5)
NumDead("bearbr",5)
NumDead("bearca",5)
NumDead("bearpo",5)
InParty(Myself)
!StateCheck(Myself,CD_STATE_NOTVALID)
InMyArea(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID)
CombatCounter(0)
!See([ENEMY])
THEN
RESPONSE #100
SetGlobal("X#FalBear","GLOBAL",1)
END

/* initiate talk */
IF %BGT_VAR%
Global("X#FalBear","GLOBAL",1)
InParty(Myself)
!StateCheck(Myself,CD_STATE_NOTVALID)
InMyArea(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID)
THEN
RESPONSE #100
PlaySong(0)
PlaySound("faldo99")
StartDialogueNoSet(Player1)
END

/* do not kill bears! 2 */
IF %BGT_VAR%
AreaType(FOREST)
Global("X#FalBear","GLOBAL",3)
InParty(Myself)
!StateCheck(Myself,CD_STATE_NOTVALID)
InMyArea(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID)
CombatCounter(0)
!See([ENEMY])
OR(4)
NumDead("bearbl",6)
NumDead("bearbr",6)
NumDead("bearca",6)
NumDead("bearpo",6)
THEN
RESPONSE #100
SetGlobal("X#FalBear","GLOBAL",4)
END

/* initiate talk */
IF %BGT_VAR%
Global("X#FalBear","GLOBAL",4)
InParty(Myself)
!StateCheck(Myself,CD_STATE_NOTVALID)
InMyArea(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID)
THEN
RESPONSE #100
PlaySong(0)
PlaySound("faldo99")
StartDialogueNoSet(Player1)
END

/* FaldornQuit */
IF %BGT_VAR%
Global("X#FaDryadQuit","GLOBAL",1)
AreaCheck("%DryadFalls%")
InParty(Myself)
!StateCheck(Myself,CD_STATE_NOTVALID)
InMyArea(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID)
CombatCounter(0)
!See([ENEMY])
THEN
RESPONSE #100
MoveToObject("caldo")
SetGlobal("X#FaDryadQuit","GLOBAL",2)
Kill("caldo")
END

IF %BGT_VAR%
Global("X#FaDryadQuit","GLOBAL",2)
Dead("caldo")
AreaCheck("%DryadFalls%")
THEN
RESPONSE #100
MoveToObject("krumm")
SetGlobal("X#FaDryadQuit","GLOBAL",3)
Kill("krumm")
SetGlobal("%KICKED_OUT%","LOCALS",2)
LeaveParty()
SetLeavePartyDialogFile()
ChangeAIScript("",DEFAULT)
END

IF %BGT_VAR%
AreaCheck("%DryadFalls%")
Global("X#FaDryadQuit","GLOBAL",3)
Dead("krumm")
THEN
RESPONSE #100
SetGlobal("X#FaDryadQuit","GLOBAL",4)
SetGlobal("%KICKED_OUT%","LOCALS",1)
END

/* Faldorn, At Seeing The Firewine Ruins */
IF %BGT_VAR%
AreaCheck("%FirewineBridge%")
Global("X#FASTFWR","GLOBAL",0)
See("poe")
InParty(Myself)
!StateCheck(Myself,CD_STATE_NOTVALID)
InMyArea(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID)
CombatCounter(0)
!See([ENEMY])
THEN
RESPONSE #100
SetGlobal("X#FASTFWR","GLOBAL",1)
END

/* initiate talk */
IF %BGT_VAR%
Global("X#FASTFWR","GLOBAL",1)
InParty(Myself)
!StateCheck(Myself,CD_STATE_NOTVALID)
InMyArea(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID)
THEN
RESPONSE #100
StartDialogueNoSet(Myself)
END

/* Faldorn at entering Map 0400 */
IF %BGT_VAR%
AreaCheck("%Farmlands%")
Global("X#FaldornM400","GLOBAL",0)
InParty(Myself)
!StateCheck(Myself,CD_STATE_NOTVALID)
InMyArea(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID)
CombatCounter(0)
!See([ENEMY])
THEN
RESPONSE #100
SetGlobal("X#FaldornM400","GLOBAL",1)
END

/* initiate talk */
IF %BGT_VAR%
Global("X#FaldornM400","GLOBAL",1)
InParty(Myself)
!StateCheck(Myself,CD_STATE_NOTVALID)
InMyArea(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID)
THEN
RESPONSE #100
StartDialogueNoSet(Myself)
END

/* Fergus */
IF %BGT_VAR%
AreaCheck("%SWBaldursGate_FlamingFistHQ_L1%")
Global("FERGUS1","GLOBAL",1)
Global("X#FaldornFergus","GLOBAL",0)
InParty(Myself)
!StateCheck(Myself,CD_STATE_NOTVALID)
InMyArea(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID)
CombatCounter(0)
!See([ENEMY])
THEN
RESPONSE #100
SetGlobal("X#FaldornFergus","GLOBAL",1)
END

/* initiate talk */
IF %BGT_VAR%
Global("X#FaldornFergus","GLOBAL",1)
InParty(Myself)
!StateCheck(Myself,CD_STATE_NOTVALID)
InMyArea(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID)
THEN
RESPONSE #100
StartDialogueNoSet(Player1)
END

/* Help Caldo */
IF %BGT_VAR%
  Global("X#FaldornHelpCaldo","GLOBAL",1) //auto-set from interjection
  InParty(Myself) //No "CombatCounter(0)" here!
  !StateCheck(Myself,CD_STATE_NOTVALID)
  InMyArea(Player1)
  !StateCheck(Player1,CD_STATE_NOTVALID)
THEN
  RESPONSE #100
    SetGlobal("X#FaldornHelpCaldo","GLOBAL",2)
    SetLeavePartyDialogFile() 
    ChangeAIScript("",DEFAULT) 
    LeaveParty() 
    Enemy()
END
