#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 look_at_p_proc;
procedure Harold00;
procedure Harold00a;
procedure Harold00b;
procedure Harold01;
procedure Harold02;
procedure Harold03;
procedure Harold04;
procedure Harold05;
procedure Harold06;
procedure Harold07;
procedure Harold08;
procedure Harold09;
procedure Harold09a;
procedure Harold10;
procedure Harold10a;
procedure Harold11;
procedure Harold12;
procedure Harold13;
procedure Harold14;
procedure Harold15;
procedure Harold15a;
procedure Harold16;
procedure Harold17;
procedure Harold17a;
procedure Harold18;
procedure Harold19;
procedure Harold20;
procedure Harold21;
procedure Harold22;
procedure Harold23;
procedure Harold24;
procedure Harold25;
procedure Harold25a;
procedure Harold26;
procedure Harold26a;
procedure Harold26b;
procedure Harold27;
procedure Harold28;
procedure Harold29;
procedure Harold30;
procedure Harold31;
procedure Harold32;
procedure Harold33;
procedure Harold34;
procedure Harold36;
procedure Harold37;
procedure Harold38;
procedure Harold39;
procedure Harold39a;
procedure Harold39b;
procedure Harold40;
procedure Harold41;
procedure Harold41a;
procedure Harold42;
procedure Harold43;
procedure Harold43a;
procedure Harold43b;
procedure Harold44;
procedure Harold45;
procedure Harold47;
procedure Harold49;
procedure Harold50;
procedure Harold51;
procedure Harold52;
procedure Harold53;
procedure Harold54;
procedure Harold55;
procedure Harold56;
procedure Harold57;
procedure HaroldEnd;

variable hostile1;
variable Only_Once := 1;

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, 41);
    critter_add_trait(self_obj, TRAIT_OBJECT, OBJECT_AI_PACKET, AI_HUB_MUTANTS);
  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 (local_var(4) == 0) then begin
    if (local_var(1) > 1) then begin
      set_local_var(4, 1);
      start_gdialog(SCRIPT_HAROLD, self_obj, 4, HEAD_HAROLD, BACKGROUND_HUB);
      gsay_start;
      call Harold00;
      gsay_end;
      end_dialogue;
    end
    else begin
      start_gdialog(SCRIPT_HAROLD, self_obj, 4, HEAD_HAROLD, BACKGROUND_HUB);
      gsay_start;
      call Harold39;
      gsay_end;
      end_dialogue;
    end
  end
  else begin
    if (local_var(1) > 1) then begin
      set_local_var(4, 1);
      start_gdialog(SCRIPT_HAROLD, self_obj, 4, HEAD_HAROLD, BACKGROUND_HUB);
      gsay_start;
      call Harold41;
      gsay_end;
      end_dialogue;
    end
    else begin
      start_gdialog(SCRIPT_HAROLD, self_obj, 4, HEAD_HAROLD, BACKGROUND_HUB);
      gsay_start;
      call Harold55;
      gsay_end;
      end_dialogue;
    end
  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 look_at_p_proc
begin
  script_overrides;
  display_msg(message_str(SCRIPT_HAROLD, 100));
end

procedure Harold00
begin
  if (dude_is_male) then begin
    gsay_reply(SCRIPT_HAROLD, 266);
  end
  else begin
    gsay_reply(SCRIPT_HAROLD, 267);
  end
  giq_option(4, SCRIPT_HAROLD, 102, Harold00a, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 103, Harold00b, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 104, Harold38, NEUTRAL_REACTION);
  if (global_var(GVAR_HUB_FILLER_29) == 2) then begin
    giq_option(4, SCRIPT_HAROLD, 225, Harold45, NEUTRAL_REACTION);
  end
  giq_option(4, SCRIPT_HAROLD, 105, Harold37, BAD_REACTION);
  giq_option(-3, SCRIPT_HAROLD, 106, Harold01, NEUTRAL_REACTION);
end

procedure Harold00a
begin
  variable LVar0 := 0;
  if (item_caps_total(dude_obj) >= 25) then begin
    LVar0 := item_caps_adjust(dude_obj, -25);
    call Harold02;
  end
  else begin
    call Harold01;
  end
