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

BEGIN ~TRHMER01~

IF ~!Dead("cefald01")
Global("geniesgone","GLOBAL",0)
~ THEN BEGIN 0 // from:
  SAY #43245 /* ~You are a stranger to this town, are you not?  I am surprised you were allowed to come within the walls.  You will find yourself unwelcome here.~ [BUSYA07] */
  IF ~~ THEN GOTO 1
END

IF ~~ THEN BEGIN 1 // from: 0.0
  SAY #43246 /* ~And, indeed... if you came to Trademeet to take advantage of our excellent markets, then you have come in vain.  Between the druids and... other problems... there is nothing to purchase here.~ */
  IF ~~ THEN REPLY #43247 /* ~What other problems are you referring to?~ */ GOTO 2
  IF ~~ THEN REPLY #43248 /* ~Nothing to purchase?  You mean people won't sell to me?~ */ GOTO 3
  IF ~~ THEN REPLY #43250 /* ~Just who are you, anyway?~ */ GOTO 6
  IF ~~ THEN REPLY #43249 /* ~I see.  I'll be on my way.~ */ GOTO 8
END

IF ~~ THEN BEGIN 2 // from: 7.0 6.0 5.0 1.0
  SAY #43251 /* ~It is nothing you need concern yourself with, stranger.  It is enough to say that our town is in danger of collapsing... there is nothing here for you to purchase.~ */
  IF ~~ THEN REPLY #43252 /* ~Nothing to purchase?  You mean people won't sell to me?~ */ GOTO 3
  IF ~~ THEN REPLY #43253 /* ~Just who are you, anyway?~ */ GOTO 6
  IF ~~ THEN REPLY #43254 /* ~I see.  I'll be on my way.~ */ GOTO 8
END

IF ~~ THEN BEGIN 3 // from: 6.1 2.0 1.1
  SAY #43255 /* ~No, I mean there is nothing for you to buy.  At least, not from the merchants and peddlers that have traditionally sold things here in Trademeet.~ */
  IF ~~ THEN GOTO 4
END

IF ~~ THEN BEGIN 4 // from: 3.0
  SAY #43256 /* ~If you are... truly desperate... you can go to the Dao djinn that have set up their tents outside of the main gates.  Hmph.  Their prices are exorbitant, but they own everything there is to sell.~ */
  IF ~~ THEN GOTO 5
END

IF ~~ THEN BEGIN 5 // from: 4.0
  SAY #43257 /* ~The caravans will not come because of the danger... and the few that have come only do so at the behest of the vast amounts of gold that the Dao seem to have flowing from their pockets.~ */
  IF ~~ THEN REPLY #43258 /* ~What other problems were you referring to?~ */ GOTO 2
  IF ~~ THEN REPLY #43259 /* ~Just who are you, anyway?~ */ GOTO 6
  IF ~~ THEN REPLY #43265 /* ~Is there nothing you can do about these Dao?~ */ GOTO 7
  IF ~~ THEN REPLY #43260 /* ~I see.  I'll be on my way.~ */ GOTO 8
END

IF ~~ THEN BEGIN 6 // from: 7.1 5.1 2.1 1.2
  SAY #43261 /* ~My name is Busya, and I am the mistress of the Merchant Guild in Trademeet.  Once, we promoted fair and honest trade here, but as of late my title is rather meaningless.~ */
  IF ~~ THEN REPLY #43262 /* ~What other problems were you referring to?~ */ GOTO 2
  IF ~~ THEN REPLY #43263 /* ~When you said there was nothing to purchase, here, did you mean because people won't sell to a stranger?~ */ GOTO 3
  IF ~~ THEN REPLY #43264 /* ~I'll be on my way.~ */ GOTO 8
END

