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

BEGIN ~HENDAK~

IF ~NumTimesTalkedTo(0)
!Dead("Lehtinan")
!PartyHasItem("MISC4Z")
~ THEN BEGIN 0 // from:
  SAY #17066 /* ~A moment, friend!  You are obviously not aligned with our captors!  Might I know your name?~ [HENDAK02] */
  IF ~~ THEN REPLY #17076 /* ~My name is <CHARNAME>, and I am certainly not aligned with Lehtinan and his men.  Who are you?~ */ DO ~SetGlobal("HendakTold","GLOBAL",1)~ GOTO 35
  IF ~~ THEN REPLY #17077 /* ~My name is my own business.  What is it that you wish?~ */ DO ~SetGlobal("HendakTold","GLOBAL",1)~ GOTO 35
  IF ~~ THEN REPLY #17078 /* ~I've no time to waste speaking with you.~ */ DO ~SetGlobal("HendakTold","GLOBAL",1)~ GOTO 3
END

IF ~Global("KnowCellKey","AR0406",0)
!Dead("Lehtinan")
!PartyHasItem("MISC4Z")
~ THEN BEGIN 1 // from: 2.0
  SAY #17080 /* ~I beg of you, please free us!  I have never begged before, and yet I do it now so I might wreak vengeance on Lehtinan and end his sick and twisted enterprise!~ [HENDAK06] */
  IF ~!PartyHasItem("MISC4Z")
~ THEN REPLY #17083 /* ~I have little taste for it, myself.  Very well.  I will attempt to free you, if I can.~ */ GOTO 4
  IF ~PartyHasItem("MISC4Z")
~ THEN REPLY #17178 /* ~I have little taste for it, myself.  Very well, I will do what I can to free you.~ */ GOTO 38
  IF ~~ THEN REPLY #17084 /* ~I have no argument with Lehtinan.  Why should I free you?~ */ GOTO 36
  IF ~~ THEN REPLY #17085 /* ~I do not think I can help you right now.  You will have to remain where you are.~ */ GOTO 3
  IF ~~ THEN REPLY #17087 /* ~I think I rather like seeing a proud man beg.  I've nothing against keeping slaves, Hendak, so you'll remain in your cage where you belong.~ */ GOTO 7
END

IF ~~ THEN BEGIN 2 // from: 35.0
  SAY #17081 /* ~I have done what I can to aid these other slaves and keep them living through the battles that Lehtinan puts on to amuse his noble fiends.~ */
  IF ~~ THEN GOTO 1
END

IF ~~ THEN BEGIN 3 // from: 1.3 0.2
  SAY #17079 /* ~Wait, wait!  Do not leave us here!  I sense you are a soul that will not let us rot here.  Please, you must certainly have prowess enough to release us!~ */
  IF ~~ THEN REPLY #17089 /* ~I suppose I might be able to help you.  Tell me who you are, first.~ */ GOTO 35
  IF ~~ THEN REPLY #17091 /* ~(sigh)  Flattery, is it?  Tell me what you want and be quick with it.~ */ GOTO 35
  IF ~~ THEN REPLY #17093 /* ~Thank you, but I still have no desire to waste time helping you.~ */ GOTO 37
  IF ~~ THEN REPLY #17096 /* ~I've nothing against slavery.  You'll rot in your cage until somebody decides to release you.~ */ GOTO 7
END

IF ~~ THEN BEGIN 4 // from: 6.0 1.0
  SAY #17098 /* ~I truly hope that you will be able to, friend.  The beastmaster has the key to our cells.  If you get the key from him, we will be able to escape!~ */
  IF ~!IsValidForPartyDialog("Aerie")
!IsValidForPartyDialog("Minsc")~ THEN REPLY #17214 /* ~I'll try, Hendak.  Wait here.~ */ GOTO 9
  IF ~IsValidForPartyDialog("Aerie")~ THEN EXTERN ~AERIEJ~ 43
  IF ~!IsValidForPartyDialog("Aerie")
IsValidForPartyDialog("Minsc")~ THEN EXTERN ~MINSCJ~ 76
END

IF ~~ THEN BEGIN 5 // from: 36.0
  SAY #17099 /* ~If I kill the bastard Lehtinan, I intend to take over the inn to ensure that no one else uses it like this.  I will offer what help I can once that occurs.~ */
  IF ~!IsValidForPartyDialog("Korgan")
!IsValidForPartyDialog("Edwin")
!IsValidForPartyDialog("Anomen")~ THEN GOTO 37
  IF ~IsValidForPartyDialog("Korgan")~ THEN EXTERN ~KORGANJ~ 47
  IF ~!IsValidForPartyDialog("Korgan")
