IF
InParty(Myself)
Global("O#CoranExperienceSet","GLOBAL",0)
XPLT(Player1,280001)
THEN
RESPONSE #100
SetGlobal("O#CoranExperienceSet","GLOBAL",1)
END

IF
InParty(Myself)
Global("O#CoranExperienceSet","GLOBAL",0)
XPGT(Player1,280000)
XPLT(Player1,600001)
THEN
RESPONSE #100
SetGlobal("O#CoranExperienceSet","GLOBAL",1)
AddXPObject("O#Coran",239000)
END

IF
InParty(Myself)
Global("O#CoranExperienceSet","GLOBAL",0)
XPGT(Player1,600000)
XPLT(Player1,1000001)
THEN
RESPONSE #100
SetGlobal("O#CoranExperienceSet","GLOBAL",1)
AddXPObject("O#Coran",639000)
END

IF
InParty(Myself)
Global("O#CoranExperienceSet","GLOBAL",0)
XPGT(Player1,1000000)
THEN
RESPONSE #100
SetGlobal("O#CoranExperienceSet","GLOBAL",1)
AddXPObject("O#Coran",1039000)
END

IF
HotKey(K)
THEN
RESPONSE #100
StartCutSceneMode()
StartCutScene("O#CoranF")
END

IF 
InParty(Myself)
Global("O#CoranShutUp","GLOBAL",0)
Global("O#CoranPCTalk","GLOBAL",0)
THEN
RESPONSE #100
RealSetGlobalTimer("O#CoranPCTimer","GLOBAL",3600)
SetGlobal("O#CoranPCTalk","GLOBAL",1)
END

IF
InParty(Myself)
RealGlobalTimerExpired("O#CoranPCTimer","GLOBAL")
Global("O#CoranShutUp","GLOBAL",0)
See(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID) 
!StateCheck(Myself,CD_STATE_NOTVALID)
CombatCounter(0)
!See([ENEMY])
OR(9)
Global("O#CoranPCTalk","GLOBAL",1)
Global("O#CoranPCTalk","GLOBAL",5)
Global("O#CoranPCTalk","GLOBAL",7)
Global("O#CoranPCTalk","GLOBAL",9)
Global("O#CoranPCTalk","GLOBAL",11)
Global("O#CoranPCTalk","GLOBAL",13)
Global("O#CoranPCTalk","GLOBAL",17)
Global("O#CoranPCTalk","GLOBAL",19)
Global("O#CoranPCTalk","GLOBAL",23)
THEN
RESPONSE #100
IncrementGlobal("O#CoranPCTalk","GLOBAL",1)
END

IF
InParty(Myself)
Global("O#CoranShutUp","GLOBAL",0)
!AreaType(DUNGEON)
See(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID) 
!StateCheck(Myself,CD_STATE_NOTVALID)
CombatCounter(0)
!See([ENEMY])
OR(9)
Global("O#CoranPCTalk","GLOBAL",2)
Global("O#CoranPCTalk","GLOBAL",6)
Global("O#CoranPCTalk","GLOBAL",8)
Global("O#CoranPCTalk","GLOBAL",10)
Global("O#CoranPCTalk","GLOBAL",12)
Global("O#CoranPCTalk","GLOBAL",14)
Global("O#CoranPCTalk","GLOBAL",18)
Global("O#CoranPCTalk","GLOBAL",20)
Global("O#CoranPCTalk","GLOBAL",24)
THEN
RESPONSE #100
StartDialogueNoSet(Player1)
END

IF
InParty(Myself)
Global("O#CoranShutUp","GLOBAL",0)
See(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID) 
!StateCheck(Myself,CD_STATE_NOTVALID)
CombatCounter(0)
!See([ENEMY])
Global("Chapter","GLOBAL",%bg2_chapter_4%)
GlobalLT("O#CoranPCChapter","GLOBAL",8)
THEN
RESPONSE #100
SetGlobal("O#CoranPCChapter","GLOBAL",8)
END

IF
InParty(Myself)
Global("O#CoranShutUp","GLOBAL",0)
See(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID) 
!StateCheck(Myself,CD_STATE_NOTVALID)
CombatCounter(0)
!See([ENEMY])
Global("Chapter","GLOBAL",%bg2_chapter_5%)
GlobalLT("O#CoranPCChapter","GLOBAL",10)
THEN
RESPONSE #100
SetGlobal("O#CoranPCChapter","GLOBAL",10)
END

IF
InParty(Myself)
Global("O#CoranShutUp","GLOBAL",0)
See(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID) 
!StateCheck(Myself,CD_STATE_NOTVALID)
CombatCounter(0)
!See([ENEMY])
Global("Chapter","GLOBAL",%bg2_chapter_6%)
GlobalLT("O#CoranPCChapter","GLOBAL",12)
THEN
RESPONSE #100
SetGlobal("O#CoranPCChapter","GLOBAL",12)
END

IF
InParty(Myself)
Global("O#CoranShutUp","GLOBAL",0)
See(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID) 
!StateCheck(Myself,CD_STATE_NOTVALID)
CombatCounter(0)
!See([ENEMY])
Global("Chapter","GLOBAL",%bg2_chapter_7%)
GlobalLT("O#CoranPCChapter","GLOBAL",14)
THEN
RESPONSE #100
SetGlobal("O#CoranPCChapter","GLOBAL",14)
END

IF
InParty(Myself)
Global("O#CoranShutUp","GLOBAL",0)
!AreaType(DUNGEON)
See(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID) 
!StateCheck(Myself,CD_STATE_NOTVALID)
CombatCounter(0)
!See([ENEMY])
OR(4)
Global("O#CoranPCChapter","GLOBAL",8)
Global("O#CoranPCChapter","GLOBAL",10)
Global("O#CoranPCChapter","GLOBAL",12)
Global("O#CoranPCChapter","GLOBAL",14)
THEN
RESPONSE #100
StartDialogueNoSet(Player1)
END

IF
InParty(Myself)
Global("O#CoranShutUp","GLOBAL",0)
See(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID) 
!StateCheck(Myself,CD_STATE_NOTVALID)
CombatCounter(0)
!See([ENEMY])
AreaCheck("AR2600")
Global("O#CoranPCForestTethyr","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("O#CoranPCForestTethyr","GLOBAL",1)
END

IF
InParty(Myself)
Global("O#CoranShutUp","GLOBAL",0)
See(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID) 
!StateCheck(Myself,CD_STATE_NOTVALID)
CombatCounter(0)
!See([ENEMY])
AreaCheck("AR2600")
Global("O#CoranPCForestTethyr","GLOBAL",1)
THEN
RESPONSE #100
StartDialogueNoSet(Player1)
END