/* Amarande Remove Escape Area*/
ALTER_TRANS ~%tutu_var%AMARAN~
BEGIN 3 5 END
BEGIN 0 END
BEGIN
"ACTION" ~SetGlobal("X#RemovedEscape","GLOBAL",1)~
END


/* YESLICK */
REPLACE_STATE_TRIGGER BYESLI 9 ~InteractingWith("kagain") GlobalLT("endofbg1","GLOBAL",2) RandomNum(8,1) Global("X#BIOYE1","LOCALS",0)~
REPLACE_STATE_TRIGGER BYESLI 10 ~InteractingWith("kagain") GlobalLT("endofbg1","GLOBAL",2) RandomNum(8,2) Global("X#BIOYE2","LOCALS",0)~
REPLACE_STATE_TRIGGER BYESLI 12 ~InteractingWith("kagain") GlobalLT("endofbg1","GLOBAL",2) RandomNum(8,3) Global("X#BIOYE3","LOCALS",0)~
REPLACE_STATE_TRIGGER BYESLI 17 ~InteractingWith("kagain") GlobalLT("endofbg1","GLOBAL",2) RandomNum(8,4) Global("X#BIOYE4","LOCALS",0)~
REPLACE_STATE_TRIGGER BYESLI 18 ~InteractingWith("kagain") GlobalLT("endofbg1","GLOBAL",2) RandomNum(8,5) Global("X#BIOYE5","LOCALS",0)~
REPLACE_STATE_TRIGGER BYESLI 19 ~InteractingWith("kagain") GlobalLT("endofbg1","GLOBAL",2) RandomNum(8,6) Global("X#BIOYE6","LOCALS",0)~
REPLACE_STATE_TRIGGER BYESLI 20 ~InteractingWith("kagain") GlobalLT("endofbg1","GLOBAL",2) RandomNum(8,7) Global("X#BIOYE7","LOCALS",0)~
REPLACE_STATE_TRIGGER BYESLI 13 ~InteractingWith("kagain") GlobalLT("endofbg1","GLOBAL",2) RandomNum(8,8) Global("X#BIOYE8","LOCALS",0)~

ADD_TRANS_ACTION BYESLI BEGIN 9 END BEGIN END ~SetGlobal("X#BIOYE1","LOCALS",1)~
ADD_TRANS_ACTION BYESLI BEGIN 10 END BEGIN END ~SetGlobal("X#BIOYE2","LOCALS",1)~
ADD_TRANS_ACTION BYESLI BEGIN 12 END BEGIN END ~SetGlobal("X#BIOYE3","LOCALS",1)~
ADD_TRANS_ACTION BYESLI BEGIN 17 END BEGIN END ~SetGlobal("X#BIOYE4","LOCALS",1)~
ADD_TRANS_ACTION BYESLI BEGIN 18 END BEGIN END ~SetGlobal("X#BIOYE5","LOCALS",1)~
ADD_TRANS_ACTION BYESLI BEGIN 19 END BEGIN END ~SetGlobal("X#BIOYE6","LOCALS",1)~
ADD_TRANS_ACTION BYESLI BEGIN 20 END BEGIN END ~SetGlobal("X#BIOYE7","LOCALS",1)~
ADD_TRANS_ACTION BYESLI BEGIN 13 END BEGIN END ~SetGlobal("X#BIOYE8","LOCALS",1)~

/* XZAR */
REPLACE_STATE_TRIGGER BXZAR 0 ~InteractingWith("montaron") GlobalLT("endofbg1","GLOBAL",2) RandomNum(3,1) Global("X#BIOXZ1","LOCALS",0)~
REPLACE_STATE_TRIGGER BXZAR 1 ~InteractingWith("montaron") GlobalLT("endofbg1","GLOBAL",2) RandomNum(3,2) Global("X#BIOXZ2","LOCALS",0)~
REPLACE_STATE_TRIGGER BXZAR 2 ~InteractingWith("montaron") GlobalLT("endofbg1","GLOBAL",2) RandomNum(3,3) Global("X#BIOXZ3","LOCALS",0)~

ADD_TRANS_ACTION BXZAR BEGIN 0 END BEGIN END ~SetGlobal("X#BIOXZ1","LOCALS",1)~
ADD_TRANS_ACTION BXZAR BEGIN 1 END BEGIN END ~SetGlobal("X#BIOXZ2","LOCALS",1)~
ADD_TRANS_ACTION BXZAR BEGIN 2 END BEGIN END ~SetGlobal("X#BIOXZ3","LOCALS",1)~

