begintownscript;
variables;
short choice;
short i,erase;
short tick;

body;
beginstate init_state;
i = 0;
while(char_ok(i) == 0){
	i = i + 1;
}
turn_off_training(1);
if(get_flag(4,0) == 0)
	message_dialog("You hike higher into the mountains, keeping your eyes open for any suitable firewood. You don't see any, but what you do see is a blue robed figure a bit further ahead. Looks like you've found where Erasmus went to.","");
if(get_flag(4,7) > 0)
	erase_char(6);
set_flag(4,0,1);
set_char_dialogue_pic(6,300,0);
break;

beginstate start_state;
if((get_flag(4,4) > 0) && (get_flag(4,6) == 0) && (num_chars_in_group(2) == 0)){

	set_flag(4,6,1);
	reset_dialog();
	add_dialog_str(0,"The last of your attackers falls dead, leaving you standing alone panting in the swirling fog. That should serve as a lesson of what happens when you walk headlong into unfamiliar territory.",0);
	add_dialog_str(1,"A place where one can get warm water to drink and wash-- well probably not wash in the hobgoblins' case-- would be a highly contended area, and you just found that out the hard way. Hopefully those totems won't be signs of things to come.",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);
	set_flag(4,6,1);
}
if((num_chars_in_group(3) == 0) && (get_flag(4,17) == 0) && (get_flag(4,16) > 0)){
	set_flag(4,17,1);
	if(get_flag(2,20) > 0)
		set_flag(4,25,1);
}
if((num_chars_in_group(4) == 0) && (get_flag(4,20) > 0) && (get_flag(4,21) == 0)){
	set_flag(4,21,1);
	if(get_flag(2,20) > 0)
		set_flag(4,25,1);
}
if((num_chars_in_group(5) == 0) && (get_flag(4,22) > 0) && (get_flag(4,23) == 0)){
	set_flag(4,23,1);
	if(get_flag(2,20) > 0)
		set_flag(4,25,1);
}
if((get_flag(4,25) > 0) && (is_combat() == 0)){
	activate_hidden_group(10);
	add_char_to_party(32);
	set_flag(4,25,0);
}

break;

beginstate exit_state;
break;

beginstate 10;
if((get_flag(4,9) > 0) && (get_flag(4,11) == 0)){
	set_flag(4,11,1);
	reset_dialog();
	add_dialog_str(0,"You reluctantly leave Erasmus' side, hesitantly glancing behind you every few steps. Suddenly another rumbling roar rips through the air.",0);
	add_dialog_str(1,"You take one last look back at Erasmus. Some men would delight in a warrior's death, but not Erasmus. He should have died an old man who'd learned all there was to learn, and departed life with book in hand.",0);
	add_dialog_str(2,"What's done is done, the mountain cares not for men's wishes and you have no power to help here. You begin sprinting south towards your friends and, unfortunately, the source of the dreadful roar.",0);
}
move_to_new_town(2,8,2);
break;

beginstate 11;
if(get_flag(4,1) == 0){
	message_dialog("Erasmus glances up from his book and calls out, _Hold on a moment, Vincent, I need to ask a favor of you. Could you speak with me before you hike any further?_ You oblige him and turn back.","");
	block_entry(1);
}
break;

beginstate 12;
if(get_flag(4,2) == 0){
	set_flag(4,2,1);
	message_dialog("Several sinister totems have been erected here. The language written on them is incomprehensible to you, but the grim faces of the heads topping each spike speak to you in a universal language - 'Beware, Visitors are not Welcome'","This is grim, but more pressing at the moment is a group of slavering wolves that have emerged from their cover to snarl at you. Totems and their makers, whoever they may be, will have to wait until later.");
	activate_hidden_group(1);
}
break;

beginstate 13;
if(get_flag(4,3) == 0)
	message_dialog("A strange scent assails your nose as you climb the hill. It's hard for you to place the stinging scent, it smells like some kind of mineral.","Clouds of steam billow off the small lae in front of you and fills the air with a humid warmth. The source of the stream you've been following the last few days is a hot spring, though in the cold mountain air it doesn't stay that way for long.");
