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

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

IF WEIGHT #3 /* Triggers after states #: 1 10 12 even though they appear after this state */
~  True()
~ THEN BEGIN 0 // from: 1.3
  SAY #17387 /* ~And who might you be then? Hmmph? Come to check out the wares of ol' Halbazzer? Well, be quick about it! And mind you don't get fidgety when we talk payment. You knew when you came in the door that my wares were magical; premium items demand a premium price.~ */
  IF ~  !PartyHasItem("X#XZDRIA")
~ THEN REPLY #17516 /* ~Let's see what you have, then.~ */ DO ~StartStore("Sto0703",LastTalkedToBy(Myself))
~ EXIT
  IF ~  !PartyHasItem("X#XZDRIA")
~ THEN REPLY #17388 /* ~Perhaps another time.~ */ EXIT
  IF ~  Global("X#XzarMakeRing","GLOBAL",1)
PartyHasItem("X#XZDRIA")
!PartyHasItem("X#XZMIRI")
~ THEN REPLY #17516 /* ~Let's see what you have, then.~ */ DO ~StartStore("STO0703",LastTalkedToBy(Myself))
~ EXIT
  IF ~  Global("X#XzarMakeRing","GLOBAL",1)
PartyHasItem("X#XZDRIA")
!PartyHasItem("X#XZMIRI")
~ THEN REPLY #17388 /* ~Perhaps another time.~ */ EXIT
  IF ~  !InParty("xzar")
PartyHasItem("X#XZDRIA")
Global("X#XzarMakeRing","GLOBAL",0)
~ THEN GOTO 20
  IF ~  InParty("xzar")
InMyArea("xzar")
!StateCheck("xzar",CD_STATE_NOTVALID)
Global("X#XzarMakeRing","GLOBAL",0)
PartyHasItem("X#XZDRIA")
!PartyHasItem("X#XZMIRI")
~ THEN EXTERN ~XZARJ~ 137
  IF ~  InParty("xzar")
InMyArea("xzar")
!StateCheck("xzar",CD_STATE_NOTVALID)
Global("X#XzarMakeRing","GLOBAL",0)
PartyHasItem("X#XZDRIA")
PartyHasItem("X#XZMIRI")
~ THEN EXTERN ~XZARJ~ 144
  IF ~  InParty("xzar")
InMyArea("xzar")
!StateCheck("xzar",CD_STATE_NOTVALID)
PartyGoldGT(1000)
Global("X#XzarMakeRing","GLOBAL",1)
PartyHasItem("X#XZDRIA")
PartyHasItem("X#XZMIRI")
~ THEN EXTERN ~XZARJ~ 147
  IF ~  InParty("xzar")
InMyArea("xzar")
!StateCheck("xzar",CD_STATE_NOTVALID)
OR(2)
Global("X#XzarNags","GLOBAL",3)
Global("X#XzarNags","GLOBAL",4)
Global("X#XZRingMade","GLOBAL",0)
PartyGoldGT(1000)
~ THEN GOTO 23
  IF ~  InParty("xzar")
InMyArea("xzar")
!StateCheck("xzar",CD_STATE_NOTVALID)
Global("X#XZRingPayed","GLOBAL",0)
GlobalGT("X#XzarNags","GLOBAL",0)
Global("X#XZRingMade","GLOBAL",1)
!PartyGoldGT(1000)
~ THEN GOTO 25
  IF ~  Global("X#XZRingMade","GLOBAL",1)
Global("X#XZRingPayed","GLOBAL",1)
GlobalTimerExpired("X#XzarRingTime","GLOBAL")
~ THEN GOTO 27
  IF ~  Global("X#XZRingMade","GLOBAL",3)
GlobalTimerExpired("X#XzarRingTime","GLOBAL")
PartyGoldGT(500)
~ THEN GOTO 28
  IF ~  Global("X#XZRingMade","GLOBAL",3)
GlobalTimerExpired("X#XzarRingTime","GLOBAL")
!PartyGoldGT(500)
~ THEN GOTO 29
  IF ~  InParty("xzar")
InMyArea("xzar")
!StateCheck("xzar",CD_STATE_NOTVALID)
Global("X#XzarMakeRing","GLOBAL",1)
Global("X#XZRingPayed","GLOBAL",0)
!PartyGoldGT(1000)
PartyHasItem("X#XZMIRI")
~ THEN REPLY #17516 /* ~Let's see what you have, then.~ */ DO ~StartStore("STO0703",LastTalkedToBy(Myself))
~ EXIT
  IF ~  InParty("xzar")
