// creator  : weidu.exe (version 23100)
// argument : _ZEKE.DLG
// game		 : .
// source	 : ./override/_ZEKE.DLG
// dialog	 : ./DIALOG.TLK
// dialogF  : (none)

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

IF WEIGHT #1 /* Triggers after states #: 4 even though they appear after this state */
~True()
~ THEN BEGIN 0 // from:
  SAY #77080 /* ~Come one, come all!  Take a look at the stone warrior maiden.  How long has she been trapped in this petrified form, no one knows!  Be the first to learn, for the mere price of 500 gold.  For that small amount of money, I shall give you a magic scroll, and with this scroll you can release the maiden from her stone prison.  Think of the gratitude she would feel to her saviors.  Perhaps she's a princess from some far off land, or maybe a powerful sorceress in search of a concubine.  You can't afford not to know!  Buy the scroll!~ */
  IF ~~ THEN REPLY #77081 /* ~Sorry, we're not interested.~ */ GOTO 1
  IF ~PartyGoldGT(499)
~ THEN REPLY #77082 /* ~Sure, give us the scroll.~ */ GOTO 2
  IF ~~ THEN REPLY #77083 /* ~We don't have the money right now.~ */ GOTO 3
  IF ~  !InParty("branwen")
!StateCheck("branwen",CD_STATE_NOTVALID)
~ THEN REPLY #98500 /* ~You're too late. She is stone no longer.~ */ GOTO 5
  IF ~  Global("X#JaheiraZeke","GLOBAL",1)
~ THEN GOTO 6
  IF ~Global("X#JaheiraZeke","GLOBAL",0)
StateCheck("branwen",CD_STATE_NOTVALID)
InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#JaheiraZeke","GLOBAL",1)~ EXTERN ~_JAHEIJ~ 124
  IF ~Global("X#ZEKE0","GLOBAL",0)
InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#ZEKE0","GLOBAL",1)~ GOTO 11
  IF ~Global("X#ZEKE0","GLOBAL",0)
InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#ZEKE0","GLOBAL",1)~ EXTERN ~_VICONJ~ 257
  IF ~Global("X#ZEKE0","GLOBAL",0)
