#include <define.h>

//#define NAME                    SCRIPT_

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



procedure start;
#include <push.h>
procedure use_p_proc;
procedure use_skill_on_p_proc;

variable Hacked;


procedure start
begin
	if (script_action == look_at_proc) then begin
		script_overrides;
		display_msg(message_str(SCRIPT_MACHIV, 100));
	end
	else begin
		if (script_action == use_proc) then begin
			call use_p_proc;
		end
		else begin
			if (script_action == use_skill_on_proc) then begin
				if (action_being_used == 12) then begin
					call use_skill_on_p_proc;
				end
			end
		end
	end
end

procedure use_p_proc
begin
	variable LVar0 := 0;
	if (Hacked == 0) then begin
		script_overrides;
		display_msg(message_str(SCRIPT_MORPCOMP, 105));
	end
	else begin
		script_overrides;
		display_msg(message_str(SCRIPT_MORPCOMP, 107));
	end
end

procedure use_skill_on_p_proc
begin
	variable LVar0 := 0;
	LVar0 := roll_vs_skill(dude_obj, 12, 0);
	if (is_success(LVar0)) then begin
		script_overrides;
		display_msg(message_str(SCRIPT_MORPCOMP, 107));
		Hacked := 1;
	end
	else begin
		script_overrides;
		display_msg(message_str(SCRIPT_MORPCOMP, 106));
	end
end