end

procedure Harold00b
begin
  variable LVar0 := 0;
  if (item_caps_total(dude_obj) >= 5) then begin
    LVar0 := item_caps_adjust(dude_obj, -5);
    call Harold02;
  end
  else begin
    call Harold01;
  end
end

procedure Harold01
begin
  gsay_message(SCRIPT_HAROLD, 107, NEUTRAL_REACTION);
end

procedure Harold02
begin
  if (dude_is_male) then begin
    gsay_reply(SCRIPT_HAROLD, 268);
  end
  else begin
    gsay_reply(SCRIPT_HAROLD, 269);
  end
  giq_option(4, SCRIPT_HAROLD, 109, Harold03, NEUTRAL_REACTION);
  if (global_var(GVAR_HUB_FILLER_29) == 2) then begin
    giq_option(4, SCRIPT_HAROLD, 225, Harold45, NEUTRAL_REACTION);
  end
  giq_option(4, SCRIPT_HAROLD, 110, HaroldEnd, NEUTRAL_REACTION);
end

procedure Harold03
begin
  gsay_reply(SCRIPT_HAROLD, 111);
  giq_option(4, SCRIPT_HAROLD, 112, Harold04, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 113, Harold36, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 114, HaroldEnd, NEUTRAL_REACTION);
end

procedure Harold04
begin
  gsay_reply(SCRIPT_HAROLD, 115);
  giq_option(4, SCRIPT_HAROLD, 116, Harold05, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 117, Harold32, NEUTRAL_REACTION);
end

procedure Harold05
begin
  gsay_reply(SCRIPT_HAROLD, 118);
  giq_option(4, SCRIPT_HAROLD, 119, Harold07, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 120, Harold06, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 121, Harold30, NEUTRAL_REACTION);
end

procedure Harold06
begin
  gsay_reply(SCRIPT_HAROLD, 122);
  giq_option(4, SCRIPT_HAROLD, 123, Harold07, NEUTRAL_REACTION);
end

procedure Harold07
begin
  gsay_reply(SCRIPT_HAROLD, 124);
  giq_option(4, SCRIPT_HAROLD, 125, Harold08, NEUTRAL_REACTION);
end

procedure Harold08
begin
  gsay_reply(SCRIPT_HAROLD, 126);
  giq_option(4, SCRIPT_HAROLD, 127, Harold09, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 128, Harold10, NEUTRAL_REACTION);
end

procedure Harold09
begin
  gsay_reply(SCRIPT_HAROLD, 129);
  giq_option(4, SCRIPT_HAROLD, 130, Harold09a, NEUTRAL_REACTION);
end

procedure Harold09a
begin
  gsay_reply(SCRIPT_HAROLD, 131);
  giq_option(4, SCRIPT_HAROLD, 132, Harold11, NEUTRAL_REACTION);
end

procedure Harold10
begin
  gsay_reply(SCRIPT_HAROLD, 133);
  giq_option(4, SCRIPT_HAROLD, 134, Harold11, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 135, Harold12, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 136, Harold10a, NEUTRAL_REACTION);
end

procedure Harold10a
begin
  gsay_message(SCRIPT_HAROLD, 137, NEUTRAL_REACTION);
  call Harold11;
end

procedure Harold11
begin
  gsay_reply(SCRIPT_HAROLD, 138);
  giq_option(4, SCRIPT_HAROLD, 139, Harold14, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 140, Harold13, NEUTRAL_REACTION);
end

procedure Harold12
begin
  gsay_reply(SCRIPT_HAROLD, 141);
  giq_option(4, SCRIPT_HAROLD, 142, Harold11, NEUTRAL_REACTION);
end

procedure Harold13
begin
  gsay_reply(SCRIPT_HAROLD, 143);
  giq_option(4, SCRIPT_HAROLD, 144, Harold15, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 145, Harold14, NEUTRAL_REACTION);
end

