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

BEGIN ~25SPELL~ 4 // non-zero flags may indicate non-pausing dialogue
//////////////////////////////////////////////////
// WARNING: this file contains non-trivial WEIGHTs
//////////////////////////////////////////////////

IF WEIGHT #4 /* Triggers after states #: 5 11 13 22 even though they appear after this state */
~AreaCheck("AR5011")
~ THEN BEGIN 0 // from:
  SAY #70769 /* ~Lazarus Librarus at your service.  Welcome to the Arcana Archives.~ */
  IF ~Global("lazarus","GLOBAL",3)~ THEN GOTO 1
  IF ~Global("lazarus","GLOBAL",0)~ THEN GOTO 8
END

IF ~~ THEN BEGIN 1 // from: 7.0 5.0 4.0 0.0
  SAY #70770 /* ~Can I interest you in my wares?  I've got a collection of scrolls most mages would die for!~ */
  IF ~~ THEN REPLY #70771 /* ~Let me see what you've got.~ */ GOTO 2
  IF ~~ THEN REPLY #70772 /* ~I'd like to ask you some questions about this town.~ */ GOTO 4
  IF ~~ THEN REPLY #70774 /* ~No thanks, I'll be going now.~ */ GOTO 3
  IF ~Global("YagaShuraHeart","GLOBAL",4)~ THEN REPLY #70778 /* ~Hey - aren't you the same guy who was selling scrolls back in Saradush?~ */ GOTO 6
END

IF ~~ THEN BEGIN 2 // from: 17.0 1.0
  SAY #70773 /* ~Please feel free to peruse my vast collection of enchanted parchments.  And if you see anything you like, I'm sure we can work out a mutually beneficial exchange of coin for the said item.~ */
  IF ~~ THEN DO ~StartStore("25Spell",LastTalkedToBy)~ EXIT
END

IF ~~ THEN BEGIN 3 // from: 14.1 1.2
  SAY #70775 /* ~Well, if you change your mind you know where to find me.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 4 // from: 1.1
  SAY #70776 /* ~Sorry... I can't help you there.  I only arrived a short time ago, and between restocking my shelves and setting traps for would be thieves, I haven't even left the building.~ */
  IF ~~ THEN GOTO 1
END

IF WEIGHT #0 ~AreaCheck("AR5502")
~ THEN BEGIN 5 // from:
  SAY #70777 /* ~Welcome to the newly relocated Arcana Archives.  Lazarus Librarus at your service!~ */
  IF ~~ THEN GOTO 1
END

IF ~~ THEN BEGIN 6 // from: 1.3
  SAY #70779 /* ~Saradush... a most unpleasant memory.  When that army burst through the gates, I grabbed my inventory and ran for my life.  Had to use up some of my own stock to get out of there with my head still attached.~ */
  IF ~~ THEN GOTO 7
END

IF ~~ THEN BEGIN 7 // from: 6.0
  SAY #70780 /* ~The army was so busy looking for Bhaalspawn to kill that nobody noticed one invisible merchant creeping out the gates.  But that's all behind me now, and I'm making a fresh start here in Amkethran!~ */
  IF ~~ THEN GOTO 1
END

IF ~~ THEN BEGIN 8 // from: 0.1
  SAY #73378 /* ~I would normally invite you to look at my magical wares, but alas my shelves are completely bare.  I have not even a single parchment left for you to purchase.~ */
  IF ~~ THEN DO ~SetGlobal("lazarus","GLOBAL",1)~ GOTO 13
END

IF ~~ THEN BEGIN 9 // from: 11.0
  SAY #73379 /* ~At first I suspected Hectan... he is well known about town for his sticky fingers.  But after questioning many witnesses it is clear that Hectan was at the local pub from dusk until dawn the night of the theft.~ */
  IF ~~ THEN UNSOLVED_JOURNAL #73486 /* ~Lazarus' Missing Spellbook

