// .txt

beginzonescript;

variables;

short im_hostile = 0;
short max_crime = 5;
short last_abil;
short counter = 0;
short did_att = 0;

body;

beginstate INIT_STATE;
	last_abil = get_current_tick();

	add_range_to_group(4752,4757,13);
	set_name(30013,"Barghan Warrior");
	set_boss_level(30013,1);
	
	set_name(4758,"Barghan Farmer");
	set_courage(4758,0);
	set_name(4759,"Barghan Farmer");
	set_courage(4759,0);
	set_name(4760,"Barghan Farmer");
	set_courage(4760,0);
	set_name(4761,"Barghan Farmer");
	set_courage(4761,0);
	set_name(4762,"Barghan Farmer");
	set_courage(4762,0);

	if (gf(30,10) > 0) {
		set_attitude(30013,10);
		set_attitude(4758,10);
		set_attitude(4759,10);
		set_attitude(4760,10);
		set_attitude(4761,10);
		set_attitude(4762,10);
		}
		
	add_range_to_group(4763,4767,14);
	add_range_to_group(4768,4773,15);
	set_name(4768,"Fang Clan Warrior");
	set_name(4769,"Fang Clan Warrior");
	set_name(4770,"Fang Clan Nephil");
	set_name(4771,"Fang Clan Nephil");
	set_name(4772,"Fang Clan Nephil");
	set_name(4773,"Fang Clan Shaman");
	change_max_health(4773,150);
	
	set_name(4777,"Omak");
	set_boss_level(4777,1);
	set_attack_bonus(4777,8);
	add_range_to_group(4777,4783,16);
	
	set_aggression(4784,40);
	set_aggression(4785,40);
	set_aggression(4786,40);
	

//	add_range_to_group(,,groupn);

	set_crime_tolerance(max_crime);

	break;

beginstate EXIT_STATE;

break;

beginstate START_STATE;
	if (did_att == 0) {
		if ((char_ok(4777) == FALSE) || (get_attitude(4777) >= 10)) 
			did_att = 1;
		if ((char_ok(4778) == FALSE) || (get_attitude(4778) >= 10)) 
			did_att = 1;
		if ((char_ok(4779) == FALSE) || (get_attitude(4779) >= 10)) 
			did_att = 1;
		if ((char_ok(4780) == FALSE) || (get_attitude(4780) >= 10)) 
			did_att = 1;
		if ((char_ok(4781) == FALSE) || (get_attitude(4781) >= 10)) 
			did_att = 1;
		if ((char_ok(4782) == FALSE) || (get_attitude(4782) >= 10)) 
			did_att = 1;
		if ((char_ok(4783) == FALSE) || (get_attitude(4783) >= 10)) 
			did_att = 1;
		if (did_att > 0) {
			set_attitude(30016,10);
			alert_char(30016);
			}
		}
		
	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(4777,"Puny Avernite.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4777,"This our farm.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(4777,"Go away.");
	//	}

	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(44,5) == 0)
				sf(44,5,1);
				else sf(44,5,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);