IsValidForPartyDialog("Edwin")~ THEN EXTERN ~EDWINJ~ 36
  IF ~!IsValidForPartyDialog("Korgan")
!IsValidForPartyDialog("Edwin")
IsValidForPartyDialog("Anomen")~ THEN EXTERN ~ANOMENJ~ 164
END

IF ~~ THEN BEGIN 6 // from: 37.0
  SAY #17168 /* ~I, Hendak, plead with you to aid people who have little to give you in return except their eternal gratitude!~ */
  IF ~!PartyHasItem("MISC4Z")
~ THEN REPLY #17218 /* ~Oh, very well.  I will do what I can to aid you, Hendak, and free these slaves from their miserable existence.~ */ GOTO 4
  IF ~PartyHasItem("MISC4Z")
~ THEN REPLY #17227 /* ~Oh, very well.  I will do what I can to assist you, Hendak, and free these slaves from their miserable existence.~ */ GOTO 38
  IF ~~ THEN REPLY #17349 /* ~I'm sorry, Hendak, but I just cannot help you right now.~ */ GOTO 13
  IF ~~ THEN REPLY #17228 /* ~I grow weary of your mewling, Hendak. Hopefully I'll be out of earshot soon.~ */ GOTO 7
END

IF ~~ THEN BEGIN 7 // from: 54.3 53.3 49.2 48.4 11.1 10.2 6.3 3.3 1.4
  SAY #17172 /* ~You... who have so much power... would raise no hand to aid us?  Damn you!  May the abyss swallow your soul for what you do!~ */
  IF ~!IsValidForPartyDialog("Anomen")
!IsValidForPartyDialog("Jaheira")~ THEN DO ~SetGlobal("KnowCellKey","AR0406",0)
~ UNSOLVED_JOURNAL #16553 /* ~Investigate activities in the Copper Coronet's rooms.

I have encountered a slave called Hendak in the Copper Coronet's pen. He asked me to help him escape.  I refused.~ */ EXIT
  IF ~IsValidForPartyDialog("Anomen")~ THEN DO ~SetGlobal("KnowCellKey","AR0406",0)~ UNSOLVED_JOURNAL #16553 /* ~Investigate activities in the Copper Coronet's rooms.

I have encountered a slave called Hendak in the Copper Coronet's pen. He asked me to help him escape.  I refused.~ */ EXTERN ~ANOMENJ~ 162
  IF ~!IsValidForPartyDialog("Anomen")
IsValidForPartyDialog("Jaheira")~ THEN DO ~SetGlobal("KnowCellKey","AR0406",0)~ UNSOLVED_JOURNAL #16553 /* ~Investigate activities in the Copper Coronet's rooms.

I have encountered a slave called Hendak in the Copper Coronet's pen. He asked me to help him escape.  I refused.~ */ EXTERN ~JAHEIRAJ~ 321
END

IF ~~ THEN BEGIN 8 // from: 38.0
  SAY #17207 /* ~Wait!  You already possess the beastmaster's key!  That will unlock the door and free us!  Thank the Gods!~ */
  IF ~~ THEN DO ~SetGlobal("HendakReleased","AR0406",2)
~ EXIT
END

IF ~~ THEN BEGIN 9 // from: 11.0 10.1 4.0
  SAY #17215 /* ~May the Gods aid your task!  Would that I could help, but I shall have to be content with the hope that Lehtinan will feel the cold swiftness of my blade.~ */
  IF ~~ THEN DO ~SetGlobal("KnowCellKey","AR0406",1)
~ UNSOLVED_JOURNAL #34118 /* ~Free Hendak and the slaves.

It appears that the Copper Coronet is keeping slaves to perform its entertainments... I have talked to a slave by the name of Hendak and agreed to free his people.  I will need a key that is currently held by the beastmaster located across the arena.~ */ EXIT
END

IF ~Global("KnowCellKey","AR0406",1)
!PartyHasItem("MISC4Z")
Global("HendakReleased","AR0406",0)
~ THEN BEGIN 10 // from:
  SAY #17323 /* ~Hello to you again, my friend.  I see you have not yet found the key.  Is there a problem?~ */
  IF ~~ THEN REPLY #17326 /* ~I cannot find this beastmaster you spoke of.  Where is he?~ */ GOTO 39
  IF ~~ THEN REPLY #17327 /* ~No, there is no problem.  I will be back.~ */ GOTO 9
  IF ~~ THEN REPLY #17334 /* ~I have decided not to free you.  It is too much trouble.~ */ GOTO 7
  IF ~Global("SlavingJerk","GLOBAL",1)~ THEN REPLY #50062 /* ~This will disappoint you. I told Lehtinan about your escape plan and he has sent me to kill you on his behalf.~ */ GOTO 63
