BEGIN ~TCSLAVE1~

IF ~NumberOfTimesTalkedTo(0)~ THEN BEGIN 0
  SAY ~Wha-- what do you want?~
  IF ~~ THEN REPLY ~Easy there old man.  We aren't going to hurt you.~ GOTO 1
END

IF ~~ THEN BEGIN 1
  SAY ~Hurt me?  Ha, I have been their play toy for so long you won't know how to hurt me.~
  IF ~~ THEN GOTO 2
END

IF ~~ THEN BEGIN 2
  SAY ~You came from the sacrifice room.  How did you do that?~
  IF ~~ THEN REPLY ~Do what?~ GOTO 3
END

IF ~~ THEN BEGIN 3
  SAY ~How did you get in there?  I didn't see you walk by earlier.~
  IF ~~ THEN REPLY ~I came in that way.  There is a secret entrance.~ GOTO 4
END

IF ~~ THEN BEGIN 4
  SAY ~Bloody hell!  My party came in through the main doors and we were attacked immediately.  We didn't even know the sahuagin were here.~
  IF ~~ THEN REPLY ~Your party?  Where is everyone else?~ GOTO 5
END

IF ~~ THEN BEGIN 5
  SAY ~Dead ya fool!  Two died in the attack.  Three of us survived but we have been prisoners ever since.  Now, I am the last one alive.~
  IF ~~ THEN REPLY ~What can you tell me of this place?  I need to find a prism.~ GOTO 6
END

IF ~~ THEN BEGIN 6
  SAY ~Second floor.  Or maybe it is the third?  I can't remember.  Scotty can tell you.  He's the one down there working on it.  I only saw it once.

Ya got any food?  Ah, who cares now?  I'm dying anyway.~
  IF ~~ THEN REPLY ~We could heal you.~ GOTO 7
  IF ~~ THEN REPLY ~We could heal you, for a price.~ GOTO 8
END

IF ~~ THEN BEGIN 7
  SAY ~Don't bother.  Watch out for the wizard.  He turned them all--~
  IF ~Detect("TCALTHON") !StateCheck("TCALTHON",CD_STATE_NOTVALID)~ THEN REPLY ~Turned what?  Who?  Old man!  Damn, he's dead.~ EXTERN ~TCALTHOJ~ BadEnd
  IF ~OR(2) !Detect("TCALTHON") StateCheck("TCALTHON",CD_STATE_NOTVALID) Detect("TCCATH") !StateCheck("TCCATH",CD_STATE_NOTVALID)~ THEN REPLY ~Turned what?  Who?  Old man!  Damn, he's dead.~ EXTERN ~TCCATHJ~ CathElmo
  IF ~OR(2) !Detect("TCALTHON") StateCheck("TCALTHON",CD_STATE_NOTVALID) OR(2) !Detect("TCCATH") StateCheck("TCCATH",CD_STATE_NOTVALID) Detect("TCALEIGHA") !StateCheck("TCALEIGHA",CD_STATE_NOTVALID)~ THEN REPLY ~Turned what?  Who?  Old man!  Damn, he's dead.~ EXTERN ~TCALEIGJ~ AleighaElmo
  IF ~OR(2) !Detect("TCALTHON") StateCheck("TCALTHON",CD_STATE_NOTVALID) OR(2) !Detect("TCCATH") StateCheck("TCCATH",CD_STATE_NOTVALID) OR(2) !Detect("TCALEIGHA") StateCheck("TCALEIGHA",CD_STATE_NOTVALID) Detect("TCCANDE") !StateCheck("TCCANDE",CD_STATE_NOTVALID)~ THEN REPLY ~Turned what?  Who?  Old man!  Damn, he's dead.~ EXTERN ~TCCANJ~ CandellaElmo
  IF ~OR(2) !Detect("TCALTHON") StateCheck("TCALTHON",CD_STATE_NOTVALID) OR(2) !Detect("TCCATH") StateCheck("TCCATH",CD_STATE_NOTVALID) OR(2) !Detect("TCALEIGHA") StateCheck("TCALEIGHA",CD_STATE_NOTVALID) OR(2) !Detect("TCCANDE") StateCheck("TCCANDE",CD_STATE_NOTVALID)~ THEN REPLY ~Turned what?  Who?  Old man!  Damn, he's dead.~ DO ~DropInventory() DestroySelf()~ EXIT
END

IF ~~ THEN BEGIN 8
  SAY ~That's real kind of you.  I'd spit but I don't have the energy.  Leave me be.~
  IF ~~ THEN DO ~DropInventory() DestroySelf()~ EXIT
