// creator  : weidu.exe (version 23100)
// argument : KAYPAL02.DLG
// game		 : .
// source	 : ./DATA/DIALOG.BIF
// dialog	 : ./DIALOG.TLK
// dialogF  : (none)

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

IF WEIGHT #0 ~NumTimesTalkedTo(0)
!Dead("kaysmg01")
!StateCheck("kaysmg01",STATE_SLEEPING)~ THEN BEGIN 0 // from:
  SAY #31725 /* ~We shall not allow you to continue your depredations here, Rindus.  Take your men and begone... your smuggling will be tolerated no longer.~ */
  IF ~~ THEN EXTERN ~KAYSMG01~ 0
END

IF ~~ THEN BEGIN 1 // from: KAYSMG01:0.0
  SAY #31727 /* ~We have no interest in your 'turf', Rindus, and it is only proof of your limited mind that you think this is so.~ */
  IF ~~ THEN EXTERN ~KAYSMG01~ 1
END

IF WEIGHT #1 ~Global("KaylStartFight","GLOBAL",2)
Global("KaylPartyHelped","GLOBAL",1)
Global("ReynaldJob","GLOBAL",0)
Global("TalkedAfterFight","LOCALS",0)~ THEN BEGIN 2 // from:
  SAY #31728 /* ~Greetings to you, friend.  I am grateful for your aid against these dogs, and would know your name if you are willing to give it.~ */
  IF ~~ THEN REPLY #31730 /* ~Who I am matters not, just be grateful that I arrived when I did.~ */ DO ~SetGlobal("TalkedAfterFight","LOCALS",1)~ GOTO 3
  IF ~~ THEN REPLY #31729 /* ~I am <CHARNAME>.~ */ DO ~SetGlobal("TalkedAfterFight","LOCALS",1)~ GOTO 15
END

IF ~~ THEN BEGIN 3 // from: 13.0 2.0
  SAY #31732 /* ~Fairly said,  I'll pry no further.  My name is Reynald de Chatillon, formerly of the Order.  I am now led by one Anarg...  Might you be interested in employment?~ */
  IF ~~ THEN REPLY #31736 /* ~No, I think not.~ */ GOTO 7
  IF ~~ THEN REPLY #31735 /* ~If the pay is adequate, you might hire our services.~ */ GOTO 4
  IF ~~ THEN REPLY #59865 /* ~How did you come to leave the Order?~ */ GOTO 16
END

IF ~~ THEN BEGIN 4 // from: 22.0 19.1 15.1 3.1
  SAY #31734 /* ~As for the task... when Anarg left the Order, the Paladins stripped his Cup from him.  The Cup is... important to him.  Perhaps you could retrieve it.~ */
  IF ~~ THEN REPLY #31740 /* ~Where will we find this cup?~ */ GOTO 5
END

IF ~~ THEN BEGIN 5 // from: 4.0
  SAY #31742 /* ~Find the Most Noble Order of the Radiant Heart in the Temple district.  The cup is within their building.   You shall be rewarded admirably for its return.~ */
  IF ~~ THEN REPLY #31752 /* ~I have no desire to look for a stupid cup, so long.~ */ GOTO 7
  IF ~~ THEN REPLY #31744 /* ~We'll go now and retrieve this Cup for you, although it hardly seems a test of our abilities.~ */ GOTO 6
END

IF ~~ THEN BEGIN 6 // from: 8.0 5.1
  SAY #31746 /* ~You'd best be prepared, the Order is strongly defended.  I, myself, would die quickly if I stepped near their Hall.  I wish you well, my <LADYLORD>.~ */
  IF ~!IsValidForPartyDialog("Keldorn")
!IsValidForPartyDialog("Anomen")~ THEN DO ~SetGlobal("ReynaldJob","GLOBAL",1)
SetGlobal("KaylStartFight","GLOBAL",3)~ UNSOLVED_JOURNAL #34245 /* ~Seek out and investigate the Fallen Paladins.

I have spoken to Reynald de Chatillon, a member of the Fallen Paladins, who promises to introduce me to Anarg if I can get ahold of a cup that belonged to Anarg and is still in the possession of the Order.  The cup, it seems, is largely ceremonial but important to Anarg personally.~ */ EXIT
  IF ~IsValidForPartyDialog("Keldorn")~ THEN DO ~SetGlobal("ReynaldJob","GLOBAL",1)
SetGlobal("KaylStartFight","GLOBAL",3)~ GOTO 23
  IF ~!IsValidForPartyDialog("Keldorn")
