IF
InParty(Myself)
Global("DreamTimerStarted","GLOBAL",0)
THEN
RESPONSE #100
RealSetGlobalTimer("DreamTalk","GLOBAL",180)
SetGlobal("DreamTimerStarted","GLOBAL",1)
END

IF
InParty(Myself)
Global("KaPCTimerStarted","GLOBAL",0)
THEN
RESPONSE #100
RealSetGlobalTimer("KaFriendTalkTime","GLOBAL",1800)
SetGlobal("KaPCTimerStarted","GLOBAL",1)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
RealGlobalTimerExpired("KaFriendTalkTime","GLOBAL")
!StateCheck(Player1,STATE_SLEEPING)
See(Player1)
CombatCounter(0)
Global("KaFriendTalk","GLOBAL",0)
THEN
RESPONSE #100
IncrementGlobal("KaFriendTalk","GLOBAL",1)
RealSetGlobalTimer("KaFriendlyTalkTime","GLOBAL",10)
Interact(Player1)
END

IF
InParty(Myself)
RealGlobalTimerExpired("KaFriendlyTalkTime","GLOBAL")
Global("KaFriendTalk","GLOBAL",1)
THEN
RESPONSE #100
IncrementGlobal("KaFriendTalk","GLOBAL",1)
RealSetGlobalTimer("KaFriendTalkTime","GLOBAL",18000)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
RealGlobalTimerExpired("KaFriendTalkTime","GLOBAL")
!StateCheck(Player1,STATE_SLEEPING)
See(Player1)
GlobalGT("Chapter","GLOBAL",3)
OR(2)
Global("KaFriendTalk","GLOBAL",2)
Global("KaFriendTalk","GLOBAL",4)
THEN
RESPONSE #100
IncrementGlobal("KaFriendTalk","GLOBAL",1)
RealSetGlobalTimer("KaFriendlyTalkTime","GLOBAL",10)
Interact(Player1)
END

IF
InParty(Myself) CombatCounter(0) !See([ENEMY])
RealGlobalTimerExpired("KaFriendlyTalkTime","GLOBAL")
GlobalGT("Chapter","GLOBAL",3)
OR(2)
Global("KaFriendTalk","GLOBAL",3)
Global("KaFriendTalk","GLOBAL",5)
THEN
RESPONSE #100
IncrementGlobal("KaFriendTalk","GLOBAL",1)
RealSetGlobalTimer("KaFriendTalkTime","GLOBAL",18000)
END

IF
InParty(Myself)
Global("X#KagainBandit","GLOBAL",1)
Global("X#KagainCaravan","GLOBAL",0)
AreaCheck("AR6900")
Dead("X#KABAND")
THEN
RESPONSE #100
SetGlobal("X#KagainCaravan","GLOBAL",1)
StartDialogueNoSet(Player1)
END