END

IF ~~ THEN BEGIN 11 // from: 39.0
  SAY #17335 /* ~The hallway from our cells leads to the arena, and directly across from the door lies the entryway for the creatures.  You may find the beastmaster there.~ */
  IF ~~ THEN REPLY #17338 /* ~I shall try to find him once more, then.~ */ GOTO 9
  IF ~~ THEN REPLY #17340 /* ~Bah!  This is too much trouble.  I have decided not to help you, Hendak.~ */ GOTO 7
END

IF ~PartyHasItem("MISC4Z")
Global("HendakReleased","AR0406",0)
~ THEN BEGIN 12 // from:
  SAY #17346 /* ~You have the key!  You have it!  Thank the Gods!  And thank you truly, my friend, for what you have done.~ [HENDAK07] */
  IF ~Dead("Lehtinan")
Global("SlavingJerk","GLOBAL",0)
~ THEN DO ~SetGlobal("KnowCellKey","AR0406",1)
AddExperienceParty(7500)~ GOTO 40
  IF ~!Dead("Lehtinan")
Global("SlavingJerk","GLOBAL",0)~ THEN DO ~SetGlobal("KnowCellKey","AR0406",1)
AddExperienceParty(7500)~ GOTO 14
  IF ~Global("SlavingJerk","GLOBAL",1)~ THEN REPLY #60906 /* ~Thank me not, slave, I will kill you for Lehtinan. The reward for the deed is adequate.~ */ DO ~SetGlobal("KnowCellKey","AR0406",1)
AddExperienceParty(7500)~ GOTO 63
  IF ~Global("SlavingJerk","GLOBAL",1)
!Dead("Lehtinan")~ THEN REPLY #60908 /* ~Lehtinan wanted me to kill you, and I agreed, but it was only a ruse to obtain a key. You are free, Hendak, to take your revenge.~ */ DO ~SetGlobal("KnowCellKey","AR0406",1)
AddExperienceParty(7500)~ GOTO 14
  IF ~Global("SlavingJerk","GLOBAL",1)
Dead("Lehtinan")~ THEN REPLY #60909 /* ~Lehtinan wanted me to kill you and I agreed but it was only a ruse to obtain a key. You are free Hendak.~ */ DO ~SetGlobal("KnowCellKey","AR0406",1)
AddExperienceParty(7500)~ GOTO 40
END

IF ~~ THEN BEGIN 13 // from: 54.2 6.2
  SAY #17351 /* ~It is a terrible thing to remain a captive and a slave.  I hope you think on this, my friend.~ */
  IF ~~ THEN EXIT
END

IF ~Global("HendakReleased","AR0406",1)
!Dead("Lehtinan")~ THEN BEGIN 14 // from: 12.3 12.1
  SAY #17354 /* ~We are free, my brothers!  Go, now, and free the women!  Hendak will strike his blade into the heart of our so-called owner, so that he shall never trouble you again!  Go and savor your freedom!~ [HENDAK21] */
  IF ~~ THEN DO ~SetGlobal("HendakReleased","AR0406",2)
~ EXTERN ~GLAD2~ 5
END

IF ~~ THEN BEGIN 15 // from: GLAD2:5.0
  SAY #17359 /* ~Thank you again, my friends.  Now to the task of killing that fiend, Lehtinan.  Assist me if you wish.  Otherwise, stand and watch the vengeance of Hendak be fulfilled!~ [HENDAK22] */
  IF ~~ THEN EXTERN ~NOBLE1~ 9
END

IF ~~ THEN BEGIN 16 // from:
  SAY #17366 /* ~Enough, fiend!  You no longer own me, and I'll ensure that you no longer claim ownership over any other, as well!  I have survived your hellish fighting pit for years... you are no match for me!~ [HENDAK24] */
  IF ~~ THEN EXTERN ~LEHTIN~ 16
END

IF ~Dead("Lehtinan")
Global("HendakReleased","AR0406",2)
Global("HendakMove","AR0406",6)
~ THEN BEGIN 17 // from:
  SAY #17371 /* ~There.  It is finally over, Lehtinan, all the years of cruel and evil acts that you have committed for nothing more than coins in your pocket.  Burn in the abyss, fiend.~ [HENDAK08] */
  IF ~~ THEN DO ~AddExperienceParty(48750)
