#include <define.h>

//#define NAME                    SCRIPT_

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



procedure start;
#include <push.h>
procedure do_dialogue;
procedure aradeshleave;
procedure aradeshend;
procedure aradeshcbt;
procedure aradesh01;
procedure aradesh01_2;
procedure aradesh01_3;
procedure aradesh02;
procedure aradesh02_2;
procedure aradesh02_4;
procedure aradesh02_5;
procedure aradesh03;
procedure aradesh04;
procedure aradesh05;
procedure aradesh06;
procedure aradesh07;
procedure aradesh08;
procedure aradesh08a;
procedure aradesh08b;
procedure aradesh09;
procedure aradesh09a;
procedure aradesh10;
procedure aradesh11;
procedure aradesh11a;
procedure aradesh11b;
procedure aradesh12;
procedure aradesh13;
procedure aradesh14;
procedure aradesh15;
procedure aradesh16;
procedure aradesh16_2;
procedure aradesh17;
procedure aradesh17_2;
procedure aradesh17_3;
procedure aradesh18;
procedure aradesh19;
procedure aradesh20;
procedure aradesh21;
procedure aradesh22;
procedure aradesh23;
procedure aradesh23_2;
procedure aradesh24;
procedure aradesh24a;
procedure aradesh24b;
procedure aradesh24c;
procedure aradesh25;
procedure aradesh26;
procedure aradesh27;
procedure aradesh28;
procedure aradesh28a;
procedure aradesh28b;
procedure aradesh28c;
procedure aradesh29;
procedure aradesh30;
procedure aradesh30a;
procedure aradesh30b;
procedure aradesh31;
procedure aradesh32;
procedure aradesh33;
procedure aradesh35;
procedure aradesh36;
procedure aradesh37;
procedure aradesh37a;
procedure aradesh38;
procedure aradesh39;
procedure aradesh39a;
procedure aradesh39b;
procedure aradesh39c;
procedure aradesh40;
procedure aradesh40a;
procedure aradesh41;
procedure aradesh42;
procedure aradesh43;
procedure aradesh44;
procedure aradesh45;
procedure aradesh46;
procedure aradesh47;
procedure aradesh48;
procedure aradeshx;
procedure aradeshx1;
procedure aradeshx2;
procedure aradeshx3;
procedure aradeshx5;

variable TRESPASS;
variable ILLEGAL;
variable ILLEGBEFORE;
variable hostile1;
variable rndx;
variable rndy;
variable rndz;
variable MALE;

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 aradesh49;
procedure aradesh49a;
procedure aradesh50;
procedure aradesh51;
procedure aradesh52;
procedure aradesh53;
procedure aradesh54;
procedure aradesh55;
procedure aradesh56;
procedure aradesh57;
procedure aradesh58;
procedure aradesh59;
procedure aradesh60;
procedure aradesh61;
procedure aradesh62;
procedure aradesh63;
procedure aradesh64;
procedure aradesh65;
procedure aradesh66;
procedure aradesh67;
procedure aradesh68;
procedure aradesh69;
procedure aradesh70;
procedure aradesh71;
procedure aradesh72;
procedure aradesh73;