IF ~~ THEN BEGIN 7 // from: 5.2
  SAY #43266 /* ~Hmph.  Until these animal attacks are stopped, there is no point.  If you are truly serious about helping, come and talk to me once that business is ended.~ */
  IF ~~ THEN REPLY #43267 /* ~What other problems were you referring to?~ */ GOTO 2
  IF ~~ THEN REPLY #43268 /* ~Just who are you, anyway?~ */ GOTO 6
  IF ~~ THEN REPLY #43269 /* ~I'll be on my way.~ */ GOTO 8
END

IF ~~ THEN BEGIN 8 // from: 7.2 6.2 5.3 2.2 1.3
  SAY #43270 /* ~As you wish, stranger.~ */
  IF ~~ THEN EXIT
END

IF ~!Dead("cefald01")
Global("geniesgone","GLOBAL",1)
!Global("genieReward","LOCALS",1)
~ THEN BEGIN 9 // from:
  SAY #43273 /* ~Ah!  You are the stranger who I am told has solved a rather thorny problem for us, whether you are aware of it or not.~ */
  IF ~~ THEN DO ~SetGlobal("genieReward","LOCALS",1)~ GOTO 10
END

IF ~~ THEN BEGIN 10 // from: 14.0 9.0
  SAY #43274 /* ~Those Dao djinn you dispatched came here recently from Calimshan, in the pursuit of a rakshasa, I am told.  They decided to set up shop, here, and proceeded to take over all business.~ */
  IF ~~ THEN GOTO 11
END

IF ~~ THEN BEGIN 11 // from: 10.0
  SAY #43275 /* ~They bribed all the caravans to go to them, only... ruining any of our other merchants.  Nothing could be done, especially with all these animal attacks keeping Lord Coprith busy.~ */
  IF ~!Dead("cefald01")
~ THEN GOTO 12
  IF ~Dead("cefald01")
Global("LoganMad","GLOBAL",1)~ THEN GOTO 43
  IF ~Dead("cefald01")
Global("LoganMad","GLOBAL",0)~ THEN GOTO 37
END

IF ~~ THEN BEGIN 12 // from: 11.0
  SAY #43276 /* ~But you have solved this problem for me, and I am most thankful.  Now, if only the druids could be dispatched so easily, Trademeet could return to the prosperity it once knew!  Regardless, you are due a reward.~ */
  IF ~~ THEN DO ~GiveGoldForce(7500)
GiveItemCreate("misc45",LastTalkedToBy,0,0,0)
GiveItemCreate("misc42",LastTalkedToBy,0,0,0)
GiveItemCreate("ring13",LastTalkedToBy,0,0,0)
GiveItemCreate("amul11",LastTalkedToBy,0,0,0)
GiveItemCreate("shld25",LastTalkedToBy,0,0,0)~ GOTO 13
END

IF ~~ THEN BEGIN 13 // from: 12.0
  SAY #43277 /* ~Good day to you, hero.~ */
  IF ~~ THEN DO ~EscapeArea()~ EXIT
END

IF ~Dead("cefald01")
Global("geniesgone","GLOBAL",1)
Global("busyajob","GLOBAL",0)
Global("busyarefused","GLOBAL",0)
!Global("Leave","LOCALS",1)
~ THEN BEGIN 14 // from:
  SAY #43279 /* ~Ah!  You are the hero who has saved us from the druids, yes?  Already, things have begun to be restored to normal once again in our town, and you have helped us in yet another way, whether you knew it or not.~ [BUSYA08] */
  IF ~~ THEN DO ~SetGlobal("Leave","LOCALS",1)
~ GOTO 10
END

IF ~Dead("cefald01")
Global("geniesgone","GLOBAL",0)
Global("busyajob","GLOBAL",0)
Global("busyarefused","GLOBAL",0)~ THEN BEGIN 15 // from:
  SAY #43280 /* ~Ah!  It is the hero who has saved us from the druids.  I give you my thanks... our town is in less trouble now than it was, and perhaps proper trade will soon be restored.~ */
  IF ~Global("loganjob2","GLOBAL",1)~ THEN DO ~SetGlobal("busyajob","GLOBAL",1)~ GOTO 16
  IF ~Global("loganjob2","GLOBAL",0)~ THEN GOTO 17
