#include <define.h>

//#define NAME                    SCRIPT_

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



procedure start;
#include <push.h>
procedure search;
procedure skills;

variable use_skill;


procedure start
begin
	if (local_var(0) == 0) then begin
		set_local_var(0, random(1, 9));
	end
	if (script_action == look_at_proc) then begin
		script_overrides;
		call search;
	end
	else begin
		if (script_action == use_skill_on_proc) then begin
			use_skill := action_being_used;
			script_overrides;
			call skills;
		end
	end
end

procedure search
begin
	if (tile_distance_objs(self_obj, dude_obj) > 3) then begin
		display_msg(message_str(SCRIPT_SEMICOMP, 100));
	end
	else begin
		if (local_var(0) == 1) then begin
			display_msg(message_str(SCRIPT_SEMICOMP, 102));
		end
		else begin
			if (local_var(0) == 2) then begin
				display_msg(message_str(SCRIPT_SEMICOMP, 103));
			end
			else begin
				if (local_var(0) == 3) then begin
					display_msg(message_str(SCRIPT_SEMICOMP, 104));
				end
				else begin
					if (local_var(0) == 4) then begin
						display_msg(message_str(SCRIPT_SEMICOMP, 105));
					end
					else begin
						if (local_var(0) == 5) then begin
							display_msg(message_str(SCRIPT_SEMICOMP, 106));
						end
						else begin
							if (local_var(0) == 6) then begin
								display_msg(message_str(SCRIPT_SEMICOMP, 107));
							end
							else begin
								if (local_var(0) == 7) then begin
									display_msg(message_str(SCRIPT_SEMICOMP, 108));
								end
								else begin
									if (local_var(0) == 8) then begin
										display_msg(message_str(SCRIPT_SEMICOMP, 109));
									end
									else begin
										if (local_var(0) == 9) then begin
											display_msg(message_str(SCRIPT_SEMICOMP, 111));
										end
									end
								end
							end
						end
					end
				end
			end
		end
	end
end

procedure skills
begin
	if ((use_skill == 13) or (use_skill == 12)) then begin
		display_msg(message_str(SCRIPT_SEMICOMP, 101));
	end
	else begin
		display_msg(message_str(SCRIPT_SEMICOMP, 102));
	end
end