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

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

IF ~~ THEN BEGIN 0 // from: 19.1
  SAY #17792 /* ~As you wish.  If you change your mind, I would still like to travel with you... I still think I have much to see in this world.  I will return to my cabin in the hills, for now.~ [VALYGA88] */
  IF ~!AreaCheck("AR0601")
!AreaCheck("AR0602")
!AreaCheck("AR0603")
!AreaCheck("AR0410")
!AreaCheck("AR0411")
!AreaCheck("AR0412")
!AreaCheck("AR0413")
!AreaCheck("AR0414")
!AreaCheck("AR1512")
!AreaCheck("AR1513")
!AreaCheck("AR1514")
!AreaCheck("AR1515")
!AreaCheck("AR1516")
!AreaCheck("AR1501")
!AreaCheck("AR1502")
!AreaCheck("AR1503")
!AreaCheck("AR1504")
!AreaCheck("AR1505")
!AreaCheck("AR1506")
!AreaCheck("AR1507")
!AreaCheck("AR1508")
!AreaCheck("AR1509")
!AreaCheck("AR1510")
!AreaCheck("AR1511")
!AreaCheck("AR2100")
!AreaCheck("AR2101")
!AreaCheck("AR2102")
!AreaCheck("AR2200")
!AreaCheck("AR2202")
!AreaCheck("AR2203")
!AreaCheck("AR2204")
!AreaCheck("AR2205")
!AreaCheck("AR2206")
!AreaCheck("AR2207")
!AreaCheck("AR2208")
!AreaCheck("AR2209")
!AreaCheck("AR2210")
!AreaCheck("AR2300")
!AreaCheck("AR2400")
!AreaCheck("AR2401")
!AreaCheck("AR2402")
!AreaCheck("AR2900")
!AreaCheck("AR2901")
!AreaCheck("AR2902")
!AreaCheck("AR2903")
!AreaCheck("AR2904")
!AreaCheck("AR2905")
!AreaCheck("AR2906")~ THEN REPLY #61166 /* ~All right, we'll go there if we need you again.~ */ DO ~SetGlobal("KickedOut","LOCALS",1)
EscapeAreaMove("AR1101",405,327,0)
~ EXIT
  IF ~!AreaCheck("AR0301")
!AreaCheck("AR0302")
!AreaCheck("AR0303")
!AreaCheck("AR0304")
!AreaCheck("AR0305")
!AreaCheck("AR0306")
!AreaCheck("AR0307")
!AreaCheck("AR0509")
!AreaCheck("AR0510")
!AreaCheck("AR0511")
!AreaCheck("AR1102")
!AreaCheck("AR1107")
!AreaCheck("AR0801")
!AreaCheck("AR0803")
!AreaCheck("AR1300")
!AreaCheck("AR1301")
!AreaCheck("AR1302")
!AreaCheck("AR1303")
!AreaCheck("AR0604")
!AreaCheck("AR0605")
!AreaCheck("AR0606")
!InWatchersKeep()
~ THEN REPLY #61168 /* ~That's not possible.  Why don't you just wait right here, and if we need you again, we'll come get you.~ */ DO ~SetGlobal("KickedOut","LOCALS",1)~ EXIT
END

IF ~~ THEN BEGIN 1 // from: 19.2
  SAY #17794 /* ~I see.  I cannot defeat Lavok on my own.  I do not know how I am to get home, but look for me there if you wish to have me back.  I will be at my cabin in the hills.~ [VALYGA89] */
  IF ~!AreaCheck("AR0601")