InMyArea("xzar")
!StateCheck("xzar",CD_STATE_NOTVALID)
Global("X#XzarMakeRing","GLOBAL",1)
Global("X#XZRingPayed","GLOBAL",0)
!PartyGoldGT(1000)
PartyHasItem("X#XZMIRI")
~ THEN REPLY #17388 /* ~Perhaps another time.~ */ EXIT
END

IF WEIGHT #2 /* Triggers after states #: 10 12 even though they appear after this state */
~  PartyHasItem("MISC51")
~ THEN BEGIN 1 // from:
  SAY #10491 /* ~Well, well! If I'm not mistaken, that be a lock of nymph's hair. A luckier being there cannot be, than they who have gained the favor of such a creature. Would ye be willing to part with a small portion of that sample? I could pay... say... 500 gold for it.~ */
  IF ~~ THEN REPLY #10492 /* ~A generous offer, and I accept it.~ */ DO ~GiveGoldForce(500)
TakePartyItem("MISC51")
~ EXIT
  IF ~~ THEN REPLY #10494 /* ~Oh, I couldn't sell this. It was a gift. Not unless you offered me outrageous amounts of money.~ */ GOTO 3
  IF ~~ THEN REPLY #10495 /* ~You'll not touch a hair of it! It's mine and mine alone!~ */ GOTO 2
  IF ~~ THEN REPLY #192 /* ~I'm not interested in selling it just now, though it would be to you if I do.~ */ GOTO 0
END

IF ~~ THEN BEGIN 2 // from: 9.2 8.1 3.1 1.2
  SAY #10496 /* ~There is simply no way someone with your manner could have come by that hair honorably! Get out of my sight. I'll not serve ye here!~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 3 // from: 1.1
  SAY #10497 /* ~Suit yourself, though I can't say as I blame ya. Very useful stuff, that. Say, how about I have a seamstress weave it within a cloak for ye? It is said that the wearer of such an item is magically more beautiful. It would not cost much, perhaps 100 gold. Delicate stuff, it is.~ */
  IF ~~ THEN REPLY #10498 /* ~I'm content with it the way it is, thank you.~ */ GOTO 7
  IF ~~ THEN REPLY #10499 /* ~I'll not have strangers put a finger on it! It is mine to keep.~ */ GOTO 2
  IF ~  PartyGoldGT(99)
~ THEN REPLY #10500 /* ~An excellent suggestion! You have a deal!~ */ DO ~TakePartyGold(100)
~ GOTO 4
END

IF ~~ THEN BEGIN 4 // from: 9.0 8.2 3.2
  SAY #10501 /* ~You won't regret this! I already have one cloak made. I'll give it to ye, now that I can make several others. Here ye go.~ */
  IF ~~ THEN DO ~TakePartyItem("MISC51")
GiveItem("CLCK07",LastTalkedToBy)
~ EXIT
END

IF ~~ THEN BEGIN 5 // from:
  SAY #10502 /* ~Welcome back, it's ready as I promised. Beautiful, is it not? You'll be the toast of the town in this.~ */
  IF ~~ THEN DO ~GiveItem("CLCK07",LastTalkedToBy)
~ EXIT
END

IF ~~ THEN BEGIN 6 // from:
  SAY #10503 /* ~I'm afraid your garment is not ready yet. Return when we agreed and you shall have it.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 7 // from: 9.1 8.0 3.0
  SAY #10504 /* ~As you will, but it does you little good in your pocket. The offer stands if you return here.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 8 // from:
  SAY #10505 /* ~Back again with that wondrous hair, I see. Have you reconsidered my offer?~ */
  IF ~~ THEN REPLY #10506 /* ~I'm content with it the way it is, thank you.~ */ GOTO 7
  IF ~~ THEN REPLY #10507 /* ~I'll not have strangers put a finger on it! It is mine to keep.~ */ GOTO 2
  IF ~~ THEN REPLY #10508 /* ~An excellent suggestion! You have a deal!~ */ GOTO 4
END

IF ~~ THEN BEGIN 9 // from:
  SAY #10509 /* ~Wonderful! The things that can be done with nymph hair are amazing! In fact, since you are so generous with it, why don't I weave what you have left within a tunic? It's said such a garment enhances the beauty of the wearer. No charge for you, friend.~ */
  IF ~~ THEN REPLY #10510 /* ~An offer I could not refuse!~ */ GOTO 4
  IF ~~ THEN REPLY #10511 /* ~I would just as soon keep it as it is. Thanks anyway.~ */ GOTO 7
  IF ~~ THEN REPLY #10513 /* ~You'll be keeping your hands off what I have left!~ */ GOTO 2