procedure start
begin
critter_add_trait(self_obj, TRAIT_OBJECT, OBJECT_TEAM_NUM, 2);
  critter_add_trait(self_obj, TRAIT_OBJECT, OBJECT_AI_PACKET, AI_PEASANT);
  if (script_action == talk_proc) then begin
    if (local_var(9) > 2) then begin
      display_msg(message_str(SCRIPT_GENCHAT, 170));
      hostile1 := 1;
    end
    else begin
      if (global_var(GVAR_ENEMY_SHADY_SANDS) == 1) then begin
        float_msg(self_obj, message_str(SCRIPT_ARADESH, 277), FLOAT_MSG_RED);
      end
      else begin
        call do_dialogue;
      end
    end
    if (local_var(7) == 1) then begin
      animate_move_obj_to_tile(self_obj, 32945, ANIMATE_WALK);
    end
  end
  else begin
    if (script_action == critter_proc) then begin
      if (obj_can_see_obj(self_obj, dude_obj)) then begin
        if (global_var(GVAR_ENEMY_SHADY_SANDS) == 1) then begin
          hostile1 := 1;
        end
      end
      if (hostile1) then begin
        hostile1 := 0;
        attack_complex(dude_obj, 0, 1, 0, 0, 30000, 0, 0);
      end
    end
    else begin
      if (script_action == damage_proc) then begin
        if (source_obj == dude_obj) then begin
          set_global_var(GVAR_ENEMY_SHADY_SANDS, 1);
        end
      end
      else begin
        if (script_action == look_at_proc) then begin
          script_overrides;
          display_msg(message_str(SCRIPT_ARADESH, 100));
        end
        else begin
          if (script_action == destroy_proc) then begin
            set_global_var(GVAR_ARADESH_STATUS, 1);
            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
          else begin
            if (script_action == pickup_proc) then begin
              hostile1 := 1;
            end
          end
        end
      end
    end
  end
end

procedure do_dialogue
begin
  if (global_var(GVAR_ENEMY_SHADY_SANDS) == 1) then begin
    float_msg(self_obj, message_str(SCRIPT_ARADESH, 277), FLOAT_MSG_RED);
  end
  else begin
    if (local_var(9) > 2) then begin
      display_msg(message_str(SCRIPT_GENCHAT, 170));
      hostile1 := 1;
    end
    else begin
      call Get_Reaction;
      start_gdialog(SCRIPT_ARADESH, self_obj, 4, HEAD_ARADESH, BACKGROUND_SHADY_SANDS);
      gsay_start;
      if (global_var(GVAR_TANDI_STATUS) == 1) then begin
        set_local_var(4, 1);
        if (global_var(GVAR_RESCUE_TANDI) == 0) then begin
          call aradesh39;
        end
        else begin
          call aradesh37;
        end
      end
      else begin
        if (local_var(4) == 1) then begin
          if (local_var(5) == 1) then begin
            call aradesh46;
          end
          else begin
            if ((global_var(GVAR_TANDI_STATUS) == 2) and (local_var(8) == 0)) then begin
              call aradesh43;
            end
            else begin
              if ((global_var(GVAR_RADSCORPION_SEED) == 2) and (local_var(10) == 0)) then begin
                set_local_var(10, 1);
                call aradesh31;
              end
              else begin
                if (global_var(GVAR_TANDI_STATUS) == 1) then begin
                  if (global_var(GVAR_RESCUE_TANDI) == 0) then begin
                    call aradesh39;
                  end
                  else begin
                    call aradesh37;
                  end
                end
                else begin
                  if ((global_var(GVAR_TANDI_STATUS) == 2) and (global_var(GVAR_RADSCORPION_SEED) != 2)) then begin
                    call aradesh30a;
                  end
                  else begin
                    if (global_var(GVAR_TANDI_STATUS) == 2) then begin
                      call aradesh35;
                    end
                    else begin
                      if (local_var(1) < 3) then begin
                        call aradesh18;
                      end
                      else begin
                        call aradesh17;
                      end
                    end
                  end
                end
              end
            end
          end
        end
        else begin
          set_local_var(4, 1);
          call aradesh01;
        end
      end
      gsay_end;
      end_dialogue;
    end
  end
end

procedure aradeshleave
begin
  gsay_message(SCRIPT_ARADESH, 276, NEUTRAL_REACTION);
end

procedure aradeshend
begin
end

procedure aradeshcbt
begin
  hostile1 := 1;
end

