#include <define.h>

//#define NAME                    SCRIPT_

#include <command.h>
//#include <ModReact.h>



procedure start;
#include <push.h>
procedure combat;
procedure critter_p_proc;
procedure pickup_p_proc;
procedure talk_p_proc;
procedure destroy_p_proc;
procedure damage_p_proc;
procedure look_at_p_proc;
procedure Butch00a;
procedure Butch00;
procedure Butch01;
procedure Butch02;
procedure Butch03;
procedure Butch04;
procedure Butch05;
procedure Butch06;
procedure Butch08;
procedure Butch09;
procedure Butch10;
procedure Butch11;
procedure Butch12;
procedure Butch12a;
procedure Butch13;
procedure Butch13a;
procedure Butch14;
procedure Butch15;
procedure Butch16;
procedure Butch17;
procedure Butch18;
procedure Butch19;
procedure Butch19a;
procedure Butch20;
procedure Butch21;
procedure Butch22;
procedure Butch23;
procedure Butch23a;
procedure Butch24;
procedure Butch25;
procedure Butch26;
procedure Butch27;
procedure Butch27a;
procedure Butch28;
procedure Butch29;
procedure Butch30;
procedure Butch30a;
procedure Butch31;
procedure Butch32;
procedure Butch33;
procedure Butch34;
procedure Butch35;
procedure Butch35a;
procedure Butch36;
procedure Butch37;
procedure Butch38;
procedure Butch39;
procedure Butch40;
procedure Butch41;
procedure Butch42;
procedure Butch43;
procedure Butch44;
procedure Butch45;
procedure Butch46;
procedure Butch47;
procedure Butch49;
procedure Butch50;
procedure Butch51;
procedure Butch51a;
procedure Butch52;
procedure Butch53;
procedure Butch53a;
procedure Butch54;
procedure Butch54a;
procedure Butch55;
procedure Butch56;
procedure Butch57;
procedure Butch58;
procedure Butch59;
procedure Butch60;
procedure Butch61;
procedure Butch62;
procedure Butch63;
procedure Butch64;
procedure Butch65;
procedure Butch66;
procedure Butch67;
procedure Butch68;
procedure Butch69;
procedure Butch70;
procedure Butch71;
procedure Butch72;
procedure Butch73;
procedure ButchX2;
procedure ButchX3;
procedure ButchEnd;
procedure ButchEndAccept;
procedure ButchEndTransport;

variable hostile1;
variable Only_Once := 1;
variable TossOut;

procedure Get_Reaction;
procedure React_To_Level;
procedure Level_To_React;
procedure Up_React;
procedure Down_React;
procedure Bottom_React;
procedure Top_React;
procedure Big_Up_React;
procedure Big_Down_React;
procedure Up_React_Level;
procedure Down_React_Level;
procedure Goodbyes;

variable exit_line;


procedure start
begin
if (Only_Once) then begin
    Only_Once := 0;
    critter_add_trait(self_obj, TRAIT_OBJECT, OBJECT_TEAM_NUM, 36);
    critter_add_trait(self_obj, TRAIT_OBJECT, OBJECT_AI_PACKET, AI_MERCHANT);
  end
  if (script_action == look_at_proc) then begin
    call look_at_p_proc;
  end
  else begin
    if (script_action == pickup_proc) then begin
      call pickup_p_proc;
    end
    else begin
      if (script_action == talk_proc) then begin
        call talk_p_proc;
      end
      else begin
        if (script_action == critter_proc) then begin
          call critter_p_proc;
        end
        else begin
          if (script_action == destroy_proc) then begin
            call destroy_p_proc;
          end
        end
      end
    end
  end
end

procedure combat
begin
  hostile1 := 1;
end

procedure critter_p_proc
begin
  if (hostile1) then begin
    hostile1 := 0;
    attack_complex(dude_obj, 0, 1, 0, 0, 30000, 0, 0);
  end
end