END

IF ~~ THEN BEGIN 16 // from: 15.0
  SAY #43281 /* ~There is yet one problem that plagues us, however, and Lord Coprith has informed me that you have agreed to help us with it.  Nothing would relieve me more.~ */
  IF ~~ THEN GOTO 21
END

IF ~~ THEN BEGIN 17 // from: 15.1
  SAY #43282 /* ~There is yet one problem that plagues us, however, and that is the matter of the Dao djinn who have usurped trade in the entire town.~ */
  IF ~~ THEN GOTO 18
END

IF ~~ THEN BEGIN 18 // from: 17.0
  SAY #43283 /* ~They arrived recently from Calimshan, in search of a criminal rakshasa they said.  But then they decided to stay, and bribed all the caravans who come to Trademeet to supply only them.~ */
  IF ~~ THEN GOTO 19
END

IF ~~ THEN BEGIN 19 // from: 18.0
  SAY #43284 /* ~Their prices are exorbitant, and we cannot match their endless supply of gold to buy supplies of our own.  They demand this rakshasa be turned over to them, but we have no idea where it might be found!~ */
  IF ~~ THEN GOTO 20
END

IF ~~ THEN BEGIN 20 // from: 19.0
  SAY #43285 /* ~Our merchants have nothing to sell and even the supply of food is dwindling... I beg of you to assist us!  We are saved from the druids only to be strangled by the djinn if you do not!~ */
  IF ~~ THEN REPLY #43286 /* ~What exactly do you expect me to do?~ */ GOTO 24
  IF ~OR(2)
!Global("chapter","GLOBAL",2)
!Global("ShadowWork","GLOBAL",1)~ THEN REPLY #43287 /* ~What kind of reward am I looking at for this?~ */ GOTO 26
  IF ~Global("chapter","GLOBAL",2)
Global("ShadowWork","GLOBAL",1)~ THEN REPLY #46053 /* ~I need to save up a large amount of gold to rescue a friend being held by the Cowled Wizards.  Is there a reward, perhaps?~ */ GOTO 26
  IF ~~ THEN REPLY #43288 /* ~I have freed up Sir Logan's men, why does he just not deal with them himself?~ */ GOTO 27
  IF ~~ THEN REPLY #43289 /* ~I am sorry, I have no time to help you.~ */ DO ~SetGlobal("busyarefused","GLOBAL",1)~ GOTO 28
END

IF ~~ THEN BEGIN 21 // from: 32.0 16.0
  SAY #43290 /* ~The Dao stay in their tents just outside of the town entrance... I ask that you go there and convince them to leave.  Either find their rakshasa or... or destroy them, I suppose, as dastardly as that might sound.~ */
  IF ~~ THEN GOTO 22
END

IF ~~ THEN BEGIN 22 // from: 21.0
  SAY #43291 /* ~In return, I offer you a reward of gold, as well as an item of some power that the guild has in its stores.  No doubt the djinn also have plenty of wealth of their own, as well.~ */
  IF ~~ THEN GOTO 23
END

IF ~~ THEN BEGIN 23 // from: 22.0
  SAY #43292 /* ~We don't desire trouble with such powerful beings, but we cannot last without supplies any longer.  Their demands are unfair.  Please... do what you can, I beg of you.~ */
  IF ~~ THEN UNSOLVED_JOURNAL #6583 /* ~Dealing with the Trademeet Genies.

Guildmistress Busya said that the genies have taken over trade within Trademeet and will not leave until they find the rakshasa they are looking for.  I have agreed to either find the rakshasa or kill the genies. Either way, Busya has promised to reward me.~ */ EXIT
END

