// SCENARIO SCRIPT

// This is the special script for your entire scenario. It contains
// special encounters and code accessable from anywhere in the scenario. it also
// contains the code that initializes important special things in the
// scenario (like shops and names and descriptions of special items).

// You can create your own states, but you should give all of them numbers greater than
// or equal to 10.

beginscenarioscript;

variables;

body;

// This is the state that is called every time the scenario is loaded,
// even when a save file in the scenario is loaded. Some things that should go here:
//    Names and descriptions of special items.
//    Names and effects of custom special abilities.
beginstate LOAD_SCEN_STATE;

//Quests
	init_quest(0,"Settle Your Bar Tab","Anthony, the innkeeper at the Golden Egret, was kind enough to let you sleep off a round of ale without paying the 15 coins it cost. You'll probably need to pay him back before you leave.");
	init_quest(1,"Travel to the Cathedral","You need to go to the Cathedral of Winds to find out why you've been summoned to Relonar.");
	init_quest(2,"Huge Cache of Jewels","Nathan, a jeweler in Stratton, spoke of a huge cache of jewels that is hidden somewhere in the Cathedral of Winds. He says he'll pay you to find its location for him.");
	init_quest(3,"Speak with Felix","Father Richardson told you to speak to Felix, who should be down in the catacombs beneath the cathedral. He'll tell you more about your quest.");
	init_quest(4,"Swap Crystal","Felix gave you a crystal to replace part of a machine in a tomb. He said to switch the crystals quickly so that the ghosts can't escape.");
	init_quest(5,"Save Jack","A hysterical guard told you that his friend Jack was caught by ghosts somewhere around the third floor. Supposedly, you should go and save him.");
	init_quest(6,"Speak with Felix Again","Father Richardson told you to speak with Felix in order to learn how to fix the wards.");
	init_quest(7,"Repair Machinery","Felix told you that the suppression field can be powered up by installing a new control crystal. You can find the backup crystals in one of the storage attics.");
	init_quest(8,"Retrieve Crystal","Grimsley told you to bring him one of the control crystals used in the cathedral's suppression field generator. Once you bring it to him, he can alter it so that it will negate the wards on the building, and then the ghosts can escape.");
	init_quest(9,"Free the Ghosts","Grimsley told you to swap the altered crystal into the suppression field generator, so that the wards on the building are nullified. Then, the ghosts can escape.");


//Special Items


break;

