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

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

IF WEIGHT #4 /* Triggers after states #: 7 21 24 25 even though they appear after this state */
~NumTimesTalkedTo(0)
InPartySlot(LastTalkedToBy,0)
~ THEN BEGIN 0 // from:
  SAY #40172 /* ~A shame Captain Arat retired, my <PRO_LADYLORD>.  He felt he had failed Lord de'Arnise, somehow... I am Cernick, and I have taken his place as the Captain of the guard.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #5 /* Triggers after states #: 7 21 24 25 even though they appear after this state */
~GlobalLT("kprevolt","GLOBAL",0)
InPartySlot(LastTalkedToBy,0)~ THEN BEGIN 1 // from:
  SAY #40174 /* ~All is well, my <PRO_LADYLORD>.  You have the favor of the people and the guard... as well-loved as Lord de'Arnise was.  Hopefully no coming trouble will change that.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #6 /* Triggers after states #: 7 21 24 25 even though they appear after this state */
~Global("kprevolt","GLOBAL",0)
InPartySlot(LastTalkedToBy,0)~ THEN BEGIN 2 // from:
  SAY #40175 /* ~All is calm, my <PRO_LADYLORD>.  The restoration of the guard has begun... a long process.  Hopefully there is no trouble like the trolls headed our way.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #7 /* Triggers after states #: 7 21 24 25 even though they appear after this state */
~GlobalGT("kprevolt","GLOBAL",0)
GlobalLT("kprevolt","GLOBAL",6)
InPartySlot(LastTalkedToBy,0)~ THEN BEGIN 3 // from:
  SAY #40176 /* ~There is resentment among the people, my <PRO_LADYLORD>... Perhaps you should follow Lord de'Arnise's benevolent example - the people will not stand a tyrant.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #8 /* Triggers after states #: 7 21 24 25 even though they appear after this state */
~GlobalGT("kprevolt","GLOBAL",5)
InPartySlot(LastTalkedToBy,0)~ THEN BEGIN 4 // from:
  SAY #40179 /* ~My men are grumbling, my <PRO_LADYLORD>.  They think you ill-suited to follow Lord de'Arnise's rule.  Continue on this path and they may not follow you any further.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #9 /* Triggers after states #: 7 21 24 25 even though they appear after this state */
~Name("Nalia",LastTalkedToBy)
~ THEN BEGIN 5 // from:
  SAY #40180 /* ~Good day, Mistress Nalia.  It is good to see you hale and traveling.  I grieve for your father... and I hope you made the right choice with our new <PRO_LADYLORD>.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #10 /* Triggers after states #: 7 21 24 25 even though they appear after this state */
~OR(2)
!InPartySlot(LastTalkedToBy,0)
!InPartySlot(LastTalkedToBy,"Nalia")~ THEN BEGIN 6 // from:
  SAY #40181 /* ~Greetings to you.  I am Captain Cernick of the keep's guard.  I am always pleased to meet one of <PRO_LADYLORD> <CHARNAME>'s associates.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #0 ~Global("KPCapt02Steal","GLOBAL",1)
~ THEN BEGIN 7 // from:
  SAY #40322 /* ~Greetings, my <PRO_LADYLORD>.  I am not sure if you have been aware, but we have been experiencing a number of thefts in the keep over the past couple of weeks.~ */
  IF ~~ THEN DO ~SetGlobal("KPCapt02Steal","GLOBAL",2)
~ GOTO 8
END

IF ~~ THEN BEGIN 8 // from: 7.0
  SAY #40323 /* ~Small things.  A goblet, some silverware, a few coins from the servants' quarters.  All of these things have value, although none of them were major thefts.~ */
  IF ~~ THEN GOTO 9
END

IF ~~ THEN BEGIN 9 // from: 8.0
  SAY #40324 /* ~Still... I investigated.  Lastin, here, is one of the new guards.  I caught him red-handed, attempting to take a necklace that belonged to the late Lady de'Arnise.~ */
  IF ~~ THEN GOTO 10
END

IF ~~ THEN BEGIN 10 // from: 9.0
  SAY #40325 /* ~Lastin has confessed his crime.  I am unsure how to punish him, my <PRO_LADYLORD>, so I have brought this before you.~ */
  IF ~~ THEN EXTERN ~KPDOMO01~ 58
END

IF ~~ THEN BEGIN 11 // from: KPDOMO01:59.0
  SAY #40332 /* ~I did.  It shall be done immediately... and it shall serve as a fine warning to all those who might try similarly.~ */
  IF ~~ THEN EXTERN ~KPGRD01~ 0
END

IF ~~ THEN BEGIN 12 // from: KPGRD01:0.0
  SAY #40334 /* ~Silence!  The <PRO_LADYLORD> has spoken.  Follow me, and retain some dignity in your death at least, Lastin.~ */
  IF ~~ THEN DO ~ActionOverride("kpgrd01",MoveToPoint([1549.1192]))
ActionOverride("kpgrd01",EscapeArea())
MoveToPoint([1499.1196])
EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 13 // from: KPDOMO01:60.0
  SAY #40336 /* ~I did.  I do not like that he goes without punishment... but if <PRO_LADYLORD> <CHARNAME> has decided to be merciful, then so be it.~ */
  IF ~~ THEN EXTERN ~KPGRD01~ 1