IF ~~ THEN BEGIN 24 // from: 30.0 27.0 26.0 20.0
  SAY #43293 /* ~We do not know where their rakshasa is, nor can we continue much longer without proper supply.  Either you must convince them to leave, somehow, or... or destroy them, I suppose, as dastardly as that might sound.~ */
  IF ~~ THEN GOTO 25
END

IF ~~ THEN BEGIN 25 // from: 24.0
  SAY #43294 /* ~I do not wish trouble with them, but their demands are unfair.  (sigh)  If Waukeen were still with us, she would never have allowed this to happen here in Trademeet!~ */
  IF ~OR(2)
!Global("chapter","GLOBAL",2)
!Global("ShadowWork","GLOBAL",1)~ THEN REPLY #43295 /* ~What kind of reward am I looking at for this?~ */ GOTO 26
  IF ~Global("chapter","GLOBAL",2)
Global("ShadowWork","GLOBAL",1)~ THEN REPLY #46054 /* ~I need to gather a large amount of gold to rescue a friend being held by the Cowled Wizards.  Might there be a reward involved?~ */ GOTO 26
  IF ~~ THEN REPLY #43296 /* ~I have freed up Sir Logan's men, why does he just not deal with them himself?~ */ GOTO 27
  IF ~~ THEN REPLY #43297 /* ~Very well, I will see what I can do.~ */ DO ~SetGlobal("busyajob","GLOBAL",1)~ GOTO 29
  IF ~~ THEN REPLY #43298 /* ~No, I do not have the time to do this.~ */ DO ~SetGlobal("busyarefused","GLOBAL",1)~ GOTO 28
END

IF ~~ THEN BEGIN 26 // from: 30.2 30.1 27.2 27.1 25.1 25.0 20.2 20.1
  SAY #43299 /* ~I still have gold and magical items in the guild's possession, which I will offer as a reward... and I am sure the djinn, themselves, possess wealth in abundance, should you wish to take it from them.~ */
  IF ~~ THEN REPLY #43300 /* ~What exactly do you expect me to do?~ */ GOTO 24
  IF ~~ THEN REPLY #43301 /* ~I have freed up Sir Logan's men, why does he just not deal with them himself?~ */ GOTO 27
  IF ~~ THEN REPLY #43302 /* ~Very well, I will see what I can do.~ */ DO ~SetGlobal("busyajob","GLOBAL",1)~ GOTO 29
  IF ~~ THEN REPLY #43303 /* ~No, I do not have the time to do this.~ */ DO ~SetGlobal("busyarefused","GLOBAL",1)~ GOTO 28
END

IF ~~ THEN BEGIN 27 // from: 30.3 26.1 25.2 20.3
  SAY #43304 /* ~The number of men under Sir Logan's command has dwindled from the animal attacks.  The djinn are also quite powerful...  But... if you could defeat the druids... surely you could do this?~ */
  IF ~~ THEN REPLY #43305 /* ~What exactly do you expect me to do?~ */ GOTO 24
  IF ~OR(2)
!Global("chapter","GLOBAL",2)
!Global("ShadowWork","GLOBAL",1)~ THEN REPLY #43306 /* ~What kind of reward am I looking at for this?~ */ GOTO 26
  IF ~Global("chapter","GLOBAL",2)
Global("ShadowWork","GLOBAL",1)~ THEN REPLY #46055 /* ~I could.  But I need to gather a large amount of gold to rescue a friend.  Is there a reward?~ */ GOTO 26
  IF ~~ THEN REPLY #43307 /* ~Very well, I will see what I can do.~ */ DO ~SetGlobal("busyajob","GLOBAL",1)~ GOTO 29
  IF ~~ THEN REPLY #43308 /* ~No, I do not have the time to do this.~ */ DO ~SetGlobal("busyarefused","GLOBAL",1)~ GOTO 28
END