TakePartyItem("MISC4Z")
Unlock("DOOR08")
Unlock("DOOR10")
SetGlobal("HendakReleased","AR0406",3)
ClearActions(Player1)
ClearActions(Player2)
ClearActions(Player3)
ClearActions(Player4)
ClearActions(Player5)
ClearActions(Player6)~ GOTO 40
END

IF ~~ THEN BEGIN 18 // from: 41.0
  SAY #17431 /* ~They have many children, yet, that they retain as slaves.  I would ask of you to rid the city of this infestation once and for all.~ */
  IF ~!Global("FreeSlaves","GLOBAL",1)~ THEN REPLY #17437 /* ~More slavers in the city?  Very well, we shall do what we can.~ */ GOTO 55
  IF ~!Global("FreeSlaves","GLOBAL",1)~ THEN REPLY #17438 /* ~That is a lot to ask, Hendak.  What might we get in return for such a task?~ */ GOTO 20
  IF ~!Global("FreeSlaves","GLOBAL",1)~ THEN REPLY #17492 /* ~Why not leave that problem to the garrison?~ */ GOTO 42
  IF ~Global("FreeSlaves","GLOBAL",1)~ THEN REPLY #61134 /* ~I've already done this.  The children are free.~ */ GOTO 30
  IF ~!Global("FreeSlaves","GLOBAL",1)~ THEN REPLY #17439 /* ~I cannot help you at the moment, Hendak.  Perhaps another time.~ */ GOTO 22
  IF ~!Global("FreeSlaves","GLOBAL",1)~ THEN REPLY #17440 /* ~I've no interest in such a task.  Find somebody else.~ */ GOTO 23
END

IF ~~ THEN BEGIN 19 // from: 56.0
  SAY #17493 /* ~I know nothing of the defenses of the place inside, however.  My stay there was brief and very long ago.~ */
  IF ~!IsValidForPartyDialog("Minsc")
!IsValidForPartyDialog("Jaheira")
!IsValidForPartyDialog("Yoshimo")~ THEN REPLY #17528 /* ~I shall go to this compound, then, and return as soon as I am able.~ */ GOTO 24
  IF ~IsValidForPartyDialog("Minsc")~ THEN EXTERN ~MINSCJ~ 78
  IF ~!IsValidForPartyDialog("Minsc")
IsValidForPartyDialog("Jaheira")~ THEN EXTERN ~JAHEIRAJ~ 323
  IF ~!IsValidForPartyDialog("Minsc")
!IsValidForPartyDialog("Jaheira")
IsValidForPartyDialog("Yoshimo")~ THEN EXTERN ~YOSHJ~ 33
END

IF ~~ THEN BEGIN 20 // from: 21.0 18.1
  SAY #17494 /* ~I am no wealthy man, my friend, but Lehtinan was.  There are likely items of value within his stores.  It may not be much, but I is all I can offer.~ */
  IF ~~ THEN REPLY #17543 /* ~Hm.  Why not report them and let the garrison handle this, Hendak?~ */ GOTO 42
  IF ~~ THEN REPLY #17544 /* ~Very well, then.  I shall do what I can.~ */ GOTO 55
  IF ~~ THEN REPLY #17546 /* ~I don't think I can help you right now.  Perhaps another time.~ */ GOTO 22
  IF ~~ THEN REPLY #17616 /* ~That's not enough compensation for a harsh task, I think.  Find somebody else.~ */ GOTO 23
END

IF ~~ THEN BEGIN 21 // from: 42.0
  SAY #17497 /* ~Lehtinan waved gold in front of their eyes to blind them, and I am sure the slavers are able to do much the same.~ */
  IF ~~ THEN REPLY #17618 /* ~I suppose you're right.  What kind of reward might I expect from a task of this kind, then?~ */ GOTO 20
  IF ~~ THEN REPLY #17619 /* ~That's true.  Very well, then, I'll not allow such a place to exist while I do.~ */ GOTO 55
  IF ~~ THEN REPLY #17620 /* ~Regardless, I don't think I can help you right now, Hendak.~ */ GOTO 22
  IF ~~ THEN REPLY #17621 /* ~Well, that's too bad because I'm not interested.  Find somebody else to do it.~ */ GOTO 23
END

IF ~~ THEN BEGIN 22 // from: 28.2 21.2 20.2 18.4
  SAY #17498 /* ~Well, it's a sad thing, it is.  But I understand.  If you change your mind, my friend, let me know.~ */
  IF ~~ THEN REPLY #17622 /* ~Alright... I've changed my mind.  I'll find these slavers and free those they hold captive.~ */ GOTO 55
  IF ~~ THEN REPLY #17623 /* ~I'll be on my way, then.~ */ GOTO 24