InParty("garrick")
InMyArea("garrick")
!StateCheck("garrick",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#ZEKE0","GLOBAL",1)~ GOTO 13
  IF ~Global("X#ZEKE0","GLOBAL",0)
InParty("garrick")
InMyArea("garrick")
!StateCheck("garrick",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#ZEKE0","GLOBAL",1)~ EXTERN ~_GARRIJ~ 266
END

IF ~~ THEN BEGIN 1 // from: 16.0 15.0 14.0 13.0 12.0 11.0 0.0 _VICONJ:259.0 _VICONJ:258.0 _VICONJ:257.0
  SAY #77084 /* ~Your loss.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 2 // from: 16.1 15.1 14.1 13.1 12.1 11.1 0.1 _VICONJ:259.1 _VICONJ:258.1 _VICONJ:257.1
  SAY #77085 /* ~You won't regret this!  Here's the scroll, and I wish you well.  Bye now.~ */
  IF ~~ THEN DO ~GiveItem("_SCRLPET",LastTalkedToBy)
TakePartyGold(500)
EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 3 // from: 16.2 15.2 14.2 13.2 12.2 11.2 0.2 _VICONJ:259.2 _VICONJ:258.2 _VICONJ:257.2
  SAY #77086 /* ~Well, if you ever get the money, I'll be here waiting.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #0 ~InParty("branwen")
~ THEN BEGIN 4 // from:
  SAY #77087 /* ~The statue has come to life!!~ */
  IF ~~ THEN DO ~EscapeArea()
~ EXIT
  IF ~Global("X#BranwenAlive","GLOBAL",0)
InParty("branwen")
InMyArea("branwen")
!StateCheck("branwen",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#BranwenAlive","GLOBAL",1)~ EXTERN ~_BRANWJ~ 33
END

IF ~~ THEN BEGIN 5 // from: 16.3 15.3 14.3 13.3 12.3 11.3 0.3 _VICONJ:259.3 _VICONJ:258.3 _VICONJ:257.3
  SAY #98501 /* ~The statue has come to life?! Gotta go!~ */
  IF ~~ THEN DO ~EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 6 // from: 16.4 15.4 14.4 13.4 12.4 11.4 0.4 _VICONJ:259.4 _VICONJ:258.4 _VICONJ:257.4
  SAY #98502 /* ~Er... Gotta go!~ */
  IF ~~ THEN DO ~EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 7 // from:
  SAY #98502 /* ~Er... Gotta go!~ */
  IF ~~ THEN DO ~EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 8 // from:
  SAY #98621 /* ~Why yes I do! As I said, for mere 500 gold...~ */
  IF ~~ THEN DO ~GiveItemCreate("_SCRLPET","jaheira",1,0,0)
~ EXIT
  IF ~  InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN GOTO 10
  IF ~  InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN EXTERN ~_JAHEIJ~ 126
  IF ~  InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN GOTO 9
  IF ~  InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN EXTERN ~_JAHEIJ~ 125
END

IF ~~ THEN BEGIN 9 // from: 8.3
  SAY #98623 /* ~OW! You... you hit me! ~ */
  IF ~~ THEN DO ~GiveItemCreate("_SCRLPET","jaheira",1,0,0)
~ EXIT
  IF ~  InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN GOTO 10
  IF ~  InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN EXTERN ~_JAHEIJ~ 126
END

IF ~~ THEN BEGIN 10 // from: 9.1 8.1
  SAY #98625 /* ~Well... Oookay. I wanted to see myself if that scroll would work...~ */
  IF ~~ THEN DO ~GiveItemCreate("_SCRLPET","jaheira",1,0,0)
~ EXIT
END

IF ~~ THEN BEGIN 11 // from: 0.6
  SAY #103799 /* ~A bargain at 500 gold!~ */
  IF ~~ THEN REPLY #77081 /* ~Sorry, we're not interested.~ */ GOTO 1
  IF ~PartyGoldGT(499)
~ THEN REPLY #77082 /* ~Sure, give us the scroll.~ */ GOTO 2
  IF ~~ THEN REPLY #77083 /* ~We don't have the money right now.~ */ GOTO 3
  IF ~  !InParty("branwen")
!StateCheck("branwen",CD_STATE_NOTVALID)
~ THEN REPLY #98500 /* ~You're too late. She is stone no longer.~ */ GOTO 5
  IF ~  Global("X#JaheiraZeke","GLOBAL",1)
~ THEN GOTO 6
  IF ~Global("X#JaheiraZeke","GLOBAL",0)
StateCheck("branwen",CD_STATE_NOTVALID)
InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#JaheiraZeke","GLOBAL",1)~ EXTERN ~_JAHEIJ~ 124
END

IF ~~ THEN BEGIN 12 // from: _VICONJ:257.6
  SAY #103799 /* ~A bargain at 500 gold!~ */
  IF ~~ THEN REPLY #77081 /* ~Sorry, we're not interested.~ */ GOTO 1
  IF ~PartyGoldGT(499)
~ THEN REPLY #77082 /* ~Sure, give us the scroll.~ */ GOTO 2
  IF ~~ THEN REPLY #77083 /* ~We don't have the money right now.~ */ GOTO 3
  IF ~  !InParty("branwen")
!StateCheck("branwen",CD_STATE_NOTVALID)
~ THEN REPLY #98500 /* ~You're too late. She is stone no longer.~ */ GOTO 5
  IF ~  Global("X#JaheiraZeke","GLOBAL",1)
~ THEN GOTO 6
  IF ~Global("X#JaheiraZeke","GLOBAL",0)
StateCheck("branwen",CD_STATE_NOTVALID)
InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#JaheiraZeke","GLOBAL",1)~ EXTERN ~_JAHEIJ~ 124
END

IF ~~ THEN BEGIN 13 // from: 0.8
  SAY #103797 /* ~Exactly, my friend. What say ye~ */
  IF ~~ THEN REPLY #77081 /* ~Sorry, we're not interested.~ */ GOTO 1
  IF ~PartyGoldGT(499)
~ THEN REPLY #77082 /* ~Sure, give us the scroll.~ */ GOTO 2
  IF ~~ THEN REPLY #77083 /* ~We don't have the money right now.~ */ GOTO 3
  IF ~  !InParty("branwen")
!StateCheck("branwen",CD_STATE_NOTVALID)
~ THEN REPLY #98500 /* ~You're too late. She is stone no longer.~ */ GOTO 5
  IF ~  Global("X#JaheiraZeke","GLOBAL",1)
~ THEN GOTO 6
  IF ~Global("X#JaheiraZeke","GLOBAL",0)
StateCheck("branwen",CD_STATE_NOTVALID)
InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#JaheiraZeke","GLOBAL",1)~ EXTERN ~_JAHEIJ~ 124
  IF ~  InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN GOTO 14
  IF ~  InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN EXTERN ~_VICONJ~ 258
END

IF ~~ THEN BEGIN 14 // from: 13.6 _VICONJ:258.6
  SAY #103799 /* ~A bargain at 500 gold!~ */
  IF ~~ THEN REPLY #77081 /* ~Sorry, we're not interested.~ */ GOTO 1
  IF ~PartyGoldGT(499)
~ THEN REPLY #77082 /* ~Sure, give us the scroll.~ */ GOTO 2
  IF ~~ THEN REPLY #77083 /* ~We don't have the money right now.~ */ GOTO 3
  IF ~  !InParty("branwen")
!StateCheck("branwen",CD_STATE_NOTVALID)
~ THEN REPLY #98500 /* ~You're too late. She is stone no longer.~ */ GOTO 5
  IF ~  Global("X#JaheiraZeke","GLOBAL",1)
~ THEN GOTO 6
  IF ~Global("X#JaheiraZeke","GLOBAL",0)
StateCheck("branwen",CD_STATE_NOTVALID)
InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#JaheiraZeke","GLOBAL",1)~ EXTERN ~_JAHEIJ~ 124
END

IF ~~ THEN BEGIN 15 // from:
  SAY #103797 /* ~Exactly, my friend. What say ye~ */
  IF ~~ THEN REPLY #77081 /* ~Sorry, we're not interested.~ */ GOTO 1
  IF ~PartyGoldGT(499)
~ THEN REPLY #77082 /* ~Sure, give us the scroll.~ */ GOTO 2
  IF ~~ THEN REPLY #77083 /* ~We don't have the money right now.~ */ GOTO 3
  IF ~  !InParty("branwen")
!StateCheck("branwen",CD_STATE_NOTVALID)
~ THEN REPLY #98500 /* ~You're too late. She is stone no longer.~ */ GOTO 5
  IF ~  Global("X#JaheiraZeke","GLOBAL",1)
~ THEN GOTO 6
  IF ~Global("X#JaheiraZeke","GLOBAL",0)
StateCheck("branwen",CD_STATE_NOTVALID)
InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#JaheiraZeke","GLOBAL",1)~ EXTERN ~_JAHEIJ~ 124
  IF ~  InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN GOTO 16
  IF ~  InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN EXTERN ~_VICONJ~ 259
END

IF ~~ THEN BEGIN 16 // from: 15.6 _VICONJ:259.6
  SAY #103799 /* ~A bargain at 500 gold!~ */
  IF ~~ THEN REPLY #77081 /* ~Sorry, we're not interested.~ */ GOTO 1
  IF ~PartyGoldGT(499)
~ THEN REPLY #77082 /* ~Sure, give us the scroll.~ */ GOTO 2
  IF ~~ THEN REPLY #77083 /* ~We don't have the money right now.~ */ GOTO 3
  IF ~  !InParty("branwen")
!StateCheck("branwen",CD_STATE_NOTVALID)
~ THEN REPLY #98500 /* ~You're too late. She is stone no longer.~ */ GOTO 5
  IF ~  Global("X#JaheiraZeke","GLOBAL",1)
~ THEN GOTO 6
  IF ~Global("X#JaheiraZeke","GLOBAL",0)
StateCheck("branwen",CD_STATE_NOTVALID)
InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#JaheiraZeke","GLOBAL",1)~ EXTERN ~_JAHEIJ~ 124
END