/* XAN */
REPLACE_STATE_TRIGGER BXANNN 0 ~InteractingWith("eldoth") GlobalLT("endofbg1","GLOBAL",2) RandomNum(3,1) Global("X#BIOXA1","LOCALS",0)~
REPLACE_STATE_TRIGGER BXANNN 1 ~InteractingWith("eldoth") GlobalLT("endofbg1","GLOBAL",2) RandomNum(3,2) Global("X#BIOXA2","LOCALS",0)~
REPLACE_STATE_TRIGGER BXANNN 2 ~InteractingWith("eldoth") GlobalLT("endofbg1","GLOBAL",2) RandomNum(3,3) Global("X#BIOXA3","LOCALS",0)~

ADD_TRANS_ACTION BXANNN BEGIN 0 END BEGIN END ~SetGlobal("X#BIOXA1","LOCALS",1)~
ADD_TRANS_ACTION BXANNN BEGIN 1 END BEGIN END ~SetGlobal("X#BIOXA2","LOCALS",1)~
ADD_TRANS_ACTION BXANNN BEGIN 2 END BEGIN END ~SetGlobal("X#BIOXA3","LOCALS",1)~

/* VICONIA */
REPLACE_STATE_TRIGGER BVICONI %BGTBVICONState0% ~InteractingWith("kivan") GlobalLT("endofbg1","GLOBAL",2) RandomNum(4,1) Global("X#BIOVI1","LOCALS",0)~
REPLACE_STATE_TRIGGER BVICONI %BGTBVICONState8% ~InteractingWith("kivan") GlobalLT("endofbg1","GLOBAL",2) RandomNum(4,2) Global("X#BIOVI2","LOCALS",0)~
REPLACE_STATE_TRIGGER BVICONI %BGTBVICONState9% ~InteractingWith("kivan") GlobalLT("endofbg1","GLOBAL",2) RandomNum(4,3) Global("X#BIOVI3","LOCALS",0)~
REPLACE_STATE_TRIGGER BVICONI %BGTBVICONState10% ~InteractingWith("kivan") GlobalLT("endofbg1","GLOBAL",2) RandomNum(4,4) Global("X#BIOVI4","LOCALS",0)~

ADD_TRANS_ACTION BVICONI BEGIN %BGTBVICONState0% END BEGIN END ~SetGlobal("X#BIOVI1","LOCALS",1)~
ADD_TRANS_ACTION BVICONI BEGIN %BGTBVICONState8% END BEGIN END ~SetGlobal("X#BIOVI2","LOCALS",1)~
ADD_TRANS_ACTION BVICONI BEGIN %BGTBVICONState9% END BEGIN END ~SetGlobal("X#BIOVI3","LOCALS",1)~
ADD_TRANS_ACTION BVICONI BEGIN %BGTBVICONState10% END BEGIN END ~SetGlobal("X#BIOVI4","LOCALS",1)~

/* TIAX */
REPLACE_STATE_TRIGGER BTIAX 6 ~InteractingWith("quayle") GlobalLT("endofbg1","GLOBAL",2) RandomNum(7,1) Global("X#BIOTI1","LOCALS",0)~
REPLACE_STATE_TRIGGER BTIAX 7 ~InteractingWith("quayle") GlobalLT("endofbg1","GLOBAL",2) RandomNum(7,2) Global("X#BIOTI2","LOCALS",0)~
REPLACE_STATE_TRIGGER BTIAX 9 ~InteractingWith("quayle") GlobalLT("endofbg1","GLOBAL",2) RandomNum(7,3) Global("X#BIOTI3","LOCALS",0)~
REPLACE_STATE_TRIGGER BTIAX 14 ~InteractingWith("quayle") GlobalLT("endofbg1","GLOBAL",2) RandomNum(7,4) Global("X#BIOTI4","LOCALS",0)~
REPLACE_STATE_TRIGGER BTIAX 15 ~InteractingWith("quayle") GlobalLT("endofbg1","GLOBAL",2) RandomNum(7,5) Global("X#BIOTI5","LOCALS",0)~
REPLACE_STATE_TRIGGER BTIAX 16 ~InteractingWith("quayle") GlobalLT("endofbg1","GLOBAL",2) RandomNum(7,6) Global("X#BIOTI6","LOCALS",0)~
REPLACE_STATE_TRIGGER BTIAX 17 ~InteractingWith("quayle") GlobalLT("endofbg1","GLOBAL",2) RandomNum(7,7) Global("X#BIOTI7","LOCALS",0)~
REPLACE_STATE_TRIGGER BTIAX 10 ~InteractingWith("branwen") GlobalLT("endofbg1","GLOBAL",2) RandomNum(3,1) Global("X#BIOTI8","LOCALS",0)~
REPLACE_STATE_TRIGGER BTIAX 11 ~InteractingWith("branwen") GlobalLT("endofbg1","GLOBAL",2) RandomNum(3,2) Global("X#BIOTI9","LOCALS",0)~
REPLACE_STATE_TRIGGER BTIAX 12 ~InteractingWith("branwen") GlobalLT("endofbg1","GLOBAL",2) RandomNum(3,3) Global("X#BIOTI10","LOCALS",0)~

