// Splashing Pool v1.0
// splashpool.txt 
// by Kelandon (tomwatts@berkeley.edu) 
// A pool that splashes damage.
//
// Memory Cells - 
//	0,1 - Damage to do when splashing. The damage will be a random amount
//		between these two numbers. If cell 1 is left at 0, it defaults to 10.
//	2 - Radius of splashing.
//	3 - Type of damage to do. 6 is usually good.
//		0 - Weapon
//		1 - Fire
//		2 - Poison
//		3 - General Magic
//		4 - Unblockable
//		5 - Cold
//		6 - Acid
//	4 - Who is damaged. If 0, only party-friendly monsters. If 1, only
//		party-hostile monsters. If 2, everyone.
beginterrainscript; 

variables; 
short last_splash;

body; 

beginstate INIT_STATE; // state 0 
	last_splash = get_current_tick();
	
if (get_memory_cell(1) == 0)
	set_memory_cell(1,10);
break; 

beginstate START_STATE; // state 2
	if (tick_difference(last_splash,get_current_tick()) > 0)
		{if (dist_to_party() < get_memory_cell(2))
			print_str("A pool splashes on you!");
	damage_nearby(get_ran(1,get_memory_cell(0),get_memory_cell(1)),get_memory_cell(2),get_memory_cell(3),get_memory_cell(4));
	last_splash = get_current_tick();
	}
break; 

beginstate SEARCH_STATE; // state 100 
break; 

beginstate UNLOCK_SPELL_STATE; // state 101 
break; 

beginstate SANCTIFICATION_STATE; // state 102 
break; 

beginstate BLOCK_MOVE_STATE; // state 112 
break; 

beginstate DISPEL_BARRIER_STATE; // state 113 
break; 

beginstate STEP_INTO_SPOT_STATE; // state 114 
break;