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

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

IF WEIGHT #0 ~NumberOfTimesTalkedTo(0)
~ THEN BEGIN 0 // from:
  SAY #84654 /* ~Uh, hello, friends, it is pleasure meeting you. You are heroes for Sword Coast, I, uhm, long wait to meet you. I am Mendas of Waterdeep, quester of small truth in this land. We, that is, I am in need of favor from you. I have a money for pay and a big heart for friendship. Can you help a gentle fellow in search for knowledge?~ */
  IF ~~ THEN REPLY #84655 /* ~Knowledge is a worthy pursuit my friend. I will help if I can.~ */ DO ~SetGlobal("TalkedToMendas","GLOBAL",1)
~ GOTO 2
  IF ~~ THEN REPLY #84656 /* ~Consult a library, sir. I have no time for such as you.~ */ DO ~SetGlobal("TalkedToMendas","GLOBAL",1)
~ GOTO 22
  IF ~~ THEN REPLY #84657 /* ~You mentioned money?~ */ DO ~SetGlobal("TalkedToMendas","GLOBAL",1)
~ GOTO 16
END

IF WEIGHT #4 /* Triggers after states #: 12 15 25 even though they appear after this state */
~Global("TalkedToMendas","GLOBAL",1)
~ THEN BEGIN 1 // from:
  SAY #84658 /* ~You consider my offer, heroic one?~ */
  IF ~~ THEN REPLY #84659 /* ~I would be interested to hear more about this "favor" that you would like me to do for you.~ */ GOTO 2
  IF ~~ THEN REPLY #84660 /* ~I have important business to attend to. Perhaps another time.~ */ GOTO 22
END

IF ~~ THEN BEGIN 2 // from: 22.0 21.0 20.0 17.0 16.2 1.0 0.0
  SAY #84661 /* ~Tragic things are happening in this unfair, uh, how you say... world. The men with power, they hurt the men with none. They destroy things that teach us better life. I tell you true, it would be better if these men are not born!

This Merchant League, these bad men, they find the island to the west. The island has a broken ship, an, uh, shipwreck. Very old shipwreck, they say.~ */
  IF ~ReactionGT(LastTalkedToBy,HOSTILE_UPPER)
~ THEN REPLY #84662 /* ~Get on with it man, you're as long-winded as Volo.~ */ GOTO 5
  IF ~ReactionLT(LastTalkedToBy,NEUTRAL_LOWER)
~ THEN REPLY #84663 /* ~Out with it, man! You're as long-winded as Volo!~ */ GOTO 7
  IF ~~ THEN REPLY #84664 /* ~Please go on.~ */ GOTO 5
  IF ~~ THEN REPLY #84665 /* ~How did the Merchant League discover the island?~ */ GOTO 3
END

IF ~~ THEN BEGIN 3 // from: 2.3
  SAY #84666 /* ~They sail to New World and big storm blow them north. The sailors can't control boat and it almost crash on island rocks. It is very stormy but they can see the old wrecked ship. They come back to Baldur's Gate and sell sea charts to Merchants' League. A pox upon them!~ */
  IF ~~ THEN REPLY #84667 /* ~Why is the Merchants' League interested in an island in the middle of nowhere? What does it boast besides dangerous shores and a rotting ship?~ */ GOTO 4
  IF ~ReactionLT(LastTalkedToBy,NEUTRAL_LOWER)
~ THEN REPLY #84668 /* ~Get to the point, windbag!~ */ GOTO 7
  IF ~ReactionGT(LastTalkedToBy,HOSTILE_UPPER)
~ THEN REPLY #84669 /* ~Where is this leading, sir?~ */ GOTO 5
END

IF ~~ THEN BEGIN 4 // from: 3.0
  SAY #84670 /* ~These merchant men are greedy. They want island and ship. May their bones rot in Nine Hells!

The merchants want treasures from the New World. The Trackless Sea is very wide, so Merchant League ships must stop for supplies. They would stop at Evermeet but elf place is north, too much. Only place to stop is Sundrah on Lantan but fees are very expensive. Merchant men lose money too much in Sundrah.

