#include <define.h>

//#define NAME                    SCRIPT_

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



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


procedure start
begin
	if (script_action == look_at_proc) then begin
		call look_at_p_proc;
	end
	else begin
		if (script_action == use_skill_on_proc) then begin
			call use_skill_on_p_proc;
		end
	end
end

procedure look_at_p_proc
begin
	script_overrides;
	display_msg(message_str(SCRIPT_VCOMPOP, 100));
	if (global_var(GVAR_FIND_WATER_CHIP) == 2) then begin
		display_msg(message_str(SCRIPT_VCOMPOP, 104));
	end
end

procedure use_skill_on_p_proc
begin
	script_overrides;
	if (global_var(GVAR_FIND_WATER_CHIP) == 2) then begin
		display_msg(message_str(SCRIPT_VCOMPOP, 104));
	end
	else begin
		if (action_being_used == 13) then begin
			if (is_success(roll_vs_skill(dude_obj, 13, 0))) then begin
				display_msg(message_str(SCRIPT_VCOMPOP, 101));
			end
			else begin
				display_msg(message_str(SCRIPT_VCOMPOP, 102));
			end
		end
		else begin
			display_msg(message_str(SCRIPT_VCOMPOP, 103));
		end
	end
end