// .txt

beginzonescript;

variables;

short im_hostile = 0;
short max_crime = 200;
short last_abil;
short counter = 0;

body;

beginstate INIT_STATE;
	last_abil = get_current_tick();

//	set_name(,"");
//	add_range_to_group(,,groupn);

	set_crime_tolerance(max_crime);

	sf(163,9,1);
	sf(163,10,0);
	if (gf(163,1) > 0)
		sf(163,10,1);
		
	set_aggression(17604,60);
	set_aggression(17605,60);
	set_aggression(17606,60);
	set_aggression(17607,60);
	set_aggression(17608,60);
	
	add_range_to_group(17609,17613,37);
	set_name(30037,"Huge Lizard");
	set_level(30037,12);
	set_aggression(30037,60);
	
	add_range_to_group(17614,17617,38);
	set_name(30038,"Huge Lizard");
	set_level(30038,12);
	set_aggression(30038,60);
	
	add_range_to_group(17622,17627,39);
	set_name(30039,"Pit Lizard");
	set_level(30039,12);
	set_aggression(30039,50);

	set_name(17642,"Crypt Ghast");
	change_max_health(17642,80);
	
	if (gf(163,6) > 0) {
		set_terrain(0,622,725,0);
		set_terrain(0,623,725,0);
		set_terrain(0,624,725,0);
		set_terrain(0,622,726,0);
		set_terrain(0,623,726,0);
		set_terrain(0,624,726,0);
		}	
	break;

beginstate EXIT_STATE;

break;

beginstate START_STATE;
	if (party_within_dist(624,764,7))
		begin_talk_mode(2);
		
	//if ((get_crime_level() >= max_crime) && (im_hostile == 0)) {
	//	make_zone_hostile();
	//	im_hostile = 1;
	//	}

	// if (gf(,) == 0) {
	//if (get_ran(1,0,100) < 10)
	//	give_char_text_bubble(,"");
	//	}

	if (((is_combat()) && (tick_difference(last_abil,get_current_tick()) > 0)) || ((is_group()) && (tick_difference(last_abil,get_current_tick()) > 5))) {
		last_abil = get_current_tick();
		
		counter = counter + 1;
		if (counter == 5) {
			counter = 0;
			if (gf(163,8) == 0)
				sf(163,8,1);
				else sf(163,8,0);
			}
			
		}
break;

beginstate 10;
break;

beginstate 11;
break;

beginstate 12;
break;

beginstate 13;
break;

//	print_str("");
//	set_terrain_string_range(".",1);
//	set_terrain_string_range("The sign says - .",1);
