// OUTDOOR SECTION SCRIPT
//    Section: X = 1, Y = 4: Land of Dead

beginoutdoorscript;

variables;

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

body;

beginstate INIT_STATE;
// This state called whenever this section is loaded into memory.
break;

beginstate START_STATE;
// Starting state of the section, called every turn the party 
// stands inside this section until you change the state.
break;

beginstate 10;
if (get_flag(51,1) == 1) {
	message_dialog("The guards of Possanatheon greet you as you approach. You tell them of your great success retrieving Legare, and they tell you that he has already entered the citadel of light.","They also tell you that you, being mortals who have completed the task for which you came, should get out of the Land of the Dead as soon as possible. They will not let you pass.");
	block_entry(1);
	end();
	}
if (character_in_party(105) < 0) {
	message_dialog("The guards at this gate stop you roughly. _You are not among the dead!_ one shouts. _We of the Celestial Guard will not allow trespassers in the Castle of Possanathoss! Leave now!_","They will not let you pass.");
	block_entry(1);
	end();
	}
if (get_flag(224,0) <= 1) {
	reset_dialog();
	add_dialog_str(0,"The guards at this gate stop you roughly. _You are not among the dead!_ one shouts. _Who are you? Tell us your names!_",0);
	if (get_flag(224,0) == 0) {
		add_dialog_str(1,"_Who are you?_ fires back Phaedra before you can say anything.",0);
		add_dialog_str(2,"_We are the Celestial Guard, the protectors of the Castle of Possanathoss!_ he shouts in reply. _Again, strangers, what are you names, and what is your business in the Land of the Dead?_",0);
		add_dialog_str(3,"Phaedra turns to you. _They are legitimate. Possanathoss was a great god in the classical slith pantheon, the god of light and poetry. We should tell them who we are._",0);
		}
	add_dialog_str(4,"What do you do?",0);
	add_dialog_choice(0,"Leave.");
	add_dialog_choice(1,"Tell them who you are and why you've come.");
	add_dialog_choice(2,"Attack!");
	set_flag(224,0,run_dialog(1));
	if (get_flag(224,0) == 1) {
		message_dialog("You shuffle away, uncertain.","");
		block_entry(1);
		}
	if (get_flag(224,0) == 2)
		message_dialog("The guards listen to your story with interest. _A curse,_ one says. _Possanathoss himself might be interested in this._ He glances at a comrade, who simply affirms that you are telling the truth. He must have some invisible way of knowing.","_Come, when you walk to the castle, we will send you a small escort._ He indicates a detachment of men, and several fall in line behind you to follow you. (They will not follow you anywhere but to the castle, though.)");
	if (get_flag(224,0) == 3) {
		message_dialog("You draw your weapons and attack the Celestial Guard. You don't even remotely stand a chance.","");
		kill_char(1000,2,0);
		}
	}
break;