//wheel.txt - A wheel that opens/closes nearby gates.
//Cell 0 - The strength necessary to open the gate. One pc has to have it.
// Cell 1 - Range of open gates, if left at 0, range is 4

beginobjectscript; // door lever

variables;

short range = 4;

body;


beginstate INIT_STATE;


	break;

beginstate DEAD_STATE;

break;

beginstate START_STATE; 

break;

beginstate USE_STATE;
	if ((get_memory_cell(0) == 0) && (gf(90,27) == 0)) 
		begin_talk_mode(22);
	if ((get_memory_cell(0) == 1) && (gf(90,28) == 0)) 
		begin_talk_mode(22);
	if ((get_memory_cell(0) == 2) && (gf(90,29) == 0)) 
		begin_talk_mode(22);

	broadcast_object_message(6,105);
	print_str_color("Turn Wheel: You turn the wheel.",2);
	pc_heard_sound(193);
break;

beginstate UNLOCK_STATE;
	print_str_color("Unlock Spell: The spell doesn't affect wheels.",1);	
break;