END

IF WEIGHT #0 ~  PartyHasItem("X#GARCH")
Global("X#HalbTalk","LOCALS",0)
~ THEN BEGIN 10 // from:
  SAY #48451 /* ~What is that armor I see you possess? The quality of the stitching and interweaving of leather and mail is unsurpassed... Where could you have got such a well-crafted suit? Never mind, each man must have his secrets, and I am an abjurer, not a diviner, by trade.~ */
  IF ~~ THEN GOTO 11
END

IF ~~ THEN BEGIN 11 // from: 10.0
  SAY #48452 /* ~I am, of course, talking about that pleasantly colored suit of chainmail you own. By the looks of it, it would be a bard's garb? I can imagine it must allow freedom of movement enough so as to not restrict spellcasting. Very useful...~ */
  IF ~  !PartyHasItem("_MISC47")
!PartyHasItem("MISC47")
~ THEN REPLY #48453 /* ~Thanks for the compliment.~ */ DO ~SetGlobal("X#HalbTalk","LOCALS",1)
~ GOTO 13
  IF ~  OR(2)
PartyHasItem("_MISC47")
PartyHasItem("MISC47")
~ THEN REPLY #48453 /* ~Thanks for the compliment.~ */ DO ~SetGlobal("X#HalbTalk","LOCALS",1)
~ GOTO 15
  IF ~~ THEN REPLY #48454 /* ~I've come to buy something, actually...~ */ DO ~StartStore("STO0703",Protagonist)
~ EXIT
  IF ~~ THEN REPLY #48455 /* ~I'd better be going.~ */ EXIT
END

IF WEIGHT #1 ~  PartyHasItem("X#GARCH")
Global("X#HalbTalk","LOCALS",1)
~ THEN BEGIN 12 // from:
  SAY #48456 /* ~Hello again. Have you changed your mind on my offer? I do believe that the armor would be most beneficial.~ */
  IF ~  OR(2)
PartyHasItem("_MISC47")
PartyHasItem("MISC47")
PartyGoldGT(999)
~ THEN REPLY #48457 /* ~Yes, I have. Please, improve my armor.~ */ GOTO 17
  IF ~~ THEN REPLY #48458 /* ~Not at this time, thank you. May I see your wares?~ */ DO ~StartStore("STO0703",Protagonist)
~ EXIT
  IF ~~ THEN REPLY #48459 /* ~Not today. Farewell.~ */ EXIT
END

IF ~~ THEN BEGIN 13 // from: 11.0
  SAY #48460 /* ~Now, the pair of us may be able to help each other out. In exchange for letting me look at the suit, that I may perhaps come to understand the manner of construction and nature of enchantments on it, I will further strengthen its protective abilities. For a modest fee, of course...~ */
  IF ~~ THEN REPLY #48461 /* ~That sounds great!~ */ GOTO 14
  IF ~~ THEN REPLY #48462 /* ~What's the catch?~ */ GOTO 14
  IF ~~ THEN REPLY #48463 /* ~I'd really rather just buy something, actually.~ */ DO ~StartStore("STO0703",Protagonist)
~ EXIT
  IF ~~ THEN REPLY #48464 /* ~Sorry, but I have to be going.~ */ EXIT
END

IF ~~ THEN BEGIN 14 // from: 13.1 13.0
  SAY #48465 /* ~All I require is 1,000 gold... And a pair of Golden Pantaloons. If you bring them to me, it should only take a matter of minutes.~ */
  IF ~~ THEN REPLY #48466 /* ~I'll bear that in mind. In the meantime, can I see your wares?~ */ DO ~StartStore("STO0703",Protagonist)
~ EXIT
  IF ~~ THEN REPLY #48467 /* ~I'll be back later, then.~ */ EXIT
END

IF ~~ THEN BEGIN 15 // from: 11.1
  SAY #48460 /* ~Now, the pair of us may be able to help each other out. In exchange for letting me look at the suit, that I may perhaps come to understand the manner of construction and nature of enchantments on it, I will further strengthen its protective abilities. For a modest fee, of course...~ */
  IF ~~ THEN REPLY #48461 /* ~That sounds great!~ */ GOTO 16
  IF ~~ THEN REPLY #48462 /* ~What's the catch?~ */ GOTO 16
  IF ~~ THEN REPLY #48463 /* ~I'd really rather just buy something, actually.~ */ DO ~StartStore("STO0703",Protagonist)
