beginoutdoorscript;

variables;
short leave_scen;
short bmessage;
string dlgstr;

body;

beginstate 0;
break;

beginstate 1;
break;

beginstate START_STATE;
		if(get_flag(0,16) == 1 && get_flag(0,17) == 1 && get_flag(0,18) == 1){
		reset_dialog();
		add_dialog_str(0,"The red and the blue quartz gems in your packs are strangely attracted to one another. when they get close together the runestone glows very brightly.",0);
		add_dialog_str(1,"Maybe something will happen if you put them together.",0);
		add_dialog_choice(0,"Put them together");
		add_dialog_choice(1,"Keep them apart");
		bmessage = run_dialog(1);
		if(bmessage == 1) {
			message_dialog("The two stones glow brightly, and witha sound like lightning striking, they form a single clear crystal.","When you look inside, you can see electricity arcing around.");
			set_flag(18,0,2);
			take_all_of_item(453);
			take_all_of_item(454);
			change_spec_item(3,0);
			reward_give(455);
			}	
		set_flag(0,18,2);	
		}
break;

beginstate 10;
if(get_flag(0,1) == 1){
print_str_color("You can't go back this way. The rocks and snow block the path.",2);
block_entry(1);
}
else{
message_dialog("You look back at the path leading down the mountain. The avalanche has completely covered it with snow and loose rocks. Stepping on it would probably lead to a swift, if not survivable, trip down the mountainside.","");
set_flag(0,1,1);
block_entry(1);
}
break;


beginstate 11;
if(get_flag(0,2) == 0)
message_dialog("It's fairly dark out. If you were given a choice you would rather not traverse these mountains at night, but you do what you have to. A thick fog is starting to roll up the mountainside from the valley below. Disconcerting.","");
set_flag(0,2,1);
end();
break;

beginstate 12;
if(get_flag(0,3) == 0)
message_dialog("The path begins to slope up here. You notice it getting colder.","");
set_flag(0,3,1);
end();
break;

beginstate 13;
if(get_flag(0,4) == 1){
print_str_color("Using the climbing equipment you found you are able to",2);
print_str_color("ascend the steep slope.",2);

}
else{
block_entry(1);
reset_dialog();
add_dialog_str(0,"There is a steep slope leading up the mountain. You look around but it appears to be the only way to go.",0);
add_dialog_str(1,"You start climbing, but you don't make it 20 feet before a frigid wind begins to blow. You slip on the ice and slide back down to the bottom.",0);
add_dialog_str(2,"If you are going to get up this you will need some sort of climbing equipment.",0);
add_dialog_choice(0,"Great. Just great.");
bmessage = run_dialog(1);
}
break;

beginstate 14;
if(get_flag(0,5) == 250)
end();
		reset_dialog();
		add_dialog_str(0,"You hear a faint noise almost directly above you. You look up the steep cliff face to your north, and at the very top you can see lights! There must be a small town up there; now you just need to get to it.",0);
		add_dialog_str(1,"You can see the moon glowing behind the church steeple. There is a full moon tonight.",0);
		add_dialog_choice(0,"Okay.");
		bmessage = run_dialog(1);
set_flag(0,5,250);
break;

beginstate 15;
if(get_flag(0,4) == 0){
	reset_dialog();
	add_dialog_str(0,"You climb around a thick group of trees and find two tents half buried in the snow.",0);
	add_dialog_str(1,"A quick search reveals that the owners are nowhere around. the tents are old and worn, they have been abandoned for a long time.",0);
	add_dialog_str(2,"Most of the stuff in the tents is useless, exept that you find some icepicks, rope, and grapnels. They could come in handy so you take them.",0);
	add_dialog_choice(0,"Okay.");
	bmessage = run_dialog(1);
set_flag(0,4,1);
end();
}
break;

beginstate 16;
	if(get_flag(0,6) == 0){
	reset_dialog();
	add_dialog_str(0,"Even with the old climbing gear it isn't easy getting up the slope, but you make it. You stop to rest at the top.",0);
	add_dialog_str(1,"In the thick fog you can't see the town anymore, but it is roughly to the east from where you are now.",0);
	add_dialog_choice(0,"Okay.");
	bmessage = run_dialog(1);
	set_flag(0,6,1);
	end();
	}	
break;