ADD_TRANS_ACTION BTIAX BEGIN 6 END BEGIN END ~SetGlobal("X#BIOTI1","LOCALS",1)~
ADD_TRANS_ACTION BTIAX BEGIN 7 END BEGIN END ~SetGlobal("X#BIOTI2","LOCALS",1)~
ADD_TRANS_ACTION BTIAX BEGIN 9 END BEGIN END ~SetGlobal("X#BIOTI3","LOCALS",1)~
ADD_TRANS_ACTION BTIAX BEGIN 14 END BEGIN END ~SetGlobal("X#BIOTI4","LOCALS",1)~
ADD_TRANS_ACTION BTIAX BEGIN 15 END BEGIN END ~SetGlobal("X#BIOTI5","LOCALS",1)~
ADD_TRANS_ACTION BTIAX BEGIN 16 END BEGIN END ~SetGlobal("X#BIOTI6","LOCALS",1)~
ADD_TRANS_ACTION BTIAX BEGIN 17 END BEGIN END ~SetGlobal("X#BIOTI7","LOCALS",1)~
ADD_TRANS_ACTION BTIAX BEGIN 10 END BEGIN END ~SetGlobal("X#BIOTI8","LOCALS",1)~
ADD_TRANS_ACTION BTIAX BEGIN 11 END BEGIN END ~SetGlobal("X#BIOTI9","LOCALS",1)~
ADD_TRANS_ACTION BTIAX BEGIN 12 END BEGIN END ~SetGlobal("X#BIOTI10","LOCALS",1)~

/* SKIE */
REPLACE_STATE_TRIGGER BSKIE 0 ~InteractingWith("eldoth") GlobalLT("endofbg1","GLOBAL",2) RandomNum(4,1) Global("X#BIOSK1","LOCALS",0)~
REPLACE_STATE_TRIGGER BSKIE 1 ~InteractingWith("eldoth") GlobalLT("endofbg1","GLOBAL",2) RandomNum(4,2) Global("X#BIOSK2","LOCALS",0)~
REPLACE_STATE_TRIGGER BSKIE 9 ~InteractingWith("eldoth") GlobalLT("endofbg1","GLOBAL",2) RandomNum(4,3) Global("X#BIOSK3","LOCALS",0)~
REPLACE_STATE_TRIGGER BSKIE 10 ~InteractingWith("eldoth") GlobalLT("endofbg1","GLOBAL",2) RandomNum(4,4) Global("X#BIOSK4","LOCALS",0)~

ADD_TRANS_ACTION BSKIE BEGIN 0 END BEGIN END ~SetGlobal("X#BIOSK1","LOCALS",1)~
ADD_TRANS_ACTION BSKIE BEGIN 1 END BEGIN END ~SetGlobal("X#BIOSK2","LOCALS",1)~
ADD_TRANS_ACTION BSKIE BEGIN 9 END BEGIN END ~SetGlobal("X#BIOSK3","LOCALS",1)~
ADD_TRANS_ACTION BSKIE BEGIN 10 END BEGIN END ~SetGlobal("X#BIOSK4","LOCALS",1)~

/* SHAR-TEEL */
REPLACE_STATE_TRIGGER BSHART 12 ~InteractingWith("eldoth") GlobalLT("endofbg1","GLOBAL",2) RandomNum(4,1) Global("X#BIOSH1","LOCALS",0)~
REPLACE_STATE_TRIGGER BSHART 13 ~InteractingWith("eldoth") GlobalLT("endofbg1","GLOBAL",2) RandomNum(4,2) Global("X#BIOSH2","LOCALS",0)~
REPLACE_STATE_TRIGGER BSHART 14 ~InteractingWith("eldoth") GlobalLT("endofbg1","GLOBAL",2) RandomNum(4,3) Global("X#BIOSH3","LOCALS",0)~
REPLACE_STATE_TRIGGER BSHART 15 ~InteractingWith("eldoth") GlobalLT("endofbg1","GLOBAL",2) RandomNum(4,4) Global("X#BIOSH4","LOCALS",0)~