IsValidForPartyDialog("Anomen")~ THEN DO ~SetGlobal("ReynaldJob","GLOBAL",1)
SetGlobal("KaylStartFight","GLOBAL",3)~ GOTO 24
END

IF ~~ THEN BEGIN 7 // from: 19.0 15.0 8.1 5.0 3.0
  SAY #31754 /* ~As you wish.  Should you change your mind in the future, I am sure that I can still be contacted here.  I look forward to meeting you again, my <LADYLORD>.~ */
  IF ~~ THEN DO ~SetGlobal("KaylStartFight","GLOBAL",3)
~ EXIT
END

IF WEIGHT #3 /* Triggers after states #: 13 even though they appear after this state */
~Global("ReynaldJob","GLOBAL",0)
Global("TalkedAfterFight","LOCALS",1)~ THEN BEGIN 8 // from:
  SAY #31755 /* ~You have returned, my <LADYLORD>?  Have you changed your mind?  Will you retrieve Anarg's cup for me, as I have requested?~ */
  IF ~~ THEN REPLY #31756 /* ~Yes Reynald, we are now ready for this task you ask of us.~ */ GOTO 6
  IF ~~ THEN REPLY #31757 /* ~I think not.~ */ GOTO 7
END

IF WEIGHT #4 /* Triggers after states #: 13 even though they appear after this state */
~Global("ReynaldJob","GLOBAL",1)
!PartyHasItem("misc6i")~ THEN BEGIN 9 // from:
  SAY #31758 /* ~You return, my <LADYLORD>... but you do not have Anarg's cup with you.  Is something amiss?~ */
  IF ~~ THEN REPLY #31759 /* ~Sorry, I am on my way to do it now.~ */ GOTO 10
END

IF ~~ THEN BEGIN 10 // from: 11.1 9.0
  SAY #31760 /* ~Excellent.  I shall see you anon.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #5 /* Triggers after states #: 13 even though they appear after this state */
~Global("ReynaldJob","GLOBAL",1)
PartyHasItem("misc6i")
Global("reySaidThis","LOCALS",0)~ THEN BEGIN 11 // from:
  SAY #31767 /* ~You return, my <LADYLORD>.  Were you successful?  Do you come with Anarg's cup in your possession?~ */
  IF ~~ THEN REPLY #31768 /* ~Yes, we have it.~ */ DO ~SetGlobal("reySaidThis","LOCALS",1)
AddExperienceParty(10250)~ GOTO 12
  IF ~~ THEN REPLY #31769 /* ~No, not yet.  But I intend to get it.~ */ GOTO 10
END

IF ~~ THEN BEGIN 12 // from: 11.0
  SAY #31771 /* ~You do?  I had almost not dared to think it possible.  You are very resourceful.  Come... I shall introduce you to Anarg, now.~ */
  IF ~~ THEN DO ~CreateCreatureObjectOffScreen("kaypal01",Myself,0,0,0)~ EXIT
END

IF WEIGHT #2 ~Global("KaylStartFight","GLOBAL",2)
Global("KaylPartyHelped","GLOBAL",0)
Global("ReynaldJob","GLOBAL",0)
Global("TalkedAfterFight","LOCALS",0)~ THEN BEGIN 13 // from:
  SAY #32113 /* ~You there... you watch us fight, yet lift no finger to assist.  So obviously you have business with us.  Might I ask its nature, and your name as well?~ */
  IF ~~ THEN REPLY #32114 /* ~We are searching for your leader, to discuss a business opportunity.  As for my name, it does not matter.~ */ DO ~SetGlobal("TalkedAfterFight","LOCALS",1)~ GOTO 3
  IF ~~ THEN REPLY #59875 /* ~My name is <CHARNAME>, and I am seeking your leader, to discuss business.~ */ DO ~SetGlobal("TalkedAfterFight","LOCALS",1)~ GOTO 15
END

IF ~~ THEN BEGIN 14 // from: KAYSMG01:2.0
  SAY #59860 /* ~You know nothing of her, fool!  And while I may no longer meet the Order's standards, I'll not stand by and listen to a cur such as you cheapen Celestine's name!~ */
  IF ~~ THEN DO ~SetGlobal("KaylStartFight","GLOBAL",1)~ EXIT
END

IF ~~ THEN BEGIN 15 // from: 13.1 2.1
  SAY #59861 /* ~Well met, <CHARNAME>.  I am Reynald de Chatillon, once of the Order and now under the leadership of Anarg.  Might you be interested in employment?~ */
  IF ~~ THEN REPLY #59862 /* ~No, I don't think so.~ */ GOTO 7
  IF ~~ THEN REPLY #59863 /* ~If the pay is adequate, you might hire our services.~ */ GOTO 4
  IF ~~ THEN REPLY #59864 /* ~How did you come to leave the Order, if I might ask?~ */ GOTO 16
