// Town script for town 28: Filberton

begintownscript;

variables;

body;

beginstate INIT_STATE;

set_name(6,"Mayor Arbuckle");
set_name(7,"Secretary");
set_name(12,"Mother Della");
set_name(13,"Hermaiony");
set_name(29,"Redrick");
set_name(35,"Teacher");
set_name(36,"Teacher");
set_name(42,"Enlil");
set_name(30,"Apprentice mage");
set_name(33,"Apprentice mage");
set_name(34,"Apprentice mage");
set_name(38,"Apprentice mage");
set_name(80,"Apprentice mage");
set_name(39,"Apprentice priest");
set_name(44,"Apprentice priest");
set_name(40,"Apprentice priest");
set_name(46,"Apprentice priest");
set_name(45,"Apprentice priest");
set_name(41,"Apprentice priest");
set_name(43,"Apprentice priest");

break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;

	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(43,"Scribble scrabble");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(43,"Hmmmm");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(43,"Cough");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(42,"Be quiet please");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(42,"This is a library");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(42,"You are to late for classes!");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(35,"And that's it");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(35,"Understand?");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(35,"Its not so hard");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(61,"Bubble");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(34,"Aha!");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(34,"Interesting");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(46,"Can you explain it?");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(46,"That's weird");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(36,"Just don't do it");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(36,"Its to dangerous");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(38,"Can't you show us?");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(38,"Its really neat!");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(37,"It sounds dangerous");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(37,"Hmmmm");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(26,"Hiss");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(17,"Good food");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(17,"Nice rooms");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(18,"Cheers!");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(19,"Cheers!");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(21,"Slurp");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(17,"And you know what she did?");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(17,"Listen carefully...");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(22,"So what happened?");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(11,"Let me out!");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(11,"Go away!");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(11,"I want food!");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(10,"Quiet beggar!");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(10,"Be quiet!");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(28,"All kind a things!");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(28,"Nice swords!");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(28,"Nice gemstones!");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(12,"Come in child");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(12,"How can I help?");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(7,"Want an appointment?");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(7,"What about Saturday?");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(62,"An appointment please");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(62,"Saturday? Fine with me");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(14,"Scribble scrabble");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(6,"Senarti...");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(6,"Bandits...");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(6,"What's happening...");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(31,"Weapons!");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(31,"Armor!");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(48,"Potions!");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(48,"Scrolls!");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(73,"Cluck");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(73,"Peck");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(68,"Cluck");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(68,"Peck");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(77,"Cluck");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(77,"Peck");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(74,"Cluck");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(74,"Peck");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(78,"Cluck");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(78,"Peck");

if (get_flag(5,12) == 1) {
		if (get_flag(28,8) == 0) {
				message_dialog("You walk into town, and immediately are squashed by people wanting to thank you. Everybody is very pleased with what you did and they show that to you, too.","After giving you your well deserved attention, the people go on with their work. Its clear that you didn't do this deed for nothing.");
				set_flag(28,8,1);
				}
		}

if (get_flag(200,1) == 1) {
		if (get_flag(28,9) == 0) {
				message_dialog("Filberton is filled with guards now. Everybody watches carefully around, to see if there are any suspicious things happening, so they can report it to the local police department.","");
				set_flag(28,9,1);
				}
		}

if (get_flag(200,1) == 1) {
		activate_hidden_group(9); // activate guards
		erase_char(16); // erase characters
		erase_char(21);
		erase_char(23);
		erase_char(28);
		take_item_of_class_on_spot(8,5,4); // destroys items in tavern
		take_item_of_class_on_spot(8,5,21);
		take_item_of_class_on_spot(9,5,21);
		take_item_of_class_on_spot(9,5,21);
		take_item_of_class_on_spot(15,9,21);
		take_item_of_class_on_spot(15,9,21);
		take_item_of_class_on_spot(15,9,21);
		take_item_of_class_on_spot(15,9,21);
		take_item_of_class_on_spot(21,26,21); // destroys items in small stand at square
		take_item_of_class_on_spot(21,27,1);
		take_item_of_class_on_spot(21,28,21);
		}

break;

beginstate 10;
if (get_flag(28,3) == 1)
		end();
	message_dialog("This is the huge temple of Filberton. Besides its status as magic city of Riverrod, it's also the cultural center of Riverrod.","The one strange thing is, are the chickens walking around. Better have a word with the priestess.");
	set_flag(28,3,1);
break;

beginstate 11;
if (get_flag(28,4) == 1)
		end();
	message_dialog("This is the local inn. You didn't expect the inn to be as full as it is now. There is a war at the moment, so you would expect people fleeing. Maybe people feel safe, when so close to a school of magery.","");
	set_flag(28,4,1);
break;

beginstate 12;
if (get_flag(28,5) == 1)
		end();
	message_dialog("This must be the most intriguing part of Filberton: the school of Magery. It is not big, actually, it is quite small. Nevertheless, new priests and mainly magi start their adventure into the world of magery here.","");
	set_flag(28,5,1);
break;

beginstate 13;
if (get_flag(28,6) == 1)
		end();
	message_dialog("This is Filberton's small bazaar. You can buy all kinds of stuff here, if you wish. The prices seem reasonable.","");
	set_flag(28,6,1);
break;

beginstate 14;
	message_dialog("You choose not to go any further than this. By going further, you might break the concentration of the apprentices, and weird things might happen. You stay away.","");
	block_entry(1);
break;

beginstate 15;
	message_dialog("This book is, sadly, beyond your comprehension.","");
break;

beginstate 16;
	message_dialog("This book is filled with delicious recipes to cook, barbecue, even boil chickens. You would love to try them out, but you wouldn't have the time to do so.","");
break;