// specobj.txt - This very simple script waits until this object is searched. When it
// is, calls a given special node in the current town's script.

// Memory Cells - 
//   0 - Number of a state in the town script. This is the state that is called when the item is used.
//   1,2 - Coordinates for a stuff done flag. If these are 0 and 0, ignored. Otherwise,
//     is the given flag is non-zero, nothing happens when the object is used.

beginterrainscript; 

variables;

body;

beginstate INIT_STATE;
	set_ter_script_mode(my_number(),2);

	break;

beginstate START_STATE;

	if (get_flag(3,2) >= 1)
		end();

	if ((is_object_on_space(12,6,4) != 1) && (town_status(-1) == 2)) {
		pause(2);
		put_sparkles_on_space(11,6,2,6);
		put_sparkles_on_space(12,6,2,6);
		put_sparkles_on_space(13,6,2,6);
		put_object_on_space(11,6,4);
		put_object_on_space(12,6,4);
		put_object_on_space(13,6,4);
		run_animation_sound(24);
		force_instant_terrain_redraw();
		message_dialog("The magic barrier reforms itself to its starting spot. Complex magics like this require a lot of power. This would mean that someone or something is keeping this barrier active. Hopefully, you can find what is creating it.","And disable it.");
}
		

	if (get_flag(get_memory_cell(0),get_memory_cell(1)) == get_memory_cell(2)) {
		
}
break;

beginstate SEARCH_STATE;

break;

