// creator  : weidu.exe (version 23600)
// argument : HALFTR.DLG
// game     : .
// source   : ./override/HALFTR.DLG
// dialog   : lang\en_us/dialog.tlk
// dialogF  : (none)

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

IF WEIGHT #1 /* Triggers after states #: 8 even though they appear after this state */
~  NumberOfTimesTalkedTo(0)
~ THEN BEGIN 0 // from:
  SAY #5373 /* ~Wayfarers! Wait up a moment. I wish to have a word with you. You are adventurers, are you not?~ */
  IF ~~ THEN REPLY #5374 /* ~Yes, we're adventurers, why should you care?~ */ GOTO 2
  IF ~~ THEN REPLY #5375 /* ~No, we're not.~ */ GOTO 1
END

IF ~~ THEN BEGIN 1 // from: 0.1
  SAY #5376 /* ~Sorry, I guess I must have misjudged you. Well, I'll be on my way now.~ */
  IF ~~ THEN DO ~EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 2 // from: 0.0
  SAY #5377 /* ~That's good then! You see, I am an adventurer of sorts, of course I'm not very fond of battle. I like to pilfer objects from ruins and monstrous lairs, and try my best to avoid getting hurt. Anyway, I have something that might interest you. I have a gem in my possession, a magical gem. I have no use for it, and I can't get the price I'm looking for from anyone I've met. Would you perhaps be interested?~ */
  IF ~~ THEN REPLY #5378 /* ~Sorry, we have no interest in a magical gem.~ */ DO ~EscapeArea()
~ GOTO 6
  IF ~~ THEN REPLY #5379 /* ~Sure, what's the price?~ */ GOTO 3
  IF ~~ THEN REPLY #5380 /* ~Perhaps you could tell us what the gem does?~ */ GOTO 4
END

IF ~~ THEN BEGIN 3 // from: 2.1
  SAY #5381 /* ~My price is a measly 1,000 gold. It allows you to see the truth in all things, a gem of true seeing you could say. 1,000 gold I would think is a rather fair price.~ */
  IF ~~ THEN REPLY #5382 /* ~That's too much for us, sorry.~ */ GOTO 6
  IF ~~ THEN REPLY #5383 /* ~Why don't you sell it for a little cheaper?~ */ GOTO 5
  IF ~  PartyGoldGT(999)
~ THEN REPLY #5384 /* ~Sure, here's 1,000 gold.~ */ GOTO 7
END

IF ~~ THEN BEGIN 4 // from: 2.2
  SAY #5385 /* ~Of course! It's a gem of true seeing. It allows you to see the truth in all things. So do you want it? I'm selling it for a 1,000 gold, no more, no less.~ */
  IF ~~ THEN REPLY #5386 /* ~Sorry, that's a little too pricey for us.~ */ GOTO 6
  IF ~~ THEN REPLY #5388 /* ~How 'bout selling it for less than 1,000 gold?~ */ GOTO 5
  IF ~  PartyGoldGT(999)
~ THEN REPLY #5394 /* ~Sure, we'll take it.~ */ GOTO 7
END

IF ~~ THEN BEGIN 5 // from: 4.1 3.1
  SAY #5397 /* ~I can't sell such a gem for less than 1,000 gold!~ */
  IF ~  PartyGoldGT(999)
~ THEN REPLY #5413 /* ~Okay, we'll take it for 1,000 gold.~ */ GOTO 7
  IF ~~ THEN REPLY #5416 /* ~Can't afford it, I guess this is goodbye.~ */ GOTO 6
END

IF ~~ THEN BEGIN 6 // from: 5.1 4.0 3.0 2.0
  SAY #6991 /* ~It's too bad that you couldn't see the obvious value of this gem. I guess I'll be on my way.~ */
  IF ~~ THEN DO ~EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 7 // from: 5.0 4.2 3.2
  SAY #6992 /* ~Good, good! Here's the gem, now I'll be on my way.~ */
  IF ~~ THEN DO ~GiveItem("MISC19",LastTalkedToBy)
TakePartyGold(1000)
EscapeArea()
~ EXIT
  IF ~Global("X#JaheiraFurret","GLOBAL",0)
InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#JaheiraFurret","GLOBAL",1)~ EXTERN ~JAHEIJ~ 109
END

IF WEIGHT #0 ~  StateCheck(Myself,STATE_CHARMED)
~ THEN BEGIN 8 // from:
  SAY #6995 /* ~I'm a halfling trader who spent the last of my money on this worthless gem that I possess. The gem is cursed you see, and now I must find a way to get rid of it.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 9 // from:
  SAY #9299 /* ~Not to be rude, but I'd rather you left immediately.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 10 // from: JAHEIJ:109.1
  SAY #45236 /* ~You... you will see the true value of this gem yet!~ */
  IF ~~ THEN DO ~GiveItem("MISC19",LastTalkedToBy)
TakePartyGold(1000)
EscapeArea()
~ EXIT
END