// This is the state that is called only once at the very beginning of 
// the scenario. Some things that should go here:
//    The stuff in shops.
//    Creating horses and boats.
beginstate START_SCEN_STATE;

	// Start bar tab 'quest', and travel to cathedral quest
	toggle_quest(0,1);
	toggle_quest(1,1);

	// Initialize a few shops.
	
	// Shop 0 - Rebecca's Armor & Weapons
	add_item_to_shop(0,31,10);
	add_item_to_shop(0,32,3);
	add_item_to_shop(0,36,5);
	add_item_to_shop(0,37,2);
	add_item_to_shop(0,40,1);
	add_item_to_shop(0,46,20);
	add_item_to_shop(0,47,13);
	add_item_to_shop(0,51,10);
	add_item_to_shop(0,52,6);
	add_item_to_shop(0,56,7);
	add_item_to_shop(0,57,3);
	add_item_to_shop(0,61,1);
	add_item_to_shop(0,66,5);
	add_item_to_shop(0,71,3);
	add_item_to_shop(0,77,1);
	add_item_to_shop(0,122,9);
	add_item_to_shop(0,123,5);
	add_item_to_shop(0,127,6);
	add_item_to_shop(0,128,2);
	add_item_to_shop(0,132,1);
	add_item_to_shop(0,142,6);
	add_item_to_shop(0,148,3);
	
	// Shop 1 - weapons
	add_item_to_shop(1,45,25);
	add_item_to_shop(1,46,20);
	add_item_to_shop(1,50,15);
	add_item_to_shop(1,51,10);
	add_item_to_shop(1,55,5);
	add_item_to_shop(1,65,20);
	add_item_to_shop(1,66,10);
	add_item_to_shop(1,70,5);
	
	// Shop 2 - Nathan the Packrat
	add_item_to_shop(2,300,1);
	add_item_to_shop(2,409,3);
	add_item_to_shop(2,408,2);
	add_item_to_shop(2,405,4);
	add_item_to_shop(2,213,1);
	add_item_to_shop(2,383,1);
	add_item_to_shop(2,271,1);
	add_item_to_shop(2,170,4);
	add_item_to_shop(2,163,2);
	add_item_to_shop(2,157,6);
	add_item_to_shop(2,184,1);
	
	// Shop 3 - Johann's Fletching
	add_item_to_shop(3,92,7);
	add_item_to_shop(3,96,3);
	add_item_to_shop(3,101,20);
	add_item_to_shop(3,102,5);
	add_item_to_shop(3,106,15);
	add_item_to_shop(3,314,8);
	add_item_to_shop(3,315,1);

	// Shop 4 - Helen's Potions & Herbs
	add_item_to_shop(4,214,15);
	add_item_to_shop(4,215,17);
	add_item_to_shop(4,216,9);
	add_item_to_shop(4,218,3);
	add_item_to_shop(4,184,2);
	add_item_to_shop(4,225,7);
	add_item_to_shop(4,226,4);
	add_item_to_shop(4,228,8);
	add_item_to_shop(4,229,6);
	add_item_to_shop(4,230,4);
	add_item_to_shop(4,231,5);

	// Shop 5 - food
	add_item_to_shop(5,4,500);
	add_item_to_shop(5,6,500);
	add_item_to_shop(5,7,500);
	add_item_to_shop(5,8,500);
	add_item_to_shop(5,11,500);
	add_item_to_shop(5,12,500);
	add_item_to_shop(5,397,500);
	add_item_to_shop(5,398,500);
	add_item_to_shop(5,399,5);

	// Shop 6 - Alexa's Mage Spells
	add_item_to_shop(6,2000,4);
	add_item_to_shop(6,2001,4);
	add_item_to_shop(6,2002,4);
	add_item_to_shop(6,2003,4);
	add_item_to_shop(6,2004,4);
	add_item_to_shop(6,2005,4);
	add_item_to_shop(6,2006,3);
	add_item_to_shop(6,2007,3);
	add_item_to_shop(6,2008,3);
	add_item_to_shop(6,2009,2);
	add_item_to_shop(6,2010,2);
	add_item_to_shop(6,2012,3);


	// Shop 7 - Helen's Potion Recipes
	add_item_to_shop(7,4000,1);
	add_item_to_shop(7,4001,1);
	add_item_to_shop(7,4002,1);
	add_item_to_shop(7,4003,1);
	add_item_to_shop(7,4004,1);
	add_item_to_shop(7,4005,1);
	add_item_to_shop(7,4007,1);
	add_item_to_shop(7,4008,1);
	add_item_to_shop(7,4009,1);

	// Shop 8 - F. Richardson's Priest Spells
	add_item_to_shop(8,3000,4);
	add_item_to_shop(8,3001,4);
	add_item_to_shop(8,3002,3);
	add_item_to_shop(8,3003,3);
	add_item_to_shop(8,3004,4);
	add_item_to_shop(8,3005,4);
	add_item_to_shop(8,3007,2);
	add_item_to_shop(8,3008,2);
	add_item_to_shop(8,3009,2);
	add_item_to_shop(8,3010,3);
	add_item_to_shop(8,3011,2);
	add_item_to_shop(8,3012,2);

	// Shop 9 - Paula's Potion Recipes
	add_item_to_shop(9,4000,1);
	add_item_to_shop(9,4001,1);
	add_item_to_shop(9,4005,1);
	add_item_to_shop(9,4006,1);
	add_item_to_shop(9,4007,1);
	add_item_to_shop(9,4012,1);



break;

// This state is called every tick wherever the party is in the scenario.
// You can use the set_state
beginstate START_STATE;

break;

// Place your own states below. Give each a number at least 10.
beginstate 10;
break;
