#include <define.h>

//#define NAME                    SCRIPT_

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



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


procedure start
begin
	if (script_action == use_proc) then begin
		call use_p_proc;
	end
	else begin
		if (script_action == use_obj_on_proc) then begin
			call use_obj_on_p_proc;
		end
	end
end

procedure use_p_proc
begin
	if (map_var(0) == 1) then begin
		load_map("Glow1.map", 1);
	end
	else begin
		script_overrides;
		display_msg(message_str(SCRIPT_ROPE, 102));
	end
end

procedure use_obj_on_p_proc
begin
	variable LVar0 := 0;
	if (obj_pid(obj_being_used_with) == 127) then begin
		script_overrides;
		set_map_var(0, 1);
		rm_obj_from_inven(dude_obj, obj_being_used_with);
		destroy_object(obj_being_used_with);
		LVar0 := create_object_sid(33555000, tile_num(self_obj), elevation(self_obj), 511);
		display_msg(message_str(SCRIPT_ROPE, 103));
	end
end