// Kivan, Prism Dead (sculptor at Nashkel)
IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
AreaCheck("AR4400")
Dead("PRISM")
Global("KPD","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("KPD","GLOBAL",1)
Dialogue(Myself)
END

//Shut Down Find Bandit's Global
IF
InParty(Myself)
AreaCheck("AR8700")
GlobalLT("FindBandits","GLOBAL",2)
THEN
RESPONSE #100
SetGlobal("FindBandits","GLOBAL",99)
END

// Kivan, First Entry to Bandit Camp
IF
GlobalLT("KivanTazok1","GLOBAL",2)
Global("JoinedBandits","GLOBAL",0)
InParty(Myself) CombatCounter(0) !See([ENEMY])
AreaCheck("AR8700")
Global("KFEBC","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("KFEBC","GLOBAL",1)
Dialogue(Player1)
END

// Kivan, See Tazok
IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
AreaCheck("AR8700")
See("Tazok")
!Dead("Tazok")
Global("KivanTazok1","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("KivanTazok1","GLOBAL",1)
Dialogue(Myself)
END

//Tazok Dead in Bandir Camp
IF
InParty(Myself)
AreaCheck("AR8700")
Dead("Tazok")
Global("KivanTazok3","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("X#TazokDead","GLOBAL",1)
SetGlobal("KivanTazok3","GLOBAL",1)
SetGlobalTimer("X#TazokDead","GLOBAL",450)
StartDialogueNoSet(Player1)
END

//If Tazok dead
IF
InParty(Myself)
AreaCheck("AR8700")
Dead("Tazok")
GlobalTimerExpired("X#TazokDead","GLOBAL")
Global("X#TazokAlarm","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("X#TazokAlarm","GLOBAL",1)
CreateCreature("BANDIT",[-1.-1],0)
ActionOverride("bandit",StartDialogueNoSet(Player1))
END


// Kivan, Bandit Camp, After Tazok’s escape
IF
AreaCheck("AR8700")
Global("KBCTE","GLOBAL",1)
!Dead("TAZOK")
THEN
RESPONSE #100
Dialogue(Myself)
END

// Kivan, Before the last Battle with Sarevok
IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
AreaCheck("AR7223")
Global("KBLBWS","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("KBLBWS","GLOBAL",1)
Dialogue(Myself)
END

// Kivan, Entry to Durlag’s Tower
IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
AreaCheck("ARD002")
Global("KEDT","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("KEDT","GLOBAL",1)
Dialogue(Myself)
END

// Kivan, Entry to Baldur’s Gate
IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
AreaCheck("AR7800")
Global("KEBG","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("KEBG","GLOBAL",1)
Dialogue(Myself)
END

// Kivan, Xvart Village You Slaughter A Number Of Them (AR4700)
IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Dead("URSA")
AreaCheck("AR3498")
AreaCheck("AR3600")
Global("KXVYSANOT","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("KXVYSANOT","GLOBAL",1)
Dialogue(Myself)
END

//Kivan, killed basilius
IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Dead("bassilus")
AreaCheck("AR9600")
Global("KivanBass","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("KivanBass","GLOBAL",1)
Dialogue(Myself)
END

//Kivan Ankhegs
IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
AreaCheck("AR8300")
Global("AnkhegCount","AR8300",1)
Global("KivanAnkheg","GLOBAL",0)
NumDead("ankheg",10)
THEN
RESPONSE #100
SetGlobal("KivanAnkheg","GLOBAL",1)
Dialogue(Player1)
END

// Kivan, Ender killed
IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
InParty("Montaron")
AreaCheck("AR8701")
Dead("Ender")
Global("MontaronKillsEnder","GLOBAL",3)
Global("KivanMontEnder","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("KivanMontEnder","GLOBAL",1)
Dialogue(Player1)
END