END

IF ~Global("TCMyStatus","LOCALS",1)~ THEN BEGIN YouTried2Help
  SAY ~Thank you for trying but as you can see, my wounds are beyond healing.~
  IF ~~ THEN DO ~DropInventory() DestroySelf()~ EXIT
END

IF ~Global("TCMyStatus","LOCALS",2)~ THEN BEGIN YouTried2Help1
  SAY ~Oooh, I can feel it working!  Yes!~
  IF ~~ THEN DO ~Polymorph(PEASANT_MAN) SetGlobal("TCMyStatus","LOCALS",3)~ EXIT
END

IF ~Global("TCMyStatus","LOCALS",3)~ THEN BEGIN ElmoIntro
  SAY ~My name is Elmo and I am a mage from Ordulin.  I was the leader of our adventuring group.~
  IF ~~ THEN REPLY ~Greetings, Elmo.  What can you tell me of your group?~ DO ~SetGlobal("TCMyStatus","LOCALS",4)~ GOTO ElmoIntro1
  IF ~~ THEN REPLY ~Greetings, Elmo.  What happened to your group?~ DO ~SetGlobal("TCMyStatus","LOCALS",4)~ GOTO ElmoIntro1
END

IF ~~ THEN BEGIN ElmoIntro1
  SAY ~Well, there were five of us.  My friend, Mirnar, who was a warrior from the Ten Towns, Rintyriar, an elven battlemage, Brellaurra, a Priestess of Azuth, and Norvar Shieldsplitter, a very skilled dwarven warrior.  I was their leader and they followed me foolishly to their deaths.  We walked right into a frontal assault.  Two died immediately, the rest of us were tortured for days.~
  IF ~~ THEN REPLY ~How did you survive?~ GOTO ElmoIntro2
  IF ~~ THEN REPLY ~It sounds like a tough battle.  You are lucky to be alive.~ GOTO ElmoIntro2
END

IF ~~ THEN BEGIN ElmoIntro2
  SAY ~They knew I was a mage from my robes.  So they kept me alive to identify items for them.~
  IF ~~ THEN REPLY ~Do you want to join us?  We can always use wizards.~ GOTO ElmoIntro3a
  IF ~~ THEN REPLY ~What are your plans now?~ GOTO ElmoIntro3b
END

IF ~~ THEN BEGIN ElmoIntro3a
  SAY ~Join?  No thanks.  I have really lost the desire to ever adventure again.  Losing my friends and being imprisoned has really changed my outlook.  We were really well equipped and yet we got slaughtered.  I'm grateful to be alive thanks to you.  Can you escort me to an exit out of here?~
  IF ~~ THEN REPLY ~Sure.  The way we came in is safe.~ EXIT
  IF ~~ THEN REPLY ~The main entrance isn't secure yet.  Let's go out the way we came in.~ EXIT
END

IF ~~ THEN BEGIN ElmoIntro3b
  SAY ~Plans?  I really don't know...  I never thought I'd get out of this place.  I guess I'll head over to Mistmoor for now to rest.  I'm grateful to be alive thanks to you.  Can you escort me to an exit out of here?~
  IF ~~ THEN REPLY ~Sure.  The way we came in is safe.~ EXIT
  IF ~~ THEN REPLY ~The main entrance isn't secure yet.  Let's go out the way we came in.~ EXIT
END

IF ~Global("TCMyStatus","LOCALS",5)~ THEN BEGIN ThankUCandella
  SAY ~Thank you, <CHARNAME> and thank you Lady Candella.  I will tell everyone of your kindness.~
  IF ~~ THEN DO ~SetGlobal("TCMyStatus","LOCALS",6) ReputationInc(1) AddexperienceParty(500) EscapeAreaDestroy(15)~ JOURNAL ~We saved the life of Elmo the Mage.  He was a prisoner of the sahuagins.  Hopefully he will have a quieter life now.~ EXIT
END


APPEND ~TCALEIGJ~

