// .txt

beginzonescript;

variables;

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

body;

beginstate INIT_STATE;
	last_abil = get_current_tick();

	set_name(15886,"Vira the Tinker");
	set_name(15887,"Nephar Bodyguard");
	set_name(15888,"Nephar Bodyguard");
	set_name(15896,"Igner");
	set_level(15896,15);
	set_name(15903,"Avernite Farmer");
	set_name(15904,"Avernite Farmer");
	
	add_range_to_group(15890,15895,25);
	set_name(30025,"Avernite Soldier");
	
	add_range_to_group(15897,15902,26);
	set_name(30026,"Avernite Refugee");
	set_courage(30026,0);
	
	set_crime_tolerance(max_crime);

	if (gf(147,2) == 0)
		sf(147,3,0);
		
	break;

beginstate EXIT_STATE;

break;

beginstate START_STATE;
		
	if ((get_crime_level() >= max_crime) && (im_hostile == 0)) {
		make_zone_hostile();
		im_hostile = 1;
		sf(147,5,1);
		}

	if (gf(147,5) == 0) {
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(15886,"Need a weapon?");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(15886,"Buying and selling!");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(15886,"Vira is here for you.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(15886,"Let me lighten your burden.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(15890 + get_ran(1,0,5),"Hail to you.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(15890 + get_ran(1,0,5),"Watch yourself.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(15890 + get_ran(1,0,5),"Bandits to the south.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(15890 + get_ran(1,0,5),"Foul skribbane eaters!");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(15890 + get_ran(1,0,5),"Accursed refugees.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(15897 + get_ran(1,0,5),"Spare some coppers?");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(15897 + get_ran(1,0,5),"News from the portal?");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(15897 + get_ran(1,0,5),"Need to pass Almaria.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(15897 + get_ran(1,0,5),"We don't eat skribbane.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(15897 + get_ran(1,0,5),"We are peaceful.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(15903 + get_ran(1,0,1),"Please leave.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(15903 + get_ran(1,0,1),"You are trespassing.");
		}

	//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();
	//	}
break;

beginstate 10;
	set_terrain_string_range("This farmhouse looks like it has been abandoned for months.",1);
break;

beginstate 11;
	set_terrain_string_range("This stone storage hut has been abandoned and thoroughly looted.",1);
break;

beginstate 12;
break;

beginstate 13;
break;

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