ADD_TRANS_ACTION BSHART BEGIN 12 END BEGIN END ~SetGlobal("X#BIOSH1","LOCALS",1)~
ADD_TRANS_ACTION BSHART BEGIN 13 END BEGIN END ~SetGlobal("X#BIOSH2","LOCALS",1)~
ADD_TRANS_ACTION BSHART BEGIN 14 END BEGIN END ~SetGlobal("X#BIOSH3","LOCALS",1)~
ADD_TRANS_ACTION BSHART BEGIN 15 END BEGIN END ~SetGlobal("X#BIOSH4","LOCALS",1)~

/* SAFANA NONE */

/* QUAYLE */
REPLACE_STATE_TRIGGER BQUAYL 0 ~InteractingWith("tiax") GlobalLT("endofbg1","GLOBAL",2) RandomNum(4,1) Global("X#BIOQU1","LOCALS",0)~
REPLACE_STATE_TRIGGER BQUAYL 5 ~InteractingWith("tiax") GlobalLT("endofbg1","GLOBAL",2) RandomNum(4,2) Global("X#BIOQU2","LOCALS",0)~
REPLACE_STATE_TRIGGER BQUAYL 6 ~InteractingWith("tiax") GlobalLT("endofbg1","GLOBAL",2) RandomNum(4,3) Global("X#BIOQU3","LOCALS",0)~
REPLACE_STATE_TRIGGER BQUAYL 7 ~InteractingWith("tiax") GlobalLT("endofbg1","GLOBAL",2) RandomNum(4,4) Global("X#BIOQU4","LOCALS",0)~

ADD_TRANS_ACTION BQUAYL BEGIN 0 END BEGIN END ~SetGlobal("X#BIOQU1","LOCALS",1)~
ADD_TRANS_ACTION BQUAYL BEGIN 5 END BEGIN END ~SetGlobal("X#BIOQU2","LOCALS",1)~
ADD_TRANS_ACTION BQUAYL BEGIN 6 END BEGIN END ~SetGlobal("X#BIOQU3","LOCALS",1)~
ADD_TRANS_ACTION BQUAYL BEGIN 7 END BEGIN END ~SetGlobal("X#BIOQU4","LOCALS",1)~

/* MONTARON NONE */

/* MINSC */
REPLACE_STATE_TRIGGER BMINSC %BGTBMINSCState7% ~InteractingWith("dynaheir") GlobalLT("endofbg1","GLOBAL",2) RandomNum(2,1) Global("X#BIOMI1","LOCALS",0)~
REPLACE_STATE_TRIGGER BMINSC %BGTBMINSCState8% ~InteractingWith("dynaheir") GlobalLT("endofbg1","GLOBAL",2) RandomNum(2,2) Global("X#BIOMI2","LOCALS",0)~

ADD_TRANS_ACTION BMINSC BEGIN %BGTBMINSCState7% END BEGIN END ~SetGlobal("X#BIOMI1","LOCALS",1)~
ADD_TRANS_ACTION BMINSC BEGIN %BGTBMINSCState8% END BEGIN END ~SetGlobal("X#BIOMI2","LOCALS",1)~


/* KIVAN */
REPLACE_STATE_TRIGGER BKIVAN 0 ~InteractingWith("viconia") GlobalLT("endofbg1","GLOBAL",2) RandomNum(5,1) Global("X#BIOKI1","LOCALS",0)~
REPLACE_STATE_TRIGGER BKIVAN 1 ~InteractingWith("viconia") GlobalLT("endofbg1","GLOBAL",2) RandomNum(5,2) Global("X#BIOKI2","LOCALS",0)~
REPLACE_STATE_TRIGGER BKIVAN 5 ~InteractingWith("viconia") GlobalLT("endofbg1","GLOBAL",2) RandomNum(5,3) Global("X#BIOKI3","LOCALS",0)~
REPLACE_STATE_TRIGGER BKIVAN 6 ~InteractingWith("viconia") GlobalLT("endofbg1","GLOBAL",2) RandomNum(5,4) Global("X#BIOKI4","LOCALS",0)~
REPLACE_STATE_TRIGGER BKIVAN 7 ~InteractingWith("viconia") GlobalLT("endofbg1","GLOBAL",2) RandomNum(5,5) Global("X#BIOKI5","LOCALS",0)~

ADD_TRANS_ACTION BKIVAN BEGIN 0 END BEGIN END ~SetGlobal("X#BIOKI1","LOCALS",1)~
ADD_TRANS_ACTION BKIVAN BEGIN 1 END BEGIN END ~SetGlobal("X#BIOKI2","LOCALS",1)~
ADD_TRANS_ACTION BKIVAN BEGIN 5 END BEGIN END ~SetGlobal("X#BIOKI3","LOCALS",1)~
ADD_TRANS_ACTION BKIVAN BEGIN 6 END BEGIN END ~SetGlobal("X#BIOKI4","LOCALS",1)~
ADD_TRANS_ACTION BKIVAN BEGIN 7 END BEGIN END ~SetGlobal("X#BIOKI5","LOCALS",1)~