procedure pickup_p_proc
begin
  if (source_obj == dude_obj) then begin
    hostile1 := 1;
  end
end

procedure talk_p_proc
begin
  call Get_Reaction;
  if (map_var(40) == 1) then begin
    float_msg(self_obj, message_str(SCRIPT_BUTCH, 328), FLOAT_MSG_RED);
  end
  else begin
    if (map_var(41) == 2) then begin
      float_msg(self_obj, message_str(SCRIPT_BUTCH, 325), FLOAT_MSG_RED);
    end
    else begin
      if (get_critter_stat(dude_obj, 4) < 4) then begin
        float_msg(dude_obj, message_str(SCRIPT_BUTCH, 330), FLOAT_MSG_GREEN);
        float_msg(self_obj, message_str(SCRIPT_BUTCH, 331), FLOAT_MSG_RED);
      end
      else begin
        if ((local_var(4) == 0) and (map_var(34) == 1)) then begin
          set_local_var(4, 1);
          start_gdialog(SCRIPT_BUTCH, self_obj, 4, HEAD_BUTCH, BACKGROUND_HUB);
          gsay_start;
          call Butch01;
          gsay_end;
          end_dialogue;
        end
        else begin
          if ((local_var(4) == 0) and (map_var(34) == 0)) then begin
            float_msg(self_obj, message_str(SCRIPT_BUTCH, 324), FLOAT_MSG_RED);
          end
          else begin
            if (map_var(41) == 3) then begin
              start_gdialog(SCRIPT_BUTCH, self_obj, 4, HEAD_BUTCH, BACKGROUND_HUB);
              gsay_start;
              call Butch73;
              gsay_end;
              end_dialogue;
            end
            else begin
              if ((local_var(5) == 1) or (map_var(41) == 4)) then begin
                start_gdialog(SCRIPT_BUTCH, self_obj, 4, HEAD_BUTCH, BACKGROUND_HUB);
                gsay_start;
                call Butch60;
                gsay_end;
                end_dialogue;
              end
              else begin
                if (map_var(56) == 1) then begin
                  start_gdialog(SCRIPT_BUTCH, self_obj, 4, HEAD_BUTCH, BACKGROUND_HUB);
                  gsay_start;
                  call Butch59;
                  gsay_end;
                  end_dialogue;
                end
                else begin
                  if (global_var(GVAR_HUB_FILLER_29) == 5) then begin
                    start_gdialog(SCRIPT_BUTCH, self_obj, 4, HEAD_BUTCH, BACKGROUND_HUB);
                    gsay_start;
                    call Butch37;
                    gsay_end;
                    end_dialogue;
                  end
                  else begin
                    start_gdialog(SCRIPT_BUTCH, self_obj, 4, HEAD_BUTCH, BACKGROUND_HUB);
                    gsay_start;
                    call Butch01;
                    gsay_end;
                    end_dialogue;
                  end
                end
              end
            end
          end
        end
      end
    end
  end
  if (TossOut == 1) then begin
    TossOut := 0;
    call ButchEndTransport;
  end
end

procedure destroy_p_proc
begin
  if (source_obj == dude_obj) then begin
    if (((global_var(GVAR_BAD_MONSTER) + global_var(GVAR_GOOD_MONSTER)) >= 25) and ((global_var(GVAR_GOOD_MONSTER) > (2 * global_var(GVAR_BAD_MONSTER))) or (global_var(GVAR_BERSERKER_REPUTATION) == 1))) then begin
      set_global_var(GVAR_BERSERKER_REPUTATION, 1);
      set_global_var(GVAR_CHAMPION_REPUTATION, 0);
    end
    if (((global_var(GVAR_BAD_MONSTER) + global_var(GVAR_GOOD_MONSTER)) >= 25) and ((global_var(GVAR_BAD_MONSTER) > (3 * global_var(GVAR_GOOD_MONSTER))) or (global_var(GVAR_CHAMPION_REPUTATION) == 1))) then begin
      set_global_var(GVAR_CHAMPION_REPUTATION, 1);
      set_global_var(GVAR_BERSERKER_REPUTATION, 0);
    end
    set_global_var(GVAR_GOOD_MONSTER, global_var(GVAR_GOOD_MONSTER) + 1);
    if ((global_var(GVAR_GOOD_MONSTER) % 2) == 0) then begin
      set_global_var(GVAR_PLAYER_REPUTATION, global_var(GVAR_PLAYER_REPUTATION) - 1);
    end
  end
