// Search-Block v1.1.0
// searchblock.txt (variant of specobj.txt)
// by Kelandon (tomwatts@berkeley.edu)
// Renamed dummy.txt for convenience
// 
// Much the same as specobj, but walking into the terrain also triggers the
// script.
//
// New version includes Search-Step and simple Specobj functionality.

// 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,3 - When the state is called. Cells 1, 2, and 3 correspond to being
//		searched, blocking the party's move, and being stepped into; 0 means
//		that the state will be called, and anything else means it won't.

beginterrainscript; 

variables;

body;

beginstate INIT_STATE; // state 0 
break;

beginstate START_STATE; // state 2 
break;

beginstate SEARCH_STATE; // state 100 
if (get_memory_cell(1) == 0)
	run_town_script(get_memory_cell(0));
break;
	
beginstate BLOCK_MOVE_STATE; // state 112
if (get_memory_cell(2) == 0)
	run_town_script(get_memory_cell(0));
break;
	
beginstate STEP_INTO_SPOT_STATE; // state 114
if (get_memory_cell(3) == 0)
	run_town_script(get_memory_cell(0));
break;

beginstate UNLOCK_SPELL_STATE; // state 101 
break; 

beginstate SANCTIFICATION_STATE; // state 102 
break;

beginstate DISPEL_BARRIER_STATE; // state 113 
break; 