// TOWN SCRIPT
//    Town 3: Marralis

// This is the special encounter script for this town.
// The states INIT_STATE, EXIT_STATE, and START_STATE have
// meanings that are described in the documenation. States you write
// yourself should be numbered from 10-100.

begintownscript;

variables;

int i,j,k,r1,choice;

body;

beginstate INIT_STATE;
	enable_add_chars(1);
	set_crime_tolerance(1);
	if (get_flag(2,1) == 250)
		end();
	message_dialog("This is the Fire Temple of Megiddo. Perhaps it was the first in the world. Legends say it was built by Helios. There is always a guard at the fire, to ensure that no matter what else, the fires will always burn.","The temple is an ancient thing. It was dug into the ground to protect it from the elements, and then much later it was uncovered in order to expose it to more sunlight.");
	set_flag(2,1,250);

break;

beginstate EXIT_STATE;
// Always called when the town is left.
break;

beginstate START_STATE;
// Starting state of the town, called every turn until you change the state.
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(7,"You had best beware");

break;

beginstate 10;
	if (get_flag(2,12) == 250) 
		end();
	message_dialog("This sharply sloping tunnel leads to the caverns underneath the Fire Temple. They are humid, and you can feel a rush of burning, disgusting air flow past you.","Warren had better REALLY like these stupid fangs. Otherwise this probably won't be worth it.");
	set_flag(2,12,250);
break;

beginstate 11;
	move_to_new_town(3,7,7);
break;

beginstate 12;
	if (get_flag(3,3) == 250) {
		block_entry(0);
		end();
		}
	block_entry(1);
	message_dialog("_Hold on,_ the guard says. _This door leads to the caverns underneath the Fire Temple; it would be best if you didn't go down there._","_There are giant spiders and bats, and they're vicious._ He raises his hands and mimes them gnashing together like a monster's jaws. _Rawr!_ he says fiercely. _Like that!_");
break;