!AreaCheck("AR0602")
!AreaCheck("AR0603")
!AreaCheck("AR0410")
!AreaCheck("AR0411")
!AreaCheck("AR0412")
!AreaCheck("AR0413")
!AreaCheck("AR0414")
!AreaCheck("AR1512")
!AreaCheck("AR1513")
!AreaCheck("AR1514")
!AreaCheck("AR1515")
!AreaCheck("AR1516")
!AreaCheck("AR1501")
!AreaCheck("AR1502")
!AreaCheck("AR1503")
!AreaCheck("AR1504")
!AreaCheck("AR1505")
!AreaCheck("AR1506")
!AreaCheck("AR1507")
!AreaCheck("AR1508")
!AreaCheck("AR1509")
!AreaCheck("AR1510")
!AreaCheck("AR1511")
!AreaCheck("AR2100")
!AreaCheck("AR2101")
!AreaCheck("AR2102")
!AreaCheck("AR2200")
!AreaCheck("AR2202")
!AreaCheck("AR2203")
!AreaCheck("AR2204")
!AreaCheck("AR2205")
!AreaCheck("AR2206")
!AreaCheck("AR2207")
!AreaCheck("AR2208")
!AreaCheck("AR2209")
!AreaCheck("AR2210")
!AreaCheck("AR2300")
!AreaCheck("AR2400")
!AreaCheck("AR2401")
!AreaCheck("AR2402")
!AreaCheck("AR2900")
!AreaCheck("AR2901")
!AreaCheck("AR2902")
!AreaCheck("AR2903")
!AreaCheck("AR2904")
!AreaCheck("AR2905")
!AreaCheck("AR2906")~ THEN REPLY #61167 /* ~All right, we'll go there if we need you again.~ */ DO ~SetGlobal("KickedOut","LOCALS",1)
EscapeAreaMove("AR1101",405,327,0)~ EXIT
  IF ~!AreaCheck("AR0301")
!AreaCheck("AR0302")
!AreaCheck("AR0303")
!AreaCheck("AR0304")
!AreaCheck("AR0305")
!AreaCheck("AR0306")
!AreaCheck("AR0307")
!AreaCheck("AR0509")
!AreaCheck("AR0510")
!AreaCheck("AR0511")
!AreaCheck("AR1102")
!AreaCheck("AR1107")
!AreaCheck("AR0801")
!AreaCheck("AR0803")
!AreaCheck("AR1300")
!AreaCheck("AR1301")
!AreaCheck("AR1302")
!AreaCheck("AR1303")
!AreaCheck("AR0604")
!AreaCheck("AR0605")
!AreaCheck("AR0606")
!InWatchersKeep()
~ THEN REPLY #61169 /* ~That's not possible.  Why don't you just wait right here, and if we need you again, we'll come get you.~ */ DO ~SetGlobal("KickedOut","LOCALS",1)~ EXIT
END

IF WEIGHT #2 /* Triggers after states #: 12 16 even though they appear after this state */
~OR(2)
Dead("lavok02")
Dead("lavok01")
Global("LavokDead","GLOBAL",0)
Global("KickedOut","LOCALS",1)~ THEN BEGIN 2 // from:
  SAY #18693 /* ~He is dead.  Lavok the necromancer is finally dead.  I can scarce believe it.~ [VALYGA75] */
  IF ~~ THEN DO ~SetGlobal("LavokDead","GLOBAL",1)~ GOTO 3
END

IF ~~ THEN BEGIN 3 // from: 2.0
  SAY #18687 /* ~My family's vow has been fulfilled, and I am now safe, and yet I feel no satisfaction.  I had no idea that it would be like this.~ [VALYGA76] */
  IF ~~ THEN GOTO 4
END

IF ~~ THEN BEGIN 4 // from: 3.0
  SAY #18688 /* ~Could he actually have been redeemed?  After all that time?  Did he actually fight that demon to prevent it from escaping the sphere?~ [VALYGA99] */
  IF ~~ THEN GOTO 5
END

IF ~~ THEN BEGIN 5 // from: 4.0
  SAY #18689 /* ~If you had asked me such a question even a day ago, I would have answered that such redemption was impossible.  Now I am not so sure.~ [VALYGA77] */
  IF ~~ THEN GOTO 6
END