end

procedure damage_p_proc
begin
  variable LVar0 := 0;
  LVar0 := obj_pid(source_obj);
  if (party_member_obj(LVar0) != 0) then begin
    set_global_var(GVAR_ENEMY_HUB, 1);
  end
end

procedure look_at_p_proc
begin
  script_overrides;
  display_msg(message_str(SCRIPT_BUTCH, 100));
end

procedure Butch00a
begin
  if (local_var(1) >= 2) then begin
    call Butch34;
  end
  else begin
    call Butch36;
  end
end

procedure Butch00
begin
  giq_option(4, SCRIPT_BUTCH, 101, Butch23, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 102, Butch10, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 103, Butch00a, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 104, Butch27, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 105, ButchEnd, NEUTRAL_REACTION);
end

procedure Butch01
begin
  gsay_reply(SCRIPT_BUTCH, 106);
  giq_option(4, SCRIPT_BUTCH, 107, Butch02, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 108, ButchEnd, NEUTRAL_REACTION);
end

procedure Butch02
begin
  gsay_reply(SCRIPT_BUTCH, 109);
  giq_option(4, SCRIPT_BUTCH, 110, Butch03, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 111, Butch08, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 112, Butch08, NEUTRAL_REACTION);
end

procedure Butch03
begin
  call Up_React_Level;
  gsay_reply(SCRIPT_BUTCH, 113);
  giq_option(4, SCRIPT_BUTCH, 114, Butch04, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 115, ButchEndAccept, NEUTRAL_REACTION);
end

procedure Butch04
begin
  gsay_reply(SCRIPT_BUTCH, 116);
  giq_option(4, SCRIPT_BUTCH, 117, Butch05, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 118, Butch08, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 119, ButchEndAccept, NEUTRAL_REACTION);
end

procedure Butch05
begin
  gsay_reply(SCRIPT_BUTCH, 120);
  giq_option(4, SCRIPT_BUTCH, 121, Butch06, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 122, ButchEndAccept, NEUTRAL_REACTION);
end

procedure Butch06
begin
  gsay_reply(SCRIPT_BUTCH, message_str(SCRIPT_BUTCH, 123) + message_str(SCRIPT_BUTCH, 124));
  giq_option(4, SCRIPT_BUTCH, 125, Butch08, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 127, Butch05, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 128, Butch21, BAD_REACTION);
  giq_option(4, SCRIPT_BUTCH, 129, Butch11, NEUTRAL_REACTION);
end

procedure Butch08
begin
  gsay_reply(SCRIPT_BUTCH, 133);
  giq_option(4, SCRIPT_BUTCH, 134, Butch09, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 135, Butch19, BAD_REACTION);
end

procedure Butch09
begin
  gsay_reply(SCRIPT_BUTCH, 136);
  giq_option(4, SCRIPT_BUTCH, 137, Butch12, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 138, Butch16, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 139, Butch18, NEUTRAL_REACTION);
end

procedure Butch10
begin
  gsay_reply(SCRIPT_BUTCH, 140);
  giq_option(4, SCRIPT_BUTCH, 141, Butch12, NEUTRAL_REACTION);
end

procedure Butch11
begin
  gsay_message(SCRIPT_BUTCH, 142, NEUTRAL_REACTION);
end

