// basicnpc.txt
// A very simple, naive text. Creature attacks anything it hates nearby.
// Once it has won, it returns to its home.
// Script Edited by Lazarus to add some extra features.
// Memory Cells:
//   Cell 0 - How creature moves.
//     0 - If 0, wander randomly. 
//     1 - Stands still until a target appears.
//     2 - Completely immobile, even if target appears.
//   Cell 1 - State to call when creature dies.
//   Cell 2 - group to add creature to.
//   Cell 3 - Dialogue node to start with if talked to. if left at 0, this
//     character doesn't talk.

begincreaturescript;

variables;

short i,target;
short i_gave_alert;

body;

beginstate INIT_STATE;
	set_mobility(ME,0);
	add_char_to_group(my_number(),4);
	break;

beginstate DEAD_STATE;
	set_terrain(my_loc_x(),my_loc_y(),137);
	put_item_on_spot(my_loc_x(),my_loc_y(),497);
	play_sound(-5);
	erase_char(ME);
break;

beginstate START_STATE; 

break;

beginstate 3; // attacking

break;

beginstate TALKING_STATE;
break;