IF ~~ THEN BEGIN 6 // from: 5.0
  SAY #18690 /* ~I think, perhaps, that I do not know all that I think I do.  I have not seen as much of the world as I thought I did.  A disturbing realization.~ [VALYGA78] */
  IF ~~ THEN GOTO 7
END

IF ~~ THEN BEGIN 7 // from: 6.0
  SAY #18691 /* ~I would continue to travel with you, if you would allow me.  If there is so much I am not aware of, I must discover it.  Will you have me?~ [VALYGA79] */
  IF ~~ THEN REPLY #18692 /* ~I would be glad to have you in my company, Valygar.~ */ DO ~EraseJournalEntry(6509)
EraseJournalEntry(6534)
EraseJournalEntry(7994)
EraseJournalEntry(7995)
EraseJournalEntry(8126)
EraseJournalEntry(8127)
EraseJournalEntry(8128)
EraseJournalEntry(8129)
EraseJournalEntry(10128)
EraseJournalEntry(16302)
EraseJournalEntry(16343)
EraseJournalEntry(16524)
EraseJournalEntry(16544)
EraseJournalEntry(16569)
EraseJournalEntry(20179)
EraseJournalEntry(20365)
EraseJournalEntry(20453)
EraseJournalEntry(23371)
EraseJournalEntry(23409)
EraseJournalEntry(3422)
EraseJournalEntry(6557)
EraseJournalEntry(7241)
EraseJournalEntry(9705)
EraseJournalEntry(9919)
EraseJournalEntry(10047)
EraseJournalEntry(23551)~ SOLVED_JOURNAL #15735 /* ~Valygar's family quest is over.

Valygar's quest is finally done.  Lavok was not what he expected, and has caused the normally judgmental ranger to think deeply about what he has experienced.  With the necromancer dead and the Cowled Wizards no longer hunting him, Valygar has asked to continue traveling with me.  I have accepted him back into the group.~ */ GOTO 8
  IF ~~ THEN REPLY #18695 /* ~As you wish, although I cannot promise it will be for long.~ */ DO ~EraseJournalEntry(6509)
EraseJournalEntry(6534)
EraseJournalEntry(7994)
EraseJournalEntry(7995)
EraseJournalEntry(8126)
EraseJournalEntry(8127)
EraseJournalEntry(8128)
EraseJournalEntry(8129)
EraseJournalEntry(10128)
EraseJournalEntry(16302)
EraseJournalEntry(16343)
EraseJournalEntry(16524)
EraseJournalEntry(16544)
EraseJournalEntry(16569)
EraseJournalEntry(20179)
EraseJournalEntry(20365)
EraseJournalEntry(20453)
EraseJournalEntry(23371)
EraseJournalEntry(23409)
EraseJournalEntry(3422)
EraseJournalEntry(6557)
EraseJournalEntry(7241)
EraseJournalEntry(9705)
EraseJournalEntry(9919)
EraseJournalEntry(10047)
EraseJournalEntry(23551)~ SOLVED_JOURNAL #15735 /* ~Valygar's family quest is over.

Valygar's quest is finally done.  Lavok was not what he expected, and has caused the normally judgmental ranger to think deeply about what he has experienced.  With the necromancer dead and the Cowled Wizards no longer hunting him, Valygar has asked to continue traveling with me.  I have accepted him back into the group.~ */ GOTO 9
  IF ~~ THEN REPLY #18696 /* ~I do not think it would be wise, Valygar.  I suggest you find your own way.~ */ DO ~EraseJournalEntry(6509)
EraseJournalEntry(6534)
EraseJournalEntry(7994)
EraseJournalEntry(7995)
EraseJournalEntry(8126)
EraseJournalEntry(8127)
EraseJournalEntry(8128)
EraseJournalEntry(8129)
EraseJournalEntry(10128)
EraseJournalEntry(16302)
EraseJournalEntry(16343)
EraseJournalEntry(16524)
EraseJournalEntry(16544)
EraseJournalEntry(16569)
EraseJournalEntry(20179)
EraseJournalEntry(20365)
EraseJournalEntry(20453)
EraseJournalEntry(23371)
EraseJournalEntry(23409)
EraseJournalEntry(3422)
EraseJournalEntry(6557)
EraseJournalEntry(7241)
EraseJournalEntry(9705)
EraseJournalEntry(9919)
EraseJournalEntry(10047)
EraseJournalEntry(23551)~ SOLVED_JOURNAL #15739 /* ~Valygar's family quest is over.