END

IF ~~ THEN BEGIN 23 // from: 28.3 21.3 20.3 18.5
  SAY #17516 /* ~I do not think anyone else can perform this task.  Ah, I suppose you have your reasons.  Come and speak to me if you change your mind.~ */
  IF ~~ THEN REPLY #17625 /* ~Well... alright.  I've changed my mind.  I'll find these slavers and free the people they hold captive.~ */ GOTO 55
  IF ~~ THEN REPLY #17626 /* ~Very well, I will be on my way then.~ */ GOTO 24
END

IF ~~ THEN BEGIN 24 // from: 26.3 23.1 22.1 19.0
  SAY #17533 /* ~Good fortune to you, my friend.~ */
  IF ~~ THEN UNSOLVED_JOURNAL #34119 /* ~Free Hendak and the slaves.

I have freed the slaves of the Copper Coronet... only to find that there are yet more slaves being held in a dry-docked ship on the east side of the slums.  Hendak mentioned there was a tunnel in the sewers that leads from the inn to the ship, but he didn't know exactly where it was.~ */ EXIT
END

IF ~~ THEN BEGIN 25 // from: 33.0 28.1 26.1
  SAY #17624 /* ~It's not as much as the fiend had, but it's plenty, and it's at a significant discount for you.  Just speak to Bernard... I still have him handling the store.~ */
  IF ~~ THEN EXIT
END

IF ~Global("FreeSlaves","GLOBAL",0)
Global("HendakReleased","AR0406",3)
~ THEN BEGIN 26 // from:
  SAY #17627 /* ~Ah.  Good to see you again, of course, my friend.  How may Hendak be of assistance?~ */
  IF ~~ THEN REPLY #17628 /* ~I was wondering if you could tell me again about the slave compound you mentioned.~ */ GOTO 27
  IF ~~ THEN REPLY #17629 /* ~I'm just looking to take advantage of your services, please.~ */ GOTO 25
  IF ~Global("HendaktoldImoen","LOCALS",0)~ THEN REPLY #42660 /* ~A question for you... I'm looking for a friend of mine who has been captured by the Cowled Wizards.  Do you know anything about them?~ */ DO ~SetGlobal("HendaktoldImoen","LOCALS",1)~ GOTO 59
  IF ~~ THEN REPLY #17630 /* ~Never mind, I'll be going.~ */ GOTO 24
END

IF ~~ THEN BEGIN 27 // from: 26.0
  SAY #17631 /* ~Well, as I said, the slavers remain at large within Athkatla, hidden at their base here in the slums. They have many children that are still enslaved.~ */
  IF ~~ THEN GOTO 57
END

IF ~~ THEN BEGIN 28 // from: 58.0
  SAY #17636 /* ~I know nothing of the defenses of the compound inside, however.  My stay there was brief and very long ago.~ */
  IF ~~ THEN REPLY #17637 /* ~Very well, I will go to this compound and see if I cannot rid this city of its slavers once and for all.~ */ GOTO 29
  IF ~~ THEN REPLY #17638 /* ~I see.  Well I shall have to think on this.  Can I see your services in the meantime?~ */ GOTO 25
  IF ~~ THEN REPLY #17639 /* ~I shall have to think on this.  Farewell.~ */ GOTO 22
  IF ~~ THEN REPLY #17669 /* ~Hmm.  Still not interested, I think.  Find somebody else.~ */ GOTO 23
END

IF ~~ THEN BEGIN 29 // from: 28.0
  SAY #17670 /* ~I knew you would not let me down.  Come back and speak to me when you have completed the deed.~ */
  IF ~~ THEN EXIT
END

IF ~Global("FreeSlaves","GLOBAL",1)
Global("HendakReleased","AR0406",3)
~ THEN BEGIN 30 // from: 18.3
  SAY #17671 /* ~You have completed the task, I see.  I can't tell you how overjoyed I am that so many children were rescued, and that nobody will face slavery here again.~ */
  IF ~~ THEN DO ~EraseJournalEntry(15705)
EraseJournalEntry(16553)
EraseJournalEntry(34114)
EraseJournalEntry(34118)
EraseJournalEntry(34119)
SetGlobal("HendakReleased","AR0406",4)
ReputationInc(1)
AddXPObject(Player1,38000)
AddXPObject(Player2,38000)
AddXPObject(Player3,38000)
AddXPObject(Player4,38000)
AddXPObject(Player5,38000)
AddXPObject(Player6,38000)
~ SOLVED_JOURNAL #47532 /* ~Free Hendak and the slaves.