procedure aradesh01
begin
  if (local_var(1) >= 2) then begin
    if (local_var(1) >= 3) then begin
      gsay_reply(SCRIPT_ARADESH, 101);
    end
    else begin
      gsay_reply(SCRIPT_ARADESH, 102);
    end
  end
  else begin
    gsay_reply(SCRIPT_ARADESH, 103);
  end
  giq_option(5, SCRIPT_ARADESH, 104, aradesh02, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_ARADESH, 105, aradesh01_2, BAD_REACTION);
  giq_option(4, SCRIPT_ARADESH, 106, aradesh10, BAD_REACTION);
  giq_option(4, SCRIPT_ARADESH, 107, aradesh01_3, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_ARADESH, 108, aradesh14, BAD_REACTION);
  giq_option(5, SCRIPT_ARADESH, 109, aradesh07, BAD_REACTION);
  giq_option(-3, SCRIPT_ARADESH, 110, aradesh15, NEUTRAL_REACTION);
end

procedure aradesh01_2
begin
  set_local_var(9, local_var(9) + 1);
  call Down_React;
  if (local_var(1) >= 2) then begin
    call aradesh05;
  end
  else begin
    call aradesh06;
  end
end

procedure aradesh01_3
begin
  if (local_var(1) >= 2) then begin
    call aradesh13;
  end
  else begin
    call aradesh11;
  end
end

procedure aradesh02
begin
  gsay_reply(SCRIPT_ARADESH, 111);
  giq_option(4, SCRIPT_ARADESH, 112, aradesh02_2, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_ARADESH, 113, aradesh01_2, BAD_REACTION);
  giq_option(5, SCRIPT_ARADESH, 114, aradesh02_4, BAD_REACTION);
  giq_option(5, SCRIPT_ARADESH, 115, aradesh02_5, NEUTRAL_REACTION);
end

procedure aradesh02_2
begin
  if (local_var(1) >= 2) then begin
    call aradesh03;
  end
  else begin
    call aradesh08;
  end
end

procedure aradesh02_4
begin
  if (local_var(1) >= 2) then begin
    call aradesh09;
  end
  else begin
    call aradesh06;
  end
end

procedure aradesh02_5
begin
  if (local_var(1) >= 2) then begin
    call aradesh04;
  end
  else begin
    call aradesh09;
  end
end

procedure aradesh03
begin
  gsay_reply(SCRIPT_ARADESH, 116);
  giq_option(4, SCRIPT_ARADESH, 117, aradesh04, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_ARADESH, 118, aradesh01_2, BAD_REACTION);
  giq_option(5, SCRIPT_ARADESH, 119, aradesh07, BAD_REACTION);
  giq_option(4, SCRIPT_ARADESH, 120, aradesh07, BAD_REACTION);
end

procedure aradesh04
begin
  gsay_message(SCRIPT_ARADESH, 121, NEUTRAL_REACTION);
  call aradeshend;
end

procedure aradesh05
begin
  gsay_reply(SCRIPT_ARADESH, 122);
  giq_option(5, SCRIPT_ARADESH, 123, aradesh06, BAD_REACTION);
  giq_option(4, SCRIPT_ARADESH, 124, aradesh04, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_ARADESH, 125, aradesh07, BAD_REACTION);
end

procedure aradesh06
begin
  set_local_var(9, local_var(9) + 1);
  gsay_message(SCRIPT_ARADESH, 126, BAD_REACTION);
  call aradeshx1;
end

procedure aradesh07
begin
  set_local_var(9, local_var(9) + 1);
  gsay_message(SCRIPT_ARADESH, 127, BAD_REACTION);
  call aradeshx2;
end

procedure aradesh08
begin
  gsay_reply(SCRIPT_ARADESH, 128);
  giq_option(4, SCRIPT_ARADESH, 129, aradesh08a, GOOD_REACTION);
  giq_option(5, SCRIPT_ARADESH, 130, aradesh08b, BAD_REACTION);
end

procedure aradesh08a
begin
  call Up_React;
  call aradesh04;
end

procedure aradesh08b
begin
  set_local_var(9, local_var(9) + 1);
  call Down_React;
  call aradesh06;
end

procedure aradesh09
begin
  gsay_reply(SCRIPT_ARADESH, 131);
  giq_option(0, SCRIPT_ARADESH, 132, aradesh09a, NEUTRAL_REACTION);
end

procedure aradesh09a
begin
  gsay_message(SCRIPT_ARADESH, 133, NEUTRAL_REACTION);
  call aradeshx;