procedure Butch12
begin
  gsay_reply(SCRIPT_BUTCH, 143);
  giq_option(4, SCRIPT_BUTCH, 144, Butch12a, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 145, ButchEndAccept, NEUTRAL_REACTION);
end

procedure Butch12a
begin
  call Butch13;
end

procedure Butch13
begin
  set_map_var(8, 1);
  set_global_var(GVAR_HUB_FILLER_29, 1);
  gsay_reply(SCRIPT_BUTCH, 146);
  giq_option(4, SCRIPT_BUTCH, 147, Butch14, BAD_REACTION);
  giq_option(4, SCRIPT_BUTCH, 148, Butch17, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 149, Butch13a, NEUTRAL_REACTION);
end

procedure Butch13a
begin
  set_map_var(33, 1);
  gsay_reply(SCRIPT_BUTCH, 150);
  giq_option(4, SCRIPT_BUTCH, 151, Butch15, BAD_REACTION);
  giq_option(4, SCRIPT_BUTCH, 152, Butch16, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 153, Butch17, NEUTRAL_REACTION);
end

procedure Butch14
begin
  call Down_React_Level;
  set_map_var(33, 1);
  gsay_reply(SCRIPT_BUTCH, 154);
  giq_option(4, SCRIPT_BUTCH, 155, Butch15, BAD_REACTION);
  giq_option(4, SCRIPT_BUTCH, 156, Butch16, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 157, Butch17, NEUTRAL_REACTION);
end

procedure Butch15
begin
  set_map_var(40, 1);
  set_map_var(35, 1);
  set_map_var(10, 0);
  TossOut := 1;
  gsay_message(SCRIPT_BUTCH, 158, NEUTRAL_REACTION);
end

procedure Butch16
begin
  set_map_var(41, 1);
  set_global_var(GVAR_MISSING_CARAVAN, 1);
  set_map_var(10, 1);
  gsay_message(SCRIPT_BUTCH, 159, NEUTRAL_REACTION);
  call ButchX3;
end

procedure Butch17
begin
  gsay_reply(SCRIPT_BUTCH, 160);
  call Butch00;
end

procedure Butch18
begin
  set_map_var(41, 2);
  set_global_var(GVAR_MISSING_CARAVAN, 0);
  gsay_message(SCRIPT_BUTCH, 161, NEUTRAL_REACTION);
end

procedure Butch19
begin
  gsay_reply(SCRIPT_BUTCH, 162);
  giq_option(4, SCRIPT_BUTCH, 163, Butch15, BAD_REACTION);
  giq_option(4, SCRIPT_BUTCH, 164, Butch19a, NEUTRAL_REACTION);
end

procedure Butch19a
begin
  if (is_success(roll_vs_skill(dude_obj, 14, 0))) then begin
    call Butch09;
  end
  else begin
    call Butch20;
  end
end

procedure Butch20
begin
  call Down_React_Level;
  gsay_reply(SCRIPT_BUTCH, 165);
  giq_option(4, SCRIPT_BUTCH, 166, Butch16, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 167, Butch18, NEUTRAL_REACTION);
end

procedure Butch21
begin
  call Down_React_Level;
  gsay_reply(SCRIPT_BUTCH, 168);
  giq_option(4, SCRIPT_BUTCH, 169, Butch15, BAD_REACTION);
  giq_option(4, SCRIPT_BUTCH, 170, Butch08, NEUTRAL_REACTION);
end

procedure Butch22
begin
  gsay_message(SCRIPT_BUTCH, 171, NEUTRAL_REACTION);
end

procedure Butch23
begin
  gsay_reply(SCRIPT_BUTCH, 172);
  giq_option(4, SCRIPT_BUTCH, 173, Butch23a, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 174, Butch23a, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 175, Butch17, NEUTRAL_REACTION);
end

procedure Butch23a
begin
  variable LVar0 := 0;
  if (dude_is_male) then begin
    LVar0 := 0;
  end
  else begin
    LVar0 := 20;
  end
  if (is_success(roll_vs_skill(dude_obj, 14, LVar0))) then begin
    call Butch24;
  end
  else begin
    call Butch26;
  end
