BEGIN J#pirat1

IF ~NumTimesTalkedTo(0)
!G("J#SilMurder",3)~ pirate
  SAY @0
=
@1
++ @2 GOTO explain
++ @3 GOTO explain
+ ~G("J#ArdTalk",1)~ + @4 GOTO rude
+ ~G("J#ArdTalk",1)~ + @5 GOTO polite
+ ~G("J#ArdTalk",1)~ + @6 GOTO rescue
END

IF ~~ explain
  SAY @7
  IF ~~ GOTO boyname
END

IF ~~ rude
  SAY @8
  IF ~~ GOTO boyname
END

IF ~~ polite
  SAY @9
  IF ~~ GOTO boyname
END

IF ~~ rescue
  SAY @10
  IF ~~ GOTO boyname
END

IF ~~ boyname
  SAY @11
  IF ~~ EXTERN J#Bren brennan
END

BEGIN J#bren
IF ~~ brennan
  SAY @12
  + ~!G("J#ArdTalk",1)~ + @13 GOTO south
  + ~!G("J#ArdTalk",1)~ + @14 EXTERN J#pirat1 beoff
  + ~!G("J#ArdTalk",1)~ + @15 EXTERN J#pirat1 beoff
  + ~G("J#ArdTalk",1)~ + @16 EXTERN J#pirat1 beoff
  + ~G("J#ArdTalk",1)~ + @17 EXTERN J#pirat1 beoff
  + ~G("J#ArdTalk",1)~ + @18 EXTERN J#pirat1 beoff
  + ~G("J#ArdTalk",1)~ + @19 EXTERN J#pirat1 beoff
END

IF ~~ south
  SAY @20
  IF ~~ THEN EXTERN J#pirat1 beoff
END

APPEND J#pirat1
IF ~~ beoff
  SAY @21
  IF ~ReactionGT(LastTalkedToBy(),NEUTRAL_UPPER)~ GOTO advice
  IF ~ReactionLT(LastTalkedToBy(),FRIENDLY_LOWER)
ReactionGT(LastTalkedToBy(),HOSTILE_UPPER)~ GOTO advice2
  IF ~ReactionLT(LastTalkedToBy(),NEUTRAL_LOWER)~ GOTO bribe
END

IF ~~ advice
  SAY @22
=
@23
  IF ~~ THEN DO ~SG("J#TalkedPirate",1)
EscapeAreaMove("J#Hall",311,229,8)~ EXIT
END

IF ~~ advice2
  SAY @24
  IF ~~ THEN DO ~SG("J#TalkedPirate",1)
EscapeAreaMove("J#Hall",311,229,8)~ EXIT
END

IF ~~ bribe
  SAY @25
  IF ~~ THEN DO ~SG("J#TalkedPirate",1)
GivePartyGold(50)
EscapeAreaMove("J#Hall",311,229,8)~ EXIT
END

IF ~G("J#TalkedPirate",1)~ furtherchat
  SAY @26
  ++ @27 + sirinewarn
  ++ @28 + piracy
  + ~G("J#TalkedSil",1)~ + @29 + siltalk
  ++ @30 EXIT
END

IF ~~ sirinewarn
  SAY @31
=
@32
  ++ @28 + piracy
  + ~G("J#TalkedSil",1)~ + @29 + siltalk
  ++ @33 EXIT
END

IF ~~ piracy
  SAY @34
=
@35
  ++ @27 + sirinewarn
  + ~G("J#TalkedSil",1)~ + @29 + siltalk
  ++ @33 EXIT
END

IF ~~ siltalk
  SAY @36
=
@37
  + ~CheckStatGT(LastTalkedToBy(Myself),13,CHR)~ + @38 + confess
  + ~CheckStatLT(LastTalkedToBy(Myself),14,CHR)~ + @38 + noconfess
  + ~CheckStatGT(LastTalkedToBy(Myself),12,INT)~ + @39 + confess
  + ~CheckStatLT(LastTalkedToBy(Myself),13,INT)~ + @39 + noconfess
  ++ @40 + fight
  ++ @41 + nofight
  ++ @42 + confess
END

IF ~~ fight
  SAY @43
=
@44
  IF ~~ THEN DO ~SG("J#PirateFight",1) // Hostile men spawn
Enemy()~ EXIT
END

IF ~~ nofight
  SAY @45
=
@46
  IF ~~ THEN DO ~SG("J#TalkedPirate",2) // If talked to again, will attack~ EXIT
END

IF ~~ noconfess
  SAY @47
=
@46
  IF ~~ THEN DO ~SG("J#TalkedPirate",2) // If talked to again, will attack~ EXIT
END

IF ~~ confess
  SAY @48
=
@49
=
@50
++ @51 GOTO fight
++ @52 GOTO bribeyou
END

IF ~~ bribeyou
  SAY @53
=
@54
  ++ @55 + dealstruck
  ++ @56 + fight
END

IF ~G("J#TalkedPirate",2)~ killjoo
  SAY @57
=
@44
  IF ~~ THEN DO ~SG("J#PirateFight",1) // His men spawn on this global and turn hostile
Enemy()~ EXIT
END

IF ~~ dealstruck
  SAY @58
  IF ~!Dead("sil")~ THEN DO ~GivePartyGold(1000)
SG("J#SilMurder",1) // Sil has had the hit taken out on her
EscapeArea()~ EXIT
  IF ~Dead("sil")~ THEN DO ~GivePartyGold(1000)
SG("J#SilMurder",2) // Sil is already dead
EscapeArea()~ EXIT
END

IF WEIGHT #-2 ~G("J#SilMurder",3)~ betrayed
  SAY @59
=
@60
=
@61
=
@62
  IF ~~ THEN DO ~SG("J#SilMurder",4) // His men turn hostile on this global
Enemy()~ EXIT
END
END
