// .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_aggression(14473,60);
	set_aggression(14474,60);
	set_aggression(14475,60);
	set_aggression(14472,60);
	

	add_range_to_group(14476,14481,13);

	set_crime_tolerance(max_crime);

	if (gf(170,1) >= 20)
		sf(134,9,1);

	set_name(14482,"Boatyard Guard");
	set_name(14483,"Boatyard Guard");
	set_name(14484,"Boatyard Guard");

	set_name(14485,"Aldea");

	set_name(14486,"Captain Dwight");
	set_name(14487,"Druella");

	if (gf(134,5) > 0)
		set_terrain(1,535,597,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 ((get_ran(1,0,100) < 10) && (gf(134,9) > 0))
		give_char_text_bubble(14486,"Your boat is ready.");
	if ((get_ran(1,0,100) < 10) && (gf(134,9) > 0))
		give_char_text_bubble(14486,"Take what you need.");
	if ((get_ran(1,0,100) < 10) && (gf(134,9) > 0))
		give_char_text_bubble(14486,"Good luck to you.");
	if (gf(134,5) == 0) {
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(14487,"No discounts.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(14487,"Stay out of the cellar.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(14487,"We still have wine.");
		}
	if (gf(134,5) > 0) {
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(14487,"Thief.");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(14487,"Thief!");
		if (get_ran(1,0,100) < 10)
			give_char_text_bubble(14487,"THIEF!");
		}

	//	}

	//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;
	if (gf(134,5) == 0) {
		begin_talk_mode(43);
		}
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);