end

procedure aradesh10
begin
  gsay_message(SCRIPT_ARADESH, 134, NEUTRAL_REACTION);
  call aradeshx;
end

procedure aradesh11
begin
  gsay_reply(SCRIPT_ARADESH, 135);
  giq_option(4, SCRIPT_ARADESH, 136, aradesh12, NEUTRAL_REACTION);
  giq_option(5, SCRIPT_ARADESH, 137, aradesh11a, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_ARADESH, 138, aradesh11b, BAD_REACTION);
end

procedure aradesh11a
begin
  if (is_success(roll_vs_skill(dude_obj, 14, 0))) then begin
    call aradesh02;
  end
  else begin
    call aradesh14;
  end
end

procedure aradesh11b
begin
  set_local_var(9, local_var(9) + 1);
  call Down_React;
  call aradesh14;
end

procedure aradesh12
begin
  gsay_reply(SCRIPT_ARADESH, 139);
  giq_option(5, SCRIPT_ARADESH, 140, aradesh02, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_ARADESH, 141, aradesh13, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_ARADESH, 142, aradesh05, NEUTRAL_REACTION);
end

procedure aradesh13
begin
  gsay_reply(SCRIPT_ARADESH, 143);
  giq_option(4, SCRIPT_ARADESH, 160, aradesh19, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_ARADESH, 151, aradesh24c, NEUTRAL_REACTION);
  giq_option(-3, SCRIPT_ARADESH, 156, aradesh36, NEUTRAL_REACTION);
end

procedure aradesh14
begin
  gsay_reply(SCRIPT_ARADESH, 144);
  giq_option(5, SCRIPT_ARADESH, 145, aradesh06, BAD_REACTION);
  giq_option(4, SCRIPT_ARADESH, 146, aradesh04, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_ARADESH, 147, aradesh07, BAD_REACTION);
end

procedure aradesh15
begin
  gsay_message(SCRIPT_ARADESH, 148, NEUTRAL_REACTION);
  call aradeshx;
end

procedure aradesh16
begin
  gsay_reply(0, 0);
  giq_option(8, SCRIPT_ARADESH, 149, aradesh25, NEUTRAL_REACTION);
  giq_option(5, SCRIPT_ARADESH, 150, aradesh16_2, NEUTRAL_REACTION);
  giq_option(5, SCRIPT_ARADESH, 151, aradesh24c, NEUTRAL_REACTION);
end

procedure aradesh16_2
begin
  if (global_var(GVAR_RADSCORPION_SEED) == 0) then begin
    call aradesh28;
  end
  else begin
    if (global_var(GVAR_RADSCORPION_SEED) == 1) then begin
      call aradesh30a;
    end
    else begin
      if ((global_var(GVAR_RADSCORPION_SEED) == 2) and not(global_var(GVAR_TANDI_STATUS) == 2)) then begin
        call aradesh31;
      end
      else begin
        if (global_var(GVAR_TANDI_STATUS) == 2) then begin
          call aradesh35;
        end
        else begin
          call aradesh26;
        end
      end
    end
  end
end

procedure aradesh17
begin
  gsay_reply(SCRIPT_ARADESH, 152);
  giq_option(4, SCRIPT_ARADESH, 153, aradesh19, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_ARADESH, 154, aradesh17_2, NEUTRAL_REACTION);
  giq_option(5, SCRIPT_ARADESH, 155, aradesh17_3, BAD_REACTION);
  giq_option(-3, SCRIPT_ARADESH, 156, aradesh36, NEUTRAL_REACTION);
end

procedure aradesh17_2
begin
  if (global_var(GVAR_TANDI_STATUS) == 2) then begin
    call aradesh44;
  end
  else begin
    call aradesh20;
  end
end

procedure aradesh17_3
begin
  set_local_var(9, local_var(9) + 1);
  call Down_React;
  if (global_var(GVAR_TANDI_STATUS) == 2) then begin
    call aradesh27;
  end
  else begin
    if (local_var(1) >= 2) then begin
      if (local_var(1) >= 3) then begin
        call aradesh27;
      end
      else begin
        call aradesh21;
      end
    end
    else begin
      call aradesh22;
    end
  end
