beginoutdoorscript;

variables;
short choice,coins;
string str;

body;

beginstate INIT_STATE;
break;

beginstate START_STATE;

	if(get_flag(10,0) == 0){
		message_dialog("Now that you've escaped the fort, it's time to find that necromancer and kill him for the trouble he's caused.","");
		toggle_quest(1,0);
		toggle_quest(2,1);
		award_party_xp(500,1);
		set_flag(10,0,1);
		}
break;

beginstate 10;
	if(get_flag(10,3) == 0){
		play_sound(-54);
		play_sound(-169);
		large_draw_pic_dialog(306,"KA-POW!");
		message_dialog("This must be the dark necromancer's evil tower.  And he lives here, so you have to go inside and kill him.","");
		set_flag(10,3,1);
		}
break;

beginstate 11;
break;

beginstate 12;

	print_str("Can't go back!");
	block_entry(1);

break;

beginstate 13;

	if(get_flag(10,0) == 1){
		message_dialog("A short distance away, you spot a small campfire.  If you wanted, you could sneak around it, but you could just as easily go check it out.","There could be treasure.");
		set_flag(10,0,2);
		}
break;

beginstate 14;

	if(get_flag(10,1) == 0){
		message_dialog("Suddenly, bats.","");
		play_sound(-121);
		large_draw_pic_dialog(304,"KREEEEEEEEEEEEEE!");
		create_out_spec_enc(0);
		set_flag(10,1,1);
		}

break;

beginstate 15; // leave
	reset_dialog();
	add_dialog_str(0,"Why are you trying to leave, don't you like it here?  There's still creatures to rob and brutally murder - your work isn't finished yet.",0);
	add_dialog_str(1,"Leave?",0);
	add_dialog_choice(0,"No.");
	add_dialog_choice(1,"YES!");
	choice = run_dialog(0);

	if(choice == 2){
		message_dialog("After leaving, the world explodes.  Everyone is dead.","");
		end_scenario(0);
		}

		else{
			block_entry(1);
			}
break;

