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

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

IF WEIGHT #1 /* Triggers after states #: 17 even though they appear after this state */
~NumberOfTimesTalkedTo(0)
~ THEN BEGIN 0 // from:
  SAY #85444 /* ~Stop!  You are trespassing on my land-home!  None come this way armed as your are; it was those horrible fishermen what hired you wasn't it?  Speak!~ */
  IF ~~ THEN REPLY #85445 /* ~I know not of whom you speak, child.~ */ GOTO 1
  IF ~ReactionLT(LastTalkedToBy,NEUTRAL_LOWER)
~ THEN REPLY #85446 /* ~Uhhh... they did send me, but I wish only to know what is going on.~ */ GOTO 2
  IF ~~ THEN REPLY #85447 /* ~It's true!  They sent me to end your villainous deeds!~ */ GOTO 2
  IF ~ReactionGT(LastTalkedToBy,HOSTILE_UPPER)
~ THEN REPLY #85448 /* ~Ummmm... they did send me, but I wish only to know what is going on.~ */ GOTO 14
  IF ~Global("X#TENYA0","GLOBAL",0)
InParty("edwin")
InMyArea("edwin")
!StateCheck("edwin",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#TENYA0","GLOBAL",1)~ EXTERN ~_EDWINJ~ 150
  IF ~Global("X#TENYA0","GLOBAL",0)
InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#TENYA0","GLOBAL",1)~ EXTERN ~_DYNAHJ~ 225
  IF ~Global("X#TENYA0","GLOBAL",0)
InParty("kivan")
InMyArea("kivan")
!StateCheck("kivan",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#TENYA0","GLOBAL",1)~ EXTERN ~_KIVANJ~ 379
  IF ~Global("X#TENYA0","GLOBAL",0)
InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#TENYA0","GLOBAL",1)~ EXTERN ~_JAHEIJ~ 383
END

IF ~~ THEN BEGIN 1 // from: 15.2 0.0
  SAY #85449 /* ~I've no quarrel with thee!  Be sure this remains so and leave.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 2 // from: 15.1 15.0 0.2 0.1
  SAY #85450 /* ~As cowardly as they are treacherous; hiring others to do what they could not!  Tonight I shall put an end to all of this!  The seas cry for vengeance!~ */
  IF ~~ THEN DO ~Enemy()
~ EXIT
  IF ~Global("X#EdwinTenya0","GLOBAL",0)
InParty("edwin")
InMyArea("edwin")
!StateCheck("edwin",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#EdwinTenya0","GLOBAL",1)~ EXTERN ~_EDWINJ~ 94
END

IF ~~ THEN BEGIN 3 // from:
  SAY #85451 /* ~Liar!  None would dare attack me of their own accord!  You shall share the fate of your employers as the sea takes back what it's due!~ */
  IF ~~ THEN DO ~Enemy()
~ GOTO 4
  IF ~Global("X#EdwinTenya1","GLOBAL",0)
InParty("edwin")
InMyArea("edwin")
!StateCheck("edwin",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#EdwinTenya1","GLOBAL",1)~ EXTERN ~_EDWINJ~ 95
END

IF ~~ THEN BEGIN 4 // from: 19.0 3.0
  SAY #85452 /* ~The power of Umberlee flows in my blood!  I am the avenging Wave of Fury, the anger of the storm that beats the shore!~ */
  IF ~~ THEN REPLY #74023 /* ~~ */ EXIT
  IF ~Global("X#EdwinTenya2","GLOBAL",0)
InParty("edwin")
InMyArea("edwin")
!StateCheck("edwin",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#EdwinTenya2","GLOBAL",1)~ EXTERN ~_EDWINJ~ 96
END

IF WEIGHT #2 /* Triggers after states #: 17 even though they appear after this state */
~Global("TenyaHit","GLOBAL",1)
~ THEN BEGIN 5 // from:
  SAY #85453 /* ~Why do you do this?  Don't you know what they've done?  Sonner and the others, THEY are the EVIL ones!  They killed my mother and now you help them?!  She only did her duty, collecting the offerings from those that would use the sea.  They stole her elemental summoning bowl, and tortured her for the words that make it work.  Now they all misuse a gift from Umberlee to pillage the seas, and my mother's spirit can't rest until it is returned.  I have more power than mother had, Umberlee gave me her anger, but I can't find the bowl.  All I can do is hurt them 'till they give it back or die, but I'm so tired.  I don't have mother's will, and the goddess is so demanding.  Help me, please.~ */
  IF ~~ THEN REPLY #85454 /* ~Shhh, child.  I shall help as best I can.~ */ DO ~SetGlobal("TenyaHit","GLOBAL",2)
ChangeEnemyAlly(Myself,NEUTRAL)
ClearAllActions()
SetGlobal("TenyaStory","GLOBAL",1)
~ GOTO 7
  IF ~~ THEN REPLY #85456 /* ~I don't trust you OR Sonner's bunch.~ */ DO ~SetGlobal("TenyaHit","GLOBAL",2)
ChangeEnemyAlly(Myself,NEUTRAL)
ClearAllActions()
SetGlobal("TenyaStory","GLOBAL",1)
~ GOTO 16
  IF ~~ THEN REPLY #85458 /* ~You would say anything to save yourself.  I'll not believe it!~ */ DO ~SetGlobal("TenyaHit","GLOBAL",2)
~ GOTO 6
  IF ~Global("X#GarTen","GLOBAL",0)
InParty("garrick")
InMyArea("garrick")
!StateCheck("garrick",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#GarTen","GLOBAL",1)~ EXTERN ~_GARRIJ~ 119
END

IF ~~ THEN BEGIN 6 // from: 21.2 5.2
  SAY #85460 /* ~Then you had best kill me now.  All who malign Umberlee must be punished, and she will not let me stop!~ */
  IF ~~ THEN DO ~Enemy()
~ EXIT
END

IF ~~ THEN BEGIN 7 // from: 21.0 5.0
  SAY #85461 /* ~Oh thank you!  The Sea Queen may yet be satisfied with the return of the bowl, but one way or another Sonner's group must no longer profit at her expense.  It is probably being hidden in a shrine to another god.  I don't know where the shrine is, and couldn't go near even if I did, but Sonner may tell you... if you ask him with a blade.  Go now, for Umberlee is seldom patient, and you are not yet on her good side.~ */
  IF ~~ THEN DO ~SetGlobal("HelpTenya","GLOBAL",1)
~ UNSOLVED_JOURNAL #85455 /* ~The fishermen and the priestess

The "priestess" I was sent to kill is no more than a child of perhaps twelve years.  She says the fishermen who hired me killed her mother.  I shall go confront them on her behalf.~ */ EXIT
END

IF WEIGHT #3 /* Triggers after states #: 17 even though they appear after this state */
~Global("HelpTenya","GLOBAL",1)
~ THEN BEGIN 8 // from:
  SAY #85462 /* ~You return.  I trust you bear good news?~ */
  IF ~Dead("jebadoh")
Dead("telman")
Dead("sonner")
~ THEN REPLY #85463 /* ~They are all dead, and will trouble you no more.  Does this satisfy your need for vengeance?~ */ GOTO 10
  IF ~PartyHasItem("_MISC53")
~ THEN REPLY #85464 /* ~Here is the bowl that was taken from your mother.  Perhaps now she will rest.~ */ GOTO 11
  IF ~~ THEN REPLY #85465 /* ~I have not yet retrieved the bowl or dealt with Sonner.~ */ GOTO 9
  IF ~~ THEN REPLY #85467 /* ~I have returned to finish what I started.  Your evil ways must end!~ */ GOTO 12
  IF ~~ THEN REPLY #85468 /* ~I'll have nothing more to do with any of you!  I will be no-one's tool.~ */ GOTO 13
END

IF ~~ THEN BEGIN 9 // from: 8.2
  SAY #85469 /* ~The Bitch Queen is not called so because of her patient nature.  Quicken your step.~ */
  IF ~~ THEN UNSOLVED_JOURNAL #85466 /* ~The fishermen and the priestess

I returned to Tenya without having carried out her wishes.  She no longer seems quite the meek child.  I feel it's best not to keep her waiting.~ */ EXIT
END

IF ~~ THEN BEGIN 10 // from: 8.0
  SAY #85470 /* ~I have no further need of vengeance.  Umberlee is mother now, and she is well pleased.  The blood spilt today will remind all of her mastery of the waters.  Hopefully Talos will tire of these little games.  You have been a most useful tool, and the Sea Queen shall reward you... in time.~ */
  IF ~~ THEN DO ~SetGlobal("HelpTenya","GLOBAL",2)
TakePartyItem("_MISC53")
AddexperienceParty(2500)
SetGlobal("TalkedToTenya","GLOBAL",1)
SetGlobal("HelpJebadoh","GLOBAL",3)
EraseJournalEntry(85582)
EraseJournalEntry(85537)
EraseJournalEntry(85548)
EraseJournalEntry(85574)
EraseJournalEntry(85576)
EraseJournalEntry(85455)
EraseJournalEntry(85457)
EraseJournalEntry(85466)
EraseJournalEntry(74934)
ForceSpell(Myself,DRYAD_TELEPORT)
~ SOLVED_JOURNAL #85471 /* ~The fishermen and the priestess

I have been promised a future reward for my role in vanquishing the fishermen aligned with Talos.  Strange, though... I do not feel as though I have helped a child, so much as I have been the pawn of a spiteful god.  Deities are not to be trifled with... they trifle back.~ */ EXIT
END

IF ~~ THEN BEGIN 11 // from: 8.1
  SAY #85472 /* ~Umberlee is mother now, and she is well pleased.  She will deal with Sonner's group in time, and Talos will no doubt abandon them for their failure.  If they are wise they will never set sail again, for the sea will take their worthless lives.  I have no reward for you, but the Sea Queen remembers those that serve her well.  You will be paid... in time.~ */
  IF ~~ THEN DO ~SetGlobal("HelpTenya","GLOBAL",2)
SetGlobal("TalkedToTenya","GLOBAL",1)
TakePartyItem("_MISC53")
AddexperienceParty(2500)
SetGlobal("HelpJebadoh","GLOBAL",3)
EraseJournalEntry(85582)
EraseJournalEntry(85537)
EraseJournalEntry(85548)
EraseJournalEntry(85574)
EraseJournalEntry(85576)
EraseJournalEntry(85455)
EraseJournalEntry(85457)
EraseJournalEntry(85466)
EraseJournalEntry(74934)
ForceSpell(Myself,DRYAD_TELEPORT)
~ SOLVED_JOURNAL #85471 /* ~The fishermen and the priestess

I have been promised a future reward for my role in vanquishing the fishermen aligned with Talos.  Strange, though... I do not feel as though I have helped a child, so much as I have been the pawn of a spiteful god.  Deities are not to be trifled with... they trifle back.~ */ EXIT
END

IF ~~ THEN BEGIN 12 // from: 8.3
  SAY #85473 /* ~So be it!  It's your own grave you dig, for Umberlee shall not be denied!~ */
  IF ~~ THEN DO ~Enemy()
~ EXIT
END

IF ~~ THEN BEGIN 13 // from: 8.4
  SAY #85474 /* ~I shall deal with them myself then.  It's no longer the time for subtlety!~ */
  IF ~~ THEN DO ~SetGlobal("TalkedToTenya","GLOBAL",1)
SetGlobal("KillFishermen","GLOBAL",1)
SetGlobal("HelpJebadoh","GLOBAL",3)
EraseJournalEntry(85582)
EraseJournalEntry(85537)
EraseJournalEntry(85548)
EraseJournalEntry(85574)
EraseJournalEntry(85576)
EraseJournalEntry(85455)
EraseJournalEntry(85457)
EraseJournalEntry(85466)
EraseJournalEntry(74934)
ForceSpell(Myself,DRYAD_TELEPORT)
~ SOLVED_JOURNAL #85475 /* ~The fishermen and the priestess

I have refused to aid Tenya in her fanatical search for vengeance, though it appears she no longer wishes my help.  I fear for the safety of all concerned, but I trust none of them.~ */ EXIT
END

IF ~~ THEN BEGIN 14 // from: 0.3
  SAY #85476 /* ~What goes on is none of your business!  Leave now, lest you earn the same fate that they have!~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #4 /* Triggers after states #: 17 even though they appear after this state */
~Global("HelpTenya","GLOBAL",0)
~ THEN BEGIN 15 // from:
  SAY #85477 /* ~You return?!  I warn you once again to leave my home.  If you do not, I must assume you are allied with my enemies!~ */
  IF ~~ THEN REPLY #85478 /* ~They did send me, but I wish only to know what is going on.~ */ GOTO 2
  IF ~~ THEN REPLY #85447 /* ~It's true!  They sent me to end your villainous deeds!~ */ GOTO 2
  IF ~~ THEN REPLY #85479 /* ~I wish no enmity between us, and will not disturb you further.~ */ GOTO 1
END

IF ~~ THEN BEGIN 16 // from: 21.1 5.1
  SAY #85480 /* ~Then stand you well outside the battle and leave me be!  It is but money that makes this fight yours! A petty reason, by any account!  Begone!~ */
  IF ~~ THEN UNSOLVED_JOURNAL #85457 /* ~The fishermen and the priestess

The "priestess" of Umberlee is no more than a child.  She claims the fishermen killed her mother.  I do not trust either side in this matter.~ */ EXIT
END

IF WEIGHT #0 ~StateCheck(Myself,STATE_CHARMED)
~ THEN BEGIN 17 // from:
  SAY #85490 /* ~New friends of mine!  You may call me Tenya, and know that I am a priestess of Umberlee.  For many weeks now I have searched for the relic that was stolen from my mother.  The fishermen Telman, Jebadoh, and Sonner stole it when they became jealous of her power.  I will soon have my revenge against these petty fishermen.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 18 // from:
  SAY #100036 /* ~Die, mageling!~ */
  IF ~~ THEN DO ~Enemy()
~ EXIT
END

IF ~~ THEN BEGIN 19 // from:
  SAY #100036 /* ~Die, mageling!~ */
  IF ~~ THEN DO ~Enemy()
~ GOTO 4
END

IF ~~ THEN BEGIN 20 // from:
  SAY #100036 /* ~Die, mageling!~ */
  IF ~~ THEN REPLY #74023 /* ~~ */ EXIT
END

IF ~~ THEN BEGIN 21 // from:
  SAY #100162 /* ~Just go away!~ */
  IF ~~ THEN REPLY #85454 /* ~Shhh, child.  I shall help as best I can.~ */ DO ~SetGlobal("TenyaHit","GLOBAL",2)
ChangeEnemyAlly(Myself,NEUTRAL)
ClearAllActions()
SetGlobal("TenyaStory","GLOBAL",1)
~ GOTO 7
  IF ~~ THEN REPLY #85456 /* ~I don't trust you OR Sonner's bunch.~ */ DO ~SetGlobal("TenyaHit","GLOBAL",2)
ChangeEnemyAlly(Myself,NEUTRAL)
ClearAllActions()
SetGlobal("TenyaStory","GLOBAL",1)
~ GOTO 16
  IF ~~ THEN REPLY #85458 /* ~You would say anything to save yourself.  I'll not believe it!~ */ DO ~SetGlobal("TenyaHit","GLOBAL",2)
~ GOTO 6
END