end

procedure aradesh18
begin
  if (local_var(1) >= 2) then begin
    gsay_reply(SCRIPT_ARADESH, 157);
  end
  else begin
    gsay_reply(SCRIPT_ARADESH, 158);
  end
  giq_option(5, SCRIPT_ARADESH, 159, aradesh23, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_ARADESH, 160, aradesh19, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_ARADESH, 161, aradesh17_2, NEUTRAL_REACTION);
  giq_option(-3, SCRIPT_ARADESH, 162, aradesh36, NEUTRAL_REACTION);
end

procedure aradesh19
begin
  if (local_var(1) >= 2) then begin
    gsay_reply(SCRIPT_ARADESH, 163);
  end
  else begin
    gsay_reply(SCRIPT_ARADESH, 164);
  end
  giq_option(5, SCRIPT_ARADESH, 165, aradesh25, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_ARADESH, 166, aradesh16_2, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_ARADESH, 167, aradesh24c, NEUTRAL_REACTION);
end

procedure aradesh20
begin
  if (local_var(1) >= 3) then begin
    gsay_message(SCRIPT_ARADESH, 168, NEUTRAL_REACTION);
  end
  else begin
    if (local_var(1) >= 2) then begin
      gsay_message(SCRIPT_ARADESH, 169, NEUTRAL_REACTION);
    end
    else begin
      gsay_message(SCRIPT_ARADESH, 170, NEUTRAL_REACTION);
    end
  end
  call aradeshx;
end

procedure aradesh21
begin
  gsay_message(SCRIPT_ARADESH, 171, NEUTRAL_REACTION);
  call aradeshx;
end

procedure aradesh22
begin
  gsay_message(SCRIPT_ARADESH, 172, NEUTRAL_REACTION);
  call aradeshx1;
end

procedure aradesh23
begin
  if (local_var(1) >= 2) then begin
    gsay_reply(SCRIPT_ARADESH, 173);
  end
  else begin
    gsay_reply(SCRIPT_ARADESH, 174);
  end
  giq_option(4, SCRIPT_ARADESH, 175, aradesh23_2, NEUTRAL_REACTION);
  giq_option(5, SCRIPT_ARADESH, 176, aradesh25, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_ARADESH, 177, aradesh17_2, NEUTRAL_REACTION);
end

procedure aradesh23_2
begin
  if (local_var(1) >= 2) then begin
    call aradesh24;
  end
  else begin
    call aradesh24b;
  end
end

procedure aradesh24
begin
  gsay_reply(SCRIPT_ARADESH, 178);
  giq_option(0, SCRIPT_ARADESH, 179, aradesh24a, NEUTRAL_REACTION);
end

procedure aradesh24a
begin
  gsay_reply(SCRIPT_ARADESH, 180);
  giq_option(4, SCRIPT_ARADESH, 181, aradesh19, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_ARADESH, 182, aradesh24c, NEUTRAL_REACTION);
end

procedure aradesh24b
begin
  gsay_reply(SCRIPT_ARADESH, 183);
  giq_option(4, SCRIPT_ARADESH, 184, aradesh19, NEUTRAL_REACTION);
end

procedure aradesh24c
begin
  if (global_var(GVAR_TANDI_STATUS) == 2) then begin
    call aradesh44;
  end
  else begin
    call aradeshx;
  end
end

procedure aradesh25
begin
  if (local_var(0) < 2) then begin
    gsay_reply(SCRIPT_ARADESH, 185);
  end
  else begin
    gsay_reply(SCRIPT_ARADESH, 186);
  end
  giq_option(4, SCRIPT_ARADESH, 187, aradesh19, NEUTRAL_REACTION);
end

