/* BGII part!! */

APPEND ACBREJ

IF ~Global("ACAR0204","LOCALS",1)~ THEN BEGIN AR0204
SAY @0
IF ~~ THEN DO ~SetGlobal("ACAR0204","LOCALS",2)~ EXIT
END

/*  
note from jastey: this will not show if Jaheira or Minsc or Yoshimo are in the party, because SetGlobal("PostCutSpeak","AR0700",2) is done in their dialogues. If none of them is, it will trigger next time Breagar is talked to, because this dialogue is not triggered...? 
Better make this independent of the game variable:
change trigger to 
~!Global("ACBREFRIEND","GLOBAL",3)%BGT_VAR2%
GlobalGT("PostCutSpeak","AR0700",0)
~Global("ACBREPostCutSpeak","GLOBAL",0)

and the transaction to 
~SetGlobal("ACBREPostCutSpeak","GLOBAL",1)~

and let Breagar trigger the dialogue from his script.
*/

IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)%BGT_VAR2%Global("PostCutSpeak","AR0700",1)~ THEN BEGIN 0700
SAY @1 = @2
IF ~~ THEN DO ~SetGlobal("PostCutSpeak","AR0700",2)~ EXIT
END




IF ~~ THEN BEGIN ACAR0300.1
SAY @3 = @4 = @5 = @6
IF ~~ THEN EXIT
END

IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACAR0600","LOCALS",1)~ THEN BEGIN 0600.1
SAY @7
++ @8 DO ~SetGlobal("ACAR0600","LOCALS",2)~ + 0600.2
++ @9 DO ~SetGlobal("ACAR0600","LOCALS",2)~ + 0600.3
++ @10 DO ~SetGlobal("ACAR0600","LOCALS",2)~ + 0600.4
END

IF ~~ THEN BEGIN 0600.2
SAY @11
IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 0600.3
SAY @12
IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 0600.4
SAY @13
IF ~~ THEN EXIT
END

IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACAR0702","LOCALS",1)~ THEN BEGIN 0702
SAY @14
IF ~~ THEN DO ~SetGlobal("ACAR0702","LOCALS",2)~ EXIT
END

IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACAR0809","LOCALS",1)~ THEN BEGIN 0809
SAY @15
++ @16 DO ~SetGlobal("ACAR0809","LOCALS",2)~ + 0809.1
++ @17 DO ~SetGlobal("ACAR0809","LOCALS",2)~ + 0809.2
++ @18 DO ~SetGlobal("ACAR0809","LOCALS",2)~ + 0809.3
++ @19 DO ~SetGlobal("ACAR0809","LOCALS",2)~ + 0809.4
END

IF ~~ THEN BEGIN 0809.1
SAY @20
IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 0809.2
SAY @21
IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 0809.3
SAY @22
IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 0809.4
SAY @23 = @24
IF ~~ THEN EXIT
END

IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACAR1102","LOCALS",1)~ THEN BEGIN 1102
SAY @25 = @26
IF ~~ THEN DO ~SetGlobal("ACAR1102","LOCALS",2)~ EXIT
END

IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACAR1512","LOCALS",2)~ THEN BEGIN 1512
SAY @30
++ @31 DO ~SetGlobal("ACAR1512","LOCALS",3)~ + 1512.1
++ @32 DO ~SetGlobal("ACAR1512","LOCALS",3)~ + 1512.2
++ @33 DO ~SetGlobal("ACAR1512","LOCALS",3)~ + 1512.3
++ @34 DO ~SetGlobal("ACAR1512","LOCALS",3)~ + 1512.4
END

IF ~~ THEN BEGIN 1512.1
SAY @35
IF ~~ THEN GOTO 1512.5
END

IF ~~ THEN BEGIN 1512.2
SAY @36
IF ~~ THEN GOTO 1512.5
END

IF ~~ THEN BEGIN 1512.3
SAY @37
IF ~~ THEN GOTO 1512.5
END

IF ~~ THEN BEGIN 1512.4
SAY @38
IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 1512.5
SAY @39 = @40
IF ~~ THEN EXIT
END

IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACAR1600","LOCALS",1)~ THEN BEGIN 1600
SAY @41  = @42  = @43 
IF ~~ THEN DO ~SetGlobal("ACAR1600","LOCALS",2)~ EXIT
END

IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACAR2100","LOCALS",1)~ THEN BEGIN 2100
SAY @44 = @45 = @46
IF ~~ THEN DO ~SetGlobal("ACAR2100","LOCALS",2)~ EXIT
END

END

CHAIN
IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACARAC00","LOCALS",1)~ THEN ACBREJ ARAC00
@311 DO ~SetGlobal("ACARAC00","LOCALS",2)~
==BMAZZY IF ~InParty("MAZZY")InMyArea("MAZZY")!StateCheck("MAZZY",CD_STATE_NOTVALID)~ THEN @312
==BIMOEN2 IF ~InParty("IMOEN2")InMyArea("IMOEN2")!StateCheck("IMOEN2",CD_STATE_NOTVALID)~ THEN @313
==BAERIE IF ~InParty("AERIE")InMyArea("AERIE")!StateCheck("AERIE",CD_STATE_NOTVALID)~ THEN @314
==BANOMEN IF ~InParty("ANOMEN")InMyArea("ANOMEN")!StateCheck("ANOMEN",CD_STATE_NOTVALID)~ THEN @315
==BJAN IF ~InParty("JAN")InMyArea("JAN")!StateCheck("JAN",CD_STATE_NOTVALID)~ THEN @316
EXIT

CHAIN
IF ~Global("ACAR2000","LOCALS",1)~ THEN ACBREJ AR2000
@293 DO ~SetGlobal("ACAR2000","LOCALS",2)SetGlobal("ACAUDINTM","GLOBAL",1)RealSetGlobalTimer("ACAUDINTMTIMER","GLOBAL",30)~
==BMAZZY IF ~InParty("MAZZY")See("MAZZY")!StateCheck("MAZZY",CD_STATE_NOTVALID)~ THEN @294
EXIT

CHAIN
IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACAR1900","LOCALS",1)~ THEN ACBREJ ACACAR1900
@195 = @196 DO ~SetGlobal("ACAR1900","LOCALS",2)~
==BCERND IF ~InParty("CERND")See("CERND")!StateCheck("CERND",CD_STATE_NOTVALID)~ THEN @197
==ACBREJ IF ~InParty("CERND")See("CERND")!StateCheck("CERND",CD_STATE_NOTVALID)~ THEN @198
==BCERND IF ~InParty("CERND")See("CERND")!StateCheck("CERND",CD_STATE_NOTVALID)~ THEN @126
==ACBREJ IF ~InParty("CERND")See("CERND")!StateCheck("CERND",CD_STATE_NOTVALID)~ THEN @199 = @200
==BCERND IF ~InParty("CERND")See("CERND")!StateCheck("CERND",CD_STATE_NOTVALID)~ THEN @156
==BJAHEIR IF ~InParty("CERND")See("CERND")!StateCheck("CERND",CD_STATE_NOTVALID)InParty("JAHEIRA")See("JAHEIRA")!StateCheck("JAHEIRA",CD_STATE_NOTVALID)~ THEN @201
EXIT

CHAIN
IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACAR2300","LOCALS",1)~ THEN ACBREJ AR2300
@202 = @203 = @204 DO ~SetGlobal("ACAR2300","LOCALS",2)~
==BMINSC IF ~InParty("MINSC")See("MINSC")!StateCheck("MINSC",CD_STATE_NOTVALID)~ THEN @205
==BIMOEN2 IF ~InParty("IMOEN2")See("IMOEN2")!StateCheck("IMOEN2",CD_STATE_NOTVALID)~ THEN @206
==BANOMEN IF ~InParty("ANOMEN")See("ANOMEN")!StateCheck("ANOMEN",CD_STATE_NOTVALID)~ THEN @207
==ACBREJ @208  = @209
EXIT

CHAIN
IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACAR2800","LOCALS",1)~ THEN ACBREJ AR2800
@210 = @211 DO ~SetGlobal("ACAR2800","LOCALS",2)~
==BJAHEIR IF ~InParty("JAHEIRA")See("JAHEIRA")!StateCheck("JAHEIRA",CD_STATE_NOTVALID)~ THEN @212
==ACBREJ @213
EXIT