set_flag(4,3,1);
break;

beginstate 14;
if(get_flag(4,4) == 0){
	reset_dialog();
	add_dialog_str(0,"You breathe deeply, soaking up the warmth of the geothermic spring. High cliff walls protect from wind coming from three sides, so the steam hangs in the air undisturbed.",0);
	add_dialog_str(1,"Your eyes wander across the cliff walls. Sheer expanses of rock soar into the air as high as one hundred feet, nobody is scaling these heights. Two things do catch your attention, however.",0);
	add_dialog_str(2,"First is that to the east the cliff wall is significantly lower, and indeed there is actually a steep pass leading higher into the mountains.",0);
	add_dialog_str(3,"Secondly, when scanning the tops of the cliff you notice a huge stone figure. At first it looks like any other rock formation, but then you realise what it looks like-- a huge stone bird leaning out from the cliff face.",0);
	add_dialog_str(4,"You ponder whether this is the 'Condor Ridge' that Erasmus wanted you to find, but are distracted by a splashing noise. Short, humanoid figures now stand on the bank of the stream, dripping water and wearing angry scowls.",0);
	add_dialog_str(5,"Several more of the blue humanoids, which you would bet anything are hobgoblins, materialize from the mist leading huge wargs. They don't look any more pleased by your presence than their companions, and are holding crude weapons. Bad news.",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);
	set_flag(4,4,1);
	activate_hidden_group(2);
}
break;

beginstate 15;
if(get_flag(4,5) == 0){
	block_entry(1);
	message_dialog("Going higher into the mountains would probably be a bad idea, you don't think there's a better place to find deciduous trees than a warm spot like this.","");
	end();
}
if(get_flag(2,25) == 0){
	block_entry(1);
	message_dialog("Going higher into the mountains, and further away from your friends back in camp, would be a bad idea in any circumstance. It is an absolutely terrible idea now that you know these lands are inhabited by hobgoblins.","");
	end();
}
break;

beginstate 16;
if(get_flag(4,6) == 0){
	print_str_color("Not during combat!",1);
	end();
}
if(get_flag(4,5) == 0){
	reset_dialog();
	add_dialog_str(0,"The air here is so warm that the snow is melting. The warm mist hangs in the air like a blanket, the leaves of the trees glisten with moisture. The place is like an oasis of green in the middle of the snowy mountains.",0);
	add_dialog_str(1,"Three ash trees grow on the banks of the spring's source, nourished by the cliff walls' protection and the spring's minerals and warmth. You stand in disbelief for a solid minute, amazed that this is really possible.",0);
	add_dialog_str(2,"Well Orrin was right, and you're all too happy to gather some fallen limbs and branches and head back. Your friends must be freezing back in the wolf cave, they don't have the hot spring's mist to keep them warm.",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);
	set_flag(4,5,1);
	change_spec_item(4,1);
}
break;

beginstate 17;
if(get_flag(4,4) > 0){
	if(get_flag(4,6) == 0){
		message_dialog("It's a bit late to turn back now, doing so would just lead the angry hobgoblins to your friends.","");
		block_entry(1);
	}
	if((get_flag(4,6) > 0) && (get_flag(4,5) == 0)){
		message_dialog("You've hiked this far, risked your life by splitting from the group, and fought a troop of angry hobgoblins, but you still don't have any firewood. You can't imagine a place more suitable to find firewood than this oasis could exist.","You turn back. If after you give the place a better look over you still don't find anything, you can return to camp and tell Orrin it was an impossible quest."); 
		block_entry(1);
	}
	if((get_flag(4,5) == 1) && (get_flag(4,7) == 0)){
		set_flag(4,7,1);
		reset_dialog();
		add_dialog_str(0,"You head back towards camp with your hard earned timber in hand. It was a pain to get, but when the storm hits you'll be happy you have it.",0);
		add_dialog_str(1,"You're starting to feel what it is Orrin warned you about. The sky is gray and cloundless, and a cold wind whips through the trees. You look back at the sheltered oasis wistfully.",0);
		add_dialog_str(2,"An unfamiliar noise causes you to spin around and unsheathe your blade. You thought at first that it was coming from right behind you, but as you quickly scan the area you realise it couldn't have.",0);
		add_dialog_str(3,"The noise was like nothing you've ever heard, but is somehow familiar. It was powerful and ferocious, and had the long wailing sound of a wolf's cry. It must have been some kind of animal-- then it hits you.",0);
		add_dialog_str(4,"Your dream. The cry in your dream. You begin sprinting towards the camp.",0);
		add_dialog_choice(0,"OK");
		choice = run_dialog(1);
		set_flag(4,7,1);
		erase_char(6);
		activate_hidden_group(3);
		set_character_pose(22,13);
		put_stain_on_space(7,46,2);
		put_stain_on_space(8,46,1);
		set_char_dialogue_pic(22,300,0);
	}
}
break;

