#include <define.h>

//#define NAME                    SCRIPT_

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



procedure start;
#include <push.h>
procedure do_stuff;
procedure ladderend;
procedure ladder01;

variable damage;
variable testa;
variable testb;
variable open;
//variable dude_tile;


procedure start
begin
if (script_action == use_proc) then begin
    load_map("VaultEnt.map", 1);
  end
end

procedure do_stuff
begin
  testa := do_check(dude_obj, 5, 2);
  script_overrides;
  call ladder01;
end

procedure ladderend
begin
end

procedure ladder01
begin
  if (is_success(testa)) then begin
    display_msg(message_str(SCRIPT_BVLAD, 100));
  end
  else begin
    if (is_critical(testa)) then begin
      damage := random(1, 6) + random(1, 6) + random(1, 6) - 9;
      if (damage < 1) then begin
        display_msg(message_str(SCRIPT_BVLAD, 101));
      end
      else begin
        display_msg(message_str(SCRIPT_BVLAD, 102) + damage + message_str(SCRIPT_BVLAD, 103));
        critter_dmg(dude_obj, damage, 0);
      end
    end
    else begin
      display_msg(message_str(SCRIPT_BVLAD, 104));
    end
    move_to(dude_obj, local_var(1), local_var(2));
  end
end