CHAIN
IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACAR0300","LOCALS",1)~ THEN ACBREJ ACAR0300
@117 = @118 DO ~SetGlobal("ACAR0300","LOCALS",2)~
==BYOSHIM IF ~InParty("YOSHIMO")See("YOSHIMO")!StateCheck("YOSHIMO",CD_STATE_NOTVALID)~ THEN @119
==ACBREJ IF ~InParty("YOSHIMO")See("YOSHIMO")!StateCheck("YOSHIMO",CD_STATE_NOTVALID)~ THEN @120
==ACBREJ IF ~InParty("YOSHIMO")See("YOSHIMO")!StateCheck("YOSHIMO",CD_STATE_NOTVALID)Global("ACARW000","LOCALS",0)~ THEN @121
==ACBREJ IF ~InParty("YOSHIMO")See("YOSHIMO")!StateCheck("YOSHIMO",CD_STATE_NOTVALID)!Global("ACARW000","LOCALS",0)~ THEN @122
END
IF ~OR(4)!InParty("YOSHIMO")!See("YOSHIMO")StateCheck("YOSHIMO",CD_STATE_NOTVALID)Global("ACARW000","LOCALS",0)~ THEN EXIT
IF ~InParty("YOSHIMO")See("YOSHIMO")!StateCheck("YOSHIMO",CD_STATE_NOTVALID)!Global("ACARW000","LOCALS",0)~ THEN REPLY @123 + ACAR0300.1
IF ~InParty("YOSHIMO")See("YOSHIMO")!StateCheck("YOSHIMO",CD_STATE_NOTVALID)!Global("ACARW000","LOCALS",0)~ THEN REPLY @124 + ACAR0300.1
IF ~InParty("YOSHIMO")See("YOSHIMO")!StateCheck("YOSHIMO",CD_STATE_NOTVALID)!Global("ACARW000","LOCALS",0)~ THEN REPLY @125 + ACAR0300.1
IF ~InParty("YOSHIMO")See("YOSHIMO")!StateCheck("YOSHIMO",CD_STATE_NOTVALID)!Global("ACARW000","LOCALS",0)~ THEN REPLY @126 + ACAR0300.1
IF ~InParty("YOSHIMO")See("YOSHIMO")!StateCheck("YOSHIMO",CD_STATE_NOTVALID)!Global("ACARW000","LOCALS",0)~ THEN REPLY @127 + ACAR0300.1

CHAIN
IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACAR0307","LOCALS",1)~ THEN ACBREJ ACACAR307
@128 DO ~SetGlobal("ACAR0307","LOCALS",2)~
==BCERND IF ~InParty("CERND")See("CERND")!StateCheck("CERND",CD_STATE_NOTVALID)~ THEN @129
==ACBREJ IF ~InParty("CERND")See("CERND")!StateCheck("CERND",CD_STATE_NOTVALID)~ THEN @130
==BCERND IF ~InParty("CERND")See("CERND")!StateCheck("CERND",CD_STATE_NOTVALID)~ THEN @131
==ACBREJ IF ~InParty("CERND")See("CERND")!StateCheck("CERND",CD_STATE_NOTVALID)~ THEN @132
EXIT

CHAIN
IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACAR0308","LOCALS",1)~ THEN ACBREJ ACAR0308
@133 = @134 DO ~SetGlobal("ACAR0308","LOCALS",2)~
==BJAHEIR IF ~InParty("JAHEIRA")See("JAHEIRA")!StateCheck("JAHEIRA",CD_STATE_NOTVALID)~ THEN @135
==ACBREJ IF ~InParty("JAHEIRA")See("JAHEIRA")!StateCheck("JAHEIRA",CD_STATE_NOTVALID)~ THEN @136
EXIT

CHAIN
IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACAR0334","LOCALS",1)~ THEN ACBREJ ACAR0334
@137 DO ~SetGlobal("ACAR0334","LOCALS",2)SetGlobal("ACBREKNOWSCROMWELL","GLOBAL",1)~
==WSMITH01 @138
==ACBREJ @139
==WSMITH01 @140 = @141
==ACBREJ @142
==WSMITH01 @143 = @144 
==ACBREJ @145
==WSMITH01 @146
END
COPY_TRANS WSMITH01 0
/*
++ @147 EXTERN WSMITH01 1
++ @148 EXTERN WSMITH01 2
++ @149 EXTERN WSMITH01 3
++ @150 EXTERN WSMITH01 4
*/

