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

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

IF WEIGHT #0 ~Global("StartedPheirkasQuest","GLOBAL",0)
!InParty([0.0.0.THIEF])
!InParty([0.0.0.FIGHTER_THIEF])
!InParty([0.0.0.FIGHTER_MAGE_THIEF])
!InParty([0.0.0.THIEF])
!InParty([0.0.0.CLERIC_THIEF])
~ THEN BEGIN 0 // from:
  SAY #79490 /* ~Hmm, I prefer not to work with amateurs.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #1 ~Global("StartedPheirkasQuest","GLOBAL",0)
~ THEN BEGIN 1 // from:
  SAY #79491 /* ~There's a fat man by the name of Algernon staying at Feldepost's Inn in Beregost. He keeps a cloak with him in his room and I need you to get your larcenous hands on it and bring it back to me. I assure you that your reward will be handsome.  Try not to kill him, just filch it off his person.~ */
  IF ~~ THEN DO ~SetGlobal("StartedPheirkasQuest","GLOBAL",1)
~ UNSOLVED_JOURNAL #79492 /* ~Algernon's cloak

Pheirkas, a dwarven fighter in the city of Baldur's Gate, has asked me to undertake what I can only call a covert mission.  Staying at Feldepost's Inn in Beregost is the apparently obese Algernon.  Kept on his person is a cloak that Pheirkas is interested in, shall we say, acquiring...  The risk is great but the reward, I'm sure, is handsome.  Pheirkas can be found in the northwest section of the city.~ */ EXIT
  IF ~Global("X#PHEIRK1","GLOBAL",0)
InParty("coran")
InMyArea("coran")
!StateCheck("coran",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#PHEIRK1","GLOBAL",1)~ GOTO 7
  IF ~Global("X#PHEIRK1","GLOBAL",0)
InParty("coran")
InMyArea("coran")
!StateCheck("coran",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#PHEIRK1","GLOBAL",1)~ EXTERN ~_CORANJ~ 311
  IF ~Global("X#PHEIRK1","GLOBAL",0)
InParty("ajantis")
InMyArea("ajantis")
!StateCheck("ajantis",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#PHEIRK1","GLOBAL",1)~ EXTERN ~_AJANTJ~ 243
END

IF WEIGHT #5 /* Triggers after states #: 3 4 5 even though they appear after this state */
~Global("StartedPheirkasQuest","GLOBAL",1)
Global("HelpPheirkas","GLOBAL",0)
~ THEN BEGIN 2 // from:
  SAY #79493 /* ~Do you have Algernon's cloak with you?~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #2 ~ReactionLT(LastTalkedToBy,FRIENDLY_LOWER)
PartyHasItem("_CLCK08")
~ THEN BEGIN 3 // from:
  SAY #79494 /* ~Ah, thank you so much. Here is 150 gp for your efforts.~ */
  IF ~~ THEN DO ~EraseJournalEntry(79492)
SetGlobal("HelpPheirkas","GLOBAL",1)
TakePartyItem("_CLCK08")
AddexperienceParty(200)
GivePartyGold(150)
~ SOLVED_JOURNAL #88981 /* ~Algernon's cloak

Our business concluded, Pheirkas rewarded my larceny with a tidy sum of coin.~ */ EXIT
END

IF WEIGHT #3 ~ReactionGT(LastTalkedToBy,NEUTRAL_UPPER)
PartyHasItem("_CLCK08")
~ THEN BEGIN 4 // from:
  SAY #79495 /* ~Oh, I do like your handiwork. Here is 200 gp for the trouble.~ */
  IF ~~ THEN DO ~EraseJournalEntry(79492)
SetGlobal("HelpPheirkas","GLOBAL",1)
TakePartyItem("_CLCK08")
AddexperienceParty(300)
GivePartyGold(200)
~ SOLVED_JOURNAL #88981 /* ~Algernon's cloak

Our business concluded, Pheirkas rewarded my larceny with a tidy sum of coin.~ */ EXIT
END

IF WEIGHT #4 ~False()
~ THEN BEGIN 5 // from:
  SAY #79496 /* ~Damn, I was hoping you were more the passive-aggressive type.~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #6 ~True()
~ THEN BEGIN 6 // from:
  SAY #79497 /* ~How do you like my new cloak?~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 7 // from: 1.1
  SAY #103164 /* ~If I like your work, and you do it fast, there'd be 200 gold in it fer you.~ */
  IF ~~ THEN DO ~SetGlobal("StartedPheirkasQuest","GLOBAL",1)
~ UNSOLVED_JOURNAL #79492 /* ~Algernon's cloak

Pheirkas, a dwarven fighter in the city of Baldur's Gate, has asked me to undertake what I can only call a covert mission.  Staying at Feldepost's Inn in Beregost is the apparently obese Algernon.  Kept on his person is a cloak that Pheirkas is interested in, shall we say, acquiring...  The risk is great but the reward, I'm sure, is handsome.  Pheirkas can be found in the northwest section of the city.~ */ EXIT
END

IF ~~ THEN BEGIN 8 // from:
  SAY #103164 /* ~If I like your work, and you do it fast, there'd be 200 gold in it fer you.~ */
  IF ~~ THEN DO ~SetGlobal("StartedPheirkasQuest","GLOBAL",1)
~ UNSOLVED_JOURNAL #79492 /* ~Algernon's cloak

Pheirkas, a dwarven fighter in the city of Baldur's Gate, has asked me to undertake what I can only call a covert mission.  Staying at Feldepost's Inn in Beregost is the apparently obese Algernon.  Kept on his person is a cloak that Pheirkas is interested in, shall we say, acquiring...  The risk is great but the reward, I'm sure, is handsome.  Pheirkas can be found in the northwest section of the city.~ */ EXIT
END

IF ~~ THEN BEGIN 9 // from:
  SAY #103164 /* ~If I like your work, and you do it fast, there'd be 200 gold in it fer you.~ */
  IF ~~ THEN DO ~SetGlobal("StartedPheirkasQuest","GLOBAL",1)
~ UNSOLVED_JOURNAL #79492 /* ~Algernon's cloak

Pheirkas, a dwarven fighter in the city of Baldur's Gate, has asked me to undertake what I can only call a covert mission.  Staying at Feldepost's Inn in Beregost is the apparently obese Algernon.  Kept on his person is a cloak that Pheirkas is interested in, shall we say, acquiring...  The risk is great but the reward, I'm sure, is handsome.  Pheirkas can be found in the northwest section of the city.~ */ EXIT
END