IF ~~ THEN BEGIN AleighaElmo
  SAY ~<CHARNAME>, can we make sure this man is buried?  Lliira will not be pleased if we leave his body to rot here.  He has suffered enough, please do not allow his soul to suffer eternal torment.~
  IF ~~ THEN REPLY ~Alright, we will carry him back to Saltmarsh.~ DO ~ActionOverride("TCSLAVE1",DropInventory()) ActionOverride("TCSLAVE1",DestroySelf())~ EXIT
  IF ~Detect("TCCANDE") !StateCheck("TCCANDE",CD_STATE_NOTVALID)~ THEN REPLY ~I'm sorry Aleigha, but it's too hard to carry him back that far.~ EXTERN ~TCCANJ~ CandellaElmo
  IF ~OR(2) !Detect("TCCANDE") StateCheck("TCCANDE",CD_STATE_NOTVALID)~ THEN REPLY ~I'm sorry Aleigha, but it's too hard to carry him back that far.~ DO ~ActionOverride("TCSLAVE1",DropInventory()) ActionOverride("TCSLAVE1",DestroySelf())~ EXIT
END
END

APPEND ~TCALTHOJ~

IF ~~ THEN BEGIN BadEnd
  SAY ~The sahuagin beasts have tortured this man down to nothing but rags on bones.  A fate I have no intentions of following.  Let's go.~
  IF ~Detect("TCCATH") !StateCheck("TCCATH",CD_STATE_NOTVALID)~ THEN EXTERN ~TCCATHJ~ CathElmo
  IF ~Detect("TCALEIGHA") !StateCheck("TCALEIGHA",CD_STATE_NOTVALID)~ THEN EXTERN ~TCALEIGJ~ AleighaElmo
  IF ~Detect("TCCANDE") !StateCheck("TCCANDE",CD_STATE_NOTVALID)~ THEN EXTERN ~TCCANJ~ CandellaElmo
  IF ~OR(2) !Detect("TCCATH") StateCheck("TCCATH",CD_STATE_NOTVALID) OR(2) !Detect("TCALEIGHA") StateCheck("TCALEIGHA",CD_STATE_NOTVALID) OR(2) !Detect("TCCANDE") StateCheck("TCCANDE",CD_STATE_NOTVALID)~ THEN DO ~ActionOverride("TCSLAVE1",DropInventory()) ActionOverride("TCSLAVE1",DestroySelf())~ EXIT
END

IF ~~ THEN BEGIN IsThatWise
  SAY ~<CHARNAME>, is it wise to waste our precious resources?  Especially when this poor soul wishes to join his friends in the afterlife?~
  IF ~~ THEN EXTERN ~TCCANJ~ Bastards
END
END

APPEND ~TCBLUSHJ~

IF ~~ THEN BEGIN BlushHelp
  SAY ~Very well, I will see what I can do.~
  IF ~~ THEN EXTERN ~TCCANJ~ CElmoSave1
END

IF ~~ THEN BEGIN BElmoStatus
  SAY ~<CHARNAME>, he has a lot of poison coursing through his veins.  I need to neutralize the poison and heal him.~
  IF ~Detect("TCALTHON") !StateCheck("TCALTHON",CD_STATE_NOTVALID)~ EXTERN ~TCALTHOJ~ IsThatWise
  IF ~OR(2) !Detect("TCALTHON") StateCheck("TCALTHON",CD_STATE_NOTVALID)~ THEN REPLY ~See if you can help him, Blush.~ GOTO BElmoTry
  IF ~OR(2) !Detect("TCALTHON") StateCheck("TCALTHON",CD_STATE_NOTVALID)~ THEN REPLY ~That's not good.  We can't afford the resources.~ EXTERN ~TCCANJ~ CandellaCruelParty
END

IF ~~ THEN BEGIN BElmoTry
  SAY ~I'll do what I can.~
  IF ~HaveSpell(CLERIC_NEUTRALIZE_POISON) !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS)~ THEN DO ~Spell("TCSLAVE1",CLERIC_NEUTRALIZE_POISON) SetGlobal("TCElmoHelped","TC0081",10)~ EXIT
  IF ~HaveSpell(CLERIC_SLOW_POISON) !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS)~ THEN DO ~Spell("TCSLAVE1",CLERIC_SLOW_POISON) SetGlobal("TCElmoHelped","TC0081",15)~ EXIT
  IF ~HaveSpell(CLERIC_NEUTRALIZE_POISON) HaveSpell(CLERIC_CURE_LIGHT_WOUNDS)~ THEN DO ~Spell("TCSLAVE1",CLERIC_NEUTRALIZE_POISON) Spell("TCSLAVE1",CLERIC_CURE_LIGHT_WOUNDS) SetGlobal("TCElmoHelped","TC0081",20)~ EXIT
  IF ~HaveSpell(CLERIC_SLOW_POISON) HaveSpell(CLERIC_CURE_LIGHT_WOUNDS)~ THEN DO ~Spell("TCSLAVE1",CLERIC_SLOW_POISON) Spell("TCSLAVE1",CLERIC_CURE_LIGHT_WOUNDS) SetGlobal("TCElmoHelped","TC0081",25)~ EXIT
  IF ~!HaveSpell(CLERIC_NEUTRALIZE_POISON) !HaveSpell(CLERIC_SLOW_POISON) HaveSpell(CLERIC_CURE_LIGHT_WOUNDS)~ DO ~SetGlobal("TCElmoHelped","TC0081",5)~ GOTO BElmoTryFailed
  IF ~!HaveSpell(CLERIC_NEUTRALIZE_POISON) !HaveSpell(CLERIC_SLOW_POISON) !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS)~ DO ~SetGlobal("TCElmoHelped","TC0081",5)~ GOTO BElmoTryFailed
