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

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

IF WEIGHT #2 /* Triggers after states #: 8 12 even though they appear after this state */
~ReactionGT(LastTalkedToBy(Myself),NEUTRAL_UPPER)
~ THEN BEGIN 0 // from:
  SAY #88486 /* ~What takes you out this far from civilization?~ */
  IF ~~ THEN REPLY #88487 /* ~It's none of your concern, stranger.~ */ GOTO 4
  IF ~~ THEN REPLY #88488 /* ~We're adventurers, ready to smite any evil that darkens our path.~ */ GOTO 3
END

IF WEIGHT #3 /* Triggers after states #: 8 12 even though they appear after this state */
~ReactionLT(LastTalkedToBy(Myself),FRIENDLY_LOWER)
ReactionGT(LastTalkedToBy(Myself),HOSTILE_UPPER)
~ THEN BEGIN 1 // from:
  SAY #88489 /* ~What foolishness takes city dwellers this far from civilization?~ */
  IF ~~ THEN REPLY #36486 /* ~It's none of your business.~ */ GOTO 4
  IF ~~ THEN REPLY #88490 /* ~We're adventurers, on the lookout for evil to smite.~ */ GOTO 3
END

IF WEIGHT #4 /* Triggers after states #: 8 12 even though they appear after this state */
~ReactionLT(LastTalkedToBy(Myself),NEUTRAL_LOWER)
~ THEN BEGIN 2 // from:
  SAY #88491 /* ~I don't have time to waste on naive adventurers.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 3 // from: 1.1 0.1
  SAY #88492 /* ~A strange coincidence; I have a quest similar to your own.  I have been hunting the bandits in the region for the past few months.  Perhaps if we worked together we would fare better.  What say you to that?~ */
  IF ~~ THEN REPLY #88493 /* ~We don't have the time to devote to that right now. Perhaps in the future...~ */ GOTO 9
  IF ~~ THEN REPLY #88494 /* ~Go ahead, we'll follow to wherever you take us.~ */ DO ~SetGlobalTimer("Kivan","GLOBAL",FIVE_DAYS)
JoinParty()
~ GOTO 10
  IF ~GlobalLT("Chapter","GLOBAL",4)
~ THEN REPLY #88495 /* ~We'll help you against the bandits, but only if you tell us why you've spent months hunting them.~ */ GOTO 7
  IF ~Global("X#SharKivanJoin","GLOBAL",0)
InParty("sharteel")
InMyArea("sharteel")
!StateCheck("sharteel",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#SharKivanJoin","GLOBAL",1)~ EXTERN ~_SHARTJ~ 78
END

IF ~~ THEN BEGIN 4 // from: 1.0 0.0
  SAY #88496 /* ~Perhaps our paths will cross some other day.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 5 // from:
  SAY #88497 /* ~I have been tracking a group of bandits for the past few days; if you desire we can continue to track these brigands together.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 6 // from:
  SAY #5093 /* ~It is none of your affair.~ */
  IF ~~ THEN REPLY #88498 /* ~Well then, we don't want you in our party!~ */ GOTO 9
  IF ~~ THEN REPLY #88499 /* ~Well, I guess that's how you want it.  We still need another good warrior, so why not join our party?~ */ DO ~SetGlobalTimer("Kivan","GLOBAL",FIVE_DAYS)
JoinParty()
~ GOTO 10
END

IF ~~ THEN BEGIN 7 // from: 15.2 3.2
  SAY #88500 /* ~Their leader, an ogre named Tazok, took the life of someone very dear to me.~ */
  IF ~~ THEN REPLY #88501 /* ~We don't need some vengeance-monger in our party.  You can leave.~ */ GOTO 9
  IF ~~ THEN REPLY #88503 /* ~Thanks for being honest.  You can join our party.~ */ DO ~SetGlobalTimer("Kivan","GLOBAL",FIVE_DAYS)
AddJournalEntry(88502,QUEST)
JoinParty()
~ GOTO 10
END

IF WEIGHT #0 ~StateCheck(Myself,STATE_CHARMED)
~ THEN BEGIN 8 // from:
  SAY #88504 /* ~All I can tell you, friend, is that you must help me gain revenge.  The evil ogre Tazok killed my lover, Deheriana.  He must suffer for that act, and I will insure that he does!~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 9 // from: 15.0 7.0 6.0 3.0
  SAY #88505 /* ~Farewell.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 10 // from: 15.1 7.1 6.1 3.1
  SAY #88506 /* ~I hope that we will work well together.~ */
  IF ~~ THEN EXIT
  IF ~Global("X#XANKIVANIJ1","GLOBAL",0)
InParty("xan")
InMyArea("xan")
!StateCheck("xan",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#XANKIVANIJ1","GLOBAL",1)~ EXTERN ~_XANJ~ 154
END

IF ~~ THEN BEGIN 11 // from:
  SAY #87030 /* ~It is a good time for us to go our separate ways.  Perhaps we shall meet again.~ */
  IF ~~ THEN DO ~LeaveParty()
SetDialogue("_KIVANP")
~ EXIT
END

IF WEIGHT #1 ~False()
~ THEN BEGIN 12 // from:
  SAY #88507 /* ~I am glad to rid myself of such burdensome companions.~ */
  IF ~~ THEN DO ~LeaveParty()
EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 13 // from:
  SAY #99760 /* ~Death is horrible, Quessir.~ */
  IF ~~ THEN EXIT
  IF ~  InParty("xan")
InMyArea("xan")
!StateCheck("xan",CD_STATE_NOTVALID)
~ THEN GOTO 14
  IF ~  InParty("xan")
InMyArea("xan")
!StateCheck("xan",CD_STATE_NOTVALID)
~ THEN EXTERN ~_XANJ~ 155
END

IF ~~ THEN BEGIN 14 // from: 13.1
  SAY #99762 /* ~Because I must.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 15 // from:
  SAY #99791 /* ~I hunt better alone, but in this fight I would welcome an ally. However, if you are not interested in joining the forces, I would not insist on traveling with you.~ */
  IF ~~ THEN REPLY #88493 /* ~We don't have the time to devote to that right now. Perhaps in the future...~ */ GOTO 9
  IF ~~ THEN REPLY #88494 /* ~Go ahead, we'll follow to wherever you take us.~ */ DO ~SetGlobalTimer("Kivan","GLOBAL",FIVE_DAYS)
JoinParty()
~ GOTO 10
  IF ~GlobalLT("Chapter","GLOBAL",4)
~ THEN REPLY #88495 /* ~We'll help you against the bandits, but only if you tell us why you've spent months hunting them.~ */ GOTO 7
END
