// .txt

beginzonescript;

variables;

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

body;

beginstate INIT_STATE;
	last_abil = get_current_tick();

	set_name(11880,"Mayor Augustus");
	set_name(11881,"Captain Verbier");
	set_name(11882,"Holda");
	set_name(11883,"Xylia");
	set_level(11883,22);
	set_boss_level(11883,1);
	set_new_abil(11883,11);
	
	set_name(11884,"Soussana");
	set_name(11885,"Contador");
	set_name(11886,"Nabile");
	set_name(11887,"Ruth");


	add_range_to_group(11888,11895,19);
	set_level(30019,18);
	set_name(30019,"Sewer Refugee");

	set_name(11888,"Wetzel");

	add_range_to_group(11904,11909,20);
	set_name(30020,"Silvar Refugee");
	add_range_to_group(11910,11916,21);
	set_name(30021,"Silvar Refugee");

	set_name(11917,"Caravan Guard");
	set_name(11918,"Caravan Guard");
	set_name(11919,"Adventurer");
	set_name(11920,"Adventurer");

	set_name(11921,"Boatworks Thug");
	set_name(11922,"Boatworks Thug");
	set_name(11923,"Boatworks Thug");
	set_name(11924,"Boatworks Thug");

	set_name(11925,"Xylia's Bodyguard");
	set_name(11926,"Xylia's Bodyguard");
	set_level(11925,22);
	set_boss_level(11925,1);
	set_new_abil(11925,20);
	set_level(11926,22);
	set_boss_level(11926,1);
	set_new_abil(11926,20);

	set_name(11927,"Herb Eater");
	set_name(11928,"Herb Eater");

	add_range_to_group(11932,11938,22);
	add_range_to_group(11939,11944,23);
	set_name(30023,"Slith Infiltrator");
	set_name(11944,"Incantor Khor'Kss");
	
	set_boss_level(11944,1);
	
	set_crime_tolerance(max_crime);

	break;

beginstate EXIT_STATE;

break;

beginstate START_STATE;
	if (set_att == 0) {
		if ((char_ok(11883) == FALSE) || (get_attitude(11883) >= 10))
			set_att = 1;
		if ((char_ok(11925) == FALSE) || (get_attitude(11925) >= 10))
			set_att = 1;
		if ((char_ok(11926) == FALSE) || (get_attitude(11926) >= 10))
			set_att = 1;
		if ((char_ok(11927) == FALSE) || (get_attitude(11927) >= 10))
			set_att = 1;
		if ((char_ok(11928) == FALSE) || (get_attitude(11928) >= 10))
			set_att = 1;
		
		if (set_att == 1) {
			set_att = 2;
			set_attitude(11883,10);
			set_attitude(11925,10);
			set_attitude(11926,10);
			set_attitude(11927,10);
			set_attitude(11928,10);
			}
		}
		
	if ((get_crime_level() >= max_crime) && (im_hostile == 0)) {
		sf(109,6,1);
		make_zone_hostile();
		im_hostile = 1;
		}

	if (gf(109,6) == 0) {
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11880,"Welcome, soldier.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11880,"I am still mayor.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11880,"I command here!");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11880,"Too many refugees.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11880,"Traitors everywhere.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11881,"Too much scum.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11881,"Show some dignity.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11881,"All these refugees.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11881,"An outsider soldier.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11882,"I am a healer.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11882,"Welcome, soldier.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11882,"We want to be left alone.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11883,"Mind your manners.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11883,"We do no harm.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11883,"Supplies are short.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11883,"We have an arrangement.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11884,"Wait your turn.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11884,"Have a menu.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11884,"Have you heard of the Anama?");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11884,"No spells, no steel!");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11885,"I serve the soldiers.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11885,"Try this cloak.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11885,"Quality material!");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11885,"Mrrrr.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11886,"I serve the army.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11886,"I have great authority.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11886,"Soldiers only.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11887,"Sigh.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11887,"What a waste.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11887,"It's a ruin.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11887,"All lost.");
		if ((get_ran(1,0,100) < 10) && (gf(110,13) < 2))
			give_char_text_bubble(11888,"We are not afraid.");
		if ((get_ran(1,0,100) < 10) && (gf(110,13) < 2))
			give_char_text_bubble(11888,"We die if we have to.");
		if ((get_ran(1,0,100) < 10) && (gf(110,13) < 2))
			give_char_text_bubble(11888,"Leave us be.");
		if ((get_ran(1,0,100) < 10) && (gf(110,13) >= 2))
			give_char_text_bubble(11888,"I was duped.");
		if ((get_ran(1,0,100) < 10) && (gf(110,13) >= 2))
			give_char_text_bubble(11888,"I was blind.");
		if ((get_ran(1,0,100) < 10) && (gf(110,13) >= 2))
			give_char_text_bubble(11888,"They tricked me.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11904 + get_ran(1,0,5),"Shhh.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11904 + get_ran(1,0,5),"Who's that?");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11904 + get_ran(1,0,5),"A soldier.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11904 + get_ran(1,0,5),"There's no hope.");
		if ((get_ran(1,0,100) < 10) && (gf(110,8) == 0))
			give_char_text_bubble(11904 + get_ran(1,0,5),"Wetzel is a fool.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11910 + get_ran(1,0,6),"A soldier.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11910 + get_ran(1,0,6),"We'll starve.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11910 + get_ran(1,0,6),"Why's a soldier here?");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11910 + get_ran(1,0,6),"Holda will help.");
		if ((get_ran(1,0,100) < 10) && (gf(110,8) == 0))
			give_char_text_bubble(11910 + get_ran(1,0,6),"I trust Wetzel.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11921 + get_ran(1,0,3),"Snort.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11921 + get_ran(1,0,3),"You smell something?");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(11921 + get_ran(1,0,3),"They won't stop us.");

		}

	//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 home has been abandoned.",1);
break;

beginstate 11;
	set_terrain_string_range("The sign says - Efram's Blades. CLOSED.",1);
break;

beginstate 12;
	set_terrain_string_range("The sign says - THE SILVAR ARMS. No steel. No spells.",1);
break;

beginstate 13;
break;

beginstate 14;
break;

beginstate 15;
break;

beginstate 22;
	if (gf(109,6) > 0)
		end();
		
		if (revive_party()) {
			print_str_color("Entering or leaving Silvar 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);