end

procedure Butch24
begin
  gsay_reply(SCRIPT_BUTCH, 176);
  giq_option(4, SCRIPT_BUTCH, 177, Butch25, NEUTRAL_REACTION);
  call Butch00;
end

procedure Butch25
begin
  gsay_message(SCRIPT_BUTCH, 179, NEUTRAL_REACTION);
  call Butch00;
end

procedure Butch26
begin
  gsay_reply(SCRIPT_BUTCH, 180);
  giq_option(4, SCRIPT_BUTCH, 181, Butch24, NEUTRAL_REACTION);
  call Butch00;
end

procedure Butch27
begin
  gsay_reply(SCRIPT_BUTCH, 183);
  giq_option(4, SCRIPT_BUTCH, 184, Butch28, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 185, Butch27a, NEUTRAL_REACTION);
end

procedure Butch27a
begin
  if (local_var(1) >= 2) then begin
    call Butch29;
  end
  else begin
    call Butch30;
  end
end

procedure Butch28
begin
  gsay_reply(SCRIPT_BUTCH, 186);
  call Butch00;
end

procedure Butch29
begin
  gsay_reply(SCRIPT_BUTCH, 187);
  giq_option(4, SCRIPT_BUTCH, 188, Butch32, NEUTRAL_REACTION);
  call Butch00;
end

procedure Butch30
begin
  gsay_reply(SCRIPT_BUTCH, 190);
  giq_option(4, SCRIPT_BUTCH, 191, Butch30a, BAD_REACTION);
  call Butch00;
end

procedure Butch30a
begin
  if (local_var(1) >= 2) then begin
    call Down_React_Level;
    call Butch31;
  end
  else begin
    call Butch15;
  end
end

procedure Butch31
begin
  gsay_reply(SCRIPT_BUTCH, 193);
  giq_option(4, SCRIPT_BUTCH, 194, Butch15, BAD_REACTION);
  giq_option(4, SCRIPT_BUTCH, 195, Butch17, NEUTRAL_REACTION);
end

procedure Butch32
begin
  gsay_reply(SCRIPT_BUTCH, 196);
  call Butch00;
end

procedure Butch33
begin
  gsay_reply(SCRIPT_BUTCH, 199);
  call Butch00;
end

procedure Butch34
begin
  if (global_var(GVAR_JUNKTOWN) == 0) then begin
    set_global_var(GVAR_JUNKTOWN, 1);
  end
  if (global_var(GVAR_BROTHERHOOD_OF_STEEL) == 0) then begin
    set_global_var(GVAR_BROTHERHOOD_OF_STEEL, 1);
  end
  if (global_var(GVAR_ANGELS_BONEYARD) == 0) then begin
    set_global_var(GVAR_ANGELS_BONEYARD, 1);
  end
  gsay_reply(SCRIPT_BUTCH, 201);
  giq_option(4, SCRIPT_BUTCH, 202, Butch35, NEUTRAL_REACTION);
  call Butch00;
end

procedure Butch35
begin
  if (global_var(GVAR_NECROPOLIS) == 0) then begin
    set_global_var(GVAR_NECROPOLIS, 1);
  end
  gsay_reply(SCRIPT_BUTCH, 204);
  giq_option(4, SCRIPT_BUTCH, 205, Butch35a, NEUTRAL_REACTION);
end

procedure Butch35a
begin
  gsay_reply(SCRIPT_BUTCH, 206);
  call Butch00;
end

procedure Butch36
begin
  gsay_reply(SCRIPT_BUTCH, 208);
  giq_option(4, SCRIPT_BUTCH, 209, Butch30a, BAD_REACTION);
  call Butch00;
end