I have dealt a blow to the slave trade in Athkatla, freeing both Hendak and the other gladiators from their prison in the Copper Coronet, as well as the slave children in the slaver compound in the slums. No more gladiators will be purchased for the Copper Coronet now that Lehtinan is dead and Hendak is in charge.~ */ GOTO 31
END

IF ~~ THEN BEGIN 31 // from: 30.0
  SAY #17672 /* ~(sigh) At least for a while. I am not naive enough to think that the slavers will not return.  I shall watch for them, however, and fight them if I can.~ */
  IF ~~ THEN GOTO 43
END

IF ~~ THEN BEGIN 32 // from: 43.0
  SAY #17673 /* ~I have collected some of Lehtinan's more valuable items here for you... I hope this is at least some small reward for the good you have done.~ */
  IF ~~ THEN DO ~TakePartyItem("misc4r")
DestroyItem("misc4r")
GiveGoldForce(3900)
GiveItemCreate("PLAT01",LastTalkedToBy,0,0,0)
GiveItemCreate("SW1H03",LastTalkedToBy,0,0,0)~ EXIT
END

IF ~Global("FreeSlaves","GLOBAL",1)
Global("HendakReleased","AR0406",4)
~ THEN BEGIN 33 // from:
  SAY #17674 /* ~A good day to you, <CHARNAME>!  Hendak welcomes you to his inn as the champion and hero that you are.  Is there something that I may do for you?~ */
  IF ~~ THEN REPLY #17675 /* ~I simply wish to see what you have in stock, Hendak.~ */ GOTO 25
  IF ~False()
GlobalLT("chapter","GLOBAL",4)
Global("HendaktoldImoen","LOCALS",0)
~ THEN REPLY #42665 /* ~A question for you... I'm looking for a friend of mine who has been captured by the Cowled Wizards.  Do you know anything about them?~ */ DO ~SetGlobal("HendaktoldImoen","LOCALS",1)~ GOTO 59
  IF ~~ THEN REPLY #17676 /* ~I do not think so, Hendak.  Farewell.~ */ GOTO 34
END

IF ~~ THEN BEGIN 34 // from: 33.2
  SAY #17677 /* ~Until the next time you grace our presence, my <LADYLORD>.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 35 // from: 3.1 3.0 0.1 0.0
  SAY #14679 /* ~I am Hendak, a proud warrior from the North until my capture by slavers.  I have been imprisoned longer than any of these men and survived, though only barely.~ */
  IF ~!IsValidForPartyDialog("Korgan")~ THEN DO ~SetGlobal("TalkedToHendak","AR0406",1)
~ GOTO 2
  IF ~IsValidForPartyDialog("Korgan")~ THEN DO ~SetGlobal("TalkedToHendak","AR0406",1)~ EXTERN ~KORGANJ~ 46
END

IF ~~ THEN BEGIN 36 // from: 1.2
  SAY #14680 /* ~I can truly offer you little in return for my freedom...~ */
  IF ~~ THEN GOTO 5
END

IF ~~ THEN BEGIN 37 // from: 5.0 3.2 HAERDAJ:61.0 EDWINJ:36.0
  SAY #14681 /* ~Please, by all that is holy, what Lehtinan is doing is wrong!  He forces the women into servitude and throws men to gruesome deaths merely to make his profit!~ */
  IF ~!IsValidForPartyDialog("Minsc")
!IsValidForPartyDialog("Nalia")~ THEN GOTO 6
  IF ~IsValidForPartyDialog("Minsc")~ THEN EXTERN ~MINSCJ~ 77
  IF ~!IsValidForPartyDialog("Minsc")
IsValidForPartyDialog("Nalia")~ THEN EXTERN ~NALIAJ~ 146
END

IF ~~ THEN BEGIN 38 // from: 54.0 53.0 48.0 6.1 1.1
  SAY #14682 /* ~I hope you will be able to, my friend.  You will but need the key... which...~ */
  IF ~~ THEN DO ~SetGlobal("KnowCellKey","AR0406",1)
~ GOTO 8
END

IF ~~ THEN BEGIN 39 // from: 10.0
  SAY #14684 /* ~The beastmaster stays with the creatures that he trains.~ */
  IF ~~ THEN GOTO 11
END

IF ~Dead("Lehtinan")
Global("HendakReleased","AR0406",1)
~ THEN BEGIN 40 // from: 17.0 12.4 12.0
  SAY #14686 /* ~I owe you my thanks once again.  As do all those you have freed.  I intend to take this place as payment for my slavery, to ensure it is never used as such again.~ [HENDAK23] */
  IF ~~ THEN DO ~SetGlobal("HendakReleased","AR0406",3)
