// creator  : weidu.exe (version 23600)
// argument : KIVAN.DLG
// game     : .
// source   : ./override/KIVAN.DLG
// dialog   : lang\en_us/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 #401 /* ~What takes you out this far from civilization?~ */
  IF ~~ THEN REPLY #411 /* ~It's none of your concern, stranger.~ */ GOTO 4
  IF ~~ THEN REPLY #412 /* ~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 #402 /* ~What foolishness takes city dwellers this far from civilization?~ */
  IF ~~ THEN REPLY #413 /* ~It's none of your business.~ */ GOTO 4
  IF ~~ THEN REPLY #414 /* ~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 #403 /* ~I don't have time to waste on naive adventurers.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 3 // from: 1.1 0.1
  SAY #405 /* ~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 #6274 /* ~We don't have the time to devote to that right now. Perhaps in the future.~ */ GOTO 9
  IF ~  Global("Chapter","GLOBAL",1)
~ THEN REPLY #6275 /* ~Go ahead, we'll follow to wherever you take us.~ */ GOTO 10
  IF ~  Global("Chapter","GLOBAL",2)
~ THEN REPLY #6275 /* ~Go ahead, we'll follow to wherever you take us.~ */ GOTO 13
  IF ~  Global("Chapter","GLOBAL",3)
~ THEN REPLY #6275 /* ~Go ahead, we'll follow to wherever you take us.~ */ GOTO 14
  IF ~  GlobalGT("Chapter","GLOBAL",3)
~ THEN REPLY #6275 /* ~Go ahead, we'll follow to wherever you take us.~ */ GOTO 15
  IF ~~ THEN REPLY #6276 /* ~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~ 82
END

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

IF ~~ THEN BEGIN 5 // from:
  SAY #407 /* ~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 #408 /* ~It is none of your affair.~ */
  IF ~~ THEN REPLY #418 /* ~Well, then, we don't want you in our party!~ */ GOTO 9
  IF ~~ THEN REPLY #419 /* ~Well, I guess that's how you want it. We still need another good warrior, so why not join our party.~ */ GOTO 10
  IF ~  Global("Chapter","GLOBAL",1)
~ THEN REPLY #419 /* ~Well, I guess that's how you want it. We still need another good warrior, so why not join our party.~ */ GOTO 10
  IF ~  Global("Chapter","GLOBAL",2)
~ THEN REPLY #419 /* ~Well, I guess that's how you want it. We still need another good warrior, so why not join our party.~ */ GOTO 13
  IF ~  Global("Chapter","GLOBAL",3)
~ THEN REPLY #419 /* ~Well, I guess that's how you want it. We still need another good warrior, so why not join our party.~ */ GOTO 14
  IF ~  GlobalGT("Chapter","GLOBAL",3)
~ THEN REPLY #419 /* ~Well, I guess that's how you want it. We still need another good warrior, so why not join our party.~ */ GOTO 15
END

IF ~~ THEN BEGIN 7 // from: 18.5 3.5
  SAY #409 /* ~Their leader, an ogre named Tazok, took the life of someone very dear to me.~ */
  IF ~~ THEN REPLY #420 /* ~We don't need some vengeance monger in our party. You can leave.~ */ GOTO 9
  IF ~  Global("Chapter","GLOBAL",1)
~ THEN REPLY #6280 /* ~Thanks for being honest. You can join our party.~ */ JOURNAL #27212 /* ~Kivan and Tazok
Kivan hunts after an ogre named Tazok. He has told us that Tazok killed someone close to him.~ */ GOTO 10
  IF ~  Global("Chapter","GLOBAL",2)
~ THEN REPLY #6280 /* ~Thanks for being honest. You can join our party.~ */ JOURNAL #27212 /* ~Kivan and Tazok
Kivan hunts after an ogre named Tazok. He has told us that Tazok killed someone close to him.~ */ GOTO 13
  IF ~  Global("Chapter","GLOBAL",3)
~ THEN REPLY #6280 /* ~Thanks for being honest. You can join our party.~ */ JOURNAL #27212 /* ~Kivan and Tazok
Kivan hunts after an ogre named Tazok. He has told us that Tazok killed someone close to him.~ */ GOTO 14
  IF ~  GlobalGT("Chapter","GLOBAL",3)