/* KHALID */
ADD_STATE_TRIGGER BKHALI 3 ~Global("X#BIOKH1","LOCALS",0)~
ADD_STATE_TRIGGER BKHALI 8 ~Global("X#BIOKH2","LOCALS",0)~

REPLACE_STATE_TRIGGER BKHALI 9 ~InteractingWith("xzar") GlobalLT("endofbg1","GLOBAL",2) RandomNum(2,2) Global("X#BIOKH3","LOCALS",0)~
REPLACE_STATE_TRIGGER BKHALI 10 ~InteractingWith("montaron") GlobalLT("endofbg1","GLOBAL",2) RandomNum(2,2) Global("X#BIOKH4","LOCALS",0)~

ADD_TRANS_ACTION BKHALI BEGIN 3 END BEGIN END ~SetGlobal("X#BIOKH1","LOCALS",1)~
ADD_TRANS_ACTION BKHALI BEGIN 8 END BEGIN END ~SetGlobal("X#BIOKH2","LOCALS",1)~
ADD_TRANS_ACTION BKHALI BEGIN 9 END BEGIN END ~SetGlobal("X#BIOKH3","LOCALS",1)~
ADD_TRANS_ACTION BKHALI BEGIN 10 END BEGIN END ~SetGlobal("X#BIOKH4","LOCALS",1)~

/* KAGAIN- NONE */

/* JAHEIRA */
ADD_STATE_TRIGGER BJAHEIR %BGTBJAHEIState0% ~Global("X#BIOJA1","LOCALS",0)~
ADD_STATE_TRIGGER BJAHEIR %BGTBJAHEIState3% ~Global("X#BIOJA2","LOCALS",0)~
ADD_STATE_TRIGGER BJAHEIR %BGTBJAHEIState6% ~Global("X#BIOJA4","LOCALS",0)~
ADD_STATE_TRIGGER BJAHEIR %BGTBJAHEIState7% ~Global("X#BIOJA5","LOCALS",0)~

REPLACE_STATE_TRIGGER BJAHEIR %BGTBJAHEIState5% ~InteractingWith("khalid") GlobalLT("endofbg1","GLOBAL",2) RandomNum(3,2) Global("X#BIOJA3","LOCALS",0)~
REPLACE_STATE_TRIGGER BJAHEIR %BGTBJAHEIState8% ~InteractingWith("khalid") GlobalLT("endofbg1","GLOBAL",2) Global("X#BIOJA6","LOCALS",0)~

ADD_TRANS_ACTION BJAHEIR BEGIN %BGTBJAHEIState0% END BEGIN END ~SetGlobal("X#BIOJA1","LOCALS",1)~
ADD_TRANS_ACTION BJAHEIR BEGIN %BGTBJAHEIState3% END BEGIN END ~SetGlobal("X#BIOJA2","LOCALS",1)~
ADD_TRANS_ACTION BJAHEIR BEGIN %BGTBJAHEIState5% END BEGIN END ~SetGlobal("X#BIOJA3","LOCALS",1)~
ADD_TRANS_ACTION BJAHEIR BEGIN %BGTBJAHEIState6% END BEGIN END ~SetGlobal("X#BIOJA4","LOCALS",1)~
ADD_TRANS_ACTION BJAHEIR BEGIN %BGTBJAHEIState7% END BEGIN END ~SetGlobal("X#BIOJA5","LOCALS",1)~
ADD_TRANS_ACTION BJAHEIR BEGIN %BGTBJAHEIState8% END BEGIN END ~SetGlobal("X#BIOJA6","LOCALS",1)~

/* GARRICK */
ADD_STATE_TRIGGER BGARRI 0 ~Global("X#BIOGA1","LOCALS",0)~
ADD_STATE_TRIGGER BGARRI 1 ~Global("X#BIOGA2","LOCALS",0)~
ADD_STATE_TRIGGER BGARRI 4 ~Global("X#BIOGA3","LOCALS",0)~
ADD_STATE_TRIGGER BGARRI 5 ~Global("X#BIOGA4","LOCALS",0)~
ADD_STATE_TRIGGER BGARRI 6 ~Global("X#BIOGA5","LOCALS",0)~
ADD_STATE_TRIGGER BGARRI 7 ~Global("X#BIOGA6","LOCALS",0)~