procedure Butch37
begin
  gsay_reply(SCRIPT_BUTCH, 211);
  if ((global_var(GVAR_THE_VATS) == 2) or (obj_is_carrying_obj_pid(dude_obj, 196) >= 1)) then begin
    giq_option(4, SCRIPT_BUTCH, 212, Butch38, NEUTRAL_REACTION);
  end
  else begin
    if (global_var(GVAR_HUB_FILLER_29) == 5) then begin
      giq_option(4, SCRIPT_BUTCH, 213, Butch53, NEUTRAL_REACTION);
    end
  end
  giq_option(4, SCRIPT_BUTCH, 214, ButchEnd, NEUTRAL_REACTION);
end

procedure Butch38
begin
  gsay_reply(SCRIPT_BUTCH, 215);
  giq_option(4, SCRIPT_BUTCH, 216, Butch39, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 217, Butch51, NEUTRAL_REACTION);
end

procedure Butch39
begin
  set_map_var(42, 2);
  gsay_reply(SCRIPT_BUTCH, 218);
  giq_option(4, SCRIPT_BUTCH, 219, Butch40, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 220, Butch46, NEUTRAL_REACTION);
end

procedure Butch40
begin
  gsay_reply(SCRIPT_BUTCH, 221);
  giq_option(4, SCRIPT_BUTCH, 222, Butch41, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 223, Butch46, NEUTRAL_REACTION);
end

procedure Butch41
begin
  gsay_reply(SCRIPT_BUTCH, 224);
  giq_option(4, SCRIPT_BUTCH, 225, Butch42, NEUTRAL_REACTION);
  if (global_var(GVAR_THE_VATS) == 2) then begin
    giq_option(4, SCRIPT_BUTCH, 226, Butch34, NEUTRAL_REACTION);
  end
end

procedure Butch42
begin
  set_map_var(41, 3);
  set_global_var(GVAR_MISSING_CARAVAN, 2);
  gsay_message(SCRIPT_BUTCH, 227, NEUTRAL_REACTION);
  call ButchX2;
end

procedure Butch43
begin
  gsay_reply(SCRIPT_BUTCH, 228);
  giq_option(4, SCRIPT_BUTCH, 229, Butch44, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 230, Butch45, NEUTRAL_REACTION);
end

procedure Butch44
begin
  set_map_var(41, 3);
  set_global_var(GVAR_MISSING_CARAVAN, 2);
  gsay_message(SCRIPT_BUTCH, 231, NEUTRAL_REACTION);
  call ButchX2;
end

procedure Butch45
begin
  set_map_var(41, 3);
  set_global_var(GVAR_MISSING_CARAVAN, 2);
  gsay_message(SCRIPT_BUTCH, 232, NEUTRAL_REACTION);
  call ButchX2;
end

procedure Butch46
begin
  gsay_reply(SCRIPT_BUTCH, 233);
  giq_option(4, SCRIPT_BUTCH, 234, Butch42, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 235, Butch47, NEUTRAL_REACTION);
end

procedure Butch47
begin
  set_map_var(41, 3);
  set_global_var(GVAR_MISSING_CARAVAN, 2);
  gsay_message(SCRIPT_BUTCH, 236, NEUTRAL_REACTION);
  call ButchX2;
end

procedure Butch49
begin
  gsay_message(SCRIPT_BUTCH, 241, NEUTRAL_REACTION);
  call ButchX3;
end

procedure Butch50
begin
  gsay_reply(SCRIPT_BUTCH, 242);
  giq_option(4, SCRIPT_BUTCH, 243, Butch39, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 244, Butch49, NEUTRAL_REACTION);
end

procedure Butch51
begin
  gsay_reply(SCRIPT_BUTCH, 245);
  giq_option(4, SCRIPT_BUTCH, 246, Butch51a, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 247, Butch50, NEUTRAL_REACTION);
end

procedure Butch51a
begin
  if (is_success(roll_vs_skill(dude_obj, 14, 0))) then begin
    call Butch52;
  end
  else begin
    call Butch49;
  end
end

