// creator  : weidu.exe (version 23600)
// argument : DENAK.DLG
// game     : .
// source   : ./override/DENAK.DLG
// dialog   : lang\en_us/dialog.tlk
// dialogF  : (none)

BEGIN ~DENAK~
//////////////////////////////////////////////////
// WARNING: this file contains non-trivial WEIGHTs
//////////////////////////////////////////////////

IF WEIGHT #2 /* Triggers after states #: 3 11 even though they appear after this state */
~  OR(3)
!InParty("edwin")
!InMyArea("edwin")
StateCheck("edwin",CD_STATE_NOTVALID)
True()
~ THEN BEGIN 0 // from:
  SAY #18232 /* ~It is so sad to have met you this fine day. Normally, we would be quite ecstatic to have visitors, but in these troubled times we really do desire privacy. We just can't afford to have anyone knowing that we're here. That is why you must die.~ */
  IF ~~ THEN REPLY #18233 /* ~Just wait a moment! We won't bother you, just let us go on our way... and you'll never see us again.~ */ GOTO 1
  IF ~~ THEN REPLY #18234 /* ~We're not scared of a bunch of posturing red-robed freaks!~ */ GOTO 2
  IF ~~ THEN REPLY #18235 /* ~Please don't kill us. We don't want to die.~ */ GOTO 1
  IF ~Global("X#SHARTEELDENAK1","GLOBAL",0)