ADD_TRANS_ACTION BGARRI BEGIN 0 END BEGIN END ~SetGlobal("X#BIOGA1","LOCALS",1)~
ADD_TRANS_ACTION BGARRI BEGIN 1 END BEGIN END ~SetGlobal("X#BIOGA2","LOCALS",1)~
ADD_TRANS_ACTION BGARRI BEGIN 4 END BEGIN END ~SetGlobal("X#BIOGA3","LOCALS",1)~
ADD_TRANS_ACTION BGARRI BEGIN 5 END BEGIN END ~SetGlobal("X#BIOGA4","LOCALS",1)~
ADD_TRANS_ACTION BGARRI BEGIN 6 END BEGIN END ~SetGlobal("X#BIOGA5","LOCALS",1)~
ADD_TRANS_ACTION BGARRI BEGIN 7 END BEGIN END ~SetGlobal("X#BIOGA6","LOCALS",1)~

/* FALDORN */
ADD_STATE_TRIGGER BFALDO 0 ~Global("X#BIOFA1","LOCALS",0)~
ADD_STATE_TRIGGER BFALDO 1 ~Global("X#BIOFA2","LOCALS",0)~
ADD_STATE_TRIGGER BFALDO 2 ~Global("X#BIOFA3","LOCALS",0)~
ADD_STATE_TRIGGER BFALDO 3 ~Global("X#BIOFA4","LOCALS",0)~

ADD_TRANS_ACTION BFALDO BEGIN 0 END BEGIN END ~SetGlobal("X#BIOFA1","LOCALS",1)~
ADD_TRANS_ACTION BFALDO BEGIN 1 END BEGIN END ~SetGlobal("X#BIOFA2","LOCALS",1)~
ADD_TRANS_ACTION BFALDO BEGIN 2 END BEGIN END ~SetGlobal("X#BIOFA3","LOCALS",1)~
ADD_TRANS_ACTION BFALDO BEGIN 3 END BEGIN END ~SetGlobal("X#BIOFA4","LOCALS",1)~

/* ELDOTH */
REPLACE_STATE_TRIGGER BELDOT 17 ~InteractingWith("sharteel") GlobalLT("endofbg1","GLOBAL",2) RandomNum(4,1) Global("X#BIOEL1","LOCALS",0)~
REPLACE_STATE_TRIGGER BELDOT 18 ~InteractingWith("sharteel") GlobalLT("endofbg1","GLOBAL",2) RandomNum(4,2) Global("X#BIOEL2","LOCALS",0)~
REPLACE_STATE_TRIGGER BELDOT 19 ~InteractingWith("sharteel") GlobalLT("endofbg1","GLOBAL",2) RandomNum(4,3) Global("X#BIOEL3","LOCALS",0)~
REPLACE_STATE_TRIGGER BELDOT 20 ~InteractingWith("sharteel") GlobalLT("endofbg1","GLOBAL",2) RandomNum(4,4) Global("X#BIOEL4","LOCALS",0)~
REPLACE_STATE_TRIGGER BELDOT 21 ~InteractingWith("xan") GlobalLT("endofbg1","GLOBAL",2) RandomNum(2,1) Global("X#BIOEL5","LOCALS",0)~
REPLACE_STATE_TRIGGER BELDOT 22 ~InteractingWith("xan") GlobalLT("endofbg1","GLOBAL",2) RandomNum(2,2) Global("X#BIOEL6","LOCALS",0)~

ADD_TRANS_ACTION BELDOT BEGIN 17 END BEGIN END ~SetGlobal("X#BIOEL1","LOCALS",1)~
ADD_TRANS_ACTION BELDOT BEGIN 18 END BEGIN END ~SetGlobal("X#BIOEL2","LOCALS",1)~
ADD_TRANS_ACTION BELDOT BEGIN 19 END BEGIN END ~SetGlobal("X#BIOEL3","LOCALS",1)~
ADD_TRANS_ACTION BELDOT BEGIN 20 END BEGIN END ~SetGlobal("X#BIOEL4","LOCALS",1)~
ADD_TRANS_ACTION BELDOT BEGIN 21 END BEGIN END ~SetGlobal("X#BIOEL5","LOCALS",1)~
ADD_TRANS_ACTION BELDOT BEGIN 22 END BEGIN END ~SetGlobal("X#BIOEL6","LOCALS",1)~

/* EDWIN */
ADD_STATE_TRIGGER BEDWIN %BGTBEDWINState3% ~Global("X#BIOED1","LOCALS",0)~
ADD_STATE_TRIGGER BEDWIN %BGTBEDWINState14% ~Global("X#BIOED2","LOCALS",0)~

ADD_TRANS_ACTION BEDWIN BEGIN %BGTBEDWINState3% END BEGIN END ~SetGlobal("X#BIOED1","LOCALS",1)~
ADD_TRANS_ACTION BEDWIN BEGIN %BGTBEDWINState14% END BEGIN END ~SetGlobal("X#BIOED2","LOCALS",1)~