procedure Butch52
begin
  set_map_var(41, 3);
  set_global_var(GVAR_MISSING_CARAVAN, 2);
  set_map_var(42, 1);
  gsay_message(SCRIPT_BUTCH, 248, NEUTRAL_REACTION);
  call ButchX2;
end

procedure Butch53
begin
  gsay_reply(SCRIPT_BUTCH, 249);
  giq_option(4, SCRIPT_BUTCH, 250, Butch54, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 251, Butch53a, NEUTRAL_REACTION);
end

procedure Butch53a
begin
  if (is_success(roll_vs_skill(dude_obj, 14, 0))) then begin
    call Butch54a;
  end
  else begin
    call Butch58;
  end
end

procedure Butch54
begin
  gsay_reply(SCRIPT_BUTCH, 252);
  giq_option(4, SCRIPT_BUTCH, 253, Butch54a, NEUTRAL_REACTION);
end

procedure Butch54a
begin
  gsay_reply(SCRIPT_BUTCH, 254);
  giq_option(4, SCRIPT_BUTCH, 255, Butch55, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 256, Butch56, NEUTRAL_REACTION);
end

procedure Butch55
begin
  gsay_message(SCRIPT_BUTCH, 257, NEUTRAL_REACTION);
  call ButchX3;
end

procedure Butch56
begin
  gsay_reply(SCRIPT_BUTCH, 258);
  giq_option(4, SCRIPT_BUTCH, 259, Butch55, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 260, Butch57, NEUTRAL_REACTION);
end

procedure Butch57
begin
  gsay_message(SCRIPT_BUTCH, 261, NEUTRAL_REACTION);
  call ButchX3;
end

procedure Butch58
begin
  gsay_message(SCRIPT_BUTCH, 262, NEUTRAL_REACTION);
  call ButchX3;
end

procedure Butch59
begin
  gsay_reply(SCRIPT_BUTCH, 263);
  if ((global_var(GVAR_THE_VATS) == 2) or (obj_is_carrying_obj_pid(dude_obj, 196) >= 1)) then begin
    giq_option(4, SCRIPT_BUTCH, 264, Butch40, NEUTRAL_REACTION);
  end
  else begin
    if (global_var(GVAR_HUB_FILLER_29) == 5) then begin
      giq_option(4, SCRIPT_BUTCH, 265, Butch54a, NEUTRAL_REACTION);
    end
  end
  giq_option(4, SCRIPT_BUTCH, 327, Butch67, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_BUTCH, 329, Butch49, NEUTRAL_REACTION);
end

procedure Butch60
begin
  gsay_message(SCRIPT_BUTCH, 266, NEUTRAL_REACTION);
  call ButchX2;
end

procedure Butch61
begin
end

procedure Butch62
begin
end

procedure Butch63
begin
end

procedure Butch64
begin
end

procedure Butch65
begin
end

procedure Butch66
begin
end

procedure Butch67
begin
  gsay_message(SCRIPT_BUTCH, 274, NEUTRAL_REACTION);
  call ButchEnd;
end

procedure Butch68
begin
  gsay_message(SCRIPT_BUTCH, 276, NEUTRAL_REACTION);
  call ButchEnd;
end

procedure Butch69
begin
end

procedure Butch70
begin
end

procedure Butch71
begin
end

procedure Butch72
begin
end

procedure Butch73
begin
  gsay_reply(SCRIPT_BUTCH, 160);
  giq_option(4, SCRIPT_BUTCH, 326, Butch68, NEUTRAL_REACTION);
end

procedure ButchX2
begin
  set_local_var(5, 1);
  set_map_var(56, 0);
end

procedure ButchX3
begin
  set_local_var(5, 0);
  set_map_var(56, 1);
end

procedure ButchEnd
begin
end

procedure ButchEndAccept
begin
  set_map_var(41, 1);
  set_global_var(GVAR_MISSING_CARAVAN, 1);
  set_map_var(10, 1);