The Merchant sailors see more than shipwreck on island. They see big harbor, also. They want to turn this harbor into new stop for ships from Waterdeep or Baldur's Gate.~ */
  IF ~~ THEN REPLY #84671 /* ~What about the shipwreck?~ */ GOTO 5
  IF ~~ THEN REPLY #84672 /* ~Why is all of this so important to you?~ */ GOTO 6
END

IF ~~ THEN BEGIN 5 // from: 6.0 4.0 3.2 2.2 2.0
  SAY #84673 /* ~The Merchant League sailors see markings on the ship. The shipwreck, hero, is Balduran's. These men they think that Balduran had much treasure on his final voyage. Maybe this true, but ship also has many artifacts.  These things hold knowledge of Balduran's fate. I wish to recover the ship's logbook. I will solve mystery of Balduran's final voyage. Merchant League will destroy my artifacts to get treasure. This must not happen! If you help me: I get things precious to me, you get treasure, merchant men get nothing.

You will help, yes?~ */
  IF ~~ THEN REPLY #84674 /* ~I'm afraid I cannot help you at this time. Perhaps later.~ */ GOTO 14
  IF ~~ THEN REPLY #84675 /* ~Though foiling the plans of innocent merchants grates on my conscience, I will help you.~ */ GOTO 8
  IF ~~ THEN REPLY #84676 /* ~Mendas, you are clearly working towards a noble end. I will help you.~ */ GOTO 8
  IF ~~ THEN REPLY #84677 /* ~I've had enough of this, old man. Out of my way!~ */ GOTO 7
END

IF ~~ THEN BEGIN 6 // from: 4.1
  SAY #84678 /* ~I am man of science. Merchant League men moved only by greed. They will destroy knowledge I need from the ship in their lust for wealth and trade advantage. Curse their black hearts!~ */
  IF ~~ THEN REPLY #84679 /* ~What knowledge does a rotting shipwreck hold?~ */ GOTO 5
  IF ~~ THEN REPLY #84680 /* ~The petty squabbles of merchants and scholars matter not to me.~ */ GOTO 7
END

IF ~~ THEN BEGIN 7 // from: 6.1 5.3 3.1 2.1
  SAY #84681 /* ~You are very rude for hero.~ */
  IF ~~ THEN DO ~SetGlobal("TalkedToMendas","GLOBAL",1)
~ UNSOLVED_JOURNAL #84682 /* ~The reclusive scholar

Some old dodder named Mendas wanted to hire me for an errand.  He'll wait 'til I'm ready, and he'll like it.~ */ EXIT
END

IF ~~ THEN BEGIN 8 // from: 5.2 5.1
  SAY #84683 /* ~I charter boat forthwith. There is small problem, though. These men that find island, they keep the sea charts locked up. In Baldur's Gate, there is building in Northeast of city called Counting House; to find it just go northeast from Elfsong tavern.  The sea charts, they are in there. Most likely, captain of ship will have them.

I don't know such things as chart retrieval but you are hero and it is no problem for heroes. There might be small danger so I give you some gold for the charts. I will wait for you here.~ */
  IF ~~ THEN REPLY #84684 /* ~Consider it done. I will back as soon as I am able.~ */ DO ~SetGlobal("MetMendas","GLOBAL",1)
SetGlobal("ChartQuest","GLOBAL",1)
SetGlobal("TalkedToMendas","GLOBAL",2)
~ GOTO 11
  IF ~ReactionLT(LastTalkedToBy,FRIENDLY_LOWER)
~ THEN REPLY #84685 /* ~How much gold are you speaking of?~ */ GOTO 9
  IF ~ReactionGT(LastTalkedToBy,NEUTRAL_UPPER)
~ THEN REPLY #84686 /* ~Exactly how much gold could you spare for this dangerous task?~ */ GOTO 10
  IF ~~ THEN REPLY #84687 /* ~I will not steal sea charts from the Merchant League! I would be no better than a common uh... well, merchant I suppose.~ */ DO ~SetGlobal("TalkedToMendas","GLOBAL",1)