~ THEN REPLY #6280 /* ~Thanks for being honest. You can join our party.~ */ JOURNAL #27212 /* ~Kivan and Tazok
Kivan hunts after an ogre named Tazok. He has told us that Tazok killed someone close to him.~ */ GOTO 15
END

IF WEIGHT #0 ~  StateCheck(Myself,STATE_CHARMED)
~ THEN BEGIN 8 // from:
  SAY #6281 /* ~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 ensure that he does!~ */
  IF ~~ THEN EXIT
END

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

IF ~~ THEN BEGIN 10 // from: 18.1 7.1 6.2 6.1 3.1
  SAY #7070 /* ~I hope that we will work well together.~ */
  IF ~~ THEN DO ~SetGlobalTimer("Kivan","GLOBAL",TWENTY_DAYS)
JoinParty()
~ 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~ 146
END

IF ~~ THEN BEGIN 11 // from: KOCH:0.1
  SAY #14362 /* ~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: KOCH:0.0
  SAY #14363 /* ~I am glad to rid myself of such burdensome companions.~ */
  IF ~~ THEN DO ~LeaveParty()
EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 13 // from: 18.2 7.2 6.3 3.2
  SAY #7070 /* ~I hope that we will work well together.~ */
  IF ~~ THEN DO ~SetGlobalTimer("Kivan","GLOBAL",FOURTEEN_DAYS)
JoinParty()
~ EXIT
END

IF ~~ THEN BEGIN 14 // from: 18.3 7.3 6.4 3.3
  SAY #7070 /* ~I hope that we will work well together.~ */
  IF ~~ THEN DO ~SetGlobalTimer("Kivan","GLOBAL",SEVEN_DAYS)
JoinParty()
~ EXIT
END

IF ~~ THEN BEGIN 15 // from: 18.4 7.4 6.5 3.4
  SAY #7070 /* ~I hope that we will work well together.~ */
  IF ~~ THEN DO ~JoinParty()
~ EXIT
END

IF ~~ THEN BEGIN 16 // from:
  SAY #46410 /* ~Death is horrible, Quessir.~ */
  IF ~~ THEN DO ~SetGlobalTimer("Kivan","GLOBAL",TWENTY_DAYS)
JoinParty()
~ EXIT
  IF ~  InParty("xan")
InMyArea("xan")
!StateCheck("xan",CD_STATE_NOTVALID)
~ THEN GOTO 17
  IF ~  InParty("xan")
InMyArea("xan")
!StateCheck("xan",CD_STATE_NOTVALID)
~ THEN EXTERN ~XANJ~ 147
END

IF ~~ THEN BEGIN 17 // from: 16.1
  SAY #46412 /* ~Because I must.~ */
  IF ~~ THEN DO ~SetGlobalTimer("Kivan","GLOBAL",TWENTY_DAYS)
JoinParty()
~ EXIT
END

IF ~~ THEN BEGIN 18 // from:
  SAY #46441 /* ~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 travelling with you.~ */
  IF ~~ THEN REPLY #6274 /* ~We don't have the time to devote to that right now. Perhaps in the future.~ */ GOTO 9
  IF ~  Global("Chapter","GLOBAL",1)
~ THEN REPLY #6275 /* ~Go ahead, we'll follow to wherever you take us.~ */ GOTO 10
  IF ~  Global("Chapter","GLOBAL",2)
~ THEN REPLY #6275 /* ~Go ahead, we'll follow to wherever you take us.~ */ GOTO 13
  IF ~  Global("Chapter","GLOBAL",3)
~ THEN REPLY #6275 /* ~Go ahead, we'll follow to wherever you take us.~ */ GOTO 14
  IF ~  GlobalGT("Chapter","GLOBAL",3)
~ THEN REPLY #6275 /* ~Go ahead, we'll follow to wherever you take us.~ */ GOTO 15
  IF ~~ THEN REPLY #6276 /* ~We'll help you against the bandits, but only if you tell us why you've spent months hunting them.~ */ GOTO 7
END
