#include <define.h>

//#define NAME                    SCRIPT_

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



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

variable test;

import variable messing_with_Morbid_stuff;


procedure start
begin
	if (script_action == pickup_proc) then begin
		call pickup_p_proc;
	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
				call use_skill_on_p_proc;
			end
		end
	end
end

procedure pickup_p_proc
begin
	if (source_obj == dude_obj) then begin
		script_overrides;
		display_msg(message_str(SCRIPT_MORBCOOL, 100));
		messing_with_Morbid_stuff := 1;
	end
end

procedure use_p_proc
begin
	if (source_obj == dude_obj) then begin
		script_overrides;
		display_msg(message_str(SCRIPT_MORBCOOL, 101));
		messing_with_Morbid_stuff := 1;
	end
end

procedure use_skill_on_p_proc
begin
	if (action_being_used == 10) then begin
		script_overrides;
		display_msg(message_str(SCRIPT_MORBCOOL, 101));
	end
	else begin
		if (action_being_used == 7) then begin
			test := roll_vs_skill(source_obj, action_being_used, 0);
			if (is_success(test)) then begin
				script_overrides;
				if (is_critical(test)) then begin
					display_msg(message_str(SCRIPT_MORBCOOL, 102));
				end
				else begin
					display_msg(message_str(SCRIPT_MORBCOOL, 104));
				end
			end
			else begin
				script_overrides;
				display_msg(message_str(SCRIPT_MORBCOOL, 103));
			end
		end
	end
end