IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("DreamTimerStarted","GLOBAL",0)
THEN
RESPONSE #100
RealSetGlobalTimer("DreamTalk","GLOBAL",180)
SetGlobal("DreamTimerStarted","GLOBAL",1)
END

IF
InParty(Myself)
Global("KiPCTimerStarted","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("KiPCTimerStarted","GLOBAL",1)
SetGlobal("KiFriendTalk","GLOBAL",1)
RealSetGlobalTimer("KiFriendTalkTime","GLOBAL",600)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
RealGlobalTimerExpired("KiFriendTalkTime","GLOBAL")
!StateCheck(Player1,STATE_SLEEPING)
AreaType(FOREST)
TimeofDay(DAY)
See(Player1)
OR(2)
Global("KiFriendTalk","GLOBAL",1)
Global("KiFriendTalk","GLOBAL",5)
THEN
RESPONSE #100
IncrementGlobal("KiFriendTalk","GLOBAL",1)
RealSetGlobalTimer("KiFriendlyTalkTime","GLOBAL",10)
Interact(Player1)
END

IF
InParty(Myself)
RealGlobalTimerExpired("KiFriendlyTalkTime","GLOBAL")
OR(2)
Global("KiFriendTalk","GLOBAL",2)
Global("KiFriendTalk","GLOBAL",6)
THEN
RESPONSE #100
IncrementGlobal("KiFriendTalk","GLOBAL",1)
RealSetGlobalTimer("KiFriendTalkTime","GLOBAL",3600)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
RealGlobalTimerExpired("KiFriendTalkTime","GLOBAL")
!StateCheck(Player1,STATE_SLEEPING)
AreaType(OUTDOOR)
TimeofDay(NIGHT)
See(Player1)
OR(2)
Global("KiFriendTalk","GLOBAL",3)
Global("KiFriendTalk","GLOBAL",7)
THEN
RESPONSE #100
IncrementGlobal("KiFriendTalk","GLOBAL",1)
RealSetGlobalTimer("KiFriendlyTalkTime","GLOBAL",10)
Interact(Player1)
END

IF
InParty(Myself)
RealGlobalTimerExpired("KiFriendlyTalkTime","GLOBAL")
OR(2)
Global("KiFriendTalk","GLOBAL",4)
Global("KiFriendTalk","GLOBAL",8)
THEN
RESPONSE #100
IncrementGlobal("KiFriendTalk","GLOBAL",1)
RealSetGlobalTimer("KiFriendTalkTime","GLOBAL",3600)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
AreaType(FOREST)
RealGlobalTimerExpired("KiFriendTalkTime","GLOBAL")
ReputationGT(Player1,12)
Global("KiFriendTalk","Global",9)
THEN
RESPONSE #100
IncrementGlobal("KiFriendTalk","GLOBAL",1)
RealSetGlobalTimer("KiFriendlyTalkTime","GLOBAL",10)
Interact(Player1)
END

IF
InParty(Myself)
RealGlobalTimerExpired("KiFriendlyTalkTime","GLOBAL")
Global("KiFriendTalk","GLOBAL",10)
THEN
RESPONSE #100
IncrementGlobal("KiFriendTalk","GLOBAL",1)
RealSetGlobalTimer("KiFriendTalkTime","GLOBAL",3600)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
AreaType(FOREST)
Gender(Player1,FEMALE)
GlobalGT("Chapter","Global",3)
Global("KiDance","GLOBAL",0)
THEN
RESPONSE #100
IncrementGlobal("KiDance","GLOBAL",1)
RealSetGlobalTimer("KiDanceTime","GLOBAL",10)
Interact(Player1)
END

IF
InParty(Myself)
RealGlobalTimerExpired("KiDanceTime","GLOBAL")
Global("KiDance","GLOBAL",1)
THEN
RESPONSE #100
IncrementGlobal("KiDance","GLOBAL",1)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
GlobalGT("Chapter","Global",5)
Global("KnowBhaal","GLOBAL",1)
Global("KiBhaal","GLOBAL",0)
THEN
RESPONSE #100
IncrementGlobal("KiBhaal","GLOBAL",1)
RealSetGlobalTimer("KiBhaalTime","GLOBAL",10)
Interact(Player1)
END

IF
InParty(Myself)
RealGlobalTimerExpired("KiBhaalTime","GLOBAL")
Global("KiBhaal","GLOBAL",1)
THEN
RESPONSE #100
IncrementGlobal("KiBhaal","GLOBAL",1)
END

//drink with Xan

IF
InParty(Myself) InParty("Xan") CombatCounter(0) !See([ENEMY])
Global("DrunkTimerStarted","GLOBAL",0)
Global("ElvesDrink","GLOBAL",1)
THEN
RESPONSE #100
RealSetGlobalTimer("DRUNKELVES","GLOBAL",360)
SetGlobal("DrunkTimerStarted","GLOBAL",1)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
InParty("XAN")
See("XAN")
!StateCheck("XAN",STATE_SLEEPING)
Global("KIXA1","LOCALS",1)
RealGlobalTimerExpired("DRUNKELVES","GLOBAL")
Global("KiDrunk","GLOBAL",0)
THEN
RESPONSE #100
IncrementGlobal("KiDrunk","GLOBAL",1)
RealSetGlobalTimer("KiDrunkTime","GLOBAL",10)
Interact(Player1)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
RealGlobalTimerExpired("KiDrunkTime","GLOBAL")
Global("KiDrunk","GLOBAL",1)
THEN
RESPONSE #100
IncrementGlobal("KiDrunk","GLOBAL",1)
END

//Montaron scandal

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
InParty("MONTARON")
See("MONTARON")
!StateCheck("MONTARON",STATE_SLEEPING)
InParty("XZAR")
See("XZAR")
RealGlobalTimerExpired("DreamTalk","GLOBAL")
Global("KivMont","GLOBAL",0)
PartyRested()
THEN
RESPONSE #100
SetGlobal("KivMont","GLOBAL",1)
RealSetGlobalTimer("KiToolsTime","GLOBAL",10)
Interact(Player1)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
RealGlobalTimerExpired("KiToolsTime","GLOBAL")
Global("KivMont","GLOBAL",1)
THEN
RESPONSE #100
IncrementGlobal("KivMont","GLOBAL",1)
RealSetGlobalTimer("DreamTalk","GLOBAL",180)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
Global("KivanLover","GLOBAL",1)
Gender(Player1,FEMALE)
Class(Player1,BARD)
Alignment(Player1,NEUTRAL_GOOD) 
Global("KiMA","GLOBAL",0)
PartyRested()
THEN
RESPONSE #100
SetGlobal("KiMA","GLOBAL",1)
RealSetGlobalTimer("KiMATime","GLOBAL",1)
Interact(Player1)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
RealGlobalTimerExpired("KiMATime","GLOBAL")
Global("KiMA","GLOBAL",1)
THEN
RESPONSE #100
IncrementGlobal("KiMA","GLOBAL",1)
RealSetGlobalTimer("DreamTalk","GLOBAL",180)
END




