#include <define.h>

//#define NAME                    SCRIPT_

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



procedure start;
#include <push.h>
procedure use_stuff;

variable open;
variable unlocked;


procedure start
begin
	if ((script_action == look_at_proc) or (script_action == description_proc)) then begin
		script_overrides;
		display_msg(message_str(SCRIPT_MVBSHELF, 100));
	end
	else begin
		if (script_action == use_skill_on_proc) then begin
			call use_stuff;
		end
	end
end

procedure use_stuff
begin
	script_overrides;
	if (not(unlocked)) then begin
		display_msg(message_str(SCRIPT_MVBSHELF, 101));
		if (is_success(roll_vs_skill(dude_obj, 11, 0)) or is_success(roll_vs_skill(dude_obj, 9, 0))) then begin
			display_msg(message_str(SCRIPT_MVSCTSHF, 100));
			unlocked := 1;
		end
	end
	else begin
		display_msg(message_str(SCRIPT_MVSCTSHF, 101));
		if (is_success(do_check(dude_obj, 1, 0))) then begin
			display_msg(message_str(SCRIPT_MVSCTSHF, 102));
		end
		if (open) then begin
			animate_stand_reverse_obj(self_obj);
			open := 0;
		end
		else begin
			animate_stand_obj(self_obj);
			open := 1;
		end
	end
end