begintownscript;

variables;
short i,choice;

body;

beginstate INIT_STATE;

	i = 0;

break;

beginstate START_STATE;

	if(get_flag(1,0) == 0){
		message_dialog("*Phew* Now that you're out of that mess, you'll need to find a way out of the fort.","Hopefully, nothing is guarding it.");
		set_flag(1,0,1);
		}

	if(get_flag(1,10) == 0)
		i = i + 1;

	if((i == 10) && (get_flag(1,10) == 0)){
		play_sound(-33);
		play_sound(-119);
		large_draw_pic_dialog(303,"Out of the shadows, a challenger appears!");
		message_dialog("If you weren't running before, now is a good time to start.","");
		activate_hidden_group(1);
		set_flag(1,10,1);
		}

	if(get_flag(1,10) == 1){
		if(char_ok(21) == FALSE){
			message_dialog("The Shambling Hulk died?  Are you kidding me?  The only way he could have died is if you were cheating.","Cheaters like you should be punished, but I'll let you off the hook and sing to you instead.");
			set_flag(1,10,2);
			set_flag(299,29,1);
			}
		}

break;

beginstate EXIT_STATE;
break;

beginstate 10;
	reset_dialog_preset_options(8);
	choice = run_dialog(0);

	if(choice == 2){
		flip_terrain(5,17);
		flip_terrain(5,18);
		play_sound(99);
		}
break;

beginstate 11;
	reset_dialog_preset_options(8);
	choice = run_dialog(0);

	if(choice == 2){
		flip_terrain(15,17);
		flip_terrain(15,18);
		play_sound(99);
		}
break;

beginstate 20;
	print_str("Can't go back!");
	block_entry(1);
break;