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

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

IF WEIGHT #3 /* Triggers after states #: 1 3 5 even though they appear after this state */
~  Global("HelpGhorak","GLOBAL",1)
~ THEN BEGIN 0 // from:
  SAY #15216 /* ~Diseased! Diseased! Stand well back... Diseased! Diseased!~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #0 ~  Global("HelpAgnasia","GLOBAL",0)
~ THEN BEGIN 1 // from:
  SAY #15217 /* ~For your own health and that of your children, come no closer. I was cursed with this fell disease as punishment for my wickedness... Diseased! Diseased! Stand well back...~ */
  IF ~~ THEN REPLY #17177 /* ~Let us cure you of your affliction.~ */ GOTO 2
  IF ~~ THEN REPLY #17178 /* ~I'm sorry, but there is little that we can do to help you.~ */ DO ~EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 2 // from: 1.0
  SAY #15221 /* ~No, your potions and magics are of little use. The only way to cure this sickness is to right the wrongs of the past. Behind a painting at the Three Old Kegs, you will find the skull of my brother, Kereph. Take it to Agnasia in The Lady's Hall. She will know what to do with it.~ */
  IF ~~ THEN DO ~SetGlobal("HelpGhorak","GLOBAL",1)
~ UNSOLVED_JOURNAL #27128 /* ~Ghorak the Diseased
When I offered to cure Ghorak the diseased, he asked me to fetch his brother's skull from its hiding place behind a painting in the Three Old Kegs. Then Ghorak wants me to present Kereph's skull to Agnasia in The Lady's Hall. I can't wait to hear what she has to say about that.~ */ EXIT
  IF ~Global("X#GarGor","GLOBAL",0)
InParty("garrick")
InMyArea("garrick")
!StateCheck("garrick",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#GarGor","GLOBAL",1)~ EXTERN ~GARRIJ~ 64
END

IF WEIGHT #1 ~  Global("HelpAgnasia","GLOBAL",1)
~ THEN BEGIN 3 // from:
  SAY #15222 /* ~I— I am cured. After all these long years of rotting away, an end has come. Blessed be Tymora and may my brother at last have peace. You are kinder than you'll ever know.~ */
  IF ~~ THEN DO ~EraseJournalEntry(27128)
EraseJournalEntry(27129)
Polymorph(FIGHTER_MALE_HUMAN)
~ SOLVED_JOURNAL #27130 /* ~Ghorak the Cured!
As expected, returning Kereph's skull to a follower of Tymora lifted the wasting curse from Ghorak. At last, both brothers have found peace.~ */ EXIT
END

IF WEIGHT #4 /* Triggers after states #: 5 even though they appear after this state */
~  True()
~ THEN BEGIN 4 // from:
  SAY #15223 /* ~Not diseased! Not diseased! Come as close as you want... Not diseased! Not diseased!~ */
  IF ~~ THEN EXIT
  IF ~Global("X#QuaGhor","GLOBAL",0)
InParty("quayle")
InMyArea("quayle")
!StateCheck("quayle",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#QuaGhor","GLOBAL",1)~ EXTERN ~QUAYLJ~ 29
END

IF WEIGHT #2 ~  False()
~ THEN BEGIN 5 // from:
  SAY #15224 /* ~I have nothing but my past and, I assure you, you do not want it.~ */
  IF ~~ THEN DO ~EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 6 // from:
  SAY #47500 /* ~What? Oh, you misunderstand. How wonderful to be healthy again!~ */
  IF ~~ THEN EXIT
END
