// .txt

beginzonescript;

variables;

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

body;

beginstate INIT_STATE;
	last_abil = get_current_tick();

//	set_name(,"");

	add_range_to_group(3568,3573,49);
	set_name(30049,"Jagged Scuttler");
	set_level(30049,25);
	set_attack_bonus(30049,40);
	set_resistance(30049,7,50);

	add_range_to_group(3574,3580,50);
	set_name(30050,"Jagged Scuttler");
	set_level(30050,25);
	set_attack_bonus(30050,40);
	set_resistance(30050,7,50);
	
	set_crime_tolerance(max_crime);

	if (gf(33,4) == 1)
		sf(33,4,2);
	if (gf(33,4) > 0) {
		set_terrain(1,336,171,0);
		set_terrain(1,337,171,0);
					set_terrain(1,333,162,0);
					set_terrain(1,333,163,0);
		}
		
	break;

beginstate EXIT_STATE;

break;

beginstate START_STATE;
		
	//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(,"");
	//	}

	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();
		if (gf(33,4) == 1) {
			if ((counter < 100) && (on_which_layer() == 1)) {
				counter = counter + 1;
				
				if (counter == 2) {
					activate_hidden_group(50);
					add_range_to_group(3588,3593,52);
					set_name(30052,"Redshell Scuttler");
					set_level(30052,27);
					set_attack_bonus(30052,20);
					set_boss_level(30052,1);
					set_coloradj(30052,256);
					set_resistance(30052,2,100);
		
					set_terrain(1,333,162,0);
					set_terrain(1,333,163,0);
					
					print_str_color("You hear another wall crumble somewhere nearby.",3);
					}
				
				if (counter == 5) {
					activate_hidden_group(51);
					add_range_to_group(3594,3599,53);
					set_name(30053,"Greenshell Scuttler");
					set_level(30053,25);
					set_attack_bonus(30053,50);
					set_coloradj(30053,512);
					set_resistance(30053,1,100);
					set_new_abil(30053,15);
					force_char_status(30053,24,7);
					set_resistance(30053,7,50);
					
					set_terrain(1,368,155,0);
					set_terrain(1,368,156,0);
					
					print_str_color("You hear another wall crumble somewhere nearby.",3);
					}
				
				if (counter == 8) {
					activate_hidden_group(52);
					add_range_to_group(3600,3605,54);
					set_name(30054,"Sparkling Scuttler");
					set_level(30054,25);
					set_attack_bonus(30054,20);
					set_coloradj(30054,1024);
					set_resistance(30054,6,100);
					set_new_abil(30054,16);
					set_resistance(30054,7,50);
					
					set_terrain(1,365,171,0);
					set_terrain(1,365,172,0);
					
					begin_talk_mode(5);
					}
				}
			}
		}
break;

beginstate 10;
	if (gf(33,4) == 0) {
		sf(33,4,1);
		
		activate_hidden_group(49);
		add_range_to_group(3581,3587,51);
		set_name(30051,"Jagged Scuttler");
		set_level(30051,25);
		set_attack_bonus(30051,40);
		set_resistance(30051,7,50);
		
		set_terrain(1,336,171,0);
		set_terrain(1,337,171,0);
		
		begin_talk_mode(4);
		}
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);
