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

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

IF WEIGHT #0 ~!PartyHasItem("MISC5L")
Global("Littleman","GLOBAL",0)
NumTimesTalkedTo(0)~ THEN BEGIN 0 // from:
  SAY #26997 /* ~... Mama?  Papa?  Is that you?~ */
  IF ~~ THEN REPLY #26998 /* ~What manner of spirit are you?  Why are you not at rest?~ */ GOTO 1
  IF ~~ THEN REPLY #26999 /* ~Hold, friends!  This may be no simple spirit!~ */ GOTO 2
END

IF ~~ THEN BEGIN 1 // from: 0.0
  SAY #27000 /* ~Spirit?  I... my name is Wellyn.  I just want... I just want my stuffed bear back...~ */
  IF ~~ THEN REPLY #27001 /* ~Your stuffed bear?~ */ GOTO 3
END

IF ~~ THEN BEGIN 2 // from: 0.1
  SAY #27002 /* ~Spirit?  I've... I've never hurt anybody!  My name is Wellyn and I... I just want my stuffed bear back...~ */
  IF ~~ THEN REPLY #27003 /* ~Stuffed bear?  What is this bear you speak of?~ */ GOTO 3
END

IF ~~ THEN BEGIN 3 // from: 13.0 2.0 1.0
  SAY #27004 /* ~It's my favorite bear, Littleman... the bad man who came into our house... he, he hurt me and he took Littleman with everything else...  (sob!)  I can never go to sleep without Littleman!~ */
  IF ~~ THEN REPLY #27005 /* ~A thief killed you and took your stuffed bear along with the rest of his loot?  If I found this bear for you, would you be at peace?~ */ GOTO 4
  IF ~~ THEN REPLY #27006 /* ~I have no time for this foolishness.  Away with you, spirit!~ */ GOTO 5
  IF ~~ THEN REPLY #27007 /* ~I cannot help you, Wellyn.~ */ GOTO 6
END

IF ~~ THEN BEGIN 4 // from: 13.1 3.0
  SAY #27008 /* ~Oh, yes!  I could go to sleep if only I had him!  Would you get him for me?  Would you, please please please?~ */
  IF ~~ THEN REPLY #27009 /* ~Very well.  Do you know where your bear is?~ */ GOTO 7
  IF ~~ THEN REPLY #27010 /* ~I have no time for such an irritating task.  Begone.~ */ GOTO 5
  IF ~~ THEN REPLY #27011 /* ~I cannot help you, Wellyn, sorry.~ */ GOTO 6
END

IF ~~ THEN BEGIN 5 // from: 13.3 11.2 9.2 4.1 3.1
  SAY #27012 /* ~Oh... (sob)  I just... I just want my Littleman!  (sob!)  Where is my Mama?  (sob!)  ... Mama?  Is that you?...~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 6 // from: 13.2 4.2 3.2
  SAY #27014 /* ~Oh, please, please!  (sob!)  I just want my Littleman!  (sob!)  Why did you take it!  ... Mama?  Mama, is that you?...~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 7 // from: 11.1 4.0
  SAY #27015 /* ~Yes...  (sniff!)  The bad man has it at that inn in the slums.  The Copper something.  (sniff!)  He's in one of those bedrooms in the back!  I think his name is 'Llynis'...~ */
  IF ~~ THEN GOTO 8
END

IF ~~ THEN BEGIN 8 // from: 7.0
  SAY #27016 /* ~I've... I've gone to him...  (sob!)  ... I've tried to tell him that I just want my bear, please, but he just gets too frightened of me.  (sob!)  Oh, please get it from him!~ */
  IF ~~ THEN DO ~SetGlobal("Littleman","GLOBAL",1)~ UNSOLVED_JOURNAL #34337 /* ~Put the spirit of the child Wellyn to rest.

I encountered the restless spirit of a small boy, Wellyn, in the graveyard and agreed to return his stuffed bear to him so that he might be at peace.  According to the spirit, the bear (named Littleman... I suppose every halfling child must have a toy named Littleman, if you think about it) is in the possession of the thief who murdered the child... the thief's name is Llynis and is in one of the rooms at the Copper Coronet.~ */ EXIT
END