InParty("sharteel")
InMyArea("sharteel")
!StateCheck("sharteel",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#SHARTEELDENAK1","GLOBAL",1)~ EXTERN ~SHARTJ~ 116
END

IF WEIGHT #3 /* Triggers after states #: 3 11 even though they appear after this state */
~  OR(3)
!InParty("edwin")
!InMyArea("edwin")
StateCheck("edwin",CD_STATE_NOTVALID)
~ THEN BEGIN 1 // from: 0.2 0.0
  SAY #18236 /* ~Sorry, but the Red Wizards of Thay are not known for their magnanimous nature. We're going to have to kill you.~ */
  IF ~~ THEN DO ~ActionOverride("BRENDAN",Enemy())
ActionOverride("LASALA",Enemy())
ActionOverride("DIANA",Enemy())
Enemy()
~ EXIT
  IF ~Global("X#DENAK1","GLOBAL",0)
InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#DENAK1","GLOBAL",1)~ GOTO 12
  IF ~Global("X#DENAK1","GLOBAL",0)
InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#DENAK1","GLOBAL",1)~ EXTERN ~DYNAHJ~ 255
  IF ~Global("X#DENAK1","GLOBAL",0)
InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#DENAK1","GLOBAL",1)~ GOTO 14
  IF ~Global("X#DENAK1","GLOBAL",0)
InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#DENAK1","GLOBAL",1)~ EXTERN ~VICONJ~ 200
END

IF WEIGHT #4 /* Triggers after states #: 3 11 even though they appear after this state */
~  OR(3)
!InParty("edwin")
!InMyArea("edwin")
StateCheck("edwin",CD_STATE_NOTVALID)
~ THEN BEGIN 2 // from: 0.1
  SAY #18237 /* ~A group of arrogant whelps! This is such a reward, and will make your deaths all the more sweet.~ */
  IF ~~ THEN DO ~ActionOverride("BRENDAN",Enemy())
ActionOverride("LASALA",Enemy())
ActionOverride("DIANA",Enemy())
Enemy()
~ EXIT
END

IF WEIGHT #1 /* Triggers after states #: 11 even though they appear after this state */
~  GlobalLT("X#EdwinBetrayRW","GLOBAL",5)
InParty("EDWIN")
~ THEN BEGIN 3 // from:
  SAY #18770 /* ~Good day, travelers. Mmm, Edwin, I did not expect to see you so soon. I hope your... business has been attended to. If it hasn't, then you should deal with it soon. I think that Zulkir Nevron would be most disappointed if he were to hear that you failed. That is all that really needs to be said. Good day again, and goodbye.~ */
  IF ~~ THEN DO ~ActionOverride("BRENDAN",EscapeArea())
ActionOverride("LASALA",EscapeArea())
ActionOverride("DIANA",EscapeArea())
EscapeArea()
~ EXIT
  IF ~  InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
~ THEN GOTO 4
  IF ~Global("X#SHARTEELDENAK2","GLOBAL",0)
InParty("sharteel")
InMyArea("sharteel")
!StateCheck("sharteel",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#SHARTEELDENAK2","GLOBAL",1)~ EXTERN ~SHARTJ~ 117
END

IF ~~ THEN BEGIN 4 // from: 10.1 3.1
  SAY #46354 /* ~But what do I see? You are not quite as useless as I have reported to Nevron time and again. You are worse! What part of "kill" did you not understand when you were ordered to assassinate the Rashemi witch? Has the stay in these barbaric lands softened your wits?~ */
  IF ~~ THEN EXTERN ~BEDWIN~ 304
END

IF ~~ THEN BEGIN 5 // from: BEDWIN:304.0
  SAY #46356 /* ~*sighs* Let me guess - instead of killing the witch, you have captured her for questioning?~ */
  IF ~~ THEN EXTERN ~BEDWIN~ 305
END

IF ~~ THEN BEGIN 6 // from: BDYNAH:278.0
  SAY #46359 /* ~And did you think how wasteful it is to transport a prisoner back to Thay?~ */
  IF ~~ THEN EXTERN ~BEDWIN~ 306
END

IF ~~ THEN BEGIN 7 // from: BEDWIN:306.3
  SAY #46369 /* ~I find that difficult to believe. Edwin, do prove yourself useful and help me take care of this... motley crew.~ */
  IF ~~ THEN DO ~SetGlobal("X#EdwinBetrayRW","GLOBAL",2)
ActionOverride("brendan",Enemy())
ActionOverride("lasala",Enemy())
ActionOverride("diana",Enemy())
ActionOverride("denak",Enemy())
ActionOverride("edwin",LeaveParty())
ActionOverride("edwin",SetLeavePartyDialogueFile())
ActionOverride("edwin",ChangeAIScript("",DEFAULT))
ActionOverride("edwin",Enemy())
~ EXIT
END

IF WEIGHT #5 /* Triggers after states #: 11 even though they appear after this state */
~  Global("X#EdwinBetrayRW","GLOBAL",6)
~ THEN BEGIN 8 // from:
  SAY #46370 /* ~Quite amusing, Edwin. Once a new assignment for you has been received, I will contact you. Oh... and here is your reimbursement as per your last expense report, though I am still unclear as to how buying a drow pleasure slave helped you in the capture of the witch?~ */
  IF ~~ THEN DO ~ActionOverride("brendan",EscapeArea())
ActionOverride("lasala",EscapeArea())
ActionOverride("diana",EscapeArea())
EscapeArea()
SetGlobal("X#EdwinBetrayRW","GLOBAL",7)
GiveGoldForce(1000)
AddXPObject("edwin",1000)
~ EXIT
END

IF ~~ THEN BEGIN 9 // from: BEDWIN:306.4
  SAY #46371 /* ~Edwin, your rugged companion here awaits your answer. Do you concede to having the most pathetic sense of humor this side of the Spine of the World, or will you expose <PRO_HISHER> primitive attempt at a ruse?~ */
  IF ~~ THEN EXTERN ~BEDWIN~ 307
END

IF ~~ THEN BEGIN 10 // from:
  SAY #46492 /* ~Do you really tolerate this insolence? Never mind. We go.~ */
  IF ~~ THEN DO ~ActionOverride("BRENDAN",EscapeArea())
ActionOverride("LASALA",EscapeArea())
ActionOverride("DIANA",EscapeArea())
EscapeArea()
~ EXIT
  IF ~  InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
~ THEN GOTO 4
END

IF WEIGHT #0 ~  GlobalGT("X#EdwinReturn","GLOBAL",0)
~ THEN BEGIN 11 // from:
  SAY #46648 /* ~The Red Wizards of Thay are not known for their magnanimous nature. You've slighted one of our number, Edwin, and it's an offense to us all. We're going to have to kill you.~ */
  IF ~~ THEN DO ~ActionOverride("denak",Enemy())
ActionOverride("brendan",Enemy())
ActionOverride("lasala",Enemy())
ActionOverride("diana",Enemy())
ActionOverride("edwin",Enemy())
SetGlobal("X#EdwinReturn","GLOBAL",3)
~ EXIT
  IF ~  Global("X#EdwinReturn","GLOBAL",2)
!Dead("Edwin")
!InParty("edwin")
!StateCheck("edwin",CD_STATE_NOTVALID)
See("denak")
~ THEN DO ~ActionOverride("denak",Enemy())
ActionOverride("brendan",Enemy())
ActionOverride("lasala",Enemy())
ActionOverride("diana",Enemy())
ActionOverride("edwin",Enemy())
SetGlobal("X#EdwinReturn","GLOBAL",3)
~ EXTERN ~EDWINP~ 6
  IF ~  Global("X#EdwinReturn","GLOBAL",1)
!Dead("Edwin")
!InParty("edwin")
!StateCheck("edwin",CD_STATE_NOTVALID)
See("denak")
~ THEN DO ~ActionOverride("denak",Enemy())
ActionOverride("brendan",Enemy())
ActionOverride("lasala",Enemy())
ActionOverride("diana",Enemy())
ActionOverride("edwin",Enemy())
SetGlobal("X#EdwinReturn","GLOBAL",3)
~ EXTERN ~EDWINP~ 5
END

IF ~~ THEN BEGIN 12 // from: 1.1
  SAY #50057 /* ~This accent... is all too familiar. You must be the Rashemi witch spotted in these parts by our friends. I can see that Edwin did not carry out his mission as ordered. Lasala, I suggest that we not tell him that we have done his job. The farther away he is, the less obstructions he creates for us.~ */
  IF ~~ THEN DO ~ActionOverride("BRENDAN",Enemy())
ActionOverride("LASALA",Enemy())
ActionOverride("DIANA",Enemy())
Enemy()
~ EXIT
END

IF ~~ THEN BEGIN 13 // from: DYNAHJ:255.1
  SAY #50057 /* ~This accent... is all too familiar. You must be the Rashemi witch spotted in these parts by our friends. I can see that Edwin did not carry out his mission as ordered. Lasala, I suggest that we not tell him that we have done his job. The farther away he is, the less obstructions he creates for us.~ */
  IF ~~ THEN DO ~ActionOverride("BRENDAN",Enemy())
ActionOverride("LASALA",Enemy())
ActionOverride("DIANA",Enemy())
Enemy()
~ EXIT
END

IF ~~ THEN BEGIN 14 // from: 1.3
  SAY #50055 /* ~They should.~ */
  IF ~~ THEN DO ~ActionOverride("BRENDAN",Enemy())
ActionOverride("LASALA",Enemy())
ActionOverride("DIANA",Enemy())
Enemy()
~ EXIT
  IF ~  InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
~ THEN GOTO 15
  IF ~  InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
~ THEN EXTERN ~DYNAHJ~ 256
END

IF ~~ THEN BEGIN 15 // from: 14.1 DYNAHJ:256.1
  SAY #50057 /* ~This accent... is all too familiar. You must be the Rashemi witch spotted in these parts by our friends. I can see that Edwin did not carry out his mission as ordered. Lasala, I suggest that we not tell him that we have done his job. The farther away he is, the less obstructions he creates for us.~ */
  IF ~~ THEN DO ~ActionOverride("BRENDAN",Enemy())
ActionOverride("LASALA",Enemy())
ActionOverride("DIANA",Enemy())
Enemy()
~ EXIT
END

IF ~~ THEN BEGIN 16 // from:
  SAY #50055 /* ~They should.~ */
  IF ~~ THEN DO ~ActionOverride("BRENDAN",Enemy())
ActionOverride("LASALA",Enemy())
ActionOverride("DIANA",Enemy())
Enemy()
~ EXIT
  IF ~  InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
~ THEN GOTO 17
  IF ~  InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
~ THEN EXTERN ~DYNAHJ~ 257
END

IF ~~ THEN BEGIN 17 // from: 16.1 DYNAHJ:257.1
  SAY #50057 /* ~This accent... is all too familiar. You must be the Rashemi witch spotted in these parts by our friends. I can see that Edwin did not carry out his mission as ordered. Lasala, I suggest that we not tell him that we have done his job. The farther away he is, the less obstructions he creates for us.~ */
  IF ~~ THEN DO ~ActionOverride("BRENDAN",Enemy())
ActionOverride("LASALA",Enemy())
ActionOverride("DIANA",Enemy())
Enemy()
~ EXIT
END
