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

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

IF WEIGHT #2 /* Triggers after states #: 7 16 even though they appear after this state */
~True()
~ THEN BEGIN 0 // from:
  SAY #81552 /* ~I am Jalantha Mistmyr; what reason do you have to see me?~ */
  IF ~~ THEN REPLY #81553 /* ~We have come to pay our respects at your temple.~ */ GOTO 2
  IF ~Global("HelpLothander","GLOBAL",1)
Global("ReturnedBook","GLOBAL",0)
~ THEN REPLY #81554 /* ~We have need of your powers.  A companion of ours is cursed with a geas spell.  We humbly ask that you remove it.~ */ GOTO 3
  IF ~Global("HelpLothander","GLOBAL",1)
Global("ReturnedBook","GLOBAL",0)
~ THEN REPLY #81555 /* ~We want you to remove a geas spell from a companion of ours.  We will pay any price.~ */ GOTO 4
  IF ~Global("BOYBODY","GLOBAL",0)
Global("HelpTremain","GLOBAL",1)
~ THEN REPLY #81556 /* ~I wish nothing of you, save the body of the infidel that tried to break into your hallowed halls.~ */ GOTO 13
END

IF ~~ THEN BEGIN 1 // from:
  SAY #81557 /* ~I am the High Priestess Jalantha Mistmyr; you have come to worship at this temple, yet none of you bear any holy items of my goddess.  Why are you here?~ */
  IF ~~ THEN REPLY #81558 /* ~We did not lie, we are here to pay our respects to your goddess.~ */ GOTO 2
  IF ~~ THEN REPLY #81559 /* ~You're right.  We're not here to worship; rather, we need the power you possess.  A friend of ours is afflicted by a geas spell.  Would you be able to remove it from him?~ */ GOTO 3
  IF ~~ THEN REPLY #81560 /* ~We need you to remove a geas spell from one of our companions.  Name your price.~ */ GOTO 4
END

IF ~~ THEN BEGIN 2 // from: 1.0 0.0
  SAY #81561 /* ~Your faith comes across falsely.  When you decide to tell me the truth, then you may speak with me again.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 3 // from: 1.1 0.1
  SAY #81562 /* ~I do not offer the power of my goddess to anyone.  If you wish this favor you will first have to do a favor for Umberlee.~ */
  IF ~~ THEN GOTO 5
END

IF ~~ THEN BEGIN 4 // from: 1.2 0.2
  SAY #81563 /* ~My Goddess cannot be bought with gold.  If you wish to see your friend healed, you will first have to do a favor for Umberlee.~ */
  IF ~~ THEN GOTO 5
  IF ~Global("X#JALANT4","GLOBAL",0)