END

IF ~~ THEN BEGIN 14 // from: KPGRD01:12.0 KPGRD01:1.0
  SAY #40338 /* ~Enough.  Follow me, Lastin.  We shall go to the barracks and collect your personals... and then I shall have the guard escort you from the keep.~ */
  IF ~~ THEN DO ~AddExperienceParty(11500)
ActionOverride("kpgrd01",MoveToPoint([1549.1192]))
ActionOverride("kpgrd01",EscapeArea())
MoveToPoint([1499.1196])
EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 15 // from: KPDOMO01:58.2
  SAY #40339 /* ~It has not happened while I've been at the keep, but Arat told me of one of the servants helping himself to the tax money.  He was executed, naturally.~ */
  IF ~~ THEN REPLY #40340 /* ~Then, if that is the proper punishment, the matter is clear.  Execute this man immediately.~ */ EXTERN ~KPDOMO01~ 59
  IF ~~ THEN REPLY #40341 /* ~I will not have this man executed.  His crimes seem minor.  Expel him from the guard, instead, and send him away.~ */ EXTERN ~KPDOMO01~ 60
  IF ~~ THEN REPLY #40342 /* ~I see.  I would like to hear what Lastin has to say in his own defense.~ */ EXTERN ~KPGRD01~ 2
END

IF ~~ THEN BEGIN 16 // from: KPGRD01:2.0
  SAY #40344 /* ~If you have any sort of excuse for your actions, Lastin, I suggest you say it quickly before the <PRO_LADYLORD> loses patience.~ */
  IF ~~ THEN EXTERN ~KPGRD01~ 3
END

IF ~~ THEN BEGIN 17 // from: KPGRD01:10.2 KPGRD01:9.2 KPGRD01:5.2
  SAY #40352 /* ~You... you intend to forgive him completely, my <PRO_LADYLORD>?~ */
  IF ~~ THEN EXTERN ~KPGRD01~ 6
END

IF ~~ THEN BEGIN 18 // from: KPGRD01:6.0
  SAY #40354 /* ~(sigh)  Fine, then.  You are lucky that the <PRO_LADYLORD> is so kind, Lastin.  Come with me back to the barracks.~ */
  IF ~~ THEN DO ~AddexperienceParty(15500)
ActionOverride("kpgrd01",MoveToPoint([1549.1192]))
ActionOverride("kpgrd01",EscapeArea())
MoveToPoint([1499.1196])
EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 19 // from: KPGRD01:11.0
  SAY #40372 /* ~Come with me, then, Lastin.  Justice shall be done, and all who follow you will know better than to try such a thing again.~ */
  IF ~~ THEN DO ~ActionOverride("kpgrd01",MoveToPoint([1549.1192]))
ActionOverride("kpgrd01",EscapeArea())
MoveToPoint([1499.1196])
EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 20 // from: KPGRD01:13.0
  SAY #40375 /* ~(sigh)  Can't say I agree with it, but... I suppose I might have done the same.  Hope it all works out well with the wife. Follow me back to the barracks, Lastin.~ */
  IF ~~ THEN DO ~AddexperienceParty(15500)
ActionOverride("kpgrd01",MoveToPoint([1549.1192]))
ActionOverride("kpgrd01",EscapeArea())
MoveToPoint([1499.1196])
EscapeArea()
~ EXIT
END

IF WEIGHT #1 ~Global("KeepPlot","GLOBAL",9)~ THEN BEGIN 21 // from:
  SAY #40654 /* ~<PRO_LADYLORD> <CHARNAME>!  Lord Roenall and some of his forces have pushed through the lines!  They are attacking the gate!~ */
  IF ~~ THEN GOTO 22
END

IF ~~ THEN BEGIN 22 // from: 21.0
  SAY #40655 /* ~You've got to come quickly!  If their forces aren't stopped, soon, they will overtake the walls and all will be lost!~ */
  IF ~~ THEN GOTO 23
END

IF ~~ THEN BEGIN 23 // from: 22.0
  SAY #40656 /* ~You must fight Lord Roenall!  If he is killed, his army will dissolve around him!  But you must do it before the walls fall!  Come, my <PRO_LADYLORD>!  To the gate!!~ */
  IF ~~ THEN DO ~SetGlobal("KeepPlot","GLOBAL",11)
ActionOverride("kpsold03",MoveToPoint([1549.1192])
ActionOverride("kpsold04",MoveToPoint([1480.1235])
ActionOverride("kpsold03",EscapeArea())
ActionOverride("kpsold04",EscapeArea())
MoveToPoint([1499.1196])
EscapeArea()
~ EXIT
END

IF WEIGHT #2 ~Global("KeepPlot","GLOBAL",11)
!Dead("kproen01")
~ THEN BEGIN 24 // from:
  SAY #40660 /* ~You must kill Roenall, my <PRO_LADYLORD>!  Do it quickly!!~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #3 ~Global("KeepPlot","GLOBAL",13)
Dead("kproen01")
~ THEN BEGIN 25 // from:
  SAY #40683 /* ~I am glad you remain in the keep... and that you survived.  Lord Roenall deserved everything he got.  We're all happy we don't have to serve scum like him.~ */
  IF ~~ THEN DO ~SetGlobal("KeepPlot","GLOBAL",15)
~ EXIT
END