IF WEIGHT #1 ~Global("Littleman","GLOBAL",1)~ THEN BEGIN 9 // from:
  SAY #27017 /* ~... Mama?  Mama, do you know where my Littleman is?  Do you have him?~ */
  IF ~PartyHasItem("MISC5L")~ THEN REPLY #27018 /* ~Yes, Wellyn... here is your bear.  You can go to sleep now.~ */ GOTO 10
  IF ~~ THEN REPLY #27019 /* ~No, I don't have your bear, I'm afraid.~ */ GOTO 11
  IF ~~ THEN REPLY #27020 /* ~Begone, spirit!  Away with you!!~ */ GOTO 5
END

IF ~~ THEN BEGIN 10 // from: 15.0 9.0
  SAY #27021 /* ~You have him!  You have him!  Oh, thank you, <SIRMAAM>, thank you!  I can go to sleep, now!  Thank you!!~ */
  IF ~~ THEN DO ~EraseJournalEntry(34337)
AddexperienceParty(15500)
TakePartyItem("MISC5L")
SetGlobal("WellynPeace","GLOBAL",1)
MoveToPointNoInterrupt([1618.1760])
CreateVisualEffectObject("SPFLESHS",Myself)
DestroySelf()~ SOLVED_JOURNAL #47705 /* ~Put the spirit of the child Wellyn to rest.

I restored a toy bear to the spirit of a murdered halfling child named Wellyn, who I presume has returned to his final rest.  Hopefully the boy will remain at peace.~ */ EXIT
END

IF ~~ THEN BEGIN 11 // from: 9.1
  SAY #27024 /* ~You don't?  (sob!)  Oh... could you get him?  Could you get my stuffed bear, pleeeaaasse?~ */
  IF ~~ THEN REPLY #27025 /* ~I will try, Wellyn.~ */ GOTO 12
  IF ~~ THEN REPLY #27026 /* ~Do you know where he is?  I seem to have forgotten.~ */ GOTO 7
  IF ~~ THEN REPLY #27028 /* ~I have no time for this.  Away with you!~ */ GOTO 5
END

IF ~~ THEN BEGIN 12 // from: 11.0
  SAY #27029 /* ~... Th-thank you, <SIRMAAM>...~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #3 /* Triggers after states #: 14 even though they appear after this state */
~!PartyHasItem("MISC5L")~ THEN BEGIN 13 // from:
  SAY #27030 /* ~... Mama?  Papa?  Is that you?  Do you have my Littleman?~ */
  IF ~~ THEN REPLY #27031 /* ~Tell me what this 'Littleman' is.  Is this the stuffed bear you spoke of?~ */ GOTO 3
  IF ~~ THEN REPLY #27032 /* ~If I get this Littleman for you, would you be at peace?~ */ GOTO 4
  IF ~~ THEN REPLY #27033 /* ~I'm sorry, spirit, I cannot help you.~ */ GOTO 6
  IF ~~ THEN REPLY #27034 /* ~Away with you, spirit!  Back to the grave!!~ */ GOTO 5
END

IF WEIGHT #2 ~PartyHasItem("MISC5L")
Global("Littleman","GLOBAL",0)~ THEN BEGIN 14 // from:
  SAY #27035 /* ~(sob!)  Mama?  Is that you?  (sob!)  You're not my mama!  But... but you have my bear!  You have my Littleman!!~ */
  IF ~~ THEN GOTO 15
END

IF ~~ THEN BEGIN 15 // from: 14.0
  SAY #27036 /* ~Oh, please... I cannot sleep without my Littleman!  Can I have him... can I have him, please?~ */
  IF ~~ THEN REPLY #27037 /* ~This stuffed bear?  Er, certainly... here you go...~ */ GOTO 10
  IF ~~ THEN REPLY #27038 /* ~Never!  The bear is mine!  Away with you, spirit!!~ */ GOTO 16
END

IF ~~ THEN BEGIN 16 // from: 15.1
  SAY #27039 /* ~What?!  You won't give me my bear?!  You... you are so MEAN!!~ */
  IF ~~ THEN DO ~EraseJournalEntry(34337)
ReallyForceSpell(Myself,REVENANT_CHANGE)~ EXIT
END