procedure Harold14
begin
  gsay_reply(SCRIPT_HAROLD, 146);
  giq_option(4, SCRIPT_HAROLD, 147, Harold18, NEUTRAL_REACTION);
end

procedure Harold15
begin
  gsay_reply(SCRIPT_HAROLD, 148);
  giq_option(4, SCRIPT_HAROLD, 149, Harold14, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 150, Harold15a, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 152, HaroldEnd, NEUTRAL_REACTION);
end

procedure Harold15a
begin
  variable LVar0 := 0;
  if (item_caps_total(dude_obj) >= 25) then begin
    LVar0 := item_caps_adjust(dude_obj, -25);
    set_local_var(6, 1);
    call Harold14;
  end
  else begin
    call Harold17;
  end
end

procedure Harold16
begin
  gsay_message(SCRIPT_HAROLD, 153, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 154, Harold14, NEUTRAL_REACTION);
end

procedure Harold17
begin
  gsay_message(SCRIPT_HAROLD, 156, NEUTRAL_REACTION);
  if (local_var(1) >= 3) then begin
    call Harold16;
  end
  else begin
    call Harold17a;
  end
end

procedure Harold17a
begin
  gsay_reply(SCRIPT_HAROLD, 157);
  giq_option(4, SCRIPT_HAROLD, 158, HaroldEnd, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 159, Harold14, NEUTRAL_REACTION);
end

procedure Harold18
begin
  gsay_reply(SCRIPT_HAROLD, 160);
  giq_option(4, SCRIPT_HAROLD, 161, Harold20, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 162, Harold19, NEUTRAL_REACTION);
end

procedure Harold19
begin
  gsay_reply(SCRIPT_HAROLD, 163);
  giq_option(4, SCRIPT_HAROLD, 164, Harold21, NEUTRAL_REACTION);
end

procedure Harold20
begin
  gsay_reply(SCRIPT_HAROLD, 165);
  giq_option(4, SCRIPT_HAROLD, 166, Harold21, NEUTRAL_REACTION);
end

procedure Harold21
begin
  gsay_reply(SCRIPT_HAROLD, 167);
  giq_option(4, SCRIPT_HAROLD, 168, Harold22, NEUTRAL_REACTION);
end

procedure Harold22
begin
  gsay_reply(SCRIPT_HAROLD, 169);
  giq_option(4, SCRIPT_HAROLD, 170, Harold23, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 171, Harold24, NEUTRAL_REACTION);
end

procedure Harold23
begin
  gsay_reply(SCRIPT_HAROLD, 172);
  giq_option(4, SCRIPT_HAROLD, 173, Harold24, NEUTRAL_REACTION);
end

procedure Harold24
begin
  gsay_reply(SCRIPT_HAROLD, 174);
  giq_option(4, SCRIPT_HAROLD, 175, Harold25, NEUTRAL_REACTION);
end

procedure Harold25
begin
  gsay_reply(SCRIPT_HAROLD, 176);
  giq_option(4, SCRIPT_HAROLD, 177, Harold25a, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 178, Harold27, NEUTRAL_REACTION);
end

procedure Harold25a
begin
  gsay_reply(SCRIPT_HAROLD, 179);
  giq_option(4, SCRIPT_HAROLD, 180, Harold26, NEUTRAL_REACTION);
end

procedure Harold26
begin
  gsay_reply(SCRIPT_HAROLD, 181);
  giq_option(4, SCRIPT_HAROLD, 182, Harold28, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 183, Harold26a, NEUTRAL_REACTION);
end

procedure Harold26a
begin
  set_local_var(5, 1);
  if (local_var(6) == 1) then begin
    gsay_reply(SCRIPT_HAROLD, 184);
    giq_option(4, SCRIPT_HAROLD, 185, Harold26b, NEUTRAL_REACTION);
  end
  else begin
    gsay_message(SCRIPT_HAROLD, 184, NEUTRAL_REACTION);
  end
end

procedure Harold26b
begin
  gsay_message(SCRIPT_HAROLD, 187, NEUTRAL_REACTION);
end