beginstate 17;
if(get_flag(0,7) == 0){
	reset_dialog();
	add_dialog_str(0,"You catch a faint glimmer of light in the distance. It can't be very far now.",0);
	add_dialog_str(1,"It is odd, though. You haven't seen any animals, and it's almost spring. There's no way to farm on this mountainside, and no one ever comes this way. How can anyone survive out here?",0);
	add_dialog_choice(0,"Okay.");
	bmessage = run_dialog(1);
	set_flag(0,7,1);
	end();
	}
break;

beginstate 18;
if(get_flag(0,8) == 0){
reset_dialog();
add_dialog_str(0,"You've finally reached the town, whatever it's called. It's very small, and there aren't any people visible.",0);
add_dialog_str(1,"No one comes out to greet you when you get closer. They probably aren't expecting travelers this time of year, but you get a nagging suspicion that there isn't anyone at all.",0);
add_dialog_choice(0,"Okay.");
bmessage = run_dialog(1);
set_flag(0,8,1);
end();
}
break;

beginstate 19;
	if(get_flag(0,9) == 0){
		reset_dialog();
	add_dialog_str(0,"You stagger as quickly as possible away from the haunted town. The wind is bitterly cold.",0);
	add_dialog_str(1,"After a couple of minutes you hear a flapping noise. You look around and see that there are bats everywhere. That vampire must not be dead after all!",0);
	add_dialog_str(2,"In the distance you hear laughter.",0);
	add_dialog_choice(0,"Okay.");
	bmessage = run_dialog(1);
	set_flag(0,9,1);
	end();
	}
break;

beginstate 20;
	if(get_flag(0,10) == 0){
		reset_dialog();
	add_dialog_str(0,"The path slopes up again. You're feeling so exhausted that it's hard to climb.",0);
	add_dialog_str(1,"The bats are still flying after you, which doesn't help. Every time you see a shape in the snow you think it's a monster.",0);
	add_dialog_str(2,"The laughter in the distance is getting louder.",0);
	add_dialog_choice(0,"Okay.");
	bmessage = run_dialog(1);
	set_flag(0,10,1);
	end();
	}
break;

beginstate 21;
	if(get_flag(0,11) == 0){
		reset_dialog();
	add_dialog_str(0,"As you're walking along, something colorful catches your eyes.",0);
	add_dialog_str(1,"There is a flower growing right by you. You don't know what kind it is, but flowers are pretty rare in the mountains in winter.",0);
	add_dialog_str(2,"You grab it and take it with you.",0);
	add_dialog_choice(0,"Okay.");
	bmessage = run_dialog(1);
	change_spec_item(1,1);
	set_flag(0,11,1);
	end();
	}
break;

beginstate 22;
	if(get_flag(0,12) == 0){
		reset_dialog();
	add_dialog_str(0,"For the first time in hours you don't hear bats following you. Looking around, you think you notice why.",0);
	add_dialog_str(1,"There is a makeshift grave over next to you. It isn't much, just two branches tied together to make a crude cross. There's no name on it. You look up a little bit and see the Vampiress standing and watching you.",0);
	add_dialog_str(2,"Oddly, she doesn't seem hostile. It looks like she's waiting to see what you do.",0);
	add_dialog_str(3,"You could place the flower on her grave. It would be a good gesture and you're in no condition for a fight.",0);
	add_dialog_choice(0,"Okay.");
	bmessage = run_dialog(1);
		reset_dialog();
	add_dialog_str(0,"You put the flower on her grave, and wait. The vampire looks at you, smiles slightly and walks off into the fog. You don't bother looking for her.",0);
	add_dialog_str(1,"For the first time since you started climbing, the mountain seems cheerful. When you glance at the horizen, you can see the sun starting to rise.",0);
	add_dialog_str(2,"You rest for a minute, then head off.",0);
	add_dialog_choice(0,"Okay.");
	bmessage = run_dialog(1);
	set_flag(0,12,1);
	change_spec_item(1,0);
	end();
	}
break;

beginstate 23;
	if(get_flag(0,13) == 0){
		reset_dialog();
	add_dialog_str(0,"You climb over the crest of another hill, and are overjoyed to see the town of Boltforth in the distance!",0);
	add_dialog_str(1,"You must be almost done with this unpleasant journey.",0);
	add_dialog_choice(0,"Hooray!");
	bmessage = run_dialog(1);
	set_flag(0,13,1);
	end();
	}