IF ~~ THEN BEGIN 28 // from: 27.4 26.3 25.4 20.4
  SAY #43309 /* ~(sigh)  Well, if that is what you decide, I can do little about it.  Come back and speak to me if you change your mind.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 29 // from: 30.4 27.3 26.2 25.3
  SAY #43310 /* ~I am relieved to hear you say that.  The Dao have their tents just outside of the entrance to town... go, please, and do what you can.~ */
  IF ~~ THEN UNSOLVED_JOURNAL #6583 /* ~Dealing with the Trademeet Genies.

Guildmistress Busya said that the genies have taken over trade within Trademeet and will not leave until they find the rakshasa they are looking for.  I have agreed to either find the rakshasa or kill the genies. Either way, Busya has promised to reward me.~ */ EXIT
END

IF ~Global("busyarefused","GLOBAL",1)
Global("busyajob","GLOBAL",0)
Global("loganjob2","GLOBAL",0)~ THEN BEGIN 30 // from:
  SAY #43311 /* ~You are back!  Have you changed your mind regarding the Dao?  We are in desperate need, my <PRO_LADYLORD>...~ */
  IF ~~ THEN REPLY #43312 /* ~What is it, exactly, that you wish me to do?~ */ GOTO 24
  IF ~OR(2)
!Global("chapter","GLOBAL",2)
!Global("ShadowWork","GLOBAL",1)~ THEN REPLY #43313 /* ~What kind of reward am I looking at?~ */ GOTO 26
  IF ~Global("chapter","GLOBAL",2)
Global("ShadowWork","GLOBAL",1)~ THEN REPLY #46056 /* ~I need to gather a large amount of gold to rescue a friend being held by the Cowled Wizards, so I'll need a reward.~ */ GOTO 26
  IF ~~ THEN REPLY #43314 /* ~Why do Lord Logan's men not handle this?  They no longer have to deal with the animal attacks.~ */ GOTO 27
  IF ~~ THEN REPLY #43315 /* ~Very well... I'll help, if I can.~ */ GOTO 29
  IF ~~ THEN REPLY #43316 /* ~No, I still cannot help you.~ */ GOTO 31
END

IF ~~ THEN BEGIN 31 // from: 30.5
  SAY #43317 /* ~Then why do you speak to me?  Is it your wish to torment me?  Begone!~ */
  IF ~~ THEN EXIT
END

IF ~Global("busyarefused","GLOBAL",1)
Global("busyajob","GLOBAL",0)
Global("loganjob2","GLOBAL",1)~ THEN BEGIN 32 // from:
  SAY #43318 /* ~Lord Logan has told me that you've agreed to aid us with the Dao... I cannot tell you how relieved I am to hear this.  You have saved us from the druids... you are my only hope with this.~ */
  IF ~~ THEN DO ~SetGlobal("busyajob","GLOBAL",1)~ GOTO 21
END

IF ~Global("busyajob","GLOBAL",1)~ THEN BEGIN 33 // from:
  SAY #43322 /* ~So... have the djinn been dealt with?  Have you been successful?~ [BUSYA09] */
  IF ~Dead("trgeni01")~ THEN REPLY #43323 /* ~I have destroyed all of the djinn... they will bother you no further.~ */ GOTO 34
  IF ~Global("zahraajob","GLOBAL",2)~ THEN REPLY #43324 /* ~I found the rakshasa that the Dao were looking for, and they have agreed to leave.~ */ GOTO 38
  IF ~Global("zahraajob","GLOBAL",1)~ THEN REPLY #43325 /* ~Not quite yet.  I have agreed to look for the rakshasa that the Dao wish to find... in return, they will leave.~ */ GOTO 39
  IF ~!Dead("trgeni01")
Global("zahraajob","GLOBAL",0)~ THEN REPLY #43326 /* ~No, I haven't yet.  But I intend to.~ */ GOTO 40
  IF ~!Dead("trgeni01")
Global("loganjob2","GLOBAL",0)~ THEN REPLY #43327 /* ~No... and I have decided that I don't have the time to continue this.~ */ DO ~SetGlobal("busyajob","GLOBAL",0)
SetGlobal("busyarefused","GLOBAL",1)~ GOTO 41
  IF ~!Dead("trgeni01")