~ GOTO 14
  IF ~Global("X#AloraMendas","GLOBAL",0)
InParty("alora")
InMyArea("alora")
!StateCheck("alora",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#AloraMendas","GLOBAL",1)~ EXTERN ~_ALORAJ~ 24
END

IF ~~ THEN BEGIN 9 // from: 26.1 8.1
  SAY #84688 /* ~I can spare 2,000 gold pieces for the charts.~ */
  IF ~~ THEN REPLY #84689 /* ~I am on my way.~ */ DO ~SetGlobal("MetMendas","GLOBAL",1)
SetGlobal("ChartQuest","GLOBAL",1)
SetGlobal("TalkedToMendas","GLOBAL",2)
SetGlobal("MendasLess","GLOBAL",1)
~ GOTO 11
  IF ~~ THEN REPLY #84690 /* ~I am insulted that you think so lowly of me. Good day.~ */ DO ~SetGlobal("TalkedToMendas","GLOBAL",1)
~ GOTO 14
  IF ~~ THEN REPLY #84691 /* ~You must try harder than that.~ */ GOTO 18
END

IF ~~ THEN BEGIN 10 // from: 26.2 8.2
  SAY #84692 /* ~I can spare 3,000 gold pieces for the charts.~ */
  IF ~~ THEN REPLY #84690 /* ~I am insulted that you think so lowly of me. Good day.~ */ GOTO 14
  IF ~~ THEN REPLY #84691 /* ~You must try harder than that.~ */ GOTO 18
  IF ~~ THEN REPLY #84689 /* ~I am on my way.~ */ DO ~SetGlobal("MetMendas","GLOBAL",1)
SetGlobal("ChartQuest","GLOBAL",1)
SetGlobal("TalkedToMendas","GLOBAL",2)
SetGlobal("MendasMore","GLOBAL",1)
~ GOTO 11
END

IF WEIGHT #5 /* Triggers after states #: 12 15 25 even though they appear after this state */
~Global("ChartQuest","GLOBAL",1)
Global("TalkedToMendas","GLOBAL",2)
~ THEN BEGIN 11 // from: 26.0 18.0 10.2 9.0 8.0
  SAY #84693 /* ~Please hurry friends, I need charts soon. Merchants prepare ships as we speak.~ */
  IF ~~ THEN DO ~SetGlobal("MetMendas","GLOBAL",1)
SetGlobal("ChartQuest","GLOBAL",1)
SetGlobal("TalkedToMendas","GLOBAL",2)
SetGlobal("MendasLess","GLOBAL",1)
~ UNSOLVED_JOURNAL #84694 /* ~The reclusive scholar

Mendas has sent us to the Counting House of the Merchant League in the city of Baldur's Gate.  We are to 'obtain' their sea charts for him.  The Counting House should be located in the northeastern quadrant of the city.~ */ EXIT
END

IF WEIGHT #1 ~PartyHasItem("_MISC1C")
Global("MendasLess","GLOBAL",1)
Global("TalkedToMendas","GLOBAL",2)
~ THEN BEGIN 12 // from:
  SAY #84695 /* ~Wonderful, my friends! I copy charts now. If you are ready, I hire boat for your journey.  Here is the money I owe you: 2,000 gold.~ */
  IF ~~ THEN REPLY #84696 /* ~I'm not ready for a journey yet.~ */ DO ~GiveGoldForce(2000)
TakePartyItem("_MISC1C")
SetGlobal("TalkedToMendas","GLOBAL",3)
~ GOTO 24
  IF ~~ THEN REPLY #84697 /* ~I am ready. Where is your boat?~ */ DO ~GiveGoldForce(2000)
TakePartyItem("_MISC1C")
SetGlobal("ReadyToSail","GLOBAL",1)
~ GOTO 13
END

IF ~~ THEN BEGIN 13 // from: 25.0 15.1 12.1
  SAY #84698 /* ~I hire boat at the docks here in Ulgoth's Beard. I meet you there soon.~ */
  IF ~~ THEN DO ~SetGlobal("ReadyToSail","GLOBAL",1)
EscapeArea()
~ UNSOLVED_JOURNAL #84699 /* ~The reclusive scholar

We have agreed to travel the Trackless Sea for Mendas, and fetch him the log book from Balduran's final voyage.  Mendas will hire a boat and meet us at the docks in Ulgoth's Beard.~ */ EXIT
END

IF ~~ THEN BEGIN 14 // from: 26.3 19.2 18.1 10.0 9.1 8.3 5.0
  SAY #84700 /* ~Please reconsider, noble hero. There is much treasure and glory in this adventure.~ */
  IF ~~ THEN DO ~SetGlobal("TalkedToMendas","GLOBAL",1)
~ EXIT
END

IF WEIGHT #2 ~PartyHasItem("_MISC1C")
Global("MendasMore","GLOBAL",1)
Global("TalkedToMendas","GLOBAL",2)
~ THEN BEGIN 15 // from:
  SAY #84701 /* ~Wonderful, my friends! I copy charts now. If you are ready, I hire boat for your journey.  Here is your money: 3,000 gold.~ */
  IF ~~ THEN REPLY #84696 /* ~I'm not ready for a journey yet.~ */ DO ~GiveGoldForce(3000)
TakePartyItem("_MISC1C")
SetGlobal("TalkedToMendas","GLOBAL",3)
~ GOTO 24
  IF ~~ THEN REPLY #84697 /* ~I am ready. Where is your boat?~ */ DO ~GiveGoldForce(3000)
TakePartyItem("_MISC1C")
~ GOTO 13
END

IF ~~ THEN BEGIN 16 // from: 22.2 0.2
  SAY #84702 /* ~You are very busy, of course. Is 2,000 gold pieces enough?~ */
  IF ~ReactionGT(LastTalkedToBy,NEUTRAL_UPPER)
~ THEN REPLY #84703 /* ~That is hardly reasonable compensation for the task. You'll have to do better.~ */ GOTO 17
  IF ~ReactionLT(LastTalkedToBy,FRIENDLY_LOWER)
~ THEN REPLY #84704 /* ~I should be paid more for having to listen to you jabber. Pay up or find a new lackey.~ */ GOTO 17
  IF ~~ THEN REPLY #84705 /* ~2,000 gold pieces will do nicely.~ */ GOTO 2
END

IF ~~ THEN BEGIN 17 // from: 16.1 16.0
  SAY #84706 /* ~Please, kind hero, I am not rich. I am but a scholar. It is all I have.~ */
  IF ~~ THEN REPLY #84707 /* ~It is banditry but I will accept.~ */ DO ~SetGlobal("MetMendas","GLOBAL",1)
SetGlobal("ChartQuest","GLOBAL",1)
SetGlobal("MendasMore","GLOBAL",1)
~ GOTO 2
  IF ~~ THEN REPLY #84708 /* ~Let us first discuss the mission then we will speak again of pay.~ */ GOTO 20
  IF ~~ THEN REPLY #83421 /* ~It is not enough. Good day.~ */ GOTO 22
END

IF ~~ THEN BEGIN 18 // from: 10.1 9.2
  SAY #84709 /* ~Please, kind hero, I am not rich. I am poor scholar. It is all I have.~ */
  IF ~~ THEN REPLY #84710 /* ~I suppose that it will do. I will go to this Counting House and retrieve the sea charts.~ */ DO ~SetGlobal("MetMendas","GLOBAL",1)
SetGlobal("ChartQuest","GLOBAL",1)
SetGlobal("MendasLess","GLOBAL",1)
~ GOTO 11
  IF ~~ THEN REPLY #84711 /* ~That is not sufficient for so dangerous an undertaking.~ */ GOTO 14
END

IF ~~ THEN BEGIN 19 // from:
  SAY #84712 /* ~You make me bereft, sir, but I give maybe 3,000.~ */
  IF ~~ THEN REPLY #84713 /* ~Perhaps. I need more information first.~ */ GOTO 20
  IF ~~ THEN REPLY #84714 /* ~That will be perfect. Who do you want killed?~ */ GOTO 21
  IF ~~ THEN REPLY #84715 /* ~I'm afraid my consulting fee is somewhat higher than 3,000. Perhaps I can help you when I'm not so busy.~ */ GOTO 14
END

IF ~~ THEN BEGIN 20 // from: 19.0 17.1
  SAY #84716 /* ~Yes, of course, benevolent hero. There is task for me that you must perform.~ */
  IF ~~ THEN GOTO 2
END

IF ~~ THEN BEGIN 21 // from: 19.1
  SAY #84717 /* ~That is not what I require, excitable one. I will explain.~ */
  IF ~~ THEN GOTO 2
END

IF ~~ THEN BEGIN 22 // from: 17.2 1.1 0.1
  SAY #84718 /* ~You would do well to listen to my proposal. There is much treasure involved.~ */
  IF ~~ THEN REPLY #84719 /* ~Treasure, you say? Speak on, good man.~ */ GOTO 2
  IF ~~ THEN REPLY #84720 /* ~I care not. Begone!~ */ GOTO 23
  IF ~~ THEN REPLY #84722 /* ~How much treasure do you speak of?~ */ GOTO 16
END

IF ~~ THEN BEGIN 23 // from: 22.1
  SAY #84723 /* ~Should you be interested later, I will be here.~ */
  IF ~~ THEN DO ~SetGlobal("TalkedtoMendas","GLOBAL",1)
~ UNSOLVED_JOURNAL #84682 /* ~The reclusive scholar

Some old dodder named Mendas wanted to hire me for an errand.  He'll wait 'til I'm ready, and he'll like it.~ */ EXIT
END

IF ~~ THEN BEGIN 24 // from: 25.1 15.0 12.0
  SAY #84724 /* ~I will remain here should you change your mind. Remember, hero, there is much treasure and glory in this adventure.~ */
  IF ~~ THEN UNSOLVED_JOURNAL #84682 /* ~The reclusive scholar

Some old dodder named Mendas wanted to hire me for an errand.  He'll wait 'til I'm ready, and he'll like it.~ */ EXIT
END

IF WEIGHT #3 ~Global("TalkedToMendas","GLOBAL",3)
~ THEN BEGIN 25 // from:
  SAY #84725 /* ~You will take this journey for me now, yes?~ */
  IF ~~ THEN REPLY #84726 /* ~I will undertake the journey.~ */ GOTO 13
  IF ~~ THEN REPLY #84727 /* ~I am not prepared to go on this trip for you.~ */ GOTO 24
END

IF ~~ THEN BEGIN 26 // from:
  SAY #98368 /* ~Okay, so much danger, maybe. But gold for danger good, yes? ~ */
  IF ~~ THEN REPLY #84684 /* ~Consider it done. I will back as soon as I am able.~ */ DO ~SetGlobal("MetMendas","GLOBAL",1)
SetGlobal("ChartQuest","GLOBAL",1)
SetGlobal("TalkedToMendas","GLOBAL",2)
~ GOTO 11
  IF ~ReactionLT(LastTalkedToBy,FRIENDLY_LOWER)
~ THEN REPLY #84685 /* ~How much gold are you speaking of?~ */ GOTO 9
  IF ~ReactionGT(LastTalkedToBy,NEUTRAL_UPPER)
~ THEN REPLY #84686 /* ~Exactly how much gold could you spare for this dangerous task?~ */ GOTO 10
  IF ~~ THEN REPLY #84687 /* ~I will not steal sea charts from the Merchant League! I would be no better than a common uh... well, merchant I suppose.~ */ DO ~SetGlobal("TalkedToMendas","GLOBAL",1)
~ GOTO 14
END
