/* CONTENTS */
/* start the timer */
/* Edwin friend talk */
/* Edwin Friend talk 1 - do you know how lucky you are */
/* Edwin Friend Talk 2 - Edwin discusses women */
/* Back-up script for Edwin friend talk */
/* X#EdwinDynaheir, first talk */
/* Back-up script for X#EdwinDynaheir, first talk */
/* Back-up script for X#EdwinDynaheir, second talk */
/* IF X#EdwinDynaheir=5, GTE(X#EdwinKillsDynaheir) Edwin kills Dy */
/* Backup script IF X#EdwinDynaheir=5, GTE(X#EdwinKillsDynaheir) Edwin kills Dy */

/* start the timer */
IF %BGT_VAR%
InParty(Myself)
Global("X#EDPCTimerStarted","GLOBAL",0)
Global("X#EdwinFriendTalk","GLOBAL",0)
Global("X#EdwinDynaheir","GLOBAL",0)
THEN
RESPONSE #100
RealSetGlobalTimer("X#EDFriendTalkTime","GLOBAL",3600)
RealSetGlobalTimer("X#EDDynaTalkTime","GLOBAL",7200)
SetGlobal("X#EDPCTimerStarted","GLOBAL",1)
SetGlobal("X#EdwinFriendTalk","GLOBAL",1)
SetGlobal("X#EdwinDynaheir","GLOBAL",1)
END

/* Edwin friend talk */
/* Edwin Friend talk 1 - do you know how lucky you are */
/* Edwin Friend Talk 2 - Edwin discusses women */
IF %BGT_VAR%
RealGlobalTimerExpired("X#EDFriendTalkTime","GLOBAL")
InParty(Myself)
CombatCounter(0)
!See([ENEMY])
!StateCheck(Player1,CD_STATE_NOTVALID)
!StateCheck(Myself,CD_STATE_NOTVALID)
See(Player1)
OR(2)
Global("X#EdwinFriendTalk","GLOBAL",1)
Global("X#EdwinFriendTalk","GLOBAL",3)
THEN
RESPONSE #100
PlaySong(0)
PlaySound("edwin99")
IncrementGlobal("X#EdwinFriendTalk","GLOBAL",1)
SetGlobal("X#EdFriendCheck","GLOBAL",1)
StartDialogueNoSet(Player1)
END

/* Back-up script for Edwin friend talk */
IF %BGT_VAR%
Global("X#EdFriendCheck","GLOBAL",1)
InParty(Myself)
CombatCounter(0)
!See([ENEMY])
!StateCheck(Player1,CD_STATE_NOTVALID)
!StateCheck(Myself,CD_STATE_NOTVALID)
See(Player1)
OR(2)
Global("X#EdwinFriendTalk","GLOBAL",2)
Global("X#EdwinFriendTalk","GLOBAL",4)
THEN
RESPONSE #100
PlaySong(0)
PlaySound("edwin99")
StartDialogueNoSet(Player1)
END

/* X#EdwinDynaheir, first talk */
IF %BGT_VAR%
RealGlobalTimerExpired("X#EDDynaTalkTime","GLOBAL")
Global("X#EdwinDynaheir","GLOBAL",1)
InParty(Myself)
CombatCounter(0)
!See([ENEMY])
!StateCheck(Player1,CD_STATE_NOTVALID)
See(Player1)
!StateCheck("dynaheir",CD_STATE_NOTVALID)
THEN
RESPONSE #100
PlaySong(0)
PlaySound("edwin99")
IncrementGlobal("X#EdwinDynaheir","GLOBAL",1)
StartDialogueNoSet(Player1)
END

/* Back-up script for X#EdwinDynaheir, first talk */
IF %BGT_VAR%
Global("X#EdwinDynaheir","GLOBAL",2)
InParty(Myself)
CombatCounter(0)
!See([ENEMY])
!StateCheck(Player1,CD_STATE_NOTVALID)
See(Player1)
!StateCheck("dynaheir",CD_STATE_NOTVALID)
THEN
RESPONSE #100
PlaySong(0)
PlaySound("edwin99")
StartDialogueNoSet(Player1)
END

/* X#EdwinDynaheir, second talk */
IF %BGT_VAR%
RealGlobalTimerExpired("X#EDDynaTalkTime","GLOBAL")
Global("X#EdwinDynaheir","GLOBAL",3)
InParty("dynaheir")
InParty(Myself)
CombatCounter(0)
!See([ENEMY])
!StateCheck(Player1,CD_STATE_NOTVALID)
!StateCheck("dynaheir",CD_STATE_NOTVALID)
THEN
RESPONSE #100
PlaySong(0)
PlaySound("edwin99")
IncrementGlobal("X#EdwinDynaheir","GLOBAL",1)
StartDialogueNoSet(Player1)
END

/* Back-up script for X#EdwinDynaheir, second talk */
IF %BGT_VAR%
Global("X#EdwinDynaheir","GLOBAL",4)
InParty("dynaheir")
InParty(Myself)
CombatCounter(0)
!See([ENEMY])
!StateCheck(Player1,CD_STATE_NOTVALID)
!StateCheck("dynaheir",CD_STATE_NOTVALID)
THEN
RESPONSE #100
PlaySong(0)
PlaySound("edwin99")
StartDialogueNoSet(Player1)
END

/* IF X#EdwinDynaheir=5, GTE(X#EdwinKillsDynaheir) Edwin kills Dy */
IF %BGT_VAR%
PartyRested()
GlobalTimerExpired("X#EdwinKillsDynaheir","GLOBAL")
InParty(Myself)
InParty("dynaheir")
Global("X#EdwinDynaheir","GLOBAL",5)
CombatCounter(0)
!See([ENEMY])
!StateCheck(Myself,CD_STATE_NOTVALID)
THEN
RESPONSE #100
SetGlobal("X#EdwinDynaheir","GLOBAL",6)
END

IF %BGT_VAR%
InParty(Myself)
InParty("dynaheir")
Global("X#EdwinDynaheir","GLOBAL",6)
!StateCheck(Myself,CD_STATE_NOTVALID)
THEN
RESPONSE #100
Kill("dynaheir")
END

IF %BGT_VAR%
InParty(Myself)
Dead("dynaheir")
Global("X#EdwinDynaheir","GLOBAL",6)
THEN
RESPONSE #100
SetGlobal("X#EdwinDynaheir","GLOBAL",7)
END