END

IF ~~ THEN BEGIN BElmoTryFailed
  SAY ~*After a momment or two, Blush opens her eyes and looks at the dying man.*  I am so sorry dear.  I don't have the spells you will need to heal you.  May Sune smile upon your soul.~
  IF ~~ THEN EXTERN ~TCSLAVE1~ YouTried2Help
END
END

APPEND ~TCCANJ~

IF ~~ THEN BEGIN CandellaElmo
  SAY ~We have to do something to save him!~
  IF ~Detect("TCBLUSH") !StateCheck("TCBLUSH",CD_STATE_NOTVALID)~ THEN GOTO SaveElmoBlush
  IF ~Detect("TCRURIK") !StateCheck("TCRURIK",CD_STATE_NOTVALID)~ THEN GOTO SaveElmoRurik
  IF ~OR(2) !Detect("TCBLUSH") StateCheck("TCBLUSH",CD_STATE_NOTVALID) OR(2) !Detect("TCRURIK") StateCheck("TCRURIK",CD_STATE_NOTVALID)~ THEN REPLY ~There isn't anything we can do for him.~ GOTO CSaveElmo
END

IF ~~ THEN BEGIN SaveElmoBlush
  SAY ~Save him, Blush!  Don't let him die!~
  IF ~~ THEN EXTERN ~TCBLUSHJ~ BlushHelp
END

IF ~~ THEN BEGIN CElmoSave1
  SAY ~Quick!  What needs to be done?~
  IF ~~ THEN EXTERN ~TCBLUSHJ~ BElmoStatus
END

IF ~~ THEN BEGIN SaveElmoRurik
  SAY ~You have to save him, Rurik!  I know you can help!~
  IF ~~ THEN EXTERN ~TCRURIKJ~ RurikHelp
END

IF ~~ THEN BEGIN CElmoSave2
  SAY ~*Sniff*  Thank you, Rurik.~
  IF ~~ THEN EXTERN ~TCRURIKJ~ RElmoStatus
END

IF ~~ THEN BEGIN CSaveElmo
  SAY ~We can't leave him here.  Can you carry him back to Saltmarsh?~
  IF ~~ THEN REPLY ~Sure, we could try that.~ EXIT
  IF ~~ THEN REPLY ~Not me.  We have more important things to do right now.~ GOTO CandellaCruelParty
END

IF ~~ THEN BEGIN Bastards
  SAY ~Have you no mercy?  He has lost all hope and suffered so much.~
  IF ~~ THEN REPLY ~Althon is right.  He wishes peace.  We shouldn't use our resources to save someone who is already dead.~ GOTO CandellaCruelParty
  IF ~Detect("TCBLUSH") !StateCheck("TCBLUSH",CD_STATE_NOTVALID)~ THEN REPLY ~See if you can help him, Blush.~ EXTERN ~TCBLUSHJ~ BElmoTry
  IF ~Detect("TCRURIK") !StateCheck("TCRURIK",CD_STATE_NOTVALID)~ THEN REPLY ~See if you can help him, Rurik.~ EXTERN ~TCRURIKJ~ RElmoTry
  IF ~~ THEN REPLY ~Let's see if we can save him.~ EXIT
END

IF ~~ THEN BEGIN CandellaCruelParty
  SAY ~How cold are your hearts?  You didn't spare any effort to try to save a poor man's life!~
  IF ~~ THEN DO ~ActionOverride("TCSLAVE1",DropInventory()) ActionOverride("TCSLAVE1",DestroySelf())~ EXIT
END
END

APPEND ~TCCATHJ~