Valygar's quest is finally done.  Lavok was not what he expected, and has caused the normally judgmental ranger to think deeply about what he has experienced.  With the necromancer dead and the Cowled Wizards no longer hunting him, Valygar has asked to continue traveling with me.  I have declined, and the ranger told me that he could be found at his home in the Docks District should I have need of him in the future.~ */ GOTO 10
  IF ~~ THEN REPLY #18697 /* ~I've no desire to travel with a useless lout like yourself.  You haven't seen nearly half the world as I have, and I'll not be the one to teach it to a mewling brat like yourself.~ */ DO ~EraseJournalEntry(6509)
EraseJournalEntry(6534)
EraseJournalEntry(7994)
EraseJournalEntry(7995)
EraseJournalEntry(8126)
EraseJournalEntry(8127)
EraseJournalEntry(8128)
EraseJournalEntry(8129)
EraseJournalEntry(10128)
EraseJournalEntry(16302)
EraseJournalEntry(16343)
EraseJournalEntry(16524)
EraseJournalEntry(16544)
EraseJournalEntry(16569)
EraseJournalEntry(20179)
EraseJournalEntry(20365)
EraseJournalEntry(20453)
EraseJournalEntry(23371)
EraseJournalEntry(23409)
EraseJournalEntry(3422)
EraseJournalEntry(6557)
EraseJournalEntry(7241)
EraseJournalEntry(9705)
EraseJournalEntry(9919)
EraseJournalEntry(10047)
EraseJournalEntry(23551)~ SOLVED_JOURNAL #23561 /* ~Valygar's family quest is over.

Valygar's quest is finally done.  Lavok was not what he expected, and has caused the normally judgmental ranger to think deeply about what he has experienced.  With the necromancer dead and the Cowled Wizards no longer hunting him, the ranger has gone on his own way.  I doubt I shall see him again.~ */ GOTO 11
END

IF ~~ THEN BEGIN 8 // from: 7.0
  SAY #18698 /* ~My thanks, <CHARNAME>.  I will not fail you.~ */
  IF ~~ THEN DO ~DestroyItem("misc7l")
SetGlobal("KickedOut","LOCALS",0)
JoinParty()
~ EXIT
END

IF ~~ THEN BEGIN 9 // from: 7.1
  SAY #18699 /* ~I will travel with you for as long as I can, <CHARNAME>.  Without you, I would still be hiding in the forest.  You have my thanks and my company for as loyalty as you wish it.~ */
  IF ~~ THEN DO ~DestroyItem("misc7l")
SetGlobal("KickedOut","LOCALS",0)
JoinParty()~ EXIT
END

IF ~~ THEN BEGIN 10 // from: 7.2
  SAY #18700 /* ~I shall return to my home here in the city, then.  If you change your mind, I shall be there for a short while before I leave for good.  I wish you well on your journey, my friend.~ */
  IF ~~ THEN DO ~EscapeAreaMove("AR1101",405,327,0)~ EXIT
END

IF ~~ THEN BEGIN 11 // from: 7.3
  SAY #18701 /* ~Hm.  A side to you I hadn't noticed.  Very well... I'll find my own way and likely be the better for it.  I wish you well, <CHARNAME>.~ */
  IF ~~ THEN DO ~ActionOverride("hervo",DestroySelf())
EscapeArea()~ EXIT
END