beginstate 18;
if((get_flag(4,5) > 0) && (get_flag(4,8) == 0)){
	reset_dialog();
	add_dialog_str(0,"Your heart sinks as you approach the spot where you last left Erasmus. You spot him sitting propped up against a pine tree nearby, his rucksack has been overturned and most of his books lie in the snow, as does his walking staff.",0);
	add_dialog_str(1,"You know in an instant that something is wrong. The snow around him is being steadily stained crimson, and his face is pale as the snow once was. His robes are ripped, and he clutches both his hands over his stomach.",0);
	add_dialog_str(2,"When he sees you he lifts up a hand to motion you over, and you see that it is dripping with blood. His lips move, but the sound is to weak to carry to you. You rush over to his side.",0);
	change_spec_item(4,-1);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);
	set_flag(4,8,1);
}
if((get_flag(4,9) > 0) && (get_flag(2,25) == 0)){
	block_entry(1);
	message_dialog("Aren't you forgetting something? Namely, a blood thirsty creature that was last seen heading towards your friends?","");
}
break;

beginstate 19;
if((get_flag(4,5) > 0) && (get_flag(4,9) == 0)){
	block_entry(1);
	message_dialog("Erasmus lies injured several feet away, his blood turning the snow crimson red. How could you just walk away?","");
}
break;

beginstate 20;
if((get_flag(2,25) > 0) && (get_flag(4,15) == 0)){
	set_flag(4,15,1);
	reset_dialog();
	add_dialog_str(0,"You troop uphill through the ever deepening snow. The group stops dead when a sudden wail splits the air. A piercing, sharp shriek that splits your ears and fills your hearts with dread.",0);
	add_dialog_str(1,"For a moment everybody is struck dumb. Then Sergeant Burden recovers enough to stammer, _Wha-- what the hell was that? What in the world made that abominable noise?_ All eyes swivel towards Orrin.",0);
	add_dialog_str(2,"Orrin stares up into the peaks before you, and speaks without turning around. _The cold and limited visibility aren't the only reasons why highlanders avoid marching in storms._",0);
	add_dialog_str(3,"Everybody looks at each other puzzled, until he continues. _Spirits, phantoms. Ghosts of vanquished warriors who found no peace in death. Also roam natural spirits, beings embodying the cold and harshness of the mountain itself._",0);
	add_dialog_str(4,"_Highlanders never march in these conditions, when the sun and moon are blotted by clouds the spirits roam unmolested to prey upon the dead. Just take solace in knowing no goblins would be foolish enough to come out here._",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);

	reset_dialog();
	add_dialog_str(0,"Sereant Burden mulls this over before coming to a conclusion. _Well we have little choice in the matter, else I'd take the goblins' wisdom for our own. Vincent! Fabian!_ You each jump to attention and cross over to her.",0);
	add_dialog_str(1,"_Whatever the hell these things are, I don't want to see them near the expedition. Orrin is weighted down with the Captain, and I trust neither Jamie nor Adrianna to prove useful in battle._",0);
	add_dialog_str(2,"_Private Evrey and I will stay here to guard the group. You scout ahead and try to make sure none of those things make it that close. Got it?_ You nod, and plod off through the snow.",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);
	activate_hidden_group(10);
	alter_stat(32,0,1);
	alter_stat(32,4,2);
	alter_stat(32,5,2);
	alter_stat(32,9,2);
	alter_stat(32,26,3);
	add_char_to_party(32);
	set_flag(2,20,0);
	move_to_new_town(4,char_loc_x(i),char_loc_y(i));
}
break;