InParty("viconia")
InMyArea("viconia")
!StateCheck("viconia",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#JALANT4","GLOBAL",1)~ EXTERN ~_VICONJ~ 242
  IF ~Global("X#JALANT4","GLOBAL",0)
InParty("garrick")
InMyArea("garrick")
!StateCheck("garrick",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#JALANT4","GLOBAL",1)~ EXTERN ~_GARRIJ~ 250
END

IF ~~ THEN BEGIN 5 // from: 4.0 3.0 _GARRIJ:250.0
  SAY #81564 /* ~The favor I ask of you is a simple one.  The holy day Storm Call approaches.  It will be the first time I have overseen this ceremony.  To insure that my first ceremony is flawless I need an item of power.  It is called the Book of Wisdom, and is possessed by the clergy of Tymora at the Temple of Tymora, called the Lady's Hall by those who venerate the frivolous goddess.  If you can get this book from me, I will do what you ask.  What is your decision?~ */
  IF ~~ THEN REPLY #81565 /* ~We don't like your offer.  We'll be off now.~ */ EXIT
  IF ~~ THEN REPLY #81566 /* ~It looks as if we have no other choice, we're in.~ */ GOTO 6
END

IF ~~ THEN BEGIN 6 // from: 5.1
  SAY #81567 /* ~I don't care how you get the book.  Once you have it, come to the temple and meet with me.~ */
  IF ~~ THEN DO ~SetGlobal("HelpJalantha","GLOBAL",1)
~ UNSOLVED_JOURNAL #81568 /* ~Marek and Lothander

In exchange for her help in curing Lothander, we have agreed to find a holy book for Jalantha Mistmyr.  The book is located in the Temple of Tymora (the Lady's Hall.)~ */ EXIT
END

IF WEIGHT #0 ~PartyHasItem("_BOOK08")
~ THEN BEGIN 7 // from:
  SAY #81569 /* ~So, you've returned with the Book of Wisdom.  Let me see it.~ */
  IF ~~ THEN REPLY #81570 /* ~We don't trust you.  Before we show it to you, we want the cure to our friend's geas.~ */ DO ~GiveItem("_CRLJALA",LastTalkedToBy)
~ GOTO 9
  IF ~~ THEN REPLY #81571 /* ~Here you go, now give us the cure to the geas.~ */ GOTO 10
  IF ~~ THEN REPLY #81572 /* ~Actually we don't have it with us right now.~ */ GOTO 8
END

IF ~~ THEN BEGIN 8 // from: 7.2
  SAY #81573 /* ~You don't have it!  Then return to me when you do, now leave.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 9 // from: 7.0
  SAY #81574 /* ~You dare question my honor!  Very well, this scroll is scripted with the incantation that will rid your friend of his curse.  Now give over the book.~ */
  IF ~~ THEN REPLY #81575 /* ~Here's your precious book.~ */ DO ~TakePartyItem("_BOOK08")
~ GOTO 12
  IF ~~ THEN REPLY #81576 /* ~Actually we don't have the book.  Aren't you the fool.~ */ GOTO 11
END

IF ~~ THEN BEGIN 10 // from: 7.1
  SAY #81577 /* ~Good.  Take this; an incantation upon this scroll will dispel the geas upon your companion.~ */
  IF ~~ THEN DO ~TakePartyItem("_BOOK08")
GiveItem("_CRLJALA",LastTalkedToBy)
SetGlobal("ReturnedBook","GLOBAL",1)
~ EXIT
END

IF ~~ THEN BEGIN 11 // from: 9.1
  SAY #81578 /* ~You will pay for such impudence!~ */
  IF ~~ THEN DO ~Shout(2727)
Enemy()
~ EXIT
END

IF ~~ THEN BEGIN 12 // from: 9.0
  SAY #81579 /* ~Our bargain is now finished, I would ask you to leave.~ */
  IF ~~ THEN DO ~SetGlobal("ReturnedBook","GLOBAL",1)
~ EXIT
END

IF ~~ THEN BEGIN 13 // from: 0.3
  SAY #81580 /* ~The bodies of infidels are priced highly in these troubled times.  Give me 2,000 gold and the body is yours.~ */
  IF ~~ THEN REPLY #81581 /* ~2,000 gold?! That's highway robbery!~ */ EXIT
  IF ~PartyGoldGT(1999)
~ THEN REPLY #81582 /* ~All right then, we're willing to pay the cash, just give us the body.~ */ GOTO 15
END

IF ~~ THEN BEGIN 14 // from:
  SAY #81583 /* ~You insult me in my own temple!  You will regret your hasty words.~ */
  IF ~~ THEN DO ~Shout(2727)
Enemy()
~ EXIT
END

IF ~~ THEN BEGIN 15 // from: 13.1
  SAY #81584 /* ~Thank you for your money.  Here is the body that you wanted.~ */
  IF ~~ THEN DO ~GiveItem("_MISC54",LastTalkedToBy)
SetGlobal("BOYBODY","GLOBAL",1)
TakePartyGold(2000)
~ EXIT
END

IF WEIGHT #1 ~False()
~ THEN BEGIN 16 // from:
  SAY #81585 /* ~Do not bother me, unless you wish to court the Bitch Queen's wrath!~ */
  IF ~~ THEN EXIT
END