~ EXIT
  IF ~~ THEN REPLY #48464 /* ~Sorry, but I have to be going.~ */ EXIT
END

IF ~~ THEN BEGIN 16 // from: 15.1 15.0
  SAY #48468 /* ~All I require is 1,000 gold... And that pair of Golden Pantaloons I see. If you are willing, it should only take a matter of minutes.~ */
  IF ~~ THEN REPLY #48466 /* ~I'll bear that in mind. In the meantime, can I see your wares?~ */ DO ~StartStore("STO0703",Protagonist)
~ EXIT
  IF ~~ THEN REPLY #29355 /* ~I'll think about it. Farewell.~ */ EXIT
  IF ~  PartyGoldGT(999)
~ THEN REPLY #48461 /* ~That sounds great!~ */ GOTO 17
END

IF ~~ THEN BEGIN 17 // from: 16.2 12.0
  SAY #48469 /* ~Excellent! Then I shall begin...~ */
  IF ~~ THEN GOTO 18
END

IF ~~ THEN BEGIN 18 // from: 17.0
  SAY #48470 /* ~Almost done...~ */
  IF ~~ THEN GOTO 19
END

IF ~~ THEN BEGIN 19 // from: 18.0
  SAY #48471 /* ~There. Protection, style, service with a smile. It was good doing business with you, my <LADYLORD>.~ */
  IF ~~ THEN DO ~TakePartyGold(1000)
SetGlobal("X#HalbTalk","LOCALS",2)
TakePartyItem("X#GARCH")
DestroyItem("X#GARCH")
TakePartyItem("MISC47")
DestroyItem("MISC47")
TakePartyItem("_MISC47")
DestroyItem("_MISC47")
GiveItemCreate("X#GARCH2",Player1,1,0,0)
~ EXIT
END

IF WEIGHT #4 ~  PartyHasItem("X#XZDRIA")
Global("X#XzarMakeRing","GLOBAL",0)
~ THEN BEGIN 20 // from: 0.4
  SAY #49310 /* ~Well, gentles, may I... ack! What've you got there?~ */
  IF ~~ THEN REPLY #49311 /* ~This, sir, is the necromantically preserved essence of...~ */ DO ~SetGlobal("X#XzarMakeRing","GLOBAL",1)
~ GOTO 21
END

IF ~~ THEN BEGIN 21 // from: 20.0
  SAY #49312 /* ~It's a necromantic slime ball! Kill the necromancer, if you haven't already, but get that muck out of my establishment.~ */
  IF ~~ THEN REPLY #49313 /* ~But we have... ~ */ GOTO 22
END

IF ~~ THEN BEGIN 22 // from: 21.0
  SAY #49314 /* ~No stories! Out! Out! OUT!!! ~ */
  IF ~~ THEN DO ~TakePartyItem("X#XZDRIA")
DestroyItem("X#XZDRIA")
~ EXIT
END

IF ~~ THEN BEGIN 23 // from: 0.8
  SAY #49315 /* ~From the eager look on your friend's face, I assume that you want the ring made? Return in five days, my friends, and it's yours!~ */
  IF ~~ THEN EXTERN ~XZARJ~ 152
END

IF ~~ THEN BEGIN 24 // from:
  SAY #49316 /* ~Return in five days, my friends.~ */
  IF ~~ THEN DO ~TakePartyItem("X#XZDRIA")
DestroyItem("X#XZDRIA")
TakePartyItem("X#XZMIRI")
DestroyItem("X#XZMIRI")
TakePartyGold(1000)
SetGlobal("X#XZRingMade","GLOBAL",1)
SetGlobal("X#XZRingPayed","GLOBAL",1)
SetGlobalTimer("X#XzarRingTime","GLOBAL",FIVE_DAYS)
~ EXIT
END

IF ~~ THEN BEGIN 25 // from: 0.9
  SAY #49317 /* ~Ah, you are the ones that have the dryad's blood, but no money?~ */
  IF ~~ THEN GOTO 26
END

IF ~~ THEN BEGIN 26 // from: 25.0
  SAY #49318 /* ~Tell you what. I'll make the ring as a spec item. If you decide you want it for 500 gold, it's yours. If not, I'm sure I'll find another buyer. Return in five days.~ */
  IF ~~ THEN DO ~TakePartyItem("X#XZDRIA")