/* DYNAHEIR */
ADD_STATE_TRIGGER BDYNA 0 ~Global("X#BIODY1","LOCALS",0)~
ADD_STATE_TRIGGER BDYNA 5 ~Global("X#BIODY2","LOCALS",0)~
ADD_STATE_TRIGGER BDYNA 6 ~Global("X#BIODY3","LOCALS",0)~
ADD_STATE_TRIGGER BDYNA 7 ~Global("X#BIODY4","LOCALS",0)~
ADD_STATE_TRIGGER BDYNA 12 ~Global("X#BIODY5","LOCALS",0)~
ADD_STATE_TRIGGER BDYNA 15 ~Global("X#BIODY6","LOCALS",0)~
ADD_STATE_TRIGGER BDYNA 16 ~Global("X#BIODY7","LOCALS",0)~

ADD_TRANS_ACTION BDYNA BEGIN 0 END BEGIN END ~SetGlobal("X#BIODY1","LOCALS",1)~
ADD_TRANS_ACTION BDYNA BEGIN 5 END BEGIN END ~SetGlobal("X#BIODY2","LOCALS",1)~
ADD_TRANS_ACTION BDYNA BEGIN 6 END BEGIN END ~SetGlobal("X#BIODY3","LOCALS",1)~
ADD_TRANS_ACTION BDYNA BEGIN 7 END BEGIN END ~SetGlobal("X#BIODY4","LOCALS",1)~
ADD_TRANS_ACTION BDYNA BEGIN 12 END BEGIN END ~SetGlobal("X#BIODY5","LOCALS",1)~
ADD_TRANS_ACTION BDYNA BEGIN 15 END BEGIN END ~SetGlobal("X#BIODY6","LOCALS",1)~
ADD_TRANS_ACTION BDYNA BEGIN 16 END BEGIN END ~SetGlobal("X#BIODY7","LOCALS",1)~

/* CORAN */
REPLACE_STATE_TRIGGER BCORAN %BGTBCORANState0% ~InteractingWith("safana") GlobalLT("endofbg1","GLOBAL",2) RandomNum(9,1) Global("X#BIOCO1","LOCALS",0)~
REPLACE_STATE_TRIGGER BCORAN %BGTBCORANState1% ~InteractingWith("safana") GlobalLT("endofbg1","GLOBAL",2) RandomNum(9,2) Global("X#BIOCO2","LOCALS",0)~
REPLACE_STATE_TRIGGER BCORAN %BGTBCORANState2% ~InteractingWith("safana") GlobalLT("endofbg1","GLOBAL",2) RandomNum(9,3) Global("X#BIOCO3","LOCALS",0)~
REPLACE_STATE_TRIGGER BCORAN %BGTBCORANState3% ~InteractingWith("safana") GlobalLT("endofbg1","GLOBAL",2) RandomNum(9,4) Global("X#BIOCO4","LOCALS",0)~
REPLACE_STATE_TRIGGER BCORAN %BGTBCORANState4% ~InteractingWith("safana") GlobalLT("endofbg1","GLOBAL",2) RandomNum(9,5) Global("X#BIOCO5","LOCALS",0)~
REPLACE_STATE_TRIGGER BCORAN %BGTBCORANState5% ~InteractingWith("safana") GlobalLT("endofbg1","GLOBAL",2) RandomNum(9,6) Global("X#BIOCO6","LOCALS",0)~
REPLACE_STATE_TRIGGER BCORAN %BGTBCORANState6% ~InteractingWith("safana") GlobalLT("endofbg1","GLOBAL",2) RandomNum(9,7) Global("X#BIOCO7","LOCALS",0)~
REPLACE_STATE_TRIGGER BCORAN %BGTBCORANState7% ~InteractingWith("safana") GlobalLT("endofbg1","GLOBAL",2) RandomNum(9,8) Global("X#BIOCO8","LOCALS",0)~
REPLACE_STATE_TRIGGER BCORAN %BGTBCORANState8% ~InteractingWith("safana") GlobalLT("endofbg1","GLOBAL",2) RandomNum(9,9) Global("X#BIOCO9","LOCALS",0)~