procedure Harold27
begin
  gsay_reply(SCRIPT_HAROLD, 188);
  giq_option(4, SCRIPT_HAROLD, 189, Harold26, NEUTRAL_REACTION);
end

procedure Harold28
begin
  gsay_reply(SCRIPT_HAROLD, 190);
  giq_option(4, SCRIPT_HAROLD, 191, Harold29, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 192, Harold26a, NEUTRAL_REACTION);
end

procedure Harold29
begin
  gsay_reply(SCRIPT_HAROLD, 193);
  giq_option(4, SCRIPT_HAROLD, 194, Harold26a, NEUTRAL_REACTION);
end

procedure Harold30
begin
  gsay_reply(SCRIPT_HAROLD, 195);
  giq_option(4, SCRIPT_HAROLD, 196, Harold31, NEUTRAL_REACTION);
end

procedure Harold31
begin
  gsay_reply(SCRIPT_HAROLD, 197);
  giq_option(4, SCRIPT_HAROLD, 198, Harold07, NEUTRAL_REACTION);
end

procedure Harold32
begin
  gsay_reply(SCRIPT_HAROLD, 199);
  giq_option(4, SCRIPT_HAROLD, 200, Harold11, NEUTRAL_REACTION);
end

procedure Harold33
begin
  gsay_reply(SCRIPT_HAROLD, 201);
  giq_option(4, SCRIPT_HAROLD, 202, Harold34, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 203, HaroldEnd, NEUTRAL_REACTION);
end

procedure Harold34
begin
  gsay_reply(SCRIPT_HAROLD, 204);
  giq_option(4, SCRIPT_HAROLD, 205, Harold05, NEUTRAL_REACTION);
end

procedure Harold36
begin
  gsay_message(SCRIPT_HAROLD, 207, NEUTRAL_REACTION);
end

procedure Harold37
begin
  call Big_Down_React;
  gsay_message(SCRIPT_HAROLD, 208, BAD_REACTION);
end

procedure Harold38
begin
  gsay_message(SCRIPT_HAROLD, 209, NEUTRAL_REACTION);
end

procedure Harold39
begin
  if (dude_is_male) then begin
    gsay_reply(SCRIPT_HAROLD, 272);
  end
  else begin
    gsay_reply(SCRIPT_HAROLD, 273);
  end
  giq_option(4, SCRIPT_HAROLD, 211, Harold39a, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 212, Harold39b, NEUTRAL_REACTION);
  if (global_var(GVAR_HUB_FILLER_29) == 2) then begin
    giq_option(4, SCRIPT_HAROLD, 225, Harold45, NEUTRAL_REACTION);
  end
  giq_option(4, SCRIPT_HAROLD, 213, Harold38, NEUTRAL_REACTION);
  giq_option(-3, SCRIPT_HAROLD, 214, Harold01, NEUTRAL_REACTION);
end

procedure Harold39a
begin
  variable LVar0 := 0;
  if (item_caps_total(dude_obj) >= 25) then begin
    LVar0 := item_caps_adjust(dude_obj, -25);
    call Harold40;
  end
  else begin
    call Harold01;
  end
end

procedure Harold39b
begin
  variable LVar0 := 0;
  if (item_caps_total(dude_obj) >= 5) then begin
    LVar0 := item_caps_adjust(dude_obj, -5);
    call Harold40;
  end
  else begin
    call Harold01;
  end
end

procedure Harold40
begin
  gsay_reply(SCRIPT_HAROLD, 215);
  giq_option(4, SCRIPT_HAROLD, 216, Harold03, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 217, HaroldEnd, NEUTRAL_REACTION);
end

procedure Harold41
begin
  gsay_reply(SCRIPT_HAROLD, 218);
  giq_option(4, SCRIPT_HAROLD, 219, Harold41a, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 220, Harold43, NEUTRAL_REACTION);
  giq_option(-3, SCRIPT_HAROLD, 221, HaroldEnd, NEUTRAL_REACTION);
end

