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

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

IF WEIGHT #1 /* Triggers after states #: 8 even though they appear after this state */
~ReactionGT(LastTalkedToBy,NEUTRAL_UPPER)
~ THEN BEGIN 0 // from:
  SAY #87656 /* ~It was unbearable; waking each morn to the mud and rock instead of the rising sun.  I am Xan, a Greycloak of Evereska, and as proficient in the ways of magic as any man can be.  If you be enemies of Mulahey I would join your cause, hopeless though it is.~ */
  IF ~~ THEN REPLY #87657 /* ~Certainly you are welcome to join with me.  Another pair of hands can only help, especially when they are proficient in the ways of magic.~ */ GOTO 5
  IF ~~ THEN REPLY #87658 /* ~It's hard enough trying to keep our hopes up without you to bring them down.  I'd rather you didn't join us.~ */ GOTO 4
  IF ~~ THEN REPLY #87659 /* ~How did you come to be trapped in such an inhospitable place?~ */ GOTO 2
  IF ~Global("X#XAN0","GLOBAL",0)
InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#XAN0","GLOBAL",1)~ GOTO 12
  IF ~Global("X#XAN0","GLOBAL",0)
InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#XAN0","GLOBAL",1)~ EXTERN ~_VICONJ~ 255
  IF ~Global("X#XAN0","GLOBAL",0)
