#include <define.h>

//#define NAME                    SCRIPT_

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



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

import variable field_change;


procedure start
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

procedure use_p_proc
begin
	if (cur_map_index == MAP_MBSTRG12) then begin
		field_change := "toggle";
		use_obj(map_var(0));
		use_obj(map_var(1));
		use_obj(map_var(2));
		use_obj(map_var(3));
		use_obj(map_var(4));
		use_obj(map_var(5));
		use_obj(map_var(6));
		use_obj(map_var(7));
	end
	else begin
		if (cur_map_index == MAP_MBVATS12) then begin
			field_change := "toggle";
			use_obj(map_var(5));
		end
	end
end

procedure use_skill_on_p_proc
begin
	if (action_being_used == 13) then begin
		script_overrides;
		display_msg(message_str(SCRIPT_TOGGLE, 100));
	end
	else begin
		if (action_being_used == 12) then begin
			script_overrides;
			display_msg(message_str(SCRIPT_TOGGLE, 101));
		end
	end
end