DestroyItem("X#XZDRIA")
TakePartyItem("X#XZMIRI")
DestroyItem("X#XZMIRI")
SetGlobal("X#XZRingMade","GLOBAL",3)
SetGlobalTimer("X#XzarRingTime","GLOBAL",FIVE_DAYS)
~ EXIT
END

IF WEIGHT #5 ~  Global("X#XZRingMade","GLOBAL",1)
~ THEN BEGIN 27 // from: 0.10
  SAY #49319 /* ~Ah, you're here for your ring, no doubt. Here you are, and a fine bit of work it is.~ */
  IF ~  InParty("xzar")
InMyArea("xzar")
!StateCheck("xzar",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#XZRingMade","GLOBAL",2)
GiveItemCreate("X#XZRING","xzar",1,0,0)
~ EXTERN ~XZARJ~ 148
  IF ~  !InParty("xzar")
~ THEN DO ~SetGlobal("X#XZRingMade","GLOBAL",2)
GiveItemCreate("X#XZRING",Player1,1,0,0)
~ EXIT
END

IF WEIGHT #6 ~  Global("X#XZRingMade","GLOBAL",3)
~ THEN BEGIN 28 // from: 0.11
  SAY #49320 /* ~Ah, you're here for your ring, no doubt. Here you are, and a fine bit of work it is. For only 500, this fine item is yours!~ */
  IF ~  PartyGoldGT(500)
~ THEN REPLY #49321 /* ~Well, we will take it.~ */ DO ~TakePartyGold(500)
SetGlobal("X#XZRingPayed","GLOBAL",1)
SetGlobal("X#XZRingMade","GLOBAL",4)
GiveItemCreate("X#XZRING","xzar",1,0,0)
~ EXTERN ~XZARJ~ 148
  IF ~~ THEN REPLY #49322 /* ~Forget it. Just show us your usual wares.~ */ DO ~SetGlobal("X#XZRingMade","GLOBAL",4)
StartStore("STO0703",LastTalkedToBy(Myself))
~ EXTERN ~XZARJ~ 149
END

IF WEIGHT #7 ~  Global("X#XZRingMade","GLOBAL",3)
~ THEN BEGIN 29 // from: 0.12
  SAY #49323 /* ~Your ring is ready, but I wager that you still do not have enough gold to pay for it. Well, well... perhaps another day.~ */
  IF ~~ THEN REPLY #49324 /* ~Just show us your usual wares.~ */ DO ~StartStore("STO0703",LastTalkedToBy(Myself))
~ EXIT
  IF ~~ THEN REPLY #49325 /* ~We will come back when we have 500 gold.~ */ EXIT
END

IF ~~ THEN BEGIN 30 // from:
  SAY #49327 /* ~Ulp! That's disgus... eh... it is finely preserved though. Dryad, isn't it?~ */
  IF ~~ THEN EXTERN ~XZARJ~ 138
END

IF ~~ THEN BEGIN 31 // from:
  SAY #49329 /* ~Well, a mithral ring would serve as a container to receive the magic of your... ugh... specimen. Unfortunately, I have no such thing is stock at the moment, myself. If you were to provide such an ideal container, then... let's see... the scroll, my time... for... nine hundred... call it one thousand gold pieces, I could produce a magical ring to resist enchantments – maybe even cast a minor one – in four... make it five days. Are you interested?~ */
  IF ~~ THEN EXTERN ~XZARJ~ 139
END

IF ~~ THEN BEGIN 32 // from:
  SAY #49327 /* ~Ulp! That's disgus... eh... it is finely preserved though. Dryad, isn't it?~ */
  IF ~~ THEN EXTERN ~XZARJ~ 145
END

IF ~~ THEN BEGIN 33 // from:
  SAY #49339 /* ~Well, a mithral ring would serve. Costs three... uh... four hundred to enchant it to contain the essence. With that and your... uh... component, I could create a ring that'd let you shrug off charms, for certain. Maybe even let you throw one back, if I'm undisturbed for the five days labor needed. Let's see... the scroll, my time, it'd cost nine... a thousand gold, altogether. What do you say?~ */
  IF ~~ THEN EXTERN ~XZARJ~ 146
END

IF ~~ THEN BEGIN 34 // from:
  SAY #49345 /* ~What's your decision?~ */
  IF ~  PartyGoldGT(1000)
~ THEN REPLY #49341 /* ~Oh, go ahead.~ */ EXTERN ~XZARJ~ 153
  IF ~~ THEN REPLY #49346 /* ~No way. It's nowhere near worth, it and we've got better stuff already.~ */ EXTERN ~XZARJ~ 164
END