procedure aradesh26
begin
  gsay_reply(SCRIPT_ARADESH, 188);
  giq_option(7, SCRIPT_ARADESH, 189, aradesh27, NEUTRAL_REACTION);
  giq_option(6, SCRIPT_ARADESH, 190, aradesh19, NEUTRAL_REACTION);
  giq_option(6, SCRIPT_ARADESH, 191, aradesh24c, NEUTRAL_REACTION);
end

procedure aradesh27
begin
  gsay_reply(SCRIPT_ARADESH, 192);
  giq_option(8, SCRIPT_ARADESH, 193, aradesh25, NEUTRAL_REACTION);
  giq_option(5, SCRIPT_ARADESH, 194, aradesh16_2, NEUTRAL_REACTION);
  giq_option(5, SCRIPT_ARADESH, 195, aradesh24c, NEUTRAL_REACTION);
end

procedure aradesh28
begin
  gsay_reply(SCRIPT_ARADESH, 196);
  giq_option(4, SCRIPT_ARADESH, 197, aradesh28a, NEUTRAL_REACTION);
end

procedure aradesh28a
begin
  gsay_reply(SCRIPT_ARADESH, 198);
  giq_option(4, SCRIPT_ARADESH, 199, aradesh29, GOOD_REACTION);
  giq_option(4, SCRIPT_ARADESH, 200, aradesh28b, BAD_REACTION);
  giq_option(4, SCRIPT_ARADESH, 201, aradesh28c, BAD_REACTION);
end

procedure aradesh28b
begin
  set_local_var(9, local_var(9) + 1);
  call Down_React;
  call aradesh30;
end

procedure aradesh28c
begin
  set_local_var(9, local_var(9) + 1);
  call Down_React;
  call aradesh19;
end

procedure aradesh29
begin
  gsay_message(SCRIPT_ARADESH, 202, NEUTRAL_REACTION);
  set_global_var(GVAR_RADSCORPION_SEED, 1);
  call aradeshx;
end

procedure aradesh30
begin
  gsay_reply(SCRIPT_ARADESH, 203);
  giq_option(5, SCRIPT_ARADESH, 204, aradesh30b, GOOD_REACTION);
  giq_option(4, SCRIPT_ARADESH, 205, aradesh19, NEUTRAL_REACTION);
end

procedure aradesh30a
begin
  gsay_message(SCRIPT_ARADESH, 206, NEUTRAL_REACTION);
  call aradeshx;
end

procedure aradesh30b
begin
  call Up_React;
  call aradesh29;
end

procedure aradesh31
begin
  gsay_reply(SCRIPT_ARADESH, 207);
  giq_option(4, SCRIPT_ARADESH, 208, aradesh19, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_ARADESH, 209, aradesh32, NEUTRAL_REACTION);
end

procedure aradesh32
begin
  gsay_reply(SCRIPT_ARADESH, 210);
  giq_option(4, SCRIPT_ARADESH, 211, aradesh19, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_ARADESH, 212, aradesh17_2, NEUTRAL_REACTION);
end

procedure aradesh33
begin
  gsay_message(SCRIPT_ARADESH, 213, NEUTRAL_REACTION);
  set_global_var(GVAR_RESCUE_TANDI, 1);
  call aradeshx;
end

procedure aradesh35
begin
  gsay_reply(SCRIPT_ARADESH, 214);
  giq_option(5, SCRIPT_ARADESH, 215, aradesh25, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_ARADESH, 216, aradesh16_2, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_ARADESH, 217, aradesh24c, NEUTRAL_REACTION);
end

procedure aradesh36
begin
  gsay_message(SCRIPT_ARADESH, 218, NEUTRAL_REACTION);
  call aradeshx;
end

procedure aradesh37
begin
  gsay_reply(SCRIPT_ARADESH, 219);
  if (global_var(GVAR_TANDI_STATUS) == 3) then begin
    giq_option(5, SCRIPT_ARADESH, 220, aradesh38, NEUTRAL_REACTION);
    giq_option(4, SCRIPT_ARADESH, 221, aradesh37a, NEUTRAL_REACTION);
    giq_option(-3, SCRIPT_ARADESH, 222, aradesh37a, NEUTRAL_REACTION);
  end
  else begin
    giq_option(4, SCRIPT_ARADESH, 223, aradesh38, NEUTRAL_REACTION);
    giq_option(5, SCRIPT_ARADESH, 224, aradesh19, NEUTRAL_REACTION);
    giq_option(-3, SCRIPT_ARADESH, 225, aradesh38, NEUTRAL_REACTION);
  end