CHAIN
IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACAR0400","LOCALS",1)~ THEN ACBREJ ACAR0400
@151 DO ~SetGlobal("ACAR0400","LOCALS",2)~
==BNALIA IF ~InParty("NALIA")See("NALIA")!StateCheck("NALIA",CD_STATE_NOTVALID)~ THEN @152
==ACBREJ IF ~InParty("NALIA")See("NALIA")!StateCheck("NALIA",CD_STATE_NOTVALID)~ THEN @153
==BNALIA IF ~InParty("NALIA")See("NALIA")!StateCheck("NALIA",CD_STATE_NOTVALID)~ THEN @154
==ACBREJ IF ~InParty("NALIA")See("NALIA")!StateCheck("NALIA",CD_STATE_NOTVALID)~ THEN @155
==BNALIA IF ~InParty("NALIA")See("NALIA")!StateCheck("NALIA",CD_STATE_NOTVALID)~ THEN @156
EXIT

CHAIN
IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACAR0404","LOCALS",1)~ THEN ACBREJ ACAR0404
@157  DO ~SetGlobal("ACAR0404","LOCALS",2)~
==BMINSC IF ~InParty("MINSC")See("MINSC")!StateCheck("MINSC",CD_STATE_NOTVALID)~ THEN @158
==ACBREJ IF ~InParty("MINSC")See("MINSC")!StateCheck("MINSC",CD_STATE_NOTVALID)~ THEN @159
EXIT

CHAIN
IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACAR0411","LOCALS",1)~ THEN ACBREJ ACAR0411
@160 DO ~SetGlobal("ACAR0411","LOCALS",2)~
==BVALYGA IF ~InParty("VALYGAR")See("VALYGAR")!StateCheck("VALYGAR",CD_STATE_NOTVALID)~ THEN @161
==ACBREJ IF ~InParty("VALYGAR")See("VALYGAR")!StateCheck("VALYGAR",CD_STATE_NOTVALID)~ THEN @162
==ACBREJ IF ~OR(3)!InParty("VALYGAR")!See("VALYGAR")StateCheck("VALYGAR",CD_STATE_NOTVALID)~ THEN @163
==ACBREJ IF ~CLASS(PLAYER1,MAGE_ALL)~ THEN @164
EXIT

CHAIN
IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACAR0414","LOCALS",1)~ THEN ACBREJ ACAR0414
@165 = @166 DO ~SetGlobal("ACAR0414","LOCALS",2)~
==BAERIE IF ~InParty("AERIE")See("AERIE")!StateCheck("AERIE",CD_STATE_NOTVALID)~ THEN @167
==ACBREJ IF ~InParty("AERIE")See("AERIE")!StateCheck("AERIE",CD_STATE_NOTVALID)~ THEN @168
EXIT

CHAIN
IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACAR0502","LOCALS",1)~ THEN ACBREJ ACAR0502
@169 DO ~SetGlobal("ACAR0502","LOCALS",2)~
==BYOSHIM IF ~InParty("YOSHIMO")See("YOSHIMO")!StateCheck("YOSHIMO",CD_STATE_NOTVALID)~ THEN @170
EXIT

CHAIN
IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACAR0516","LOCALS",2)~ THEN ACBREJ ACAR0516
@171 DO ~SetGlobal("ACAR0516","LOCALS",3)~
==BEDWIN IF ~InParty("EDWIN")See("EDWIN")!StateCheck("EDWIN",CD_STATE_NOTVALID)~ THEN @13
==ACBREJ @172 = @173
EXIT

CHAIN
IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACAR0800","LOCALS",1)~ THEN ACBREJ ACAR0800
@174 DO ~SetGlobal("ACAR0800","LOCALS",2)SetGlobal("ACBOUTDEATH","LOCALS",1)~
==BVICONI IF ~InParty("VICONIA")See("VICONIA")!StateCheck("VICONIA",CD_STATE_NOTVALID)~ THEN @175
==ACBREJ IF ~InParty("VICONIA")See("VICONIA")!StateCheck("VICONIA",CD_STATE_NOTVALID)~ THEN @176
==ACBREJ @177
==BKORGAN IF ~InParty("KORGAN")See("KORGAN")!StateCheck("KORGAN",CD_STATE_NOTVALID)~ THEN @178
==ACBREJ IF ~InParty("KORGAN")See("KORGAN")!StateCheck("KORGAN",CD_STATE_NOTVALID)~ THEN @179
EXIT