Global("loganjob2","GLOBAL",1)~ THEN REPLY #43338 /* ~No... and I have decided that I don't have the time to continue this.~ */ GOTO 42
END

IF ~~ THEN BEGIN 34 // from: 33.0
  SAY #43330 /* ~Ah, so it is done.  I would have hoped it could have been done peacefully... there is no telling whether more of their kind will come, now... but what is important is that their monopoly has been ended.~ */
  IF ~Global("LoganMad","GLOBAL",0)~ THEN GOTO 35
  IF ~Global("LoganMad","GLOBAL",1)~ THEN GOTO 43
END

IF ~~ THEN BEGIN 35 // from: 38.0 34.0
  SAY #43331 /* ~You have the sincere thanks of Trademeet's merchants and, I am sure, all of its citizens.  Here is the reward that I promised you.~ */
  IF ~GlobalLT("loganjob2","GLOBAL",2)~ THEN GOTO 36
  IF ~Global("loganjob2","GLOBAL",2)~ THEN GOTO 37
END

IF ~~ THEN BEGIN 36 // from: 35.0
  SAY #43332 /* ~You should go and find Lord Logan, I think, and tell him of your deed.  No doubt he will be overjoyed to hear of it... you have earned a hero's welcome here in Trademeet, my <LADYLORD>.~ */
  IF ~~ THEN UNSOLVED_JOURNAL #10125 /* ~Dealing with the Trademeet Genies.

The guildmistress was pleased at my ridding the town of the problem of the genies.  She suggested that I go to Lord Logan Coprith to tell him that the deed is done.~ */ GOTO 37
END

IF ~~ THEN BEGIN 37 // from: 43.0 36.0 35.1 11.2
  SAY #43333 /* ~I, myself, have much to do at the moment.  The caravans must be contacted and brought in immediately to give us the supplies we need.  Thank you once again.~ */
  IF ~~ THEN DO ~GiveGoldForce(7500)
GiveItemCreate("misc45",LastTalkedToBy,0,0,0)
GiveItemCreate("misc42",LastTalkedToBy,0,0,0)
GiveItemCreate("ring13",LastTalkedToBy,0,0,0)
GiveItemCreate("amul11",LastTalkedToBy,0,0,0)
GiveItemCreate("shld25",LastTalkedToBy,0,0,0)
EscapeArea()~ EXIT
END

IF ~~ THEN BEGIN 38 // from: 33.1
  SAY #43334 /* ~Ah, so it is done.  And you have found the peaceful solution, as well... that means we do not have to fear a visit by more of their kind.  Your good reputation is well deserved, I think.~ */
  IF ~Global("LoganMad","GLOBAL",0)~ THEN GOTO 35
  IF ~Global("LoganMad","GLOBAL",1)~ THEN GOTO 43
END

IF ~~ THEN BEGIN 39 // from: 33.2
  SAY #43335 /* ~That is excellent.  A peaceful way to make these creatures leave would be preferable.  Please find this rakshasa, then, as quickly as you can.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 40 // from: 33.3
  SAY #43336 /* ~Very good.  Please do so quickly, for we are all depending on you.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 41 // from: 33.4
  SAY #43337 /* ~You don't?  Ah, that is too bad.  I wish... I wish there was someone else we could turn to.  If you change your mind, please do come and speak to me.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 42 // from: 33.5
  SAY #43339 /* ~Then... then you should go and speak to Lord Logan, I think, and tell him that this is what you have decided.  I beg you to reconsider, however... there is nothing we can do about these Dao without your aid!~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 43 // from: 38.1 34.1 11.1
  SAY #57697 /* ~Lord Logan is still quite angry over your poisoning of the grove... as are many others.  We merchants see the necessity, however.  But the reward is all I can offer you.~ */
  IF ~~ THEN GOTO 37
END