beginstate 16;
	if(get_flag(10,2) == 1){
		reset_dialog();
		add_dialog_str(0,"Thanks to your efforts, the merchants are safe from harm.",0);
		add_dialog_str(1,"_Thank goodness you came along,_ says one of the dapper gents, _we were almost bat food._",0);
		add_dialog_str(2,"_Yes, quite,_ says the other fanciful fellow, _I am indubitably certain that you should be rewarded for your efforts._",0);
		add_dialog_str(3,"He reaches into his coat and draws a couple of flasks, which he hands to you.",0);
		add_dialog_str(4,"_These are quality potions,_ he grins, _we're potion salesmen._",0);
		add_dialog_choice(0,"Thanks.");
		choice = run_dialog(1);

		award_party_xp(250,2);
		reward_give(220);
		reward_give(223);
		reward_give(225);

		reset_dialog();
		if(party_size() == 1)
			add_dialog_str(0,"_Say Bill,_ one of the salesmen says, _do you think this guy is worthy of the Special?_",0);
		if(party_size() > 1)
			add_dialog_str(0,"_Say Bill,_ one of the salesmen says, _do you think these guys are worthy of the Special?_",0);
		add_dialog_str(1,"Bill slaps his forehead in surprise.",0);
		add_dialog_str(2,"_The Special, of course, how could I forget about the Special?_",0);
		add_dialog_str(3,"He glances you over, scratching his beard.",0);
		if(party_size() == 1)
			add_dialog_str(4,"_I don't know Vince, I mean... well he DID save our lives.  What do you think?_",0);
			add_dialog_str(5,"_I guess we could afford to sell it if- nah, forget it, he's not interested.  Let's get moving._",0);
		if(party_size() > 1)
			add_dialog_str(4,"_I don't know Vince, I mean... well they DID save our lives.  What do you think?_",0);
			add_dialog_str(5,"_I guess we could afford to sell it if- nah, forget it, they're not interested.  Let's get moving._",0);
		add_dialog_choice(0,"I'll just be going now...");
		add_dialog_choice(1,"Wait, I'm interested!");
		choice = run_dialog(1);

		if(choice == 1){
			reset_dialog();
			add_dialog_str(0,"_Now wait just a moment_ Bill shouts. _Just lend us a moment of your time so we may properly extend our graditude._",0);
			add_dialog_str(1,"_What do you say, will you stay a minute and listen to this great deal?_",0);
			add_dialog_choice(0,"No, I've got to go.");
			add_dialog_choice(1,"Fine.");
			choice = run_dialog(1);
			}

			if(choice == 1){
				message_dialog("_Fine,_ Vince sighs, _we'll get out of your hair then.  Thanks again._","The two salesmen turn away and wander down the path.");
				set_flag(10,2,2);
				end();
				}

		reset_dialog();
		add_dialog_str(0,"_I knew he'd be interested,_ Bill says with a smirk. _I know good taste when I see it._",0);
		if(party_size() == 1)
			add_dialog_str(1,"_GREAT taste,_ Vince corrects him.  _Yes, I could tell we were dealing with a real aesthete the moment we were rescued from those brutish bats._",0);
		if(party_size() > 1)
			add_dialog_str(1,"_GREAT taste,_ Vince corrects him.  _Yes, I could tell we were dealing with some real aesthetes the moment we were rescued from those brutish bats._",0);
		add_dialog_str(2,"He leans in close, putting a hand on your shoulder.",0);
		add_dialog_str(3,"_And how could someone of such great taste not be interested in such a fantastic product as the Special?_",0);
		add_dialog_choice(0,"Actually, I've got to go.");
		add_dialog_choice(1,"Just tell me what it is already!");
		choice = run_dialog(1);

		if(choice == 1){
			reset_dialog();
			add_dialog_str(0,"_Now wait just a moment_ Bill shouts. _Just lend us a moment of your time so we may properly extend our graditude._",0);
			add_dialog_str(1,"_What do you say, will you stay a minute and listen to this great deal?_",0);
			add_dialog_choice(0,"No, I've got to go.");
			add_dialog_choice(1,"Fine.");
			choice = run_dialog(1);
			}

			if(choice == 1){
				message_dialog("_Fine,_ Vince sighs, _we'll get out of your hair then.  Thanks again._","The two salesmen turn away and wander down the path.");
				set_flag(10,2,2);
				end();
				}

		reset_dialog();
		add_dialog_str(0,"Vince pulls a flask out of his jacket.",0);
		add_dialog_str(1,"_Here it is - the Special!_",0);
		add_dialog_str(2,"_But Vince,_ Bill asks, _just what is so special about the Special?_",0);
		add_dialog_str(3,"_I'm glad you asked Bill, fantastic question, but you've got it all wrong - the real question is what ISN'T special about the Special!_",0);
		add_dialog_str(4,"_I'm afraid I don't quite understand, Vince, are you saying that the Special is possibly the most amazing potion to have ever been brewed?_",0);
		add_dialog_str(5,"_That's exactly what I'm saying, Bill.  Just look at the quality of this flask - that's actual glass crafted from the finest ash this side of the Abyss!_",0);
		add_dialog_str(6,"_I'm already sold Vince, but I doubt that someone of modest means, such as myself, could possibly afford something as amazing as the Special._",0);
		add_dialog_str(7,"_That's where you're wrong Bill!  What if I were to tell you that I was selling the Special for a special one-time offer of- uh... Hey buddy, how much cash you strapping anyway?_",0);
		add_dialog_choice(0,"Nevermind, I've heard enough.");
		if(coins_amount() > 0){
			clear_buffer();
			append_number(coins_amount());
			append_string(" coins.");
			get_buffer_text(str);
			add_dialog_choice(1,str);
			}
		if(coins_amount() == 0)
			add_dialog_choice(1,"Actually, I'm broke.");
			
		choice = run_dialog(1);

		if(choice == 1){
			reset_dialog();
			add_dialog_str(0,"_Now wait just a moment_ Bill shouts. _Just lend us a moment of your time so we may properly extend our graditude._",0);
			add_dialog_str(1,"_This is a great deal.  I assure you that you'll never find an offer like this elsewhere.  So how much did you say you have?_",0);
			add_dialog_choice(0,"Bye.");
			if(coins_amount() > 0){
				clear_buffer();
				append_number(coins_amount());
				append_string(" coins.");
				get_buffer_text(str);
				add_dialog_choice(1,str);
				}
			if(coins_amount() == 0)
				add_dialog_choice(1,"Actually, I'm broke.");

			choice = run_dialog(1);
			}

		if(choice == 1){
			message_dialog("_Fine,_ Vince sighs, _we'll get out of your hair then.  Thanks again._","The two salesmen turn away and wander down the path.");
			set_flag(10,2,2);
			end();
			}

		if((choice == 2) && (coins_amount() == 0)){
			reset_dialog();
			add_dialog_str(0,"Vince glances uneasily at Bill.",0);
			add_dialog_str(1,"_Uh, actually, we've got go.  Thanks again for the help._",0);
			add_dialog_str(2,"The two men quickly turn and walk away.",0);
			choice = run_dialog(1);

			set_flag(10,2,2);
			end();
			}

		clear_buffer();
		append_string("_What do you know, the price is exactly ");
		append_number(coins_amount());
		append_string(" coins!  How lucky you must feel!_");
		get_buffer_text(str);

		reset_dialog();
		add_dialog_str(0,str,0);
		add_dialog_str(1,"Bill grins at you.",0);
		add_dialog_str(2,"_So, you interested?_",0);
		add_dialog_choice(0,"I don't know...");
		choice = run_dialog(1);

		large_draw_pic_dialog(305,"_Come on, don't you trust us?_");

		reset_dialog();
		add_dialog_str(0,"_This is the last time we'll ask; take it or leave it._",0);
		add_dialog_str(1,"Buy the Special?",0);
		add_dialog_choice(0,"No.");
		add_dialog_choice(1,"Yes.");
		choice = run_dialog(1);

		if(choice == 1){
			message_dialog("_I guess we mistook you for someone of good taste,_ Vince says with a frown.","The two salesmen turn and wander away.");
			set_flag(10,2,2);
			end();
			}

		message_dialog("_You've made a wise decision,_ Bill says.","You exchange your money for a bottle of the Special.  Vince gives you a wink, and then the two salesmen turn and wander away.  You think you can hear them laughing.");
		coins = coins_amount() * -1;
		change_coins(coins);
		reward_give(448);
		set_flag(10,2,2);
		}
break;