InParty("garrick")
InMyArea("garrick")
!StateCheck("garrick",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#XAN0","GLOBAL",1)~ EXTERN ~_GARRIJ~ 265
END

IF WEIGHT #2 /* Triggers after states #: 8 even though they appear after this state */
~ReactionLT(LastTalkedToBy,FRIENDLY_LOWER)
ReactionGT(LastTalkedToBy,HOSTILE_UPPER)
~ THEN BEGIN 1 // from:
  SAY #87660 /* ~At last I am free of my dreary prison; five and eighty days are far too long for one of the fair folk to live as a dwarf.  You look no better off than I, but my appreciation for my liberty bids me add my spells to your cause.  I am Xan; shall we face the impossible together?~ */
  IF ~~ THEN REPLY #87661 /* ~Certainly you are welcome to join with me.  Another pair of hands can only help, especially when they wield powerful magic.~ */ GOTO 5
  IF ~~ THEN REPLY #87658 /* ~It's hard enough trying to keep our hopes up without you to bring them down.  I'd rather you didn't join us.~ */ GOTO 4
  IF ~~ THEN REPLY #87659 /* ~How did you come to be trapped in such an inhospitable place?~ */ GOTO 2
  IF ~Global("X#GarXan2","GLOBAL",0)
InParty("garrick")
InMyArea("garrick")
!StateCheck("garrick",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#GarXan2","GLOBAL",1)~ EXTERN ~_GARRIJ~ 129
END

IF ~~ THEN BEGIN 2 // from: 14.2 13.2 12.2 1.2 0.2 _VICONJ:256.2 _VICONJ:255.2
  SAY #87662 /* ~Alas, I was sent to investigate the strange goings-on about this area and I landed caged for seemingly hopeless weeks on end.  I have not seen the sun almost as long as I have not seen my home.~ */
  IF ~~ THEN REPLY #87663 /* ~Certainly you are welcome to join with me.  Another pair of hands can only help, especially when they wield powerful magics..~ */ GOTO 5
  IF ~~ THEN REPLY #87658 /* ~It's hard enough trying to keep our hopes up without you to bring them down.  I'd rather you didn't join us.~ */ GOTO 4
  IF ~~ THEN REPLY #87664 /* ~If that is the case, I don't want you in my group.  How effective can you be if you were captured by this lot.~ */ GOTO 6
END

IF WEIGHT #3 /* Triggers after states #: 8 even though they appear after this state */
~ReactionLT(LastTalkedToBy,NEUTRAL_LOWER)
~ THEN BEGIN 3 // from:
  SAY #87665 /* ~I thank you for my rescue but I must leave quickly.  I wish you well in your struggle, though it is surely lost.~ */
  IF ~~ THEN DO ~TakePartyItem("_SW1H13")
MoveToPoint([113.695])
EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 4 // from: 14.1 13.1 12.1 2.1 1.1 0.1 _VICONJ:256.1 _VICONJ:255.1
  SAY #87666 /* ~I understand your decision, for the odds are surely insurmountable.  I shall return unto Evereska and report of these dire straits.~ */
  IF ~~ THEN DO ~TakePartyItem("_SW1H13")
MoveToPoint([113.695])
EscapeArea()
~ SOLVED_JOURNAL #87667 /* ~Xan

I rescued an elf named Xan from the mines in Nashkel.  Quite a despondent fellow, actually.  He was investigating the problems in the region just as I am.  We probably could have worked together, but I did not like his manner.~ */ EXIT
END

IF ~~ THEN BEGIN 5 // from: 14.0 13.0 12.0 2.0 1.0 0.0 _VICONJ:256.0 _VICONJ:255.0
  SAY #87668 /* ~I thank you.  However ineffective our actions be, I shall not rest until I have made payment to you.  If you have searched through Mulahey's treasure you may have found a sword among his documents.  The sword is a moonblade and it is my most valued possession.~ */
  IF ~~ THEN DO ~JoinParty()
~ SOLVED_JOURNAL #87669 /* ~Xan

I rescued an elf named Xan from the mines in Nashkel.  Quite a despondent fellow, actually.  He was investigating the problems in the region just as I am, so I accepted his offer to join with me.~ */ EXIT
  IF ~Global("X#SharXanJoin","GLOBAL",0)
InParty("sharteel")
InMyArea("sharteel")
!StateCheck("sharteel",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#SharXanJoin","GLOBAL",1)~ EXTERN ~_SHARTJ~ 80
END

IF ~~ THEN BEGIN 6 // from: 2.2
  SAY #87670 /* ~There is no need to be rude.  I will go back to my home in Evereska, and leave the lot of you to your hopeless quest.~ */
  IF ~~ THEN DO ~TakePartyItem("_SW1H13")
MoveToPoint([113.695])
EscapeArea()
~ SOLVED_JOURNAL #87667 /* ~Xan

I rescued an elf named Xan from the mines in Nashkel.  Quite a despondent fellow, actually.  He was investigating the problems in the region just as I am.  We probably could have worked together, but I did not like his manner.~ */ EXIT
END

IF ~~ THEN BEGIN 7 // from:
  SAY #87671 /* ~I apologize if I seem abrupt, but I must be leaving, and quickly.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #0 ~StateCheck(Myself,STATE_CHARMED)
GlobalLT("Chapter","GLOBAL",6)
~ THEN BEGIN 8 // from:
  SAY #86957 /* ~If you are interested friend, I am a Greycloak from Evereksa.  It is my duty to watch over the political events of the human nations along our borders.  From what I have learned so far, there is some sort of mercantile organization known as the Iron Throne that has been trying to cause turmoil along the Sword Coast.  To what end I could not tell you, as I was captured before learning any more.~ */
  IF ~~ THEN UNSOLVED_JOURNAL #87672 /* ~The Iron Throne

While in the Nashkel mines, I rescued an elf named Xan.  When charmed, he revealed that there is some sort of mercantile organization known as the Iron Throne that has been trying to cause turmoil along the Sword Coast.  To what end, he could not say.~ */ EXIT
END

IF ~~ THEN BEGIN 9 // from:
  SAY #86955 /* ~This whole mission has been a dismal failure from the very start. Consider my debt repaid, friends, as I certainly do.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 10 // from:
  SAY #86956 /* ~While my stay with you was admittedly fruitless, it has, at least, been fun. I might even enjoy sharing another ill-fated adventure with you, should you ever require the use of my considerable talents.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 11 // from: _SHARTJ:80.1
  SAY #94999 /* ~*sigh*~ */
  IF ~~ THEN DO ~JoinParty()
~ SOLVED_JOURNAL #87669 /* ~Xan

I rescued an elf named Xan from the mines in Nashkel.  Quite a despondent fellow, actually.  He was investigating the problems in the region just as I am, so I accepted his offer to join with me.~ */ EXIT
END

IF ~~ THEN BEGIN 12 // from: 0.3
  SAY #103795 /* ~A... drow! I am surely dead.~ */
  IF ~~ THEN REPLY #87657 /* ~Certainly you are welcome to join with me.  Another pair of hands can only help, especially when they are proficient in the ways of magic.~ */ GOTO 5
  IF ~~ THEN REPLY #87658 /* ~It's hard enough trying to keep our hopes up without you to bring them down.  I'd rather you didn't join us.~ */ GOTO 4
  IF ~~ THEN REPLY #87659 /* ~How did you come to be trapped in such an inhospitable place?~ */ GOTO 2
END

IF ~~ THEN BEGIN 13 // from: _VICONJ:255.3
  SAY #103795 /* ~A... drow! I am surely dead.~ */
  IF ~~ THEN REPLY #87657 /* ~Certainly you are welcome to join with me.  Another pair of hands can only help, especially when they are proficient in the ways of magic.~ */ GOTO 5
  IF ~~ THEN REPLY #87658 /* ~It's hard enough trying to keep our hopes up without you to bring them down.  I'd rather you didn't join us.~ */ GOTO 4
  IF ~~ THEN REPLY #87659 /* ~How did you come to be trapped in such an inhospitable place?~ */ GOTO 2
END

IF ~~ THEN BEGIN 14 // from: _VICONJ:256.3
  SAY #103795 /* ~A... drow! I am surely dead.~ */
  IF ~~ THEN REPLY #87657 /* ~Certainly you are welcome to join with me.  Another pair of hands can only help, especially when they are proficient in the ways of magic.~ */ GOTO 5
  IF ~~ THEN REPLY #87658 /* ~It's hard enough trying to keep our hopes up without you to bring them down.  I'd rather you didn't join us.~ */ GOTO 4
  IF ~~ THEN REPLY #87659 /* ~How did you come to be trapped in such an inhospitable place?~ */ GOTO 2
END
