// OUTDOOR SECTION SCRIPT

beginoutdoorscript;

variables;

int i,j,k,r1,choice;

body;

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

beginstate START_STATE;
// This state is called every turn the party is in this outdoor section. 
break;

beginstate 10;
	if (get_flag(0,12) == 250)
		end();
	if (get_flag(0,11) == 0)
		end();
	message_dialog("You find the herb patch that Deadeye mentioned. You pick the precious plants and tuck them away in a bundle. These should come in handy.","");
	set_flag(0,12,250);
	reward_give(214);
break;

beginstate 11;
	if (get_flag(0,15) == 0) {
		end();
		}
	if (get_flag(0,24) == 250) {
		end();
		}
	message_dialog("You're getting close to the alleged woods spirit. You can actually see flickering light coming from the deep woods. There appears to be an easy route to the light, as well. You should take it.","");
	set_flag(0,24,250);
break;

beginstate 12;
	if (get_flag(0,15) == 0) {
		message_dialog("You can see a flickering light deep in the woods, but it's impossible to find a clear path there. The woods are simply too thick.","");
		block_entry(1);
		end();
		}
	block_entry(0);
break;

beginstate 13;
	if (get_flag(2,11) == 250) {
		print_str("The guards at the gate nod at you.");
		block_entry(0);
		end();
		}
	message_dialog("This gate leads out of the lands of Megiddo, and into the territory of the savage Hunan people. It would be best to keep your distance.","Indeed, Megiddo guards have been placed here by the King himself to keep people from venturing into Hunan territory... and to keep the Hunan in.");
	block_entry(1);
break;

beginstate 14;
	if (get_flag(3,4) == 250) {
		end();
		}
	message_dialog("You can see the Great Circle directly to the north. The nature-worshiping Hunan set some great significance in this pile of rocks. They will probably be congregating there.","");
	set_flag(3,4,250);
break;

beginstate 15;
	if (get_flag(3,5) == 250) {
		end(); 
		}
	message_dialog("From this point, you have a good view of the island nation, the City of Peace. The leaders of the City of Peace preach neutrality, and will trade with any other nation. It has become the center of commerce in these parts.","Naturally, this attracts scum. Both the rich kind, and the poor kind.");
	set_flag(3,5,250);
break;

beginstate 16;
	i = 0;
	reset_dialog();
	add_dialog_str(1,"This path leads out of the little nation of Megiddo, and into the wider world of Eidetia. Do you want to leave now?",0);
	add_dialog_choice(0,"It's time to leave.");
	add_dialog_choice(1,"I want to stay.");
	i = run_dialog(1);
	if (i == 1 && get_flag(0,28) < 250) {
		message_dialog("This path leads out of Megiddo and into the greater world of Eidetia. You walk away from Megiddo and forget about its problems.","");
		block_entry(1);
		end_scenario(0);
		}
	if (i == 1 && get_flag(0,28) == 250) {
		message_dialog("Your job done, you journey out of Megiddo. There are so many unanswered questions; who told Lady Keria to kill the King? Who gave her those powers? Is this an end, in and of itself?","The future of Megiddo is far from certain, and it looks like it will be a dark winter for these poor people.");
		block_entry(1);
		end_scenario(1);
		}
	if (i == 2) {
		block_entry(1);
		message_dialog("You decide to stay in Megiddo. There are still things to be done here.","");
		}
break;

beginstate 17;
	if (get_flag(0,26) == 250) {
		print_str("You pass through one of Megiddo's hamlets.");
		end();
		}
	message_dialog("This is one of Megiddo's little hamlets. These small villages are under the nominal control of a noble, a feudal lord. All the nobles provide input to the King; this is the basis for government in Megiddo.","You meet a few common people in the town, but don't stay long. There's nothing to do.");
	set_flag(0,26,250);
break;