CHAIN
IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACAR0900","LOCALS",1)~ THEN ACBREJ ACAR0900
@180 DO ~SetGlobal("ACAR0900","LOCALS",2)~
==BVICONI IF ~InParty("VICONIA")See("VICONIA")!StateCheck("VICONIA",CD_STATE_NOTVALID)~ THEN @13
==ACBREJ IF ~InParty("VICONIA")See("VICONIA")!StateCheck("VICONIA",CD_STATE_NOTVALID)~ THEN @181
==BVICONI IF ~InParty("VICONIA")See("VICONIA")!StateCheck("VICONIA",CD_STATE_NOTVALID)~ THEN @182
==ACBREJ IF ~InParty("VICONIA")See("VICONIA")!StateCheck("VICONIA",CD_STATE_NOTVALID)~ THEN @183
EXIT

CHAIN
IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACAR1201","LOCALS",1)~ THEN ACBREJ ACAR1201
@184 DO ~SetGlobal("ACAR1201","LOCALS",2)~
==BKELDOR IF ~InParty("KELDORN")See("KELDORN")!StateCheck("KELDORN",CD_STATE_NOTVALID)~ THEN @185
==ACBREJ IF ~InParty("KELDORN")See("KELDORN")!StateCheck("KELDORN",CD_STATE_NOTVALID)~ THEN @186
==BKELDOR IF ~InParty("KELDORN")See("KELDORN")!StateCheck("KELDORN",CD_STATE_NOTVALID)~ THEN @187
==ACBREJ IF ~InParty("KELDORN")See("KELDORN")!StateCheck("KELDORN",CD_STATE_NOTVALID)~ THEN @188
EXIT

CHAIN
IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACAR1401","LOCALS",1)~ THEN ACBREJ ACAR1401
@189 DO ~SetGlobal("ACAR1401","LOCALS",2)~
==BMINSC IF ~InParty("MINSC")See("MINSC")!StateCheck("MINSC",CD_STATE_NOTVALID)~ THEN @190
==ACBREJ IF ~InParty("MINSC")See("MINSC")!StateCheck("MINSC",CD_STATE_NOTVALID)~ THEN @191
EXIT

CHAIN
IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACAR1500","LOCALS",1)~ THEN ACBREJ ACAR1500
@192 DO ~SetGlobal("ACAR1500","LOCALS",2)~
==ACBREJ IF ~!PartyHasItem("misc8v")~ THEN @193
==ACBREJ IF ~PartyHasItem("misc8v")~ THEN @194
EXIT


CHAIN
IF WEIGHT #6 ~!Global("ACBREFRIEND","GLOBAL",3)Global("ACPLLD","LOCALS",1)~ THEN ACBREJ ACPLLD
@317 DO ~SetGlobal("ACPLLD","LOCALS",2)~
==BVICONI IF ~InParty("VICONIA")See("VICONIA")!StateCheck("VICONIA",CD_STATE_NOTVALID)~ THEN @318
==ACBREJ IF ~InParty("VICONIA")See("VICONIA")!StateCheck("VICONIA",CD_STATE_NOTVALID)~ THEN @247
==BVICONI IF ~InParty("VICONIA")See("VICONIA")!StateCheck("VICONIA",CD_STATE_NOTVALID)~ THEN @319
==ACBREJ IF ~InParty("VICONIA")See("VICONIA")!StateCheck("VICONIA",CD_STATE_NOTVALID)~ THEN @320
==BVICONI IF ~GlobalLT("ACBREBIO","GLOBAL",2)InParty("VICONIA")See("VICONIA")!StateCheck("VICONIA",CD_STATE_NOTVALID)~ THEN @321
==BVICONI IF ~GlobalGT("ACBREBIO","GLOBAL",1)InParty("VICONIA")See("VICONIA")!StateCheck("VICONIA",CD_STATE_NOTVALID)~ THEN @322
==ACBREJ IF ~InParty("VICONIA")See("VICONIA")!StateCheck("VICONIA",CD_STATE_NOTVALID)~ THEN @323
EXIT