~ GOTO 41
END

IF ~~ THEN BEGIN 41 // from: 40.0
  SAY #14688 /* ~I wish I did not have to ask, but there is one more task that needs doing.  The slavers remain at large within Athkatla, hidden at their base here in the slums.~ */
  IF ~~ THEN GOTO 18
END

IF ~~ THEN BEGIN 42 // from: 20.0 18.2
  SAY #14689 /* ~The garrison?  The garrison is no more capable of shutting down the slavers than they were capable of shutting down this bar.~ */
  IF ~~ THEN GOTO 21
END

IF ~~ THEN BEGIN 43 // from: 31.0
  SAY #14694 /* ~You have done more than was required of you, and for that you have Hendak's most humble thanks.~ */
  IF ~~ THEN GOTO 32
END

IF ~Dead("Guard3")
Dead("Lehtinan")
~ THEN BEGIN 44 // from:
  SAY #25229 /* ~A moment, friend!  You are obviously not aligned with our captors!  Might I know your name?~ */
  IF ~~ THEN REPLY #25230 /* ~My name is <CHARNAME>, and I am certainly not aligned with these men.  Who are you?~ */ GOTO 45
  IF ~~ THEN REPLY #25231 /* ~My name is my own business.  What is it that you wish?~ */ GOTO 45
  IF ~~ THEN REPLY #25232 /* ~I've no time to waste speaking with you.~ */ GOTO 49
END

IF ~~ THEN BEGIN 45 // from: 49.0 44.1 44.0
  SAY #25233 /* ~I am Hendak, once a warrior from the North until my capture.  I was sold to Lehtinan many years ago to serve as one of the fighters here in these pits.~ */
  IF ~~ THEN GOTO 46
END

IF ~~ THEN BEGIN 46 // from: 45.0
  SAY #25234 /* ~I have done what I can to keep myself and the other fighters alive, with the thought that one day I would take my vengeance upon that demon, Lehtinan.~ */
  IF ~~ THEN GOTO 47
END

IF ~~ THEN BEGIN 47 // from: 46.0
  SAY #25235 /* ~You have worked my vengeance for me, and for that I thank you.  I would ask that you free us, and allow me to take this place, this inn of Lehtinan's.~ */
  IF ~~ THEN GOTO 48
END

IF ~~ THEN BEGIN 48 // from: 47.0
  SAY #25236 /* ~I would see it be made a proper inn, and ensure that it never return to the hands of slavers. Please... I, who have never begged before, I beg this of you now...~ */
  IF ~PartyHasItem("MISC4Z")
~ THEN REPLY #25238 /* ~I'm willing to help you, Hendak.  How do I free you and the other slaves?~ */ GOTO 38
  IF ~!PartyHasItem("MISC4Z")
~ THEN REPLY #25239 /* ~I'm willing to help you, Hendak.  How do I free you and the other slaves?~ */ GOTO 50
  IF ~~ THEN REPLY #25240 /* ~It seems like a lot of trouble.  Why should I free you?~ */ GOTO 52
  IF ~~ THEN REPLY #25241 /* ~I do not think I can help you right now.  You will have to remain where you are.~ */ GOTO 49
  IF ~~ THEN REPLY #25242 /* ~I think I rather like seeing a proud man beg.  I've nothing against keeping slaves, Hendak, so you'll remain in your cage where you belong.~ */ GOTO 7
END

IF ~~ THEN BEGIN 49 // from: 48.3 44.2
  SAY #25237 /* ~Wait!  Don't leave us!  I sense you have a soul that will not let us rot here, and I know you have prowess enough to release us!~ */
  IF ~~ THEN REPLY #25243 /* ~I suppose I might be able to help you.  Tell me who you are, first.~ */ GOTO 45
  IF ~~ THEN REPLY #25244 /* ~Thank you, but I still have no desire to waste time helping you.~ */ GOTO 54
  IF ~~ THEN REPLY #25245 /* ~I've nothing against slavery.  You'll rot in your cage until somebody decides to release you.~ */ GOTO 7
END

IF ~~ THEN BEGIN 50 // from: 54.1 53.1 48.1
  SAY #15390 /* ~I truly hope you will be able to. The beastmaster has the key to our cells... he stays in the pit, in an area across from this hall. With the key, we can escape!~ */
  IF ~~ THEN REPLY #16949 /* ~I'll try, Hendak.  Wait here.~ */ GOTO 51
END