procedure Harold41a
begin
  variable LVar0 := 0;
  if (item_caps_total(dude_obj) >= 20) then begin
    LVar0 := item_caps_adjust(dude_obj, -20);
    call Harold43;
  end
  else begin
    call Harold01;
  end
end

procedure Harold42
begin
  call Down_React;
  gsay_message(SCRIPT_HAROLD, 222, BAD_REACTION);
end

procedure Harold43
begin
  gsay_reply(SCRIPT_HAROLD, 223);
  if (global_var(GVAR_HUB_FILLER_29) == 2) then begin
    giq_option(4, SCRIPT_HAROLD, 225, Harold45, NEUTRAL_REACTION);
  end
  if (((global_var(GVAR_THE_HUB_INVADED_DATE) - (game_time / (10 * 60 * 60 * 24))) < 10) or (global_var(GVAR_FIND_LOST_INITIATE) == 1)) then begin
    giq_option(4, SCRIPT_HAROLD, 224, Harold43b, NEUTRAL_REACTION);
  end
  if (local_var(5) == 0) then begin
    giq_option(4, SCRIPT_HAROLD, 226, Harold43a, NEUTRAL_REACTION);
  end
  giq_option(4, SCRIPT_HAROLD, 265, HaroldEnd, NEUTRAL_REACTION);
end

procedure Harold43a
begin
  gsay_message(SCRIPT_HAROLD, 228, NEUTRAL_REACTION);
  call Harold04;
end

procedure Harold43b
begin
  if (global_var(GVAR_FIND_LOST_INITIATE) == 1) then begin
    call Harold53;
  end
  else begin
    if ((global_var(GVAR_THE_HUB_INVADED_DATE) - (game_time / (10 * 60 * 60 * 24))) < 10) then begin
      call Harold54;
    end
  end
end

procedure Harold44
begin
  gsay_message(SCRIPT_HAROLD, 229, NEUTRAL_REACTION);
end

procedure Harold45
begin
  set_global_var(GVAR_HUB_FILLER_29, 3);
  gsay_reply(SCRIPT_HAROLD, 230);
  giq_option(4, SCRIPT_HAROLD, 231, Harold47, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 232, Harold47, NEUTRAL_REACTION);
end

procedure Harold47
begin
  gsay_reply(SCRIPT_HAROLD, 233);
  giq_option(4, SCRIPT_HAROLD, 234, Harold49, NEUTRAL_REACTION);
end

procedure Harold49
begin
  gsay_reply(SCRIPT_HAROLD, 235);
  giq_option(4, SCRIPT_HAROLD, 236, Harold50, NEUTRAL_REACTION);
end

procedure Harold50
begin
  gsay_reply(SCRIPT_HAROLD, 237);
  giq_option(4, SCRIPT_HAROLD, 238, Harold51, NEUTRAL_REACTION);
end

procedure Harold51
begin
  gsay_reply(SCRIPT_HAROLD, 239);
  giq_option(4, SCRIPT_HAROLD, 240, HaroldEnd, NEUTRAL_REACTION);
end

procedure Harold52
begin
  gsay_message(SCRIPT_HAROLD, 241, NEUTRAL_REACTION);
end

procedure Harold53
begin
  set_global_var(GVAR_DECKER_KNOWN, 1);
  gsay_reply(SCRIPT_HAROLD, 242);
  giq_option(4, SCRIPT_HAROLD, 243, HaroldEnd, NEUTRAL_REACTION);
end

procedure Harold54
begin
  gsay_reply(SCRIPT_HAROLD, 244);
  giq_option(4, SCRIPT_HAROLD, 245, HaroldEnd, NEUTRAL_REACTION);
end

procedure Harold55
begin
  gsay_reply(SCRIPT_HAROLD, 246);
  giq_option(4, SCRIPT_HAROLD, 247, Harold56, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_HAROLD, 248, Harold57, NEUTRAL_REACTION);
end

procedure Harold56
begin
  gsay_message(SCRIPT_HAROLD, 249, BAD_REACTION);
end

procedure Harold57
begin
  gsay_message(SCRIPT_HAROLD, 250, BAD_REACTION);
end

procedure HaroldEnd
begin
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