end

procedure aradesh37a
begin
  gsay_message(SCRIPT_ARADESH, 226, NEUTRAL_REACTION);
  call aradeshx5;
end

procedure aradesh38
begin
  gsay_message(SCRIPT_ARADESH, 227, NEUTRAL_REACTION);
  call aradeshx;
end

procedure aradesh39
begin
  set_global_var(GVAR_TALKED_ABOUT_TANDI, 1);
  gsay_reply(SCRIPT_ARADESH, 228);
  giq_option(4, SCRIPT_ARADESH, 229, aradesh39a, NEUTRAL_REACTION);
  giq_option(-3, SCRIPT_ARADESH, 230, aradesh33, NEUTRAL_REACTION);
end

procedure aradesh39a
begin
  gsay_reply(SCRIPT_ARADESH, 231);
  giq_option(4, SCRIPT_ARADESH, 232, aradesh39b, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_ARADESH, 233, aradesh41, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_ARADESH, 234, aradesh39c, NEUTRAL_REACTION);
end

procedure aradesh39b
begin
  call Up_React;
  set_global_var(GVAR_RESCUE_TANDI, 1);
  call aradesh40;
end

procedure aradesh39c
begin
  set_local_var(9, local_var(9) + 1);
  call Down_React;
  call aradesh42;
end

procedure aradesh40
begin
  variable LVar0 := 0;
  gsay_reply(SCRIPT_ARADESH, 235);
  set_global_var(GVAR_RESCUE_TANDI, 1);
  LVar0 := create_object_sid(7, 0, 0, -1);
  add_obj_to_inven(dude_obj, LVar0);
  giq_option(4, SCRIPT_ARADESH, 236, aradesh40a, NEUTRAL_REACTION);
end

procedure aradesh40a
begin
  gsay_message(SCRIPT_ARADESH, 237, NEUTRAL_REACTION);
  call aradeshx;
end

procedure aradesh41
begin
  gsay_reply(SCRIPT_ARADESH, 238);
  giq_option(4, SCRIPT_ARADESH, 239, aradesh40, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_ARADESH, 240, aradesh42, NEUTRAL_REACTION);
end

procedure aradesh42
begin
  gsay_message(SCRIPT_ARADESH, 241, NEUTRAL_REACTION);
  call aradeshx3;
end

procedure aradesh43
begin
  variable LVar0 := 0;
  if (local_var(8) == 0) then begin
    set_local_var(8, 1);
    LVar0 := create_object_sid(41, 0, 0, -1);
    add_mult_objs_to_inven(dude_obj, LVar0, 500);
  end
  call Top_React;
  set_global_var(GVAR_RESCUE_TANDI, 2);
  gsay_reply(SCRIPT_ARADESH, 242);
  giq_option(4, SCRIPT_ARADESH, 243, aradesh19, NEUTRAL_REACTION);
  giq_option(4, SCRIPT_ARADESH, 244, aradesh44, NEUTRAL_REACTION);
end

procedure aradesh44
begin
  gsay_message(SCRIPT_ARADESH, 245, NEUTRAL_REACTION);
  call aradeshx;
end

procedure aradesh45
begin
  set_local_var(9, local_var(9) + 1);
  call Big_Down_React;
  float_msg(self_obj, message_str(SCRIPT_ARADESH, 246), FLOAT_MSG_LIGHT_RED);
  call aradeshx;
end

procedure aradesh46
begin
  set_local_var(9, local_var(9) + 1);
  call Big_Down_React;
  float_msg(self_obj, message_str(SCRIPT_ARADESH, 247), FLOAT_MSG_LIGHT_RED);
  call aradeshx;