IF ~~ THEN BEGIN 51 // from: 50.0
  SAY #16951 /* ~Would that I could help you... may the Gods grant you speed and strength to aid your task!~ */
  IF ~~ THEN DO ~SetGlobal("KnowCellKey","AR0406",1)
~ EXIT
END

IF ~~ THEN BEGIN 52 // from: 48.2
  SAY #16954 /* ~These people are being kept here against their will... forced to fight daily.  Would you leave us here to die, knowing you could have done something?~ */
  IF ~~ THEN GOTO 53
END

IF ~~ THEN BEGIN 53 // from: 52.0
  SAY #16955 /* ~I myself have nothing to offer but gratitude, but when I take this inn, my gratitude may be worth more to you.  I ask you again, then... will you free us?~ */
  IF ~PartyHasItem("MISC4Z")
~ THEN REPLY #25246 /* ~Very well, I will do what I can.~ */ GOTO 38
  IF ~!PartyHasItem("MISC4Z")
~ THEN REPLY #25247 /* ~Very well, I will do what I can.~ */ GOTO 50
  IF ~~ THEN REPLY #25248 /* ~Sorry, I don't have the time to help you.~ */ GOTO 54
  IF ~~ THEN REPLY #25249 /* ~Forget it.  Nothing in my conscience dictates releasing you.~ */ GOTO 7
END

IF ~Dead("Lehtinan")
Global("KnowCellKey","AR0406",0)
~ THEN BEGIN 54 // from: 53.2 49.1
  SAY #25252 /* ~I, Hendak, plead with you to aid people who have little to give you in return except their eternal gratitude!~ */
  IF ~PartyHasItem("MISC4Z")
~ THEN REPLY #25253 /* ~(sigh)  Very well... I will do what I can.~ */ GOTO 38
  IF ~!PartyHasItem("MISC4Z")
~ THEN REPLY #25254 /* ~(sigh)  Very well... I will do what I can.~ */ GOTO 50
  IF ~~ THEN REPLY #25255 /* ~Perhaps later... I must go now.~ */ GOTO 13
  IF ~~ THEN REPLY #25256 /* ~Forget it.  Free yourselves.~ */ GOTO 7
END

IF ~~ THEN BEGIN 55 // from: 23.0 22.0 21.1 20.1 18.0
  SAY #34047 /* ~I knew you would not let me down.  The compound is not far from here... a dry-docked boat just across the way on the east side of the slums.~ */
  IF ~~ THEN GOTO 56
END

IF ~~ THEN BEGIN 56 // from: 55.0
  SAY #34048 /* ~It may be risky to approach openly. There was talk of a secret passage to the sewer connecting the Coronet to the slaver base, but I do not know where it might be.~ */
  IF ~~ THEN GOTO 19
END

IF ~~ THEN BEGIN 57 // from: 27.0
  SAY #34049 /* ~The compound is not far from here... a dry-docked boat just across the way to the east side of the slums.~ */
  IF ~~ THEN GOTO 58
END

IF ~~ THEN BEGIN 58 // from: 57.0
  SAY #34050 /* ~It may be risky to approach openly. There was talk of a secret passage to the sewer connecting the Coronet to the slaver base, but I do not know where it might be.~ */
  IF ~~ THEN GOTO 28
END

IF ~~ THEN BEGIN 59 // from: 33.1 26.2
  SAY #42662 /* ~Hmm, I am not a local here, but even I have heard of the Cowled Wizards.  This amounts to little beyond what many know, however.~ */
  IF ~~ THEN GOTO 60
END

IF ~~ THEN BEGIN 60 // from: 59.0
  SAY #42663 /* ~They are powerful and secretive, and they are the only group permitted to use magic openly, because they police it in the city.~ */
  IF ~~ THEN GOTO 61
END

IF ~~ THEN BEGIN 61 // from: 60.0
  SAY #42664 /* ~If your friend is their captive, I can only offer condolences.  Maybe another powerful group, like the Shadow Thieves or the churches, could tell you more.~ */
  IF ~~ THEN GOTO 62
END

IF ~~ THEN BEGIN 62 // from: 61.0
  SAY #42666 /* ~I shall keep an ear out for you, though, and let you know if any information turns up.  You never know what a bartender might hear, yes?~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 63 // from: 12.2 10.3
  SAY #50058 /* ~By the gods! I have never heard of such an evil thing! Surely you and Lehtinan deserve each other's company. You shall find that I don't fall easily!~ */
  IF ~~ THEN DO ~Enemy()~ EXIT
END

IF ~~ THEN BEGIN 64 // from:
  SAY #60903 /* ~~ */
  IF ~~ THEN EXIT
END