END

IF ~~ THEN BEGIN 16 // from: 15.2 3.2
  SAY #59866 /* ~There are several of us here who, for one reason or another, are unworthy of the vows we once took.  We... do not share the particulars of our downfall.~ */
  IF ~Class(LastTalkedToBy,PALADIN_ALL)
FallenPaladin(LastTalkedToBy)~ THEN GOTO 17
  IF ~OR(2)
!Class(LastTalkedToBy,PALADIN_ALL)
!FallenPaladin(LastTalkedToBy)~ THEN GOTO 18
END

IF ~~ THEN BEGIN 17 // from: 16.0
  SAY #59867 /* ~I believe you know what I speak of.  We seek the solace of each other's company and Anarg's leadership because we come from the same place.~ */
  IF ~~ THEN GOTO 19
END

IF ~~ THEN BEGIN 18 // from: 16.1
  SAY #59868 /* ~I would not expect one who is not Fallen to understand.  We... seek the solace of each other's company because we come from the same place.~ */
  IF ~~ THEN GOTO 19
END

IF ~~ THEN BEGIN 19 // from: 18.0 17.0
  SAY #59869 /* ~Regardless, we find ourselves in need of aid, and you fight well.  Might you be interested in helping us?~ */
  IF ~~ THEN REPLY #59870 /* ~No, I don't think so.~ */ GOTO 7
  IF ~~ THEN REPLY #59871 /* ~I might be.~ */ GOTO 4
END

IF ~~ THEN BEGIN 20 // from:
  SAY #59872 /* ~Most excellent!  I must beg your forgiveness, however, since I must ask you to perform an act of good faith first.  Anarg is... cautious in whom he meets.~ */
  IF ~~ THEN GOTO 21
END

IF ~~ THEN BEGIN 21 // from: 20.0
  SAY #59873 /* ~With good reason, no doubt.  All of us have been betrayed.  Sometimes even by those we love.  (sigh)  We no longer trust as we once did.~ */
  IF ~~ THEN GOTO 22
END

IF ~~ THEN BEGIN 22 // from: 21.0
  SAY #59874 /* ~Perform this act for my commander and he will extend his trust to you, and you will be rewarded well.  Otherwise we can part ways here, neither the worse off.~ */
  IF ~~ THEN GOTO 4
END

IF ~~ THEN BEGIN 23 // from: 6.1
  SAY #59876 /* ~But... one question before you leave.  The warrior who stands with you... he bears a most remarked resemblance to Sir Keldorn Firecam.  It has been so long...~ */
  IF ~~ THEN EXTERN ~KELDORJ~ 251
END

IF ~~ THEN BEGIN 24 // from: 6.2
  SAY #59877 /* ~But... one question before you leave.  The priest, there, is none other than Anomen Delryn, no?  A member of the Order!  Just what are you attempting?~ */
  IF ~!Global("AnomenIsNotKnight","GLOBAL",1)~ THEN EXTERN ~ANOMENJ~ 308
  IF ~Global("AnomenIsNotKnight","GLOBAL",1)~ THEN EXTERN ~ANOMENJ~ 307
END

IF ~~ THEN BEGIN 25 // from: KELDORJ:251.0
  SAY #59878 /* ~I... I see.  Forgive me, then.  I receive so little news of the Order... it does not matter.  I wish you well, my <LADYLORD>, and hope to see you soon.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 26 // from: KAYPAL01:5.1 KAYPAL01:2.1
  SAY #59882 /* ~Wh-what?!  B-but... no!  No!  I have been betrayed!!~ */
  IF ~~ THEN EXTERN ~KAYPAL01~ 3
END

IF ~~ THEN BEGIN 27 // from: KAYPAL01:1.1
  SAY #59883 /* ~Anarg!  What are you doing?!~ */
  IF ~~ THEN EXTERN ~KAYPAL01~ 4
END

IF ~~ THEN BEGIN 28 // from: KAYPAL01:4.0
  SAY #59884 /* ~Fight on your own, then!  I will not join you in this!  Obviously you are not the knight I thought you to be.~ */
  IF ~~ THEN DO ~SetGlobal("KaylAnargAttack","GLOBAL",1)
ActionOverride("kaypala",Enemy())
EscapeArea()~ EXIT
END

IF WEIGHT #6 ~True()~ THEN BEGIN 29 // from:
  SAY #62149 /* ~I cannot speak to you at the moment, my <LADYLORD>.~ */
  IF ~~ THEN EXIT
END