end

procedure aradesh47
begin
  set_local_var(9, local_var(9) + 1);
  call Down_React;
  gsay_message(SCRIPT_ARADESH, 248, NEUTRAL_REACTION);
  call aradeshx;
end

procedure aradesh48
begin
  set_local_var(9, local_var(9) + 1);
  call Down_React;
  gsay_message(SCRIPT_ARADESH, 249, NEUTRAL_REACTION);
end

procedure aradeshx
begin
end

procedure aradeshx1
begin
  world_map;
end

procedure aradeshx2
begin
  world_map;
end

procedure aradeshx3
begin
end

procedure aradeshx5
begin
  set_local_var(7, 1);
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

procedure aradesh49
begin
  gsay_message(SCRIPT_ARADESH, 250, NEUTRAL_REACTION);
end

procedure aradesh49a
begin
  gsay_message(SCRIPT_ARADESH, 251, NEUTRAL_REACTION);
end

procedure aradesh50
begin
  gsay_message(SCRIPT_ARADESH, 252, NEUTRAL_REACTION);
end

procedure aradesh51
begin
  gsay_message(SCRIPT_ARADESH, 253, NEUTRAL_REACTION);
end

procedure aradesh52
begin
  gsay_message(SCRIPT_ARADESH, 254, NEUTRAL_REACTION);
end

procedure aradesh53
begin
  gsay_message(SCRIPT_ARADESH, 255, NEUTRAL_REACTION);
end

procedure aradesh54
begin
  gsay_message(SCRIPT_ARADESH, 256, NEUTRAL_REACTION);
end

procedure aradesh55
begin
  gsay_message(SCRIPT_ARADESH, 257, NEUTRAL_REACTION);
end

procedure aradesh56
begin
  gsay_message(SCRIPT_ARADESH, 258, NEUTRAL_REACTION);
end

procedure aradesh57
begin
  gsay_message(SCRIPT_ARADESH, 259, NEUTRAL_REACTION);
end

procedure aradesh58
begin
  gsay_message(SCRIPT_ARADESH, 260, NEUTRAL_REACTION);
end

procedure aradesh59
begin
  gsay_message(SCRIPT_ARADESH, 261, NEUTRAL_REACTION);
end

procedure aradesh60
begin
  gsay_message(SCRIPT_ARADESH, 262, NEUTRAL_REACTION);
end

procedure aradesh61
begin
  gsay_message(SCRIPT_ARADESH, 263, NEUTRAL_REACTION);
end

procedure aradesh62
begin
  gsay_message(SCRIPT_ARADESH, 264, NEUTRAL_REACTION);
end

procedure aradesh63
begin
  gsay_message(SCRIPT_ARADESH, 265, NEUTRAL_REACTION);
end

procedure aradesh64
begin
  gsay_message(SCRIPT_ARADESH, 266, NEUTRAL_REACTION);
end

procedure aradesh65
begin
  gsay_message(SCRIPT_ARADESH, 267, NEUTRAL_REACTION);
end

procedure aradesh66
begin
  gsay_message(SCRIPT_ARADESH, 268, NEUTRAL_REACTION);
end

procedure aradesh67
begin
  gsay_message(SCRIPT_ARADESH, 269, NEUTRAL_REACTION);
end

procedure aradesh68
begin
  gsay_message(SCRIPT_ARADESH, 270, NEUTRAL_REACTION);
end

procedure aradesh69
begin
  gsay_message(SCRIPT_ARADESH, 271, NEUTRAL_REACTION);
end

procedure aradesh70
begin
  gsay_message(SCRIPT_ARADESH, 272, NEUTRAL_REACTION);
end

procedure aradesh71
begin
  gsay_message(SCRIPT_ARADESH, 273, NEUTRAL_REACTION);
end

procedure aradesh72
begin
  gsay_message(SCRIPT_ARADESH, 274, NEUTRAL_REACTION);
end

procedure aradesh73
begin
  gsay_message(SCRIPT_ARADESH, 275, NEUTRAL_REACTION);
end