ADD_TRANS_ACTION BCORAN BEGIN %BGTBCORANState0% END BEGIN END ~SetGlobal("X#BIOCO1","LOCALS",1)~
ADD_TRANS_ACTION BCORAN BEGIN %BGTBCORANState1% END BEGIN END ~SetGlobal("X#BIOCO2","LOCALS",1)~
ADD_TRANS_ACTION BCORAN BEGIN %BGTBCORANState2% END BEGIN END ~SetGlobal("X#BIOCO3","LOCALS",1)~
ADD_TRANS_ACTION BCORAN BEGIN %BGTBCORANState3% END BEGIN END ~SetGlobal("X#BIOCO4","LOCALS",1)~
ADD_TRANS_ACTION BCORAN BEGIN %BGTBCORANState4% END BEGIN END ~SetGlobal("X#BIOCO5","LOCALS",1)~
ADD_TRANS_ACTION BCORAN BEGIN %BGTBCORANState5% END BEGIN END ~SetGlobal("X#BIOCO6","LOCALS",1)~
ADD_TRANS_ACTION BCORAN BEGIN %BGTBCORANState6% END BEGIN END ~SetGlobal("X#BIOCO7","LOCALS",1)~
ADD_TRANS_ACTION BCORAN BEGIN %BGTBCORANState7% END BEGIN END ~SetGlobal("X#BIOCO8","LOCALS",1)~
ADD_TRANS_ACTION BCORAN BEGIN %BGTBCORANState8% END BEGIN END ~SetGlobal("X#BIOCO9","LOCALS",1)~

/* BRANWEN */
REPLACE_STATE_TRIGGER BBRANW 2 ~InteractingWith("tiax") GlobalLT("endofbg1","GLOBAL",2) RandomNum(2,1) Global("X#BIOBR3","LOCALS",0)~

ADD_STATE_TRIGGER BBRANW 0 ~Global("X#BIOBR1","LOCALS",0)~
ADD_STATE_TRIGGER BBRANW 1 ~Global("X#BIOBR2","LOCALS",0)~

ADD_TRANS_ACTION BBRANW BEGIN 0 END BEGIN END ~SetGlobal("X#BIOBR1","LOCALS",1)~
ADD_TRANS_ACTION BBRANW BEGIN 1 END BEGIN END ~SetGlobal("X#BIOBR2","LOCALS",1)~
ADD_TRANS_ACTION BBRANW BEGIN 2 END BEGIN END ~SetGlobal("X#BIOBR3","LOCALS",1)~

/* AJANTIS */
ADD_STATE_TRIGGER BAJANT 0 ~Global("X#BIOAJ1","LOCALS",0)~
ADD_STATE_TRIGGER BAJANT 1 ~Global("X#BIOAJ2","LOCALS",0)~
ADD_STATE_TRIGGER BAJANT 2 ~Global("X#BIOAJ3","LOCALS",0)~
ADD_STATE_TRIGGER BAJANT 3 ~Global("X#BIOAJ4","LOCALS",0)~
ADD_STATE_TRIGGER BAJANT 4 ~Global("X#BIOAJ5","LOCALS",0)~

ADD_TRANS_ACTION BAJANT BEGIN 0 END BEGIN END ~SetGlobal("X#BIOAJ1","LOCALS",1)~
ADD_TRANS_ACTION BAJANT BEGIN 1 END BEGIN END ~SetGlobal("X#BIOAJ2","LOCALS",1)~
ADD_TRANS_ACTION BAJANT BEGIN 2 END BEGIN END ~SetGlobal("X#BIOAJ3","LOCALS",1)~
ADD_TRANS_ACTION BAJANT BEGIN 3 END BEGIN END ~SetGlobal("X#BIOAJ4","LOCALS",1)~
ADD_TRANS_ACTION BAJANT BEGIN 4 END BEGIN END ~SetGlobal("X#BIOAJ5","LOCALS",1)~

/* ALORA */
ADD_STATE_TRIGGER BALORA 0 ~Global("X#BIOAL1","LOCALS",0)~
ADD_STATE_TRIGGER BALORA 1 ~Global("X#BIOAL2","LOCALS",0)~
ADD_STATE_TRIGGER BALORA 3 ~Global("X#BIOAL3","LOCALS",0)~
ADD_STATE_TRIGGER BALORA 4 ~Global("X#BIOAL4","LOCALS",0)~

ADD_TRANS_ACTION BALORA BEGIN 0 END BEGIN END ~SetGlobal("X#BIOAL1","LOCALS",1)~
ADD_TRANS_ACTION BALORA BEGIN 1 END BEGIN END ~SetGlobal("X#BIOAL2","LOCALS",1)~
ADD_TRANS_ACTION BALORA BEGIN 3 END BEGIN END ~SetGlobal("X#BIOAL3","LOCALS",1)~
ADD_TRANS_ACTION BALORA BEGIN 4 END BEGIN END ~SetGlobal("X#BIOAL4","LOCALS",1)~

/* Patching "unhappiness" P-file entries  is unneeded in BGT : code removed */