break;

beginstate 24;
	if(get_flag(0,14) == 0){
		reset_dialog();
	add_dialog_str(0,"You run into Boltforth nearly skipping with happiness.",0);
	add_dialog_str(1,"You attact many strange stares, covered in blood, and looking awful. Fortunately, one of the guards is willing to talk to you.",0);
	add_dialog_str(2,"He directs you to a clerk, who directs you to another clerk, who directs you to a constabulary, who send you to an engineer of some kind, who waves in the general direction of the rest of the town.",0);
	add_dialog_str(3,"After a while, you find a large house situated next to the gold mine that seems to be the town's sole source of income. A nearby man says that a wizard named Levington lives there.",0);
	add_dialog_choice(0,"Okay.");
	bmessage = run_dialog(1);
	reset_dialog();
	add_dialog_str(0, "Levington invites you in, and you deliver the package. It turns out to be some rare herbs and reagents. Levington hands you a small pouch, that jingles nicely.",0);
	add_dialog_str(1,"He gets you a cup of tea while you tell him about the trip you had. Just before you leave, you ask him about the town you fought through.",0);
	add_dialog_str(2,"_Where?_ he says, arching one eyebrow and glancing at your bloody weapons, _That place burned down years ago!_",5);
	add_dialog_str(3,"You search for the ring the vampiress dropped, only to find it missing.",0);
	bmessage = run_dialog(1);
	change_spec_item(0,0);
	change_spec_item(2,0);
	toggle_quest(0,0);
	change_coins(500);
	end_scenario(1);
	end();
	}
break;

beginstate 25;
	if(get_flag(0,15) == 0){
		reset_dialog();
		add_dialog_str(0,"Around another copse of trees you see a large bone sticking out of the ground. A bit of digging reveals that there was once a human skeleton here.",0);
		add_dialog_str(1,"There are no possessions except for a ancient wand, which you take.",0);
		bmessage = run_dialog(1);
		set_flag(0,15,1);
		reward_give(282);
		end();
	}
break;

beginstate 26;
	if(get_flag(0,16) == 0){
		reset_dialog();
		add_dialog_str(0,"A red light catches your eye as you're exploring the mountains.",0);
		add_dialog_str(1,"After a minute of digging you manage to extract a large red quartz crystal.",0);
		bmessage = run_dialog(1);
		set_flag(0,16,1);
		reward_give(453);
		end();
	}
break;

beginstate 27;
	if(get_flag(0,17) == 0){
		reset_dialog();
		add_dialog_str(0,"You trip over something in the snow. It turns out to be a large blue stone.",0);
		bmessage = run_dialog(1);
		set_flag(0,17,1);
		reward_give(454);
		end();
	}
break;

beginstate 28;
	if(get_flag(0,18) == 0){
		reset_dialog();
		add_dialog_str(0,"In the darkness you see something glowing. It's a large stone sitting in a puddle of water. It's slightly warm.",0);
		add_dialog_str(1,"There are several strange glowing glyphs set into it. You don't know what they mean.",0);
		bmessage = run_dialog(1);
		set_flag(0,18,1);
		change_spec_item(3,1);
		end();
	}
break;

beginstate 29;
	if(get_flag(0,19) == 0){
		reset_dialog();
		add_dialog_str(0,"Except for your panting, everything is suddenly quiet. A little too quiet.",0);
		bmessage = run_dialog(1);
		
		clear_buffer();
		append_string("Thinking quickly, ");
		append_char_name(0);
		append_string(" grabs a rock and throws it towards the vampiress. It flies straight through her, landing with a thud.");
		get_buffer_text(dlgstr);
		message_dialog("You look up, and see a pair of faintly glowing red eyes looking back down.",dlgstr);
		
		reset_dialog();
		message_dialog("She laughs and floats off to the west. Maybe you got lucky and destroyed her physical form in the fight, and she can't actually do anything to hurt you.","If she had wanted to, there would have been ample opportunity along this trail.");
		set_flag(0,19,1);
		end();
	}
break;

beginstate 30;
	if(get_flag(0,20) == 0){
		reset_dialog();
		add_dialog_str(0,"The path ahead of you dead ends sharply. You'll have to go back.",0);
		bmessage = run_dialog(1);
		set_flag(0,20,1);
		end();
	}
break;