The owner of a local scroll shop has had his spellbook stolen.  Without it, he has no wares to sell.  He suspects a man named Hectan, though Hectan has an ironclad alibi:  he was busy getting drunk down at the local inn.~ */ GOTO 10
END

IF ~~ THEN BEGIN 10 // from: 9.0
  SAY #73380 /* ~I still suspect that no-good thief Hectan was involved - I can clearly see the guilt in his face!  But there is no proof.  Without my spellbook I am virtually powerless to pursue this myself, and as a newcomer to this town I have no one to turn to for help.~ */
  IF ~~ THEN REPLY #73396 /* ~Are there any clues?~ */ GOTO 15
  IF ~~ THEN REPLY #73397 /* ~I will make this Hectan confess!~ */ GOTO 15
  IF ~~ THEN REPLY #73398 /* ~I will return when I have finished my investigation.~ */ GOTO 12
END

IF WEIGHT #2 /* Triggers after states #: 22 even though they appear after this state */
~Global("lazarus","GLOBAL",2)
AreaCheck("AR5011")
~ THEN BEGIN 11 // from: 14.0 13.0
  SAY #73381 /* ~I thank you for your aid in solving the theft of my spellbook, mighty <CHARNAME>.  Is there anything I can do to aid your investigation?~ */
  IF ~!Global("hectan","GLOBAL",2)
!PartyHasItem("PLOT18B")~ THEN REPLY #73392 /* ~What can you tell me about the crime?~ */ GOTO 9
  IF ~!Global("hectan","GLOBAL",2)
!PartyHasItem("PLOT18B")~ THEN REPLY #73393 /* ~I will come back when my investigations are done.~ */ GOTO 12
  IF ~PartyHasItem("PLOT18B")
~ THEN REPLY #73394 /* ~I have your spellbook here.~ */ GOTO 17
  IF ~Global("hectan","GLOBAL",2)
!Dead("hectan")
!PartyHasItem("PLOT18B")~ THEN REPLY #73395 /* ~Hectan admitted he stole your spellbook.  He will give it back in exchange for a teleportation scroll to escape the city.~ */ GOTO 18
END

IF ~~ THEN BEGIN 12 // from: 16.1 16.0 11.1 10.2
  SAY #73383 /* ~As you wish.  I urge you godspeed.  Without my spellbook I have no way to restock my inventory with the precious scrolls I normally carry.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #3 /* Triggers after states #: 22 even though they appear after this state */
~Global("lazarus","GLOBAL",1)
AreaCheck("AR5011")
~ THEN BEGIN 13 // from: 8.0
  SAY #73385 /* ~My spellbook has been stolen!  Without it, I cannot fashion the powerful scrolls which normally fill my shop.  Please, mighty <CHARNAME>... I beg of you to help a humble wizard!~ */
  IF ~~ THEN REPLY #73386 /* ~Very well, I shall help you recover your spellbook.~ */ DO ~SetGlobal("lazarus","GLOBAL",2)~ GOTO 11
  IF ~~ THEN REPLY #73387 /* ~What's in this for me?~ */ GOTO 14
  IF ~~ THEN REPLY #73388 /* ~I can't be bothered with your petty problems!~ */ GOTO 14
END

IF ~~ THEN BEGIN 14 // from: 13.2 13.1
  SAY #73389 /* ~I only ask this of you because there is nowhere else I may turn. And if you return my spellbook I can craft scrolls of the greatest power for you, <CHARNAME>!  As many as you need, of any spell you desire!  All for the most reasonable of prices.~ */
  IF ~~ THEN REPLY #73390 /* ~Very well, I will help you recover your spellbook.~ */ DO ~SetGlobal("lazarus","GLOBAL",2)~ GOTO 11
  IF ~~ THEN REPLY #73391 /* ~Sorry, I'm not interested.~ */ GOTO 3
END

