// .txt

beginzonescript;

variables;

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

body;

beginstate INIT_STATE;
	last_abil = get_current_tick();

	set_name(13830,"Mayor Aznavour");
	set_name(13831,"Captain Puvner");
	set_name(13832,"Sergeant Estragon");
	set_name(13833,"Thrace");
	set_name(13834,"Rippel");
	set_name(13835,"Priestess Kyra");
	set_name(13836,"Pereles");
	set_name(13837,"Patricia");

	set_name(13838,"Incantor Kiril");
	set_boss_level(13838,1);
	set_level(13838,7);
	change_max_health(13838,50);

	add_range_to_group(13839,13841,13);
	set_name(13839,"Zeleny");
	set_boss_level(13839,1);
	set_name(13840,"Ogre Guard");
	//set_boss_level(13840,1);
	set_name(13841,"Ogre Guard");
	//set_boss_level(13841,1);
	
	set_name(13851,"Depot Guard");
	set_name(13852,"Depot Guard");
	set_name(13853,"Depot Guard");
	
	add_range_to_group(13857,13863,14);
	set_name(30014,"Dharmon Refugee");
	add_range_to_group(13864,13870,15);
	set_name(30015,"Dharmon Miner");

	set_name(13871,"Vladimir");
	add_range_to_group(13872,13876,16);
	set_name(30016,"Dharmon Supplicant");

	set_name(13877,"Herb Eater");
	set_new_abil(13877,20);
	set_name(13878,"Herb Eater");
	set_level(13878,15);
	set_new_abil(13878,20);
	set_name(13879,"Herb Eater");
	set_name(13880,"Herb Eater");
	set_courage(13879,0);
	set_courage(13880,0);
	
	set_crime_tolerance(max_crime);

	sf(128,17,0);

	break;

beginstate EXIT_STATE;

break;

beginstate START_STATE;
		
	if ((get_crime_level() >= max_crime) && (im_hostile == 0)) {
		make_zone_hostile(); 
		im_hostile = 1;
		//erase_char(30000);
		begin_talk_mode(299);
		}

	// if (gf(,) == 0) {
	if (gf(128,11) < 2) {
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(13830,"Blosk must be dealt with.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(13830,"Hoarding is illegal!");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(13830,"I will maintain order.");
		}
	if (gf(128,11) >= 2) {
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(13830,"You have done well.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(13830,"They learned their lesson.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(13830,"I will maintain order.");
		}
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13831,"You shouldn't be here.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13831,"Not enough meal.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13831,"When's the next shipment?");
	if ((get_ran(1,0,100) < 10) && (gf(128,2) == 1))
		give_char_text_bubble(13831,"Just get out.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13832,"Be patient!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13832,"Request denied.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13832,"Who is next?");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13832,"Keep calm!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13833,"Be patient.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13833,"Ale coming up.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13833,"We are full.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13833,"Here's your meal.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13834,"Need more materials.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13834,"Need apprentices.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13834,"Dark times.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13834,"Need custom work?");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13834,"We accept trade-ins.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13835,"No charity here.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13835,"You get what you earn.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13835,"We help you prosper.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13836,"Try this cloak on.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13836,"Lovely tunic, eh?");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13836,"Ah, for the old days.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13837,"Have any ore?");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13837,"I buy fine crystals.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13837,"Sale on picks today.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13837,"Quality shovels!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13837,"No credit!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13838,"No!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13838,"Who are you?");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13838,"Get out!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13839,"Just try it.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13839,"It makes you strong!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13839,"Try it and you'll see.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13871,"Down on my luck.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13871,"Spare a coin?");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13871,"Bless you.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13857 + get_ran(1,0,6),"We can try the Abyss.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13857 + get_ran(1,0,6),"Let's go east.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13857 + get_ran(1,0,6),"No hope here.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13857 + get_ran(1,0,6),"Try the portal.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13857 + get_ran(1,0,6),"I hear Mertis has food.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13857 + get_ran(1,0,6),"I'm staying here.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13857 + get_ran(1,0,6),"Best to try the depot.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13864 + get_ran(1,0,6),"Where's my pick?");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13864 + get_ran(1,0,6),"I'm losing my claim!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13864 + get_ran(1,0,6),"Have to get out there!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13864 + get_ran(1,0,6),"I found great crystals.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13864 + get_ran(1,0,6),"Just need some meal.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13872 + get_ran(1,0,4),"Help me!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13872 + get_ran(1,0,4),"I just need a little!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13872 + get_ran(1,0,4),"My farm failed!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13872 + get_ran(1,0,4),"I have three children.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(13872 + get_ran(1,0,4),"Just a few scraps?");

	//	}

	//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;
	sf(128,16,1);
break;

beginstate 11;
	set_terrain_string_range("There is a foul smell in this chamber. Not even the refugees can stand to sleep here.",1);
break;

beginstate 12;
	if ((char_ok(13839)) && (get_attitude(13839) < 10)) {
		print_str_color("Zeleny draws his blade. 'Stop right there!'",3);
		set_attitude(30013,10);
		set_attitude(13877,10);
		set_attitude(13878,10);
		}
break;

beginstate 13;
	set_terrain_string_range("A sign on this door says - KEEP OUT! PRIVATE!",1);
break;

beginstate 14;
	set_terrain_string_range("A sign on this door says - Rippel's Smithy. Fine Dharmon Steel.",1);
break;

beginstate 30;
		if (revive_party()) {
			print_str_color("Entering or leaving Dharmon heals your wounds",2);
			print_str_color("  and restores your spell energy.",2);
			}
break;
//	print_str("");
//	set_terrain_string_range(".",1);
//	set_terrain_string_range("The sign says - .",1);