end

procedure ButchEndTransport
begin
  gfade_out(1000);
  move_to(dude_obj, 18664, 0);
  gfade_in(1000);
end

procedure Get_Reaction
begin
  if (local_var(2) == 0) then begin
    set_local_var(0, 50);
    set_local_var(1, 2);
    set_local_var(2, 1);
    set_local_var(0, local_var(0) + (5 * get_critter_stat(dude_obj, 3)) - 25);
    set_local_var(0, local_var(0) + (10 * has_trait(0, dude_obj, 10)));
    if (has_trait(0, dude_obj, 39)) then begin
      if (global_var(GVAR_PLAYER_REPUTATION) > 0) then begin
        set_local_var(0, local_var(0) + global_var(GVAR_PLAYER_REPUTATION));
      end
      else begin
        set_local_var(0, local_var(0) - global_var(GVAR_PLAYER_REPUTATION));
      end
    end
    else begin
      if (local_var(3) == 1) then begin
        set_local_var(0, local_var(0) - global_var(GVAR_PLAYER_REPUTATION));
      end
      else begin
        set_local_var(0, local_var(0) + global_var(GVAR_PLAYER_REPUTATION));
      end
    end
    if (global_var(GVAR_CHILDKILLER_REPUTATION) > 2) then begin
      set_local_var(0, local_var(0) - 30);
    end
    if (((global_var(GVAR_BAD_MONSTER) + global_var(GVAR_GOOD_MONSTER)) >= 25) and ((global_var(GVAR_BAD_MONSTER) > (3 * global_var(GVAR_GOOD_MONSTER))) or (global_var(GVAR_CHAMPION_REPUTATION) == 1))) then begin
      set_local_var(0, local_var(0) + 20);
    end
    if (((global_var(GVAR_BAD_MONSTER) + global_var(GVAR_GOOD_MONSTER)) >= 25) and ((global_var(GVAR_GOOD_MONSTER) > (2 * global_var(GVAR_BAD_MONSTER))) or (global_var(GVAR_BERSERKER_REPUTATION) == 1))) then begin
      set_local_var(0, local_var(0) - 20);
    end
    call React_To_Level;
  end
end

procedure React_To_Level
begin
  if (local_var(0) <= 25) then begin
    set_local_var(1, 1);
  end
  else begin
    if (local_var(0) <= 75) then begin
      set_local_var(1, 2);
    end
    else begin
      set_local_var(1, 3);
    end
  end
end

procedure Level_To_React
begin
  if (local_var(1) == 1) then begin
    set_local_var(0, random(1, 25));
  end
  else begin
    if (local_var(1) == 2) then begin
      set_local_var(0, random(26, 75));
    end
    else begin
      set_local_var(0, random(76, 100));
    end
  end
end

procedure Up_React
begin
  set_local_var(0, local_var(0) + 10);
  call React_To_Level;
end

procedure Down_React
begin
  set_local_var(0, local_var(0) - 10);
  call React_To_Level;
end

procedure Bottom_React
begin
  set_local_var(1, 1);
  set_local_var(0, 1);
end

procedure Top_React
begin
  set_local_var(0, 100);
  set_local_var(1, 3);
end

procedure Big_Up_React
begin
  set_local_var(0, local_var(0) + 25);
  call React_To_Level;
end

procedure Big_Down_React
begin
  set_local_var(0, local_var(0) - 25);
  call React_To_Level;
end

procedure Up_React_Level
begin
  set_local_var(1, local_var(1) + 1);
  if (local_var(1) > 3) then begin
    set_local_var(1, 3);
  end
  call Level_To_React;
end

procedure Down_React_Level
begin
  set_local_var(1, local_var(1) - 1);
  if (local_var(1) < 1) then begin
    set_local_var(1, 1);
  end
  call Level_To_React;
end

procedure Goodbyes
begin
  exit_line := message_str(SCRIPT_MODREACT, random(100, 105));
end
