#include <define.h>

//#define NAME                    SCRIPT_

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



procedure start;
#include <push.h>

variable lit;


procedure start
begin
	if (script_action == use_obj_on_proc) then begin
		scr_return(0);
		if ((lit != 1) and (lit != 2)) then begin
			obj_set_light_level(self_obj, 100, 7);
			display_msg(message_str(SCRIPT_FLARE, 100));
			lit := 1;
			add_timer_event(self_obj, game_ticks(1800 * 3), 1);
		end
		else begin
			display_msg(message_str(SCRIPT_FLARE, 101));
		end
	end
	else begin
		if (script_action == timed_event_proc) then begin
			if (fixed_param == 1) then begin
				obj_set_light_level(self_obj, 80, 7);
				add_timer_event(self_obj, game_ticks(900 * 3), 2);
			end
			else begin
				if (fixed_param == 2) then begin
					obj_set_light_level(self_obj, 60, 7);
					add_timer_event(self_obj, game_ticks(450 * 3), 3);
				end
				else begin
					if (fixed_param == 3) then begin
						obj_set_light_level(self_obj, 0, 1);
						lit := 2;
						display_msg(message_str(SCRIPT_FLARE, 102));
					end
				end
			end
		end
		else begin
			if (script_action == look_at_proc) then begin
				script_overrides;
				if (lit == 1) then begin
					display_msg(message_str(SCRIPT_FLARE, 103));
				end
				else begin
					if (lit == 2) then begin
						display_msg(message_str(SCRIPT_FLARE, 104));
					end
					else begin
						display_msg(message_str(SCRIPT_FLARE, 105));
					end
				end
			end
		end
	end
end