/* Edwin and Denak */
IF %BGT_VAR%
AreaCheck("%SpiderWood%")
Global("X#EdwinBetrayRW","GLOBAL",5)
Dead("dynaheir")
Dead("minsc")
InParty(Myself)
!StateCheck(Myself,CD_STATE_NOTVALID)
InMyArea(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID)
THEN
RESPONSE #100
SetGlobal("X#EdwinBetrayRW","GLOBAL",6)
END

/* Initiate Edwin and Denak */
IF %BGT_VAR%
Global("X#EdwinBetrayRW","GLOBAL",6)
InParty(Myself)
!StateCheck(Myself,CD_STATE_NOTVALID)
InMyArea(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID)
THEN
RESPONSE #100
ActionOverride("denak",StartDialogueNoSet("edwin"))
END

/* Edwin becomes Edwina */
IF %BGT_VAR%
Gender("edwin",FEMALE)
Global("X#EdwinFemale","GLOBAL",0)
InParty(Myself)
!StateCheck(Myself,CD_STATE_NOTVALID)
InMyArea(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID)
THEN
RESPONSE #100
SetGlobal("X#EdwinFemale","GLOBAL",1)
END

/* Initiate Edwin becomes Edwina */
IF %BGT_VAR%
Global("X#EdwinFemale","GLOBAL",1)
InParty(Myself)
!StateCheck(Myself,CD_STATE_NOTVALID)
InMyArea(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID)
THEN
RESPONSE #100
StartDialogueNoSet(Player1)
END

/* Edwin Goes to RW rondezvous */
IF %BGT_VAR%
Global("X#EdwinAbandoned","GLOBAL",1)
Global("X#EdwinReturn","GLOBAL",0)
THEN
RESPONSE #100
SetGlobalTimer("JW#Edwin","GLOBAL",28800) //four days
SetGlobal("X#EdwinReturn","GLOBAL",1)
EscapeAreaMove("%SpiderWood%",1833,2153,2)
END
