// Town 33: Gateway
begintownscript;

variables;

short choice,i,j,k;
string dlgstr;

body;

beginstate INIT_STATE;
	set_crime_tolerance(2);
	
	change_outdoor_location(1,4,45,31);
	
	if (get_flag(33,0) == 0) {
		force_instant_terrain_redraw();
		set_flag(33,0,1);
		message_dialog("When you step through the portal, you are transported an immeasurable distance. But the distance is not so much the strange sensation: you feel yourself passing between up and down, as if someone ripped a hole right through space.","You come out on the other side to a beautiful, green land. This must be the Land of the Dead, the land from which few mortals ever return. Somewhere here, Legare is being held prisoner.");
		}
break;

beginstate EXIT_STATE;
	if (get_flag(33,1) == 0) {
		set_flag(33,1,1);
		message_dialog("From here, you can see much of the Land of the Dead. There is a large river, strange, flowing around this island, and many spirits clamor on this side of it to get across. You can see little detail from here, though.","");
		}
break;

beginstate START_STATE;
break;

beginstate 10;
	block_entry(1);
	message_dialog("This portal is hard as rock, impossible to walk through at all. It must be currently inactive. You cannot get back out this way, at least for right now.","");
break;

beginstate 11;
if (get_flag(51,1) == 0)
	end();
	
	reset_dialog_preset_options(3);
	if (run_dialog(1) == 1)
		block_entry(1);
	else
		move_to_new_town(45,18,24);
break;