// v1.0.0
// specobj.txt
// Spiderweb Software (spidweb@spidweb.com)

// Version History:
//   v1.0.0 - Original version by Jeff Vogel.

// This very simple script waits until this object is searched. When it is, it
// calls a state in the current town's script.

// Memory Cells:
//   0 - State number. This is the number of the state called from the town's
//     script when the party causes the SEARCH_STATE in this script to be
//     entered.

// 1,2 - SDF coordinates. If these are left at 0 and 0, these memory cells are
//     ignored. Otherwise, the SDF is set to 1 when the SEARCH_STATE is entered.

beginterrainscript;

variables;

body;

beginstate INIT_STATE;
break;

beginstate START_STATE;
break;

beginstate SEARCH_STATE;
	if ((get_memory_cell(1) > 0) || (get_memory_cell(2) > 0))
		if (get_flag(get_memory_cell(1),get_memory_cell(2)) > 0) {
			print_str_color("You can't do anything with this anymore.",2);
			end();
		}
	run_town_script(get_memory_cell(0));
break;