// creator  : weidu.exe (version 23600)
// argument : PETRIN.DLG
// game     : .
// source   : ./override/PETRIN.DLG
// dialog   : lang\en_us/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 #15126 /* ~Hi, I'm Petrine.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #1 ~  NumberOfTimesTalkedTo(0)
ReactionGT(LastTalkedToBy,HOSTILE_UPPER)
~ THEN BEGIN 1 // from:
  SAY #15127 /* ~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 UNSOLVED_JOURNAL #26881 /* ~Petrine's Cat
Petrine, one of Baldur's Gate's many orphans, has lost Angel, her cat. I might find Angel at the house of Petrine's Uncle Bheren, where Petrine is reluctant to go. If I can bring her the ring that Angel uses as a toy, the cat may return to Petrine.~ */ 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~ 103
  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~ 104
END

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

IF WEIGHT #2 ~  PartyHasItem("OHRING16")
~ THEN BEGIN 3 // from:
  SAY #15129 /* ~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 #20663 /* ~You be careful to stay out of trouble, kid.~ */ DO ~EraseJournalEntry(26881)
EraseJournalEntry(26879)
EraseJournalEntry(26880)
SetGlobal("HelpPetrine","GLOBAL",2)
TakePartyItem("OHRING16")
AddexperienceParty(500)
~ SOLVED_JOURNAL #27358 /* ~Petrine's Cat
Petrine brightened at the sight of Angel's ring. Her happiness was reward enough, I suppose.~ */ EXIT
  IF ~  Dead("PetrinesCat")
~ THEN REPLY #20664 /* ~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~ 93
  IF ~  !Dead("petrinescat")
Dead("BHEREN")
~ THEN REPLY #46504 /* ~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 #46505 /* ~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 #15130 /* ~Angel! Help me, Angel!~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #5 ~  True()
~ THEN BEGIN 5 // from:
  SAY #15131 /* ~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 #20665 /* ~You... you killed Angel... Waaaaaaaaa...!~ */
  IF ~~ THEN DO ~EraseJournalEntry(26881)
EraseJournalEntry(26879)
EraseJournalEntry(26880)
SetGlobal("HelpPetrine","GLOBAL",99)
ReputationInc(-1)
EscapeArea()
~ EXIT
END

IF ~~ THEN BEGIN 7 // from:
  SAY #45210 /* ~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 #20663 /* ~You be careful to stay out of trouble, kid.~ */ DO ~EraseJournalEntry(26881)
EraseJournalEntry(26879)
EraseJournalEntry(26880)
SetGlobal("HelpPetrine","GLOBAL",2)
TakePartyItem("OHRING16")
AddexperienceParty(500)
~ SOLVED_JOURNAL #27358 /* ~Petrine's Cat
Petrine brightened at the sight of Angel's ring. Her happiness was reward enough, I suppose.~ */ EXIT
  IF ~  Dead("PetrinesCat")
~ THEN REPLY #20664 /* ~Actually, you little brat, we killed your cat Angel.~ */ GOTO 6
END