beginstate 21;
if((get_flag(4,16) == 0) && (get_flag(2,25) > 0)){
	set_flag(4,16,1);
	message_dialog("That terrible, blood curdling wail pierces your ears again. This time the source of the sound makes itself known, the spectral figure of a woman shrouded in a hazy black shroud swoops down on you, accompanied by two spectral warriors.","It takes all your willpower to keep from dropping your weapons to clap your hands to your ears. The banshee continues her terrible wailing cry, baring her ghostly teeth at you in the process. You aren't sure what's more unnerving, the sound or the sight.");
	activate_hidden_group(5);
}
break;

beginstate 22;
if((get_flag(4,17) == 0) && (get_flag(2,25) > 0)){
	block_entry(1);
	end();
}
if((get_flag(4,18) == 0) && (get_flag(2,25) > 0)){
	set_flag(4,18,1);
	message_dialog("When Sergeant Burden and the rest catch up to you, she crosses over and asks, _So this is it? This is the landmark Erasmus wanted you to find?_ You nod.","_Good enough for me. I can hardly make heads or tails of this map, but I think we're supposed to take the pass to the east now. We'll see if we can find any more landmarks from there._");
}
break;

beginstate 24;
if(get_flag(4,19) == 0){
	set_flag(4,19,1);
	message_dialog("Well if there is one bright spot in this gloomy day it's that Orrin was correct in saying the hobgoblins would be taking shelter.","Whether it's the roaming spirits or the freezing cold keeping them indoors is little concern to you, what matters is that the filthy creatures aren't out here bothering you. There are totems everwhere, but their builders are noplace to be seen.");
}
break;

beginstate 25;
if(get_flag(4,20) == 0){
	set_flag(4,20,1);
	activate_hidden_group(6);
	message_dialog("The screams announce your next assailants well before you see them. Several more banshees glide down from the heights to beset you, their midnight-black ethereal hair streaming behind them.","");
	if(get_flag(2,20) > 0)
		erase_char(4);
}
break;

beginstate 26;
if(get_flag(4,21) == 0){
	block_entry(1);
	end();
}
if(get_flag(4,24) == 0){
	set_flag(4,24,1);
	message_dialog("The snow is getting deeper and deeper as you climb higher into the mountains. It now reaches your waist, as if your legs weren't numb enough already.","It makes for slow, not to mention uncomfortable, marching. You are torn between stopping to rest your weary limbs or pressing on. You decide to keep on, if only because the heat you generate from moving offsets the discomfort."); 
}
break;

beginstate 27;
if(get_flag(4,22) == 0){
	set_flag(4,22,1);
	activate_hidden_group(4);
	message_dialog("This forest resounds with the sound of screeching banshees, like great birds of prey they swoop down on you. Several spectral warriors rise out of the snow to aid them.","Fighting in this deep snow is going to be no picnic, and to make it even worse, you're fighting enemies completely unaffected by it. They glide across the fresh snow without sinking an inch.");
	if(get_flag(2,20) > 0)
		erase_char(4);
}
break;

beginstate 28;
if(get_flag(4,23) > 0){
	message_dialog("You and Fabian treck further into the mountains. Nothing stirs except the swirling wind, indeed you haven't seen anything living save your fellows.","This isn't a bad thing really, since it means the builders of the grim totems that survey the trail are no place to be seen. You do see several half devoured goblin corpses hanging from pine trees, though. You shiver and continue on.");
	move_to_new_town(5,2,5);
}
break;

beginstate 101;
	set_flag(2,20,1);
	message_dialog("Fabian falls to the ground, worn down by exhaustion, the cold, and his many wounds. He quickly scrambles up and leaves the battle, saying _Sorry Vincent, you'll have to handle the rest of them on your own, I'm done for now._","");
break;

beginstate 102;
block_entry(1);
break;