// talkobj.txt 

// A very simple and important script. When the object is used, begins a conversation.
// Can set a SDF to turn off talking when a condition is met.

// Cell 0 - The talk ndo eot begin the conversation at. If this is left at 0,
//   we call the special encoutner in cell 4 instead
// Cell 1,2 - A stuff done flag. if non-zero, the converation no longer
//   happens when the object is used. These can both be left at 0 (for no flag).
// Cell 3 - Of 1, use a no exit talk, otherwise a regulare talk
// Cell 4 - The special encounter to run when this is used. Only used if
//   cell 0 is left at 0.

beginobjectscript; // talking object

variables;

body;

beginstate INIT_STATE;
	break;

beginstate DEAD_STATE;
	break;

beginstate START_STATE; 
	break;

beginstate USE_STATE;
	if ((get_memory_cell(1) > 0) || (get_memory_cell(2) > 0)) {
		if (get_sdf(get_memory_cell(1),get_memory_cell(2)) > 0) {
			print_str_color("You can't do anything else with this.",2);
			end();
			}
		}
	if (get_memory_cell(0) == 0)
		run_special(get_memory_cell(4));
		else if (get_memory_cell(3) > 0)
			talk_no_exit(get_memory_cell(0));
			else begin_talk_mode(get_memory_cell(0));
break;