IF ~~ THEN BEGIN CathElmo
  SAY ~The fool let his friends die.  Don't expect me to bring the body back to my temple to have him raised.  His mind was as shattered as his helpless form.  Shar's wish was for him not to be spared.~
  IF ~Detect("TCCANDE") !StateCheck("TCCANDE",CD_STATE_NOTVALID)~ THEN EXTERN ~TCCANJ~ CandellaElmo
  IF ~Detect("TCALEIGHA") !StateCheck("TCALEIGHA",CD_STATE_NOTVALID)~ THEN EXTERN ~TCALEIGJ~ AleighaElmo
  IF ~OR(2) !Detect("TCCANDE") StateCheck("TCCANDE",CD_STATE_NOTVALID) OR(2) !Detect("TCALEIGHA") StateCheck("TCALEIGHA",CD_STATE_NOTVALID)~ THEN DO ~ActionOverride("TCSLAVE1",DropInventory()) ActionOverride("TCSLAVE1",DestroySelf())~ EXIT
END
END

APPEND ~TCRURIKJ~

IF ~~ THEN BEGIN RurikHelp
  SAY ~Stop your damn crying and let me see what I can do.~
  IF ~~ THEN EXTERN ~TCCANJ~ CElmoSave2
END

IF ~~ THEN BEGIN RElmoStatus
  SAY ~<CHARNAME>, he has a lot of poison coursing through his veins.  I need to neutralize the poison and heal him.~
  IF ~Detect("TCALTHON") !StateCheck("TCALTHON",CD_STATE_NOTVALID)~ EXTERN ~TCALTHOJ~ IsThatWise
  IF ~OR(2) !Detect("TCALTHON") StateCheck("TCALTHON",CD_STATE_NOTVALID)~ THEN REPLY ~See if you can help him, Rurik.~ GOTO RElmoTry
  IF ~OR(2) !Detect("TCALTHON") StateCheck("TCALTHON",CD_STATE_NOTVALID)~ THEN REPLY ~That's not good.  We can't afford the resources.~ EXTERN ~TCCANJ~ CandellaCruelParty
END

IF ~~ THEN BEGIN RElmoTry
  SAY ~Humph.  I'll do what I can.~
  IF ~HaveSpell(CLERIC_NEUTRALIZE_POISON) !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS)~ THEN DO ~Spell("TCSLAVE1",CLERIC_NEUTRALIZE_POISON) SetGlobal("TCElmoHelped","TC0081",10)~ EXIT
  IF ~HaveSpell(CLERIC_SLOW_POISON) !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS)~ THEN DO ~Spell("TCSLAVE1",CLERIC_SLOW_POISON) SetGlobal("TCElmoHelped","TC0081",15)~ EXIT
  IF ~HaveSpell(CLERIC_NEUTRALIZE_POISON) HaveSpell(CLERIC_CURE_LIGHT_WOUNDS)~ THEN DO ~Spell("TCSLAVE1",CLERIC_NEUTRALIZE_POISON) Spell("TCSLAVE1",CLERIC_CURE_LIGHT_WOUNDS) SetGlobal("TCElmoHelped","TC0081",20)~ EXIT
  IF ~HaveSpell(CLERIC_SLOW_POISON) HaveSpell(CLERIC_CURE_LIGHT_WOUNDS)~ THEN DO ~Spell("TCSLAVE1",CLERIC_SLOW_POISON) Spell("TCSLAVE1",CLERIC_CURE_LIGHT_WOUNDS) SetGlobal("TCElmoHelped","TC0081",25)~ EXIT
  IF ~!HaveSpell(CLERIC_NEUTRALIZE_POISON) !HaveSpell(CLERIC_SLOW_POISON) HaveSpell(CLERIC_CURE_LIGHT_WOUNDS)~ DO ~SetGlobal("TCElmoHelped","TC0081",5)~ GOTO RElmoTryFailed
  IF ~!HaveSpell(CLERIC_NEUTRALIZE_POISON) !HaveSpell(CLERIC_SLOW_POISON) !HaveSpell(CLERIC_CURE_LIGHT_WOUNDS)~ DO ~SetGlobal("TCElmoHelped","TC0081",5)~ GOTO RElmoTryFailed
END

IF ~~ THEN BEGIN RElmoTryFailed
  SAY ~*After a momment or two, Rurik shakes his head, opens his eyes and looks at the dying man.*  Yur too far gone fur me.  I don't have the spells ye need.  May you god smile upon your soul.~
  IF ~~ THEN EXTERN ~TCSLAVE1~ YouTried2Help
END
END