IF ~~ THEN BEGIN 15 // from: 10.1 10.0
  SAY #73399 /* ~There is but one clue, <CHARNAME>... though it does little to point the finger at Hectan.  A set of muddy footprints leading from my window.  Very small footprints... far smaller than those of Hectan.  Or any man or woman, for that matter.~ */
  IF ~~ THEN DO ~SetGlobal("MuddyFootprints","GLOBAL",1)
~ GOTO 16
END

IF ~~ THEN BEGIN 16 // from: 15.0
  SAY #73400 /* ~I regret that there is little else I can tell you.  Hectan can usually be found in the Tankard Tree if you wish to question him.~ */
  IF ~~ THEN REPLY #73401 /* ~I shall return when my investigations are done.~ */ GOTO 12
  IF ~~ THEN REPLY #73402 /* ~I think I will go speak to this Hectan.~ */ GOTO 12
END

IF ~~ THEN BEGIN 17 // from: 22.0 11.2
  SAY #73403 /* ~My spellbook!  Thank you, kind <PRO_SIRMAAM>!   Truly, the legends of <CHARNAME> have not been exaggerated!  I can once again craft my scrolls!~ */
  IF ~~ THEN DO ~SetGlobal("lazarus","GLOBAL",3)
SetGlobal("lazarusscroll","GLOBAL",3)
AddXP2DA("PLOT24B")
TakePartyItem("PLOT18B")
EraseJournalEntry(73486)
EraseJournalEntry(73487)
EraseJournalEntry(73488)
EraseJournalEntry(73489)
EraseJournalEntry(73490)~ SOLVED_JOURNAL #73491 /* ~Lazarus' Missing Spellbook

With his spellbook returned, Lazarus is once again able to open up his fabulous scroll shop.~ */ GOTO 2
END

IF ~~ THEN BEGIN 18 // from: 11.3
  SAY #73404 /* ~I knew that thief was to blame!  But he is a fool if he thinks a teleportation scroll will help him escape this city.~ */
  IF ~~ THEN GOTO 19
END

IF ~~ THEN BEGIN 19 // from: 18.0
  SAY #73405 /* ~I do have such a scroll, and I will gladly trade it for my spellbook... but the scroll is useless.  Yaga-Shura's mages have cast powerful spells imprisoning us here.~ */
  IF ~~ THEN GOTO 20
END

IF ~~ THEN BEGIN 20 // from: 19.0
  SAY #73406 /* ~Anyone foolish enough to attempt a magical escape will rebound off the invisible walls, a grisly and very messy fate.  Nevertheless, here is the scroll Hectan wanted.~ */
  IF ~~ THEN DO ~GiveItemCreate("PLOT18A",LastTalkedToBy,0,0,0)
~ UNSOLVED_JOURNAL #73488 /* ~Lazarus' Missing Spellbook

Lazarus has given me the teleportation scroll.  I can exchange it with Hectan for the spellbook... though Lazarus has warned me that anyone using the scroll will rebound from the magical barriers surrounding Saradush - a ghastly end, to be sure.~ */ GOTO 21
END

IF ~~ THEN BEGIN 21 // from: 22.1 20.0
  SAY #73407 /* ~I suppose the choice is up to you, <CHARNAME>, if you wish to warn Hectan about the consequences of using the scroll.  I wish you luck in recovering my spellbook.~ */
  IF ~~ THEN DO ~SetGlobal("lazarusscroll","GLOBAL",1)~ EXIT
END

IF WEIGHT #1 ~Global("lazarusscroll","GLOBAL",1)
AreaCheck("AR5011")
~ THEN BEGIN 22 // from:
  SAY #73408 /* ~Have you made the exchange with Hectan yet?  Have you recovered my spellbook?~ */
  IF ~PartyHasItem("PLOT18B")
~ THEN REPLY #73409 /* ~Yes, here is your spellbook.~ */ DO ~SetGlobal("lazarusscroll","GLOBAL",2)~ GOTO 17
  IF ~!PartyHasItem("PLOT18B")~ THEN REPLY #73410 /* ~I'm still working on making the exchange.~ */ GOTO 21
END