IF WEIGHT #0 ~OR(2)
Global("ValygarHome","GLOBAL",1)
Global("KickedOut","LOCALS",1)
!Dead("lavok01")
!Dead("lavok02")~ THEN BEGIN 12 // from:
  SAY #19440 /* ~Ah, I see you have tracked me down here.  Have you changed your mind regarding my proposal?~ [VALYGA85] */
  IF ~~ THEN REPLY #19442 /* ~Yes, I have.  Join me and we will enter the planar sphere together.~ */ GOTO 13
  IF ~~ THEN REPLY #19443 /* ~No.  But I have changed my mind about bringing your body to the Cowled Wizards!~ */ GOTO 14
  IF ~~ THEN REPLY #19444 /* ~No.  Actually, I'll be leaving again.~ */ GOTO 15
END

IF ~~ THEN BEGIN 13 // from: 12.0
  SAY #19445 /* ~I thank you for helping me this way.  I am nervous about the possibility of facing my ancestor, not to mention the Cowled Wizards, but it must be done if I am to have peace.~ */
  IF ~~ THEN DO ~DestroyItem("misc7l")
SetGlobal("KickedOut","LOCALS",0)
JoinParty()
SetGlobal("BetrayedCowled","GLOBAL",1)~ EXIT
END

IF ~~ THEN BEGIN 14 // from: 12.1
  SAY #19446 /* ~Bastard and traitor!  As you wish!  You'll not find Valygar a sitting target!!~ */
  IF ~~ THEN DO ~Enemy()~ EXIT
END

IF ~~ THEN BEGIN 15 // from: 12.2
  SAY #19448 /* ~As you wish.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #1 ~Global("LavokDead","GLOBAL",1)
OR(2)
Global("ValygarHome","GLOBAL",1)
Global("KickedOut","LOCALS",1)
OR(2)
Dead("lavok01")
Dead("lavok02")~ THEN BEGIN 16 // from:
  SAY #19449 /* ~Greetings once again, my friend.  Have you changed your mind about my joining your travels?~ [VALYGA86] */
  IF ~~ THEN REPLY #19451 /* ~I have.  I would welcome your presence.~ */ GOTO 17
  IF ~~ THEN REPLY #19452 /* ~No, not really.  I'll be on my way again.~ */ GOTO 18
END

IF ~~ THEN BEGIN 17 // from: 16.0
  SAY #19453 /* ~I look forward to your companionship.  Let us be underway, then.~ */
  IF ~~ THEN DO ~DestroyItem("misc7l")
SetGlobal("KickedOut","LOCALS",0)
JoinParty()~ EXIT
END

IF ~~ THEN BEGIN 18 // from: 16.1
  SAY #19454 /* ~As you wish.  I will not remain here long, however.  A safe journey to you, friend.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #4 /* Triggers after states #: 21 even though they appear after this state */
~Global("KickedOut","LOCALS",0)~ THEN BEGIN 19 // from:
  SAY #48339 /* ~(sigh) Are we through? I should like to know if we are to continue.~ [VALYGA87] */
  IF ~~ THEN REPLY #48340 /* ~Yes, let's go.~ */ GOTO 20
  IF ~//Dead("lavok02")
True()~ THEN REPLY #48341 /* ~No, we should split up for now.~ */ GOTO 0
  IF ~//!Dead("lavok02")
False()~ THEN REPLY #61165 /* ~No, we should split up for now.~ */ GOTO 1
END

IF ~~ THEN BEGIN 20 // from: 19.0
  SAY #48350 /* ~Good. Let's not waste time here.~ */
  IF ~~ THEN DO ~SetGlobal("KickedOut","LOCALS",0)
JoinParty()~ EXIT
END

IF WEIGHT #3 ~Global("KickedOut","LOCALS",0)
HappinessLT(Myself,-290)~ THEN BEGIN 21 // from:
  SAY #61164 /* ~I'll not stand about and participate in your degenerate activities any longer, <CHARNAME>.  I'll find my own way and leave you to yours.~ */
  IF ~~ THEN DO ~SetGlobal("KickedOut","LOCALS",1)
EscapeArea()~ EXIT
END
