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

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

IF WEIGHT #0 ~NumberOfTimesTalkedTo(0)
ReactionLT(LastTalkedToBy,NEUTRAL_LOWER)
~ THEN BEGIN 0 // from:
  SAY #82053 /* ~Hi, I'm Petrine.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #1 ~Global("HelpPetrine","GLOBAL",0)
!Dead("petrinescat")
ReactionGT(LastTalkedToBy,HOSTILE_UPPER)
~ THEN BEGIN 1 // from:
  SAY #82054 /* ~Hi, I'm Petrine and my folks aren't around no more and I ran away from my Uncle Bheren 'cause he's real mean. My cat's really an angel, though, and she protects me when bad things happen. Or at least she did. I can't find her now, though. I think she went back to my uncle's to get her ring.  There's this ring that she loves to play with, but when I ran away I had to leave it at my nasty uncle's.  If you could just get me the ring, I'm sure Angel would come back.  Could you do it, oh please?~ */
  IF ~~ THEN DO ~SetGlobal("HelpPetrine","GLOBAL",1)
~ UNSOLVED_JOURNAL #82055 /* ~Petrine's cat

Petrine, one of the countless orphans of Baldur's Gate, has lost the one thing she still holds dear in life: her cat, Angel.  It is difficult not to feel a deep pity for the sweet girl... but she doesn't want my pity, only my help.  According to Petrine, Angel has likely returned to the house of her uncle Bheren, from whose place she has fled and is reluctant to return.  If I could find and return the ring Angel loves to play with, I would probably make Petrine a very happy girl.~ */ EXIT
  IF ~Global("X#DynaheirPetrine1","GLOBAL",0)
InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
Class(Player1,THIEF_ALL)
~ THEN DO ~SetGlobal("X#DynaheirPetrine1","GLOBAL",1)~ EXTERN ~_DYNAHJ~ 102
  IF ~Global("X#DynaheirPetrine1","GLOBAL",0)
InParty("dynaheir")
InMyArea("dynaheir")
!StateCheck("dynaheir",CD_STATE_NOTVALID)
!Class(Player1,THIEF_ALL)
~ THEN DO ~SetGlobal("X#DynaheirPetrine1","GLOBAL",1)~ EXTERN ~_DYNAHJ~ 103
END

IF WEIGHT #4 /* Triggers after states #: 3 4 even though they appear after this state */
~Global("HelpPetrine","GLOBAL",1)
~ THEN BEGIN 2 // from:
  SAY #82056 /* ~I miss Angel. I hope she comes back real soon.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #2 ~Global("HelpPetrine","GLOBAL",1)
PartyHasItem("MACRING2")
~ THEN BEGIN 3 // from:
  SAY #82057 /* ~You found the ring... now Angel will come back... and we can live together forever and ever.  I wish I had something to give you for finding her ring but I really and truly don't. Maybe she'll give you some good luck, though.~ */
  IF ~!Dead("petrinescat")
~ THEN REPLY #82058 /* ~You be careful to stay out of trouble kid.~ */ DO ~EraseJournalEntry(82055)
EraseJournalEntry(82238)
EraseJournalEntry(82240)
SetGlobal("HelpPetrine","GLOBAL",2)
TakePartyItem("MACRING2")
AddexperienceParty(500)
~ SOLVED_JOURNAL #88974 /* ~Petrine's cat

I located Angel's ring and returned it to Petrine.  She brightened visibly at the sight of it, and even though she had nothing to give me in return, the act itself carried its own reward.~ */ EXIT
  IF ~Dead("petrinescat")
~ THEN REPLY #82059 /* ~Actually, you little brat, we killed your cat Angel.~ */ GOTO 6
  IF ~Global("X#JaheiraPetrine","GLOBAL",0)
InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#JaheiraPetrine","GLOBAL",1)~ EXTERN ~_JAHEIJ~ 88
  IF ~  !Dead("petrinescat")
Dead("BHEREN")
~ THEN REPLY #99854 /* ~Petrine, your uncle wanted us to kill Angel. I reasoned that if we refused, tomorrow he’d find someone else. And I can not stand idle when people go around killing poor orphan girls’ cats! I... I killed him.~ */ DO ~TakePartyItem("_RING16")
AddexperienceParty(1000)
~ EXIT
  IF ~  !Dead("petrinescat")
Dead("BHEREN")
~ THEN REPLY #99855 /* ~I am going to make sure that you are transferred into the care of someone kinder than your rude uncle, Petrine. Trust me.~ */ DO ~ReputationInc(1)
TakePartyItem("_RING16")
AddexperienceParty(1000)
~ EXIT
END

IF WEIGHT #3 ~False()
~ THEN BEGIN 4 // from:
  SAY #82060 /* ~Angel! Help me, Angel!~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #5 ~Global("HelpPetrine","GLOBAL",2)
~ THEN BEGIN 5 // from:
  SAY #82061 /* ~Angel's out hunting but she says you're really kind.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 6 // from: 7.1 3.1
  SAY #82062 /* ~You... you killed Angel... Waaaaaaaaa...~ */
  IF ~~ THEN DO ~EraseJournalEntry(82055)
EraseJournalEntry(82238)
EraseJournalEntry(82240)
SetGlobal("HelpPetrine","GLOBAL",99)
ReputationInc(-1)
EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 7 // from:
  SAY #98562 /* ~O, no... they... they won't let me have Angel. And Angel... nobody in the whole world loves me, but my Angel.~ */
  IF ~!Dead("petrinescat")
~ THEN REPLY #82058 /* ~You be careful to stay out of trouble kid.~ */ DO ~EraseJournalEntry(82055)
EraseJournalEntry(82238)
EraseJournalEntry(82240)
SetGlobal("HelpPetrine","GLOBAL",2)
TakePartyItem("MACRING2")
AddexperienceParty(500)
~ SOLVED_JOURNAL #88974 /* ~Petrine's cat

I located Angel's ring and returned it to Petrine.  She brightened visibly at the sight of it, and even though she had nothing to give me in return, the act itself carried its own reward.~ */ EXIT
  IF ~Dead("petrinescat")
~ THEN REPLY #82059 /* ~Actually, you little brat, we killed your cat Angel.~ */ GOTO 6
END
