BEGIN ~CB513REL~

IF ~OR(2)
Class([PC],RANGER)
Class([PC],CLERIC_RANGER)
NumTimesTalkedTo(0)~ THEN BEGIN 0
  SAY @1
  IF ~~ THEN REPLY @2 GOTO 15
  IF ~~ THEN REPLY @3 GOTO 2
  IF ~~ THEN REPLY @4 GOTO 19
  IF ~~ THEN REPLY @5 GOTO 20
END

IF ~!Class([PC],RANGER)
!Class([PC],CLERIC_RANGER)
NumTimesTalkedTo(0)~ THEN BEGIN 1
  SAY @6
  IF ~~ THEN REPLY @2 GOTO 15
  IF ~~ THEN REPLY @3 GOTO 2
  IF ~~ THEN REPLY @4 GOTO 19
  IF ~~ THEN REPLY @5 GOTO 20
END

IF ~~ THEN BEGIN 2
  SAY @7
  IF ~~ THEN GOTO 3
END

IF ~~ THEN BEGIN 3
  SAY @8
  IF ~~ THEN GOTO 4
END

IF ~~ THEN BEGIN 4
  SAY @9
  IF ~~ THEN REPLY @10 GOTO 5
  IF ~~ THEN REPLY @11 GOTO 13
  IF ~~ THEN REPLY @12 GOTO 14
END

IF ~~ THEN BEGIN 5
  SAY @13
  IF ~~ THEN GOTO 6
END

IF ~~ THEN BEGIN 6
  SAY @14
  IF ~~ THEN GOTO 7
END

IF ~~ THEN BEGIN 7
  SAY @15
  IF ~~ THEN REPLY @16 GOTO 8
END

IF ~~ THEN BEGIN 8
  SAY @17
  IF ~~ THEN GOTO 9
END

IF ~~ THEN BEGIN 9
  SAY @18
  IF ~~ THEN REPLY @19 GOTO 10
END

IF ~~ THEN BEGIN 10
  SAY @20
  IF ~~ THEN GOTO 11
END

IF ~~ THEN BEGIN 11
  SAY @21
  IF ~~ THEN REPLY @22 GOTO 12
  IF ~~ THEN REPLY @23 GOTO 21
END

IF ~~ THEN BEGIN 12
  SAY @24
  IF ~~ THEN REPLY @23 GOTO 21
END

IF ~~ THEN BEGIN 13
  SAY @25
  IF ~~ THEN GOTO 6
END

IF ~~ THEN BEGIN 14
  SAY @26
  IF ~~ THEN GOTO 6
END

IF ~~ THEN BEGIN 15
  SAY @27
  IF ~~ THEN GOTO 16
END

IF ~~ THEN BEGIN 16
  SAY @28
  IF ~~ THEN GOTO 17
END

IF ~~ THEN BEGIN 17
  SAY @29
  IF ~~ THEN GOTO 18
END

IF ~~ THEN BEGIN 18
  SAY @30
  IF ~~ THEN GOTO 4
END

IF ~~ THEN BEGIN 19
  SAY @31
  IF ~~ THEN GOTO 17
END

IF ~~ THEN BEGIN 20
  SAY @32
  IF ~~ THEN GOTO 17
END

IF ~~ THEN BEGIN 21
  SAY @33
  IF ~~ THEN GOTO 22
END

IF ~~ THEN BEGIN 22
  SAY @34
  IF ~~ THEN REPLY @35 GOTO 23
  IF ~~ THEN REPLY @36 GOTO 25
  IF ~~ THEN REPLY @37 GOTO 25
END

IF ~~ THEN BEGIN 23
  SAY @38
  IF ~~ THEN REPLY @39 GOTO 24
  IF ~~ THEN REPLY @36 GOTO 25
END

IF ~~ THEN BEGIN 24
  SAY @40
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 25
  SAY @41
  IF ~OR(2)
Class([PC],RANGER)
Class([PC],CLERIC_RANGER)~ THEN GOTO 26
  IF ~!Class([PC],RANGER)
!Class([PC],CLERIC_RANGER)~ THEN GOTO 27
END

IF ~~ THEN BEGIN 26
  SAY @42
  IF ~~ THEN GOTO 28
END

IF ~~ THEN BEGIN 27
  SAY @43
  IF ~~ THEN GOTO 28
END

IF ~~ THEN BEGIN 28
  SAY @44
  IF ~~ THEN GOTO 29
END

IF ~~ THEN BEGIN 29
  SAY @45
  IF ~OR(2)
Class([PC],RANGER)
Class([PC],CLERIC_RANGER)
PartyGoldGT(5999)~ THEN REPLY @46 GOTO 30
  IF ~!Class([PC],RANGER)
!Class([PC],CLERIC_RANGER)
PartyGoldGT(29999)~ THEN REPLY @46 GOTO 31
  IF ~~ THEN REPLY @47 GOTO 33
  IF ~~ THEN REPLY @48 GOTO 34
END

IF ~~ THEN BEGIN 30
  SAY @49
  IF ~~ THEN DO ~TakePartyGold(6000)
DestroyGold(6000)
GiveItem("CB513REL",LastTalkedToBy(Myself))
SetGlobal("Cb_PartyBoughtCabin","GLOBAL",1)
RevealAreaOnMap("AR3534")~ GOTO 32
END

IF ~~ THEN BEGIN 31
  SAY @49
  IF ~~ THEN DO ~TakePartyGold(30000)
DestroyGold(30000)
GiveItem("CB513REL",LastTalkedToBy(Myself))
SetGlobal("Cb_PartyBoughtCabin","GLOBAL",1)
RevealAreaOnMap("AR3534")~ GOTO 32
END

IF ~~ THEN BEGIN 32
  SAY @50
  IF ~~ THEN DO ~SetGlobal("Cb_PartyBoughtCabin","LOCALS",1)~ EXIT
END

IF ~~ THEN BEGIN 33
  SAY @51
  IF ~OR(2)
Class([PC],RANGER)
Class([PC],CLERIC_RANGER)
PartyGoldGT(5999)~ THEN REPLY @46 GOTO 30
  IF ~!Class([PC],RANGER)
!Class([PC],CLERIC_RANGER)
PartyGoldGT(29999)~ THEN REPLY @46 GOTO 31
  IF ~~ THEN REPLY @48 GOTO 34
END

IF ~~ THEN BEGIN 34
  SAY @52
  IF ~~ THEN GOTO 24
END

IF ~Global("Cb_PartyBoughtCabin","LOCALS",1)
NumTimesTalkedToGT(0)~ THEN BEGIN 35
  SAY @53
  IF ~~ THEN EXIT
END

IF ~Global("Cb_PartyBoughtCabin","LOCALS",0)
NumTimesTalkedToGT(0)~ THEN BEGIN 36
  SAY @54
  IF ~~ THEN REPLY @55 GOTO 37
  IF ~~ THEN REPLY @56 GOTO 38
END

IF ~~ THEN BEGIN 37
  SAY @57
  IF ~~ THEN REPLY @56 GOTO 38
END

IF ~~ THEN BEGIN 38
  SAY @58
  IF ~~ THEN GOTO 6
END
