void QuestComplete(string sQuestName)
{
	int tmpLangFileID = LanguageOpenFile("interface_strings.txt");
	ref PChar, sld;
	int iPassenger;
	PChar = GetMainCharacter();
	float locx;
	float locy;
	float locz;
	int iColony;
	int iTradeGoods, iQuantityGoods, iTradeNation;
	string homelocation, homegroup, homelocator, tavernfriend;
// KK -->
	int cc;
	int canQty = 0;
	int crewQty = 0;
	ref port;
// <-- KK
	float x, y, z;// MAXIMUS
	string nearloc;// MAXIMUS
	aref arship; // PB

	int gp;
	int pb;
	int pg;
	int mb;

	int cog;
	int rum;

	switch(sQuestName)
	{

//..........................................................................................................................
//JRH: Caroline K quest -->

//---------------------------------------------------------------------------------------------------------

		case "clear_weather":
			SetNextWeather("Clear");
		break;

		case "Pchar_hah":
			PlaySound("VOICE\ENGLISH\blaze_hah.wav");
		break;

		case "Pchar_huh":
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");
		break;

		case "pchar_yah":
			PlaySound("OBJECTS\DUEL\man_attack6.wav");
		break;

		case "Pchar_whatwasthat":
			PlaySound("VOICE\ENGLISH\blaze_what_was_that.wav");
		break;

		case "Pchar_mhm":
			PlaySound("VOICE\ENGLISH\blaze_mhm.wav");
		break;

		case "pchar_sigh":
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
		break;

		case "pchar_oh":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead0.wav");
		break;

		case "pchar_ohoh":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead1.wav");
		break;

		case "Pchar_ooh":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead7.wav");
		break;

		case "Pchar_aah":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead6.wav");
		break;

		case "Pchar_mule_kick":
			PlaySound("OBJECTS\DUEL\damadge_hit1.wav");
		break;

		case "pchar_puh":
			PlaySound("VOICE\ENGLISH\blaze_puh.wav");
		break;

		case "Pchar_very_nice":
			PlaySound("VOICE\ENGLISH\blaze_very_nice.wav");
		break;

		case "Pchar_lets_go":
			PlaySound("VOICE\ENGLISH\blaze_lets_go.wav");
		break;

		case "Pchar_scream":
			PlaySound("VOICE\ENGLISH\blaze_scream.wav");
		break;

		case "Pchar_no_escape":
			PlaySound("VOICE\ENGLISH\blaze_no_escape.wav");
		break;

		case "Pchar_laugh":
			PlaySound("PEOPLE\laugh1.wav");
		break;

		case "pchar_grr":
			PlaySound("OBJECTS\DUEL\man_attack5.wav");
		break;

		case "pchar_psst":
			PlaySound("VOICE\ENGLISH\defoe_psst.wav");
		break;

		case "Pchar_poortype":
			LAi_SetPoorType(Pchar);
		break;

		case "Pchar_sittype":
			LAi_SetSitType(Pchar);
		break;

		case "Pchar_staytype":
			LAi_SetStayType(Pchar);
		break;

		case "Pchar_playertype":
			LAi_SetPlayerType(Pchar);
		break;

		case "Pchar_actortype":
			LAi_SetActorType(Pchar);
		break;

		case "skip_fightmode":
			LAi_SetFightMode(Pchar, false);
			LAi_SetPlayerType(Pchar);
		break;

		case "pchar_1":
			PlaySound("VOICE\ENGLISH\blaze_1.wav");
		break;

		case "pchar_2":
			PlaySound("VOICE\ENGLISH\blaze_2.wav");
		break;

		case "pchar_3":
			PlaySound("VOICE\ENGLISH\blaze_3.wav");
		break;

		case "pchar_4":
			PlaySound("VOICE\ENGLISH\blaze_4.wav");
		break;

		case "pchar_5":
			PlaySound("VOICE\ENGLISH\blaze_5.wav");
		break;

		case "pchar_6":
			PlaySound("VOICE\ENGLISH\blaze_6.wav");
		break;

		case "pchar_7":
			PlaySound("VOICE\ENGLISH\blaze_7.wav");
		break;

		case "pchar_8":
			PlaySound("VOICE\ENGLISH\blaze_8.wav");
		break;

		case "pchar_9":
			PlaySound("VOICE\ENGLISH\blaze_9.wav");
		break;

		case "censer_sound":
			PlaySound("OBJECTS\DUEL\censer.wav");
			PlaySound("OBJECTS\DUEL\censer.wav");
		break;

		case "recoil_sound":
			PlaySound("PEOPLE\recoil.wav");	
		break;

		case "creak_sound":
			PlaySound("PEOPLE\creak2.wav");
		break;

		case "jump_roof_sound":
			PlaySound("PEOPLE\jump_roof.wav");
		break;

		case "jump_sound":
			PlaySound("PEOPLE\Jump.wav");
		break;

		case "quest_item":
			PlaySound("INTERFACE\important_item.wav");	
			Logit(TranslateString("","An item has been removed from your inventory"));
		break;

		case "bomb_lit":
			PlaySound("OBJECTS\SHIPCHARGE\bomb_lit.wav");
			CreateParticleSystem("fort_fire" , 27.7, 0.5, 1.1, 0.0, 0.0, 0.0, sti(20) );
		break;

		case "whistle_the_side":
			PlaySound("OBJECTS\SHIPCHARGE\whistle_the_side.wav");
		break;

		case "temp_ammo_check_equip_button":



		break;

		case "temp_ammo_check_corridor_pistol":
			//LogIt("temp_ammo_check_corridor_pistol");
			//pistol use, diff places

			string gunID = GetCharacterEquipByGroup(Pchar,GUN_ITEM_TYPE);
			aref gun;
			Items_FindItem(gunID, &gun);

			gp = GetCharacterItem(Pchar, "gunpowder");
			pb = GetCharacterItem(Pchar, "pistolbullets");
			if(gp == 0)
			{
				int origchargespeed;
				origchargespeed = makeint(gun.chargespeed);
				//LogIt("origchargespeed = " + origchargespeed);
				gun.chargespeed = 0.1;
				//LogIt("chargespeed = " + gun.chargespeed);

				TakenItems(Pchar, "gunpowder", 1);

				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterByItem(Pchar, gunID);

				gun.chargespeed = origchargespeed;
				//LogIt("chargespeed = " + gun.chargespeed);

				LAi_QuestDelay("temp_gp_remove", 1.0);
			}
			if(pb == 0)
			{
				origchargespeed = makeint(gun.chargespeed);
				//LogIt("origchargespeed = " + origchargespeed);
				gun.chargespeed = 0.1;
				//LogIt("chargespeed = " + gun.chargespeed);

				TakenItems(Pchar, "pistolbullets", 1);

				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterByItem(Pchar, gunID);

				gun.chargespeed = origchargespeed;
				//LogIt("chargespeed = " + gun.chargespeed);

				LAi_QuestDelay("temp_pb_remove", 1.0);
			}
		break;
	//--------------------------------------------------------------------------------------
		case "temp_gp_remove":
			//LogIt("temp_gp_remove");
			if(!LAi_IsFightMode(Pchar))
			{
				TakenItems(Pchar, "gunpowder", -1);
			}
			else LAi_QuestDelay("temp_gp_remove", 0.5);
		break;

		case "temp_pb_remove":
			//LogIt("temp_pb_remove");
			if(!LAi_IsFightMode(Pchar))
			{
				TakenItems(Pchar, "pistolbullets", -1);
			}
			else LAi_QuestDelay("temp_pb_remove", 0.5);
		break;
	//--------------------------------------------------------------------------------------
	//--------------------------------------------------------------------------------------
		case "ammo_reset":
			//swamp_island
			//LogIt("Pchar.quest.gunpowder = " + Pchar.quest.gunpowder);
			//LogIt("Pchar.quest.pistolbullets = " + Pchar.quest.pistolbullets);

			int gp2 = makeint(Pchar.quest.gunpowder);
			int pb2 = makeint(Pchar.quest.pistolbullets);

			//LogIt("gp2 = " + gp2);
			//LogIt("pb2 = " + pb2);

			TakenItems(Pchar, "gunpowder", -100);
			TakenItems(Pchar, "pistolbullets", -100);

			TakenItems(Pchar, "gunpowder", gp2));
			TakenItems(Pchar, "pistolbullets", pb2);
		break;

		case "mutiny_cabin":
			PlaySound("AMBIENT\JAIL\sigh2.wav");
			PlaySound("AMBIENT\JAIL\sigh2.wav");

			LAi_QuestDelay("mutiny_cabin0", 4.0);

			pchar.quest.mutiny_officers.win_condition.l1 = "locator";
			pchar.quest.mutiny_officers.win_condition.l1.location = "mutiny_cabin";
			pchar.quest.mutiny_officers.win_condition.l1.locator_group = "goto";
			pchar.quest.mutiny_officers.win_condition.l1.locator = "check1";
			pchar.quest.mutiny_officers.win_condition = "mutiny_officers";
		break;

		case "mutiny_cabin0":
			PlaySound("INTERFACE\closed_door.wav");
			PlaySound("INTERFACE\closed_door.wav");

			LAi_QuestDelay("mutiny_cabin1", 2.0);
		break;

		case "mutiny_cabin1":
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto8");

			LAi_QuestDelay("mutiny_cabin1_A", 2.0);
		break;

		case "mutiny_cabin1_A":
			PlaySound("PEOPLE\run_wood.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "goto2", "mutiny_cabin2", "");

			LAi_QuestDelay("mutiny_cabin2", 4.0);
		break;

		case "mutiny_cabin2":
			LAi_SetActorType(characterFromID("Constable Mills"));
			LAi_ActorTurnToCharacter(characterFromID("Constable Mills"), PChar);
			LAi_SetActorType(characterFromID("Fletcher Christian"));
			LAi_ActorTurnToCharacter(characterFromID("Fletcher Christian"), PChar);

			LAi_SetActorType(characterFromID("Midshipman Young"));
			LAi_ActorTurnToCharacter(characterFromID("Midshipman Young"), PChar);
			LAi_ActorDialogNow(characterFromID("Midshipman Young"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Midshipman Young"));
			Characters[GetCharacterIndex("Midshipman Young")].dialog.CurrentNode  = "Young";
		break;

		case "mutiny_cabin3":
			//from Young dialog
			LAi_SetActorType(characterFromID("Constable Mills"));
			LAi_ActorTurnToCharacter(characterFromID("Constable Mills"), PChar);
			LAi_ActorDialogNow(characterFromID("Constable Mills"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Constable Mills"));
			Characters[GetCharacterIndex("Constable Mills")].dialog.CurrentNode  = "Mills";
		break;

		case "mutiny_cabin4":
			//from Mills dialog
			LAi_SetActorType(characterFromID("Fletcher Christian"));
			LAi_ActorTurnToCharacter(characterFromID("Fletcher Christian"), PChar);
			LAi_ActorDialogNow(characterFromID("Fletcher Christian"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Fletcher Christian"));
			Characters[GetCharacterIndex("Fletcher Christian")].dialog.CurrentNode  = "Christian";
		break;

		case "mutiny_cabin5":
			//from Christian dialog
			LAi_SetActorType(characterFromID("Fletcher Christian"));
			LAi_ActorTurnToLocator(characterFromID("Fletcher Christian"), "goto", "goto1");

			LAi_QuestDelay("mutiny_cabin5_A", 0.5);
		break;

		case "mutiny_cabin5_A":
			LAi_LocationFightDisable(&Locations[FindLocation("mutiny_cabin")], false);
			LAi_SetPlayerType(characterFromID("Fletcher Christian"));
			if(!LAi_IsFightMode(characterFromID("Fletcher Christian")) ) LAi_SetFightMode(characterFromID("Fletcher Christian"), true);

			LAi_QuestDelay("mutiny_cabin6", 1.0);
		break;

		case "mutiny_cabin6":
			PostVideoAndQuest("common\Blaze_mutiny_dead",1, "mutiny_cabin7");
		break;

		case "mutiny_cabin7":
			PauseAllSounds();//stops music

			LAi_SetActorType(characterFromID("Constable Mills"));
			LAi_ActorTurnToCharacter(characterFromID("Constable Mills"), PChar);
			LAi_SetActorType(characterFromID("Midshipman Young"));
			LAi_ActorTurnToCharacter(characterFromID("Midshipman Young"), PChar);

			LAi_SetPlayerType(Pchar);

			RemoveCharacterEquip(characterFromID("Fletcher Christian"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("Fletcher Christian"), "Guestsknife" );
			GiveItem2Character(characterFromID("Fletcher Christian"), "bladeX4");
			EquipCharacterByItem(characterFromID("Fletcher Christian"), "bladeX4");

			if(LAi_IsFightMode(characterFromID("Fletcher Christian"))) LAi_SetFightMode(characterFromID("Fletcher Christian"), false);

			LAi_SetActorType(characterFromID("Fletcher Christian"));
			LAi_ActorTurnToCharacter(characterFromID("Fletcher Christian"), PChar);

			LAi_QuestDelay("mutiny_cabin8", 1.0);
		break;

		case "mutiny_cabin8":
			LAi_LocationFightDisable(&Locations[FindLocation("mutiny_cabin")], true);
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");

			LAi_SetStayType(characterFromID("Fletcher Christian"));
			LAi_SetStayType(characterFromID("Midshipman Young"));
			LAi_SetStayType(characterFromID("Constable Mills"));
		break;

		case "mutiny_officers":
			PlaySound("VOICE\ENGLISH\blaze_pay_for_this.wav");

			LAi_SetOfficerType(characterFromID("Fletcher Christian"));
			LAi_SetOfficerType(characterFromID("Midshipman Young"));
			LAi_SetOfficerType(characterFromID("Constable Mills"));

			pchar.quest.mutiny_officers0.win_condition.l1 = "locator";
			pchar.quest.mutiny_officers0.win_condition.l1.location = "mutiny_cabin";
			pchar.quest.mutiny_officers0.win_condition.l1.locator_group = "goto";
			pchar.quest.mutiny_officers0.win_condition.l1.locator = "goto4";
			pchar.quest.mutiny_officers0.win_condition = "mutiny_officers0";
		break;

		case "mutiny_officers0":
			PlaySound("OBJECTS\SHIPCHARGE\gunner_fire.wav");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("mutiny_officers1", 2.0);
		break;

		case "mutiny_officers1":
			Characters[GetCharacterIndex("Fletcher Christian")].dialog.CurrentNode  = "Christian2";

			LAi_SetActorType(characterFromID("Fletcher Christian"));
			LAi_ActorTurnToCharacter(characterFromID("Fletcher Christian"), PChar);
			LAi_ActorDialogNow(characterFromID("Fletcher Christian"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Fletcher Christian"));
		break;

		case "mutiny_officers2":
			//from Christian dialog
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Fletcher Christian"));

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);

			DeleteAttribute(Pchar, "items");//takes all incl fists
			AddMoneyToCharacter(Pchar, -10000);

			GiveItem2Character(Pchar, "bladeX4");
			EquipCharacterByItem(Pchar, "bladeX4");
			PlaySound("OBJECTS\duel\sword_fallen.wav");

			LAi_QuestDelay("mutiny_officers2_A", 1.0);
		break;

		case "mutiny_officers2_A":
			GiveItem2Character(characterFromID("Fletcher Christian"), "blade1");
			EquipCharacterByItem(characterFromID("Fletcher Christian"), "blade1");
			GiveItem2Character(characterFromID("Fletcher Christian"), "pistolbbuss");
			EquipCharacterByItem(characterFromID("Fletcher Christian"), "pistolbbuss");

			LAi_QuestDelay("mutiny_officers3", 1.0);
		break;

		case "mutiny_officers3":
			Characters[GetCharacterIndex("Midshipman Young")].dialog.CurrentNode  = "Young2";

			LAi_SetActorType(characterFromID("Midshipman Young"));
			LAi_ActorTurnToCharacter(characterFromID("Midshipman Young"), PChar);
			LAi_ActorDialogNow(characterFromID("Midshipman Young"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Midshipman Young"));
		break;

		case "mutiny_officers4":
			//from Young dialog
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Midshipman Young"));

			LAi_QuestDelay("mutiny_officers4_A", 0.5);
		break;

		case "mutiny_officers4_A":
			GiveItem2Character(Pchar, "potionrum");
			PlaySound("INTERFACE\glass1.wav");
			PlaySound("INTERFACE\glass1.wav");

			LAi_QuestDelay("mutiny_officers5", 1.0);
		break;

		case "mutiny_officers5":
			Characters[GetCharacterIndex("Constable Mills")].dialog.CurrentNode  = "Mills2";

			LAi_SetActorType(characterFromID("Constable Mills"));
			LAi_ActorTurnToCharacter(characterFromID("Constable Mills"), PChar);
			LAi_ActorDialogNow(characterFromID("Constable Mills"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Constable Mills"));
		break;

		case "mutiny_officers6":
			//from Mills dialog
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Constable Mills"));
			GiveItem2Character(Pchar, "pistol2");
			EquipCharacterByItem(Pchar, "pistol2");
			TakeNItems(Pchar,"gunpowder", 1);
			TakeNItems(Pchar,"pistolbullets", 1);
			PlaySound("OBJECTS\DUEL\pistol_out1original.wav");

			LAi_QuestDelay("mutiny_officers7", 1.0);
		break;

		case "mutiny_officers7":
		//	Pchar.quest.JRH_rain = "";			//stops only drops not the sound!
			PlaySound("OBJECTS\DUEL\man_attack5.wav");

			LAi_QuestDelay("mutiny_officers8", 2.0);
		break;
	//----------------------------------------------------------------------------------------------------------------
		case "mutiny_officers8":
			Characters[GetCharacterIndex("Constable Mills")].dialog.CurrentNode  = "Mills3";

			LAi_SetActorType(characterFromID("Constable Mills"));
			LAi_ActorTurnToCharacter(characterFromID("Constable Mills"), PChar);
			LAi_ActorDialogNow(characterFromID("Constable Mills"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Constable Mills"));
		break;

		case "mutiny_officers9":
			Characters[GetCharacterIndex("Midshipman Young")].dialog.CurrentNode  = "Young3";

			LAi_SetActorType(characterFromID("Midshipman Young"));
			LAi_ActorTurnToCharacter(characterFromID("Midshipman Young"), PChar);
			LAi_ActorDialogNow(characterFromID("Midshipman Young"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Midshipman Young"));
		break;

		case "mutiny_officers10":
			Characters[GetCharacterIndex("Fletcher Christian")].dialog.CurrentNode  = "Christian3";

			LAi_SetActorType(characterFromID("Fletcher Christian"));
			LAi_ActorTurnToCharacter(characterFromID("Fletcher Christian"), PChar);
			LAi_ActorDialogNow(characterFromID("Fletcher Christian"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Fletcher Christian"));
		break;

		case "mutiny_officers11":
			PlaySound("VOICE\ENGLISH\blaze_puh.wav");

			LAi_SetPlayerType(Pchar);
			LAi_SetOfficerType(characterFromID("Fletcher Christian"));
			LAi_SetOfficerType(characterFromID("Midshipman Young"));
			LAi_SetOfficerType(characterFromID("Constable Mills"));

			Pchar.quest.marooned_items = "yes";			

			pchar.quest.mutiny_deck.win_condition.l1 = "location";
			pchar.quest.mutiny_deck.win_condition.l1.location = "mutiny_deck";
			pchar.quest.mutiny_deck.win_condition = "mutiny_deck";
		break;
	//----------------------------------------------------------------------------------------------------------------
		case "mutiny_deck":
			PlaySound("INTERFACE\closed_locked_door.wav");

			ChangeCharacterAddressGroup(characterFromID("Fletcher Christian"), "mutiny_deck", "officers", "reload1_3");
			ChangeCharacterAddressGroup(characterFromID("Midshipman Young"), "mutiny_deck", "officers", "reload1_2");
			ChangeCharacterAddressGroup(characterFromID("Constable Mills"), "mutiny_deck", "officers", "reload1_1");

			LAi_SetStayType(characterFromID("Fletcher Christian"));
			LAi_SetStayType(characterFromID("Midshipman Young"));
			LAi_SetStayType(characterFromID("Constable Mills"));

			LAi_QuestDelay("mutiny_deck00", 1.0);

			pchar.quest.mutiny_deck0.win_condition.l1 = "locator";
			pchar.quest.mutiny_deck0.win_condition.l1.location = "mutiny_deck";
			pchar.quest.mutiny_deck0.win_condition.l1.locator_group = "goto";
			pchar.quest.mutiny_deck0.win_condition.l1.locator = "goto32";
			pchar.quest.mutiny_deck0.win_condition = "mutiny_deck0";
		break;

		case "mutiny_deck00":
			PlaySound("AMBIENT\pirate_captains.wav");
		break;

		case "mutiny_deck0":
			PlaySound("AMBIENT\UnHappy-001.wav");

			LAi_SetOfficerType(characterFromID("Fletcher Christian"));
			LAi_SetOfficerType(characterFromID("Midshipman Young"));
			LAi_SetOfficerType(characterFromID("Constable Mills"));

			pchar.quest.mutiny_deck1.win_condition.l1 = "locator";
			pchar.quest.mutiny_deck1.win_condition.l1.location = "mutiny_deck";
			pchar.quest.mutiny_deck1.win_condition.l1.locator_group = "box";
			pchar.quest.mutiny_deck1.win_condition.l1.locator = "box2";
			pchar.quest.mutiny_deck1.win_condition = "mutiny_deck1";
		break;

		case "mutiny_deck1":
			SetNextWind("N",30);
			PlaySound("PEOPLE\recoil.wav");
			LAi_SetSitType(Pchar);

			ChangeCharacterAddressGroup(characterFromID("Fletcher Christian"), "mutiny_deck", "goto", "goto30");
			ChangeCharacterAddressGroup(characterFromID("Midshipman Young"), "mutiny_deck", "goto", "goto29");
			ChangeCharacterAddressGroup(characterFromID("Constable Mills"), "mutiny_deck", "box", "box1");

			ChangeCharacterAddressGroup(characterFromID("mutineer_18"), "mutiny_deck", "goto", "goto28");

			LAi_SetActorType(characterFromID("mutineer_25"));
			LAi_SetActorType(characterFromID("mutineer_26"));
			LAi_SetActorType(characterFromID("mutineer_27"));
			LAi_SetActorType(characterFromID("mutineer_3"));
			LAi_SetActorType(characterFromID("mutineer_13"));
			LAi_SetActorType(characterFromID("mutineer_5"));
			LAi_SetActorType(characterFromID("mutineer_17"));
			LAi_SetActorType(characterFromID("mutineer_31"));
			LAi_SetActorType(characterFromID("mutineer_1"));
			LAi_SetActorType(characterFromID("mutineer_11"));
			LAi_SetActorType(characterFromID("mutineer_12"));
			LAi_SetActorType(characterFromID("mutineer_22"));
			LAi_SetActorType(characterFromID("mutineer_21"));

			LAi_SetActorType(characterFromID("mutineer_4"));
			LAi_SetActorType(characterFromID("mutineer_2"));
			LAi_SetActorType(characterFromID("mutineer_8"));
			LAi_SetActorType(characterFromID("mutineer_19"));
			LAi_SetActorType(characterFromID("mutineer_23"));
			LAi_SetActorType(characterFromID("mutineer_9"));
			LAi_SetActorType(characterFromID("mutineer_24"));
			LAi_SetActorType(characterFromID("mutineer_6"));
			LAi_SetActorType(characterFromID("mutineer_14"));
			LAi_SetActorType(characterFromID("mutineer_18"));
			LAi_SetActorType(characterFromID("Fletcher Christian"));
			LAi_SetActorType(characterFromID("Midshipman Young"));
			LAi_SetActorType(characterFromID("Constable Mills"));

			LAi_ActorTurnToLocator(characterFromID("mutineer_25"), "box", "box2");
			LAi_ActorTurnToLocator(characterFromID("mutineer_26"), "box", "box2");
			LAi_ActorTurnToLocator(characterFromID("mutineer_27"), "box", "box2");
			LAi_ActorTurnToLocator(characterFromID("mutineer_3"), "box", "box2");
			LAi_ActorTurnToLocator(characterFromID("mutineer_13"), "box", "box2");
			LAi_ActorTurnToLocator(characterFromID("mutineer_5"), "box", "box2");
			LAi_ActorTurnToLocator(characterFromID("mutineer_17"), "box", "box2");
			LAi_ActorTurnToLocator(characterFromID("mutineer_31"), "box", "box2");
			LAi_ActorTurnToLocator(characterFromID("mutineer_1"), "box", "box2");
			LAi_ActorTurnToLocator(characterFromID("mutineer_11"), "box", "box2");
			LAi_ActorTurnToLocator(characterFromID("mutineer_12"), "box", "box2");
			LAi_ActorTurnToLocator(characterFromID("mutineer_22"), "box", "box2");
			LAi_ActorTurnToLocator(characterFromID("mutineer_21"), "box", "box2");

			LAi_ActorTurnToLocator(characterFromID("mutineer_4"), "box", "box2");
			LAi_ActorTurnToLocator(characterFromID("mutineer_2"), "box", "box2");
			LAi_ActorTurnToLocator(characterFromID("mutineer_8"), "box", "box2");
			LAi_ActorTurnToLocator(characterFromID("mutineer_19"), "box", "box2");
			LAi_ActorTurnToLocator(characterFromID("mutineer_23"), "box", "box2");
			LAi_ActorTurnToLocator(characterFromID("mutineer_9"), "box", "box2");
			LAi_ActorTurnToLocator(characterFromID("mutineer_24"), "box", "box2");
			LAi_ActorTurnToLocator(characterFromID("mutineer_6"), "box", "box2");
			LAi_ActorTurnToLocator(characterFromID("mutineer_14"), "box", "box2");
			LAi_ActorTurnToLocator(characterFromID("mutineer_18"), "box", "box2");
			LAi_ActorTurnToLocator(characterFromID("Fletcher Christian"), "box", "box2");
			LAi_ActorTurnToLocator(characterFromID("Midshipman Young"), "box", "box2");
			LAi_ActorTurnToLocator(characterFromID("Constable Mills"), "box", "box2");

			LAi_QuestDelay("mutiny_deck1_A", 0.5);

			pchar.quest.Swamp_island1.win_condition.l1 = "location";
			pchar.quest.Swamp_island1.win_condition.l1.location = "Swamp_island1";
			pchar.quest.Swamp_island1.win_condition = "swamp1_pos1_turn_sea";
		break;

		case "mutiny_deck1_A":
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("mutiny_deck2", 0.5);
		break;

		case "mutiny_deck2":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto16");

			LAi_QuestDelay("mutiny_deck3", 1.0);
		break;

		case "mutiny_deck3":
			PlaySound("OBJECTS\SHIPCHARGE\hurrah.wav");

			LAi_QuestDelay("mutiny_deck3_A", 1.0);
		break;

		case "mutiny_deck3_A":
			PlaySound("VOICE\ENGLISH\blaze_pay_for_this.wav");

			LAi_QuestDelay("mutiny_deck4", 1.0);
		break;

		case "mutiny_deck4":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "randitem", "randitem1");

			LAi_QuestDelay("mutiny_deck5", 1.0);
		break;

		case "mutiny_deck5":
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");

			LAi_QuestDelay("mutiny_deck6", 1.0);
		break;

		case "mutiny_deck6":
			LAi_SetPlayerType(Pchar);
			Pchar.quest.mutineer_boat = "ready";
		break;

		case "Mutineer_dialog_over":
			//from Mutineer_dialog
			LAi_QuestDelay("Mutineer_dialog_over1", 2.0);
		break;

		case "Mutineer_dialog_over1":
			LAi_SetStayType(CharacterFromID("mutineer_1"));
			LAi_SetStayType(CharacterFromID("mutineer_2"));
			LAi_SetStayType(CharacterFromID("mutineer_3"));
			LAi_SetStayType(CharacterFromID("mutineer_4"));
			LAi_SetStayType(CharacterFromID("mutineer_5"));
			LAi_SetStayType(CharacterFromID("mutineer_6"));
			LAi_SetStayType(CharacterFromID("mutineer_7"));
			LAi_SetStayType(CharacterFromID("mutineer_8"));
			LAi_SetStayType(CharacterFromID("mutineer_9"));
			LAi_SetStayType(CharacterFromID("mutineer_10"));
			LAi_SetStayType(CharacterFromID("mutineer_11"));
			LAi_SetStayType(CharacterFromID("mutineer_12"));
			LAi_SetStayType(CharacterFromID("mutineer_13"));
			LAi_SetStayType(CharacterFromID("mutineer_14"));
			LAi_SetStayType(CharacterFromID("mutineer_16"));
			LAi_SetStayType(CharacterFromID("mutineer_17"));
			LAi_SetStayType(CharacterFromID("mutineer_19"));
			LAi_SetStayType(CharacterFromID("mutineer_21"));
			LAi_SetStayType(CharacterFromID("mutineer_22"));
			LAi_SetStayType(CharacterFromID("mutineer_23"));
			LAi_SetStayType(CharacterFromID("mutineer_24"));
			LAi_SetStayType(CharacterFromID("mutineer_31"));

			ChangeCharacterAddressGroup(CharacterFromID("mutineer_1"), "mutiny_deck", "goto", "goto1");
			ChangeCharacterAddressGroup(CharacterFromID("mutineer_2"), "mutiny_deck", "goto", "goto2");
			ChangeCharacterAddressGroup(CharacterFromID("mutineer_3"), "mutiny_deck", "goto", "goto3");
			ChangeCharacterAddressGroup(CharacterFromID("mutineer_4"), "mutiny_deck", "goto", "goto4");
			ChangeCharacterAddressGroup(CharacterFromID("mutineer_5"), "mutiny_deck", "goto", "goto5");
			ChangeCharacterAddressGroup(CharacterFromID("mutineer_6"), "mutiny_deck", "goto", "goto6");
			ChangeCharacterAddressGroup(CharacterFromID("mutineer_7"), "mutiny_deck", "goto", "goto7");
			ChangeCharacterAddressGroup(CharacterFromID("mutineer_8"), "mutiny_deck", "goto", "goto8");
			ChangeCharacterAddressGroup(CharacterFromID("mutineer_9"), "mutiny_deck", "goto", "goto9");
			ChangeCharacterAddressGroup(CharacterFromID("mutineer_10"), "mutiny_deck", "goto", "goto10");
			ChangeCharacterAddressGroup(CharacterFromID("mutineer_11"), "mutiny_deck", "goto", "goto11");
			ChangeCharacterAddressGroup(CharacterFromID("mutineer_12"), "mutiny_deck", "goto", "goto12");
			ChangeCharacterAddressGroup(CharacterFromID("mutineer_13"), "mutiny_deck", "goto", "goto13");
			ChangeCharacterAddressGroup(CharacterFromID("mutineer_14"), "mutiny_deck", "goto", "goto14");
			ChangeCharacterAddressGroup(CharacterFromID("mutineer_16"), "mutiny_deck", "goto", "goto16");
			ChangeCharacterAddressGroup(CharacterFromID("mutineer_17"), "mutiny_deck", "goto", "goto17");
		ChangeCharacterAddressGroup(CharacterFromID("mutineer_18"), "mutiny_deck", "goto", "goto18");
			ChangeCharacterAddressGroup(CharacterFromID("mutineer_19"), "mutiny_deck", "goto", "goto19");
			ChangeCharacterAddressGroup(CharacterFromID("mutineer_21"), "mutiny_deck", "goto", "goto21");
			ChangeCharacterAddressGroup(CharacterFromID("mutineer_22"), "mutiny_deck", "goto", "goto22");
			ChangeCharacterAddressGroup(CharacterFromID("mutineer_23"), "mutiny_deck", "goto", "goto23");
			ChangeCharacterAddressGroup(CharacterFromID("mutineer_24"), "mutiny_deck", "goto", "goto24");
			ChangeCharacterAddressGroup(CharacterFromID("mutineer_25"), "mutiny_deck", "goto", "goto25");
			ChangeCharacterAddressGroup(CharacterFromID("mutineer_26"), "mutiny_deck", "goto", "goto26");
			ChangeCharacterAddressGroup(CharacterFromID("mutineer_27"), "mutiny_deck", "goto", "goto27");
			ChangeCharacterAddressGroup(CharacterFromID("mutineer_31"), "mutiny_deck", "goto", "goto31");

		LAi_SetSitType(CharacterFromID("mutineer_18"));
			LAi_SetPoorType(CharacterFromID("mutineer_25"));
			LAi_SetPoorType(CharacterFromID("mutineer_26"));
			LAi_SetPoorType(CharacterFromID("mutineer_27"));
		break;

//-------------------------------------------------------------------------------------------
//swamp island1
		case "swamp1_pos1_turn_sea":
			PlaySound("PEOPLE\step_water.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "look1");

			LAi_QuestDelay("Pchar_playertype1", 1.0);
		break;

		case "Pchar_playertype1":
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("no_ships_in_sight1", 1.0);
		break;

		case "Pchar_playertype":
			LAi_SetPlayerType(Pchar);
		break;

		case "no_ships_in_sight1":
			if(Locations[FindLocation(Pchar.location)].models.always.locators == "jungle2_locators_JRH1")
			{
				PlaySound("VOICE\ENGLISH\blaze_dont_leave_me.wav");
			}
			else
			{
				if(Locations[FindLocation(Pchar.location)].models.always.locators == "jungle2_locators_JRH2")
				{
					if(CheckAttribute(Pchar,"quest.swamp1_sounds") && Pchar.quest.swamp1_sounds == "scream")
					{
						PlaySound("VOICE\ENGLISH\blaze_scream.wav");
					}
					else PlaySound("VOICE\ENGLISH\blaze_help.wav");
				}
			}
			else PlaySound("VOICE\ENGLISH\blaze_scream.wav");
		break;

		case "swamp1_pos1_move_to_land":
			PlaySound("PEOPLE\step_water2.wav");
			LAi_SetPlayerType(Pchar);

			ChangeCharacterAddressGroup(Pchar, "Swamp_island1", "goto", "goto1");
		break;
	//------------------------------------------------------------------------------------
		case "swamp1_pos2_turn_sea":
			PlaySound("PEOPLE\step_water.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "look2");

			LAi_QuestDelay("Pchar_playertype2", 1.0);
		break;

		case "Pchar_playertype2":
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("no_ships_in_sight2", 1.0);
		break;

		case "no_ships_in_sight2":
			PlaySound("VOICE\ENGLISH\blaze_no_escape.wav");
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"That island is the only land in sight. I have to get there!"));
		break;

		case "swamp1_pos2_move_to_land":
			PlaySound("PEOPLE\step_water2.wav");
			LAi_SetPlayerType(Pchar);

			ChangeCharacterAddressGroup(Pchar, "Swamp_island1", "goto", "goto2");
		break;
	//------------------------------------------------------------------------------------
		case "swamp1_pos3_turn_sea":
			PlaySound("PEOPLE\step_water.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "look3");

			LAi_QuestDelay("Pchar_playertype3", 1.0);
		break;

		case "Pchar_playertype3":
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("no_ships_in_sight3", 1.0);
		break;

		case "no_ships_in_sight3":
			if(Locations[FindLocation(Pchar.location)].models.always.locators == "jungle2_locators_JRH1")
			{
				PlaySound("VOICE\ENGLISH\blaze_help.wav");
			}
			else PlaySound("VOICE\ENGLISH\blaze_scream.wav");
		break;

		case "swamp1_pos3_move_to_land":
			PlaySound("PEOPLE\step_water2.wav");
			LAi_SetPlayerType(Pchar);

			ChangeCharacterAddressGroup(Pchar, "Swamp_island1", "goto", "goto3");
		break;
	//------------------------------------------------------------------------------------
		case "push_tree1":
			//from itemlogic
			Characters[GetCharacterIndex("gm_crew4")].Ship.Type = "obj_invisible";	//was boat
			characters[GetCharacterIndex("gm_crew5")].sailaway = true;

			DoQuestReloadToLocation("Swamp_island1", "goto", "push8", "push_tree1A");
		break;

		case "push_tree1A":
			LAi_SetActorType(Pchar);
			PlaySound("PEOPLE\step_water2.wav");

			LAi_QuestDelay("push_tree1B", 1.0);
		break;

		case "push_tree1B":
			PlaySound("OBJECTS\DUEL\man_attack6.wav");
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Yes, I can push tree to the shore!"));

			LAi_QuestDelay("sloop_sailaway1", 1.0);
		break;
	//.......................................................................
		case "sloop_sailaway1":
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire1.wav");

			LAi_QuestDelay("sloop_sailaway2", 1.0);
		break;

		case "sloop_sailaway2":

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box4");

			LAi_QuestDelay("sloop_sailaway3", 1.0);
		break;

		case "sloop_sailaway3":
			LAi_ActorGoToLocator(Pchar, "box", "box4", "sloop_sailaway4", 12.0);
		break;

		case "sloop_sailaway4":

			PlaySound("PEOPLE\step_water2.wav");
			ChangeCharacterAddressGroup(Pchar, "Swamp_island1", "goto", "at_sea1");

			LAi_QuestDelay("swamp1_pos1_turn_sea", 0.01);
			LAi_QuestDelay("sloop_sailed_long", 40.0);
		break;

		case "sloop_sailed_long":
			Pchar.quest.swamp1_sounds = "scream";
		break;
	//.......................................................................
		case "push_tree2":
			//from itemlogic
			SetCharacterShipLocation(characterFromID("gm_crew5"), "none");		//sloop

			DoQuestReloadToLocation("Swamp_island1", "goto", "push5", "push_tree2A");
		break;

		case "push_tree2A":
			PlaySound("PEOPLE\step_water2.wav");

			LAi_QuestDelay("push_tree2B", 1.0);
		break;

		case "push_tree2B":
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
		break;

		case "push_tree3":
			//from itemlogic
			DoQuestReloadToLocation("Swamp_island1", "goto", "at_sea2", "push_tree3A");
		break;

		case "push_tree3A":
			PlaySound("PEOPLE\step_water2.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "look2");

			LAi_QuestDelay("push_tree3B", 1.0);
		break;

		case "push_tree3B":
			LAi_SetPlayerType(Pchar);
			PlaySound("VOICE\ENGLISH\blaze_puh.wav");
		break;

		case "swamp1_pos2_turn_sea_last_time":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "look2_tree");

			LAi_QuestDelay("Pchar_sits_on_tree", 1.0);
		break;

		case "Pchar_sits_on_tree":
			LAi_SetPoorType(Pchar);
			PlaySound("VOICE\ENGLISH\blaze_lets_go.wav");

			LAi_QuestDelay("Pchar_sits_on_tree2", 1.0);

			pchar.quest.Swamp_island2.win_condition.l1 = "location";
			pchar.quest.Swamp_island2.win_condition.l1.location = "Swamp_island2";
			pchar.quest.Swamp_island2.win_condition = "Swamp_island2_start";
		break;

		case "Pchar_sits_on_tree2":
			Pchar.quest.tree_boat = "ready";
		break;

//-------------------------------------------------------------------------------------------
//swamp island2
		case "Swamp_island2_start":
			LAi_SetPlayerType(Pchar);
			SetCharacterShipLocation(characterFromID("gm_crew2"), "none");		//fallen_tree swamp_island2

			LAi_QuestDelay("timberlog_check", 0.1);

			pchar.quest.loghouse.win_condition.l1 = "location";
			pchar.quest.loghouse.win_condition.l1.location = "Loghouse";
			pchar.quest.loghouse.win_condition = "loghouse_start";

			pchar.quest.wreck.win_condition.l1 = "location";
			pchar.quest.wreck.win_condition.l1.location = "swamp_wreck_inside";
			pchar.quest.wreck.win_condition = "wreck_start";
		break;

		case "timberlog_check":
			if(CheckCharacterItem(Pchar,"koster1") || CheckCharacterItem(Pchar,"koster3") || CheckCharacterItem(Pchar,"koster4"))
			{
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "koster1" );
				TakeItemFromCharacter(Pchar, "koster3" );
				TakeItemFromCharacter(Pchar, "koster4" );
				GiveItem2Character(Pchar, "pistollog");
				EquipCharacterByItem(Pchar, "pistollog");

				SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box16", 0.0001);
				Locations[FindLocation("Swamp_island2")].locators_radius.box.box16 = 0.0001;

				SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box7", 2.0);
				Locations[FindLocation("Swamp_island2")].locators_radius.box.box7 = 2.0;

				//restart timberlog_check when pchar has placed a log at the shore
			}
			else
			{
				if(Locations[FindLocation(Pchar.location)].models.always.locators == "TownExitW_locators_JRH8")
				{
					return;
				}
				else LAi_QuestDelay("timberlog_check", 0.5);//loop check
			}
		break;

		case "loghouse_start":
			locations[FindLocation(Pchar.location)].box1.items.Minerspick = 1;

			LAi_QuestDelay("minerspick_check", 0.1);
		break;

		case "wreck_start":
			locations[FindLocation(Pchar.location)].box1.items.Minersspade = 1;

			LAi_QuestDelay("minersspade_check", 0.1);
		break;

		case "minersspade_check":
			if(CheckCharacterItem(Pchar,"Minersspade"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "Minersspade");
			}
			else
			{
				LAi_QuestDelay("minersspade_check", 0.5);//loop check
			}
		break;

		case "minerspick_check":
			if(CheckCharacterItem(Pchar,"Minerspick"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "Minerspick");
			}
			else
			{
				LAi_QuestDelay("minerspick_check", 0.5);//loop check
			}
		break;

		case "barmansknife_check":
			if(CheckCharacterItem(Pchar,"BarmansKnife"))
			{
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box1", 0.0001);
				Locations[FindLocation("Swamp_grot")].locators_radius.box.box1 = 0.0001;

				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "BarmansKnife");

				LAi_QuestDelay("graveplundering", 1.0);
			}
			else
			{
				LAi_QuestDelay("barmansknife_check", 0.5);//loop check
			}
		break;

		case "graveplundering":
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
			Logit(TranslateString("","Hmm. That was maybe not a good idea!?"));
			ChangeCharacterReputation(pchar, -5);//5p per level
		break;
	//.................................................................................................................
		case "use_Minerspick_on_stone":
			//from itemlogic box8
			PlaySound("PEOPLE\blade_kling.wav");
			PlaySound("OBJECTS\DUEL\spyglass.wav");
			CreateParticleSystem("splinters", 39.3, 1.0, -0.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 39.3, 1.0, -0.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", 39.0, 1.0, -0.3, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 39.0, 1.0, -0.3, 0.0, 0.0, 0.0, 0);

			LAi_QuestDelay("use_Minerspick_on_stone0", 1.0);
		break;

		case "use_Minerspick_on_stone0":
			PlaySound("PEOPLE\blade_kling.wav");
			PlaySound("OBJECTS\DUEL\spyglass.wav");
			CreateParticleSystem("splinters", 39.3, 1.0, -0.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 39.3, 1.0, -0.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", 39.0, 1.0, -0.3, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 39.0, 1.0, -0.3, 0.0, 0.0, 0.0, 0);

			LAi_QuestDelay("use_Minerspick_on_stone1", 1.0);
		break;

		case "use_Minerspick_on_stone1":
			PlaySound("PEOPLE\blade_kling.wav");
			PlaySound("OBJECTS\DUEL\spyglass.wav");
			CreateParticleSystem("splinters", 39.3, 1.0, -0.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 39.3, 1.0, -0.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", 39.0, 1.0, -0.3, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 39.0, 1.0, -0.3, 0.0, 0.0, 0.0, 0);

			LAi_QuestDelay("use_Minerspick_on_stone2", 1.0);
		break;

		case "use_Minerspick_on_stone2":
			if(LAi_IsFightMode(Pchar))
			{
				LAi_SetPlayerType(Pchar);
				LAi_SetFightMode(PChar, false);

				SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box8", 0.0001);
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem15", 2.0);

				Locations[FindLocation("Swamp_island2")].locators_radius.box.box8 = 0.0001;
				Locations[FindLocation("Swamp_island2")].locators_radius.randitem.randitem15 = 2.0;
			}
		break;
	//.................................................................................................................
		case "use_Minerspick_on_mud":
			//from itemlogic box8
			PlaySound("OBJECTS\DUEL\club1.wav");
			PlaySound("OBJECTS\DUEL\sword_cutbody.wav");
			CreateParticleSystemX("ball_splash", 36.0, 0.5, 5.2, 0.0, 0.0, 0.0, 0);

			LAi_QuestDelay("use_Minerspick_on_mud0", 1.0);
		break;

		case "use_Minerspick_on_mud0":
			PlaySound("OBJECTS\DUEL\club1.wav");
			PlaySound("OBJECTS\DUEL\sword_cutbody.wav");
			CreateParticleSystemX("ball_splash", 36.0, 0.5, 5.2, 0.0, 0.0, 0.0, 0);

			LAi_QuestDelay("use_Minerspick_on_mud1", 1.0);
		break;

		case "use_Minerspick_on_mud1":
			PlaySound("OBJECTS\DUEL\club1.wav");
			PlaySound("OBJECTS\DUEL\sword_cutbody.wav");
			CreateParticleSystemX("ball_splash", 36.0, 0.5, 5.2, 0.0, 0.0, 0.0, 0);

			LAi_QuestDelay("use_Minerspick_on_mud2", 1.0);
		break;

		case "use_Minerspick_on_mud2":
			if(LAi_IsFightMode(Pchar))
			{
				LAi_SetPlayerType(Pchar);
				LAi_SetFightMode(PChar, false);

				SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box9", 0.0001);
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem20", 1.0);

				Locations[FindLocation("Swamp_island2")].locators_radius.box.box9 = 0.0001;
				Locations[FindLocation("Swamp_island2")].locators_radius.randitem.randitem20 = 2.0;
			}
		break;
	//.................................................................................................................
		case "use_MinersSpade_on_grave":
			//from itemlogic box8
			locations[FindLocation(Pchar.location)].box1.items.BarmansKnife = 1;

			PlaySound("PEOPLE\dig_sand.wav");
			CreateParticleSystem("blast_dirt_small" , 10.9, -1.8, 1.2, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("use_MinersSpade_on_grave0", 1.0);
		break;

		case "use_MinersSpade_on_grave0":
			PlaySound("PEOPLE\dig_sand.wav");
			CreateParticleSystem("blast_dirt_small" , 10.9, -1.8, 1.2, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("use_MinersSpade_on_grave1", 1.0);
		break;

		case "use_MinersSpade_on_grave1":
			PlaySound("PEOPLE\dig_sand.wav");
			CreateParticleSystem("blast_dirt_small" , 10.9, -1.8, 1.2, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("use_MinersSpade_on_grave2", 0.5);
		break;

		case "use_MinersSpade_on_grave2":
			if(LAi_IsFightMode(Pchar))
			{
				LAi_SetPlayerType(Pchar);
				LAi_SetFightMode(PChar, false);

				ChangeCharacterAddressGroup(characterFromID("buried_skeleton"), "Swamp_grot", "goto", "corpse");
				Pchar.quest.buried_skeleton = "visible";

				LAi_QuestDelay("barmansknife_check", 0.1);
			}
		break;
	//.................................................................................................................
		case "use_BarmansKnife_on_rope":
			//from itemlogic box10

			PlaySound("OBJECTS\SHIPCHARGE\sail_damage2.wav");
			PlaySound("OBJECTS\SHIPCHARGE\sail_damage2.wav");
			PlaySound("OBJECTS\SHIPCHARGE\sail_damage2.wav");

			LAi_QuestDelay("use_BarmansKnife_on_rope2", 1.0);
		break;

		case "use_BarmansKnife_on_rope2":
			if(LAi_IsFightMode(Pchar))
			{
				LAi_SetPlayerType(Pchar);
				LAi_SetFightMode(PChar, false);

				SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box10", 0.0001);
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem7", 1.5);

				Locations[FindLocation("Swamp_island2")].locators_radius.box.box10 = 0.0001;
				Locations[FindLocation("Swamp_island2")].locators_radius.randitem.randitem7 = 1.5;

				LAi_QuestDelay("raft_ropes_check", 0.1);
			}
		break;
	//.................................................................................................................
	//-----------------------------------------------------------------------------------------------------------------
		case "wrong_use_MinersPick_on_grave":
			//from itemlogic box1 Swamp_grot
			PlaySound("OBJECTS\DUEL\punch4.wav");

			LAi_QuestDelay("wrong_use_MinersPick_on_grave0", 1.0);
		break;

		case "wrong_use_MinersPick_on_grave0":
			PlaySound("OBJECTS\VOICES\DEAD\skeleton\skeleton_dead02.wav");

			LAi_QuestDelay("wrong_use_MinersPick_on_grave1", 1.0);
		break;

		case "wrong_use_MinersPick_on_grave1":
			if(LAi_IsFightMode(Pchar))
			{
				LAi_SetPlayerType(Pchar);
				LAi_SetFightMode(PChar, false);
			}

			PlaySound("OBJECTS\VOICES\DEAD\male\dead1.wav");
		break;
	//.................................................................................................................
		case "wrong_use_MinersSpade_on_stone":
			//from itemlogic box8 Swamp_island2
			PlaySound("INTERFACE\wheel_place.wav");

			LAi_QuestDelay("wrong_use_MinersSpade_on_stone0", 1.0);
		break;

		case "wrong_use_MinersSpade_on_stone0":
			PlaySound("INTERFACE\wheel_place.wav");

			LAi_QuestDelay("wrong_use_MinersSpade_on_stone1", 1.0);
		break;

		case "wrong_use_MinersSpade_on_stone1":
			PlaySound("INTERFACE\wheel_place.wav");

			LAi_QuestDelay("wrong_use_MinersSpade_on_stone2", 1.0);
		break;

		case "wrong_use_MinersSpade_on_stone2":
			if(LAi_IsFightMode(Pchar))
			{
				LAi_SetPlayerType(Pchar);
				LAi_SetFightMode(PChar, false);

				PlaySound("OBJECTS\DUEL\man_attack5.wav");
				Logit(TranslateString("","Hmm. That's not a good idea"));
			}
		break;
	//.................................................................................................................
		case "wrong_use_MinersSpade_on_mud":
			//from itemlogic box8 Swamp_island2
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			CreateParticleSystemX("ball_splash", 36.0, 0.5, 5.2, 0.0, 0.0, 0.0, 0);

			LAi_QuestDelay("wrong_use_MinersSpade_on_mud0", 1.0);
		break;

		case "wrong_use_MinersSpade_on_mud0":
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			CreateParticleSystemX("ball_splash", 36.0, 0.5, 5.2, 0.0, 0.0, 0.0, 0);

			LAi_QuestDelay("wrong_use_MinersSpade_on_mud1", 1.0);
		break;

		case "wrong_use_MinersSpade_on_mud1":
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			CreateParticleSystemX("ball_splash", 36.0, 0.5, 5.2, 0.0, 0.0, 0.0, 0);

			LAi_QuestDelay("wrong_use_MinersSpade_on_mud2", 1.0);
		break;

		case "wrong_use_MinersSpade_on_mud2":
			if(LAi_IsFightMode(Pchar))
			{
				LAi_SetPlayerType(Pchar);
				LAi_SetFightMode(PChar, false);

				PlaySound("OBJECTS\DUEL\man_attack5.wav");
				Logit(TranslateString("","Hmm. That's not a good idea"));
			}
		break;
	//-----------------------------------------------------------------------------------------------------------------
	//.................................................................................................................
		case "swamp_wreck1":
			if(CheckAttribute(Pchar,"quest.raft_ropes") && Pchar.quest.raft_ropes == "picked_up")
			{
				LAi_SetActorType(Pchar);
				LAi_ActorTurnToLocator(Pchar, "reload", "reload7");
			}
			else
			{
				if(CheckAttribute(Pchar,"quest.mast_climb") && Pchar.quest.mast_climb == "way_down")
				{
					LAi_SetActorType(Pchar);
					LAi_ActorTurnToLocator(Pchar, "reload", "reload7");
				}
				else
				{
					LAi_SetActorType(Pchar);
					LAi_ActorTurnToLocator(Pchar, "goto", "look1");
				}
			}

			LAi_QuestDelay("Pchar_playertype", 1.0);
		break;

		case "swamp_wreck2":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "look2");

			LAi_QuestDelay("Pchar_playertype", 1.0);
		break;

		case "collect_raft_logs":
			//from itemlogic
			if(Locations[FindLocation(Pchar.location)].models.always.locators == "TownExitW_locators_JRH7")
			{
				SetNextWeather("Heavy Fog");
				Locations[FindLocation(Pchar.location)].models.always.locators = "TownExitW_locators_JRH8";
			}

			if(Locations[FindLocation(Pchar.location)].models.always.locators == "TownExitW_locators_JRH6")
			{ Locations[FindLocation(Pchar.location)].models.always.locators = "TownExitW_locators_JRH7";}

			if(Locations[FindLocation(Pchar.location)].models.always.locators == "TownExitW_locators_JRH5")
			{
				SetNextWeather("Foggy");
				Locations[FindLocation(Pchar.location)].models.always.locators = "TownExitW_locators_JRH6";
			}

			if(Locations[FindLocation(Pchar.location)].models.always.locators == "TownExitW_locators_JRH4")
			{ Locations[FindLocation(Pchar.location)].models.always.locators = "TownExitW_locators_JRH5";}

			DoQuestReloadToLocation("Swamp_island2", "goto", "goto8", "collect_raft_logs1");
		break;

		case "collect_raft_logs1":
			PlaySound("VOICE\ENGLISH\blaze_puh.wav");

			LAi_QuestDelay("ammo_reset", 0.1);
			LAi_QuestDelay("timberlog_check", 0.1);
		break;

		case "raft_ropes_check":
			//from itemlogic
			if(CheckCharacterItem(Pchar,"raft_ropes"))
			{
				Pchar.quest.raft_ropes = "picked_up";

				LAi_QuestDelay("raft_ropes1", 1.0);
			}
			else
			{
				LAi_QuestDelay("raft_ropes_check", 0.5);//loop check
			}
		break;

		case "raft_ropes1":
			PlaySound("PEOPLE\creak2.wav");
			ChangeCharacterAddressGroup(Pchar, "Swamp_island2", "goto", "goto6");
		break;

		case "arrange_raft_logs":
			//from itemlogic
			Locations[FindLocation(Pchar.location)].models.always.locators = "TownExitW_locators_JRH8_raft_logs";
			DoQuestReloadToLocation("Swamp_island2", "goto", "goto8", "arrange_raft_logs1");
		break;

		case "arrange_raft_logs1":
			CreateParticleSystem("blast_dirt_small" , -8.5, 1.1, -18.6, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("PEOPLE\wood2.wav");
			if(LAi_IsFightMode(Pchar))
			{
				LAi_SetPlayerType(Pchar);
				LAi_SetFightMode(PChar, false);
			}
		break;

		case "build_raft":
			//from itemlogic
			SetNextWeather("IslaDeMuerte");
			TakeItemFromCharacter(Pchar, "raft_ropes");
			Locations[FindLocation(Pchar.location)].models.always.locators = "TownExitW_locators_JRH8_raft_ropes";
			DoQuestReloadToLocation("Swamp_island2", "goto", "goto8", "build_raft1");
		break;

		case "build_raft1":
			PlaySound("OBJECTS\DUEL\man_attack6.wav");

			LAi_QuestDelay("Pchar_playertype", 1.0);
		break;

		case "launch_raft":
			//from itemlogic
			Locations[FindLocation("Swamp_island2")].locators_radius.box.box7 = 0.0001;
			SetCharacterShipLocation(CharacterFromID("gm_crew6"), "Swamp_island2");	//raft2
			Locations[FindLocation(Pchar.location)].models.always.locators = "TownExitW_locators_JRH0_raft_ship1";
			DoQuestReloadToLocation("Swamp_island2", "goto", "goto8", "launch_raft1");
		break;

		case "launch_raft1":
			CreateParticleSystemX("ball_splash", -8.1, 0.0, -11.6, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", -7.6, 0.0, -11.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", -10.3, 0.0, -11.3, 0.0, 0.0, 0.0, 0);
			PlaySound("PEOPLE\jump_water.wav");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
		break;

		case "push_raft":
			//from itemlogic
			Locations[FindLocation(Pchar.location)].models.always.locators = "TownExitW_locators_JRH0_raft_ship2";
			DoQuestReloadToLocation("Swamp_island2", "goto", "arrive", "push_raft1");
		break;

		case "push_raft1":
			PlaySound("PEOPLE\step_water2.wav");
		break;

		case "enter_raft":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "randitem", "randitem34");

			LAi_QuestDelay("enter_raft1", 1.0);
		break;

		case "enter_raft1":
			PlaySound("PEOPLE\recoil.wav");
			LAi_SetPoorType(Pchar);
			PlaySound("VOICE\ENGLISH\blaze_lets_go.wav");

			Pchar.quest.raft_boat = "ready";

			pchar.quest.meet_manowar.win_condition.l1 = "location";
			pchar.quest.meet_manowar.win_condition.l1.location = "at_sea_in_fog";
			pchar.quest.meet_manowar.win_condition = "meet_manowar";
		break;

		case "meet_manowar":
			PlaySound("OBJECTS\SHIPCHARGE\ship_aboard.wav");

			LAi_QuestDelay("meet_manowar1", 2.0);
			LAi_QuestDelay("meet_manowar_ambient", 8.0);

			pchar.quest.meet_manowar11.win_condition.l1 = "locator";
			pchar.quest.meet_manowar11.win_condition.l1.location = "Manowar_hold";
			pchar.quest.meet_manowar11.win_condition.l1.locator_group = "reload";
			pchar.quest.meet_manowar11.win_condition.l1.locator = "reload1";
			pchar.quest.meet_manowar11.win_condition = "meet_manowar11";
		break;

		case "meet_manowar_ambient":
			PlaySound("OBJECTS\SHIPCHARGE\ship_aground.wav");
		break;

		case "meet_manowar1":
			LAi_SetStayType(Pchar);
			PlaySound("VOICE\ENGLISH\blaze_what_was_that.wav");

			LAi_QuestDelay("meet_manowar2", 2.0);
		break;

		case "meet_manowar2":
			PlaySound("INTERFACE\bell2.wav");

			LAi_QuestDelay("meet_manowar3", 1.0);
		break;

		case "meet_manowar3":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "look1_mow");

			LAi_QuestDelay("meet_manowar4", 1.0);
		break;

		case "meet_manowar4":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead0.wav");
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("meet_manowar5", 1.0);
		break;

		case "meet_manowar5":
			PlaySound("INTERFACE\_EvShip0.wav");
			LAi_SetPlayerType(Pchar);
			SetCurrentTime(10.00, 0);
			SetNextWeather("Blue Sky");
			Pchar.quest.JRH_rain = "Clear";

			LAi_QuestDelay("meet_manowar6", 1.0);
		break;

		case "meet_manowar6":
			DoQuestReloadToLocation("Manowar_hold", "goto", "fall_down", "meet_manowar7");
		break;

		case "meet_manowar7":
			Pchar.quest.take_items = "no";
			Pchar.quest.JRH_rain = "";
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);

			DeleteAttribute(Pchar, "items");//takes all incl fists
			AddMoneyToCharacter(Pchar, -10000);

			GiveItem2Character(Pchar, "bladeX4");
			EquipCharacterByItem(Pchar, "bladeX4");

			LAi_QuestDelay("meet_manowar8", 0.5);
		break;

		case "meet_manowar8":
			PlaySound("PEOPLE\jump.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorSetLayMode(Pchar);

			LAi_QuestDelay("meet_manowar8A", 2.0);
		break;

		case "meet_manowar8A":
			PlaySound("INTERFACE\chart_move.wav");
			PlaySound("INTERFACE\chart_move.wav");
			PlaySound("INTERFACE\chart_move.wav");
			//PlaySound("PEOPLE\creak2.wav");

			LAi_QuestDelay("meet_manowar8B", 1.0);
		break;

		case "meet_manowar8B":
			PlaySound("PEOPLE\wood3.wav");

			LAi_QuestDelay("meet_manowar9", 2.0);
		break;

		case "meet_manowar9":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead2.wav");
			LAi_SetPoorType(Pchar);

			LAi_QuestDelay("meet_manowar10", 2.0);
		break;

		case "meet_manowar10":
			PlaySound("VOICE\ENGLISH\blaze_dont_leave_me.wav");
			LAi_SetPlayerType(Pchar);
		break;

		case "meet_manowar11":
			LAi_SetStayType(Pchar);
			PlaySound("VOICE\ENGLISH\blaze_no_escape.wav");

			LAi_QuestDelay("meet_manowar12", 1.5);

			pchar.quest.meet_manowar13.win_condition.l1 = "locator";
			pchar.quest.meet_manowar13.win_condition.l1.location = "Manowar_hold";
			pchar.quest.meet_manowar13.win_condition.l1.locator_group = "goto";
			pchar.quest.meet_manowar13.win_condition.l1.locator = "stay1";
			pchar.quest.meet_manowar13.win_condition = "meet_manowar13";
		break;

		case "meet_manowar12":
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "stay1", "", 4.0);
		break;

		case "meet_manowar13":
			LAi_SetstayType(Pchar);

			LAi_QuestDelay("meet_manowar14", 1.0);

			pchar.quest.pyle_port_royal.win_condition.l1 = "location";
			pchar.quest.pyle_port_royal.win_condition.l1.location = "Redmond_port";
			pchar.quest.pyle_port_royal.win_condition = "pyle_port_royal";
		break;

		case "meet_manowar14":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload3");

			LAi_QuestDelay("meet_manowar15", 1.0);
		break;

	//----------------------------------------------------------------------------
		case "meet_manowar15":
			LAi_SetPoorType(Pchar);
			PlaySound("PEOPLE\recoil.wav");

			LAi_QuestDelay("meet_manowar15A", 1.0);
		break;

		case "meet_manowar15A":
			PlaySound("PEOPLE\yawn.wav");

			LAi_QuestDelay("meet_manowar16", 2.0);
		break;

		case "meet_manowar16":
			PlaySound("AMBIENT\JAIL\sigh2.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorSetLayMode(Pchar);

			LAi_QuestDelay("meet_manowar17", 4.0);
		break;

		case "meet_manowar17":
			Locations[FindLocation("Manowar_hold")].models.always.locators = "Hold_l_JRH_manowar2";
			locations[FindLocation("Manowar_hold")].type = "silent_seashore";	//no music
			Locations[FindLocation("Manowar_hold")].image = "";

			DoQuestReloadToLocation("Manowar_hold", "goto", "stay1", "meet_manowar18");
		break;

		case "meet_manowar18":
			ChangeCharacterAddressGroup(characterFromID("Bolitho"), "Manowar_hold", "goto", "bolitho");
			ChangeCharacterAddressGroup(characterFromID("Herrick"), "Manowar_hold", "goto", "sailor2");
			ChangeCharacterAddressGroup(characterFromID("mow_marine1"), "Manowar_hold", "goto", "guard1");
			ChangeCharacterAddressGroup(characterFromID("mow_marine2"), "Manowar_hold", "goto", "guard2");
			ChangeCharacterAddressGroup(characterFromID("mow_sailor1"), "Manowar_hold", "goto", "sailor1");
			ChangeCharacterAddressGroup(characterFromID("mow_sailor2"), "Manowar_hold", "goto", "herrick");

			PlaySound("OBJECTS\SHIPCHARGE\CannonReload-001.wav");
			PlaySound("OBJECTS\SHIPCHARGE\CannonReload-001.wav");

			LAi_QuestDelay("meet_manowar19", 1.0);
		break;

		case "meet_manowar19":
			LAi_SetPoorType(Pchar);
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");

			LAi_QuestDelay("meet_manowar20", 1.0);
		break;

		case "meet_manowar20":
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("meet_Bolitho", 1.0);
		break;

		case "meet_Bolitho":
			LAi_SetActorType(characterFromID("Bolitho"));
			LAi_ActorTurnToCharacter(characterFromID("Bolitho"), PChar);
			LAi_ActorDialogNow(characterFromID("Bolitho"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Bolitho"));
		break;

		case "meet_Herrick":
			LAi_SetActorType(characterFromID("Herrick"));
			LAi_ActorTurnToCharacter(characterFromID("Herrick"), Pchar);
			LAi_ActorDialogNow(characterFromID("Herrick"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Herrick"));
		break;

		case "byebye_Bolitho":
			Characters[GetCharacterIndex("Bolitho")].dialog.CurrentNode  = "byebye";

			LAi_SetActorType(characterFromID("Bolitho"));
			LAi_ActorTurnToCharacter(characterFromID("Bolitho"), PChar);
			LAi_ActorDialogNow(characterFromID("Bolitho"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Bolitho"));
		break;

		case "Bolitho_leaves":
			LAi_SetActorType(characterFromID("Bolitho"));
			LAi_ActorTurnToLocator(characterFromID("Bolitho"), "randitem", "randitem3");

			LAi_QuestDelay("Bolitho_leaves1", 1.0);
		break;

		case "Bolitho_leaves1":
			ChangeCharacterAddressGroup(characterFromID("Bolitho"), "none", "", "");
			PlaySound("PEOPLE\creak2.wav");

			LAi_QuestDelay("Bolitho_leaves2", 0.5);
		break;

		case "Bolitho_leaves2":
			Characters[GetCharacterIndex("Herrick")].dialog.CurrentNode  = "leave_hold";

			LAi_SetActorType(characterFromID("Herrick"));
			LAi_ActorTurnToCharacter(characterFromID("Herrick"), Pchar);
			LAi_ActorDialogNow(characterFromID("Herrick"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Herrick"));
		break;

		case "leave_manowar_hold":
			Characters[GetCharacterIndex("Herrick")].dialog.CurrentNode  = "escort";
			SetCharacterShipLocation(characterFromID("gm_crew8"), "Redmond_Port");		//HMS_Endeavour
			SetCharacterShipLocation(characterFromID("gm_crew9"), "Redmond_Port");		//Boat2
			LAi_SetStayType(characterFromID("Herrick"));

			locations[FindLocation("Manowar_hold")].reload.l3.go = "REDMOND_PORT";
			locations[FindLocation("Manowar_hold")].reload.l3.emerge = "pyle";
			Locations[FindLocation("Manowar_hold")].reload.l3.disable = 0;

			LAi_SetPlayerType(Pchar);
		break;

		case "pyle_port_royal":
			ChangeCharacterAddressGroup(characterFromID("mow_sailor1"), "Redmond_port", "goto", "sailor1");
			ChangeCharacterAddressGroup(characterFromID("mow_sailor2"), "Redmond_port", "goto", "sailor2");
			LAi_SetStayType(characterFromID("mow_sailor1"));
			LAi_SetStayType(characterFromID("mow_sailor2"));

			ChangeCharacterAddressGroup(characterFromID("Herrick"), "Redmond_port", "goto", "herrick");
			ChangeCharacterAddressGroup(characterFromID("mow_marine1"), "Redmond_port", "goto", "marine1");
			ChangeCharacterAddressGroup(characterFromID("mow_marine2"), "Redmond_port", "goto", "marine2");

			AddPassenger(Pchar, characterFromID("Herrick"), 0);
			SetOfficersIndex(Pchar, 1, getCharacterIndex("Herrick"));
			LAi_SetPlayerType(characterFromID("Herrick"));
			LAi_SetOfficerType(characterFromID("Herrick"));

			AddPassenger(Pchar, characterFromID("mow_marine1"), 0);
			SetOfficersIndex(Pchar, 2, getCharacterIndex("mow_marine1"));
			LAi_SetOfficerType(characterFromID("mow_marine1"));

			AddPassenger(Pchar, characterFromID("mow_marine2"), 0);
			SetOfficersIndex(Pchar, 3, getCharacterIndex("mow_marine2"));
			LAi_SetOfficerType(characterFromID("mow_marine2"));

			Pchar.quest.Redmond_pause_sounds = "yes";

			ChangeCharacterAddressGroup(characterFromID("Woodes Rogers"), "Redmond_Town_01", "goto", "goto56");
			Locations[FindLocation("Redmond_town_01")].locators_radius.goto.goto17 = 2.0;

			pchar.quest.WR_on_balcony.win_condition.l1 = "locator";
			pchar.quest.WR_on_balcony.win_condition.l1.location = "Redmond_town_01";
			pchar.quest.WR_on_balcony.win_condition.l1.locator_group = "goto";
			pchar.quest.WR_on_balcony.win_condition.l1.locator = "goto17";
			pchar.quest.WR_on_balcony.win_condition = "WR_on_balcony";
		break;

//intro Rdm ---------------------------------------------------------------------------------------------------------

		case "WR_after_dialog3":
			LAi_SetStayType(Pchar);
			LAi_QuestDelay("WR_gone_soon", 1.0);
		break;

		case "WR_gone_soon":
			LAi_QuestDelay("WR_gone", 3.5);
		break;

		case "WR_gone":
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(characterFromID("Woodes Rogers"), "none", "", "");

			LAi_QuestDelay("WR_backcheck_exitloc", 0.1);
		break;

		case "WR_backcheck_exitloc":
			Pchar.quest.WR_back.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.WR_back.win_condition.l1.location = "Redmond_town_01";
			Pchar.quest.WR_back.win_condition = "WR_maybe_back";
		break;

		case "WR_maybe_back":
			if(CheckAttribute(Pchar,"quest.woodesrogers") && Pchar.quest.woodesrogers == "dead") return;

			if (pchar.location == "Redmond_tavern")
			{
				if(CheckAttribute(Pchar,"quest.wr_quest1") && Pchar.quest.wr_quest1 == "on")
				{
					ChangeCharacterAddressGroup(characterFromID("Woodes Rogers"), "Redmond_Tavern", "goto", "goto8");
					Locations[FindLocation("Redmond_town_01")].locators_radius.goto.goto17 = 2.0;

					LAi_QuestDelay("WR_dialog_starter", 0.1);
				}
				else
				{
					LAi_QuestDelay("WR_gone", 0.1);
				}
			}
			else
			{
				LAi_QuestDelay("WR_back", 0.1);
			}
		break;

		case "WR_back":
			ChangeCharacterAddressGroup(characterFromID("Woodes Rogers"), "Redmond_Town_01", "goto", "goto56");
			LAi_SetActorType(characterFromID("Woodes Rogers"));
			LAi_ActorTurnToLocator(characterFromID("Woodes Rogers"), "goto", "goto17");
			Locations[FindLocation("Redmond_town_01")].locators_radius.goto.goto17 = 2.0;

			LAi_QuestDelay("WR_dialog_starter", 0.1);
		break;

		case "WR_dialog_starter":
			pchar.quest.WR_on_balcony.win_condition.l1 = "locator";
			pchar.quest.WR_on_balcony.win_condition.l1.location = "Redmond_town_01";
			pchar.quest.WR_on_balcony.win_condition.l1.locator_group = "goto";
			pchar.quest.WR_on_balcony.win_condition.l1.locator = "goto17";
			pchar.quest.WR_on_balcony.win_condition = "WR_on_balcony";
		break;

		case "WR_on_balcony":
			if(CheckAttribute(Pchar,"quest.Redmond_pause_sounds") && Pchar.quest.Redmond_pause_sounds == "yes")
			{
				PauseAllSounds();
			}
			SetQuestHeader("Woodes_Rogers_quest");

			int p1; int p2; int p3; int p4; int p5;	int ptot;

			if(CheckAttribute(Pchar,"quest.wr_quest1") && Pchar.quest.wr_quest1 == "off") return;
			//after QC: donīt read here no more, go instead to "QC_sound_check_done"


			//this is what can happen - no other cases
			if(CheckAttribute(Pchar,"quest.wr_quest1") && Pchar.quest.wr_quest1 == "on")
			{
				PlaySound("VOICE\ENGLISH\gr_WR_offer3.wav");

				LAi_QuestDelay("WR_backcheck_exitloc", 5.5);
				return;
			}
			else
			{
				Pchar.quest.wr_quest1 = "balcony_talk1";
			}

			LAi_SetActorType(characterFromID("Woodes Rogers"));
			LAi_ActorTurnToCharacter(characterFromID("Woodes Rogers"), PChar);
			LAi_ActorDialogNow(characterFromID("Woodes Rogers"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Woodes Rogers"));
		break;

		case "wr_gone_soon2":
			LAi_SetStayType(Pchar);
			LAi_QuestDelay("balcony_talk2_start", 4.5);
		break;

		case "balcony_talk2_start":
			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("Redmond_tavern")].locators_radius.goto.goto6 = 1.0;

			ChangeCharacterAddress(characterFromID("Woodes Rogers"), "Redmond_tavern", "goto16");
			LAi_SetStayType(characterFromID("Woodes Rogers"));

			pchar.quest.balcony_talk2_upstairs.win_condition.l1 = "locator";
			pchar.quest.balcony_talk2_upstairs.win_condition.l1.location = "Redmond_tavern";
			pchar.quest.balcony_talk2_upstairs.win_condition.l1.locator_group = "goto";
			pchar.quest.balcony_talk2_upstairs.win_condition.l1.locator = "goto6";
			pchar.quest.balcony_talk2_upstairs.win_condition = "balcony_talk2_upstairs";
		break;

		case "balcony_talk2_upstairs":
			LAi_SetActorType(characterFromID("Woodes Rogers"));
			LAi_ActorTurnToCharacter(characterFromID("Woodes Rogers"), PChar);
			LAi_ActorDialog(characterFromID("Woodes Rogers"), pchar, "", 0.5, 0.5);
			LAi_ActorWaitDialog(Pchar, characterFromID("Woodes Rogers"));
			Characters[GetCharacterIndex("Woodes Rogers")].dialog.CurrentNode  = "balcony_talk2A";
		break;

		case "balcony_talk2_over":
			LAi_SetStayType(Pchar);
			LAi_SetActorType(characterFromID("Woodes Rogers"));
			LAi_ActorGoToLocator(characterFromID("Woodes Rogers"), "reload", "reload2", "balcony_talk2_over2", 1.0);
		break;

		case "balcony_talk2_over2":
			LAi_SetPlayerType(Pchar);
			PlaySound("INTERFACE\closed_locked_door.wav");
			Pchar.quest.wr_quest1 = "dont_repeat_talk2";		//repeat is off

			LAi_QuestDelay("WR_gone", 0.1);
		break;

		case "WR_wait_soon1":
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("balcony_talk1_start", 0.1);
			LAi_QuestDelay("Escort_crew_leaves", 0.1);
		break;
	//--------------------------------------------------------------------------------------
		case "Escort_crew_leaves":
			Characters[GetCharacterIndex("Herrick")].dialog.CurrentNode  = "Escort_leaves";
			LAi_SetActorType(characterFromID("Herrick"));
			LAi_ActorTurnToCharacter(characterFromID("Herrick"), Pchar);
			LAi_ActorDialogNow(characterFromID("Herrick"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Herrick"));
		break;

		case "Escort_returns_to_ship":
			int i;
			for(i=1; i<4; i++) RemoveOfficersIndex(GetMainCharacter(), GetOfficersIndex(GetMainCharacter(), i));
			RemovePassenger(pchar, characterFromID("Herrick"));
			RemovePassenger(pchar, characterFromID("mow_marine1"));
			RemovePassenger(pchar, characterFromID("mow_marine2"));

			LAi_SetActorType(characterFromID("Herrick"));
			LAi_ActorGoToLocator(characterFromID("Herrick"), "reload", "reload_from_port", "", "");
			LAi_SetActorType(characterFromID("mow_marine1"));
			LAi_ActorGoToLocator(characterFromID("mow_marine1"), "reload", "reload_from_port", "", "");
			LAi_SetActorType(characterFromID("mow_marine2"));
			LAi_ActorGoToLocator(characterFromID("mow_marine2"), "reload", "reload_from_port", "", "");

			LAi_QuestDelay("Escort_returns_to_ship1", 26.0);
		break;

		case "Escort_returns_to_ship1":
			ChangeCharacterAddressGroup(characterFromID("Herrick"), "Manowar_hold", "goto", "sailor2");
			ChangeCharacterAddressGroup(characterFromID("mow_marine1"), "Manowar_hold", "goto", "guard1");
			ChangeCharacterAddressGroup(characterFromID("mow_marine2"), "Manowar_hold", "goto", "guard2");

			ChangeCharacterAddressGroup(characterFromID("mow_sailor1"), "Manowar_hold", "goto", "sailor1");
			ChangeCharacterAddressGroup(characterFromID("mow_sailor2"), "Manowar_hold", "goto", "herrick");

			SetCharacterShipLocation(characterFromID("gm_crew9"), "none");		//Boat2
		break;
	//--------------------------------------------------------------------------------------
		case "balcony_talk1_start":
			if(CheckAttribute(Pchar,"quest.Nevis_part") && Pchar.quest.Nevis_part == "done")
			{
				return;
			}
			else
			{
				LAi_SetPlayerType(Pchar);

				pchar.quest.balcony_talk1_inside.win_condition.l1 = "locator";
				pchar.quest.balcony_talk1_inside.win_condition.l1.location = "Redmond_Tavern";
				pchar.quest.balcony_talk1_inside.win_condition.l1.locator_group = "reload";
				pchar.quest.balcony_talk1_inside.win_condition.l1.locator = "reload1";
				pchar.quest.balcony_talk1_inside.win_condition = "balcony_talk1_inside";
			}
		break;

		case "balcony_talk1_inside":
			if(CheckAttribute(Pchar,"quest.wr_quest1") && Pchar.quest.wr_quest1 == "off")
			{
				return;
			}
			else
			{
				ChangeCharacterAddress(characterFromID("Woodes Rogers"), "Redmond_tavern", "goto8");

				pchar.quest.balcony_talk1_outside.win_condition.l1 = "locator";
				pchar.quest.balcony_talk1_outside.win_condition.l1.location = "Redmond_Town_01";
				pchar.quest.balcony_talk1_outside.win_condition.l1.locator_group = "goto";
				pchar.quest.balcony_talk1_outside.win_condition.l1.locator = "goto57";
				pchar.quest.balcony_talk1_outside.win_condition = "balcony_talk1_outside";

				pchar.quest.balcony_talk1_out_again.win_condition.l2 = "locator";
				pchar.quest.balcony_talk1_out_again.win_condition.l2.location = "Redmond_Town_01";
				pchar.quest.balcony_talk1_out_again.win_condition.l2.locator_group = "reload";
				pchar.quest.balcony_talk1_out_again.win_condition.l2.locator = "door_1";
				pchar.quest.balcony_talk1_out_again.win_condition = "balcony_talk1_out_again";
			}
		break;

		case "balcony_talk1_out_again":
			if(CheckAttribute(Pchar,"quest.Nevis_part") && Pchar.quest.Nevis_part == "done")
			{
				return;
			}
			else
			{

				ChangeCharacterAddressGroup(characterFromID("Woodes Rogers"), "Redmond_Town_01", "goto", "goto56");

				LAi_QuestDelay("balcony_talk1_start", 0.1);
			}
		break;

		case "balcony_talk1_outside":
			ChangeCharacterAddressGroup(characterFromID("Woodes Rogers"), "Redmond_Town_01", "goto", "goto56");

			LAi_SetActorType(characterFromID("Woodes Rogers"));
			LAi_ActorTurnToCharacter(characterFromID("Woodes Rogers"), PChar);

			LAi_QuestDelay("balcony_talk1_outside1", 0.5);
			LAi_QuestDelay("balcony_talk1_outside2", 1.5);
		break;

		case "balcony_talk1_outside1":
			PauseAllSounds();
		break;

		case "balcony_talk1_outside2":
			LAi_ActorDialog(characterFromID("Woodes Rogers"), pchar, "", 0.5, 0.5);
			LAi_ActorWaitDialog(Pchar, characterFromID("Woodes Rogers"));
			Characters[GetCharacterIndex("Woodes Rogers")].dialog.CurrentNode  = "balcony_talk1A";
		break;

		case "balcony_talk1_over":
			Pchar.quest.Redmond_pause_sounds = "no";
			AddQuestRecord("Woodes_Rogers_quest", "1");
			Pchar.quest.check_pelagomap = "enabled";

			LAi_QuestDelay("balcony_talk1_jump", 1.5);
		break;

		case "balcony_talk1_jump":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto58");

			LAi_QuestDelay("balcony_talk1_jump2", 1.5);
		break;

		case "balcony_talk1_jump2":
			ChangeCharacterAddress(Pchar, "Redmond_Town_01", "goto58");
			PlaySound("PEOPLE\step_wood.wav");
			PlaySound("OBJECTS\DUEL\man_attack1.wav");

			LAi_SetSitType(Pchar);

			LAi_QuestDelay("balcony_talk1_jump3", 0.75);
		break;

		case "balcony_talk1_jump3":
			Pchar.quest.take_items = "yes";//reset
			SetCharacterShipLocation(characterFromID("gm_crew8"), "none");		//HMS_Endeavour
			SetCharacterShipLocation(characterFromID("gm_crew9"), "none");		//Boat2
			PlaySound("PEOPLE\jump.wav");
			PlaySound("PEOPLE\Jump_stone.wav");
			PlaySound("PEOPLE\step_echo.wav");

			Locations[FindLocation("Redmond_tavern")].reload.l3.disable = 1;//reload3 to balcony

			SetNextWind("E",30);
			SetServedNation(ENGLAND);
			GiveShip2Character(pchar,"SloopBermuda","Marquis",-1,PIRATE,true,true);
			SetCharacterShipLocation(Pchar, "Redmond_port");

			Locations[FindLocation("Tutorial_Deck")].WeaponsLocker.items.blade1 = 1;
			Locations[FindLocation("Tutorial_Deck")].WeaponsLocker.items.PiratesPistol = 1;

			Locations[FindLocation("Tutorial_Deck")].box1.items.spyglass2 = 1;
			Locations[FindLocation("Tutorial_Deck")].box1.items.compass1 = 1;
			Locations[FindLocation("Tutorial_Deck")].box1.items.map = 1;
			Locations[FindLocation("Tutorial_Deck")].box1.items.medical1 = 2; // PB
			Locations[FindLocation("Tutorial_Deck")].box1.money = 3000;	//was 1500
			Locations[FindLocation("Tutorial_Deck")].box1.items.gunpowder = 6;
			Locations[FindLocation("Tutorial_Deck")].box1.items.pistolbullets = 6;

			LAi_QuestDelay("WR_backcheck_exitloc", 0.1);

			LAi_QuestDelay("balcony_talk1_jump4", 0.4);
		break;

		case "balcony_talk1_jump4":
			PlaySound("INTERFACE\blues_intro.wav");

			locations[FindLocation("Redmond_Town_01")].type = "blues_town";
			locations[FindLocation("Redmond_Town_03")].type = "blues_town";
			locations[FindLocation("Redmond_Town_04")].type = "blues_town";
			locations[FindLocation("Redmond_Port")].type = "blues_port";
			PostEvent("LoadSceneSound", 2750);

			locations[FindLocation("Redmond_UsurerHouse")].type = "Rogers_neutral";//as long as this quest lasts

			LAi_SetPlayerType(Pchar);
			LAi_SetActorType(characterFromID("Woodes Rogers"));
			LAi_ActorTurnToLocator(characterFromID("Woodes Rogers"), "goto", "goto17");

		//[2] quest starter part1 QC -->
			Pchar.quest.wr_quest1 = "on";
			Pchar.quest.wr_quest2 = "start";
			Pchar.quest.wr_questinfo = "no";

			ChangeCharacterAddressGroup(characterFromID("Mistress"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_Brothel", "goto", "goto3");

			pchar.quest.marquis_very_nice.win_condition.l2 = "locator";
			pchar.quest.marquis_very_nice.win_condition.l2.location = "Redmond_port";
			pchar.quest.marquis_very_nice.win_condition.l2.locator_group = "goto";
			pchar.quest.marquis_very_nice.win_condition.l2.locator = "very_nice";
			pchar.quest.marquis_very_nice.win_condition = "marquis_very_nice";
		break;

		case "marquis_very_nice":
			LAi_SetStayType(Pchar);
			PlaySound("VOICE\ENGLISH\blaze_very_nice.wav");

			LAi_QuestDelay("Pchar_playertype", 1.0);

			pchar.quest.disable_check_pelagomap.win_condition.l1 = "location";
			pchar.quest.disable_check_pelagomap.win_condition.l1.location = "QC_port";
			pchar.quest.disable_check_pelagomap.win_condition = "disable_check_pelagomap";
		break;

		case "disable_check_pelagomap":
			Pchar.quest.check_pelagomap = "disabled";
			if(makeint(pchar.money) < 228) AddMoneyToCharacter(PChar, 228);
		break;
//..............................................................................................
//QC
		case "agreed_to_help":
			LAi_SetImmortal(CharacterFromID("Wench3"), true);
			ChangeCharacterAddress(characterFromID("Mistress"), "QC_brothel", "goto6");
			Pchar.quest.wr_quest2 = "Caroline_talk1";
			AddQuestRecord("Woodes_Rogers_quest", "5");
		break;

		//these come from wench 1 2 4 (brothel mode)
		case "Natalia":
			Characters[GetCharacterIndex("Wench1")].dialog.Filename  = "wenched_dialog.c";
			ChangeCharacterAddress(characterFromID("Wench1"), "QC_brothel_upstairs", "goto3");

			if(CheckAttribute(Pchar,"quest.wr_quest1") && Pchar.quest.wr_quest1 == "on")
			{
				ChangeCharacterAddressGroup(characterFromID("Mistress"), "none", "", "");
			}
			else
			{
				ChangeCharacterAddressGroup(characterFromID("Mistress"), "QC_brothel", "reload", "reload1");
				LAi_SetWaitressType(characterFromID("Mistress"));
			}

			Pchar.quest.wr_quest2 = "visit_Natalia";
			LAi_QuestDelay("after_wench", 0.1);
		break;

		case "Serena":
			Characters[GetCharacterIndex("Wench2")].dialog.Filename  = "wenched_dialog.c";
			ChangeCharacterAddress(characterFromID("Wench2"), "QC_brothel_upstairs", "goto2");

			if(CheckAttribute(Pchar,"quest.wr_quest1") && Pchar.quest.wr_quest1 == "on")
			{
				ChangeCharacterAddressGroup(characterFromID("Mistress"), "none", "", "");
			}
			else
			{
				ChangeCharacterAddressGroup(characterFromID("Mistress"), "QC_brothel", "reload", "reload1");
				LAi_SetWaitressType(characterFromID("Mistress"));
			}

			Pchar.quest.wr_quest2 = "visit_Serena";
			LAi_QuestDelay("after_wench", 0.1);
		break;

		case "Celia":
			Characters[GetCharacterIndex("Wench4")].dialog.Filename  = "wenched_dialog.c";
			ChangeCharacterAddress(characterFromID("Wench4"), "QC_brothel_upstairs", "goto2");

			if(CheckAttribute(Pchar,"quest.wr_quest1") && Pchar.quest.wr_quest1 == "on")
			{
				ChangeCharacterAddressGroup(characterFromID("Mistress"), "none", "", "");
			}
			else
			{
				ChangeCharacterAddressGroup(characterFromID("Mistress"), "QC_brothel", "reload", "reload1");
				LAi_SetWaitressType(characterFromID("Mistress"));
			}

			Pchar.quest.wr_quest2 = "visit_Celia";
			LAi_QuestDelay("after_wench", 0.1);
		break;

		case "Caroline_K":
			Pchar.quest.disable_rebirth = true;
			bDisableFastReload = 1;
			Locations[FindLocation("QC_brothel_upstairs")].models.always.locators = "brothel_room_locators_JRH2";//change to no box locators

			LAi_SetStayType(characterFromID("Wench3"));
			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_brothel_upstairs", "reload", "reload1");
			Locations[FindLocation("QC_brothel_upstairs")].reload.l1.disable = 1;
			Pchar.quest.wr_quest2 = "visit_Caroline";
		break;

		case "after_wench":
			pchar.quest.after_wench_2.win_condition.l1 = "locator";
			pchar.quest.after_wench_2.win_condition.l1.location = "QC_brothel";
			pchar.quest.after_wench_2.win_condition.l1.locator_group = "goto";
			pchar.quest.after_wench_2.win_condition.l1.locator = "goto12";
			pchar.quest.after_wench_2.win_condition = "after_wench_2";
		break;

		case "after_wench_2":
			LAi_SetWaitressType(characterFromID("Wench1"));
			LAi_SetWaitressType(characterFromID("Wench2"));
			LAi_SetWaitressType(characterFromID("Wench4"));

			if ( CheckAttribute(Pchar,"quest.wr_quest2") )
			{
			    switch(Pchar.quest.wr_quest2)
			    {
				case "visit_Natalia":
					Characters[GetCharacterIndex("Wench1")].dialog.Filename  = "wench_dialog.c";
					ChangeCharacterAddress(characterFromID("Wench1"), "QC_brothel", "goto6");
					pchar.quest.wr_quest2 = "neutral";//so the same girl doesnīt teleports again & again to goto6
					LAi_QuestDelay("after_wench", 0.1);
				break;

				case "visit_Serena":
					Characters[GetCharacterIndex("Wench2")].dialog.Filename  = "wench_dialog.c";
					ChangeCharacterAddress(characterFromID("Wench2"), "QC_brothel", "goto6");
					pchar.quest.wr_quest2 = "neutral";
					LAi_QuestDelay("after_wench", 0.1);
				break;

				case "visit_Celia":
					Characters[GetCharacterIndex("Wench4")].dialog.Filename  = "wench_dialog.c";
					ChangeCharacterAddress(characterFromID("Wench4"), "QC_brothel", "goto6");
					pchar.quest.wr_quest2 = "neutral";
					LAi_QuestDelay("after_wench", 0.1);
				break;
			    }
			    return;
			}
		break;

		case "ready_to_leave_brothel_room1":
			SetCurrentTime(12.00, 0);
			SetNextWeather("Clear");
			Pchar.quest.JRH_sky = "7_Gr";

			Locations[FindLocation("QC_brothel_upstairs")].models.always.locators = "brothel_room_locators_JRH";//resets to normal locators

			for(i=1; i<4; i++) RemoveOfficersIndex(GetMainCharacter(), GetOfficersIndex(GetMainCharacter(), i));

			ChangeCharacterAddress(characterFromID("Wench1"), "QC_brothel", "goto4");
			ChangeCharacterAddress(characterFromID("Wench2"), "QC_brothel", "goto5");
			ChangeCharacterAddress(characterFromID("Wench4"), "QC_brothel", "goto21");

			LAi_SetStayType(characterFromID("Mistress"));
			LAi_SetWaitressType(characterFromID("Wench1"));
			LAi_SetWaitressType(characterFromID("Wench2"));
			LAi_SetWaitressType(characterFromID("Wench4"));

			Locations[FindLocation("QC_brothel_upstairs")].reload.l1.disable = 0;

			AddQuestRecord("Woodes_Rogers_quest", "6");

			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_brothel", "reload", "reload3");
			LAi_SetStayType(characterFromID("Wench3"));

			pchar.quest.ready_to_leave_brothel_room2.win_condition.l1 = "locator";
			pchar.quest.ready_to_leave_brothel_room2.win_condition.l1.location = "QC_brothel";
			pchar.quest.ready_to_leave_brothel_room2.win_condition.l1.locator_group = "reload";
			pchar.quest.ready_to_leave_brothel_room2.win_condition.l1.locator = "reload2";
			pchar.quest.ready_to_leave_brothel_room2.win_condition = "ready_to_leave_brothel_room2";
		break;

		case "ready_to_leave_brothel_room2":
			ChangeCharacterAddress(characterFromID("Mistress"), "QC_brothel", "goto9");
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "goto8", "ready_to_leave_brothel_room3", 4.0);

			pchar.quest.ready_to_leave_brothel_room3.win_condition.l1 = "locator"
			pchar.quest.ready_to_leave_brothel_room3.win_condition.l1.location = "QC_brothel";
			pchar.quest.ready_to_leave_brothel_room3.win_condition.l1.locator_group = "goto";
			pchar.quest.ready_to_leave_brothel_room3.win_condition.l1.locator = "goto8";
			pchar.quest.ready_to_leave_brothel_room3.win_condition = "ready_to_leave_brothel_room3";

			pchar.quest.wr_quest2 = "Caroline_left_brothel_room";
		break;

		case "ready_to_leave_brothel_room3":
			LAi_type_actor_Reset(Pchar);

			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 2.0, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
		break;

		case "ready_to_break_window":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto13");

			LAi_QuestDelay("ready_to_break_window1", 0.5);
		break;


		case "ready_to_break_window1":
			Locations[FindLocation("QC_town")].models.always.locators = "QCtown_l_JRH";

			Locations[FindLocation("QC_Brothel")].reload.l1.disable = 1;//temp locked
			Locations[FindLocation("QC_brothel")].reload.l2.disable = 0;

			LAi_LocationFightDisable(&Locations[FindLocation("QC_brothel")], false);
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(PChar, true);

			LAi_QuestDelay("window_brakes", 1.0);
		break;

		case "window_brakes":
			LAi_tmpl_ani_PlayAnimation(characterFromID("Wench3"), "afraid", 1.0);

			SetSoundScheme("shop");//ambient is silenced down
			PauseAllSounds();//stops music
			PlaySound("AMBIENT\TOWN\window_dog_pistol.wav");

		locations[FindLocation("QC_town")].type = "silent_town";//stops music only

			LAi_QuestDelay("window_broken", 1.0);
		break;

		case "window_broken":
			if(LAi_IsFightMode(Pchar)) LAi_SetFightMode(PChar, false);

			ChangeCharacterAddressGroup(CharacterFromID("Brthug2"), "QC_brothel", "goto", "goto6");

			LAi_SetPlayerType(characterFromID("Wench3"));
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_brothel", "goto", "goto13");

			pchar.quest.wr_quest2 = "brothel_roof_talk";

			ChangeCharacterAddressGroup(CharacterFromID("Brthug1"), "QC_brothel", "goto", "goto16");

			GiveItem2Character(characterFromID("Mistress"), "blade5");
			EquipCharacterByItem(characterFromID("Mistress"), "blade5");

			LAi_SetActorType(characterFromID("Brthug1"));
			LAi_SetActorType(characterFromID("Brthug2"));
			LAi_SetActorType(characterFromID("Mistress"));

			LAi_ActorAttack(CharacterFromID("Brthug1"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("Brthug2"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("Mistress"), Pchar, "");

			LAi_SetImmortal(CharacterFromID("Mistress"), true);
			LAi_SetImmortal(CharacterFromID("Wench1"), true);
			LAi_SetImmortal(CharacterFromID("Wench2"), true);
			LAi_SetImmortal(CharacterFromID("Wench4"), true);

			pchar.quest.both_on_brothel_roof.win_condition.l1 = "location";
			pchar.quest.both_on_brothel_roof.win_condition.l1.location = "QC_town";
			pchar.quest.both_on_brothel_roof.win_condition = "both_on_brothel_roof";
		break;

		case "both_on_brothel_roof":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_town", "goto", "goto110");

			PlaySound("AMBIENT\TAVERN\tinkle4.wav");
			PlaySound("AMBIENT\TAVERN\drop4.wav");

			Locations[FindLocation("QC_Brothel")].reload.l1.disable = 0;//open again

			ChangeCharacterAddressGroup(CharacterFromID("Brthug1"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("Brthug2"), "none", "", "");

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Wench3"));

			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToLocator(characterFromID("Wench3"), "goto", "roof1");

			LAi_QuestDelay("both_on_brothel_roof_1", 2.0);//to roof_2
		break;

		case "both_on_brothel_roof_1":
			LAi_ActorTurnToLocator(characterFromID("Wench3"), "goto", "roof2");
			PlaySound("VOICE\ENGLISH\gr_wench3_mhm.wav");
			LAi_QuestDelay("both_on_brothel_roof_2", 1.0);		//was 2.0
		break;

		case "both_on_brothel_roof_2":
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_town", "goto", "roof2");
			PlaySound("PEOPLE\Jump_Roof.wav");
			LAi_QuestDelay("Caroline_walk_1", 1.0);
		break;
//-----------------------------------------------------------------------------------------------------------------
		case "Caroline_walk_1":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_town", "goto", "goto113w");
			PlaySound("PEOPLE\Run_Roof.wav");
			LAi_QuestDelay("Caroline_walk_1A", 0.5);
		break;

		case "Caroline_walk_1A":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_town", "goto", "goto114");
			LAi_QuestDelay("Caroline_jump_2", 0.5);
		break;

		case "Caroline_jump_2":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_town", "goto", "goto114j");
			LAi_QuestDelay("Caroline_jump_2A", 0.2);
		break;

		case "Caroline_jump_2A":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_town", "goto", "roof3");
			PlaySound("PEOPLE\Jump_Roof.wav");
			LAi_QuestDelay("Caroline_walk_2", 1.0);
		break;

		case "Caroline_walk_2":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_town", "goto", "goto115w");
			PlaySound("PEOPLE\Run_Roof.wav");
			LAi_QuestDelay("Caroline_walk_2A", 0.5);
		break;

		case "Caroline_walk_2A":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_town", "goto", "goto116");
			LAi_QuestDelay("Caroline_jump_3", 0.5);
		break;

		case "Caroline_jump_3":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_town", "goto", "goto116j");
			LAi_QuestDelay("Caroline_jump_3A", 0.2);
		break;

		case "Caroline_jump_3A":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_town", "goto", "roof4");
			PlaySound("PEOPLE\Jump_Roof.wav");
			LAi_QuestDelay("Caroline_walk_3", 1.0);
		break;

		case "Caroline_walk_3":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_town", "goto", "goto117w");
			PlaySound("PEOPLE\Run_Roof.wav");
			LAi_QuestDelay("Caroline_walk_3A", 0.5);
		break;

		case "Caroline_walk_3A":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_town", "goto", "goto118");
			LAi_QuestDelay("Caroline_jump_4", 0.5);
		break;

		case "Caroline_jump_4":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_town", "goto", "goto118j");
			LAi_QuestDelay("Caroline_jump_4A", 0.2);
		break;

		case "Caroline_jump_4A":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_town", "reload", "reload20");
			PlaySound("PEOPLE\Jump_Stone.wav");
			LAi_QuestDelay("Caroline_on_terrace", 0.5);
		break;

		case "Caroline_on_terrace":
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToCharacter(characterFromID("Wench3"), PChar);
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 1.0, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
		break;
//---------------------------------------------------------------------------------------------------------------------
		case "Blaze_ready_to_walk_0":
			//from Caroline dialog
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "roof2");
			ChangeCharacterAddressGroup(Pchar, "QC_town", "box", "box1");
		break;

		case "Blaze_walk_0":
			PlaySound("PEOPLE\Run_stone.wav");
			LAi_QuestDelay("Blaze_walk_0A", 0.5);
		break;

		case "Blaze_walk_0A":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "goto111");
			LAi_QuestDelay("Blaze_roof_fencing_1", 0.7);
		break;
//....................................................................................................
		case "Blaze_roof_fencing_1":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "roof2");
			PlaySound("PEOPLE\Jump_Roof.wav");

			RemoveCharacterEquip(CharacterFromID("Mistress"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(CharacterFromID("Mistress"), "blade5" );
			GiveItem2Character(characterFromID("Mistress"), "bladebbuss");
			EquipCharacterByItem(characterFromID("Mistress"), "bladebbuss");

			LAi_QuestDelay("Blaze_roof_fencing_1A", 1.0);
		break;

		case "Blaze_roof_fencing_1A":
			PlaySound("AMBIENT\TAVERN\tinkle4.wav");
			PlaySound("AMBIENT\TAVERN\drop4.wav");

			LAi_group_MoveCharacter(characterFromID("Brthug7"), "ROOF_THUGS_1");
			LAi_group_Register("ROOF_THUGS_1");
			LAi_group_SetRelation(LAI_GROUP_PLAYER, "ROOF_THUGS_1", LAI_GROUP_ENEMY);
			LAi_group_FightGroups(LAI_GROUP_PLAYER, "ROOF_THUGS_1", true);

			LAi_QuestDelay("Blaze_roof_fencing_2", 1.0);
		break;

		case "Blaze_roof_fencing_2":
			pchar.quest.wr_quest2 = "warning_thug_behind";

			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToCharacter(characterFromID("Wench3"), PChar);
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
		break;

		case "Blaze_roof_fencing_3":
			PlaySound("PEOPLE\Run_stone.wav");

			ChangeCharacterAddressGroup(characterFromID("Brthug7"), "QC_town", "goto", "goto111");
			TakenItems(characterFromID("Brthug7"), "potion1", 2);

			ChangeCharacterAddressGroup(characterFromID("Mistress"), "QC_town", "goto", "goto108");

			LAi_SetActorType(characterFromID("Mistress"));
			LAi_ActorTurnToLocator(characterFromID("Mistress"), "goto", "roof2");

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto111");

			LAi_QuestDelay("Blaze_roof_fencing_4", 1.0);
		break;

		case "Blaze_roof_fencing_4":
			PlaySound("OBJECTS\DUEL\man_attack6.wav");

			LAi_SetPlayerType(Pchar);

			pchar.quest.Blaze_roof_fencing_5.win_condition.l1 = "NPC_Death";
			pchar.quest.Blaze_roof_fencing_5.win_condition.l1.character = "Brthug7";
			pchar.quest.Blaze_roof_fencing_5.win_condition = "Blaze_roof_fencing_5";
		break;

		case "Blaze_roof_fencing_5":
			PlaySound("OBJECTS\VOICES\DEAD\female\dead_wom6.wav");

			LAi_group_MoveCharacter(characterFromID("Mistress"), "ROOF_THUGS_2");
			LAi_group_Register("ROOF_THUGS_2");
			LAi_group_SetRelation(LAI_GROUP_PLAYER, "ROOF_THUGS_2", LAI_GROUP_ENEMY);
			LAi_group_FightGroups(LAI_GROUP_PLAYER, "ROOF_THUGS_2", true);

			LAi_QuestDelay("Blaze_roof_fencing_6", 2.0);	//was 1.0
		break;

		case "Blaze_roof_fencing_6":
			float u, v, w;
			GetCharacterPos(CharacterFromID("Mistress"), &u, &v, &w);
			CreateParticleSystem("gunfire" , u, v+1.2, w-0.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , u, v+1.2, w-0.6, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("OBJECTS\duel\pistol_bbus.wav");

			float Php;
			Php = LAi_GetCharacterHP(Pchar);
			int Php3;
			Php3 = Php/3;
			LAi_ApplyCharacterDamage(Pchar, Php3);

			LAi_QuestDelay("Blaze_roof_fencing_6A", 1.0);
			LAi_QuestDelay("Blaze_roof_fencing_7", 2.0);
		break;

		case "Blaze_roof_fencing_6A":
			PlaySound("OBJECTS\duel\man_hit4.wav");
		break;

		case "Blaze_roof_fencing_7":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "goto110");
			PlaySound("PEOPLE\Jump_Stone.wav");
			LAi_QuestDelay("Blaze_roof_fencing_8", 1.0);
		break;

		case "Blaze_roof_fencing_8":
			ChangeCharacterAddressGroup(characterFromID("Mistress"), "QC_town", "goto", "goto107");
			PlaySound("PEOPLE\Run_roof.wav");
			LAi_QuestDelay("Blaze_roof_fencing_9", 0.5);
		break;

		case "Blaze_roof_fencing_9":
			ChangeCharacterAddressGroup(characterFromID("Mistress"), "QC_town", "goto", "goto106");
			LAi_QuestDelay("Blaze_roof_fencing_10", 1.0);
		break;

		case "Blaze_roof_fencing_10":
			PlaySound("INTERFACE\closed_door.wav");

			ChangeCharacterAddressGroup(characterFromID("Brthug7"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("Mistress"), "none", "", "");

			RemoveCharacterEquip(CharacterFromID("Mistress"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(CharacterFromID("Mistress"), "bladebbuss" );
			GiveItem2Character(characterFromID("Mistress"), "blade5");
			EquipCharacterByItem(characterFromID("Mistress"), "blade5");

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "roof2");
			LAi_QuestDelay("Blaze_jump_1", 3.0);
		break;
//....................................................................................................
		case "Blaze_jump_1":
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "QC_town", "box", "box2");
			PlaySound("PEOPLE\Jump_Roof.wav");
		break;

		case "Blaze_walk_1":
			PlaySound("PEOPLE\Run_roof.wav");
			LAi_QuestDelay("Blaze_walk_1A", 0.5);
		break;

		case "Blaze_walk_1A":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "goto114");
			LAi_QuestDelay("Blaze_jump_2", 0.5);
		break;

		case "Blaze_jump_2":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "roof3");
			PlaySound("PEOPLE\Jump_Roof.wav");
		break;

		case "Blaze_walk_2":
			PlaySound("PEOPLE\Run_roof.wav");
			LAi_QuestDelay("Blaze_walk_2A", 0.5);
		break;

		case "Blaze_walk_2A":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "goto116");
			LAi_QuestDelay("Blaze_jump_3", 0.5);
		break;

		case "Blaze_jump_3":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "roof4");
			PlaySound("PEOPLE\Jump_Roof.wav");
		break;

		case "Blaze_walk_3":
			PlaySound("PEOPLE\Run_roof.wav");
			LAi_QuestDelay("Blaze_walk_3A", 0.5);
		break;

		case "Blaze_walk_3A":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "goto118");
			LAi_QuestDelay("Blaze_jump_4", 0.5);
		break;


		case "Blaze_jump_4":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "roof5");
			PlaySound("PEOPLE\Jump_Stone.wav");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("Roof_knifeman_attack2", 1.0);
		break;

		case "Roof_knifeman_attack2":
			LAi_SetPlayerType(Pchar);

			LAi_SetActorType(characterFromID("Brthug3"));
			LAi_ActorAttack(CharacterFromID("Brthug3"), Pchar, "");
			ChangeCharacterAddressGroup(characterFromID("Brthug3"), "QC_town", "goto", "goto118");
			GiveItem2Character(CharacterFromID("Brthug3"), "bladeX4");//no blade no laydown

			PlaySound("OBJECTS\duel\knife_woodrattle.wav");

			RemoveCharacterEquip(CharacterFromID("Brthug3"), BLADE_ITEM_TYPE);
	              	TakeItemFromCharacter(CharacterFromID("Brthug3"), "blade5" );//a fake throwing knife

			GiveItem2Character(CharacterFromID("Wench3"), "bladep0");
			EquipCharacterByItem(CharacterFromID("Wench3"), "bladep0");

			GiveItem2Character(CharacterFromID("Wench3"), "pistol0");
			EquipCharacterByItem(CharacterFromID("Wench3"), "pistol0");

			if (ENABLE_AMMOMOD) {
				TakenItems(CharacterFromID("Wench3"), "gunpowder", 6);
				TakenItems(CharacterFromID("Wench3"), "pistolbullets", 6);
			}

			LAi_SetPlayerType(characterFromID("Wench3"));
			if(!LAi_IsFightMode(characterFromID("Wench3")) ) LAi_SetFightMode(characterFromID("Wench3"), true);

			LAi_QuestDelay("Roof_knifeman_attack2A", 1.0);
		break;

		case "Roof_knifeman_attack2A":
			LAi_tmpl_ani_PlayAnimation(Pchar, "afraid", 1.0);

			LAi_QuestDelay("Caroline_ready_to_fire", 1.0);
		break;

		case "Caroline_ready_to_fire":
			LAi_SetActorType(Pchar);
			LAi_ActorAfraid(Pchar, Pchar, false);
			LAi_ActorTurnToLocator(Pchar, "goto", "roof4");

			//float u, v, w;
			GetCharacterPos(CharacterFromID("Wench3"), &u, &v, &w);
			CreateParticleSystem("gunfire" , u-0.4, v+1.2, w, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("OBJECTS\duel\pistol_pocket.wav");
			LAi_ApplyCharacterDamage(CharacterFromID("Brthug3"), 20);

			LAi_QuestDelay("Roof_knifeman_prepare_attack3", 2.0);
		break;

		case "Roof_knifeman_prepare_attack3":
			GiveItem2Character(CharacterFromID("Brthug3"), "blade5");
			EquipCharacterByItem(CharacterFromID("Brthug3"), "blade5");

			LAi_QuestDelay("Roof_knifeman_attack3", 0.5);	//was 2.0
		break;

		case "Roof_knifeman_attack3":
			PlaySound("OBJECTS\duel\knife_male.wav");

			LAi_ApplyCharacterDamage(Pchar, 10 + rand(5));
			LAi_tmpl_ani_PlayAnimation(Pchar, "afraid", 4.5);		//was 1 0r 1.5

			RemoveCharacterEquip(CharacterFromID("Brthug3"), BLADE_ITEM_TYPE);
	              	TakeItemFromCharacter(CharacterFromID("Brthug3"), "blade5" );//a fake throwing knife

			LAi_QuestDelay("Roof_knifeman_attack3A", 0.5);
			LAi_QuestDelay("Caroline_ready_to_fire_again", 1.5);
		break;

		case "Roof_knifeman_attack3A":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead0.wav");
		break;

		case "Caroline_ready_to_fire_again":
			GiveItem2Character(CharacterFromID("Brthug3"), "blade5");
			EquipCharacterByItem(CharacterFromID("Brthug3"), "blade5");

			CreateParticleSystem("gunfire" , u-0.4, v+1.2, w, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("OBJECTS\duel\pistol_pocket.wav");
			LAi_ApplyCharacterDamage(CharacterFromID("Brthug3"), 20);

			LAi_KillCharacter(characterFromID("Brthug3"));
			pchar.quest.wr_quest2 = "knife_wound";

			LAi_QuestDelay("Knifeman_dead", 0.5);
			LAi_QuestDelay("Roof_fight_end", 3.0);	//was 2.0
		break;

		case "Knifeman_dead":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead8.wav");
		break;

		case "Roof_fight_end":
			ChangeCharacterAddressGroup(CharacterFromID("Brthug3"), "none", "", "");

			LAi_SetActorType(Pchar);
			LAi_ActorAfraid(Pchar, Pchar, false);
			LAi_SetPlayerType(Pchar);

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Wench3"));

			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToCharacter(characterFromID("Wench3"), PChar);
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 1.0, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
		break;

		case "afraid_to_jump":
			//from Caroline dialog1

			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_town", "goto", "roof6");
			PlaySound("PEOPLE\Run_stone.wav");

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "roof6");

			pchar.quest.wr_quest2 = "store_outdoors_talk_2";

			LAi_QuestDelay("afraid_to_jump_1", 1.5);
		break;

		case "afraid_to_jump_1":
			LAi_SetPlayerType(Pchar);

			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToCharacter(characterFromID("Wench3"), PChar);
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 1.0, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
		break;
//=================================================================================================================
		case "afraid_to_jump_2":
			//from Caroline dialog2
			PlaySound("PEOPLE\recoil.wav");

			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_town", "reload", "reload22");
			ChangeCharacterAddressGroup(Pchar, "QC_town", "box", "box5");

			pchar.quest.wr_quest2 = "store_upperdoor_talk";
		break;

		case "afraid_to_jump_3":
			PlaySound("PEOPLE\Run_stone.wav");//pchar running
			LAi_QuestDelay("afraid_to_jump_4", 2.0);
		break;

		case "afraid_to_jump_4":
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToCharacter(characterFromID("Wench3"), PChar);
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
		break;

		case "store_upperdoor":
			//from CK dialog
			ChangeCharacterAddressGroup(Pchar, "QC_town", "box", "box6");
			pchar.quest.wr_quest2 = "go_on_Captain";

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload25");

			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_town", "goto", "roof5");
			PlaySound("PEOPLE\Run_stone.wav");

			LAi_QuestDelay("store_upperdoor_1", 0.5);
		break;

		case "store_upperdoor_1":
			LAi_SetPlayerType(Pchar);
		break;

		case "store_upperdoor_2":
			PlaySound("PEOPLE\Run_stone.wav");

			pchar.quest.store_upstairs.win_condition.l1 = "locator";
			pchar.quest.store_upstairs.win_condition.l1.location = "QC_store_upstairs";
			pchar.quest.store_upstairs.win_condition.l1.locator_group = "goto";
			pchar.quest.store_upstairs.win_condition.l1.locator = "goto30";
			pchar.quest.store_upstairs.win_condition = "store_upstairs";
		break;

		case "store_upstairs":
			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_store_upstairs", "reload", "reload3");
			LAi_SetOfficerType(characterFromID("Wench3"));

			pchar.quest.empty_store.win_condition.l1 = "locator";
			pchar.quest.empty_store.win_condition.l1.location = "QC_store_JRH";
			pchar.quest.empty_store.win_condition.l1.locator_group = "goto";
			pchar.quest.empty_store.win_condition.l1.locator = "goto10";
			pchar.quest.empty_store.win_condition = "empty_store";
		break;

		case "empty_store":
			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_store_JRH", "reload", "locator1");

			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorFollow(characterFromID("Wench3"), pchar, "", 5.0);

			pchar.quest.empty_store_dialog.win_condition.l1 = "locator";
			pchar.quest.empty_store_dialog.win_condition.l1.location = "QC_store_JRH";
			pchar.quest.empty_store_dialog.win_condition.l1.locator_group = "reload";
			pchar.quest.empty_store_dialog.win_condition.l1.locator = "locator2";
			pchar.quest.empty_store_dialog.win_condition = "empty_store_dialog";

			pchar.quest.wr_quest2 = "store_door_closed";
		break;

		case "empty_store_dialog":
			PlaySound("INTERFACE\knock.wav");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("empty_store_dialog_1", 1.0);
		break;

		case "empty_store_dialog_1":
			LAi_SetPlayerType(Pchar);

			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToCharacter(characterFromID("Wench3"), PChar);
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
		break;

		case "search_store":
			//from Caroline dialog
			pchar.quest.wr_quest2 = "go_on_Captain";

			pchar.quest.jump_counter_1.win_condition.l1 = "locator";
			pchar.quest.jump_counter_1.win_condition.l1.location = "QC_store_JRH";
			pchar.quest.jump_counter_1.win_condition.l1.locator_group = "goto";
			pchar.quest.jump_counter_1.win_condition.l1.locator = "goto1";
			pchar.quest.jump_counter_1.win_condition = "jump_counter_1";
		break;

		case "jump_counter_1":
			LAi_QuestDelay("jump_counter_2", 0.5);
		break;

		case "jump_counter_2":
			PlaySound("PEOPLE\Jump_Counter.wav");
			ChangeCharacterAddressGroup(Pchar, "QC_store_JRH", "goto", "goto11");
			LAi_QuestDelay("jump_counter_3", 0.5);
		break;

		case "jump_counter_3":
			ChangeCharacterAddressGroup(Pchar, "QC_store_JRH", "goto", "goto2");

			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_store_JRH", "reload", "reload1");
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToCharacter(characterFromID("Wench3"), PChar);

			pchar.quest.jump_counter_girl.win_condition.l1 = "locator";
			pchar.quest.jump_counter_girl.win_condition.l1.location = "QC_store_JRH";
			pchar.quest.jump_counter_girl.win_condition.l1.locator_group = "reload";
			pchar.quest.jump_counter_girl.win_condition.l1.locator = "reload3";
			pchar.quest.jump_counter_girl.win_condition = "jump_counter_girl";
		break;

		case "jump_counter_girl":
			PlaySound("PEOPLE\Jump_Counter.wav");
			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_store_JRH", "goto", "goto2");

			pchar.quest.climb_chair_blaze.win_condition.l1 = "locator";
			pchar.quest.climb_chair_blaze.win_condition.l1.location = "QC_store_JRH";
			pchar.quest.climb_chair_blaze.win_condition.l1.locator_group = "sit";
			pchar.quest.climb_chair_blaze.win_condition.l1.locator = "sit1";
			pchar.quest.climb_chair_blaze.win_condition = "climb_chair_blaze";
		break;

		case "climb_chair_blaze":
			LAi_QuestDelay("climb_chair_blaze_1", 0.5);
		break;

		case "climb_chair_blaze_1":
			ChangeCharacterAddressGroup(Pchar, "QC_store_JRH", "goto", "goto3");
			PlaySound("AMBIENT\CHURCH\bench1.wav");
			LAi_QuestDelay("climb_chair_blaze_2", 1.5);
		break;

		case "climb_chair_blaze_2":
			ChangeCharacterAddressGroup(Pchar, "QC_store_JRH", "goto", "goto4");
			PlaySound("AMBIENT\CHURCH\bench1.wav");
			LAi_QuestDelay("climb_chair_blaze_3", 1.5);
		break;

		case "climb_chair_blaze_3":
			ChangeCharacterAddressGroup(Pchar, "QC_store_JRH", "goto", "goto6");
			PlaySound("AMBIENT\CHURCH\bench1.wav");
			LAi_QuestDelay("climb_chair_blaze_4", 1.5);
		break;

		case "climb_chair_blaze_4":
			if(CheckCharacterItem(Pchar,"mtoon_item"))
			{
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "mtoon_item" );
				GiveItem2Character(Pchar, "pistolmtoon");
				EquipCharacterByItem(Pchar, "pistolmtoon");

				PlaySound("OBJECTS\DUEL\Reload1.wav");
				TakenItems(Pchar, "pistolbullets", -100);
				TakenItems(Pchar, "musketbullets", -100);
				TakenItems(Pchar, "pistolgrapes", 6);
				TakenItems(Pchar, "gunpowder", -100);
				TakenItems(Pchar, "gunpowder", 6);

				SetLocatorRadius(locations[FindLocation(Pchar.location)], "officers", "locator2_2", 1.0);

				LAi_QuestDelay("climb_chair_blaze_5", 2.0);
			}
			else
			{
				LAi_QuestDelay("climb_chair_blaze_4", 0.5);//loop check
			}
		break;

		case "climb_chair_blaze_5":
			ChangeCharacterAddressGroup(Pchar, "QC_store_JRH", "goto", "goto5");
			PlaySound("PEOPLE\jump.wav");
			PlaySound("PEOPLE\Jump_stone.wav");

			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_store_JRH", "reload", "reload2");
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToCharacter(characterFromID("Wench3"), PChar);

			LAi_QuestDelay("climb_chair_blaze_6", 1.0);
		break;

		case "climb_chair_blaze_6":
			PlaySound("VOICE\ENGLISH\gr_wench3_pos.wav");

			pchar.quest.jump_counter_back.win_condition.l1 = "locator";
			pchar.quest.jump_counter_back.win_condition.l1.location = "QC_store_JRH";
			pchar.quest.jump_counter_back.win_condition.l1.locator_group = "goto";
			pchar.quest.jump_counter_back.win_condition.l1.locator = "goto2";
			pchar.quest.jump_counter_back.win_condition = "jump_counter_back";
		break;

		case "jump_counter_back":
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToLocator(characterFromID("Wench3"), "reload", "reload1");
			LAi_QuestDelay("jump_counter_back_1", 0.5);
		break;

		case "jump_counter_back_1":
			PlaySound("PEOPLE\Jump_Counter.wav");
			ChangeCharacterAddressGroup(Pchar, "QC_store_JRH", "goto", "goto12");
			LAi_QuestDelay("jump_counter_back_2", 0.5);
		break;

		case "jump_counter_back_2":
			ChangeCharacterAddressGroup(Pchar, "QC_store_JRH", "goto", "goto1");

			pchar.quest.girl_walk_back.win_condition.l1 = "locator";
			pchar.quest.girl_walk_back.win_condition.l1.location = "QC_store_JRH";
			pchar.quest.girl_walk_back.win_condition.l1.locator_group = "officers";
			pchar.quest.girl_walk_back.win_condition.l1.locator = "locator2_2";
			pchar.quest.girl_walk_back.win_condition = "girl_walk_back";
		break;

		case "girl_walk_back":
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box1", 0.5);
			Locations[FindLocation("QC_store_JRH")].locators_radius.box.box1 = 0.5;

			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box2", 0.5);
			Locations[FindLocation("QC_store_JRH")].locators_radius.box.box2 = 0.5;

			SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload1", 0.0001);
			Locations[FindLocation("QC_store_JRH")].locators_radius.reload.reload1 = 0.0001;

			SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload2", 0.0001);
			Locations[FindLocation("QC_store_JRH")].locators_radius.reload.reload2 = 0.0001;

			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_store_JRH", "reload", "reload1");
			PlaySound("PEOPLE\counter_openclose.wav");

			LAi_SetStayType(Pchar);

			LAi_QuestDelay("girl_walk_back_1", 1.5);
		break;

		case "girl_walk_back_1":
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload1");

			pchar.quest.wr_quest2 = "empty_store_finished";

			LAi_QuestDelay("girl_walk_back_2", 1.0);
		break;

		case "girl_walk_back_2":
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
		break;

	//-----------------------------------------------------------------------------------------
		case "arrive_store_upstairs":
			//from itemlogic
			DoQuestReloadToLocation("QC_store_upstairs", "goto", "goto30", "_");
		break;
	//-----------------------------------------------------------------------------------------

		case "leave_empty_store":
			//from Caroline dialog

			LAi_SetPlayerType(Pchar);

			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorFollow(characterFromID("Wench3"), pchar, "", 5.0);

			pchar.quest.leave_empty_store_1.win_condition.l1 = "locator";
			pchar.quest.leave_empty_store_1.win_condition.l1.location = "QC_store_upstairs";
			pchar.quest.leave_empty_store_1.win_condition.l1.locator_group = "goto";
			pchar.quest.leave_empty_store_1.win_condition.l1.locator = "goto10";
			pchar.quest.leave_empty_store_1.win_condition = "leave_empty_store_1";
		break;

		case "leave_empty_store_1":
			SetCurrentTime(12.00, 0);
			SetNextWeather("Heavy Rain");
			Pchar.quest.JRH_rain = "Heavy Rain";
			Pchar.quest.JRH_sky = "C_Ni2";

			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_store_upstairs", "reload", "reload1");
			Locations[FindLocation("QC_store_upstairs")].reload.l3.emerge = "roof8";

			pchar.quest.leave_empty_store_2.win_condition.l1 = "locator";
			pchar.quest.leave_empty_store_2.win_condition.l1.location = "QC_town";
			pchar.quest.leave_empty_store_2.win_condition.l1.locator_group = "goto";
			pchar.quest.leave_empty_store_2.win_condition.l1.locator = "roof8";
			pchar.quest.leave_empty_store_2.win_condition = "leave_empty_store_2";
		break;

		case "leave_empty_store_2":
			Pchar.quest.terrace_ambush = "started";
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto29");

			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_town", "reload", "reload23");
			LAi_SetActorType(CharacterFromID("Wench3"));
			LAi_ActorTurnToLocator(CharacterFromID("Wench3"), "goto", "roof6");

			LAi_QuestDelay("ambush5_1", 1.0);
		break;

		case "ambush5_1":
			LAi_SetPlayerType(Pchar);

			ChangeCharacterAddressGroup(CharacterFromID("Brthug5"), "QC_town", "goto", "goto29_1");
			LAi_QuestDelay("ambush5_2", 0.02);
		break;

		case "ambush5_2":
			ChangeCharacterAddressGroup(CharacterFromID("Brthug5"), "QC_town", "goto", "goto29_2");
			LAi_QuestDelay("ambush5_3", 0.02);
		break;

		case "ambush5_3":
			ChangeCharacterAddressGroup(CharacterFromID("Brthug5"), "QC_town", "goto", "goto29_3");
			LAi_QuestDelay("ambush5_sit", 0.02);
		break;

		case "ambush5_sit":
			ChangeCharacterAddressGroup(CharacterFromID("Brthug5"), "QC_town", "goto", "goto29");
			PlaySound("PEOPLE\Jump_Stone.wav");

			LAi_QuestDelay("ambush5_sit2", 0.05);
		break;

		case "ambush5_sit2":
			LAi_SetSitType(CharacterFromID("Brthug5"));
			LAi_QuestDelay("ambush5_4", 0.18);
		break;

		case "ambush5_4":
			PlaySound("VOICE\ENGLISH\gr_wench3_oh.wav");

			LAi_SetStayType(CharacterFromID("Brthug5"));
			LAi_SetActorType(characterFromID("Brthug5"));
			LAi_ActorTurnToLocator(CharacterFromID("Brthug5"), "goto", "goto32");

			LAi_QuestDelay("ambush5_4_0", 0.5);
		break;

		case "ambush5_4_0":
			LAi_SetActorType(characterFromID("Brthug5"));
			LAi_ActorAttack(CharacterFromID("Brthug5"), Pchar, "");

			LAi_QuestDelay("ambush4_1", 1.0);
		break;

		case "ambush4_1":
			ChangeCharacterAddressGroup(CharacterFromID("Brthug4"), "QC_town", "goto", "goto28_1");
			LAi_QuestDelay("ambush4_2", 0.02);
		break;

		case "ambush4_2":
			ChangeCharacterAddressGroup(CharacterFromID("Brthug4"), "QC_town", "goto", "goto28_2");
			LAi_QuestDelay("ambush4_3", 0.02);
		break;

		case "ambush4_3":
			ChangeCharacterAddressGroup(CharacterFromID("Brthug4"), "QC_town", "goto", "goto28_3");
			LAi_QuestDelay("ambush4_sit", 0.02);
		break;

		case "ambush4_sit":
			ChangeCharacterAddressGroup(CharacterFromID("Brthug4"), "QC_town", "goto", "goto28");
			PlaySound("PEOPLE\Jump_Stone.wav");
			LAi_QuestDelay("ambush4_sit2", 0.05);
		break;

		case "ambush4_sit2":
			LAi_SetSitType(CharacterFromID("Brthug4"));
			LAi_QuestDelay("ambush4_4", 0.18);
		break;

		case "ambush4_4":
			LAi_SetStayType(CharacterFromID("Brthug4"));

			LAi_group_MoveCharacter(characterFromID("Brthug4"), "ROOF_THUGS_3");
			LAi_group_MoveCharacter(characterFromID("Wench3"), LAI_GROUP_PLAYER);
			LAi_group_Register("ROOF_THUGS_3");
			LAi_group_SetRelation(LAI_GROUP_PLAYER, "ROOF_THUGS_3", LAI_GROUP_ENEMY);
			LAi_group_FightGroups(LAI_GROUP_PLAYER, "ROOF_THUGS_3", true);

			LAi_QuestDelay("ambush6_1", 0.5);
		break;

		case "ambush6_1":
			ChangeCharacterAddressGroup(CharacterFromID("Brthug6"), "QC_town", "goto", "goto30_1");
			LAi_QuestDelay("ambush6_2", 0.02);
		break;

		case "ambush6_2":
			ChangeCharacterAddressGroup(CharacterFromID("Brthug6"), "QC_town", "goto", "goto30_2");
			LAi_QuestDelay("ambush6_3", 0.02);
		break;

		case "ambush6_3":
			ChangeCharacterAddressGroup(CharacterFromID("Brthug6"), "QC_town", "goto", "goto30_3");
			LAi_QuestDelay("ambush6_sit", 0.02);
		break;

		case "ambush6_sit":
			ChangeCharacterAddressGroup(CharacterFromID("Brthug6"), "QC_town", "goto", "goto30");
			PlaySound("PEOPLE\Jump_Stone.wav");
			LAi_QuestDelay("ambush6_sit2", 0.05);
		break;

		case "ambush6_sit2":
			LAi_SetSitType(CharacterFromID("Brthug6"));
			LAi_QuestDelay("ambush6_4", 0.18);
		break;

		case "ambush6_4":
			LAi_SetStayType(CharacterFromID("Brthug6"));
			LAi_SetActorType(characterFromID("Brthug6"));
			LAi_ActorTurnToLocator(CharacterFromID("Brthug6"), "goto", "goto31");

			LAi_QuestDelay("ambush6_4_0", 0.5);
		break;

		case "ambush6_4_0":
			LAi_SetActorType(characterFromID("Brthug6"));
			LAi_ActorAttack(CharacterFromID("Brthug6"), Pchar, "");
			LAi_group_MoveCharacter(characterFromID("Brthug6"), "ROOF_THUGS_3");

			LAi_QuestDelay("3thugs_Carshot1", 1.0);
		break;

		case "3thugs_Carshot1":
			GetCharacterPos(CharacterFromID("Wench3"), &u, &v, &w);
			CreateParticleSystem("gunfire" , u+0.4, v+1.2, w-0.1, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("OBJECTS\duel\pistol_pocket.wav");
			LAi_ApplyCharacterDamage(CharacterFromID("Brthug4"), 20);

			LAi_QuestDelay("3thugs_5shot", 1.0);
		break;

		case "3thugs_5shot":
			if(!LAi_IsDead(CharacterFromID("Brthug5")) )
			{
				GetCharacterPos(CharacterFromID("Brthug5"), &u, &v, &w);
				CreateParticleSystem("gunfire" , u-0.4, v+1.2, w-0.5, 0.0, 0.0, 0.0, sti(20) );
				PlaySound("OBJECTS\duel\pistol_medium.wav");
				LAi_ApplyCharacterDamage(Pchar, 12 + rand(12));
				LAi_group_MoveCharacter(characterFromID("Brthug5"), "ROOF_THUGS_3");
			}

			LAi_QuestDelay("3thugs_4adv1", 0.5);
		break;

		case "3thugs_4adv1":
			if(!LAi_IsDead(CharacterFromID("Brthug4")) )
			{
				ChangeCharacterAddressGroup(CharacterFromID("Brthug4"), "QC_town", "goto", "goto36");
				PlaySound("PEOPLE\Run_stone.wav");
			}

			if(!LAi_IsDead(CharacterFromID("Brthug5")) )
			{
				//change thug5 weapons
				RemoveCharacterEquip(CharacterFromID("Brthug5"), BLADE_ITEM_TYPE);
	              		TakeItemFromCharacter(CharacterFromID("Brthug5"), "bladep2" );
				RemoveCharacterEquip(CharacterFromID("Brthug5"), GUN_ITEM_TYPE);
	              		TakeItemFromCharacter(CharacterFromID("Brthug5"), "pistolb1" );

				GiveItem2Character(CharacterFromID("Brthug5"), "blade1");
				EquipCharacterByItem(CharacterFromID("Brthug5"), "blade1");
				GiveItem2Character(CharacterFromID("Brthug5"), "pistol2");
				EquipCharacterByItem(CharacterFromID("Brthug5"), "pistol2");
			}
			LAi_QuestDelay("3thugs_4adv2", 0.2);
		break;

		case "3thugs_4adv2":
			if(!LAi_IsDead(CharacterFromID("Brthug4")) )
			{
				ChangeCharacterAddressGroup(CharacterFromID("Brthug4"), "QC_town", "goto", "goto33");
			}
			LAi_QuestDelay("3thugs_Carshot2", 0.5);
		break;

		case "3thugs_Carshot2":
			GetCharacterPos(CharacterFromID("Wench3"), &u, &v, &w);
			CreateParticleSystem("gunfire" , u+0.4, v+1.2, w-0.1, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("OBJECTS\duel\pistol_pocket.wav");

			if(!LAi_IsDead(CharacterFromID("Brthug4")) )
			{
				LAi_ApplyCharacterDamage(CharacterFromID("Brthug4"), 30);
				LAi_KillCharacter(characterFromID("Brthug4"));

				PlaySound("OBJECTS\VOICES\DEAD\male\dead6.wav");
			}
			LAi_QuestDelay("3thugs_6adv1", 0.5);
		break;

		case "3thugs_6adv1":
			if(!LAi_IsDead(CharacterFromID("Brthug6")) )
			{
				ChangeCharacterAddressGroup(CharacterFromID("Brthug6"), "QC_town", "goto", "goto34");
				PlaySound("PEOPLE\Run_stone.wav");
			}
			LAi_QuestDelay("3thugs_6adv2", 0.2);
		break;

		case "3thugs_6adv2":
			if(!LAi_IsDead(CharacterFromID("Brthug6")) )
			{
				ChangeCharacterAddressGroup(CharacterFromID("Brthug6"), "QC_town", "goto", "goto32");
				LAi_SetImmortal(CharacterFromID("Brthug6"), false);
				LAi_SetActorType(characterFromID("Wench3"));
				LAi_ActorAttack(CharacterFromID("Wench3"), CharacterFromID("Brthug6"), "");
			}

			LAi_QuestDelay("ck_bladep0_terrace", 0.1);
			LAi_QuestDelay("3thugs_5adv1", 1.0);
		break;
//----------------------------------------------------------------------------------------------
		case "ck_bladep0_terrace":
			if(CheckAttribute(Pchar,"quest.terrace_ambush") && Pchar.quest.terrace_ambush == "started")
			{
				if(!IsEquipCharacterByItem(CharacterFromID("Wench3"), "bladep0"))
				{
					//just to be sure she's got the bladepistol
					if(!CheckCharacterItem(CharacterFromID("Wench3"),"bladep0"))
					{
						GiveItem2Character(CharacterFromID("Wench3"), "bladep0");
					}

					RemoveCharacterEquip(CharacterFromID("Wench3"), BLADE_ITEM_TYPE);
					EquipCharacterbyItem(CharacterFromID("Wench3"), "bladep0");
				}

				LAi_QuestDelay("ck_bladep0_terrace", 0.5);
			}
			else return;
		break;
//----------------------------------------------------------------------------------------------
		case "3thugs_5adv1":
			if(!LAi_IsDead(CharacterFromID("Brthug5")) )
			{
				ChangeCharacterAddressGroup(CharacterFromID("Brthug5"), "QC_town", "goto", "goto34");
				PlaySound("PEOPLE\Run_stone.wav");
			}

			LAi_QuestDelay("3thugs_5adv2", 0.2);
		break;

		case "3thugs_5adv2":
			if(!LAi_IsDead(CharacterFromID("Brthug5")) )
			{
				if(LAi_IsDead(CharacterFromID("Brthug6")) )
				{
					ChangeCharacterAddressGroup(CharacterFromID("Brthug5"), "QC_town", "goto", "goto32");
					LAi_SetImmortal(CharacterFromID("Brthug5"), false);
					LAi_SetActorType(characterFromID("Wench3"));
					LAi_ActorAttack(CharacterFromID("Wench3"), CharacterFromID("Brthug5"), "");
				}
				else
				{
					ChangeCharacterAddressGroup(CharacterFromID("Brthug5"), "QC_town", "goto", "goto31");
				}
			}

			LAi_QuestDelay("3thugs_checkdead", 0.5);
		break;

		case "3thugs_checkdead":
			Pchar.quest.3thugs_dead_yes.win_condition.l1 = "NPC_Death";
			Pchar.quest.3thugs_dead_yes.win_condition.l1.character = "Brthug5";
			Pchar.quest.3thugs_dead_yes.win_condition.l2 = "NPC_Death";
			Pchar.quest.3thugs_dead_yes.win_condition.l2.character = "Brthug6";
			Pchar.quest.3thugs_dead_yes.win_condition = "3thugs_dead_yes";
		break;

		case "3thugs_dead_yes":
			ChangeCharacterAddressGroup(CharacterFromID("Brthug4"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("Brthug5"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("Brthug6"), "none", "", "");

			if(LAi_IsFightMode(characterFromID("Wench3")) ) LAi_SetFightMode(characterFromID("Wench3"), false);

			pchar.quest.wr_quest2 = "3thugs_are_dead";

			LAi_QuestDelay("3thugs_dead_yes_1", 1.0);
		break;

		case "3thugs_dead_yes_1":
			pchar.quest.wr_quest2 = "3thugs_are_dead";
			Pchar.quest.terrace_ambush = "finished";

			PlaySound("VOICE\ENGLISH\blaze_puh.wav");
			PlaySound("VOICE\ENGLISH\blaze_puh.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload23");
			LAi_QuestDelay("3thugs_dead_yes_2", 2.0);
		break;

		case "3thugs_dead_yes_2":
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
		break;

		case "run_and_jump":
			//from caroline dialog
			ChangeCharacterAddressGroup(Pchar, "QC_town", "box", "box8");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload22");
		break;

		case "run_and_jump_1":
			PlaySound("PEOPLE\Run_stone.wav");
			LAi_QuestDelay("run_and_jump_2", 0.5);
		break;

		case "run_and_jump_2":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "reload", "reload22");
			LAi_QuestDelay("run_and_jump_3", 0.2);
		break;

		case "run_and_jump_3":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload1");
			LAi_QuestDelay("run_and_jump_5", 0.5);//was 0.2
		break;

		case "run_and_jump_5":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "goto40");
			LAi_SetSitType(Pchar);
			PlaySound("PEOPLE\Jump_roof.wav");
			LAi_QuestDelay("run_and_jump_8", 0.7);
		break;

		case "run_and_jump_8":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "goto41");
			LAi_SetPoorType(Pchar);
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_town", "goto", "goto40");
			PlaySound("PEOPLE\Jump.wav");
			LAi_QuestDelay("run_and_jump_9", 0.8);
		break;

		case "run_and_jump_9":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_town", "goto", "goto40A");
			LAi_QuestDelay("run_and_jump_10", 0.1);//was 0.2
		break;

		case "run_and_jump_10":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_town", "goto", "goto41A");
			PlaySound("PEOPLE\Jump.wav");
			PlaySound("PEOPLE\Jump.wav");
			PlaySound("PEOPLE\Jump.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorSetLayMode(Pchar);
			LAi_ApplyCharacterDamage(Pchar, 10);

			LAi_QuestDelay("run_and_jump_11", 1.2);
		break;

		case "run_and_jump_11":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_town", "goto", "goto43");
			PlaySound("PEOPLE\Run_roof.wav");
			LAi_QuestDelay("run_and_jump_12", 1.0);
		break;

		case "run_and_jump_12":
			LAi_SetActorType(CharacterFromID("Wench3"));
			LAi_ActorTurnToLocator(CharacterFromID("Wench3"), "goto", "goto41");
			PlaySound("VOICE\ENGLISH\gr_wench3_aye.wav");
			LAi_QuestDelay("run_and_jump_13", 3.0);
		break;

		case "run_and_jump_13":
			LAi_SetPoorType(Pchar);
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("stars_short" , u, v+1, w, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("OBJECTS\VOICES\DEAD\male\dead7.wav");

			pchar.quest.wr_quest2 = "blaze_knocked";
			LAi_QuestDelay("run_and_jump_14", 4.0);
		break;

		case "run_and_jump_14":
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
		break;

		case "run_and_jump_15":
			//from caroline dialog
			PlaySound("OBJECTS\DUEL\man_attack1.wav");

			LAi_SetStayType(Pchar);
			LAi_QuestDelay("run_and_jump_16", 1.0);
		break;

		case "run_and_jump_16":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "goto42");
			PlaySound("PEOPLE\Run_roof.wav");
			LAi_QuestDelay("run_and_jump_17", 1.0);
		break;

		case "run_and_jump_17":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload45");
			pchar.quest.wr_quest2 = "under_roof";
			LAi_QuestDelay("run_and_jump_18", 1.0);
		break;

		case "run_and_jump_18":
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");

			LAi_SetPlayerType(Pchar);
			LAi_SetOfficerType(characterFromID("Wench3"));
		break;

		case "run_and_jump_19":
			//from caroline dialog
			LAi_SetStayType(Pchar);
			LAi_SetStayType(characterFromID("Mistress"));
			ChangeCharacterAddressGroup(characterFromID("Mistress"), "QC_town", "goto", "goto50");

			PlaySound("OBJECTS\VOICES\DEAD\male\dead1.wav");

			LAi_QuestDelay("run_and_jump_19A", 1.0);
		break;

		case "run_and_jump_19A":
			PlaySound("VOICE\ENGLISH\gr_mistress_laugh.wav");
			LAi_QuestDelay("run_and_jump_20", 1.0);
		break;

		case "run_and_jump_20":
			LAi_SetActorType(characterFromID("Mistress"));
			LAi_ActorAttack(CharacterFromID("Mistress"), characterFromID("Wench3"), "");
			ChangeCharacterAddressGroup(characterFromID("Mistress"), "QC_town", "goto", "goto51");
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToLocator(CharacterFromID("Wench3"), "goto", "goto51");
			PlaySound("VOICE\ENGLISH\gr_wench3_oh.wav");
			LAi_QuestDelay("run_and_jump_21", 1.5);
		break;

		case "run_and_jump_21":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto46A");
			LAi_QuestDelay("run_and_jump_22", 0.5);
		break;

		case "run_and_jump_22":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_town", "goto", "goto46A");
			PlaySound("PEOPLE\Run_roof.wav");
			LAi_QuestDelay("run_and_jump_23", 0.5);
		break;

		case "run_and_jump_23":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_town", "goto", "goto46");
			PlaySound("INTERFACE\locked_window.wav");
			LAi_QuestDelay("run_and_jump_24", 1.5);
		break;

		case "run_and_jump_24":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "goto45A");
			PlaySound("PEOPLE\Run_roof.wav");
			LAi_QuestDelay("run_and_jump_25", 0.5);
		break;

		case "run_and_jump_25":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "reload", "reload45");
			PlaySound("INTERFACE\locked_window.wav");
			LAi_QuestDelay("run_and_jump_26", 2.0);
		break;

		case "run_and_jump_26":
			PlaySound("VOICE\ENGLISH\gr_mistress2.wav");
			LAi_QuestDelay("run_and_jump_27", 2.0);
		break;

		case "run_and_jump_27":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(PChar, CharacterFromID("Mistress"));
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToCharacter(characterFromID("Wench3"), CharacterFromID("Mistress"));

			LAi_QuestDelay("run_and_jump_27A", 2.0);
		break;

		case "run_and_jump_27A":
			ChangeCharacterAddressGroup(characterFromID("Mistress"), "QC_town", "goto", "goto52");
			PlaySound("PEOPLE\Run_roof.wav");
			LAi_QuestDelay("run_and_jump_27B", 1.5);
		break;

		case "run_and_jump_27B":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(PChar, CharacterFromID("Mistress"));

			LAi_group_MoveCharacter(characterFromID("Mistress"), "ROOF_THUGS_2");
			LAi_group_Register("ROOF_THUGS_2");
			LAi_group_SetRelation(LAI_GROUP_PLAYER, "ROOF_THUGS_2", LAI_GROUP_ENEMY);
			LAi_group_FightGroups(LAI_GROUP_PLAYER, "ROOF_THUGS_2", true);

			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_town", "goto", "goto44A");
			PlaySound("PEOPLE\Run_roof.wav");

			LAi_QuestDelay("mistress_jumps", 1.5);

			Pchar.quest.run_and_jump_29.win_condition.l2 = "NPC_Death";
			Pchar.quest.run_and_jump_29.win_condition.l2.character = "Mistress";
			Pchar.quest.run_and_jump_29.win_condition = "run_and_jump_29";
		break;

		case "mistress_jumps":
			ChangeCharacterAddressGroup(characterFromID("Mistress"), "QC_town", "goto", "goto53");
			PlaySound("PEOPLE\step_stairway1.wav");
			LAi_QuestDelay("run_and_jump_27C", 0.5);
		break;

		case "run_and_jump_27C":
			ChangeCharacterAddressGroup(characterFromID("Mistress"), "QC_town", "goto", "goto46");
			PlaySound("PEOPLE\Jump_roof.wav");
			LAi_SetPlayerType(Pchar);
			Pchar.quest.kill_mistress = "yes";
		break;
	
		case "run_and_jump_29":
			Pchar.quest.kill_mistress = "no";		//reset to normal	
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload17");
			LAi_QuestDelay("run_and_jump_30", 2.0);
		break;

		case "run_and_jump_30":
			PlaySound("VOICE\ENGLISH\gr_wench3_pos.wav");
			LAi_QuestDelay("run_and_jump_34", 2.0);
		break;

		case "run_and_jump_34":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "reload", "reload44");
			PlaySound("PEOPLE\Run_roof.wav");

			LAi_SetPlayerType(Pchar);

			pchar.quest.store_bedroom.win_condition.l1 = "locator";
			pchar.quest.store_bedroom.win_condition.l1.location = "QC_store_bedroom";
			pchar.quest.store_bedroom.win_condition.l1.locator_group = "goto";
			pchar.quest.store_bedroom.win_condition.l1.locator = "goto2";
			pchar.quest.store_bedroom.win_condition = "store_bedroom";
		break;

		case "store_bedroom":
			PlaySound("PEOPLE\recoil.wav");

			locations[FindLocation(Pchar.location)].box2.items.potion1 = 2;

			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_store_bedroom", "goto", "goto5");
			LAi_ActorFollow(characterFromID("Wench3"), pchar, "", 5.0);

			ChangeCharacterAddressGroup(characterFromID("Peter Blowhorn"), "QC_store_JRH", "sit", "sit1");

			Locations[FindLocation("QC_Store_JRH")].reload.l5.disable = 0;//reload3 to bedroom

			pchar.quest.wr_quest2 = "QC_store_keeper";
			PChar.qcstore_door = "not_yet";
			PChar.qcstore_jump = "not_yet";
			PChar.qcstore_bedroom = "not_yet";
			PChar.qcstore_deal = "no";

			pchar.quest.store_again.win_condition.l1 = "locator";
			pchar.quest.store_again.win_condition.l1.location = "QC_Store_JRH";
			pchar.quest.store_again.win_condition.l1.locator_group = "goto";
			pchar.quest.store_again.win_condition.l1.locator = "goto15";
			pchar.quest.store_again.win_condition = "store_again";
		break;

		case "store_again":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_Store_JRH", "reload", "reload3");

			LAi_SetActorType(characterFromID("Peter Blowhorn"));
			LAi_ActorDialog(characterFromID("Peter Blowhorn"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Peter Blowhorn"));
		break;
//...................................................................................................................
		case "leave_town":
			//from PB dialog [1/5]
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_Store_JRH", "goto", "locator6");
			PlaySound("PEOPLE\Jump_Counter.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto12");
			LAi_QuestDelay("leave_town_0", 2.0);
		break;

		case "leave_town_0":
			LAi_SetPlayerType(Pchar);
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorGoToLocator(characterFromID("Wench3"), "reload", "locator2", "leave_town_1", 3.0);
		break;

		case "leave_town_1":
			LAi_SetStayType(characterFromID("Wench3"));
			PlaySound("VOICE\ENGLISH\gr_wench3_aye.wav");
			LAi_QuestDelay("leave_town_2", 2.0);
		break;

		case "leave_town_2":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "none", "", "");
			LAi_QuestDelay("leave_town_3", 2.0);
		break;

		case "leave_town_3":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_Store_JRH", "reload", "locator2");
			LAi_SetStayType(characterFromID("Wench3"));
			PlaySound("INTERFACE\closed_locked_door.wav");
			PlaySound("VOICE\ENGLISH\gr_wench3_oh.wav");
			pchar.quest.wr_quest2 = "QC_door_check";
			LAi_QuestDelay("leave_town_4", 2.0);
		break;

		case "leave_town_4":
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
		break;

		case "leave_town_5":
			//from Caroline dialog
			LAi_QuestDelay("leave_town_6", 1.0);
		break;

		case "leave_town_6":
			PlaySound("INTERFACE\door_locked2.wav");
			LAi_QuestDelay("leave_town_7", 1.0);
		break;

		case "leave_town_7":
			PlaySound("INTERFACE\knock.wav");
			LAi_QuestDelay("leave_town_8", 1.0);
		break;

		case "leave_town_8":
			LAi_SetActorType(CharacterFromID("Wench3"));
			LAi_ActorRunToLocator(characterFromID("Wench3"), "goto", "goto8", "leave_town_9", 3.0);
		break;

		case "leave_town_9":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_Store_JRH", "goto", "goto9");
			PlaySound("PEOPLE\Jump_Counter.wav");
			LAi_QuestDelay("leave_town_10", 0.5);
		break;

		case "leave_town_10":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_Store_JRH", "reload", "reload3");

			LAi_SetOfficerType(characterFromID("Peter Blowhorn"));
			Characters[GetCharacterIndex("Peter Blowhorn")].dialog.CurrentNode  = "from_bedroom_options";
		break;

		case "leave_no_deal":
			LAi_SetPlayerType(Pchar);//resets player to enable dialog
			PlaySound("VOICE\ENGLISH\gr_wench3_couldnt.wav");

			LAi_SetOfficerType(characterFromID("Peter Blowhorn"));
			Characters[GetCharacterIndex("Peter Blowhorn")].dialog.CurrentNode  = "from_bedroom_options";
		break;

		case "leave_jump":
			//from PB dialog [3/5]
			pchar.quest.wr_quest2 = "not_jump_again";
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
		break;

		case "leave_jump_1":
			//from Caroline dialog
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "sit", "sit1");
			LAi_QuestDelay("leave_jump_2", 1.0);
		break;

		case "leave_jump_2":
			LAi_SetPlayerType(Pchar);

			LAi_SetOfficerType(characterFromID("Peter Blowhorn"));
			Characters[GetCharacterIndex("Peter Blowhorn")].dialog.CurrentNode  = "from_bedroom_options";
		break;

		case "leave_bedroom":
			//from PB dialog [4/5]
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(PChar, CharacterFromID("Wench3"));
			PlaySound("VOICE\ENGLISH\gr_wench3_mhm.wav");
			LAi_SetStayType(characterFromID("Peter Blowhorn"));
			LAi_QuestDelay("leave_bedroom_0", 1.0);
		break;

		case "leave_bedroom_0":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_store_bedroom", "goto", "goto2");
			LAi_SetStayType(characterFromID("Wench3"));
			LAi_SetPlayerType(Pchar);

			pchar.quest.leave_bedroom_1.win_condition.l1 = "locator";
			pchar.quest.leave_bedroom_1.win_condition.l1.location = "QC_store_bedroom";
			pchar.quest.leave_bedroom_1.win_condition.l1.locator_group = "reload";
			pchar.quest.leave_bedroom_1.win_condition.l1.locator = "reload1";
			pchar.quest.leave_bedroom_1.win_condition = "leave_bedroom_1";
		break;

		case "leave_bedroom_1":
			Locations[FindLocation("QC_store_bedroom")].reload.l1.disable = 1;//bedroom to store

			PlaySound("VOICE\ENGLISH\gr_wench3_aye.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(PChar, CharacterFromID("Wench3"));
			LAi_QuestDelay("leave_bedroom_2", 2.0);
		break;

		case "leave_bedroom_2":
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "goto3", "leave_bedroom_3", 2.0);
		break;

		case "leave_bedroom_3":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "item", "item1");
			LAi_SetOfficerType(characterFromID("Mistress"));
			ChangeCharacterAddressGroup(characterFromID("Mistress"), "QC_store_bedroom", "goto", "goto10");
			LAi_QuestDelay("leave_bedroom_4", 1.0);
		break;

		case "leave_bedroom_4":
			ChangeCharacterAddressGroup(characterFromID("Mistress"), "QC_store_bedroom", "goto", "goto11");
			LAi_SetPlayerType(Pchar);
			LAi_QuestDelay("leave_bedroom_5", 1.0);
		break;

		case "leave_bedroom_5":
			PlaySound("PEOPLE\Run_roof.wav");
			ChangeCharacterAddressGroup(characterFromID("Mistress"), "QC_store_bedroom", "goto", "goto12");
			LAi_QuestDelay("leave_bedroom_6", 0.5);
		break;

		case "leave_bedroom_6":
			ChangeCharacterAddressGroup(characterFromID("Mistress"), "QC_store_bedroom", "goto", "goto13");
			LAi_QuestDelay("leave_bedroom_7", 1.0);
		break;

		case "leave_bedroom_7":
			PlaySound("VOICE\ENGLISH\gr_wench3_oh.wav");
			PlaySound("PEOPLE\Run_roof.wav");
			ChangeCharacterAddressGroup(characterFromID("Mistress"), "QC_store_bedroom", "goto", "goto14");
			LAi_QuestDelay("leave_bedroom_8", 0.5);
		break;

		case "leave_bedroom_8":
			ChangeCharacterAddressGroup(characterFromID("Mistress"), "QC_store_bedroom", "goto", "goto15");
			PlaySound("INTERFACE\locked_window.wav");
			LAi_SetActorType(CharacterFromID("Wench3"));
			LAi_ActorTurnToLocator(CharacterFromID("Wench3"), "goto", "goto15");
			LAi_QuestDelay("leave_bedroom_9", 1.0);
		break;

		case "leave_bedroom_9":
			LAi_QuestDelay("leave_bedroom_10", 1.0);
		break;

		case "leave_bedroom_10":
			Locations[FindLocation("QC_store_bedroom")].reload.l1.disable = 0;//bedroom to store
			LAi_SetActorType(CharacterFromID("Wench3"));
			LAi_ActorRunToLocator(characterFromID("Wench3"), "goto", "goto1", "leave_bedroom_11", 10.0);
		break;

		case "leave_bedroom_11":
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToLocator(CharacterFromID("Wench3"), "goto", "goto3");
			PlaySound("INTERFACE\locked_window.wav");
			LAi_SetPlayerType(Pchar);

			pchar.quest.leave_bedroom_12.win_condition.l1 = "locator";
			pchar.quest.leave_bedroom_12.win_condition.l1.location = "QC_Store_JRH";
			pchar.quest.leave_bedroom_12.win_condition.l1.locator_group = "reload";
			pchar.quest.leave_bedroom_12.win_condition.l1.locator = "reload3";
			pchar.quest.leave_bedroom_12.win_condition = "leave_bedroom_12";
		break;

		case "leave_bedroom_12":
			pchar.quest.leave_bedroom_13.win_condition.l1 = "locator";
			pchar.quest.leave_bedroom_13.win_condition.l1.location = "QC_Store_JRH";
			pchar.quest.leave_bedroom_13.win_condition.l1.locator_group = "goto";
			pchar.quest.leave_bedroom_13.win_condition.l1.locator = "goto15";
			pchar.quest.leave_bedroom_13.win_condition = "leave_bedroom_13";
		break;

		case "leave_bedroom_13":
			PlaySound("INTERFACE\closed_locked_door.wav");
			Locations[FindLocation("QC_Store_JRH")].reload.l5.disable = 1;//reload3 to bedroom
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_Store_JRH", "reload", "reload3");

			LAi_SetOfficerType(characterFromID("Peter Blowhorn"));
			Characters[GetCharacterIndex("Peter Blowhorn")].dialog.CurrentNode  = "from_bedroom_options";
		break;

		case "Blowhorn_fight":
			//from PB dialog
			LAi_SetActorType(characterFromID("Peter Blowhorn"));
			LAi_ActorAttack(CharacterFromID("Peter Blowhorn"), Pchar, "");
			PlaySound("VOICE\Eng_m_a_059.wav");
			LAi_LocationFightDisable(&Locations[FindLocation("QC_store_JRH")], false);

			Pchar.quest.Blowhorn_dead_0.win_condition.l1 = "NPC_Death";
			Pchar.quest.Blowhorn_dead_0.win_condition.l1.character = "Peter Blowhorn";
			Pchar.quest.Blowhorn_dead_0.win_condition = "Blowhorn_dead_0";
		break;

		case "Blowhorn_dead_0":
			ChangeCharacterAddressGroup(CharacterFromID("Peter Blowhorn"), "none", "", "");
			Locations[FindLocation("QC_Store_JRH")].reload.l1.disable = 0;//exit to QC town
			Locations[FindLocation("QC_Store_JRH")].reload.l2.disable = 1;//upstairs

			pchar.quest.Blowhorn_dead_1.win_condition.l1 = "locator";
			pchar.quest.Blowhorn_dead_1.win_condition.l1.location = "QC_Store_JRH";
			pchar.quest.Blowhorn_dead_1.win_condition.l1.locator_group = "goto";
			pchar.quest.Blowhorn_dead_1.win_condition.l1.locator = "goto2";
			pchar.quest.Blowhorn_dead_1.win_condition = "Blowhorn_dead_1";
		break;

		case "Blowhorn_dead_1":
			PlaySound("PEOPLE\Jump_Counter.wav");
			ChangeCharacterAddressGroup(Pchar, "QC_store_JRH", "goto", "goto12");
			LAi_QuestDelay("Blowhorn_dead_2", 0.5);
		break;

		case "Blowhorn_dead_2":
			ChangeCharacterAddressGroup(Pchar, "QC_store_JRH", "goto", "goto1");
			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_store_JRH", "reload", "reload2");
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToLocator(characterFromID("Wench3"), "reload", "reload1");

			pchar.quest.Blowhorn_dead_3.win_condition.l1 = "locator";
			pchar.quest.Blowhorn_dead_3.win_condition.l1.location = "QC_store_JRH";
			pchar.quest.Blowhorn_dead_3.win_condition.l1.locator_group = "reload";
			pchar.quest.Blowhorn_dead_3.win_condition.l1.locator = "locator2";
			pchar.quest.Blowhorn_dead_3.win_condition = "Blowhorn_dead_3";
		break;

		case "Blowhorn_dead_3":
			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_store_JRH", "reload", "reload1");
			PlaySound("PEOPLE\counter_openclose.wav");

			pchar.quest.Blowhorn_dead_4.win_condition.l1 = "locator";
			pchar.quest.Blowhorn_dead_4.win_condition.l1.location = "QC_town";
			pchar.quest.Blowhorn_dead_4.win_condition.l1.locator_group = "reload";
			pchar.quest.Blowhorn_dead_4.win_condition.l1.locator = "reload5";
			pchar.quest.Blowhorn_dead_4.win_condition = "Blowhorn_dead_4";
		break;

		case "Blowhorn_dead_4":
			LAi_SetOfficerType(characterFromID("Mistress"));
			ChangeCharacterAddressGroup(characterFromID("Mistress"), "QC_town", "officers", "reload5_3");
			PlaySound("VOICE\ENGLISH\gr_mistress_laugh.wav");
			LAi_QuestDelay("Blowhorn_dead_4A", 1.0);
		break;

		case "Blowhorn_dead_4A":
			PlaySound("OBJECTS\DUEL\pistol_small.wav");
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("gunfire" , u-1, v+1.2, w, 0.0, 0.0, 0.0, sti(20) );
			LAi_ApplyCharacterDamage(Pchar, 10);

			LAi_QuestDelay("Blowhorn_dead_4B", 0.2);
		break;

		case "Blowhorn_dead_4B":
			PlaySound("OBJECTS\DUEL\pistol_small.wav");
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("gunfire" , u-0.5, v+1.2, w, 0.0, 0.0, 0.0, sti(20) );
			LAi_ApplyCharacterDamage(Pchar, 14);

			LAi_QuestDelay("Blowhorn_dead_5", 1.0);

		break;

		case "Blowhorn_dead_5":
			PlaySound("OBJECTS\DUEL\pistol_bbus.wav");
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("gunfire" , u+0.5, v+1.2, w, 0.0, 0.0, 0.0, sti(20) );
			LAi_KillCharacter(Pchar);
		break;

//...................................................................................................................
		case "store_deal":
			LAi_SetActorType(Pchar);
			LAi_SetStayType(Pchar);

			PlaySound("INTERFACE\coins7.wav");
			int gold;
			gold = GetCharacterMoney(Pchar);
			AddMoneyToCharacter(Pchar,-gold);
			AddMoneyToCharacter(CharacterFromID("Peter Blowhorn"),gold);

			int pwd;
			int grp;
			if(CheckAttribute(pchar,"equip."+FLASK_ITEM_TYPE) )
			{
				pwd = 12;
			}else{
				pwd = 6;
			}
			if(CheckAttribute(pchar,"equip."+POUCH_ITEM_TYPE) )
			{
				grp = 12;
			}else{
				grp = 6;
			}
			TakeNItems(pchar,"gunpowder", -100);
			TakeNItems(pchar,"gunpowder", pwd);
			TakeNItems(pchar,"pistolgrapes", -100);
			TakeNItems(pchar,"pistolgrapes", grp);

			LAi_QuestDelay("store_deal_1", 1.0);
		break;

		case "store_deal_1":
			LAi_SetActorType(characterFromID("Peter Blowhorn"));
			LAi_ActorGoToLocator(characterFromID("Peter Blowhorn"), "reload", "reload2", "store_deal_2", 5.0);
		break;

		case "store_deal_2":
			ChangeCharacterAddressGroup(characterFromID("Peter Blowhorn"), "QC_store_JRH", "goto", "goto7");
			PlaySound("PEOPLE\counter_openclose.wav");
			LAi_QuestDelay("store_deal_3", 0.5);
		break;

		case "store_deal_3":
			ChangeCharacterAddressGroup(characterFromID("Peter Blowhorn"), "QC_store_JRH", "reload", "reload1");
			LAi_QuestDelay("store_deal_4", 1.0);
		break;

		case "store_deal_4":
			LAi_SetPlayerType(Pchar);

			pchar.quest.store_deal_5.win_condition.l1 = "locator";
			pchar.quest.store_deal_5.win_condition.l1.location = "QC_store_JRH";
			pchar.quest.store_deal_5.win_condition.l1.locator_group = "sit";
			pchar.quest.store_deal_5.win_condition.l1.locator = "sit1";
			pchar.quest.store_deal_5.win_condition = "store_deal_5";
		break;

		case "store_deal_5":
			LAi_SetActorType(characterFromID("Peter Blowhorn"));
			LAi_ActorDialog(characterFromID("Peter Blowhorn"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Peter Blowhorn"));
			Characters[GetCharacterIndex("Peter Blowhorn")].dialog.CurrentNode  = "dress_deal";
		break;

		case "Caroline_dress":
			//from PB dialog
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload3");
			LAi_QuestDelay("Caroline_dress_1", 1.0);
		break;

		case "Caroline_dress_1":
			PlaySound("VOICE\ENGLISH\gr_wench3.wav");
			LAi_QuestDelay("Caroline_dress_2", 1.0);
		break;

		case "Caroline_dress_2":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "none", "", "");
			LAi_QuestDelay("Caroline_dress_3", 1.0);
		break;

		case "Caroline_dress_3":
			LAi_SetActorType(characterFromID("Peter Blowhorn"));
			LAi_ActorDialog(characterFromID("Peter Blowhorn"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Peter Blowhorn"));
			Characters[GetCharacterIndex("Peter Blowhorn")].dialog.CurrentNode  = "dress_deal_9";
		break;

		case "Blaze_dress":
			//from PB dialog
			LAi_SetPlayerType(Pchar);

			pchar.quest.Blaze_dress_1.win_condition.l1 = "locator";
			pchar.quest.Blaze_dress_1.win_condition.l1.location = "QC_store_JRH";
			pchar.quest.Blaze_dress_1.win_condition.l1.locator_group = "goto";
			pchar.quest.Blaze_dress_1.win_condition.l1.locator = "goto13";
			pchar.quest.Blaze_dress_1.win_condition = "Blaze_dress_1";
		break;

		case "Blaze_dress_1":
			PlaySound("INTERFACE\closet_open.wav");
			LAi_SetStayType(Pchar);
			LAi_QuestDelay("Blaze_dress_2", 1.0);
		break;

		case "Blaze_dress_2":
			SetModel(PChar, "Animist4A", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			SetModel(characterFromID("Peter Blowhorn"), "Blowhorn_monk", "man", "man", 1.8, false);
			PlaySound("PEOPLE\clothes1.wav");
			LAi_QuestDelay("Blaze_dress_3", 1.0);
		break;

		case "Blaze_dress_3":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");

			LAi_QuestDelay("Blaze_dress_5", 2.0);
		break;

		case "Blaze_dress_5":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_store_JRH", "reload", "reload3");
			SetModel(characterFromID("Wench3"), "Animistsf", "man", "woman", 1.8, false);
			PlaySound("INTERFACE\closed_locked_door.wav");
			LAi_QuestDelay("Blaze_dress_6", 2.0);
		break;

		case "Blaze_dress_6":
			PlaySound("VOICE\ENGLISH\gr_wench3_mhm.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto5");

			LAi_QuestDelay("Blaze_dress_7", 1.5);
		break;

		case "Blaze_dress_7":
			PlaySound("VOICE\ENGLISH\blaze_lets_go.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");

			LAi_QuestDelay("store_departure_1", 1.0);
		break;

		case "store_departure":
			//from PB dialog
			LAi_SetPlayerType(Pchar);

			pchar.quest.store_departure_1.win_condition.l1 = "locator";
			pchar.quest.store_departure_1.win_condition.l1.location = "QC_store_JRH";
			pchar.quest.store_departure_1.win_condition.l1.locator_group = "box";
			pchar.quest.store_departure_1.win_condition.l1.locator = "box2";
			pchar.quest.store_departure_1.win_condition = "store_departure_1";
		break;

		case "store_departure_1":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload1");

			LAi_SetActorType(characterFromID("Peter Blowhorn"));
			LAi_ActorGoToLocator(characterFromID("Peter Blowhorn"), "officers", "locator2_2", "store_departure_2", 2.5);
		break;

		case "store_departure_2":
			LAi_QuestDelay("store_departure_3", 0.5);
		break;

		case "store_departure_3":
			LAi_SetStayType(characterFromID("Peter Blowhorn"));

			LAi_QuestDelay("store_departure_4", 0.5);
		break;

		case "store_departure_4":
			LAi_SetActorType(characterFromID("Peter Blowhorn"));
			LAi_ActorTurnToLocator(characterFromID("Peter Blowhorn"), "reload", "reload1");
			LAi_SetPlayerType(Pchar);

			pchar.quest.store_departure_4A.win_condition.l1 = "locator";
			pchar.quest.store_departure_4A.win_condition.l1.location = "QC_store_JRH";
			pchar.quest.store_departure_4A.win_condition.l1.locator_group = "box";
			pchar.quest.store_departure_4A.win_condition.l1.locator = "box1";
			pchar.quest.store_departure_4A.win_condition = "store_departure_4A";
		break;

		case "store_departure_4A":
			LAi_QuestDelay("store_departure_5", 2.0);
		break;

		case "store_departure_5":
			PlaySound("PEOPLE\Jump_Counter.wav");
			LAi_QuestDelay("store_departure_6", 0.7);
		break;

		case "store_departure_6":
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_store_JRH", "goto", "locator6");
			LAi_QuestDelay("store_departure_7", 0.5);
		break;

		case "store_departure_7":
			PlaySound("VOICE\ENGLISH\gr_wench3_aye.wav");
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToLocator(characterFromID("Wench3"), "reload", "reload1");
			LAi_QuestDelay("store_departure_8", 1.5);
		break;

		case "store_departure_8":
			PlaySound("VOICE\ENGLISH\blaze_lead_way_out.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "officers", "locator1_2");
			LAi_QuestDelay("store_departure_9", 1.0);
		break;

		case "store_departure_9":
			LAi_SetActorType(characterFromID("Peter Blowhorn"));
			LAi_ActorGoToLocator(characterFromID("Peter Blowhorn"), "reload", "locator1", "store_departure_10A", 7.0);

			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorGoToLocator(characterFromID("Wench3"), "reload", "locator1", "store_departure_10B", 8.0);

			LAi_QuestDelay("store_departure_9A", 2.0);
		break;

		case "store_departure_9A":
			LAi_SetPlayerType(Pchar);

			pchar.quest.store_departure_11.win_condition.l1 = "locator";
			pchar.quest.store_departure_11.win_condition.l1.location = "QC_store_JRH";
			pchar.quest.store_departure_11.win_condition.l1.locator_group = "goto";
			pchar.quest.store_departure_11.win_condition.l1.locator = "goto10";
			pchar.quest.store_departure_11.win_condition = "store_departure_11";
		break;

		case "store_departure_10A":
			ChangeCharacterAddressGroup(CharacterFromID("Peter Blowhorn"), "QC_store_upstairs", "officers", "reload1_1");
		break;

		case "store_departure_10B":
			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_store_upstairs", "officers", "reload1_2");
			LAi_SetStayType(characterFromID("Wench3"));
		break;

		case "store_departure_11":
			PlaySound("AMBIENT\silent_talk.wav");

			Locations[FindLocation("QC_store_JRH")].reload.l2.emerge = "reload1";
			Locations[FindLocation("QC_Store_upstairs")].reload.l1.disable = 1;//to store
			locations[FindLocation("QC_Store_upstairs")].type = "";		   //no harpsichord

			LAi_SetImmortal(CharacterFromID("CoastBrother1"), true);	//leader

			pchar.quest.coastbrothers.win_condition.l1 = "locator";
			pchar.quest.coastbrothers.win_condition.l1.location = "QC_store_upstairs";
			pchar.quest.coastbrothers.win_condition.l1.locator_group = "reload";
			pchar.quest.coastbrothers.win_condition.l1.locator = "reload1";
			pchar.quest.coastbrothers.win_condition = "coastbrothers";
		break;
//........................................................................................................................
		case "coastbrothers":
			Pchar.quest.wr_quest3 = "cb_leader_silent";

			SetCurrentTime(19.00, 0);
			SetNextWeather("Stormy");
			Pchar.quest.JRH_rain = "Stormy";
			Pchar.quest.JRH_sky = "C_Ni2";

			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother1"), "QC_store_upstairs", "goto", "goto17");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother2"), "QC_store_upstairs", "sit", "sit10");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother3"), "QC_store_upstairs", "sit", "sit11");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother4"), "QC_store_upstairs", "sit", "sit18");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother5"), "QC_store_upstairs", "sit", "sit12");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother6"), "QC_store_upstairs", "sit", "sit14");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother7"), "QC_store_upstairs", "sit", "sit15");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother8"), "QC_store_upstairs", "sit", "sit16");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother9"), "QC_store_upstairs", "sit", "sit17");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother10"), "QC_store_upstairs", "sit", "sit13");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother11"), "QC_store_upstairs", "sit", "sit5");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother12"), "QC_store_upstairs", "sit", "sit19");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother13"), "QC_store_upstairs", "sit", "sit20");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother14"), "QC_store_upstairs", "sit", "sit21");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother15"), "QC_store_upstairs", "sit", "sit8");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother16"), "QC_store_upstairs", "sit", "sit25");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother17"), "QC_store_upstairs", "sit", "sit24");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother19"), "QC_store_upstairs", "sit", "sit26");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother21"), "QC_store_upstairs", "sit", "sit22");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother22"), "QC_store_upstairs", "goto", "goto12");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother23"), "QC_store_upstairs", "goto", "goto21");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother24"), "QC_store_upstairs", "goto", "goto11");
		//ChangeCharacterAddressGroup(CharacterFromID("CoastBrother25"), "QC_store_upstairs", "goto", "goto15");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother26"), "QC_store_upstairs", "goto", "goto20");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother27"), "QC_store_upstairs", "goto", "goto16");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother29"), "QC_store_upstairs", "goto", "goto19");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother30"), "QC_store_upstairs", "goto", "goto14");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother32"), "QC_store_upstairs", "goto", "goto13");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother33"), "QC_store_upstairs", "goto", "goto22");

			PlaySound("AMBIENT\c_brothers_long.wav");

			if(CheckAttribute(Pchar,"quest.wr_quest3") && Pchar.quest.wr_quest3 == "cb_leader_silent")
			{
				LAi_QuestDelay("loop_coastbrothersound", 36.0);
			}

			if(Pchar.quest.wr_quest2 == "store_disguise")
			{
				Locations[FindLocation("QC_Store_upstairs")].reload.l2.disable = 0;//to store roof
				Locations[FindLocation("QC_Store_upstairs")].reload.l3.disable = 1;//to terrace

				pchar.quest.coastbrothers_7.win_condition.l1 = "locator";
				pchar.quest.coastbrothers_7.win_condition.l1.location = "QC_store_upstairs";
				pchar.quest.coastbrothers_7.win_condition.l1.locator_group = "goto";
				pchar.quest.coastbrothers_7.win_condition.l1.locator = "goto7";
				pchar.quest.coastbrothers_7.win_condition = "coastbrothers_7intro";
			}
			if(Pchar.quest.wr_quest2 == "store_no_disguise")
			{
				//locked 4 first sec ???
				Locations[FindLocation("QC_store_upstairs")].reload.l1.emerge = "locator1";
				LAi_LocationFightDisable(&Locations[FindLocation("QC_Store_upstairs")], false);

			AddPassenger(Pchar, characterFromID("Wench3"), 0);
			AddPassenger(Pchar, characterFromID("Peter Blowhorn"), 0);
			SetOfficersIndex(Pchar, 1, getCharacterIndex("Wench3"));
			SetOfficersIndex(Pchar, 2, getCharacterIndex("Peter Blowhorn"));
			LAi_SetOfficerType(characterFromID("Wench3"));
			LAi_SetOfficerType(characterFromID("Peter Blowhorn"));
			LAi_SetImmortal(CharacterFromID("Wench3"), true);
			LAi_SetImmortal(CharacterFromID("Peter Blowhorn"), true);

				LAi_QuestDelay("coastbrothers_kill", 4.0);
			}

		break;

		case "loop_coastbrothersound":
			if (pchar.location == "QC_Store_upstairs")
			{
				if(CheckAttribute(Pchar,"quest.wr_quest3") && Pchar.quest.wr_quest3 == "cb_leader_speaks")
				{
					return;
				}
				if(CheckAttribute(Pchar,"quest.wr_quest3") && Pchar.quest.wr_quest3 == "cb_leader_silent")
				{
					PlaySound("AMBIENT\c_brothers_long.wav");
					LAi_QuestDelay("loop_coastbrothersound", 36.0);
				}
			}
		break;


//------------------------------------------------------------------------------------------------------------------------
		case "coastbrothers_kill":
			//Locations[FindLocation("QC_Store_upstairs")].reload.l1.disable = 0;//to store
			// no never
			PlaySound("OBJECTS\DUEL\pistol_grape.wav");
			GetCharacterPos(CharacterFromID("Peter Blowhorn"), &u, &v, &w);
			CreateParticleSystem("gunfire" , u+0.5, v+1.6, w-0.5, 0.0, 0.0, 0.0, sti(20) );

			LAi_SetActorType(CharacterFromID("CoastBrother1"));
			LAi_SetActorType(CharacterFromID("CoastBrother2"));
			LAi_SetActorType(CharacterFromID("CoastBrother3"));
			LAi_SetActorType(CharacterFromID("CoastBrother4"));
			LAi_SetActorType(CharacterFromID("CoastBrother5"));
			LAi_SetActorType(CharacterFromID("CoastBrother6"));
			LAi_SetActorType(CharacterFromID("CoastBrother7"));
			LAi_SetActorType(CharacterFromID("CoastBrother8"));
			LAi_SetActorType(CharacterFromID("CoastBrother9"));
			LAi_SetActorType(CharacterFromID("CoastBrother10"));
			LAi_SetActorType(CharacterFromID("CoastBrother11"));
			LAi_SetActorType(CharacterFromID("CoastBrother12"));
			LAi_SetActorType(CharacterFromID("CoastBrother13"));
			LAi_SetActorType(CharacterFromID("CoastBrother14"));
			LAi_SetActorType(CharacterFromID("CoastBrother15"));
			LAi_SetActorType(CharacterFromID("CoastBrother16"));
			LAi_SetActorType(CharacterFromID("CoastBrother17"));
			LAi_SetActorType(CharacterFromID("CoastBrother19"));
			LAi_SetActorType(CharacterFromID("CoastBrother21"));
			LAi_SetActorType(CharacterFromID("CoastBrother22"));
			LAi_SetActorType(CharacterFromID("CoastBrother23"));
			LAi_SetActorType(CharacterFromID("CoastBrother24"));
			//LAi_SetActorType(CharacterFromID("CoastBrother25"));
			LAi_SetActorType(CharacterFromID("CoastBrother26"));
			LAi_SetActorType(CharacterFromID("CoastBrother27"));
			LAi_SetActorType(CharacterFromID("CoastBrother29"));
			LAi_SetActorType(CharacterFromID("CoastBrother30"));
			LAi_SetActorType(CharacterFromID("CoastBrother32"));
			LAi_SetActorType(CharacterFromID("CoastBrother33"));//stops the random talks

			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother1"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother2"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother3"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother4"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother5"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother6"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother7"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother8"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother9"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother10"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother11"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother12"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother13"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother14"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother15"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother16"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother17"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother19"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother21"), Pchar);//still sitting
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother22"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother23"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother24"), Pchar);
			//LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother25"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother26"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother27"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother29"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother30"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother32"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother33"), Pchar);

			LAi_QuestDelay("coastbrothers_kill_1", 1.0);
		break;

		case "coastbrothers_kill_1":
			PauseAllSounds();
			PlaySound("VOICE\ENGLISH\c_brother21.wav");

			LAi_QuestDelay("coastbrothers_kill_2", 2.0);
		break;

		case "coastbrothers_kill_2":
			PlaySound("OBJECTS\ABORDAGE\abordage2.wav");

			LAi_SetActorType(CharacterFromID("Wench3"));
			LAi_ActorAttack(CharacterFromID("Wench3"), CharacterFromID("CoastBrother10"), "");
			LAi_SetActorType(CharacterFromID("Peter Blowhorn"));
			LAi_ActorAttack(CharacterFromID("Peter Blowhorn"), CharacterFromID("CoastBrother5"), "");

			LAi_ActorAttack(CharacterFromID("CoastBrother1"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother2"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother3"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother4"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother5"), CharacterFromID("Peter Blowhorn"), "");
			LAi_ActorAttack(CharacterFromID("CoastBrother6"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother7"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother8"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother9"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother10"), CharacterFromID("Wench3"), "");
			LAi_ActorAttack(CharacterFromID("CoastBrother11"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother12"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother13"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother14"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother15"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother16"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother17"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother19"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother21"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother22"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother23"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother24"), Pchar, "");
			//LAi_ActorAttack(CharacterFromID("CoastBrother25"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother26"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother27"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother29"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother30"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother32"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother33"), Pchar, "");

			PlaySound("OBJECTS\ABORDAGE\abordage2.wav");
		break;

//------------------------------------------------------------------------------------------------------------------------
		case "coastbrothers_7intro":
			PauseAllSounds();

			ChangeCharacterAddressGroup(Pchar, "QC_store_upstairs", "goto", "drunk");
			LAi_SetStayType(Pchar);

			LAi_SetActorType(characterFromID("Peter Blowhorn"));
			LAi_ActorRunToLocatorJRH(characterFromID("Peter Blowhorn"), "goto", "goto41", 0.0);
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorRunToLocatorJRH(characterFromID("Wench3"), "goto", "goto41B", 0.0);

			Pchar.quest.wr_quest3 = "cb_leader_speaks";

			LAi_SetActorType(CharacterFromID("CoastBrother1"));
			LAi_SetActorType(CharacterFromID("CoastBrother2"));
			LAi_SetActorType(CharacterFromID("CoastBrother3"));
			LAi_SetActorType(CharacterFromID("CoastBrother4"));
			LAi_SetActorType(CharacterFromID("CoastBrother5"));
			LAi_SetActorType(CharacterFromID("CoastBrother6"));
			LAi_SetActorType(CharacterFromID("CoastBrother7"));
			LAi_SetActorType(CharacterFromID("CoastBrother8"));
			LAi_SetActorType(CharacterFromID("CoastBrother9"));
			LAi_SetActorType(CharacterFromID("CoastBrother10"));
			LAi_SetActorType(CharacterFromID("CoastBrother11"));
			LAi_SetActorType(CharacterFromID("CoastBrother12"));
			LAi_SetActorType(CharacterFromID("CoastBrother13"));
			LAi_SetActorType(CharacterFromID("CoastBrother14"));
			LAi_SetActorType(CharacterFromID("CoastBrother15"));
			LAi_SetActorType(CharacterFromID("CoastBrother16"));
			LAi_SetActorType(CharacterFromID("CoastBrother17"));
			LAi_SetActorType(CharacterFromID("CoastBrother19"));
			//LAi_SetActorType(CharacterFromID("CoastBrother21"));//admiral sits
			LAi_SetActorType(CharacterFromID("CoastBrother22"));
			LAi_SetActorType(CharacterFromID("CoastBrother23"));
			LAi_SetActorType(CharacterFromID("CoastBrother24"));
			//LAi_SetActorType(CharacterFromID("CoastBrother25"));
			LAi_SetActorType(CharacterFromID("CoastBrother26"));
			LAi_SetActorType(CharacterFromID("CoastBrother27"));
			LAi_SetActorType(CharacterFromID("CoastBrother29"));
			LAi_SetActorType(CharacterFromID("CoastBrother30"));
			LAi_SetActorType(CharacterFromID("CoastBrother32"));
			LAi_SetActorType(CharacterFromID("CoastBrother33"));//stops the random talks

			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother1"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother2"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother3"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother4"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother5"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother6"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother7"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother8"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother9"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother10"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother11"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother12"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother13"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother14"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother15"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother16"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother17"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother19"), Pchar);
			//LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother21"), Pchar);//still sitting
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother22"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother23"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother24"), Pchar);
			//LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother25"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother26"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother27"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother29"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother30"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother32"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother33"), Pchar);

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto17");

			LAi_QuestDelay("coastbrothers_9", 0.1);//was 1.0
		break;

		case "coastbrothers_9":
			LAi_SetActorType(characterFromID("Coastbrother1"));
			LAi_ActorDialog(characterFromID("Coastbrother1"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Coastbrother1"));
		break;

		case "blaze_drunk1":
			//from CB dialog
			LAi_SetStayType(Pchar);
			PlaySound("VOICE\ENGLISH\blaze_drunk1.wav");

			LAi_QuestDelay("coastbrothers_10", 2.0);
		break;

		case "coastbrothers_10":
			LAi_SetActorType(characterFromID("Coastbrother1"));
			LAi_ActorDialog(characterFromID("Coastbrother1"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Coastbrother1"));
			Characters[GetCharacterIndex("Coastbrother1")].dialog.CurrentNode  = "talk_1";
		break;

		case "coastbrothers_not_fooled":
			//from CB dialog
			LAi_SetActorType(characterFromID("Peter Blowhorn"));
			LAi_ActorRunToLocatorJRH(characterFromID("Peter Blowhorn"), "goto", "goto43", 3.0);
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorRunToLocatorJRH(characterFromID("Wench3"), "goto", "goto42", 3.0);

			PlaySound("VOICE\ENGLISH\blaze_drunk2.wav");

			LAi_QuestDelay("coastbrothers_not_fooled_1", 3.0);
		break;

		case "coastbrothers_not_fooled_1":
			LAi_SetPlayerType(Pchar);

			pchar.quest.coastbrothers_not_fooled_2.win_condition.l1 = "locator";
			pchar.quest.coastbrothers_not_fooled_2.win_condition.l1.location = "QC_store_upstairs";
			pchar.quest.coastbrothers_not_fooled_2.win_condition.l1.locator_group = "goto";
			pchar.quest.coastbrothers_not_fooled_2.win_condition.l1.locator = "goto41";
			pchar.quest.coastbrothers_not_fooled_2.win_condition = "coastbrothers_not_fooled_2";
		break;

		case "coastbrothers_not_fooled_2":
			LAi_SetActorType(characterFromID("Peter Blowhorn"));
			LAi_ActorTurnToCharacter(CharacterFromID("Peter Blowhorn"), Pchar);
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToCharacter(CharacterFromID("Wench3"), Pchar);

			//LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother1"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother2"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother3"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother4"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother5"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother6"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother7"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother8"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother9"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother10"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother11"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother12"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother13"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother14"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother15"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother16"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother17"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother19"), Pchar);
			//LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother21"), Pchar);//still sitting
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother22"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother23"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother24"), Pchar);
			//LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother25"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother26"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother27"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother29"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother30"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother32"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("CoastBrother33"), Pchar);

			PlaySound("OBJECTS\DUEL\pistol_grape.wav");
			GetCharacterPos(CharacterFromID("Coastbrother1"), &u, &v, &w);
			CreateParticleSystem("gunfire" , u+0.5, v+1.6, w-0.5, 0.0, 0.0, 0.0, sti(20) );

			LAi_SetActorType(characterFromID("Coastbrother1"));
			LAi_ActorDialog(characterFromID("Coastbrother1"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Coastbrother1"));
			Characters[GetCharacterIndex("Coastbrother1")].dialog.CurrentNode  = "talk_2";
		break;

		case "coastbrothers_not_fooled_3":
			//from CB dialog
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto43");

			LAi_QuestDelay("coastbrothers_not_fooled_4", 2.0);
		break;

		case "coastbrothers_not_fooled_4":
			PlaySound("VOICE\ENGLISH\blaze_lets_go.wav");

			LAi_SetActorType(characterFromID("Peter Blowhorn"));
			LAi_ActorRunToLocatorJRH(characterFromID("Peter Blowhorn"), "reload", "reload2", 3.0);
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorRunToLocatorJRH(characterFromID("Wench3"), "goto", "goto8", 3.0);

			LAi_QuestDelay("coastbrothers_not_fooled_5", 1.0);
		break;

		case "coastbrothers_not_fooled_5":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "sit", "sit22");

			LAi_SetActorType(CharacterFromID("CoastBrother21"));
			PlaySound("VOICE\ENGLISH\c_brother21.wav");

			LAi_QuestDelay("coastbrothers_not_fooled_6", 2.0);
		break;

		case "coastbrothers_not_fooled_6":
			LAi_SetPlayerType(Pchar);
			LAi_LocationFightDisable(&Locations[FindLocation("QC_Store_upstairs")], false);
			LAi_ActorAttack(CharacterFromID("Coastbrother21"), Pchar, "");
			ChangeCharacterAddressGroup(CharacterFromID("Peter Blowhorn"), "QC_town", "goto", "goto62");

			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorRunToLocatorJRH(characterFromID("Wench3"), "reload", "reload2", 2.0);

			LAi_QuestDelay("coastbrothers_not_fooled_7", 1.0);
		break;

		case "coastbrothers_not_fooled_7":
			PlaySound("OBJECTS\ABORDAGE\abordage2.wav");

			if (pchar.location == "QC_Store_upstairs")
			{
				LAi_QuestDelay("loop_abordagesound", 15.0);
			}

			LAi_QuestDelay("coastbrothers_not_fooled_8", 1.0);
		break;

		case "loop_abordagesound":
			if (pchar.location == "QC_Store_upstairs")
			{
				PlaySound("OBJECTS\ABORDAGE\abordage2.wav");
				LAi_QuestDelay("loop_abordagesound", 15.0);
			}
		break;

		case "coastbrothers_not_fooled_8":
			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_town", "goto", "goto60");

			LAi_ActorAttack(CharacterFromID("CoastBrother1"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother2"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother3"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother4"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother5"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother6"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother7"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother8"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother9"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother10"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother11"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother12"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother13"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother14"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother15"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother16"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother17"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother19"), Pchar, "");

			LAi_ActorAttack(CharacterFromID("CoastBrother22"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother23"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother24"), Pchar, "");
			//LAi_ActorAttack(CharacterFromID("CoastBrother25"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother26"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother27"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother29"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother30"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother32"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("CoastBrother33"), Pchar, "");

			pchar.quest.coastbrothers_pursuit.win_condition.l1 = "locator";
			pchar.quest.coastbrothers_pursuit.win_condition.l1.location = "QC_store_upstairs";
			pchar.quest.coastbrothers_pursuit.win_condition.l1.locator_group = "goto";
			pchar.quest.coastbrothers_pursuit.win_condition.l1.locator = "goto8";
			pchar.quest.coastbrothers_pursuit.win_condition = "coastbrothers_pursuit";
		break;

//......................................................................................................

		case "coastbrothers_pursuit":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto16");

			LAi_SetStayType(CharacterFromID("CoastBrother26"));
			LAi_SetStayType(CharacterFromID("CoastBrother27"));

			LAi_SetStayType(CharacterFromID("CoastBrother11"));
			LAi_SetStayType(CharacterFromID("CoastBrother12"));
			LAi_SetStayType(CharacterFromID("CoastBrother14"));
			LAi_SetStayType(CharacterFromID("CoastBrother4"));

			LAi_SetStayType(CharacterFromID("CoastBrother10"));
			LAi_SetStayType(CharacterFromID("CoastBrother15"));
			LAi_SetStayType(CharacterFromID("CoastBrother13"));
			LAi_SetStayType(CharacterFromID("CoastBrother1"));

			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother10"), "QC_store_upstairs", "goto", "goto42");

			LAi_QuestDelay("cb_blaze_ready", 1.0);

			pchar.quest.store_roof_1.win_condition.l1 = "location";
			pchar.quest.store_roof_1.win_condition.l1.location = "QC_town";
			pchar.quest.store_roof_1.win_condition = "store_roof_1";
		break;

		case "cb_blaze_ready":
			LAi_SetPlayerType(Pchar);
			LAi_QuestDelay("cb10_below_wait", 0.1); //was 2.5
		break;
//......................................................................................................

		case "cb10_below_wait":
			LAi_SetActorType(CharacterFromID("CoastBrother10"));
			LAi_ActorRunToLocator(characterFromID("CoastBrother10"), "goto", "goto43", "cb10_below_attacks", 0.1);//was 1.0
		break;

		case "cb10_below_attacks":
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother15"), "QC_store_upstairs", "goto", "goto42");
			LAi_SetActorType(CharacterFromID("CoastBrother10"));
			LAi_ActorAttack(CharacterFromID("CoastBrother10"), Pchar, "");
			LAi_QuestDelay("cb10_below_check", 0.1);
		break;

		case "cb10_below_check":
			if (pchar.location == "QC_store_upstairs")
			{
				Pchar.quest.cb15_below_wait.win_condition.l1 = "NPC_Death";
				Pchar.quest.cb15_below_wait.win_condition.l1.character = "CoastBrother10";
				Pchar.quest.cb15_below_wait.win_condition = "cb15_below_wait";
			}
		break;

		case "cb15_below_wait":
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother13"), "QC_store_upstairs", "goto", "goto42");
			LAi_SetActorType(CharacterFromID("CoastBrother15"));
			LAi_ActorRunToLocator(characterFromID("CoastBrother15"), "goto", "goto43", "cb15_below_attacks", 1.0);//was 2.0
		break;

		case "cb15_below_attacks":
			LAi_SetActorType(CharacterFromID("CoastBrother15"));
			LAi_ActorAttack(CharacterFromID("CoastBrother15"), Pchar, "");
			LAi_QuestDelay("cb15_below_check", 0.1);
		break;

		case "cb15_below_check":
			if (pchar.location == "QC_store_upstairs")
			{
				Pchar.quest.cb13_below_wait.win_condition.l1 = "NPC_Death";
				Pchar.quest.cb13_below_wait.win_condition.l1.character = "CoastBrother15";
				Pchar.quest.cb13_below_wait.win_condition = "cb13_below_wait";
			}
		break;

		case "cb13_below_wait":
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother1"), "QC_store_upstairs", "goto", "goto42");
			LAi_SetActorType(CharacterFromID("CoastBrother13"));
			LAi_ActorRunToLocator(characterFromID("CoastBrother13"), "goto", "goto43", "cb13_below_attacks", 1.0);//was 2.0
		break;

		case "cb13_below_attacks":
			LAi_SetActorType(CharacterFromID("CoastBrother13"));
			LAi_ActorAttack(CharacterFromID("CoastBrother13"), Pchar, "");
			LAi_QuestDelay("cb13_below_check", 0.1);			//was off!
		break;
//------------------------------------------------------------------------------------------------------------------------
		case "cb13_below_check":
			if (pchar.location == "QC_store_upstairs")
			{
				Pchar.quest.cb1_below_wait.win_condition.l1 = "NPC_Death";
				Pchar.quest.cb1_below_wait.win_condition.l1.character = "CoastBrother15";
				Pchar.quest.cb1_below_wait.win_condition = "cb1_below_wait";
			}
		break;

		case "cb1_below_wait":
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother21"), "QC_store_upstairs", "goto", "goto42");
			LAi_SetActorType(CharacterFromID("CoastBrother1"));
			LAi_ActorRunToLocator(characterFromID("CoastBrother1"), "goto", "goto43", "cb1_below_attacks", 1.0);//was 2.0
		break;

		case "cb1_below_attacks":
			LAi_SetActorType(CharacterFromID("CoastBrother1"));
			LAi_ActorAttack(CharacterFromID("CoastBrother1"), Pchar, "");
		break;
//------------------------------------------------------------------------------------------------------------------------
		case "store_roof_1":
			PlaySound("PEOPLE\counter_openclose.wav");
			LAi_QuestDelay("store_roof_2", 0.5);
		break;

		case "store_roof_2":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "goto63");
			LAi_QuestDelay("store_roof_3", 0.5);
		break;

		case "store_roof_3":
			LAi_SetActorType(CharacterFromID("Peter Blowhorn"));
			LAi_ActorDialog(characterFromID("Peter Blowhorn"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Peter Blowhorn"));
			Characters[GetCharacterIndex("Peter Blowhorn")].dialog.CurrentNode  = "store_roof_talk";
		break;

		case "store_roof_4":
			//from PB dialog 1
			LAi_SetActorType(CharacterFromID("Wench3"));
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 0.5, 0.5);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
			Characters[GetCharacterIndex("Wench3")].dialog.CurrentNode  = "store_roof_talk";
		break;

		case "store_roof_5":
			//from CK dialog 1
			LAi_SetActorType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "goto64");
			PlaySound("PEOPLE\Run_wood.wav");
			LAi_SetActorType(CharacterFromID("Peter Blowhorn"));
			LAi_ActorDialog(characterFromID("Peter Blowhorn"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Peter Blowhorn"));
			Characters[GetCharacterIndex("Peter Blowhorn")].dialog.CurrentNode  = "store_roof_talk_2";
		break;

		case "store_roof_7":
			//from PB dialog 2/3
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(PChar, true);
			LAi_SetImmortal(CharacterFromID("Peter Blowhorn"), true);
			LAi_QuestDelay("store_roof_8", 1.0);
		break;

		case "store_roof_8":
			LAi_SetActorType(CharacterFromID("Peter Blowhorn"));
			LAi_ActorTurnToLocator(characterFromID("Peter Blowhorn"), "goto", "goto70");
			LAi_QuestDelay("store_roof_9", 1.0);
		break;

		case "store_roof_9":
			PlaySound("OBJECTS\DUEL\man_attack1.wav");

			ChangeCharacterAddressGroup(CharacterFromID("Peter Blowhorn"), "QC_town", "goto", "goto71");
			LAi_SetSitType(characterFromID("Peter Blowhorn"));
			LAi_SetActorType(CharacterFromID("Wench3"));
			LAi_ActorTurnToLocator(CharacterFromID("Wench3"), "goto", "goto72");
			LAi_QuestDelay("store_roof_10", 0.5);
		break;

		case "store_roof_10":
			ChangeCharacterAddressGroup(CharacterFromID("Peter Blowhorn"), "QC_town", "goto", "goto70");
			PlaySound("PEOPLE\Jump_roof.wav");
			LAi_QuestDelay("store_roof_11", 0.7);
		break;

		case "store_roof_11":
			LAi_SetStayType(characterFromID("Peter Blowhorn"));
			LAi_SetActorType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "goto62");
			PlaySound("PEOPLE\Run_wood.wav");
			LAi_QuestDelay("store_roof_12", 1.0);
		break;

		case "store_roof_12":
			LAi_SetActorType(CharacterFromID("Peter Blowhorn"));
			LAi_ActorTurnToCharacter(CharacterFromID("Peter Blowhorn"), Pchar);
			LAi_SetPlayerType(Pchar);
			LAi_SetStayType(CharacterFromID("CoastBrother1"));//yes that did it
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother1"), "QC_town", "goto", "goto63");
			LAi_SetStayType(CharacterFromID("CoastBrother22"));	//was 21 admiral
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother22"), "QC_town", "goto", "goto65");
			LAi_QuestDelay("store_roof_13", 1.0);	//was 1.0
		break;

		case "store_roof_13":
			LAi_SetActorType(CharacterFromID("CoastBrother1"));
			LAi_ActorTurnToLocator(CharacterFromID("CoastBrother1"), "goto", "goto62");
			PlaySound("PEOPLE\counter_openclose.wav");
			LAi_SetPlayerType(characterFromID("CoastBrother22"));
			if(!LAi_IsFightMode(characterFromID("CoastBrother22")) ) LAi_SetFightMode(characterFromID("CoastBrother22"), true);

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto63");
			LAi_QuestDelay("store_roof_14", 1.0);
		break;

		case "store_roof_14":
			LAi_SetPlayerType(characterFromID("CoastBrother1"));
			if(!LAi_IsFightMode(characterFromID("CoastBrother1")) ) LAi_SetFightMode(characterFromID("CoastBrother1"), true);

			LAi_QuestDelay("store_roof_15", 1.0);
		break;

		case "store_roof_15":
			PlaySound("VOICE\ENGLISH\blaze_lets_go.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto71");

			LAi_QuestDelay("store_roof_15A", 1.5);
			LAi_QuestDelay("store_roof_16", 2.0);
		break;

		case "store_roof_15A":
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother22"), "QC_town", "goto", "goto64");
			PlaySound("PEOPLE\Run_wood.wav");
		break;

		case "store_roof_16":
			PlaySound("VOICE\ENGLISH\gr_wench3_oh.wav");
			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_town", "goto", "goto72");
			LAi_SetSitType(characterFromID("Wench3"));
			LAi_QuestDelay("store_roof_17", 0.3);
		break;

		case "store_roof_17":
			PlaySound("OBJECTS\DUEL\man_attack1.wav");

			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "goto71");
			LAi_SetSitType(Pchar);
			LAi_QuestDelay("store_roof_18", 0.2);
		break;

		case "store_roof_18":
			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_town", "goto", "goto74");
			PlaySound("PEOPLE\Jump_roof.wav");
			LAi_QuestDelay("store_roof_19", 0.3);
		break;

		case "store_roof_19":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "goto73");
			PlaySound("PEOPLE\Jump.wav");
			LAi_QuestDelay("store_roof_20", 0.2);
		break;

		case "store_roof_20":
			LAi_SetStayType(CharacterFromID("Wench3"));
			LAi_QuestDelay("store_roof_21", 0.2);
		break;

		case "store_roof_21":
			LAi_SetStayType(Pchar);
			LAi_QuestDelay("store_roof_22", 1.0);
		break;

		case "store_roof_22":
			PauseAllSounds();
			PlaySound("PEOPLE\roof_creak.wav");//takes about 3 sec
			LAi_QuestDelay("store_roof_22A", 2.0);//was 3.0
		break;

		case "store_roof_22A":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead1.wav");

			LAi_QuestDelay("store_roof_23", 1.0);
		break;

		case "store_roof_23":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "goto73D");
			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_town", "goto", "goto74D");
			ChangeCharacterAddressGroup(CharacterFromID("Peter Blowhorn"), "QC_town", "goto", "goto70D");
			LAi_QuestDelay("store_roof_24", 0.5);
		break;

		case "store_roof_24":
			GiveItem2Character(CharacterFromID("CoastBrother22"), "pistolb1");
			EquipCharacterByItem(CharacterFromID("CoastBrother22"), "pistolb1");
			GiveItem2Character(CharacterFromID("CoastBrother1"), "pistolb1");
			EquipCharacterByItem(CharacterFromID("CoastBrother1"), "pistolb1");
			GiveItem2Character(CharacterFromID("CoastBrother22"), "bladep2");
			EquipCharacterByItem(CharacterFromID("CoastBrother22"), "bladep2");
			GiveItem2Character(CharacterFromID("CoastBrother1"), "bladep2");
			EquipCharacterByItem(CharacterFromID("CoastBrother1"), "bladep2");

			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother22"), "QC_town", "goto", "goto61");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother1"), "QC_town", "goto", "goto60");
		//	ChangeCharacterAddressGroup(CharacterFromID("CoastBrother21"), "none", "", "");

			DoQuestReloadToLocation("QC_shipyard1_JRH", "goto", "goto1U", "shipyard_1");
		break;
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
		case "shipyard_1":
			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_shipyard1_JRH", "goto", "goto3U");
			ChangeCharacterAddressGroup(CharacterFromID("Peter Blowhorn"), "QC_shipyard1_JRH", "goto", "goto4U");

			RemoveCharacterEquip(CharacterFromID("Peter Blowhorn"), BLADE_ITEM_TYPE);

			PlaySound("OBJECTS\VOICES\DEAD\female\dead_wom3.wav");

			DeleteAttribute(Pchar, "items");//takes all incl fists
			GiveItem2Character(Pchar, "bladeX4");

			LAi_SetSitType(Pchar);
			LAi_SetSitType(CharacterFromID("Wench3"));
			LAi_SetSitType(CharacterFromID("Peter Blowhorn"));

			LAi_QuestDelay("shipyard_2", 0.5);//0.5 is the shortest possible time (to play roof_broken completely)
		break;

		case "shipyard_2":
			PlaySound("PEOPLE\roof_broken1.wav");//yes exact here
			PlaySound("PEOPLE\Jump.wav");

			ChangeCharacterAddressGroup(Pchar, "QC_shipyard1_JRH", "goto", "goto1");
			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_shipyard1_JRH", "goto", "goto3");
			ChangeCharacterAddressGroup(CharacterFromID("Peter Blowhorn"), "QC_shipyard1_JRH", "goto", "goto4");

			//damage from hit the floor
			//float Php;
			Php = LAi_GetCharacterHP(Pchar);
			int Php4;
			Php4 = Php/4;
			LAi_ApplyCharacterDamage(Pchar, Php4);

			float x1, y1, z1;
			float x2, y2, z2;
			float x3, y3, z3;

			GetCharacterPos(Pchar, &x1, &y1, &z1);
			GetCharacterPos(CharacterFromID("Wench3"), &x2, &y2, &z2);
			GetCharacterPos(CharacterFromID("Peter Blowhorn"), &x3, &y3, &z3);

			CreateParticleSystem("splinters", x1, y1, z1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", x1, y1, z1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", x2, y2, z2, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", x2, y2, z2, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", x3, y3, z3, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", x3, y3, z3, 0.0, 0.0, 0.0, 0);

			CreateParticleSystemX("blast_dirt", x1, y1, z1, x1, y1, z1,10);
			CreateParticleSystemX("blast_dirt", x2, y2, z2, x2, y2, z2,10);
			CreateParticleSystemX("blast_dirt", x3, y3, z3, x3, y3, z3,10);

			LAi_QuestDelay("shipyard_3", 0.5);
		break;

		case "shipyard_3":
			LAi_SetActorType(Pchar);
			LAi_ActorSetLayMode(Pchar);

			LAi_SetActorType(CharacterFromID("Wench3"));
			LAi_ActorSetLayMode(CharacterFromID("Wench3"));

			LAi_SetActorType(CharacterFromID("Peter Blowhorn"));
			LAi_ActorSetLayMode(CharacterFromID("Peter Blowhorn"));

			LAi_SetActorType(CharacterFromID("Jakob Nickerson"));
			LAi_ActorSetLayMode(CharacterFromID("Jakob Nickerson"));

			LAi_QuestDelay("shipyard_3A", 1.0);
		break;

		case "shipyard_3A":
			CreateParticleSystemX("cancloud_grey", x1, y1, z1, x1, y1, z1,10);
			CreateParticleSystemX("cancloud_grey", x2, y2, z2, x2, y2, z2,10);
			CreateParticleSystemX("cancloud_grey", x3, y3, z3, x3, y3, z3,10);
			CreateParticleSystemX("cancloud_grey", 0.6, -0.2, 0, 0.6, -0.2, 0,10);//pchar
			CreateParticleSystemX("cancloud_grey", -0.3, -0.2, -0.1, -0.3, -0.2, -0.1,10);//PB
			LAi_QuestDelay("shipyard_4", 2.0);//was 1.0
		break;

		case "shipyard_4":
			ChangeCharacterAddressGroup(CharacterFromID("Jakob Nickerson"), "QC_shipyard2_JRH", "goto", "goto6");
			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_shipyard2_JRH", "goto", "goto3");
			ChangeCharacterAddressGroup(CharacterFromID("Peter Blowhorn"), "QC_shipyard2_JRH", "goto", "goto4");
			DoQuestReloadToLocation("QC_shipyard2_JRH", "goto", "goto1", "shipyard_5");
		break;

		case "shipyard_5":
			string blade5 = GetCharacterEquipByGroup(CharacterFromID("Peter Blowhorn"), BLADE_ITEM_TYPE);
			RemoveCharacterEquip(CharacterFromID("Peter Blowhorn"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(CharacterFromID("Peter Blowhorn"), blade5);

			RemoveCharacterEquip(CharacterFromID("Jakob Nickerson"), BLADE_ITEM_TYPE);

			GiveItem2Character(Pchar, "bladearmchair");//ok
			EquipCharacterByItem(Pchar, "bladearmchair");//ok

			//1:st damage from fallen roof
			Php = LAi_GetCharacterHP(Pchar);
			//int Php3;
			Php3 = Php/3;
			LAi_ApplyCharacterDamage(Pchar, Php3);

			GiveItem2Character(CharacterFromID("Jakob Nickerson"), "bladearmchair");//works ok
			EquipCharacterByItem(CharacterFromID("Jakob Nickerson"), "bladearmchair");//works ok

			PlaySound("PEOPLE\roof_broken2.wav");
			CreateParticleSystemX("cancloud", 0.6, -0.2, 0, 0.6, -0.2, 0,6);//pchar
			CreateParticleSystemX("cancloud_grey", 0.6, -0.2, 0, 0.6, -0.2, 0,10);//pchar
			CreateParticleSystemX("cancloud", -0.3, -0.2, -0.1, -0.3, -0.2, -0.1,6);//PB
			CreateParticleSystemX("cancloud_grey", -0.3, -0.2, -0.1, -0.3, -0.2, -0.1,11);//PB
			CreateParticleSystemX("cancloud_grey", x1, y1, z1, x1, y1, z1,12);
			CreateParticleSystemX("cancloud_grey", x2, y2, z2, x2, y2, z2,13);
			CreateParticleSystemX("cancloud_grey", x3, y3, z3, x3, y3, z3,14);
			CreateParticleSystemX("cancloud", x1, y1, z1, x1, y1, z1,4);
			CreateParticleSystemX("cancloud", x2, y2, z2, x2, y2, z2,3);
			CreateParticleSystemX("cancloud", x3, y3, z3, x3, y3, z3,5);

			LAi_QuestDelay("shipyard_6", 2.5);
		break;

		case "shipyard_6":
			//2:nd damage from fallen roof
			Php = LAi_GetCharacterHP(Pchar);
			int Php2;
			Php2 = Php/2;
			LAi_ApplyCharacterDamage(Pchar, Php2);
			//now 1/4 of HP (on the roof) should remain

			LAi_QuestDelay("shipyard_7", 13.5);
		break;

		case "shipyard_7":
			locations[FindLocation("QC_shipyard2_JRH")].type = "brothel_shop";
			LAi_SetPoorType(Pchar);
			PlaySound("OBJECTS\VOICES\DEAD\male\dead7.wav");

			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("stars_short" , u, v+1, w, 0.0, 0.0, 0.0, sti(20) );

			Pchar.quest.shya_beam = "right";	//middle, left, 		right = start
			Pchar.quest.shya_posAB = "upper_chest";	//pickup_chest, lower_chest	upper_chest = start
			Pchar.quest.shya_posC = "keys_or_push";	//open_or_drill, invisible	keys_or_push = start
			Pchar.quest.shya_posD = "sack";		//basket, chest			sack = start
			Pchar.quest.shya_posE = "blocked";	//wood, chest			blocked = start
			Pchar.quest.shya_posF = "wood";		//chest				wood = start
			Pchar.quest.shya_posJ = "blocked";	//blocked, wood, chest		blocked = start
			Pchar.quest.shya_posK = "blocked";	//blocked, wood, locked, open	blocked = start

			locations[FindLocation(Pchar.location)].box16.items.tool1 = 1;		//J drawer (mast)
			locations[FindLocation(Pchar.location)].box5.items.pistoltar = 1;	//A upper chest
			locations[FindLocation(Pchar.location)].box5.items.key4 = 1;		//A upper chest
			locations[FindLocation(Pchar.location)].box5.items.blade4 = 1;		//A upper chest
			locations[FindLocation(Pchar.location)].box2.items.tool4 = 1;		//B lower chest
			locations[FindLocation(Pchar.location)].box2.items.blade5 = 1;		//B lower chest
			locations[FindLocation(Pchar.location)].box17.items.tool2 = 1;		//C big chest in corner
			locations[FindLocation(Pchar.location)].box16.items.potionrum = 2;	//C big chest in corner
			locations[FindLocation(Pchar.location)].box6.items.tool3 = 1;		//D basket chest
			locations[FindLocation(Pchar.location)].box3.items.key2 = 1;		//E writing desk
			locations[FindLocation(Pchar.location)].box1.items.tool6 = 1;		//F commode by the door
			locations[FindLocation(Pchar.location)].box8.items.key1 = 1;		//S book case
			locations[FindLocation(Pchar.location)].box18.items.tool5 = 1;		//P commode behind beam

			LAi_QuestDelay("shipyard_8", 8.0);
		break;

		case "shipyard_8":
			LAi_SetStayType(Pchar);
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");

			LAi_QuestDelay("shya_phase_1", 1.5);
		break;

		case "shya_phase_1":
			LAi_SetPlayerType(Pchar);

			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladearmchair");
			EquipCharacterByItem(Pchar, "bladeX4");

			PlaySound("PEOPLE\step_stairway.wav");
			PlaySound("PEOPLE\recoil.wav");

			LAi_QuestDelay("shya_take_key1", 0.1);
			LAi_QuestDelay("shya_take_barrel1", 0.1);
			LAi_QuestDelay("shya_take_wood_box1", 0.1);
			LAi_QuestDelay("shya_take_sack_box6", 0.1);
		break;
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
//[2―] from here
		case "fill_shya_boxes":
			pchar.quest.fill_shya_boxes1.win_condition.l1 = "locator";
			pchar.quest.fill_shya_boxes1.win_condition.l1.location = "QC_shipyard2_JRH";
			pchar.quest.fill_shya_boxes1.win_condition.l1.locator_group = "reload";
			pchar.quest.fill_shya_boxes1.win_condition.l1.locator = "locator2";
			pchar.quest.fill_shya_boxes1.win_condition = "fill_shya_boxes1";
		break;

		case "fill_shya_boxes1":
			Pchar.quest.shya_beam = "right";		//middle, left, 		right = start
			Pchar.quest.shya_posAB = "upper_chest";	//pickup_chest, lower_chest	upper_chest = start
			Pchar.quest.shya_posC = "keys_or_push";	//open_or_drill, invisible	keys_or_push = start
			Pchar.quest.shya_posD = "sack";		//basket, chest			sack = start
			Pchar.quest.shya_posE = "blocked";	//wood, chest			blocked = start
			Pchar.quest.shya_posF = "wood";		//chest				wood = start
			Pchar.quest.shya_posJ = "blocked";	//blocked, wood, chest		blocked = start
			Pchar.quest.shya_posK = "blocked";	//blocked, wood, locked, open	blocked = start

			locations[FindLocation(Pchar.location)].box7.items.tool1 = 1;		//J drawer (mast)
			locations[FindLocation(Pchar.location)].box5.items.pistoltar = 1;	//A upper chest
			locations[FindLocation(Pchar.location)].box5.items.key4 = 1;		//A upper chest
			locations[FindLocation(Pchar.location)].box5.items.blade4 = 1;		//A upper chest
			locations[FindLocation(Pchar.location)].box2.items.tool4 = 1;		//B lower chest
			locations[FindLocation(Pchar.location)].box2.items.blade5 = 1;		//B lower chest
			locations[FindLocation(Pchar.location)].box4.items.tool2 = 1;		//C big chest in corner
			locations[FindLocation(Pchar.location)].box7.items.potionrum = 2;	//C big chest in corner
			locations[FindLocation(Pchar.location)].box6.items.tool3 = 1;		//D basket chest
			locations[FindLocation(Pchar.location)].box3.items.key2 = 1;		//E writing desk
			locations[FindLocation(Pchar.location)].box1.items.tool6 = 1;		//F commode by the door
			locations[FindLocation(Pchar.location)].box8.items.key1 = 1;		//S book case
			locations[FindLocation(Pchar.location)].box9.items.tool5 = 1;		//P commode behind beam

			LAi_QuestDelay("shya_take_key1", 0.1);
			LAi_QuestDelay("shya_take_barrel1", 0.1);
			LAi_QuestDelay("shya_take_wood_box1", 0.1);
			LAi_QuestDelay("shya_take_sack_box6", 0.1);
		break;
	//..................................................................................................
		case "push_RtoM":
			//from box11
			DoQuestReloadToLocation("QC_shipyard2_JRH", "goto", "goto8", "push_RtoM_1");
		break;

		case "push_RtoM_1":
			PlaySound("PEOPLE\wood3.wav");
			Pchar.quest.shya_beam = "middle";

			LAi_QuestDelay("shya_radius_check", 0.1);
		break;
	//..................................................................................................
		case "push_MtoR":
			//from box10
			DoQuestReloadToLocation("QC_shipyard2_JRH", "goto", "goto5R", "push_MtoR_1");
		break;

		case "push_MtoR_1":
			PlaySound("PEOPLE\wood3.wav");
			Pchar.quest.shya_beam = "right";

			LAi_QuestDelay("shya_radius_check", 0.1);
		break;
	//..................................................................................................
		case "push_LtoM":
			//from box10
			DoQuestReloadToLocation("QC_shipyard2_JRH", "goto", "goto5", "push_LtoM_1");//was goto5L
		break;

		case "push_LtoM_1":
			PlaySound("PEOPLE\wood3.wav");
			Pchar.quest.shya_beam = "middle";

			LAi_QuestDelay("shya_radius_check", 0.1);
		break;
	//..................................................................................................
		case "push_MtoL":
			//from box9
			DoQuestReloadToLocation("QC_shipyard2_JRH", "goto", "goto10", "push_MtoL_1");
		break;

		case "push_MtoL_1":
			PlaySound("PEOPLE\wood3.wav");
			Pchar.quest.shya_beam = "left";

			LAi_QuestDelay("shya_radius_check", 0.1);
		break;
	//..................................................................................................
		case "shya_delayed_ping":
			PlaySound("INTERFACE\took_item.wav");
		break;

		case "shya_take_key1":
			//only for took item sound
			if(CheckCharacterItem(Pchar,"key1"))
			{
				PlaySound("INTERFACE\took_item.wav");
			}
			else
			{
				LAi_QuestDelay("shya_take_key1", 0.5);//loop check
			}
		break;

		case "shya_take_barrel1":
			//abort barrel1 to enable push the beam R to M		enabled from start

			if(CheckCharacterItem(Pchar,"barrel_big"))
			{
				TakeItemFromCharacter(Pchar, "barrel_big");
				PlaySound("INTERFACE\barrel_roll.wav");
				Pchar.quest.shya_barrel1 = "taken";

				LAi_QuestDelay("shya_radius_check", 0.1);
			}
			else
			{
				LAi_QuestDelay("shya_take_barrel1", 0.5);//loop check
			}
		break;

		case "shya_take_wood_box1":
			//abort wood to enable box1 (F)				enabled from start
			if(CheckCharacterItem(Pchar,"brF13"))
			{
				TakeItemFromCharacter(Pchar, "brF13");
				PlaySound("PEOPLE\wood1.wav");
				Pchar.quest.shya_posF = "chest";

				LAi_QuestDelay("shya_radius_check", 0.1);
			}
			else
			{
				LAi_QuestDelay("shya_take_wood_box1", 0.5);//loop check
			}
		break;

		case "shya_take_hammer":
			//chest1 to enable tool3				from box6
			if(CheckCharacterItem(Pchar,"tool3"))
			{
				if(CheckCharacterItem(Pchar,"pistoltoolchest1"))
				{
					EquipCharacterByItem(Pchar, "tool3");
					Pchar.quest.shya_hammer = "taken";
				}
				else
				{
					Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"You can't carry these tools without a real Carpenter's Chest."));
					PlaySound("OBJECTS\duel\sword_fallen.wav");
					TakeItemFromCharacter(Pchar, "tool3");
					locations[FindLocation(Pchar.location)].box6.items.tool3 = 1;
				}
			}
		break;

		case "shya_take_sack_box6":
			//take sack to enable basket (V)			enabled from start
			if(CheckCharacterItem(Pchar,"sack"))
			{
				TakeItemFromCharacter(Pchar, "sack");
				PlaySound("PEOPLE\step_grass.wav");
				PlaySound("PEOPLE\step_wood.wav");
				Pchar.quest.shya_posD = "basket";

				LAi_QuestDelay("shya_radius_check", 0.1);
				LAi_QuestDelay("shya_take_basket_box6", 0.1);
			}
			else
			{
				LAi_QuestDelay("shya_take_sack_box6", 0.5);//loop check
			}
		break;

		case "shya_take_basket_box6":
			//take basket to enable box6 (D)			from take_sack_box6
			if(CheckCharacterItem(Pchar,"basket"))
			{
				TakeItemFromCharacter(Pchar, "basket");
				PlaySound("PEOPLE\jump.wav");
				PlaySound("PEOPLE\basket.wav");
				Pchar.quest.shya_posD = "chest";

				LAi_QuestDelay("shya_radius_check", 0.1);
			}
			else
			{
				LAi_QuestDelay("shya_take_basket_box6", 0.5);//loop check
			}
		break;

		case "shya_take_heavytool":
			//tool6 to enable wood2 (randitem9)			from box1
			if(CheckCharacterItem(Pchar,"tool6"))
			{
				if(CheckCharacterItem(Pchar,"pistoltoolchest1"))
				{
					EquipCharacterByItem(Pchar, "tool6");
					Pchar.quest.shya_heavytool = "taken";

					LAi_QuestDelay("shya_take_wood_box3", 0.5);
				}
				else
				{
					Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"You can't carry these tools without a real Carpenter's Chest."));
					PlaySound("OBJECTS\duel\sword_fallen.wav");
					TakeItemFromCharacter(Pchar, "tool6");
					locations[FindLocation(Pchar.location)].box1.items.tool6 = 1;
				}
			}
		break;

		case "shya_take_wood_box3":
			//abort wood to enable box3 (E)				from take_heavytool
			if(CheckCharacterItem(Pchar,"brF14R"))
			{
				TakeItemFromCharacter(Pchar, "brF14R");
				PlaySound("PEOPLE\wood2.wav");
				Pchar.quest.shya_posE = "chest";

				LAi_QuestDelay("shya_take_key2", 0.1);
				LAi_QuestDelay("shya_radius_check", 0.1);
			}
			else
			{
				LAi_QuestDelay("shya_take_wood_box3", 0.5);//loop check
			}
		break;

		case "shya_take_key2":
			//only for took item sound
			if(CheckCharacterItem(Pchar,"key2"))
			{
				PlaySound("INTERFACE\took_item.wav");
			}
			else
			{
				LAi_QuestDelay("shya_take_key2", 0.5);//loop check
			}
		break;

		case "shya_take_blade4_box5":
			//							from box5
			if(CheckAttribute(Pchar,"quest.shya_blade4") && Pchar.quest.shya_blade4 == "taken")
			{
				return;
			}
			else
			{
				if(CheckCharacterItem(Pchar,"blade4"))
				{
					Pchar.quest.shya_blade4 = "taken";
					RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
					EquipCharacterByItem(Pchar, "blade4");

					PlaySound("OBJECTS\DUEL\sword_out.wav");
				}
			}
		break;

		case "shya_take_key4_box5":
			//							from box5
			if(CheckCharacterItem(Pchar,"key4"))
			{
				Pchar.quest.shya_key4 = "taken";
				//PlaySound("INTERFACE\took_item.wav");

				LAi_QuestDelay("shya_take_key4_box5A", 1.5);
			}
			else
			{
				LAi_QuestDelay("shya_take_key4_box5", 0.5);//loop check
			}
		break;

		case "shya_take_key4_box5A":
			PlaySound("INTERFACE\took_item.wav");
		break;

		case "shya_take_tar_box5":
			//remove tar to enable carpenter chest pick up		from box5

			LAi_QuestDelay("shya_take_tar_box5A", 1.5);
		break;

		case "shya_take_tar_box5A":
			if(CheckCharacterItem(Pchar,"pistoltar"))
			{
				EquipCharacterByItem(Pchar, "pistoltar");
				LAi_SetStayType(Pchar);
				Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"This tar is really heavy - and I don't need it..."));
				PlaySound("VOICE\ENGLISH\blaze_puh.wav");

				LAi_QuestDelay("shya_take_tar_box5B", 1.5);	//was 2.5
			}
		break;

		case "shya_take_tar_box5B":
			//
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "pistoltar");
			PlaySound("INTERFACE\bucket_water.wav");
			LAi_SetPlayerType(Pchar);
		break;

		case "empty_carpenter_chest":
			//							from box5
			ref lcn = &Locations[FindLocation(pchar.location)];

			if( !CheckAttribute(lcn,"box5.Items.blade4") || lcn.box5.Items.blade4 == 0 )
			{
				if( !CheckAttribute(lcn,"box5.Items.blade5") || lcn.box5.Items.blade5 == 0 )
				{
					if( !CheckAttribute(lcn,"box5.Items.pistoltar") || lcn.box5.Items.pistoltar == 0 )
					{
						ChangeCharacterAddressGroup(Pchar, "QC_shipyard2_JRH", "goto", "goto8");
						Pchar.quest.shya_posAB = "pickup_chest";

						LAi_QuestDelay("shya_radius_check", 0.1);
						LAi_QuestDelay("shya_take_carpenter_chest", 0.1);
					}
				}
			}
		break;

		case "shya_take_carpenter_chest":
			//							from above
			if(CheckCharacterItem(Pchar,"toolchest1"))
			{
				TakeItemFromCharacter(Pchar, "toolchest1");
				GiveItem2Character(Pchar, "pistoltoolchest1");
				EquipCharacterByItem(Pchar, "pistoltoolchest1");

				if(!CheckAttribute(Pchar,"quest.shya_key4") || Pchar.quest.shya_key4 != "taken")
				{
					GiveItem2Character(Pchar, "key4");
					PlaySound("INTERFACE\took_item.wav");
				}

				Pchar.quest.shya_posAB = "lower_chest";

				LAi_QuestDelay("shya_radius_check", 0.1);
			}
			else
			{
				LAi_QuestDelay("shya_take_carpenter_chest", 0.5);//loop check
			}
		break;

		case "shya_take_drill":
			//							from box2
			if(CheckCharacterItem(Pchar,"tool4"))
			{
				EquipCharacterByItem(Pchar, "tool4");
				Pchar.quest.shya_posC = "drill";
				Pchar.quest.shya_drill = "ready";

				LAi_QuestDelay("shya_radius_check", 0.1);
			}
		break;

		case "shya_take_barrel2":
			//abort barrel2 to enable push the beam M to L		from box4
			LAi_SetPlayerType(Pchar);

			if(CheckCharacterItem(Pchar,"barrel_big"))
			{
				TakeItemFromCharacter(Pchar, "barrel_big");
				PlaySound("INTERFACE\barrel_roll.wav");
				Pchar.quest.shya_posC = "keys_or_push";	//reset
				Pchar.quest.shya_barrel2 = "taken";
				ChangeCharacterAddressGroup(Pchar, "QC_shipyard2_JRH", "goto", "goto9");

				LAi_QuestDelay("shya_radius_check", 0.1);
			}
			else
			{
				LAi_QuestDelay("shya_take_barrel2", 0.5);//loop check
			}
		break;

		case "shya_take_saw":
			//							from box9
			if(CheckCharacterItem(Pchar,"tool5"))
			{
				EquipCharacterByItem(Pchar, "tool5");
				Pchar.quest.shya_saw = "taken";

				LAi_QuestDelay("shya_take_derrick", 0.1);
			}
		break;

		case "shya_take_derrick":
			//abort derrick at door					from take_saw

			if(CheckCharacterItem(Pchar,"brderrick"))
			{
				TakeItemFromCharacter(Pchar, "brderrick");
				PlaySound("PEOPLE\derrick_fall.wav");
				ChangeCharacterAddressGroup(Pchar, "QC_shipyard2_JRH", "goto", "out");

				GetCharacterPos(Pchar, &x1, &y1, &z1);
				GetCharacterPos(CharacterFromID("Wench3"), &x2, &y2, &z2);
				CreateParticleSystemX("blast_dirt", x1, y1, z1, x1, y1, z1,10);
				CreateParticleSystemX("blast_dirt", x2, y2, z2, x2, y2, z2,10);

				Pchar.quest.shya_posK = "locked";

				LAi_QuestDelay("shya_radius_check", 0.1);
				LAi_QuestDelay("shipyard_9", 4.0);			//Caroline wakes up
			}
			else
			{
				LAi_QuestDelay("shya_take_derrick", 0.5);//loop check
			}
		break;

		case "shya_take_axe":
			//							from box4
			if(CheckCharacterItem(Pchar,"tool2"))
			{
				EquipCharacterByItem(Pchar, "tool2");
				Pchar.quest.shya_axe = "taken";

				LAi_QuestDelay("shya_take_wood_box7", 0.1);
			}
		break;

		case "shya_take_wood_box7":
			//abort wood to enable mast to fall down (J)		from take_axe
			if(CheckCharacterItem(Pchar,"brF4R"))
			{
				TakeItemFromCharacter(Pchar, "brF4R");
				PlaySound("PEOPLE\wood1.wav");			//was wood2

				LAi_QuestDelay("shya_take_wood_box7_1", 1.0);
			}
			else
			{
				LAi_QuestDelay("shya_take_wood_box7", 0.5);//loop check
			}
		break;

		case "shya_take_wood_box7_1":
			PlaySound("PEOPLE\roof_creak.wav");

			LAi_QuestDelay("shya_take_wood_box7_2", 2.0);
		break;

		case "shya_take_wood_box7_2":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead1.wav");

			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "goto1", "shya_take_wood_box7_3", 3.0);//was 2.0
		break;

		case "shya_take_wood_box7_3":
			Locations[FindLocation("QC_shipyard2_JRH")].models.always.locators = "sh02_l_JRH2";
			DoQuestReloadToLocation("QC_shipyard2_JRH", "goto", "goto1", "shya_take_wood_box7_4");
		break;

		case "shya_take_wood_box7_4":
			PlaySound("PEOPLE\wood3.wav");
			PlaySound("PEOPLE\wood3.wav");
			PlaySound("PEOPLE\wood3.wav");
			PlaySound("OBJECTS\SHIPCHARGE\Cannon_explosion_01.wav");
			PlaySound("OBJECTS\SHIPCHARGE\Cannon_explosion_01.wav");
			PlaySound("OBJECTS\DUEL\sword_fallen.wav");

			CreateParticleSystemX("blast_dirt", -2.1, -1.0, -1.9, -2.1, -1.0, -1.9,10);
			CreateParticleSystemX("blast_dirt", -2.1, -1.0, -0.3, -2.1, -1.0, -0.3,10);
			CreateParticleSystemX("blast_dirt", -2.4, -1.9, 1.4, -2.4, -1.9, 1.4,10);

			LAi_SetPlayerType(Pchar);
			Pchar.quest.shya_posJ = "chest";

			LAi_QuestDelay("shya_radius_check", 0.1);
			LAi_QuestDelay("shya_take_wood_box7_5", 2.0);
		break;

		case "shya_take_wood_box7_5":
			PlaySound("VOICE\ENGLISH\gr_wench3_angry.wav");
		break;

		case "shya_take_compasses":
			//							from box7
			if(CheckCharacterItem(Pchar,"tool1"))
			{
				EquipCharacterByItem(Pchar, "tool1");
				Pchar.quest.shya_compasses = "taken";
				ChangeCharacterAddressGroup(Pchar, "QC_shipyard2_JRH", "goto", "full_chest");

				LAi_QuestDelay("shya_take_compasses1", 1.0);
			}
		break;

		case "shya_take_compasses1":
			//							from box7
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"The Carpenter's Chest is filled up!"));

			PlaySound("AMBIENT\JAIL\jail_door2.wav");
			PlaySound("AMBIENT\JAIL\jail_door2.wav");

			TakeItemFromCharacter(Pchar, "tool2");
			TakeItemFromCharacter(Pchar, "tool3");
			TakeItemFromCharacter(Pchar, "tool4");
			TakeItemFromCharacter(Pchar, "tool5");
			TakeItemFromCharacter(Pchar, "tool6");

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "pistoltoolchest1");
			GiveItem2Character(Pchar, "pistoltoolchest2");
			EquipCharacterByItem(Pchar, "pistoltoolchest2");
		break;
	//..................................................................................................
		case "shya_use_cutlass":
			//PlaySound("PEOPLE\blade_kling.wav");
			PlaySound("PEOPLE\blade_basket.wav");
			Pchar.quest.shya_box6 = "open";

			LAi_QuestDelay("shya_disable_fightmode", 1.5);	//was 0.5
		break;

		case "shya_use_dagger":
			PlaySound("PEOPLE\knife_closet.wav");
			Pchar.quest.shya_box9 = "open";

			LAi_QuestDelay("shya_disable_fightmode", 1.0);
		break;

		case "shya_use_hammer":
			PlaySound("PEOPLE\chopchop.wav");
			Pchar.quest.shya_box2 = "open";

			LAi_QuestDelay("shya_disable_fightmode", 1.5);
		break;

		case "shya_use_drill":
			PlaySound("PEOPLE\drill_water.wav");

			LAi_QuestDelay("shya_disable_fightmode", 2.5);
			LAi_QuestDelay("shya_use_drill1", 3.5);
		break;

		case "shya_use_drill1":
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("shya_take_barrel2", 3.0);
		break;

		case "shya_use_lever":
			PlaySound("OBJECTS\DUEL\man_attack1.wav");

			LAi_QuestDelay("shya_use_lever1", 0.5);
		break;

		case "shya_use_lever1":
			PlaySound("PEOPLE\creak.wav");
			PlaySound("PEOPLE\wood1.wav");

			Pchar.quest.shya_posE = "wood";

			LAi_QuestDelay("shya_radius_check", 0.1);
			LAi_QuestDelay("shya_disable_fightmode", 1.0);
		break;

		case "shya_use_saw":
			PlaySound("PEOPLE\saw_creak.wav");

			LAi_QuestDelay("shya_disable_fightmode", 2.5);
			LAi_QuestDelay("shya_use_saw1", 3.5);
		break;

		case "shya_use_saw1":
			ChangeCharacterAddressGroup(Pchar, "QC_shipyard2_JRH", "goto", "out");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("shya_use_saw2", 2.0);
		break;

		case "shya_use_saw2":
			LAi_SetPlayerType(Pchar);

			Pchar.quest.shya_posK = "wood";

			LAi_QuestDelay("shya_radius_check", 0.1);
		break;

		case "shya_use_axe":
			PlaySound("PEOPLE\axe_creak.wav");

			LAi_QuestDelay("shya_disable_fightmode", 2.5);
			LAi_QuestDelay("shya_use_axe1", 3.5);
		break;

		case "shya_use_axe1":
			ChangeCharacterAddressGroup(Pchar, "QC_shipyard2_JRH", "goto", "axe");

			Pchar.quest.shya_posJ = "wood";

			LAi_QuestDelay("shya_radius_check", 0.1);
		break;

		case "shya_use_compasses":
			PlaySound("PEOPLE\lockpick.wav");

			LAi_QuestDelay("shya_disable_fightmode", 3.0);
			LAi_QuestDelay("shya_use_compasses1", 3.0);
		break;

		case "shya_use_compasses1":
			PlaySound("OBJECTS\DUEL\man_attack6.wav");

			LAi_QuestDelay("shya_use_compasses2", 1.0);
		break;

		case "shya_use_compasses2":
			ChangeCharacterAddressGroup(Pchar, "QC_shipyard2_JRH", "goto", "out");
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "tool1");
			EquipCharacterByItem(Pchar, "blade4");
			LAi_SetStayType(Pchar);

			Pchar.quest.shya_posK = "open";

			LAi_QuestDelay("shya_radius_check", 0.1);
			LAi_QuestDelay("shipyard_23", 1.0);
		break;

		case "shya_disable_fightmode":
			if(LAi_IsFightMode(Pchar))
			{
				LAi_SetPlayerType(Pchar);
				LAi_SetFightMode(PChar, false);
				LAi_LocationFightDisable(&Locations[FindLocation(pchar.location)], true);
			}
		break;
	//..................................................................................................
		case "shya_radius_check":
			if(CheckAttribute(Pchar,"quest.shya_beam"))
			{
				if(Pchar.quest.shya_beam == "right")
				{
					if(Pchar.quest.shya_posC == "open")
					{
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box4", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box17", 1.2);

						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box12", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box13", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box14", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box10", 0.1);
					}

					if(Pchar.quest.shya_posC == "drill")
					{
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box4", 1.2);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box17", 0.1);

						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box12", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box13", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box14", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box10", 0.1);
					}

					if(Pchar.quest.shya_posC == "keys_or_push")
					{
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box4", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box17", 0.1);

						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box12", 0.9);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box13", 0.1);

						if(CheckAttribute(Pchar,"quest.shya_barrel1") && Pchar.quest.shya_barrel1 == "taken")
						{
							SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box14", 0.8);
						}
						else SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box14", 0.6);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box10", 0.1);
					}

					if(Pchar.quest.shya_posC == "invisible")
					{
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box4", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box17", 0.1);

						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box12", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box13", 0.1);

						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box14", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box10", 0.1);
					}

					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box9", 0.1);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box18", 0.1);

					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box11", 1.0);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box5", 0.1);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem7", 0.2);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box2", 0.1);
				}

				if(Pchar.quest.shya_beam == "middle")
				{
					if(Pchar.quest.shya_posC == "open")
					{
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box4", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box17", 1.2);

						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box12", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box13", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box14", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box10", 0.1);
					}

					if(Pchar.quest.shya_posC == "drill")
					{
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box4", 1.2);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box17", 0.1);

						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box12", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box13", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box14", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box10", 0.1);
					}

					if(Pchar.quest.shya_posC == "keys_or_push")
					{
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box4", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box17", 0.1);

						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box12", 0.9);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box13", 0.1);

						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box14", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box10", 0.8);
					}

					if(Pchar.quest.shya_posC == "invisible")
					{
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box4", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box17", 0.1);

						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box12", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box13", 0.1);

						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box14", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box10", 0.1);
					}

					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box9", 0.8);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box18", 0.1);

					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box11", 0.1);
					if(CheckAttribute(Pchar,"quest.shya_posAB"))
					{
						if(Pchar.quest.shya_posAB == "upper_chest")
						{
							SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box5", 0.8);
							SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem7", 0.2);
							SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box2", 0.2);
						}

						if(Pchar.quest.shya_posAB == "pickup_chest")
						{
							SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box5", 0.2);
							SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem7", 1.0);//was 1.0
							SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box2", 0.2);
						}

						if(Pchar.quest.shya_posAB == "lower_chest")
						{
							SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box5", 0.2);
							SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem7", 0.2);
							SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box2", 0.8);
						}
					}
				}

				if(Pchar.quest.shya_beam == "left")
				{
					if(Pchar.quest.shya_posC == "open")
					{
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box4", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box17", 1.2);

						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box12", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box13", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box14", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box10", 0.1);
					}

					if(Pchar.quest.shya_posC == "drill")
					{
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box4", 1.2);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box17", 0.1);

						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box12", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box13", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box14", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box10", 0.1);
					}

					if(Pchar.quest.shya_posC == "keys_or_push")
					{
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box4", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box17", 0.1);

						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box12", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box13", 0.9);

						if(CheckAttribute(Pchar,"quest.shya_barrel1") && Pchar.quest.shya_barrel1 == "taken")
						{
							SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box14", 0.8);
						}
						else SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box14", 0.6);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box10", 0.1);
					}

					if(Pchar.quest.shya_posC == "invisible")
					{
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box4", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box17", 0.1);

						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box12", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box13", 0.1);

						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box14", 0.1);
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box10", 0.1);
					}

					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box9", 0.1);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box18", 0.8);

					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box11", 0.1);
					if(CheckAttribute(Pchar,"quest.shya_posAB"))
					{
						if(Pchar.quest.shya_posAB == "upper_chest")
						{
							SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box5", 0.8);
							SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem7", 0.2);
							SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box2", 0.2);
						}

						if(Pchar.quest.shya_posAB == "pickup_chest")
						{
							SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box5", 0.2);
							SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem7", 1.0);//was 1.0
							SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box2", 0.2);
						}

						if(Pchar.quest.shya_posAB == "lower_chest")
						{
							SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box5", 0.2);
							SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem7", 0.2);
							SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box2", 0.8);
						}
					}
				}
			}

			if(CheckAttribute(Pchar,"quest.shya_posD"))
			{
				if(Pchar.quest.shya_posD == "sack")
				{
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem24", 1.2);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem25", 0.1);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box6", 0.1);
				}

				if(Pchar.quest.shya_posD == "basket")
				{
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem24", 0.1);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem25", 2.0);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box6", 0.1);
				}

				if(Pchar.quest.shya_posD == "chest")
				{
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem24", 0.1);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem25", 0.1);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box6", 1.2);
				}
			}

			if(CheckAttribute(Pchar,"quest.shya_posE"))
			{
				if(Pchar.quest.shya_posE == "blocked")
				{
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem9", 0.1);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box3", 0.1);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box19", 1.0);
				}

				if(Pchar.quest.shya_posE == "wood")
				{
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem9", 1.0);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box3", 0.1);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box19", 0.1);
				}

				if(Pchar.quest.shya_posE == "chest")
				{
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem9", 0.1);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box3", 1.0);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box19", 0.1);
				}
			}

			if(CheckAttribute(Pchar,"quest.shya_posF"))
			{
				if(Pchar.quest.shya_posF == "wood")
				{
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem13", 1.0);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box1", 0.2);
				}

				if(Pchar.quest.shya_posF == "chest")
				{
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem13", 0.1);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box1", 1.2);
				}
			}

			if(CheckAttribute(Pchar,"quest.shya_posJ"))
			{
				if(Pchar.quest.shya_posJ == "blocked")
				{
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem17", 0.1);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box7", 1.0);
				}

				if(Pchar.quest.shya_posJ == "wood")
				{
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem17", 1.5);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box7", 0.1);
				}

				if(Pchar.quest.shya_posJ == "chest")
				{
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem17", 0.1);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box7", 0.5);
				}
			}

			if(CheckAttribute(Pchar,"quest.shya_posK"))
			{
				if(Pchar.quest.shya_posK == "blocked")
				{
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box15", 1.0);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem6", 0.001);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "locator2", 0.001);
				}

				if(Pchar.quest.shya_posK == "wood")
				{
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box15", 0.001);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem6", 3.0);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "locator2", 0.001);
				}

				if(Pchar.quest.shya_posK == "locked")
				{
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box15", 1.0);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem6", 0.001);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "locator2", 0.001);
				}

				if(Pchar.quest.shya_posK == "open")
				{
					Locations[FindLocation("QC_shipyard2_JRH")].reload.l1.disable = 0;
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box15", 0.001);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem6", 0.001);
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "locator2", 1.0);
				}
			}

			if(CheckAttribute(Pchar,"quest.shya_barrel1") && Pchar.quest.shya_barrel1 == "taken")
			{
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem21", 0.1);
				//to see better + avoid ev interfence boxes
			}

			if(CheckAttribute(Pchar,"quest.shya_drill") && Pchar.quest.shya_drill == "done")
			{
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem20", 1.5);
			}

			if(CheckAttribute(Pchar,"quest.shya_barrel2") && Pchar.quest.shya_barrel2 == "taken")
			{
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem20", 0.1);
				//to see better + avoid ev interfence boxes
			}
		break;
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
		case "shipyard_9":
			//Caroline wakes up
			LAi_SetStayType(Pchar);
			LAi_SetStunnedType(CharacterFromID("Wench3"));
			PlaySound("OBJECTS\VOICES\DEAD\female\dead_wom2.wav");
			GetCharacterPos(CharacterFromID("Wench3"), &u, &v, &w);
			CreateParticleSystem("stars_short" , u, v+1, w, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("shipyard_10", 2.0);//was 8.0 to Car follow
		break;

		case "shipyard_10":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto3");
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");

			LAi_QuestDelay("shipyard_11", 1.0);//was 2 + 4(next)
		break;

		case "shipyard_11":
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("shipyard_12", 5.0);
		break;

		case "shipyard_12":
			LAi_SetActorType(CharacterFromID("Wench3"));
			LAi_ActorFollow(characterFromID("Wench3"), pchar, "", 4.0);

			LAi_QuestDelay("shipyard_13", 0.5);
		break;

		case "shipyard_13":
			LAi_SetActorType(CharacterFromID("Wench3"));
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 0.5, 0.5);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
			Characters[GetCharacterIndex("Wench3")].dialog.CurrentNode  = "shipyard_talk";
		break;

		case "shipyard_14":
			//from Caroline K dialog
			LAi_SetPlayerType(Pchar);
			PlaySound("VOICE\ENGLISH\blaze_hah.wav");

			pchar.quest.shipyard_15.win_condition.l1 = "locator";
			pchar.quest.shipyard_15.win_condition.l1.location = "QC_shipyard2_JRH";
			pchar.quest.shipyard_15.win_condition.l1.locator_group = "goto";
			pchar.quest.shipyard_15.win_condition.l1.locator = "goto6";
			pchar.quest.shipyard_15.win_condition = "shipyard_15";
		break;

		case "shipyard_15":
			LAi_SetStayType(Pchar);
			SetModel(PChar, "Pira4M", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			PlaySound("PEOPLE\clothes1.wav");

			SetModel(characterFromID("Jakob Nickerson"), "Nickerson_poor", "man", "man", 1.8, true);
			SetModel(characterFromID("Wench3"), "Caroline_K", "woman", "woman", 1.75, true);

			LAi_QuestDelay("shipyard_15A", 2.0);
		break;

		case "shipyard_15A":
			LAi_SetPlayerType(Pchar);
			GiveItem2Character(Pchar, "key3");
			PlaySound("INTERFACE\took_item.wav");
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"I found a big key in one of his pockets!"));

			LAi_QuestDelay("shipyard_16", 1.0);
		break;

		case "shipyard_16":
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 0.5, 0.5);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
			Characters[GetCharacterIndex("Wench3")].dialog.CurrentNode  = "shipyard_more_talk";
		break;

		case "carpenter_tools_C":
			if(CheckCharacterItem(Pchar,"tool2"))
			{
				LAi_QuestDelay("shipyard_19", 0.1);//continues here...
			}
			else
			{
				LAi_QuestDelay("carpenter_tools_C", 0.5);//loop check
			}
		break;

		case "shipyard_19":
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 0.5, 0.5);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
			Characters[GetCharacterIndex("Wench3")].dialog.CurrentNode  = "shipyard_more_talk_3";
		break;

		case "shipyard_20":
			//from Caroline K dialog
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_shipyard2_JRH", "goto", "goto3");
		break;

		case "shipyard_23":
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 0.5, 0.5);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
			Characters[GetCharacterIndex("Wench3")].dialog.CurrentNode  = "shipyard_more_talk_4";
		break;
//..............................................................................................................
		case "QC_gate_1":
			//from Caroline dialog
			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("QC_town")].image = "Town_QC_Town.tga";

			Pchar.quest.JRH_sky = "";		//reset
			SetCurrentTime(23.00, 0);
			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Clear";

			pchar.quest.QC_gate_2.win_condition.l1 = "locator";
			pchar.quest.QC_gate_2.win_condition.l1.location = "QC_town";
			pchar.quest.QC_gate_2.win_condition.l1.locator_group = "goto";
			pchar.quest.QC_gate_2.win_condition.l1.locator = "goto80";
			pchar.quest.QC_gate_2.win_condition = "QC_gate_2";
		break;

		case "QC_gate_2":
			Pchar.quest.wr_quest1 = "off";
			ChangeCharacterAddressGroup(characterFromID("Wench1"), "QC_Brothel", "goto", "goto2");
			ChangeCharacterAddressGroup(characterFromID("Wench2"), "QC_Brothel", "goto", "goto5");
			ChangeCharacterAddressGroup(characterFromID("Wench4"), "QC_Brothel", "goto", "goto21");
			LAi_SetWaitressType(characterFromID("Wench1"));
			LAi_SetWaitressType(characterFromID("Wench2"));
			LAi_SetWaitressType(characterFromID("Wench4"));

			SetModel(characterFromID("Peter Blowhorn"), "Blowhorn_monk", "man", "man", 1.8, true);
			ChangeCharacterAddressGroup(characterFromID("Peter Blowhorn"), "QC_store", "sit", "sit1");
			LAi_SetStayType(characterFromID("Peter Blowhorn"));

			SetModel(characterFromID("Jakob Nickerson"), "Nickerson_poor", "man", "man", 1.8, true);
			ChangeCharacterAddressGroup(characterFromID("Jakob Nickerson"), "QC_shipyard", "sit", "sit3");
			LAi_SetHuberType(characterFromID("Jakob Nickerson"));
			RemoveCharacterEquip(CharacterFromID("Jakob Nickerson"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(CharacterFromID("Jakob Nickerson"), "bladearmchair");

			Locations[FindLocation("QC_town")].reload.l1.disable = 1;//closed

		AddMoneyToCharacter(characterFromID("Wench3"), 5);
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "QC_town", "reload", "reload4");
			LAi_SetOfficerType(characterFromID("Wench3"));
			PlaySound("INTERFACE\closed_locked_door.wav");

			LAi_SetActorType(CharacterFromID("CoastBrother22"));
			LAi_ActorAttack(CharacterFromID("CoastBrother22"), Pchar, "");
			LAi_SetPlayerType(characterFromID("CoastBrother1"));
			if(!LAi_IsFightMode(characterFromID("CoastBrother1")) ) LAi_SetFightMode(characterFromID("CoastBrother1"), true);

			pchar.quest.QC_gate_3.win_condition.l1 = "locator";
			pchar.quest.QC_gate_3.win_condition.l1.location = "QC_town";
			pchar.quest.QC_gate_3.win_condition.l1.locator_group = "reload";
			pchar.quest.QC_gate_3.win_condition.l1.locator = "reload1";
			pchar.quest.QC_gate_3.win_condition = "QC_gate_3";
		break;

		case "QC_gate_3":
			PlaySound("INTERFACE\knock.wav");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("QC_gate_4", 0.5);//was 1.0
		break;

		case "QC_gate_4":
			LAi_SetPlayerType(Pchar);

			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToCharacter(characterFromID("Wench3"), PChar);
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));

			Characters[GetCharacterIndex("Wench3")].dialog.CurrentNode  = "QC_gate_talk_1";
		break;

		case "QC_gate_5":
			//from Caroline K dialog
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto84");

			PlaySound("VOICE\ENGLISH\gr_wench3_mhm.wav");
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorRunToLocator(characterFromID("Wench3"), "goto", "goto81", "", "");
			LAi_QuestDelay("QC_gate_6", 2.0);
		break;

		case "QC_gate_6":
			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_town", "goto", "goto84");
			PlaySound("AMBIENT\CHURCH\bench1.wav");
			LAi_QuestDelay("QC_gate_7", 0.7);//all steps were 1.0
		break;

		case "QC_gate_7":
			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_town", "goto", "goto85");
			PlaySound("AMBIENT\CHURCH\bench1.wav");
			LAi_QuestDelay("QC_gate_8", 0.7);
		break;

		case "QC_gate_8":
			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_town", "goto", "goto86");
			PlaySound("AMBIENT\CHURCH\bench1.wav");
			LAi_QuestDelay("QC_gate_9", 0.7);
		break;

		case "QC_gate_9":
			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_town", "goto", "goto87");
			PlaySound("AMBIENT\CHURCH\bench1.wav");
			LAi_QuestDelay("QC_gate_10", 0.7);
		break;

		case "QC_gate_10":
			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_town", "goto", "goto82");
			PlaySound("PEOPLE\step_stairway.wav");
			LAi_QuestDelay("QC_gate_11", 1.0);
		break;

		case "QC_gate_11":
			PlaySound("VOICE\ENGLISH\gr_wench3_aye.wav");
			LAi_SetPlayerType(Pchar);

			pchar.quest.QC_gate_11.win_condition.l1 = "locator";
			pchar.quest.QC_gate_11.win_condition.l1.location = "QC_town";
			pchar.quest.QC_gate_11.win_condition.l1.locator_group = "goto";
			pchar.quest.QC_gate_11.win_condition.l1.locator = "goto81";
			pchar.quest.QC_gate_11.win_condition = "QC_gate_12";
		break;

		case "QC_gate_12":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto84");
			LAi_QuestDelay("QC_gate_13", 1.0);
		break;

		case "QC_gate_13":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "goto84");
			PlaySound("AMBIENT\CHURCH\bench1.wav");
			LAi_QuestDelay("QC_gate_14", 0.5);//all steps were 1.0
		break;

		case "QC_gate_14":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "goto85");
			PlaySound("AMBIENT\CHURCH\bench1.wav");
			LAi_QuestDelay("QC_gate_15", 0.5);
		break;

		case "QC_gate_15":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "goto86");
			PlaySound("AMBIENT\CHURCH\bench1.wav");
			LAi_QuestDelay("QC_gate_16", 0.5);
			LAi_QuestDelay("QC_gate_17", 0.5);
		break;

		case "QC_gate_16":
			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_town", "goto", "goto83");
			PlaySound("PEOPLE\run_wood.wav");
		break;

		case "QC_gate_17":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "goto87");
			PlaySound("AMBIENT\CHURCH\bench1.wav");
			LAi_QuestDelay("QC_gate_18", 0.5);
		break;

		case "QC_gate_18":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "goto82");
			PlaySound("PEOPLE\step_stairway.wav");
			LAi_QuestDelay("QC_gate_19", 0.5);
		break;

		case "QC_gate_19":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto83");
			LAi_QuestDelay("QC_gate_20", 0.5);
		break;

		case "QC_gate_20":
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToCharacter(characterFromID("Wench3"), PChar);
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));

			Characters[GetCharacterIndex("Wench3")].dialog.CurrentNode  = "QC_gate_talk_2";
		break;

		case "QC_gate_21":
			//from Caroline K dialog
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToLocator(characterFromID("Wench3"), "goto", "goto88");
			LAi_SetPlayerType(Pchar);
			LAi_QuestDelay("QC_gate_22", 1.0);
		break;

		case "QC_gate_22":
			PlaySound("AMBIENT\TAVERN\open_bottle.wav");
			LAi_QuestDelay("QC_gate_23", 1.0);
		break;

		case "QC_gate_23":
			PlaySound("PEOPLE\grass_noise.wav");
			LAi_QuestDelay("QC_gate_24", 1.0);
		break;

		case "QC_gate_24":
			PlaySound("objects\duel\reload1.wav");
			LAi_QuestDelay("QC_gate_25", 1.0);//was 0.5
		break;
//.......................................................................................................
	//main line Caroline & mistress
		case "QC_gate_25":
			PlaySound("VOICE\ENGLISH\gr_mistress2.wav");
			ChangeCharacterAddressGroup(CharacterFromID("mistress"), "QC_town", "goto", "goto6");
			LAi_SetActorType(characterFromID("Mistress"));
			LAi_ActorRunToLocator(characterFromID("Mistress"), "goto", "goto81", "", "");

			LAi_QuestDelay("QC_gate_26", 1.0);
		break;

		case "QC_gate_26":
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToCharacter(characterFromID("Wench3"), CharacterFromID("mistress"));
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("CoastBrother22"));

			LAi_QuestDelay("QC_gate_27", 2.0);//was 3.0 (5.5 to 28 tot)
		break;

		case "QC_gate_27":
			LAi_SetPlayerType(Pchar);

			PlaySound("VOICE\ENGLISH\alarm1.wav");
			LAi_QuestDelay("QC_gate_bigshot", 1.0);
			LAi_QuestDelay("QC_gate_grapeshot", 2.0);
			LAi_QuestDelay("QC_gate_28", 4.5);//was 2.5 to 28, 3.5 is better
		break;

		case "QC_gate_28":
			ChangeCharacterAddressGroup(CharacterFromID("mistress"), "QC_town", "goto", "goto84");
			PlaySound("AMBIENT\CHURCH\bench1.wav");

			LAi_QuestDelay("QC_gate_29", 1.0);
		break;

		case "QC_gate_29":
			ChangeCharacterAddressGroup(CharacterFromID("mistress"), "QC_town", "goto", "goto85");
			PlaySound("AMBIENT\CHURCH\bench1.wav");
			LAi_QuestDelay("QC_gate_30", 1.0);
		break;

		case "QC_gate_30":
			ChangeCharacterAddressGroup(CharacterFromID("mistress"), "QC_town", "goto", "goto86");
			PlaySound("AMBIENT\CHURCH\bench1.wav");
			PlaySound("VOICE\ENGLISH\gr_mistress_laugh.wav");

			LAi_QuestDelay("QC_gate_31", 1.0);
		break;

		case "QC_gate_31":
			ChangeCharacterAddressGroup(CharacterFromID("mistress"), "QC_town", "goto", "goto87");
			PlaySound("AMBIENT\CHURCH\bench1.wav");

			PlaySound("VOICE\ENGLISH\gr_wench3_oh.wav");
			LAi_SetActorType(CharacterFromID("Wench3"));
			LAi_ActorAttack(CharacterFromID("Wench3"), CharacterFromID("Mistress"), "");

			LAi_QuestDelay("QC_gate_31A", 0.5);
		break;

		case "QC_gate_31A":
			GetCharacterPos(CharacterFromID("Wench3"), &u, &v, &w);
			CreateParticleSystem("gunfire" , u-0.4, v+1.2, w, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("OBJECTS\duel\pistol_pocket.wav");

			LAi_QuestDelay("QC_gate_32", 0.5);
		break;

		case "QC_gate_32":
			GetCharacterPos(CharacterFromID("Wench3"), &u, &v, &w);
			CreateParticleSystem("gunfire" , u-0.4, v+1.2, w, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("OBJECTS\duel\pistol_pocket.wav");

			ChangeCharacterAddressGroup(CharacterFromID("mistress"), "QC_town", "goto", "goto82");
			PlaySound("PEOPLE\step_stairway.wav");

			LAi_QuestDelay("QC_gate_32A", 0.5);
		break;

		case "QC_gate_32A":
			PlaySound("OBJECTS\VOICES\DEAD\female\dead_wom1.wav");
			ChangeCharacterAddressGroup(CharacterFromID("mistress"), "none", "", "");
			LAi_QuestDelay("QC_gate_33", 1.0);
		break;

		case "QC_gate_33":
			PlaySound("PEOPLE\wood2.wav");
			LAi_QuestDelay("QC_gate_34", 0.5);
		break;

		case "QC_gate_34":
			PlaySound("PEOPLE\jump.wav");
			PlaySound("PEOPLE\jump_roof.wav");
			PlaySound("PEOPLE\wood3.wav");

			LAi_QuestDelay("QC_gate_CB_run", 0.01);//starts CB runners
		break;

		case "QC_gate_35":
			//from QC_gate_CB_run_4

			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToCharacter(characterFromID("Wench3"), PChar);
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));

			Characters[GetCharacterIndex("Wench3")].dialog.CurrentNode  = "QC_gate_talk_3";
		break;

		case "QC_gate_36":
			//from Caroline K dialog
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToLocator(characterFromID("Wench3"), "goto", "goto89");
			LAi_QuestDelay("QC_gate_37", 0.5);
		break;

		case "QC_gate_37":
			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_town", "goto", "goto89");
			PlaySound("PEOPLE\jump_counter.wav");
			LAi_QuestDelay("QC_gate_38", 0.5);
		break;

		case "QC_gate_38":
			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_town", "goto", "goto90");
			PlaySound("PEOPLE\jump.wav");
			LAi_QuestDelay("QC_gate_39", 0.5);
			LAi_QuestDelay("QC_gate_40", 0.5);
		break;

		case "QC_gate_39":
			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "none", "", "");
		break;

		case "QC_gate_40":
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			EquipCharacterByItem(Pchar, "blade4");
			LAi_QuestDelay("QC_gate_42", 1.0);
			LAi_QuestDelay("QC_gate_CB21", 1.0);//starts CB21 attack
		break;

		case "QC_gate_42":
			LAi_SetPlayerType(Pchar);

			pchar.quest.QC_gate_45.win_condition.l1 = "NPC_Death";
			pchar.quest.QC_gate_45.win_condition.l1.character = "CoastBrother21";
			pchar.quest.QC_gate_45.win_condition = "QC_gate_45";
		break;

		case "QC_gate_45":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto64");

			PlaySound("OBJECTS\DUEL\skeleton_attack1.wav");

			LAi_QuestDelay("QC_gate_bigshot", 1.5);//was 1.0
			LAi_QuestDelay("QC_gate_grapeshot", 2.5);//was 2.0
			LAi_QuestDelay("QC_gate_46", 3.5);//was 3.0
		break;

		case "QC_gate_46":
			PauseAllSounds();
			PlaySound("OBJECTS\SHIPCHARGE\LG42H.wav");
			PlaySound("OBJECTS\SHIPCHARGE\gunpowder_explosion.wav");

			GetCharacterPos(Pchar, &u, &v, &w);

			CreateParticleSystem("fort_fire" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("fort_fire" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("fort_fire" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("fort_fire" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("fort_fire" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

			CreateParticleSystem("canfire" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("canfire" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("canfire" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("canfire" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("canfire" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

			CreateParticleSystem("gunfire_red" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("gunfire_red" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("gunfire_red" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("gunfire_red" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("gunfire_red" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

			CreateParticleSystem("stars_fire" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("stars_fire" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("stars_fire" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("stars_fire" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("stars_fire" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

			CreateParticleSystem("cancloud" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("cancloud" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("cancloud" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("cancloud" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("cancloud" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

			CreateParticleSystem("splinters", u, v+1.8, W, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", u-0.5, v+1.0, W, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", u, v+1.8, w, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", u-0.5, v+1.0, w, 0.0, 0.0, 0.0, 0);

			SetModel(PChar, "Pira4B", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			Php = LAi_GetCharacterHP(Pchar);
			Php2 = Php/2;
			LAi_ApplyCharacterDamage(Pchar, Php2);

			TakeNItems(pchar,"potionrum", -2);
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "pistoltoolchest2");
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "blade4");
			TakeItemFromCharacter(Pchar, "blade5");
			EquipCharacterByItem(Pchar, "bladeX4");

			//int gold;
			gold = GetCharacterMoney(Pchar);
			AddMoneyToCharacter(Pchar,-gold);

			LAi_QuestDelay("QC_gate_46A", 0.5);
		break;

		case "QC_gate_46A":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "goto92");
			LAi_SetSitType(Pchar);

			LAi_QuestDelay("QC_gate_47", 0.2);//was 0.2
		break;

		case "QC_gate_47":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "goto93");
			LAi_QuestDelay("QC_gate_48", 0.4);//was 0.4
		break;

		case "QC_gate_48":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "goto96");
			LAi_QuestDelay("QC_gate_49", 0.8);
		break;

		case "QC_gate_49":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead6.wav");

			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "goto93");
			LAi_QuestDelay("QC_gate_50", 0.4);
		break;

		case "QC_gate_50":
			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "goto94");
			LAi_QuestDelay("QC_gate_51", 0.2);
		break;

		case "QC_gate_51":
			Locations[FindLocation("QC_town_exit")].image = "";
			Locations[FindLocation("QC_town_exit")].models.always.locators = "QCexit_l_JRH";
			Locations[FindLocation("QC_town_exit")].models.always.exit = "QCexit_JRH";
			Locations[FindLocation("QC_town_exit")].reload.l1.disable = 1;

			DoQuestReloadToLocation("QC_town_exit", "goto", "goto15", "QC_gate_52");
		break;

		case "QC_gate_52":
			Locations[FindLocation("QC_town_exit")].image = "Town_QC_Exit.tga";
			locations[FindLocation("QC_town_exit")].type = "silent_jungle";
			LAi_QuestDelay("QC_gate_53", 0.5);
		break;

		case "QC_gate_53":
			locations[FindLocation("QC_town")].type = "town";//resets sound & music in town

			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystemX("blast_dirt", u, v, w, u, v, w,10);
			CreateParticleSystemX("blast_dirt", u-0.5, v, w, u, v, w,10);

			PlaySound("OBJECTS\VOICES\body_fallen1.wav");
			PlaySound("PEOPLE\jump.wav");

			Play3DSoundComplex("objects\shipcharge\ship_onfire.wav", -1.8, 0, -28.3, true, false);//looped sound

			LAi_SetActorType(Pchar);
			LAi_ActorSetLayMode(Pchar);

			Php = LAi_GetCharacterHP(Pchar);
			Php2 = Php/2;
			LAi_ApplyCharacterDamage(Pchar, Php2);
			TakenItems(Pchar, "potionrum", -100);

			LAi_QuestDelay("QC_outside_gate", 4.0);
		break;
//------------------------------------------------------------------------------------------------------------------
//.......................................................................................................
	//CB:s shoot from store roof
		case "QC_gate_bigshot":
			GetCharacterPos(CharacterFromID("CoastBrother22"), &u, &v, &w);
			CreateParticleSystem("gunfire" , u+0.4, v+1.2, w-0.1, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("OBJECTS\duel\pistol_big.wav");
			LAi_QuestDelay("QC_gate_bigshot_miss", 0.5);
		break;

		case "QC_gate_bigshot_miss":
			PlaySound("OBJECTS\duel\bullet_miss2.wav");
		break;

		case "QC_gate_grapeshot":
			GetCharacterPos(CharacterFromID("CoastBrother1"), &u, &v, &w);
			CreateParticleSystem("gunfire" , u+0.4, v+1.2, w-0.1, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("OBJECTS\duel\pistol_grape.wav");
			LAi_QuestDelay("QC_gate_grapeshot_miss", 0.5);
		break;

		case "QC_gate_grapeshot_miss":
			PlaySound("OBJECTS\duel\bullet_miss1.wav");
		break;
//.......................................................................................................
	//CB runners from store
		case "QC_gate_CB_run":
			PlaySound("AMBIENT\c_brothers_long.wav");

			LAi_SetActorType(CharacterFromID("CoastBrother21"));
			LAi_SetActorType(CharacterFromID("CoastBrother2"));
			LAi_SetActorType(CharacterFromID("CoastBrother3"));
			LAi_SetActorType(CharacterFromID("CoastBrother4"));
			LAi_SetActorType(CharacterFromID("CoastBrother5"));
			LAi_SetActorType(CharacterFromID("CoastBrother6"));
			LAi_SetActorType(CharacterFromID("CoastBrother7"));
			LAi_SetActorType(CharacterFromID("CoastBrother8"));

			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother21"), "QC_town", "reload", "reload5");
			LAi_QuestDelay("QC_gate_CB_run_21", 1.0);
		break;

		case "QC_gate_CB_run_21":
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother2"), "QC_town", "reload", "reload5");
			LAi_QuestDelay("QC_gate_CB_run_2", 1.0);

			LAi_ActorRunToLocator(characterFromID("CoastBrother21"), "goto", "goto81", "", "");
		break;

		case "QC_gate_CB_run_2":
			LAi_QuestDelay("QC_gate_grapeshot", 0.01);

			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother3"), "QC_town", "reload", "reload5");
			LAi_QuestDelay("QC_gate_CB_run_3", 1.0);

			LAi_ActorRunToLocator(characterFromID("CoastBrother2"), "goto", "goto81", "", "");
			LAi_QuestDelay("QC_gate_CB2", 6.0);
		break;

		case "QC_gate_CB_run_3":
			LAi_QuestDelay("QC_gate_bigshot", 0.01);

			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother4"), "QC_town", "reload", "reload5");
			LAi_QuestDelay("QC_gate_CB_run_4", 1.0);

			LAi_ActorRunToLocator(characterFromID("CoastBrother3"), "goto", "goto81", "", "");
			LAi_QuestDelay("QC_gate_CB3", 6.0);
		break;

		case "QC_gate_CB_run_4":
			LAi_QuestDelay("QC_gate_35", 0.01);

			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother5"), "QC_town", "reload", "reload5");
			LAi_QuestDelay("QC_gate_CB_run_5", 1.0);

			LAi_ActorRunToLocator(characterFromID("CoastBrother4"), "goto", "goto81", "", "");
			LAi_QuestDelay("QC_gate_CB4", 6.0);
		break;

		case "QC_gate_CB_run_5":
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother6"), "QC_town", "reload", "reload5");
			LAi_QuestDelay("QC_gate_CB_run_6", 1.0);

			LAi_ActorRunToLocator(characterFromID("CoastBrother5"), "goto", "goto81", "", "");
			LAi_QuestDelay("QC_gate_CB5", 6.0);
		break;

		case "QC_gate_CB_run_6":
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother7"), "QC_town", "reload", "reload5");
			LAi_QuestDelay("QC_gate_CB_run_7", 1.0);

			LAi_ActorRunToLocator(characterFromID("CoastBrother6"), "goto", "goto81", "", "");
			LAi_QuestDelay("QC_gate_CB6", 6.0);
		break;

		case "QC_gate_CB_run_7":
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother8"), "QC_town", "reload", "reload5");
			LAi_QuestDelay("QC_gate_CB_run_8", 1.0);

			LAi_ActorRunToLocator(characterFromID("CoastBrother7"), "goto", "goto81", "", "");
			LAi_QuestDelay("QC_gate_CB7", 6.0);
		break;

		case "QC_gate_CB_run_8":
			LAi_ActorRunToLocator(characterFromID("CoastBrother8"), "goto", "goto81", "", "");
			LAi_QuestDelay("QC_gate_CB8", 6.0);
		break;
//.......................................................................................................
	//CB admiral attacks
		case "QC_gate_CB21":
			PlaySound("VOICE\ENGLISH\c_brother21.wav");

			ChangeCharacterAddressGroup(Pchar, "QC_town", "goto", "goto91");
			PlaySound("PEOPLE\run_wood.wav");

			LAi_QuestDelay("QC_gate_CB21_A", 1.0);//was 3.0 to B
		break;

		case "QC_gate_CB21_A":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto82");

			LAi_QuestDelay("QC_gate_CB21_B", 2.0);
		break;

		case "QC_gate_CB21_B":
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother21"), "QC_town", "goto", "goto86");
			PlaySound("AMBIENT\CHURCH\bench1.wav");

			LAi_SetActorType(Pchar);
			LAi_ActorAttack(Pchar, CharacterFromID("CoastBrother21"), "");
			LAi_QuestDelay("QC_gate_CB21_C", 1.0);
		break;

		case "QC_gate_CB21_C":
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother21"), "QC_town", "goto", "goto87");
			PlaySound("AMBIENT\CHURCH\bench1.wav");

			LAi_SetPlayerType(Pchar);
			LAi_QuestDelay("QC_gate_CB21_D", 1.0);
		break;

		case "QC_gate_CB21_D":
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother21"), "QC_town", "goto", "goto82");
			PlaySound("PEOPLE\step_stairway.wav");

			LAi_SetActorType(CharacterFromID("CoastBrother21"));
			LAi_ActorAttack(CharacterFromID("CoastBrother21"), Pchar, "");
		break;
//.......................................................................................................
	//CB runners attack mode
		case "QC_gate_CB2":
			LAi_SetActorType(CharacterFromID("CoastBrother2"));
			LAi_ActorAttack(CharacterFromID("CoastBrother2"), Pchar, "");
		break;

		case "QC_gate_CB3":
			LAi_SetActorType(CharacterFromID("CoastBrother3"));
			LAi_ActorAttack(CharacterFromID("CoastBrother3"), Pchar, "");
		break;

		case "QC_gate_CB4":
			LAi_SetActorType(CharacterFromID("CoastBrother4"));
			LAi_ActorAttack(CharacterFromID("CoastBrother4"), Pchar, "");
		break;

		case "QC_gate_CB5":
			LAi_SetActorType(CharacterFromID("CoastBrother5"));
			LAi_ActorAttack(CharacterFromID("CoastBrother5"), Pchar, "");
		break;

		case "QC_gate_CB6":
			LAi_SetActorType(CharacterFromID("CoastBrother6"));
			LAi_ActorAttack(CharacterFromID("CoastBrother6"), Pchar, "");
		break;

		case "QC_gate_CB7":
			LAi_SetActorType(CharacterFromID("CoastBrother7"));
			LAi_ActorAttack(CharacterFromID("CoastBrother7"), Pchar, "");
		break;

		case "QC_gate_CB8":
			LAi_SetActorType(CharacterFromID("CoastBrother8"));
			LAi_ActorAttack(CharacterFromID("CoastBrother8"), Pchar, "");
		break;
//.......................................................................................................
//------------------------------------------------------------------------------------------------------------------
		case "QC_outside_gate":
			DeleteAttribute(PChar, "quest.disable_rebirth");
			bDisableFastReload = 0;
			Locations[FindLocation("QC_port")].locators_radius.officers.reload3_1 = 1.0;
			Locations[FindLocation("QC_Pirate_House")].locators_radius.goto.citizen08 = 1.0;

			Locations[FindLocation("QC_town")].models.always.locators = "QCtown_l";//reset to normal locators
			Locations[FindLocation("QC_town")].reload.l1.disable = 0;//open again
			ChangeCharacterAddressGroup(characterFromID("Mistress"), "QC_Brothel", "goto", "goto6");
			LAi_SetOfficerType(characterFromID("Mistress"));
			LAi_SetPoorType(Pchar);
			PlaySound("OBJECTS\VOICES\DEAD\male\dead7.wav");

			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("stars_short" , u, v+1, w, 0.0, 0.0, 0.0, sti(20) );

			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother21"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother2"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother3"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother4"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother5"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother6"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother7"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("CoastBrother8"), "none", "", "");

			LAi_QuestDelay("QC_outside_gate_0", 1.0);
			LAi_QuestDelay("QC_outside_gate_1", 5.0);
		break;

		case "QC_outside_gate_0":
			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "QC_town_exit", "reload", "reload4");
			LAi_SetOfficerType(characterFromID("Wench3"));
		break;

		case "QC_outside_gate_1":
			//3fire, 2smoke, kosters, gate blocked & closed, black
			LAi_SetStayType(Pchar);
			LAi_SetPlayerType(Pchar);

			Locations[FindLocation("QC_town")].models.always.town = "QCtown_black";

			LAi_QuestDelay("QC_outside_gate_2", 3.0);//story continues

			LAi_QuestDelay("QC_smoke", 120.0);//120
			LAi_QuestDelay("QC_black_open", 240.0);
		break;

		case "QC_smoke":
			//1smoke, kosters, gate blocked & closed, black

			Locations[FindLocation("QC_town_exit")].models.always.locators = "QCexit_l_JRH2";
		break;

		case "QC_black_open":
			//start: exit 	 		kosters, gate open, black
			//check: town 1:st visit	derrick, sound, kosters

			Locations[FindLocation("QC_town_exit")].image = "Town_QC_Exit.tga";//reset
			Locations[FindLocation("QC_town_exit")].models.always.locators = "QCexit_l_JRH3";
			Locations[FindLocation("QC_town_exit")].reload.l1.disable = 0;//open

			Locations[FindLocation("QC_town")].models.always.locators = "QCtown_l_derrick";
			locations[FindLocation("QC_town")].type = "repair_town";

			pchar.quest.QC_after_explosion.win_condition.l1 = "locator";
			pchar.quest.QC_after_explosion.win_condition.l1.location = "QC_town";
			pchar.quest.QC_after_explosion.win_condition.l1.locator_group = "reload";
			pchar.quest.QC_after_explosion.win_condition.l1.locator = "reload1";
			pchar.quest.QC_after_explosion.win_condition = "QC_after_explosion";
		break;

		case "QC_after_explosion":
			//start: town 1:st visit 	derrick, sound, kosters
			//check: exit 1:st visit	kosters, gate open, black

			PlaySound("ambient\shipyard\hammer.wav");
			locations[FindLocation("QC_town_exit")].type = "jungle";

			pchar.quest.QC_after_explosion2.win_condition.l1 = "locator";
			pchar.quest.QC_after_explosion2.win_condition.l1.location = "QC_town_exit";
			pchar.quest.QC_after_explosion2.win_condition.l1.locator_group = "reload";
			pchar.quest.QC_after_explosion2.win_condition.l1.locator = "reload1";
			pchar.quest.QC_after_explosion2.win_condition = "QC_after_explosion2";
		break;

		case "QC_after_explosion2":
			//start: exit 1:st visit	kosters, gate open, black
			//check: town 2:nd visit 	kosters ground

			Locations[FindLocation("QC_town")].models.always.locators = "QCtown_l_black";//only kosters ground
			locations[FindLocation("QC_town")].type = "town";//reset to normal

			pchar.quest.QC_after_explosion3.win_condition.l1 = "locator";
			pchar.quest.QC_after_explosion3.win_condition.l1.location = "QC_town";
			pchar.quest.QC_after_explosion3.win_condition.l1.locator_group = "reload";
			pchar.quest.QC_after_explosion3.win_condition.l1.locator = "reload1";
			pchar.quest.QC_after_explosion3.win_condition = "QC_after_explosion3";
		break;

		case "QC_after_explosion3":
			//start: town 2:nd visit 	kosters ground
			//check: exit 2:nd visit	kosters ground

			Locations[FindLocation("QC_town_exit")].models.always.locators = "QCexit_l_JRH4";
		break;

		case "QC_outside_gate_2":
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));

			Characters[GetCharacterIndex("Wench3")].dialog.CurrentNode  = "QC_outside_gate_talk";
		break;

		case "QC_outside_gate_3":
			//from Caroline K dialog

			AddPassenger(Pchar, characterFromID("Wench3"), 0);
			SetOfficersIndex(Pchar, 1, getCharacterIndex("Wench3"));
			LAi_SetOfficerType(characterFromID("Wench3"));
			Pchar.quest.wr_quest2 = "QC_finished";

			Locations[FindLocation("Redmond_tavern")].models.always.locators = "LT_l_JRH2";//part2 locators
			AddQuestRecord("Woodes_Rogers_quest", "7");
			CloseQuestHeader("Woodes_Rogers_quest");

			LAi_QuestDelay("QC_outside_gate_4", 2.0);
		break;

		case "QC_outside_gate_4":
			PlaySound("MUSIC\brothel_organ.wav");
			PlaySound("MUSIC\brothel_unison.wav");

			Pchar.quest.WR_back.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.WR_back.win_condition.l1.location = "QC_town_exit";
			Pchar.quest.WR_back.win_condition = "QC_sound_check_done";
		break;
//=================================================================================================================
	//shortcut [3] starts us up from this case
		case "QC_sound_check_done":

			Pchar.quest.Nevis_part = "done";
			Pchar.quest.Rdm_officiant = "Claire";//changes officiant and location(?) for reincarnation Redmond

			Lai_SetImmortal(CharacterFromID("wench3"), true);

			locations[FindLocation("QC_town_exit")].type = "jungle";

			locations[FindLocation("Redmond_Town_01")].type = "blues_town";
			locations[FindLocation("Redmond_Town_03")].type = "blues_town";
			locations[FindLocation("Redmond_Town_04")].type = "blues_town";
			Locations[FindLocation("Redmond_Port")].models.always.locators = "RedPort_l_JRH0";
			locations[FindLocation("Redmond_Port")].type = "blues_port";

			Locations[FindLocation("Redmond_Town_01")].locators_radius.goto.goto17 = 4.0;
			Locations[FindLocation("Redmond_tavern")].models.always.locators = "LT_l_JRH2";

			pchar.quest.back_in_Redmond1.win_condition.l1 = "locator";
			pchar.quest.back_in_Redmond1.win_condition.l1.location = "Redmond_Town_01";
			pchar.quest.back_in_Redmond1.win_condition.l1.locator_group = "goto";
			pchar.quest.back_in_Redmond1.win_condition.l1.locator = "goto17";
			pchar.quest.back_in_Redmond1.win_condition = "back_in_Redmond1";
		break;

		case "back_in_Redmond1":
			SetCurrentTime(12.00, 0);
			SetNextWeather("Blue Sky");	//to make library green doors not so obvious
			Locations[FindLocation("Tavern_storeroom")].environment.weather = "true";	//to 'activate' new weather

			SetCharacterShipLocation(characterFromID("Woodes Rogers"), "wr_port");
			LAi_SetStayType(Pchar);
			LAi_SetActorType(characterFromID("Woodes Rogers"));
			LAi_ActorTurnToCharacter(characterFromID("Woodes Rogers"), PChar);
			PlaySound("VOICE\ENGLISH\gr_wench3_oh.wav");

			LAi_QuestDelay("back_in_Redmond2", 0.5);
		break;

		case "back_in_Redmond2":
			PlaySound("OBJECTS\DUEL\man_attack6.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(PChar, characterFromID("Woodes Rogers"));

			RemoveOfficersIndex(pchar, GetCharacterIndex("Wench3"));
			RemovePassenger(pchar, characterFromID("Wench3"));
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorRunToLocator(characterFromID("Wench3"), "reload", "Door_1", "back_in_Redmond3", 3.0);
		break;

		case "back_in_Redmond3":
			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "wr_library", "goto", "goto1");

			LAi_QuestDelay("back_in_Redmond4", 1.0);
		break;

		case "back_in_Redmond4":
			ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "wr_library", "sit", "sit1");
			LAi_SetSitType(CharacterFromID("Woodes Rogers"));
			LAi_QuestDelay("subject_sound_architecture", 0.1);
			LAi_QuestDelay("back_in_Redmond5", 0.5);
		break;

		case "back_in_Redmond5":
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");

			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("Redmond_tavern")].reload.l3.disable = 1;
			Locations[FindLocation("wr_library")].locators_radius.goto.goto6 = 1.0;

			pchar.quest.back_in_Redmond6.win_condition.l1 = "locator";
			pchar.quest.back_in_Redmond6.win_condition.l1.location = "wr_library";
			pchar.quest.back_in_Redmond6.win_condition.l1.locator_group = "goto";
			pchar.quest.back_in_Redmond6.win_condition.l1.locator = "goto6";
			pchar.quest.back_in_Redmond6.win_condition = "back_in_Redmond6";
		break;

		case "back_in_Redmond6":
			LAi_SetCurHPMax(Pchar);		//if pchar is wounded he could get killed by Dover's medicine

			Locations[FindLocation("Tavern_storeroom")].environment.weather = "false";		//reset to normal
			Pchar.quest.wr_quest1 = "mission1";//prevents windem to repeat hint
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
			Characters[GetCharacterIndex("Wench3")].dialog.CurrentNode  = "thank_you";
		break;

		case "back_in_Redmond7":
			LAi_SetStayType(characterFromID("Wench3"));
			Pchar.quest.wr_quest2 = "shut_up_Caroline";
			LAi_SetActorType(characterFromID("Woodes Rogers"));
			LAi_ActorDialog(characterFromID("Woodes Rogers"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Woodes Rogers"));
			Characters[GetCharacterIndex("Woodes Rogers")].dialog.CurrentNode  = "back_in_redmond";
		break;

		case "back_in_Redmond8":
			LAi_SetActorType(characterFromID("wr_voy"));
			LAi_ActorDialog(characterFromID("wr_voy"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wr_voy"));
			Characters[GetCharacterIndex("wr_voy")].dialog.CurrentNode  = "doctor";
		break;

		case "back_in_Redmond9":
			LAi_SetStayType(characterFromID("wr_voy"));
			Pchar.quest.med_Dover = "neutral";
			LAi_SetStayType(Pchar);
			PlaySound("INTERFACE\drink.wav");

			Pchar.quest.disable_rebirth = true;
			Pchar.chr_ai.poison =  10;

			LAi_QuestDelay("back_in_Redmond10", 2.0);
		break;

		case "back_in_Redmond10":
			LAi_SetPoorType(pchar);
			PlaySound("PEOPLE\step_carpet.wav");
			PlaySound("PEOPLE\step_carpet.wav");
			PlaySound("OBJECTS\Voices\dead\male\dead4.wav");

			LAi_QuestDelay("back_in_Redmond10_A", 5.0);
		break;

		case "back_in_Redmond10_A":
			LAi_SetPlayerType(Pchar);
			LAi_UseAtidoteBottle(Pchar);

			int curExp = sti(Pchar.Experience);
			int nextExp = CalculateExperienceFromRank(sti(Pchar.rank)+1);
			int addExp = nextExp-curExp;
			AddCharacterExpNS(Pchar, addExp);
			Pchar.perks.freepoints = 0;//this takes away the added perk
			Pchar.perks.list.BasicDefence = true;

			int SAI = CalcCharacterSkill(Pchar, "Sailing");
			Pchar.skill.Sailing = SAI + 1;

			LAi_QuestDelay("back_in_Redmond10_B", 1.0);
		break;

		case "back_in_Redmond10_B":
			PlaySound("VOICE\ENGLISH\blaze_hah.wav");

			LAi_QuestDelay("back_in_Redmond10_C", 1.0);
		break;
//.......................................................................................................
		case "back_in_Redmond10_C":
			LAi_SetActorType(characterFromID("wr_voy"));
			LAi_ActorDialog(characterFromID("wr_voy"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wr_voy"));
			Characters[GetCharacterIndex("wr_voy")].dialog.CurrentNode  = "bandages";
		break;
//.......................................................................................................
		case "back_in_Redmond11":
			LAi_SetActorType(characterFromID("Woodes Rogers"));
			LAi_ActorDialog(characterFromID("Woodes Rogers"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Woodes Rogers"));
			Characters[GetCharacterIndex("Woodes Rogers")].dialog.CurrentNode  = "mission1";
		break;

		case "mission1_given":
			LAi_SetStayType(characterFromID("wr_voy"));
			Pchar.quest.med_Dover = "neutral";
			DeleteAttribute(PChar, "quest.disable_rebirth");
			ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "wr_library", "sit", "sit1");
			LAi_SetSitType(CharacterFromID("Woodes Rogers"));
			PlaySound("AMBIENT\SHOP\sigh1.wav");
			Locations[FindLocation("Redmond_tavern")].reload.l2.disable = 0;
			Locations[FindLocation("JRH_tavern_upstairs")].models.always.locators = "LH_F2_l_JRH_closed";
			ChangeCharacterAddressGroup(CharacterFromID("wr_bucc1"), "Redmond_tavern", "goto", "guard1");
			ChangeCharacterAddressGroup(CharacterFromID("wr_boc16"), "Redmond_tavern", "goto", "guard2");
			Locations[FindLocation("wr_bedroom")].box1.money = 5;

			DeleteQuestHeader("Woodes_Rogers_quest");
			SetQuestHeader("Woodes_Rogers_reward");
			AddQuestRecord("Woodes_Rogers_reward", "1");

			LAi_QuestDelay("pistol1_check", 0.1);
		break;
	//------------------------------------------------------------------------------------------------------
		case "open_tavern_upstairs_hatch":
			//from itemlogic box...
			DoQuestReloadToLocation("JRH_tavern_upstairs", "goto", "teleport", "open_tavern_upstairs_hatch1");
		break;

		case "open_tavern_upstairs_hatch1":
			CreateParticleSystem("blast_dirt_small" , -0.4, 0.0, -3.5, 0.0, 0.0, 0.0, sti(20) );
			LAi_SetFightMode(Pchar, false);
			PlaySound("PEOPLE\wood1.wav");
			Locations[FindLocation("JRH_tavern_upstairs")].image = "Inside_Doubleflour_House_Room.tga";
		break;

		case "close_tavern_upstairs_hatch":
			//from itemlogic box...
			DoQuestReloadToLocation("JRH_tavern_upstairs", "goto", "teleport", "close_tavern_upstairs_hatch1");
		break;

		case "close_tavern_upstairs_hatch1":
			CreateParticleSystem("blast_dirt_small" , 0.2, 1.0, -4.1, 0.0, 0.0, 0.0, sti(20) );
			LAi_SetFightMode(Pchar, false);
			PlaySound("PEOPLE\wood1.wav");
			Locations[FindLocation("JRH_tavern_upstairs")].image = "Inside_Doubleflour_House_Room.tga";
		break;
	//------------------------------------------------------------------------------------------------------
		case "pistol1_check":
			if(CheckCharacterItem(Pchar,"pistol201"))
			{
				AddQuestRecord("Woodes_Rogers_reward", "2");
				CloseQuestHeader("Woodes_Rogers_reward");

				Pchar.quest.wr_quest1 = "pistol1";

				EquipCharacterByItem(Pchar, "pistol201");

				ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "none", "", "");
				ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "wr_residence", "goto", "goto4");
				LAi_SetStayType(CharacterFromID("Woodes Rogers"));
				ChangeCharacterAddressGroup(CharacterFromID("wr_voy"), "wr_library", "sit", "sit1");
				LAi_SetSitType(CharacterFromID("wr_voy"));
				ChangeCharacterAddressGroup(CharacterFromID("Charles Windem"), "Charles_Windem_room", "sit", "sit1");
				LAi_SetSitType(CharacterFromID("Charles Windem"));

				Characters[GetCharacterIndex("wr_voy")].dialog.CurrentNode  = "hint_green_door";

				Locations[FindLocation("Tavern_storeroom")].reload.l4.disable = 0;//to Windem room
				locations[FindLocation("Charles_Windem_room")].id.label = "Charles Windem's room";
				Locations[FindLocation("Tavern_storeroom")].reload.l3.disable = 1;//to library

				Locations[FindLocation("wr_library")].locators_radius.reload.reload2 = 1.0;

				pchar.quest.pistol1.win_condition.l1 = "locator";
				pchar.quest.pistol1.win_condition.l1.location = "Charles_Windem_room";
				pchar.quest.pistol1.win_condition.l1.locator_group = "goto";
				pchar.quest.pistol1.win_condition.l1.locator = "goto5";
				pchar.quest.pistol1.win_condition = "pistol1";
			}
			else
			{
				LAi_QuestDelay("pistol1_check", 0.5);//loop check
			}
		break;

		case "pistol1":
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Charles Windem"));

			ChangeCharacterAddressGroup(CharacterFromID("Charles Windem"), "Charles_Windem_room", "goto", "goto6");//ok
			LAi_SetActorType(characterFromID("Charles Windem"));
			LAi_ActorDialog(characterFromID("Charles Windem"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Charles Windem"));
			Characters[GetCharacterIndex("Charles Windem")].dialog.CurrentNode  = "pistol1";
		break;

		case "library_closed":
			//from windem dialog
			ChangeCharacterAddressGroup(CharacterFromID("Charles Windem"), "Charles_Windem_room", "sit", "sit1");//ok
			LAi_SetSitType(CharacterFromID("Charles Windem"));

			LAi_QuestDelay("library_closed2", 1.0);
		break;

		case "library_closed2":
			LAi_SetPlayerType(Pchar);

			pchar.quest.library_closed3.win_condition.l1 = "locator";
			pchar.quest.library_closed3.win_condition.l1.location = "Charles_Windem_room";
			pchar.quest.library_closed3.win_condition.l1.locator_group = "goto";
			pchar.quest.library_closed3.win_condition.l1.locator = "goto5";
			pchar.quest.library_closed3.win_condition = "library_closed3";
		break;

		case "library_closed3":
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Charles Windem"));

			ChangeCharacterAddressGroup(CharacterFromID("Charles Windem"), "Charles_Windem_room", "goto", "goto6");//ok
			//repeated dialog
			LAi_SetActorType(characterFromID("Charles Windem"));
			LAi_ActorDialog(characterFromID("Charles Windem"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Charles Windem"));
			Characters[GetCharacterIndex("Charles Windem")].dialog.CurrentNode  = "pistol1_C";
		break;

		case "library_open":
			//from windem dialog
			Locations[FindLocation("Tavern_storeroom")].reload.l3.disable = 0;//to library
			LAi_SetStayType(Pchar);
			LAi_SetStayType(characterFromID("Charles Windem"));

			LAi_QuestDelay("library_open2", 0.5);
		break;

		case "library_open2":
			LAi_SetActorType(characterFromID("Charles Windem"));
			LAi_ActorGoToLocator(characterFromID("Charles Windem"), "reload", "reload3", "library_open3", 2.0);
		break;

		case "library_open3":
			LAi_SetPlayerType(Pchar);
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(CharacterFromID("Charles Windem"), "Redmond_Tavern", "merchant", "goto1");
			LAi_SetBarmanType(characterFromID("Charles Windem"));

			pchar.quest.close_windem_room.win_condition.l1 = "locator";
			pchar.quest.close_windem_room.win_condition.l1.location = "wr_library";
			pchar.quest.close_windem_room.win_condition.l1.locator_group = "reload";
			pchar.quest.close_windem_room.win_condition.l1.locator = "reload1";
			pchar.quest.close_windem_room.win_condition = "close_windem_room";

			pchar.quest.green_door_found.win_condition.l1 = "location";
			pchar.quest.green_door_found.win_condition.l1.location = "wr_residence";
			pchar.quest.green_door_found.win_condition = "green_door_found";
		break;

		case "close_windem_room":
			Locations[FindLocation("Tavern_storeroom")].reload.l4.disable = 1;//to Windem room
		break;

		case "green_door_found":
			Characters[GetCharacterIndex("wr_voy")].dialog.CurrentNode  = "First time";
			Pchar.quest.med_Dover = "neutral";

			pchar.quest.library_open4.win_condition.l2 = "locator";
			pchar.quest.library_open4.win_condition.l2.location = "wr_residence";
			pchar.quest.library_open4.win_condition.l2.locator_group = "goto";
			pchar.quest.library_open4.win_condition.l2.locator = "goto4";
			pchar.quest.library_open4.win_condition = "library_open4";
		break;

		case "library_open4":
			Locations[FindLocation("Redmond_Town_01")].models.always.locators = "Red01_l_JRH2";//window F3 visible & open
			Locations[FindLocation("wr_residence")].reload.l3.disable = 0;//window now open
			Locations[FindLocation("wr_library")].reload.l1.disable = 1;//library to storeroom closed
			Locations[FindLocation("Tavern_storeroom")].reload.l3.disable = 1;//storeroom to library closed
			locations[FindLocation("wr_library")].type = "Rogers_repair_residence";
			locations[FindLocation("Tavern_storeroom")].type = "repair_house";
			Locations[FindLocation("Tavern_storeroom")].models.always.locators = "store04_locators_JRH3";//with planks

			LAi_SetActorType(characterFromID("Woodes Rogers"));
			LAi_ActorDialog(characterFromID("Woodes Rogers"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Woodes Rogers"));
			Characters[GetCharacterIndex("Woodes Rogers")].dialog.CurrentNode  = "piece_of_land";
		break;

		case "piece_of_land":
			pchar.quest.piece_of_land2.win_condition.l1 = "locator";
			pchar.quest.piece_of_land2.win_condition.l1.location = "wr_residence";
			pchar.quest.piece_of_land2.win_condition.l1.locator_group = "goto";
			pchar.quest.piece_of_land2.win_condition.l1.locator = "goto6";
			pchar.quest.piece_of_land2.win_condition = "piece_of_land2";
		break;

		case "piece_of_land2":
			LAi_SetActorType(characterFromID("wr_bri"));
			LAi_ActorDialog(characterFromID("wr_bri"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wr_bri"));
			Characters[GetCharacterIndex("wr_bri")].dialog.CurrentNode  = "lieutenant";
		break;

		case "land_added":
			LAi_SetSitType(characterFromID("wr_bri"));

			pchar.quest.land_added2.win_condition.l1 = "locator";
			pchar.quest.land_added2.win_condition.l1.location = "wr_residence";
			pchar.quest.land_added2.win_condition.l1.locator_group = "goto";
			pchar.quest.land_added2.win_condition.l1.locator = "goto4";
			pchar.quest.land_added2.win_condition = "land_added2";
		break;

		case "land_added2":
			LAi_SetActorType(characterFromID("Woodes Rogers"));
			LAi_ActorDialog(characterFromID("Woodes Rogers"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Woodes Rogers"));
			Characters[GetCharacterIndex("Woodes Rogers")].dialog.CurrentNode  = "mission2";
		break;

		case "mission2_given":
			SetQuestHeader("Woodes_Rogers_reward_2");
			AddQuestRecord("Woodes_Rogers_reward_2", "1");
			DeleteQuestHeader("Woodes_Rogers_reward");

			LAi_SetActorType(characterFromID("Woodes Rogers"));
			LAi_ActorGoToLocator(characterFromID("Woodes Rogers"), "goto", "goto14", "wr_terrace", 4.5);

			LAi_SetStayType(characterFromID("wr_bri"));
			ChangeCharacterAddressGroup(CharacterFromID("wr_bri"), "wr_residence", "goto", "goto7");

			LAi_QuestDelay("pchar_searches_residence", 0.1);
		break;

		case "pchar_searches_residence":
			pchar.quest.lieut_leaves.win_condition.l1 = "locator";
			pchar.quest.lieut_leaves.win_condition.l1.location = "wr_residence";
			pchar.quest.lieut_leaves.win_condition.l1.locator_group = "goto";
			pchar.quest.lieut_leaves.win_condition.l1.locator = "goto1";		//was reload7
			pchar.quest.lieut_leaves.win_condition = "lieut_leaves";
		break;

		case "wr_terrace":
			ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "Redmond_Town_04", "goto", "goto_45");
			PlaySound("INTERFACE\closed_locked_door.wav");
		break;

		case "lieut_leaves":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("wr_bri"));
			LAi_QuestDelay("lieut_leaves2", 1.0);
		break;

		case "lieut_leaves2":
			PlaySound("VOICE\ENGLISH\por_m_b_006.wav");
			LAi_QuestDelay("lieut_leaves3", 3.0);
		break;

		case "lieut_leaves3":
			LAi_SetActorType(characterFromID("wr_bri"));
			LAi_ActorGoToLocator(characterFromID("wr_bri"), "reload", "reload2", "lieut_leaves4", 4.5);

			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box4", 0.5);
			Locations[FindLocation("wr_residence")].locators_radius.box.box4 = 0.5;	//walk to clock
			locations[FindLocation(Pchar.location)].box2.items.key5 = 1;
		break;

		case "lieut_leaves4":
			LAi_SetActorType(characterFromID("wr_bri"));
			LAi_ActorGoToLocator(characterFromID("wr_bri"), "reload", "reload2", "lieut_leaves5", 2.0);
		break;

		case "lieut_leaves5":
			ChangeCharacterAddressGroup(CharacterFromID("wr_bri"), "none", "", "");
			PlaySound("INTERFACE\closed_locked_door.wav");
			Locations[FindLocation("wr_residence")].reload.l2.disable = 1;//closed to lib so clock entrance may be observed
			Locations[FindLocation("wr_library")].reload.l2.disable = 1;//& back to residence
			LAi_SetPlayerType(Pchar);

			pchar.quest.search_clock.win_condition.l1 = "locator";
			pchar.quest.search_clock.win_condition.l1.location = "wr_residence";
			pchar.quest.search_clock.win_condition.l1.locator_group = "goto";
			pchar.quest.search_clock.win_condition.l1.locator = "goto13";
			pchar.quest.search_clock.win_condition = "search_clock";
		break;

		case "search_clock":
			Pchar.quest.disable_rebirth = true;
			PlaySound("PEOPLE\run_wood.wav");

			Pchar.quest.search_clock1.win_condition.l1 = "item";
			Pchar.quest.search_clock1.win_condition.l1.character = Pchar.id;
			Pchar.quest.search_clock1.win_condition.l1.item = "key5";
			Pchar.quest.search_clock1.win_condition = "search_clock1";
		break;

		case "search_clock1":
			AddQuestRecord("Woodes_Rogers_reward_2", "2");
			DeleteAttribute(PChar, "quest.disable_rebirth");

			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box4", 0.0001);
			Locations[FindLocation("wr_residence")].locators_radius.box.box4 = 0.0001;	//to clock

			PlaySound("INTERFACE\took_item.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto8");

			Locations[FindLocation("wr_bedroom")].locators_radius.box.box2 = 1.0;				//reset to normal reload in charge
			Locations[FindLocation("wr_bedroom")].locators_radius.reload.reload2 = 0.0001;

			LAi_QuestDelay("search_clock2", 2.0);
		break;

		case "search_clock2":
			ResumeAllSounds();
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "wr_residence", "goto", "goto15");
			PlaySound("PEOPLE\run_wood.wav");

			LAi_QuestDelay("kitchen", 0.1);
		break;

		case "kitchen":
			pchar.quest.kitchen2.win_condition.l1 = "locator";
			pchar.quest.kitchen2.win_condition.l1.location = "wr_kitchen";
			pchar.quest.kitchen2.win_condition.l1.locator_group = "reload";
			pchar.quest.kitchen2.win_condition.l1.locator = "reload2";
			pchar.quest.kitchen2.win_condition = "kitchen2";
		break;

		case "kitchen2":
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Woodes Rogers' kitchen"));
			PlaySound("INTERFACE\closed_locked_door.wav");
			TakeItemFromCharacter(Pchar, "key5");
			locations[FindLocation("wr_kitchen")].id.label = "Woodes Rogers' kitchen";
			Locations[FindLocation("Redmond_tavern")].reload.l2.disable = 1;//to tavern_upstairs
			Locations[FindLocation("JRH_tavern_upstairs")].reload.l2.disable = 1;//to wr bed

			locations[FindLocation(Pchar.location)].box1.items.Barmansknife = 1;
			locations[FindLocation(Pchar.location)].box1.items.plate = 1;
			locations[FindLocation(Pchar.location)].box1.items.fish = 3;

			locations[FindLocation(Pchar.location)].box2.items.plate = 3;
			locations[FindLocation(Pchar.location)].box2.items.tankard = 2;
			locations[FindLocation(Pchar.location)].box2.items.fish = 1;

			locations[FindLocation(Pchar.location)].box3.items.copper_cauldron = 1;
			locations[FindLocation(Pchar.location)].box3.items.fish = 2;

			LAi_QuestDelay("shower", 0.1);
			LAi_QuestDelay("pistol2_check", 0.1);
			LAi_QuestDelay("bmknife_check", 0.1);
		break;

		case "shower":
			pchar.quest.shower.win_condition.l1 = "locator";
			pchar.quest.shower.win_condition.l1.location = "wr_booty";
			pchar.quest.shower.win_condition.l1.locator_group = "goto";
			pchar.quest.shower.win_condition.l1.locator = "goto13";
			pchar.quest.shower.win_condition = "shower_1";
		break;

		case "shower_1":
			PauseAllSounds();
			LAi_SetStayType(Pchar);
			PlaySound("PEOPLE\shower.wav");

			LAi_QuestDelay("after_shower", 4.5);
		break;

		case "after_shower":
			ChangeCharacterAddressGroup(Pchar, "wr_booty", "goto", "goto12");
			PlaySound("PEOPLE\step_stairway.wav");

			if(Pchar.model == "pira4B")
			{
				SetModel(PChar, "Pira4M_C", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);
			}

			LAi_QuestDelay("after_shower2", 1.0);
		break;

		case "after_shower2":
			ResumeAllSounds();
			PlaySound("VOICE\ENGLISH\blaze_what_was_that.wav");

			LAi_SetPlayerType(Pchar);

			//this is to secure that Selkirk shows up after: shower - leave booty - find pistol2
			if(Pchar.quest.wr_quest1 == "pistol2")
			{
				return;
			}
		break;

		case "kitchen_R1_unlock":
			Locations[FindLocation("wr_kitchen")].image = "";
			DoQuestReloadToLocation("wr_kitchen", "goto", "goto5", "kitchen_R1_unlock1");
		break;

		case "kitchen_R1_unlock1":
			Locations[FindLocation("wr_kitchen")].image = "wr_kitchen.tga";
			PlaySound("INTERFACE\closet_open.wav");
			Locations[FindLocation("wr_kitchen")].reload.l1.disable = 0;

			Locations[FindLocation("Redmond_Town_01")].reload.l16.go = "WR_kitchen";
			Locations[FindLocation("Redmond_Town_01")].reload.l16.emerge = "reload1";
			Locations[FindLocation("Redmond_Town_01")].reload.l16.label = "Woodes Rogers' kitchen.";
			Locations[FindLocation("Redmond_Town_01")].reload.l16.disable = 0;
		break;

		case "kitchen_R1_lock":
			Locations[FindLocation("wr_kitchen")].image = "";
			DoQuestReloadToLocation("wr_kitchen", "goto", "goto5", "kitchen_R1_lock1");
		break;

		case "kitchen_R1_lock1":
			Locations[FindLocation("wr_kitchen")].image = "wr_kitchen.tga";
			PlaySound("INTERFACE\key_lock.wav");
			Locations[FindLocation("wr_kitchen")].reload.l1.disable = 1;
			Locations[FindLocation("Redmond_Town_01")].reload.l16.disable = 1;
		break;

		case "kitchen_lever_stuck":
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");
		break;

		case "bmknife_check":
			Pchar.quest.bmknife_check1.win_condition.l1 = "item";
			Pchar.quest.bmknife_check1.win_condition.l1.character = Pchar.id;
			Pchar.quest.bmknife_check1.win_condition.l1.item = "BarmansKnife";
			Pchar.quest.bmknife_check1.win_condition = "bmknife_check1";
		break;

		case "bmknife_check1":
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			EquipCharacterByItem(Pchar, "BarmansKnife");

			if(CheckCharacterItem(Pchar,"pistol202"))
			{
				EquipCharacterByItem(Pchar, "pistol202");
			}
		break;

		case "pistol2_check":
			if(CheckCharacterItem(Pchar,"pistol202"))
			{
				AddQuestRecord("Woodes_Rogers_reward_2", "3");
				CloseQuestHeader("Woodes_Rogers_reward_2");
				Pchar.quest.wr_quest1 = "pistol2";

				EquipCharacterByItem(Pchar, "pistol202");
				Locations[FindLocation("wr_residence")].reload.l7.disable = 0;//open to armory
				ChangeCharacterAddressGroup(CharacterFromID("wr_voy"), "none", "", "");//doc
				locations[FindLocation("wr_armory")].id.label = "Woodes Rogers' armory";

				LAi_QuestDelay("pistol2", 0.1);
			}
			else
			{
				LAi_QuestDelay("pistol2_check", 0.5);//loop check
			}
		break;

		case "pistol2":
			ChangeCharacterAddressGroup(CharacterFromID("Selkirk"), "wr_booty", "reload", "reload4");

			pchar.quest.selkirk_gone.win_condition.l1 = "locator";
			pchar.quest.selkirk_gone.win_condition.l1.location = "wr_booty";
			pchar.quest.selkirk_gone.win_condition.l1.locator_group = "goto";
			pchar.quest.selkirk_gone.win_condition.l1.locator = "goto14";
			pchar.quest.selkirk_gone.win_condition = "selkirk_gone";
		break;

		case "selkirk_gone":
			LAi_SetStayType(Pchar);
			PlaySound("VOICE\ENGLISH\Eng_m_c_073.wav");
			LAi_QuestDelay("selkirk_gone2", 3.0);
		break;
//[4] from here
		case "selkirk_gone2":
			ChangeCharacterAddressGroup(CharacterFromID("Selkirk"), "none", "", "");
			PlaySound("PEOPLE\counter_openclose.wav");
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("steplock_armory", 0.1);//must be here (first!)

			pchar.quest.armory_sound_hint.win_condition.l1 = "location";
			pchar.quest.armory_sound_hint.win_condition.l1.location = "wr_residence";
			pchar.quest.armory_sound_hint.win_condition = "armory_sound_hint";
		break;

		case "armory_sound_hint":
			//PlaySound("PEOPLE\counter_open.wav");
			PlaySound("INTERFACE\key_unlock.wav");

			LAi_QuestDelay("armory_sound_hint1", 2.5);

			pchar.quest.armory_intro.win_condition.l1 = "locator";
			pchar.quest.armory_intro.win_condition.l1.location = "wr_armory";
			pchar.quest.armory_intro.win_condition.l1.locator_group = "reload";
			pchar.quest.armory_intro.win_condition.l1.locator = "reload2";
			pchar.quest.armory_intro.win_condition = "armory_intro";
		break;

		case "armory_sound_hint1":
			PlaySound("VOICE\ENGLISH\blaze_what_was_that.wav");
		break;

		case "armory_intro":
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box1", 0.1);
			Locations[FindLocation("wr_armory")].reload.l2.disable = 1;//locked inside armory until wr arrives to secure some box/randitem functions
			PlaySound("INTERFACE\closed_locked_door.wav");
			locations[FindLocation(Pchar.location)].box1.items.cannonballs = 45;
			locations[FindLocation(Pchar.location)].box3.items.cannonballs = 3;
			Pchar.quest.cannonballs_in_counterbox = "3";

			LAi_QuestDelay("ballbox_radius", 0.1);
			LAi_QuestDelay("ballbox_armory", 0.1);
		break;

		case "ballbox_radius":
			pchar.quest.ballbox_radius1.win_condition.l1 = "locator";
			pchar.quest.ballbox_radius1.win_condition.l1.location = "wr_armory";
			pchar.quest.ballbox_radius1.win_condition.l1.locator_group = "goto";
			pchar.quest.ballbox_radius1.win_condition.l1.locator = "goto6";
			pchar.quest.ballbox_radius1.win_condition = "ballbox_radius1";
		break;

		case "ballbox_radius1":
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem12", 1.5);
		break;

		case "armory_intro2":
			pchar.quest.gunner_dialog.win_condition.l1 = "locator";
			pchar.quest.gunner_dialog.win_condition.l1.location = "wr_armory";
			pchar.quest.gunner_dialog.win_condition.l1.locator_group = "officers";
			pchar.quest.gunner_dialog.win_condition.l1.locator = "reload2_3";
			pchar.quest.gunner_dialog.win_condition = "gunner_dialog";
		break;

		case "gunner_dialog":
			LAi_SetActorType(characterFromID("wr_oman1X"));
			LAi_ActorDialog(characterFromID("wr_oman1X"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wr_oman1X"));
			Characters[GetCharacterIndex("wr_oman1X")].dialog.CurrentNode  = "gunner";
		break;

		case "armory_start":
			//from gunner dialog
			Pchar.quest.wr_quest1 = "blade_found";
			GiveItem2Character(Pchar, "blade4-2");
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			EquipCharacterByItem(Pchar, "blade4-2");
			PlaySound("OBJECTS\DUEL\sabre_hit.wav");

			if(CheckCharacterItem(Pchar,"pistol202"))
			{
				EquipCharacterByItem(Pchar, "pistol202");
			}

			if(CheckCharacterItem(Pchar,"BarmansKnife"))
			{
				TakeItemFromCharacter(Pchar, "BarmansKnife");
			}

			LAi_SetActorType(characterFromID("wr_oman1X"));
			LAi_ActorTurnToLocator(characterFromID("wr_oman1X"), "goto", "goto9");

			LAi_QuestDelay("armory_start1", 0.5);
		break;

		case "armory_start1":
			PlaySound("OBJECTS\DUEL\sword_out.wav");
			LAi_SetSitType(characterFromID("wr_oman1X"));
			//quest continues in itemlogic by trying to open box3, then to armory_start2
		break;

		case "blade_on_armory_box":
			PlaySound("PEOPLE\blade_basket.wav");

			LAi_QuestDelay("blade_on_armory_box1", 1.0);
		break;

		case "blade_on_armory_box1":
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(Pchar, false);
			LAi_LocationFightDisable(&Locations[FindLocation(pchar.location)], true);
		break;
//---------------------------------------------------------------------------------------------------
		case "steplock_armory":
			pchar.quest.steplock_armory1.win_condition.l1 = "locator";
			pchar.quest.steplock_armory1.win_condition.l1.location = "wr_armory";
			pchar.quest.steplock_armory1.win_condition.l1.locator_group = "goto";
			pchar.quest.steplock_armory1.win_condition.l1.locator = "goto1";
			pchar.quest.steplock_armory1.win_condition = "steplock_armory1";
		break;

		case "steplock_armory1":
			PlaySound("INTERFACE\step_open.wav");
			Locations[FindLocation("wr_armory")].reload.l1.disable = 0;
			Locations[FindLocation("wr_gunpowder")].reload.l1.disable = 0;
			LAi_QuestDelay("steplock_armory2", 3.0);
		break;

		case "steplock_armory2":
			PlaySound("INTERFACE\key_lock.wav");
			Locations[FindLocation("wr_armory")].reload.l1.disable = 1;
			Locations[FindLocation("wr_gunpowder")].reload.l1.disable = 1;
			LAi_QuestDelay("steplock_armory", 0.1);	//loop
		break;
//---------------------------------------------------------------------------------------------------
		case "ballbox_armory":
			if(CheckCharacterItem(Pchar,"cannonball_box2"))
			{
				TakeItemFromCharacter(Pchar, "cannonball_box2");
				PlaySound("PEOPLE\wood2.wav");
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem12", 0.01);
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box1", 1.0);
			}
			else
			{
				LAi_QuestDelay("ballbox_armory", 0.5);//loop check
			}
		break;

		case "armory_blade5":
			LAi_SetStayType(CharacterFromID("wr_oman1X"));
			PlaySound("PEOPLE\run_wood.wav");
			ChangeCharacterAddressGroup(CharacterFromID("wr_oman1X"), "wr_armory", "goto", "goto7");
			LAi_QuestDelay("armory_blade6", 1.0);
		break;

		case "armory_blade6":
			PlaySound("OBJECTS\SHIPCHARGE\_balls.wav");
			LAi_QuestDelay("armory_blade7", 2.0);
		break;

		case "armory_blade7":
			PlaySound("PEOPLE\step_iron.wav");
			PlaySound("PEOPLE\step_iron.wav");
			PlaySound("PEOPLE\step_iron.wav");
			PlaySound("PEOPLE\step_iron.wav");
		break;
//---------------------------------------------------------------------------------------------------
		case "armory_balls":
			//from check in itemsbox
			if(CheckAttribute(Pchar,"quest.wr_quest1") && Pchar.quest.wr_quest1 == "armory_box3_empty")
			{
				LAi_QuestDelay("armory_take_box", 0.1);
			}
			else
			{
				LAi_QuestDelay("armory_balls", 0.5);//loop check
			}
		break;

		case "armory_take_box":
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem5", 1.5);
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box3", 0.1);
			LAi_QuestDelay("armory_take_box1", 0.1);
		break;

		case "armory_take_box1":
			if(CheckCharacterItem(Pchar,"cannonball_box"))
			{
				TakeItemFromCharacter(Pchar, "cannonball_box");
				PlaySound("PEOPLE\wood2.wav");
				LAi_QuestDelay("armory_jump", 0.1);
				LAi_QuestDelay("armory_blade5", 1.0);

				pchar.quest.gps_start.win_condition.l1 = "locator";
				pchar.quest.gps_start.win_condition.l1.location = "wr_gunpowder";
				pchar.quest.gps_start.win_condition.l1.locator_group = "reload";
				pchar.quest.gps_start.win_condition.l1.locator = "reload1";
				pchar.quest.gps_start.win_condition = "gps_start";
			}
			else
			{
				LAi_QuestDelay("armory_take_box1", 0.5);//loop check
			}
		break;

		case "armory_jump":
			pchar.quest.armory_jump1.win_condition.l1 = "locator";
			pchar.quest.armory_jump1.win_condition.l1.location = "wr_armory";
			pchar.quest.armory_jump1.win_condition.l1.locator_group = "goto";
			pchar.quest.armory_jump1.win_condition.l1.locator = "goto14";
			pchar.quest.armory_jump1.win_condition = "armory_jump1";
		break;

		case "armory_jump1":
			PlaySound("PEOPLE\Jump_counter.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_armory", "goto", "goto15");
			LAi_QuestDelay("armory_jump2", 0.5);
		break;

		case "armory_jump2":
			ChangeCharacterAddressGroup(Pchar, "wr_armory", "officers", "reload1_2");
			LAi_QuestDelay("armory_jump", 0.1);//loop
		break;

		case "gps_start":
			PlaySound("AMBIENT\JUNGLE\screams.wav");
			if(Pchar.quest.wr_quest1 == "armory_box3_empty")
			{
				ChangeCharacterAddressGroup(CharacterFromID("wr_oman1X"), "wr_armory", "goto", "goto17");

				Pchar.quest.wr_quest1 = "gunpowder";
				locations[FindLocation(Pchar.location)].box2.items.powderflask = 1;
				locations[FindLocation(Pchar.location)].box2.items.ammopouch = 1;
				locations[FindLocation(Pchar.location)].box3.items.gunpowder = 1239;
				locations[FindLocation(Pchar.location)].box4.items.pistolbullets = 867;
				locations[FindLocation(Pchar.location)].box4.items.pistolgrapes = 496;
				locations[FindLocation(Pchar.location)].box4.items.musketbullets = 186;

				SetModel(characterFromID("Powdermonkey"), "monkey", "monkey", "monkey", 1.8, false);
				LAi_SetActorType(CharacterFromID("Powdermonkey"));

				LAi_QuestDelay("gps_flaskpouch_check", 0.1);
			}
		break;

		case "gps_flaskpouch_check":
			if(CheckCharacterItem(Pchar,"powderflask") && CheckCharacterItem(Pchar,"ammopouch"))
			{
				EquipCharacterByItem(Pchar, "powderflask");
				EquipCharacterByItem(Pchar, "ammopouch");
				Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"You equipped a Powder Flask and an Ammunition Pouch."));
				LAi_QuestDelay("gps_monkey_down", 0.5);
			}
			else
			{
				LAi_QuestDelay("gps_flaskpouch_check", 0.5);//loop check
			}
		break;

		case "gps_monkey_down":
			ChangeCharacterAddressGroup(CharacterFromID("Powdermonkey"), "wr_gunpowder", "goto", "goto9");
			PlaySound("PEOPLE\recoil.wav");

			LAi_QuestDelay("gps_monkey_down0", 1.0);
		break;

		case "gps_monkey_down0":
			PlaySound("OBJECTS\VOICES\DEAD\monkey\monkey_dead2.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto9");

			LAi_SetPlayerType(Pchar);

			pchar.quest.gps_monkey_cannon.win_condition.l1 = "locator";
			pchar.quest.gps_monkey_cannon.win_condition.l1.location = "wr_gunpowder";
			pchar.quest.gps_monkey_cannon.win_condition.l1.locator_group = "box";
			pchar.quest.gps_monkey_cannon.win_condition.l1.locator = "box3";
			pchar.quest.gps_monkey_cannon.win_condition = "gps_monkey_cannon";
		break;

		case "gps_monkey_cannon":
			ChangeCharacterAddressGroup(CharacterFromID("Powdermonkey"), "wr_gunpowder", "goto", "goto3");
			PlaySound("PEOPLE\recoil.wav");

			LAi_QuestDelay("gps_monkey_cannon1", 1.0);
		break;

		case "gps_monkey_cannon1":
			PlaySound("OBJECTS\DUEL\monkey_hit3.wav");

			LAi_SetActorType(characterFromID("Powdermonkey"));
			LAi_ActorRunToLocator(characterFromID("Powdermonkey"), "goto", "goto4", "gps_monkey_cannon2", 3.0);
		break;

		case "gps_monkey_cannon2":
			ChangeCharacterAddressGroup(CharacterFromID("Powdermonkey"), "wr_gunpowder", "goto", "goto11");
			LAi_QuestDelay("gps_ammo_check", 0.1);
		break;

		case "gps_ammo_check":
			gp = GetCharacterItem(Pchar, "gunpowder");
			pb = GetCharacterItem(Pchar, "pistolbullets");

			if(gp == 12 && pb == 12)
			{
				LAi_QuestDelay("gunner_warning", 0.1);
			}
			else
			{
				LAi_QuestDelay("gps_ammo_check", 0.5);//loop check
			}
		break;

		case "gunner_warning":
			PlaySound("OBJECTS\SHIPCHARGE\gunner_warning.wav");
			LAi_QuestDelay("gunner_warning0", 1.0);
		break;

		case "gunner_warning0":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "officers", "reload1_1");
			LAi_QuestDelay("gunner_warning1", 1.0);
		break;

		case "gunner_warning1":
			PlaySound("OBJECTS\DUEL\monkey_attack2.wav");
			ChangeCharacterAddressGroup(CharacterFromID("Powdermonkey"), "wr_gunpowder", "goto", "goto4");
			LAi_QuestDelay("gunner_warning2", 1.0);
		break;

		case "gunner_warning2":
			LAi_SetActorType(characterFromID("Powdermonkey"));
			LAi_ActorRunToLocator(characterFromID("Powdermonkey"), "reload", "reload1", "gunner_warning3", 2.0);
		break;

		case "gunner_warning3":
			PlaySound("INTERFACE\key_unlock2.wav");
			Locations[FindLocation("wr_gunpowder")].reload.l1.disable = 0;
			ChangeCharacterAddressGroup(CharacterFromID("Powdermonkey"), "wr_armory", "goto", "goto16");
			LAi_QuestDelay("gunner_warning4", 1.0);
		break;

		case "gunner_warning4":
			PlaySound("OBJECTS\SHIPCHARGE\gunner_fire.wav");
			LAi_QuestDelay("cannonshot", 1.0);
		break;

		case "cannonshot":
			PlaySound("OBJECTS\DUEL\pistol_musket.wav");
			PlaySound("OBJECTS\DUEL\pistol_musket.wav");
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire1.wav");
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire1.wav");
			PlaySound("OBJECTS\SHIPCHARGE\gunpowder_explosion.wav");

			Pchar.quest.wr_armorybox = "open";
			Locations[FindLocation("wr_armory")].models.always.locators = "LS_l_JRH3";//after shot
			Locations[FindLocation("wr_armory")].reload.l1.disable = 0;//open from now

			LAi_QuestDelay("cannonshot1", 1.0);
		break;

		case "cannonshot1":
			CreateParticleSystemX("blast_dirt", 0.3, 0, 4.3, 0.3, 0, 4.3,10);
			CreateParticleSystemX("blast_dirt", 0.3, 0, 4.3, 0.3, 0, 4.3,10);
			PlaySound("OBJECTS\SHIPCHARGE\Cannon_Explosion_01.wav");
			LAi_QuestDelay("cannonshot2", 2.0);
		break;

		case "cannonshot2":
			LAi_SetPlayerType(Pchar);
			PlaySound("OBJECTS\SHIPCHARGE\man2waitB.wav");

			pchar.quest.cannonshot3.win_condition.l1 = "locator";
			pchar.quest.cannonshot3.win_condition.l1.location = "wr_armory";
			pchar.quest.cannonshot3.win_condition.l1.locator_group = "reload";
			pchar.quest.cannonshot3.win_condition.l1.locator = "reload1";
			pchar.quest.cannonshot3.win_condition = "cannonshot3";
		break;

		case "cannonshot3":
			CreateParticleSystem("smoke_inv" , -3.5, 0.8, -0.3, 5.1, 4.0, 0.0, sti(20) );

			CreateParticleSystemX("blast_dirt", -1.6, 0.8, 5.3, -1.6, 0.5, 5.3,10);
			CreateParticleSystemX("blast_dirt", -1.6, 0.8, 5.3, -1.6, 0.5, 5.3,10);
			CreateParticleSystemX("blast_dirt", -1.6, 1.3, 5.3, -1.6, 0.5, 5.3,10);

			LAi_SetActorType(characterFromID("wr_oman1X"));
			LAi_ActorTurnToLocator(characterFromID("wr_oman1X"), "goto", "goto9");
			LAi_SetActorType(characterFromID("powdermonkey"));
			LAi_ActorTurnToCharacter(characterFromID("powdermonkey"), PChar);
			PlaySound("AMBIENT\JUNGLE\screams.wav");

			ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "wr_armory", "reload", "reload2");
			LAi_SetStayType(characterFromID("Woodes Rogers"));

			locations[FindLocation(Pchar.location)].box2.items.bladepickaxe1 = 1;
			Play3DSoundComplex("objects\shipcharge\ship_onfire.wav", -3.8, 1.7, 7.2, true, false);//looped sound

		        LAi_QuestDelay("governor_back", 0.1);//checkpoint for pchar to stop at
			LAi_QuestDelay("wr_armory_more_smoke", 5.0);
		break;

		case "wr_armory_more_smoke":
			CreateParticleSystem("smoke_inv" , -3.5, 0.8, -0.3, 5.1, 4.0, 0.0, sti(20) );

			LAi_QuestDelay("wr_armory_more_smoke1", 5.0);
		break;

		case "wr_armory_more_smoke1":
			CreateParticleSystem("smoke_inv" , -3.5, 0.8, -0.3, 5.1, 4.0, 0.0, sti(20) );

			LAi_QuestDelay("wr_armory_more_smoke2", 5.0);
		break;

		case "wr_armory_more_smoke2":
			CreateParticleSystem("smoke_inv" , -3.5, 0.8, -0.3, 5.1, 4.0, 0.0, sti(20) );
		break;

		case "governor_back":
			pchar.quest.governor_back1.win_condition.l1 = "locator";
			pchar.quest.governor_back1.win_condition.l1.location = "wr_armory";
			pchar.quest.governor_back1.win_condition.l1.locator_group = "goto";
			pchar.quest.governor_back1.win_condition.l1.locator = "goto18";
			pchar.quest.governor_back1.win_condition = "governor_back1";
		break;

		case "governor_back1":
			LAi_SetStayType(Pchar);
			LAi_SetActorType(characterFromID("Woodes Rogers"));
			LAi_ActorGoToLocatorJRH(characterFromID("Woodes Rogers"), "goto", "goto19", 5.5);

			LAi_SetActorType(characterFromID("wr_oman1X"));
			LAi_ActorTurnToCharacter(characterFromID("wr_oman1X"), PChar);

			LAi_QuestDelay("governor_back3", 0.5);//starts gunner talk
			LAi_QuestDelay("governor_back4", 5.0);
		break;

		case "governor_back3":
			PlaySound("VOICE\ENGLISH\Eng_m_b_059.wav");
		break;

		case "governor_back4":
			PlaySound("VOICE\ENGLISH\gr_WR_host1.wav");
			LAi_SetActorType(characterFromID("wr_oman1X"));
			LAi_ActorTurnToLocator(characterFromID("wr_oman1X"), "goto", "goto19");
			LAi_SetActorType(characterFromID("powdermonkey"));
			LAi_ActorTurnToLocator(characterFromID("powdermonkey"), "goto", "goto19");
			LAi_QuestDelay("governor_back5", 3.0);//was 4.0
		break;

		case "governor_back5":
			PlaySound("OBJECTS\DUEL\monkey_attack2.wav");
			LAi_QuestDelay("governor_back6", 0.5);
		break;

		case "governor_back6":
			PlaySound("OBJECTS\DUEL\monkey_hit3.wav");
			LAi_QuestDelay("governor_back7", 0.5);
		break;

		case "governor_back7":
			PlaySound("OBJECTS\DUEL\monkey_attack2.wav");
			LAi_QuestDelay("governor_back8", 0.5);
		break;

		case "governor_back8":
			LAi_SetActorType(characterFromID("Woodes Rogers"));
			LAi_ActorTurnToLocator(characterFromID("Woodes Rogers"), "officers", "reload2_2");
			LAi_QuestDelay("governor_back9", 1.0);
		break;

		case "governor_back9":
			Locations[FindLocation("wr_residence")].reload.l1.disable = 0;
			LAi_SetActorType(characterFromID("Woodes Rogers"));
			LAi_ActorGoToLocator(characterFromID("Woodes Rogers"), "reload", "reload2", "governor_back10", 3.5);
		break;

		case "governor_back10":
			ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "Redmond_town_04", "goto", "goto_45");
			Pchar.quest.wr_terrace = "first_time";
			Locations[FindLocation("wr_armory")].reload.l2.disable = 0;//open now to residence
			Locations[FindLocation("wr_residence")].reload.l3.disable = 1;//window now closed
			Locations[FindLocation("Redmond_Town_01")].reload.l18.disable = 1;//window now closed
			LAi_SetPlayerType(Pchar);
			LAi_SetStayType(characterFromID("wr_oman1X"));
			PlaySound("PEOPLE\counter_openclose.wav");

			LAi_QuestDelay("governor_back11", 1.25);

			LAi_QuestDelay("bladepickaxe1_check", 0.1);

			pchar.quest.terrace_out0.win_condition.l1 = "locator";
			pchar.quest.terrace_out0.win_condition.l1.location = "Redmond_town_04";
			pchar.quest.terrace_out0.win_condition.l1.locator_group = "goto";
			pchar.quest.terrace_out0.win_condition.l1.locator = "terr_out1";
			pchar.quest.terrace_out0.win_condition = "terrace_out0";
		break;
//...................................................................................................................
		case "terrace_out0":
			PlaySound("INTERFACE\closed_door.wav");

			LAi_QuestDelay("terrace_out1", 2.0);
		break;

		case "terrace_out1":
			PlaySound("PEOPLE\recoil.wav");
			ChangeCharacterAddressGroup(Pchar, "Redmond_town_04", "goto", "terr_out1X");

			if(CheckAttribute(Pchar,"quest.wr_terrace") && Pchar.quest.wr_terrace == "first_time")
			{
				LAi_QuestDelay("terrace1", 0.1);	//starts Rogers dialog
			}
			else
			{
				LAi_QuestDelay("terrace_out1_A", 1.0);

			}
		break;

		case "terrace_out1_A":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "terr_in1");

			LAi_QuestDelay("terrace_out2", 1.0);
		break;

		case "terrace_out2":
			LAi_SetPlayerType(Pchar);
			PlaySound("PEOPLE\Run_stone.wav");
			ChangeCharacterAddressGroup(Pchar, "Redmond_town_04", "goto", "terr_out2");

			LAi_QuestDelay("terrace_out3", 2.0);
		break;

		case "terrace_out3":
			DoQuestReloadToLocation("Redmond_town_01", "goto", "terr_out3", "terrace_out4");
		break;

		case "terrace_out4":
			PlaySound("PEOPLE\Run_stone.wav");

			LAi_QuestDelay("terrace_out5", 2.0);
		break;

		case "terrace_out5":
			PlaySound("INTERFACE\rusty.wav");
			ChangeCharacterAddressGroup(Pchar, "Redmond_town_01", "reload", "reload6");

	//RESTARTS WAY IN
			pchar.quest.terrace_in1.win_condition.l1 = "locator";
			pchar.quest.terrace_in1.win_condition.l1.location = "Redmond_town_04";
			pchar.quest.terrace_in1.win_condition.l1.locator_group = "goto";
			pchar.quest.terrace_in1.win_condition.l1.locator = "terr_in1";
			pchar.quest.terrace_in1.win_condition = "terrace_in1";
		break;
//...................................................................................................................
		case "terrace_in1":
			//Locations[FindLocation("wr_residence")].reload.l1.disable = 0;		//if locked to terrace
			PlaySound("INTERFACE\rusty.wav");

			LAi_QuestDelay("terrace_in2", 2.0);
		break;

		case "terrace_in2":
			PlaySound("PEOPLE\Run_stone.wav");
			ChangeCharacterAddressGroup(Pchar, "Redmond_town_04", "goto", "terr_in2");

			LAi_QuestDelay("terrace_in3", 2.0);
		break;

		case "terrace_in3":
			PlaySound("PEOPLE\Run_stone.wav");
			ChangeCharacterAddressGroup(Pchar, "Redmond_town_04", "reload", "reload7");

			pchar.quest.terrace_in4.win_condition.l1 = "locator";
			pchar.quest.terrace_in4.win_condition.l1.location = "wr_residence";
			pchar.quest.terrace_in4.win_condition.l1.locator_group = "reload";
			pchar.quest.terrace_in4.win_condition.l1.locator = "reload1";
			pchar.quest.terrace_in4.win_condition = "terrace_in4";
		break;

		case "terrace_in4":
			PlaySound("INTERFACE\closed_door.wav");

	//RESTARTS WAY OUT
			pchar.quest.terrace_out0.win_condition.l1 = "locator";
			pchar.quest.terrace_out0.win_condition.l1.location = "Redmond_town_04";
			pchar.quest.terrace_out0.win_condition.l1.locator_group = "goto";
			pchar.quest.terrace_out0.win_condition.l1.locator = "terr_out1";
			pchar.quest.terrace_out0.win_condition = "terrace_out0";
		break;
//...................................................................................................................
		case "governor_back11":
			PlaySound("PEOPLE\wood3.wav");
			LAi_QuestDelay("governor_back12", 0.5);
		break;

		case "governor_back12":
			PlaySound("VOICE\ENGLISH\Eng_m_b_057.wav");
			LAi_QuestDelay("governor_back13", 2.0);
		break;

		case "governor_back13":
			PlaySound("OBJECTS\DUEL\monkey_attack2.wav");
		break;

		case "terrace1":
			SetCurrentTime(11.00, 0);
			Locations[FindLocation("Redmond_town_01")].models.always.locators = "Red01_l_JRH3";//with locator outside the gate
			Locations[FindLocation("wr_armory")].models.always.locators = "LS_l_JRH4";//only wallsmoke

			ChangeCharacterAddressGroup(CharacterFromID("wr_oman1X"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("powdermonkey"), "none", "", "");
			if(CheckCharacterItem(Pchar,"cannonballs")) TakeItemFromCharacter(Pchar, "cannonballs");

			LAi_QuestDelay("terrace2", 1.0);
		break;

		case "terrace2":
			LAi_SetActorType(characterFromID("Woodes Rogers"));
			LAi_ActorDialog(characterFromID("Woodes Rogers"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Woodes Rogers"));
			Characters[GetCharacterIndex("Woodes Rogers")].dialog.CurrentNode  = "terrace";
		break;

		case "terrace_dialog":
			//from wr dialog
			SetQuestHeader("Woodes_Rogers_reward_3");
			AddQuestRecord("Woodes_Rogers_reward_3", "1");
			DeleteQuestHeader("Woodes_Rogers_reward_2");

			if(!CheckCharacterItem(Pchar,"bladepickaxe1")) AddQuestRecord("Woodes_Rogers_reward_3", "4");

			Pchar.quest.wr_quest1 = "mission3";
			PlaySound("VOICE\ENGLISH\gr_WR_friend3.wav");

			LAi_QuestDelay("fill_shop_boxes", 0.1);
			LAi_QuestDelay("after_terrace_dialog", 2.0);
		break;

		case "after_terrace_dialog":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "terr_in1");

			LAi_QuestDelay("after_terrace_dialog1", 2.5);
		break;

		case "after_terrace_dialog1":
			Pchar.quest.wr_terrace = "second_time";
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("terrace_out2", 1.0);
		break;

		case "bladepickaxe1_check":
			if(CheckCharacterItem(Pchar,"bladepickaxe1"))
			{
				EquipCharacterByItem(Pchar, "bladepickaxe1");
				ChangeCharacterAddressGroup(CharacterFromID("Redmond Usurer"), "Redmond_UsurerHouse", "goto", "goto1");
				LAi_SetStayType(CharacterFromID("Redmond Usurer"));

				Locations[FindLocation("Redmond_UsurerHouse")].locators_radius.box.box2 = 1.0;
				Locations[FindLocation("Redmond_UsurerHouse")].locators_radius.reload.reload4 = 0.0001;

				LAi_QuestDelay("bladepickaxe1_check1", 0.1);
			}
			else
			{
				LAi_QuestDelay("bladepickaxe1_check", 0.5);
			}
		break;

		case "bladepickaxe1_check1":
			pchar.quest.bladepickaxe1_check2.win_condition.l1 = "locator";
			pchar.quest.bladepickaxe1_check2.win_condition.l1.location = "Redmond_UsurerHouse";
			pchar.quest.bladepickaxe1_check2.win_condition.l1.locator_group = "reload";
			pchar.quest.bladepickaxe1_check2.win_condition.l1.locator = "locator2";
			pchar.quest.bladepickaxe1_check2.win_condition = "bladepickaxe1_check2";
		break;

		case "bladepickaxe1_check2":
			if(CheckCharacterItem(Pchar,"bladepickaxe1"))
			{
				LAi_SetStayType(Pchar);
				Locations[FindLocation("Redmond_UsurerHouse")].reload.l1.disable = 1;//to town
				Locations[FindLocation("wr_armory")].models.always.locators = "LS_l_JRH5";//no smoke

				LAi_QuestDelay("bladepickaxe1_check2A", 1.0);
			}
			else
			{
				LAi_QuestDelay("bladepickaxe1_check", 0.5);//go back to armory & get the stick!
			}
		break;

		case "bladepickaxe1_check2A":
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "officers", "locator2_3", "bladepickaxe1_check2B", 2.0);
		break;

		case "bladepickaxe1_check2B":
			LAi_SetStayType(Pchar);
			PlaySound("VOICE\ENGLISH\Eng_m_b_044.wav");
			LAi_QuestDelay("bladepickaxe1_check2C", 2.0);
		break;

		case "bladepickaxe1_check2C":
			LAi_SetActorType(CharacterFromID("Redmond Usurer"));
			LAi_ActorGoToLocator(characterFromID("Redmond Usurer"), "reload", "locator2", "bladepickaxe1_check2D", 2.0);
		break;

		case "bladepickaxe1_check2D":
			PlaySound("INTERFACE\closed_locked_door.wav");
			ChangeCharacterAddressGroup(CharacterFromID("Redmond Usurer"), "none", "", "");
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], false);
			LAi_SetPlayerType(Pchar);
		break;

		case "stick_on_floorhatch":
			//from itemlogic
			PlaySound("PEOPLE\basket.wav");

			LAi_QuestDelay("stick_on_floorhatch0", 1.0);
		break;

		case "stick_on_floorhatch0":
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem3", 1.1);
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box2", 0.0001);
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload4", 0.0001);

			Locations[FindLocation("Redmond_UsurerHouse")].locators_radius.randitem.randitem3 = 1.1;
			Locations[FindLocation("Redmond_UsurerHouse")].locators_radius.box.box2 = 0.0001;
			Locations[FindLocation("Redmond_UsurerHouse")].locators_radius.reload.reload4 = 0.0001;
			locations[FindLocation("Loanshark_cellar")].id.label = "Loanshark cellar";

			LAi_QuestDelay("stick_on_floorhatch1", 0.1);
		break;

		case "stick_on_floorhatch1":
			Locations[FindLocation("Redmond_UsurerHouse")].image = "Inside_StoreSmall.tga";	//after merge
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(PChar, false);

			LAi_QuestDelay("stick_on_floorhatch2", 0.1);
		break;

		case "stick_on_floorhatch2":
			if(CheckCharacterItem(Pchar,"hatch2"))
			{
				PlaySound("OBJECTS\DUEL\sword_fallen.wav");
				TakeItemFromCharacter(Pchar, "hatch2");

				SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem3", 0.0001);
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box2", 0.0001);
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload4", 0.5);

				Locations[FindLocation("Redmond_UsurerHouse")].locators_radius.randitem.randitem3 = 0.0001;
				Locations[FindLocation("Redmond_UsurerHouse")].locators_radius.box.box2 = 0.0001;
				Locations[FindLocation("Redmond_UsurerHouse")].locators_radius.reload.reload4 = 0.5;
				Locations[FindLocation("Redmond_UsurerHouse")].reload.l6.disable = 0;//to cellar

				LAi_QuestDelay("loanshark_cellar", 1.0);
			}
			else
			{
				LAi_QuestDelay("stick_on_floorhatch2", 0.5);
			}
		break;

		case "loanshark_cellar":
			Locations[FindLocation("Redmond_UsurerHouse")].image = "Inside_StoreSmall.tga";//after merge

			pchar.quest.loanshark_cellar1.win_condition.l1 = "locator";
			pchar.quest.loanshark_cellar1.win_condition.l1.location = "Loanshark_cellar";
			pchar.quest.loanshark_cellar1.win_condition.l1.locator_group = "reload";
			pchar.quest.loanshark_cellar1.win_condition.l1.locator = "reload2";
			pchar.quest.loanshark_cellar1.win_condition = "loanshark_cellar1";
		break;

		case "loanshark_cellar1":
			locations[FindLocation(Pchar.location)].box1.items.key6 = 1;

			LAi_QuestDelay("loanshark_cellar2", 0.1);
		break;

		case "loanshark_cellar2":
			if(CheckCharacterItem(Pchar,"key6"))
			{
				AddQuestRecord("Woodes_Rogers_reward_3", "2");

				if(IsEquipCharacterByItem(Pchar, "bladepickaxe1")) RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "blade4-2");

				PlaySound("INTERFACE\took_item.wav");
				Locations[FindLocation("Redmond_Town_01")].reload.l23.disable = 1;//gate to terrace

				Locations[FindLocation("Redmond_UsurerHouse")].locators_radius.box.box1 = 1.0;
				Locations[FindLocation("Redmond_UsurerHouse")].locators_radius.reload.locator1 = 0.0001;
			}
			else
			{
				LAi_QuestDelay("loanshark_cellar2", 0.5);//loop check
			}
		break;
//-----------------------------------------------------------------------------------------------------------
		case "fill_shop_boxes":
			pchar.quest.fill_shop_boxes1.win_condition.l1 = "locator";
			pchar.quest.fill_shop_boxes1.win_condition.l1.location = "wr_shop";
			pchar.quest.fill_shop_boxes1.win_condition.l1.locator_group = "reload";
			pchar.quest.fill_shop_boxes1.win_condition.l1.locator = "reload6";
			pchar.quest.fill_shop_boxes1.win_condition = "fill_shop_boxes1";
		break;

		case "fill_shop_boxes1":
			locations[FindLocation(Pchar.location)].box9.items.indian16 = 1;
			locations[FindLocation(Pchar.location)].box10.items.indian13 = 1;
			locations[FindLocation(Pchar.location)].box11.items.meds4 = 1;
			locations[FindLocation(Pchar.location)].box12.items.chinatiger = 1;
		break;

		case "pistol3":
			ChangeCharacterAddressGroup(Pchar, "wr_shop", "goto", "goto3");
			PlaySound("PEOPLE\step_stairway.wav");

			LAi_QuestDelay("pistol3_check", 0.1);
		break;

		case "pistol3_check":
			if(CheckCharacterItem(Pchar,"pistol203"))
			{
				AddQuestRecord("Woodes_Rogers_reward_3", "3");
				Pchar.quest.wr_quest1 = "pistol3";
				Pchar.quest.wr_shoppistol = "yes";
				EquipCharacterByItem(Pchar, "pistol203");

				Locations[FindLocation("Redmond_town_01")].reload.l10.disable = 0;//to loanshark
				Locations[FindLocation("Redmond_UsurerHouse")].reload.l1.disable = 0;//to town
				Locations[FindLocation("wr_library")].reload.l6.disable = 1;//to loansh
				Locations[FindLocation("wr_library")].reload.l3.disable = 0;//to attic

				Locations[FindLocation("Tavern_storeroom")].reload.l4.disable = 0;//to Windem room
				Locations[FindLocation("Charles_Windem_room")].reload.l3.disable = 0;//to storeroom, needed?
				Locations[FindLocation("Charles_Windem_room")].reload.l2.disable = 0;//to attic

				Locations[FindLocation("Redmond_town_01")].reload.l11.disable = 1;//to tavern
				Locations[FindLocation("Redmond_tavern")].reload.l1.disable = 1;//to town
				Locations[FindLocation("Redmond_town_01")].reload.l31.disable = 1;//to tavern from balcony
				Locations[FindLocation("Redmond_tavern")].reload.l3.disable = 1;//to balcony
				locations[FindLocation("Redmond_tavern")].id.label = "CLOSED BECAUSE OF ILLNESS - Charles Windem innkeeper";

				Locations[FindLocation("Redmond_tavern")].reload.l2.disable = 0;//to room upstairs
				Locations[FindLocation("JRH_tavern_upstairs")].reload.l2.disable = 0;//to wr bed

				ChangeCharacterAddressGroup(CharacterFromID("Redmond Usurer"), "Redmond_UsurerHouse", "sit", "sit1");
				LAi_SetSitType(CharacterFromID("Redmond Usurer"));

				ChangeCharacterAddressGroup(CharacterFromID("Charles Windem"), "Charles_Windem_room", "sit", "sit2");
				LAi_SetActorType(CharacterFromID("Charles Windem"));
				LAi_ActorSetLayMode(CharacterFromID("Charles Windem"));

				ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "ck_bedroom", "goto", "goto3");
				LAi_SetStayType(CharacterFromID("Wench3"));
				ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "wr_bedroom", "goto", "goto5");
				LAi_SetStayType(characterFromID("Woodes Rogers"));
				ChangeCharacterAddressGroup(CharacterFromID("Selkirk"), "wr_booty", "sit", "sit1");
				LAi_SetSitType(characterFromID("Selkirk"));

				ChangeCharacterAddressGroup(CharacterFromID("Dave Edna"), "wr_shop", "sit", "sit1");

				locations[FindLocation("storeroom_attic")].id.label = "Storeroom attic";

				LAi_QuestDelay("pistol3_start", 0.1);
			}
			else
			{
				LAi_QuestDelay("pistol3_check", 0.5);//loop check
			}
		break;

		case "pistol3_start":
			ChangeCharacterAddressGroup(Pchar, "wr_shop", "goto", "goto5");
			PlaySound("PEOPLE\jump.wav");

			LAi_QuestDelay("dave_talks", 1.5);
			LAi_QuestDelay("selkirk_dialog", 0.1);
			LAi_QuestDelay("dave_arrives", 1.5);
			LAi_QuestDelay("shop_check", 0.1);
		break;
//-----------------------------------------------------------------------------------------------------------
		case "elevator_up":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto2");
			LAi_QuestDelay("elevator_up1", 1.0);
		break;

		case "elevator_up1":
			PlaySound("INTERFACE\elevator_1.wav");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("elevator_up2", 0.5);
		break;

		case "elevator_up2":
			ChangeCharacterAddressGroup(Pchar, "Dave_Edna_room", "goto", "elevator1");
			LAi_QuestDelay("elevator_up3", 0.5);
		break;

		case "elevator_up3":
			ChangeCharacterAddressGroup(Pchar, "Dave_Edna_room", "goto", "elevator2");
			LAi_QuestDelay("elevator_up4", 0.5);
		break;

		case "elevator_up4":
			DoQuestReloadToLocation("wr_shop", "goto", "elevator", "elevator_up6");
		break;

		case "elevator_up6":
			PlaySound("INTERFACE\elevator_2.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_shop", "goto", "elevator");
			LAi_QuestDelay("elevator_up7", 1.0);
		break;

		case "elevator_up7":
			ChangeCharacterAddressGroup(Pchar, "wr_shop", "goto", "elevator1");
			LAi_QuestDelay("elevator_up8", 0.5);
		break;

		case "elevator_up8":
			ChangeCharacterAddressGroup(Pchar, "wr_shop", "goto", "elevator2");
			LAi_QuestDelay("elevator_up9", 0.5);
		break;

		case "elevator_up9":
			ChangeCharacterAddressGroup(Pchar, "wr_shop", "goto", "elevator3");
			LAi_QuestDelay("elevator_up10", 0.5);
		break;

		case "elevator_up10":
			ChangeCharacterAddressGroup(Pchar, "wr_shop", "goto", "elevator4");
			LAi_QuestDelay("elevator_up11", 0.5);
		break;

		case "elevator_up11":
			DoQuestReloadToLocation("wr_mother", "goto", "elevator", "elevator_up13");
		break;

		case "elevator_up13":
			PlaySound("INTERFACE\elevator_3.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_mother", "goto", "elevator");
			LAi_QuestDelay("elevator_up14", 1.0);
		break;

		case "elevator_up14":
			LAi_SetPlayerType(Pchar);
			Pchar.quest.wr_elevator = "up";

			if(CheckAttribute(Pchar,"quest.medicine_quest") && Pchar.quest.medicine_quest == "started")
			{
				Locations[FindLocation("wr_shop")].models.always.locators = "residence05_locators_JRH_Lup_mdc";
			}
			else Locations[FindLocation("wr_shop")].models.always.locators = "residence05_locators_JRH_Lup";
		break;
//-----------------------------------------------------------------------------------------------------------
		case "elevator_down":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto5");
			LAi_QuestDelay("elevator_down1", 1.0);
		break;

		case "elevator_down1":
			PlaySound("INTERFACE\elevator_1.wav");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("elevator_down2", 1.0);
		break;

		case "elevator_down2":
			DoQuestReloadToLocation("wr_shop", "goto", "elevator4", "elevator_down3");
		break;

		case "elevator_down3":
			PlaySound("INTERFACE\elevator_2.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_shop", "goto", "elevator4");
			LAi_QuestDelay("elevator_down4", 1.0);
		break;

		case "elevator_down4":
			ChangeCharacterAddressGroup(Pchar, "wr_shop", "goto", "elevator3");
			LAi_QuestDelay("elevator_down5", 0.5);
		break;

		case "elevator_down5":
			ChangeCharacterAddressGroup(Pchar, "wr_shop", "goto", "elevator2");
			LAi_QuestDelay("elevator_down6", 0.5);
		break;

		case "elevator_down6":
			ChangeCharacterAddressGroup(Pchar, "wr_shop", "goto", "elevator1");
			LAi_QuestDelay("elevator_down7", 0.5);
		break;

		case "elevator_down7":
			ChangeCharacterAddressGroup(Pchar, "wr_shop", "goto", "elevator");
			LAi_QuestDelay("elevator_down8", 0.5);
		break;

		case "elevator_down8":
			DoQuestReloadToLocation("Dave_Edna_room", "goto", "elevator2", "elevator_down9");
		break;

		case "elevator_down9":
			PlaySound("INTERFACE\elevator_3.wav");
			ChangeCharacterAddressGroup(Pchar, "Dave_Edna_room", "goto", "elevator2");
			LAi_QuestDelay("elevator_down10", 1.0);
		break;

		case "elevator_down10":
			ChangeCharacterAddressGroup(Pchar, "Dave_Edna_room", "goto", "elevator1");
			LAi_QuestDelay("elevator_down11", 0.5);
		break;

		case "elevator_down11":
			ChangeCharacterAddressGroup(Pchar, "Dave_Edna_room", "goto", "elevator");
			LAi_QuestDelay("elevator_down12", 0.5);
		break;

		case "elevator_down12":
			LAi_SetPlayerType(Pchar);
			Pchar.quest.wr_elevator = "down";

			if(CheckAttribute(Pchar,"quest.medicine_quest") && Pchar.quest.medicine_quest == "started")
			{
				Locations[FindLocation("wr_shop")].models.always.locators = "residence05_locators_JRH_Ldown_mdc";
			}
			else Locations[FindLocation("wr_shop")].models.always.locators = "residence05_locators_JRH_Ldown";
		break;
//-----------------------------------------------------------------------------------------------------------
		case "elevator_lever":
			DoQuestReloadToLocation("wr_shop", "goto", "goto14", "elevator_lever1");
		break;

		case "elevator_lever1":
			PlaySound("INTERFACE\elevator.wav");
			Locations[FindLocation("wr_shop")].image = "wr_shop.tga";
		break;
//-----------------------------------------------------------------------------------------------------------
		case "dave_talks":
			PlaySound("VOICE\ENGLISH\Dave_Edna_1.wav");
		break;

		case "shop_check":
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload6", 0.001);

			Pchar.quest.shop_check1.win_condition.l1 = "locator";
			Pchar.quest.shop_check1.win_condition.l1.location = "wr_shop";
			Pchar.quest.shop_check1.win_condition.l1.locator_group = "goto";	//was reload
			Pchar.quest.shop_check1.win_condition.l1.locator = "goto17";		//was reload6
			Pchar.quest.shop_check1.win_condition = "shop_check1";
		break;

		case "shop_check1":
			if(CheckAttribute(Pchar,"quest.wr_shop") && Pchar.quest.wr_shop == "box8_tour_open" || CheckCharacterItem(Pchar,"key9") )
			{
				return;
			}
			else
			{
				PlaySound("VOICE\ENGLISH\defoe_psst.wav");
				LAi_SetStayType(Pchar);
				LAi_QuestDelay("shop_check2", 1.0);
			}
		break;

		case "shop_check2":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "sit", "sit1");
			LAi_QuestDelay("shop_check3", 1.0);
		break;

		case "shop_check3":
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "goto13", "Dave_Edna_dialog", 2.0);
		break;

		case "dave_arrives":
			if(CheckAttribute(Pchar,"quest.wr_shop") && Pchar.quest.wr_shop == "box8_tour_open" || CheckCharacterItem(Pchar,"key9") )
			{
				return;
			}
			else
			{
				Pchar.quest.Dave_Edna_dialog.win_condition.l1 = "locator";
				Pchar.quest.Dave_Edna_dialog.win_condition.l1.location = "wr_shop";
				Pchar.quest.Dave_Edna_dialog.win_condition.l1.locator_group = "goto";
				Pchar.quest.Dave_Edna_dialog.win_condition.l1.locator = "goto13";
				Pchar.quest.Dave_Edna_dialog.win_condition = "Dave_Edna_dialog";
			}
		break;

		case "Dave_Edna_dialog":
			LAi_SetActorType(characterFromID("Dave Edna"));
			LAi_ActorDialog(characterFromID("Dave Edna"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Dave Edna"));
			Characters[GetCharacterIndex("Dave Edna")].dialog.CurrentNode  = "shop_closed";
		break;

		case "key9":
			//from Dave Edna dialog
			LAi_SetStayType(characterFromID("Dave Edna"));
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload6", 0.5);//reset to normal size
			LAi_SetPlayerType(Pchar);
			GiveItem2Character(Pchar, "key9");
			PlaySound("INTERFACE\took_item.wav");

			LAi_QuestDelay("Dave_Edna_hint_Selkirk", 1.0);
		break;

		case "Dave_Edna_hint_Selkirk":
			LAi_SetActorType(characterFromID("Dave Edna"));
			LAi_ActorDialog(characterFromID("Dave Edna"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Dave Edna"));
			Characters[GetCharacterIndex("Dave Edna")].dialog.CurrentNode  = "Selkirk_hint";
		break;

		case "Dave_Edna_hint_Selkirk1":
			//from Dave dialog

			AddQuestRecord("Woodes_Rogers_reward_3", "5");
		break;

		case "shop_box5_tour1":
			PlaySound("PEOPLE\run_wood.wav");
			LAi_QuestDelay("shop_box5_tour2", 1.0);
		break;

		case "shop_box5_tour2":
			PlaySound("PEOPLE\run_wood.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_shop", "goto", "goto1");
		break;

		case "shop_box_run_sound":
			PlaySound("PEOPLE\run_wood.wav");
		break;

		case "shop_box8_tour":
			Pchar.quest.shop_box8_tour1.win_condition.l1 = "locator";
			Pchar.quest.shop_box8_tour1.win_condition.l1.location = "wr_shop";
			Pchar.quest.shop_box8_tour1.win_condition.l1.locator_group = "goto";
			Pchar.quest.shop_box8_tour1.win_condition.l1.locator = "goto7";
			Pchar.quest.shop_box8_tour1.win_condition = "shop_box_run_sound";

			ChangeCharacterAddressGroup(Pchar, "wr_shop", "goto", "goto7");
		break;

		case "shop_box12_tour1":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box8");
			LAi_QuestDelay("shop_box12_tour2", 1.0);
		break;

		case "shop_box12_tour2":
			LAi_SetPlayerType(Pchar);
			PlaySound("PEOPLE\run_wood.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_shop", "goto", "goto12");
		break;
//-------------------------------------------------------------------------------------------------------------
	//[5] from here
//main line
		case "selkirk_dialog":
			Pchar.quest.selkirk_dialog1.win_condition.l1 = "locator";
			Pchar.quest.selkirk_dialog1.win_condition.l1.location = "wr_booty";
			Pchar.quest.selkirk_dialog1.win_condition.l1.locator_group = "goto";
			Pchar.quest.selkirk_dialog1.win_condition.l1.locator = "goto15";
			Pchar.quest.selkirk_dialog1.win_condition = "selkirk_dialog1";
		break;

		case "selkirk_dialog1":
			LAi_SetActorType(characterFromID("Selkirk"));
			LAi_ActorDialog(characterFromID("Selkirk"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Selkirk"));
			Characters[GetCharacterIndex("Selkirk")].dialog.CurrentNode  = "marooned";
		break;

		case "friday_arrives":
			PlaySound("VOICE\ENGLISH\gr_friday1.wav");
			ChangeCharacterAddressGroup(CharacterFromID("Friday"), "wr_booty", "reload", "reload1");
			LAi_QuestDelay("friday_arrives2", 1.0);
		break;

		case "friday_arrives2":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload1");
			LAi_QuestDelay("friday_arrives3", 1.0);
		break;

		case "friday_arrives3":
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");

			LAi_QuestDelay("selkirk_dialog2", 1.0);
		break;

		case "selkirk_dialog2":
			LAi_SetActorType(characterFromID("Selkirk"));
			LAi_ActorDialog(characterFromID("Selkirk"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Selkirk"));
			Characters[GetCharacterIndex("Selkirk")].dialog.CurrentNode  = "translate";
		break;

		case "translate_over":
			AddQuestRecord("Woodes_Rogers_reward_3", "6");
			LAi_SetSitType(characterFromID("Selkirk"));
			LAi_SetActorType(characterFromID("Friday"));
			LAi_ActorGoToLocator(characterFromID("Friday"), "goto", "goto14", "translate_over2", 5.0);

			LAi_QuestDelay("friday_close_door", 9.0);
		break;

		case "friday_close_door":
			PlaySound("INTERFACE\closed_door.wav");
		break;

		case "translate_over2":
			ChangeCharacterAddressGroup(CharacterFromID("friday"), "wr_friday", "goto", "goto5");
			LAi_SetPlayerType(Pchar);

			Pchar.quest.wr_quest2 = "shut_up_Caroline";
			locations[FindLocation("ck_bedroom")].id.label = "Caroline K's bedroom";
			Locations[FindLocation("wr_kitchen")].reload.l5.disable = 0;//kitchen to Car bed

			LAi_QuestDelay("key8", 0.1);
			LAi_QuestDelay("CK_bedroom", 0.1);
		break;

		case "key8":
			if(CheckCharacterItem(Pchar,"key8"))
			{
				PlaySound("INTERFACE\took_item.wav");
			}
			else
			{
				LAi_QuestDelay("key8", 0.5);//loop check
			}
		break;

		case "CK_bedroom":
			Pchar.quest.ck_bedroom1.win_condition.l1 = "locator";
			Pchar.quest.ck_bedroom1.win_condition.l1.location = "ck_bedroom";
			Pchar.quest.ck_bedroom1.win_condition.l1.locator_group = "goto";
			Pchar.quest.ck_bedroom1.win_condition.l1.locator = "goto3";
			Pchar.quest.ck_bedroom1.win_condition = "ck_bedroom1";
		break;

		case "ck_bedroom1":
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));

			if(Pchar.model == "pira4B")
			{
				Characters[GetCharacterIndex("Wench3")].dialog.CurrentNode  = "wash_yourself";
			}
			else
			{
				Characters[GetCharacterIndex("Wench3")].dialog.CurrentNode  = "ck_bedroom2";
			}
		break;

		case "wash_yourself":
			//from ck dialog
			DoQuestReloadToLocation("wr_kitchen", "reload", "reload5", "wash_yourself1");
		break;

		case "wash_yourself1":
			//from ck dialog
			Pchar.quest.wr_quest2 = "shut_up_Caroline";
			LAi_QuestDelay("CK_bedroom", 0.1);	//loop
		break;

		case "ck_bedroom3":
			//from ck dialog
			AddQuestRecord("Woodes_Rogers_reward_3", "7");

			Pchar.quest.wr_quest2 = "shut_up_Caroline";
			SetModel(PChar, "Pira4M_H", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);
			PlaySound("OBJECTS\DUEL\man_attack6.wav");

			LAi_QuestDelay("CK_bedroom4", 2.0);
			//LAi_QuestDelay("steplock_bedroom", 0.1);
		break;

		case "ck_bedroom4":
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
			Characters[GetCharacterIndex("Wench3")].dialog.CurrentNode  = "ck_bedroom4";
		break;

		case "steplock_bedroom":
			//from ck dialog
			AddQuestRecord("Woodes_Rogers_reward_3", "8");
			CloseQuestHeader("Woodes_Rogers_reward_3");
		LAi_SetCitizenType(characterFromID("Wench3"));				//try already here

			pchar.quest.steplock_bedroom1.win_condition.l1 = "locator";
			pchar.quest.steplock_bedroom1.win_condition.l1.location = "ck_bedroom";
			pchar.quest.steplock_bedroom1.win_condition.l1.locator_group = "goto";
			pchar.quest.steplock_bedroom1.win_condition.l1.locator = "goto2";
			pchar.quest.steplock_bedroom1.win_condition = "steplock_bedroom1";
		break;

		case "steplock_bedroom1":
			LAi_SetCitizenType(characterFromID("Wench3"));
			PlaySound("INTERFACE\step_open.wav");
			Locations[FindLocation("wr_kitchen")].reload.l2.disable = 0;//to wr_bedroom
			Locations[FindLocation("wr_bedroom")].reload.l2.disable = 0;//to kitchen
			LAi_QuestDelay("wr_bedroom", 0.1);
		break;

		case "wr_bedroom":
			Pchar.quest.wr_bedroom1.win_condition.l1 = "locator";
			Pchar.quest.wr_bedroom1.win_condition.l1.location = "wr_bedroom";
			Pchar.quest.wr_bedroom1.win_condition.l1.locator_group = "goto";
			Pchar.quest.wr_bedroom1.win_condition.l1.locator = "goto8";
			Pchar.quest.wr_bedroom1.win_condition = "wr_bedroom1";
		break;

		case "wr_bedroom1":
			LAi_SetActorType(characterFromID("Woodes Rogers"));
			LAi_ActorDialog(characterFromID("Woodes Rogers"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Woodes Rogers"));
			Characters[GetCharacterIndex("Woodes Rogers")].dialog.CurrentNode  = "mission4";
		break;

		case "mission4_given":
			//from wr dialog
			SetQuestHeader("Woodes_Rogers_reward_4");
			AddQuestRecord("Woodes_Rogers_reward_4", "1");
			DeleteQuestHeader("Woodes_Rogers_reward_3");

			Pchar.quest.wr_quest1 = "just_greeting";
			Pchar.quest.wr_kitchendoor = "stuck";
			Locations[FindLocation("wr_kitchen")].models.always.locators = "FlamHouse_locators_JRH2";
			Locations[FindLocation("wr_kitchen")].reload.l1.disable = 1;//to town
			Locations[FindLocation("Redmond_Town_01")].reload.l16.disable = 1;//to kitchen

			LAi_SetPlayerType(Pchar);
			LAi_SetCitizenType(characterFromID("Woodes Rogers"));
			PlaySound("VOICE\ENGLISH\gr_WR_friend2.wav");
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l1.disable = 1;//to town
			Locations[FindLocation("Redmond_Town_01")].reload.l10.disable = 1;//to LS
			locations[FindLocation("Redmond_UsurerHouse")].id.label = "TEMPORARY OUT OF GOLD. OPEN SOON AGAIN. Robyn Corrick - bank manager";
			ChangeCharacterAddressGroup(CharacterFromID("Redmond Usurer"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("Dave Edna"), "none", "", "");

			Locations[FindLocation("Tavern_storeroom")].reload.l4.disable = 0;//to Windem room
			Locations[FindLocation("Charles_Windem_room")].reload.l2.disable = 0;//to attic
			locations[FindLocation("storeroom_attic")].id.label = "Storeroom attic";
			locations[FindLocation("storeroom_attic")].id.label = "Storeroom attic";

			locations[FindLocation("Redmond_tavern")].type = "house";
			Locations[FindLocation("Redmond_tavern")].models.always.locators = "LT_l_JRH3";//without characters
			Locations[FindLocation("wr_library")].reload.l3.disable = 0;//open to attic
			Locations[FindLocation("wr_library")].models.always.locators = "Res02_l_JRH1";//visible derricks

			Pchar.quest.windem_effects.win_condition.l1 = "locator";
			Pchar.quest.windem_effects.win_condition.l1.location = "Charles_Windem_room";
			Pchar.quest.windem_effects.win_condition.l1.locator_group = "reload";
			Pchar.quest.windem_effects.win_condition.l1.locator = "reload3";
			Pchar.quest.windem_effects.win_condition = "windem_effects";
		break;
//---------------------------------------------------------------------------------------------------------------
		case "windem_effects":
			PlaySound("VOICE\ENGLISH\windem_drunk.wav");
			GetCharacterPos(CharacterFromID("Charles Windem"), &u, &v, &w);
			CreateParticleSystem("stars_short" , u, v+1, w, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("windem_effects1", 3.5);
			LAi_QuestDelay("attic_steplock_open", 0.1);//was attic_steplock_open
		break;

		case "windem_effects1":
			if(CheckAttribute(Pchar,"quest.rum_phase") && Pchar.quest.rum_phase == "4") return;

			if(Pchar.location == "Charles_Windem_room")
			{
				PlaySound("PEOPLE\snoring.wav");
				LAi_QuestDelay("windem_effects1", 3.5);
			}
			else
			{
				//no snoring please

				pchar.quest.windem_effects1.win_condition.l1 = "location";
				pchar.quest.windem_effects1.win_condition.l1.location = "Charles_Windem_room";
				pchar.quest.windem_effects1.win_condition = "windem_effects1";
			}
		break;
//-----------------------------------------------------------------------------------------------------------
		case "attic_steplock_open":
			pchar.quest.attic_steplock_open1.win_condition.l1 = "locator";
			pchar.quest.attic_steplock_open1.win_condition.l1.location = "storeroom_attic";
			pchar.quest.attic_steplock_open1.win_condition.l1.locator_group = "goto";
			pchar.quest.attic_steplock_open1.win_condition.l1.locator = "goto4";
			pchar.quest.attic_steplock_open1.win_condition = "attic_steplock_open1";
		break;

		case "attic_steplock_open1":
			ChangeCharacterAddressGroup(CharacterFromID("wr_boc4"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_cor1_1"), "none", "", "");

			Pchar.quest.wr_libstep = "libstep_path_1";
			//LogIt("wr_libstep = " + Pchar.quest.wr_libstep);
			PlaySound("INTERFACE\step_path.wav");

			LAi_QuestDelay("libstep_one", 0.5);
			LAi_QuestDelay("libstep_A", 0.1);
			LAi_QuestDelay("libstep_B", 0.1);
			LAi_QuestDelay("libstep_C", 0.1);
			LAi_QuestDelay("libstep_E", 0.1);
		break;
//..................................................................................................................
		case "libstep_one":
			PlaySound("VOICE\ENGLISH\blaze_1.wav");
		break;

		case "libstep_two":
			PlaySound("VOICE\ENGLISH\blaze_2.wav");
		break;

		case "libstep_three":
			PlaySound("VOICE\ENGLISH\blaze_3.wav");
		break;

		case "libstep_four":
			PlaySound("VOICE\ENGLISH\blaze_4.wav");
		break;

		case "libstep_five":
			PlaySound("VOICE\ENGLISH\blaze_5.wav");
		break;

		case "libstep_miss":
			PlaySound("VOICE\ENGLISH\blaze_miss.wav");
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Oh no, I have to start all over again!"));
		break;
//..................................................................................................................
		case "libstep_A":
			pchar.quest.libstep_A_effect.win_condition.l1 = "locator";
			pchar.quest.libstep_A_effect.win_condition.l1.location = "wr_library";
			pchar.quest.libstep_A_effect.win_condition.l1.locator_group = "goto";
			pchar.quest.libstep_A_effect.win_condition.l1.locator = "goto10";
			pchar.quest.libstep_A_effect.win_condition = "libstep_A_effect";
		break;

		case "libstep_A_effect":
			if(CheckAttribute(Pchar,"quest.wr_libstep"))
			{
			    switch(Pchar.quest.wr_libstep)
			    {
				case "libstep_path_1": LAi_QuestDelay("libstep_reset", 0.1); break;

				case "libstep_path_2": LAi_QuestDelay("libstep_reset", 0.1); break;

				case "libstep_path_4": LAi_QuestDelay("libstep_open", 0.1); break;

				//default:
			    }
			    return;
			}
		break;

		case "libstep_B":
			pchar.quest.libstep_B_effect.win_condition.l1 = "locator";
			pchar.quest.libstep_B_effect.win_condition.l1.location = "wr_library";
			pchar.quest.libstep_B_effect.win_condition.l1.locator_group = "goto";
			pchar.quest.libstep_B_effect.win_condition.l1.locator = "goto11";
			pchar.quest.libstep_B_effect.win_condition = "libstep_B_effect";
		break;

		case "libstep_B_effect":
			if(CheckAttribute(Pchar,"quest.wr_libstep"))
			{
			    switch(Pchar.quest.wr_libstep)
			    {
				case "libstep_path_1":
					Pchar.quest.wr_libstep = "libstep_path_2";
					//LogIt("wr_libstep = " + Pchar.quest.wr_libstep);
					PlaySound("INTERFACE\step_path.wav");

					LAi_QuestDelay("libstep_two", 0.5);
				break;

				case "libstep_path_3":
					Pchar.quest.wr_libstep = "libstep_path_4";
					//LogIt("wr_libstep = " + Pchar.quest.wr_libstep);
					PlaySound("INTERFACE\step_path.wav");

					LAi_QuestDelay("libstep_four", 0.5);
					LAi_QuestDelay("libstep_A", 0.1);
					LAi_QuestDelay("libstep_C", 0.1);
				break;

				//default:
			    }
			    return;
			}
		break;

		case "libstep_C":
			pchar.quest.libstep_C_effect.win_condition.l1 = "locator";
			pchar.quest.libstep_C_effect.win_condition.l1.location = "wr_library";
			pchar.quest.libstep_C_effect.win_condition.l1.locator_group = "goto";
			pchar.quest.libstep_C_effect.win_condition.l1.locator = "goto12";
			pchar.quest.libstep_C_effect.win_condition = "libstep_C_effect";
		break;

		case "libstep_C_effect":
			if(CheckAttribute(Pchar,"quest.wr_libstep"))
			{
			    switch(Pchar.quest.wr_libstep)
			    {
				case "libstep_path_2":
					Pchar.quest.wr_libstep = "libstep_path_3";
					//LogIt("wr_libstep = " + Pchar.quest.wr_libstep);
					PlaySound("INTERFACE\step_path.wav");

					LAi_QuestDelay("libstep_three", 0.5);
					LAi_QuestDelay("libstep_B", 0.1);
				break;

				case "libstep_path_4":
					LAi_QuestDelay("libstep_reset", 0.1);
				break;

				//default:
			    }
			    return;
			}
		break;

		case "libstep_E":
			pchar.quest.libstep_E_effect.win_condition.l1 = "locator";
			pchar.quest.libstep_E_effect.win_condition.l1.location = "wr_library";
			pchar.quest.libstep_E_effect.win_condition.l1.locator_group = "goto";
			pchar.quest.libstep_E_effect.win_condition.l1.locator = "goto9";
			pchar.quest.libstep_E_effect.win_condition = "libstep_E_effect";
		break;

		case "libstep_E_effect":
			if(CheckAttribute(Pchar,"quest.wr_libstep"))
			{
			    switch(Pchar.quest.wr_libstep)
			    {
				case "libstep_path_3": LAi_QuestDelay("libstep_reset", 0.1); break;

				case "libstep_open":
					PlaySound("OBJECTS\DUEL\man_attack6.wav");
				break;

				//default:
			    }
			    return;
			}
		break;

		case "libstep_open":
			Pchar.quest.wr_libstep = "libstep_open";
			//LogIt("wr_libstep = " + Pchar.quest.wr_libstep);
			PlaySound("INTERFACE\step_open.wav");

			LAi_QuestDelay("libstep_five", 0.5);

			Locations[FindLocation("wr_library")].reload.l6.name = "reload6";			//on when door is opened from here to LS
			Locations[FindLocation("wr_library")].reload.l6.go = "Redmond_UsurerHouse";
			Locations[FindLocation("wr_library")].reload.l6.emerge = "reload5";
			Locations[FindLocation("wr_library")].reload.l6.autoreload = "0";
			Locations[FindLocation("wr_library")].reload.l6.label = "Loanshark's Office.";
			Locations[FindLocation("wr_library")].reload.l6.disable = 0;

			Locations[FindLocation("Redmond_UsurerHouse")].reload.l3.name = "reload5";
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l3.go = "wr_library";
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l3.emerge = "reload6";
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l3.autoreload = "0";
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l3.label = "Woodes Rogersī library.";
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l3.disable = 0;

			pchar.quest.padlock_shop.win_condition.l1 = "location";
			pchar.quest.padlock_shop.win_condition.l1.location = "wr_shop";
			pchar.quest.padlock_shop.win_condition = "padlock_shop";
		break;

		case "padlock_shop":
			LAi_QuestDelay("padlock_shop1", 3.0);
		break;

		case "padlock_shop1":
			PlaySound("VOICE\ENGLISH\blaze_mhm.wav");
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Okay, I'm in the Shop now. Where am I supposed to use the padlock?"));
			AddQuestRecord("Woodes_Rogers_reward_4", "2");
		break;

		case "libstep_reset":
			Pchar.quest.wr_libstep = "libstep_reset";
			//LogIt("wr_libstep = " + Pchar.quest.wr_libstep);
			PlaySound("INTERFACE\step_reset.wav");

			LAi_QuestDelay("libstep_miss", 2.0);
			LAi_QuestDelay("attic_steplock_open", 0.1);
		break;
//-----------------------------------------------------------------------------------------------------------
		case "shop_closet":
			//from itemlogic
			PlaySound("PEOPLE\run_wood.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_shop", "goto", "goto4");
			TakeItemFromCharacter(Pchar, "key8");
			LAi_QuestDelay("shop_closet2", 0.1);
			LAi_QuestDelay("shop_closet0", 2.0);
		break;

		case "shop_closet0":
			ChangeCharacterAddressGroup(CharacterFromID("Dave Edna"), "wr_shop", "reload", "reload3");
			LAi_SetStayType(CharacterFromID("Dave Edna"));
			Locations[FindLocation("wr_shop")].reload.l3.disable = 0;//to shop entré
			Locations[FindLocation("Redmond_Town_01")].reload.l27.disable = 0;//to shop
			LAi_QuestDelay("shop_closet1", 0.5);
		break;

		case "shop_closet1":
			PlaySound("INTERFACE\closed_door.wav");
			LAi_SetActorType(CharacterFromID("Dave Edna"));
			LAi_ActorGoToLocator(characterFromID("Dave Edna"), "goto", "goto15", "shop_closet3", 8.0);
			LAi_QuestDelay("shop_closet4", 4.0);
			LAi_QuestDelay("shop_closet2_A", 2.0);
		break;

		case "shop_closet2":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto9");
		break;

		case "shop_closet2_A":
			PlaySound("VOICE\ENGLISH\Dave_Edna_3.wav");
		break;

		case "shop_closet3":
			LAi_SetActorType(characterFromID("Dave Edna"));
			LAi_ActorTurnToLocator(characterFromID("Dave Edna"), "reload", "reload2");
			LAi_SetPlayerType(Pchar);
		break;

		case "shop_closet4":
			PlaySound("INTERFACE\Closet_open.wav");
			ChangeCharacterAddressGroup(CharacterFromID("grandma"), "wr_shop", "reload", "reload2");
			LAi_SetStayType(CharacterFromID("grandma"));
			LAi_QuestDelay("shop_closet5", 4.0);
			LAi_QuestDelay("shop_closet6", 1.0);
		break;

		case "shop_closet5":
			PlaySound("VOICE\ENGLISH\grandma_1.wav");
		break;

		case "shop_closet6":
			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_ActorGoToLocator(characterFromID("grandma"), "goto", "goto16", "shop_closet7", 7.0);
		break;

		case "shop_closet7":
			LAi_SetActorType(characterFromID("grandma"));
			LAi_ActorTurnToLocator(characterFromID("grandma"), "reload", "reload2");
			LAi_QuestDelay("shop_closet8", 1.0);
		break;

		case "shop_closet8":
			PlaySound("VOICE\ENGLISH\grandma_yell.wav");
			LAi_QuestDelay("shop_walkers1", 1.0);
		break;

		case "shop_walkers1":
			RemoveCharacterEquip(characterFromID("wr_fsh"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_fsh"), "pistol1");
			RemoveCharacterEquip(characterFromID("wr_fsh"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_fsh"), "blade4");

			GiveItem2Character(CharacterFromID("wr_fsh"), "bladearmchair");
			EquipCharacterbyItem(characterFromID("wr_fsh"), "bladearmchair");
			
			PlaySound("INTERFACE\Closet_open.wav");
			LAi_SetStayType(CharacterFromID("wr_fsh"));
			ChangeCharacterAddressGroup(CharacterFromID("wr_fsh"), "wr_shop", "reload", "reload2");
			LAi_QuestDelay("shop_walkers1_A", 1.0);
		break;

		case "shop_walkers1_A":
			LAi_SetActorType(CharacterFromID("wr_fsh"));
			LAi_ActorGoToLocator(characterFromID("wr_fsh"), "reload", "reload6", "shop_walkers1_B", 8.0);
			LAi_QuestDelay("shop_walkers2", 4.0);
		break;

		case "shop_walkers1_B":
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(CharacterFromID("wr_fsh"), "wr_crew", "sit", "sit2");
			LAi_SetSitType(CharacterFromID("wr_fsh"));
			RemoveCharacterEquip(characterFromID("wr_fsh"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_fsh"), "bladearmchair");

			GiveItem2Character(CharacterFromID("wr_fsh"), "blade4");
			GiveItem2Character(CharacterFromID("wr_fsh"), "pistol1");
			EquipCharacterbyItem(characterFromID("wr_fsh"), "blade4");
			EquipCharacterbyItem(characterFromID("wr_fsh"), "pistol1");
		break;

		case "shop_walkers2":
			PlaySound("INTERFACE\Closet_open.wav");
			LAi_SetStayType(CharacterFromID("wr_fatj"));
			ChangeCharacterAddressGroup(CharacterFromID("wr_fatj"), "wr_shop", "reload", "reload2");
			LAi_QuestDelay("shop_walkers2_A", 1.0);
		break;

		case "shop_walkers2_A":
			LAi_SetActorType(CharacterFromID("wr_fatj"));
			LAi_ActorGoToLocator(characterFromID("wr_fatj"), "reload", "reload6", "shop_walkers2_B", 8.0);
			LAi_QuestDelay("shop_walkers3", 4.0);
		break;

		case "shop_walkers2_B":
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(CharacterFromID("wr_fatj"), "wr_crew", "sit", "sit3");
			LAi_SetSitType(CharacterFromID("wr_fatj"));
			RemoveCharacterEquip(characterFromID("wr_fatj"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_fatj"), "bladebasket");

			GiveItem2Character(CharacterFromID("wr_fatj"), "blade4");
			GiveItem2Character(CharacterFromID("wr_fatj"), "pistol1");
			EquipCharacterbyItem(characterFromID("wr_fatj"), "blade4");
			EquipCharacterbyItem(characterFromID("wr_fatj"), "pistol1");
		break;

		case "shop_walkers3":
			RemoveCharacterEquip(characterFromID("wr_cor3"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_cor3"), "pistol1");
			RemoveCharacterEquip(characterFromID("wr_cor3"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_cor3"), "blade4");

			GiveItem2Character(CharacterFromID("wr_cor3"), "bladeX4");
			EquipCharacterbyItem(characterFromID("wr_cor3"), "bladeX4");
			GiveItem2Character(CharacterFromID("wr_cor3"), "pistol_armchair");
			EquipCharacterbyItem(characterFromID("wr_cor3"), "pistol_armchair");

			PlaySound("INTERFACE\Closet_open.wav");
			LAi_SetStayType(CharacterFromID("wr_cor3"));
			ChangeCharacterAddressGroup(CharacterFromID("wr_cor3"), "wr_shop", "reload", "reload2");
			LAi_QuestDelay("shop_walkers3_A", 1.0);
			LAi_QuestDelay("shop_walkers3_AA", 3.0);
		break;

		case "shop_walkers3_AA":
			PlaySound("VOICE\ENGLISH\grandma_yell2.wav");
		break;

		case "shop_walkers3_A":
			LAi_SetActorType(CharacterFromID("wr_cor3"));
			LAi_ActorGoToLocator(characterFromID("wr_cor3"), "reload", "reload3", "shop_walkers3_B", 7.0);
			LAi_QuestDelay("shop_walkers4", 3.0);
		break;

		case "shop_walkers3_B":
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(CharacterFromID("wr_cor3"), "wr_crew", "sit", "sit4");
			LAi_SetSitType(CharacterFromID("wr_cor3"));
			RemoveCharacterEquip(characterFromID("wr_cor3"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_cor3"), "pistol_armchair");

			GiveItem2Character(CharacterFromID("wr_cor3"), "blade4");
			GiveItem2Character(CharacterFromID("wr_cor3"), "pistol1");
			EquipCharacterbyItem(characterFromID("wr_cor3"), "blade4");
			EquipCharacterbyItem(characterFromID("wr_cor3"), "pistol1");
		break;

		case "shop_walkers4":
			PlaySound("INTERFACE\Closet_open.wav");
			LAi_SetStayType(CharacterFromID("wr_mong"));
			ChangeCharacterAddressGroup(CharacterFromID("wr_mong"), "wr_shop", "reload", "reload2");
			LAi_QuestDelay("shop_walkers4_A", 1.0);
			LAi_QuestDelay("shop_walkers4_AA", 3.0);
		break;

		case "shop_walkers4_AA":
			PlaySound("VOICE\ENGLISH\grandma_yell.wav");
		break;

		case "shop_walkers4_A":
			LAi_SetActorType(CharacterFromID("wr_mong"));
			LAi_ActorGoToLocator(characterFromID("wr_mong"), "box", "box1", "shop_walkers4_B", 10.0);
			LAi_QuestDelay("shop_walkers50", 4.0);//fralut = 5:th walker
		break;

		case "shop_walkers50":
			PlaySound("INTERFACE\Closet_open.wav");
			LAi_SetStayType(CharacterFromID("wr_fralut"));
			ChangeCharacterAddressGroup(CharacterFromID("wr_fralut"), "wr_shop", "reload", "reload2");
			LAi_QuestDelay("shop_walkers50_A", 1.0);
		break;

		case "shop_walkers50_A":
			LAi_SetActorType(CharacterFromID("wr_fralut"));
			LAi_ActorGoToLocator(characterFromID("wr_fralut"), "reload", "reload6", "shop_walkers50_B", 8.0);
		break;

		case "shop_walkers50_B":
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(CharacterFromID("wr_fralut"), "wr_crew", "waitress", "stay2");
			LAi_SetCitizenType(CharacterFromID("wr_fralut"));
			RemoveCharacterEquip(characterFromID("wr_fralut"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_fralut"), "bladebasket");

			GiveItem2Character(CharacterFromID("wr_fralut"), "blade4");
			GiveItem2Character(CharacterFromID("wr_fralut"), "pistol1");
			EquipCharacterbyItem(characterFromID("wr_fralut"), "blade4");
			EquipCharacterbyItem(characterFromID("wr_fralut"), "pistol1");
		break;

		case "shop_walkers4_B":
			PlaySound("PEOPLE\wood2.wav");
			RemoveCharacterEquip(characterFromID("wr_mong"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_mong"), "bladebarrel");
			RemoveCharacterEquip(characterFromID("wr_mong"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_mong"), "pistolbarrel");

			ChangeCharacterAddressGroup(CharacterFromID("wr_mong"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_mong"), "wr_shop", "box", "box1");
			//refresh needed to get rid of pistolbarrel

			LAi_QuestDelay("shop_walkers5", 1.0);//pir4 = 6:th walker
			LAi_QuestDelay("shop_walkers4_C", 1.0);
		break;

		case "shop_walkers4_C":
			LAi_ActorGoToLocator(characterFromID("wr_mong"), "reload", "reload2", "shop_walkers4_D", 11.0);//was 10
		break;

		case "shop_walkers4_D":
			PlaySound("INTERFACE\closed_door.wav");
			RemoveCharacterEquip(characterFromID("wr_mong"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_mong"), "bladebarrel");
			RemoveCharacterEquip(characterFromID("wr_mong"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_mong"), "pistolbarrel");
			ChangeCharacterAddressGroup(CharacterFromID("wr_mong"), "wr_crew", "sit", "sit5");
			LAi_SetSitType(CharacterFromID("wr_mong"));

			GiveItem2Character(CharacterFromID("wr_mong"), "blade4");
			GiveItem2Character(CharacterFromID("wr_mong"), "pistol1");
			EquipCharacterbyItem(characterFromID("wr_mong"), "blade4");
			EquipCharacterbyItem(characterFromID("wr_mong"), "pistol1");
		break;

		case "shop_walkers5":
			PlaySound("INTERFACE\Closet_open.wav");
			LAi_SetStayType(CharacterFromID("wr_pir4"));
			ChangeCharacterAddressGroup(CharacterFromID("wr_pir4"), "wr_shop", "reload", "reload2");
			LAi_QuestDelay("shop_walkers5_A", 1.0);
		break;

		case "shop_walkers5_A":
			LAi_SetActorType(CharacterFromID("wr_pir4"));
			LAi_ActorGoToLocator(characterFromID("wr_pir4"), "reload", "reload6", "shop_walkers5_B", 8.0);
		break;

		case "shop_walkers5_B":
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(CharacterFromID("wr_pir4"), "wr_crew", "sit", "sit6");
			LAi_SetSitType(CharacterFromID("wr_pir4"));
			RemoveCharacterEquip(characterFromID("wr_pir4"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_pir4"), "bladeglobe");

			GiveItem2Character(CharacterFromID("wr_pir4"), "blade4");
			GiveItem2Character(CharacterFromID("wr_pir4"), "pistol1");
			EquipCharacterbyItem(characterFromID("wr_pir4"), "blade4");
			EquipCharacterbyItem(characterFromID("wr_pir4"), "pistol1");

			LAi_QuestDelay("shop_walkers7_A", 1.0);//start Dave
			LAi_QuestDelay("shop_walkers6", 1.0);//start ma R, was 5
		break;

		case "shop_walkers6":
			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_ActorGoToLocator(characterFromID("grandma"), "reload", "reload2", "shop_walkers7", 7.0);
			PlaySound("VOICE\ENGLISH\grandma_2.wav");
		break;

		case "shop_walkers7":
			ChangeCharacterAddressGroup(CharacterFromID("grandma"), "none", "", "");
			PlaySound("INTERFACE\closed_locked_door.wav");
		break;

		case "shop_walkers7_A":
			LAi_SetActorType(CharacterFromID("Dave Edna"));
			LAi_ActorGoToLocator(characterFromID("Dave Edna"), "reload", "reload6", "shop_walkers8", 4.0);
		break;

		case "shop_walkers8":
			PlaySound("INTERFACE\key_lock.wav");
			Locations[FindLocation("wr_shop")].reload.l6.disable = 1;//to loanshark
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l2.disable = 1;//to shop
			LAi_SetStayType(CharacterFromID("Dave Edna"));
			LAi_QuestDelay("shop_walkers9", 1.0);
		break;

		case "shop_walkers9":
			LAi_SetActorType(CharacterFromID("Dave Edna"));
			LAi_ActorGoToLocator(characterFromID("Dave Edna"), "reload", "reload3", "shop_walkers10", 5.0);
		break;

		case "shop_walkers10":
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(CharacterFromID("Dave Edna"), "Dave_Edna_room", "goto", "goto1");
			LAi_QuestDelay("shop_walkers11", 1.0);
		break;
//..................................................................................................................
		case "shop_walkers11":
			PlaySound("PEOPLE\run_wood.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_shop", "box", "box4");
			locations[FindLocation("Shop_stairs")].id.label = "Rogers' Paintings Furniture & Weapons";
			LAi_QuestDelay("shop_walkers12", 1.0);
		break;

		case "shop_walkers12":
			LAi_SetPlayerType(Pchar);
			LAi_QuestDelay("prepare_elevator", 0.1);
			LAi_QuestDelay("in_daves_room", 0.5);
		break;

		case "prepare_elevator":
			pchar.quest.prepare_elevator1.win_condition.l1 = "locator";
			pchar.quest.prepare_elevator1.win_condition.l1.location = "Shop_stairs";
			pchar.quest.prepare_elevator1.win_condition.l1.locator_group = "reload";
			pchar.quest.prepare_elevator1.win_condition.l1.locator = "reload4";
			pchar.quest.prepare_elevator1.win_condition = "prepare_elevator1";
		break;

		case "prepare_elevator1":
			//secure that elevator is down for the first trip

			if(Pchar.quest.wr_quest1 == "just_greeting")
			{
				if(Pchar.quest.wr_elevator == "up")
				{
					PlaySound("INTERFACE\elevator.wav");
					Pchar.quest.wr_elevator = "down";
					Locations[FindLocation("wr_shop")].models.always.locators = "residence05_locators_JRH_Ldown";
					LAi_QuestDelay("prepare_elevator", 0.1);
				}
				else
				{
					LAi_QuestDelay("prepare_elevator", 0.1);
				}
			}
			else
			{
				return;
			}

			LAi_QuestDelay("missed_pistol204", 0.1);
		break;

		case "missed_pistol204":
			pchar.quest.missed_pistol204_A.win_condition.l1 = "location";
			pchar.quest.missed_pistol204_A.win_condition.l1.location = "Redmond_town_01";
			pchar.quest.missed_pistol204_A.win_condition = "missed_pistol204_A";
		break;

		case "missed_pistol204_A":
			if(!CheckCharacterItem(Pchar,"pistol204"))
			{
				PlaySound("OBJECTS\VOICES\DEAD\male\dead1.wav");
				Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"I saw no gun  at all in there. Did I miss it?"));
				AddQuestRecord("Woodes_Rogers_reward_4", "4");
			}
		break;

		case "in_daves_room":
			pchar.quest.in_daves_room1.win_condition.l1 = "locator";
			pchar.quest.in_daves_room1.win_condition.l1.location = "Dave_Edna_room";
			pchar.quest.in_daves_room1.win_condition.l1.locator_group = "reload";
			pchar.quest.in_daves_room1.win_condition.l1.locator = "reload1";
			pchar.quest.in_daves_room1.win_condition = "in_daves_room1";
		break;

		case "in_daves_room1":
			PlaySound("VOICE\ENGLISH\Dave_Edna_4.wav");
			LAi_SetStayType(CharacterFromID("Dave Edna"));
			LAi_QuestDelay("pistol4_check", 0.1);
			LAi_QuestDelay("steplock_mother", 0.1);//starts the steplock loop in wr_mother room
		break;

		case "pistol4_check":
			if(CheckCharacterItem(Pchar,"pistol204"))
			{
				curExp = sti(Pchar.Experience);
				nextExp = CalculateExperienceFromRank(sti(Pchar.rank)+1);
				addExp = nextExp-curExp;
				AddCharacterExpNS(Pchar, addExp);
				int SNE = CalcCharacterSkill(Pchar, "Sneak");
				Pchar.skill.Sneak = SNE + 1;

				AddQuestRecord("Woodes_Rogers_reward_4", "3");

				Pchar.quest.wr_quest1 = "pistol4";
				EquipCharacterByItem(Pchar, "pistol204");
				ChangeCharacterAddressGroup(CharacterFromID("wr_pir13"), "Shop_stairs", "sit", "sit1");
				ChangeCharacterAddressGroup(CharacterFromID("Dave Edna"), "none", "", "");

				Locations[FindLocation("Redmond_Town_01")].reload.l23.disable = 0;//reopen gate to terrace
				SetModel(characterFromID("Powdermonkey"), "monkey", "monkey", "monkey", 1.8, false);
				ChangeCharacterAddressGroup(CharacterFromID("PowderMonkey"), "Redmond_Town_01", "goto", "goto60");

				Locations[FindLocation("wr_residence")].reload.l7.disable = 1;//locked to arm
				Locations[FindLocation("wr_residence")].reload.l2.disable = 0;//open to lib
				Locations[FindLocation("wr_library")].reload.l2.disable = 0;//open to residence
				ChangeCharacterAddressGroup(CharacterFromID("wr_bri"), "wr_residence", "sit", "sit2");
				LAi_SetSitType(CharacterFromID("wr_bri"));
				Locations[FindLocation("wr_library")].models.always.locators = "Res02_l_JRH2";//gives subjects shelfs
				ChangeCharacterAddressGroup(CharacterFromID("wr_voy"), "wr_library", "goto", "goto18");
				LAi_SetStayType(CharacterFromID("wr_voy"));

				LAi_QuestDelay("pistol4_bonus", 0.1);
			}
			else
			{
				LAi_QuestDelay("pistol4_check", 0.5);//loop check
			}
		break;

		case "pistol4_bonus":
			pchar.quest.pistol4_bonus1.win_condition.l1 = "locator";
			pchar.quest.pistol4_bonus1.win_condition.l1.location = "Shop_stairs";
			pchar.quest.pistol4_bonus1.win_condition.l1.locator_group = "goto";
			pchar.quest.pistol4_bonus1.win_condition.l1.locator = "goto1";
			pchar.quest.pistol4_bonus1.win_condition = "pistol4_bonus1";
		break;

		case "pistol4_bonus1":
			LAi_SetStayType(Pchar);
			LAi_SetActorType(characterFromID("wr_pir13"));
			LAi_ActorDialog(characterFromID("wr_pir13"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wr_pir13"));
			Characters[GetCharacterIndex("wr_pir13")].dialog.CurrentNode  = "bladetalk";
		break;

		case "bladetalk_over":
			//from E Cook dialog
			TakeItemFromCharacter(Pchar, "bladeA17");
			TakeItemFromCharacter(Pchar, "bladeA2");
			TakeItemFromCharacter(Pchar, "bladeA4");
			TakeItemFromCharacter(Pchar, "bladeA5");
			TakeItemFromCharacter(Pchar, "bladeA11");

			if(!CheckCharacterItem(Pchar,"bladepickaxe1"))
			{
			 	PlaySound("OBJECTS\duel\sword_fallen.wav");//not 1:st time
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			}

			ChangeCharacterAddressGroup(Pchar, "Shop_stairs", "goto", "goto1");
			ChangeCharacterAddressGroup(CharacterFromID("wr_pir13"), "Shop_stairs", "sit", "sit1");
			LAi_SetSitType(characterFromID("wr_pir13"));
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto4");
			LAi_QuestDelay("bladetalk_over2", 1.0);
		break;

		case "bladetalk_over2":
			LAi_SetPlayerType(Pchar);		//to enable pchar-started dialog

			if (WEAPONSLOCKER == 1)
			{
				pchar.quest.upgrade_weaponslocker.win_condition.l1 = "location";
				pchar.quest.upgrade_weaponslocker.win_condition.l1.location = "Tutorial_Deck";
				pchar.quest.upgrade_weaponslocker.win_condition = "upgrade_weaponslocker";
			}
		break;

		case "upgrade_weaponslocker":
			//these are added even if there are better border weapons in the weaponslocker already - maybe there is only one better gun
			//or does it matter?
			locations[FindLocation(Pchar.location)].box2.items.blade11 = 12;//how many borders?
			locations[FindLocation(Pchar.location)].box2.items.pistol3 = 12;//how many borders?
		break;

		case "try_blade1":
			//from E Cook dialog
			PlaySound("OBJECTS\duel\sword_out.wav");
			GiveItem2Character(Pchar, "bladeA17");
			EquipCharacterByItem(Pchar, "bladeA17");

			TakeItemFromCharacter(Pchar, "blade4-2");
			TakeItemFromCharacter(Pchar, "bladepickaxe1");
			LAi_QuestDelay("try_another", 3.0);
		break;

		case "try_blade2":
			//from E Cook dialog
			PlaySound("OBJECTS\duel\sword_out.wav");
			GiveItem2Character(Pchar, "bladeA5");
			EquipCharacterByItem(Pchar, "bladeA5");

			TakeItemFromCharacter(Pchar, "blade4-2");
			TakeItemFromCharacter(Pchar, "bladepickaxe1");
			LAi_QuestDelay("try_another", 3.0);
		break;

		case "try_blade3":
			//from E Cook dialog
			PlaySound("OBJECTS\duel\sword_out.wav");
			GiveItem2Character(Pchar, "bladeA11");
			EquipCharacterByItem(Pchar, "bladeA11");

			TakeItemFromCharacter(Pchar, "blade4-2");
			TakeItemFromCharacter(Pchar, "bladepickaxe1");
			LAi_QuestDelay("try_another", 3.0);
		break;

		case "try_blade4":
			//from E Cook dialog
			PlaySound("OBJECTS\duel\sword_out.wav");
			GiveItem2Character(Pchar, "bladeA4");
			EquipCharacterByItem(Pchar, "bladeA4");

			TakeItemFromCharacter(Pchar, "blade4-2");
			TakeItemFromCharacter(Pchar, "bladepickaxe1");
			LAi_QuestDelay("try_another", 3.0);
		break;

		case "try_blade5":
			//from E Cook dialog
			PlaySound("OBJECTS\duel\sword_out.wav");
			GiveItem2Character(Pchar, "bladeA2");
			EquipCharacterByItem(Pchar, "bladeA2");

			TakeItemFromCharacter(Pchar, "blade4-2");
			TakeItemFromCharacter(Pchar, "bladepickaxe1");
			LAi_QuestDelay("try_another", 3.0);
		break;

		case "try_another":
			LAi_SetActorType(characterFromID("wr_pir13"));
			LAi_ActorDialog(characterFromID("wr_pir13"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wr_pir13"));
			Characters[GetCharacterIndex("wr_pir13")].dialog.CurrentNode  = "decide_blade";
		break;
//---------------------------------------------------------------------------------------------------------------------------
//[6] from here...
		case "bladetalk_finished":
			//from E Cook dialog, pchar has got the blade
			ChangeCharacterAddressGroup(CharacterFromID("wr_boc4"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_cor1_1"), "none", "", "");

			PlaySound("VOICE\ENGLISH\Eng_m_c_062.wav");
			ChangeCharacterAddressGroup(CharacterFromID("wr_pir13"), "Shop_stairs", "sit", "sit1");
			LAi_SetSitType(characterFromID("wr_pir13"));
			LAi_SetPlayerType(Pchar);

			ChangeCharacterAddressGroup(CharacterFromID("Selkirk"), "wr_library", "goto", "goto6");
			LAi_SetStayType(CharacterFromID("Selkirk"));
			Pchar.quest.wr_gunroom = "locked";
			locations[FindLocation("wr_gunroom")].id.label = "Officers only!";
			Locations[FindLocation("wr_library")].reload.l6.disable = 1;//closed to loanshark
			Locations[FindLocation("wr_library")].reload.l3.disable = 1;//closed to attic
			Locations[FindLocation("wr_residence")].locators_radius.reload.reload4 = 0.0001;//to clock
			locations[FindLocation("Shop_stairs")].id.label = "Rogers' Paintings Furniture & Weapons";

			Pchar.quest.wr_defoe = "start";
			Pchar.quest.rum_water = "empty";	//start = empty
			Pchar.quest.rum_molasses = "empty";	//start = empty
			Pchar.quest.rum_wheel = "off";		//start = off
			Pchar.quest.rum_damper = "closed";	//start = closed
			Pchar.quest.rum_fire = "unlit";		//start = unlit
			Pchar.quest.rum_fuel = "no";		//start = no
			Pchar.quest.rum_phase = "0";		//start = 0
			Pchar.quest.rum_sack = "no";		//start = no

			Pchar.quest.water_check = 0;		//start = 0
			Pchar.quest.molasses_check = 0;		//start = 0
			Pchar.quest.wheel_check = 0;		//start = 0
			Pchar.quest.damper_check = 0;		//start = 0
			Pchar.quest.4checks = 0;		//start = 0

			LAi_QuestDelay("monkey_gate", 0.1);
			LAi_QuestDelay("fill_library_box", 0.1);
			LAi_QuestDelay("light_fire_enabled", 0.1);

			LAi_QuestDelay("subject_erotica", 0.1);
			LAi_QuestDelay("subject_geography", 0.1);
			LAi_QuestDelay("subject_math", 0.1);
			LAi_QuestDelay("subject_shipbuilding", 0.1);
			LAi_QuestDelay("subject_trade", 0.1);
			LAi_QuestDelay("subject_seamanship", 0.1);
			LAi_QuestDelay("subject_seabattles", 0.1);
			LAi_QuestDelay("subject_philosophy", 0.1);

			//LAi_QuestDelay("subject_architecture", 0.1);
			LAi_QuestDelay("subject_antiques", 0.1);
			LAi_QuestDelay("subject_poetry", 0.1);
			LAi_QuestDelay("subject_medicine", 0.1);
			LAi_QuestDelay("subject_law", 0.1);
			LAi_QuestDelay("subject_travels", 0.1);
			LAi_QuestDelay("subject_history", 0.1);
			LAi_QuestDelay("subject_maps", 0.1);
			LAi_QuestDelay("subject_alchemy", 0.1);
			LAi_QuestDelay("subject_novels", 0.1);

			pchar.quest.end_reward4.win_condition.l1 = "location";
			pchar.quest.end_reward4.win_condition.l1.location = "Redmond_town_01";
			pchar.quest.end_reward4.win_condition = "end_reward4";
		break;
//.................................................................................................
		case "end_reward4":
			AddQuestRecord("Woodes_Rogers_reward_4", "5");
			CloseQuestHeader("Woodes_Rogers_reward_4");

			pchar.quest.take_ammo_gunroom.win_condition.l1 = "location";
			pchar.quest.take_ammo_gunroom.win_condition.l1.location = "wr_gunroom";
			pchar.quest.take_ammo_gunroom.win_condition = "take_ammo_gunroom";
		break;

		case "take_ammo_gunroom":
			gp = GetCharacterItem(Pchar, "gunpowder");
			pb = GetCharacterItem(Pchar, "pistolbullets");
			if(gp == 0)
			{
				TakenItems(Pchar, "gunpowder", 1);
				Pchar.quest.temp_gunpowder = "yes";
			    	//LogIt("temp_gunpowder = " + Pchar.quest.temp_gunpowder);
			    	//gp = GetCharacterItem(Pchar, "gunpowder");
			    	//LogIt("gp = " + gp);
			}
			if(pb == 0)
			{
				TakenItems(Pchar, "pistolbullets", 1);
				Pchar.quest.temp_pistolbullets = "yes";
			    	//LogIt("temp_pistolbullets = " + Pchar.quest.temp_pistolbullets);
			    	//pb = GetCharacterItem(Pchar, "pistolbullets");
			    	//LogIt("pb = " + pb);
			}

			Pchar.quest.give_ammo_gunroom.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.give_ammo_gunroom.win_condition.l1.location = "wr_gunroom";
			Pchar.quest.give_ammo_gunroom.win_condition = "give_ammo_gunroom";
		break;

		case "give_ammo_gunroom":
			if(CheckAttribute(Pchar,"quest.temp_gunpowder") && Pchar.quest.temp_gunpowder == "yes")
			{
				TakenItems(Pchar, "gunpowder", -1);
			    	//gp = GetCharacterItem(Pchar, "gunpowder");
			    	//LogIt("gp = " + gp);
				Pchar.quest.temp_gunpowder = "no";
			}
			if(CheckAttribute(Pchar,"quest.temp_pistolbullets") && Pchar.quest.temp_pistolbullets == "yes")
			{
				TakenItems(Pchar, "pistolbullets", -1);
			    	//pb = GetCharacterItem(Pchar, "pistolbullets");
			    	//LogIt("pb = " + pb);
				Pchar.quest.temp_pistolbullets = "no";
			}

			pchar.quest.take_ammo_gunroom.win_condition.l1 = "location";
			pchar.quest.take_ammo_gunroom.win_condition.l1.location = "wr_gunroom";
			pchar.quest.take_ammo_gunroom.win_condition = "take_ammo_gunroom";
		break;
//.................................................................................................
		case "fill_library_box":
			pchar.quest.fill_library_box2.win_condition.l1 = "locator";
			pchar.quest.fill_library_box2.win_condition.l1.location = "wr_library";
			pchar.quest.fill_library_box2.win_condition.l1.locator_group = "reload";
			pchar.quest.fill_library_box2.win_condition.l1.locator = "reload2";
			pchar.quest.fill_library_box2.win_condition = "fill_library_box2";
		break;

		case "fill_library_box2":
			locations[FindLocation(Pchar.location)].box7.items.book26 = 1;//sea battles: medicine
			locations[FindLocation(Pchar.location)].box10.items.corkscrews = 1;

			locations[FindLocation(Pchar.location)].box1.items.book30 = 1;
		break;
//.................................................................................................
		case "subject_erotica":
			pchar.quest.subject_erotica1.win_condition.l1 = "locator";
			pchar.quest.subject_erotica1.win_condition.l1.location = "wr_library";
			pchar.quest.subject_erotica1.win_condition.l1.locator_group = "goto";
			pchar.quest.subject_erotica1.win_condition.l1.locator = "goto25";	//was reload10
			pchar.quest.subject_erotica1.win_condition = "subject_erotica1";
		break;

		case "subject_erotica1":
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Erotica"));
			LAi_QuestDelay("subject_erotica", 0.1);
		break;

		case "subject_geography":
			pchar.quest.subject_geography1.win_condition.l1 = "locator";
			pchar.quest.subject_geography1.win_condition.l1.location = "wr_library";
			pchar.quest.subject_geography1.win_condition.l1.locator_group = "goto";
			pchar.quest.subject_geography1.win_condition.l1.locator = "goto17";
			pchar.quest.subject_geography1.win_condition = "subject_geography1";
		break;

		case "subject_geography1":
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Geography and Meteorology"));
			LAi_QuestDelay("subject_geography", 0.1);
		break;

		case "subject_math":
			pchar.quest.subject_math1.win_condition.l1 = "locator";
			pchar.quest.subject_math1.win_condition.l1.location = "wr_library";
			pchar.quest.subject_math1.win_condition.l1.locator_group = "goto";
			pchar.quest.subject_math1.win_condition.l1.locator = "goto15";
			pchar.quest.subject_math1.win_condition = "subject_math1";
		break;

		case "subject_math1":
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Mathematics, Physics and Chemistry"));
			LAi_QuestDelay("subject_math", 0.1);
		break;

		case "subject_shipbuilding":
			pchar.quest.subject_shipbuilding1.win_condition.l1 = "locator";
			pchar.quest.subject_shipbuilding1.win_condition.l1.location = "wr_library";
			pchar.quest.subject_shipbuilding1.win_condition.l1.locator_group = "goto";
			pchar.quest.subject_shipbuilding1.win_condition.l1.locator = "goto18";
			pchar.quest.subject_shipbuilding1.win_condition = "subject_shipbuilding1";
		break;

		case "subject_shipbuilding1":
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Shipbuilding"));
			LAi_QuestDelay("subject_shipbuilding", 0.1);
		break;

		case "subject_trade":
			pchar.quest.subject_trade1.win_condition.l1 = "locator";
			pchar.quest.subject_trade1.win_condition.l1.location = "wr_library";
			pchar.quest.subject_trade1.win_condition.l1.locator_group = "goto";
			pchar.quest.subject_trade1.win_condition.l1.locator = "goto14";
			pchar.quest.subject_trade1.win_condition = "subject_trade1";
		break;

		case "subject_trade1":
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Trade and Economics"));
			LAi_QuestDelay("subject_trade", 0.1);
		break;

		case "subject_seamanship":
			pchar.quest.subject_seamanship1.win_condition.l1 = "locator";
			pchar.quest.subject_seamanship1.win_condition.l1.location = "wr_study";
			pchar.quest.subject_seamanship1.win_condition.l1.locator_group = "goto";
			pchar.quest.subject_seamanship1.win_condition.l1.locator = "goto3";
			pchar.quest.subject_seamanship1.win_condition = "subject_seamanship1";
		break;

		case "subject_seamanship1":
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Navigation and Seamanship"));
			LAi_QuestDelay("subject_seamanship", 0.1);
		break;

		case "subject_seabattles":
			pchar.quest.subject_seabattles1.win_condition.l1 = "locator";
			pchar.quest.subject_seabattles1.win_condition.l1.location = "wr_library";
			pchar.quest.subject_seabattles1.win_condition.l1.locator_group = "goto";
			pchar.quest.subject_seabattles1.win_condition.l1.locator = "goto26";	//was reload9
			pchar.quest.subject_seabattles1.win_condition = "subject_seabattles1";
		break;

		case "subject_seabattles1":
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Sea Battles"));
			LAi_QuestDelay("subject_seabattles", 0.1);
		break;

		case "subject_philosophy":
			pchar.quest.subject_philosophy1.win_condition.l1 = "locator";
			pchar.quest.subject_philosophy1.win_condition.l1.location = "wr_library";
			pchar.quest.subject_philosophy1.win_condition.l1.locator_group = "goto";
			pchar.quest.subject_philosophy1.win_condition.l1.locator = "goto23";
			pchar.quest.subject_philosophy1.win_condition = "subject_philosophy1";
		break;

		case "subject_philosophy1":
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Philosophy and Psychology"));
			LAi_QuestDelay("subject_philosophy", 0.1);
		break;

		case "subject_architecture":
			pchar.quest.subject_architecture1.win_condition.l1 = "locator";
			pchar.quest.subject_architecture1.win_condition.l1.location = "wr_library";
			pchar.quest.subject_architecture1.win_condition.l1.locator_group = "box";
			pchar.quest.subject_architecture1.win_condition.l1.locator = "box11";
			pchar.quest.subject_architecture1.win_condition = "subject_architecture1";
		break;

		case "subject_architecture1":
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Architecture, Town Planning and Fortifications"));
			LAi_QuestDelay("subject_architecture", 0.1);
		break;

		case "subject_sound_architecture":
			pchar.quest.subject_sound_architecture1.win_condition.l1 = "locator";
			pchar.quest.subject_sound_architecture1.win_condition.l1.location = "wr_library";
			pchar.quest.subject_sound_architecture1.win_condition.l1.locator_group = "goto";
			pchar.quest.subject_sound_architecture1.win_condition.l1.locator = "goto20";
			pchar.quest.subject_sound_architecture1.win_condition = "subject_sound_architecture1";
		break;

		case "subject_sound_architecture1":
			PlaySound("PEOPLE\counter_openclose.wav");
			LAi_QuestDelay("subject_sound_architecture", 0.1);
		break;

		case "subject_poetry":
			pchar.quest.subject_poetry1.win_condition.l1 = "locator";
			pchar.quest.subject_poetry1.win_condition.l1.location = "wr_library";
			pchar.quest.subject_poetry1.win_condition.l1.locator_group = "goto";
			pchar.quest.subject_poetry1.win_condition.l1.locator = "goto13";
			pchar.quest.subject_poetry1.win_condition = "subject_poetry1";
		break;

		case "subject_poetry1":
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Poetry and Love Songs"));
			LAi_QuestDelay("subject_poetry", 0.1);
		break;

		case "subject_medicine":
			pchar.quest.subject_medicine1.win_condition.l1 = "locator";
			pchar.quest.subject_medicine1.win_condition.l1.location = "wr_library";
			pchar.quest.subject_medicine1.win_condition.l1.locator_group = "goto";
			pchar.quest.subject_medicine1.win_condition.l1.locator = "goto22";
			pchar.quest.subject_medicine1.win_condition = "subject_medicine1";
		break;

		case "subject_medicine1":
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Medicine"));
			LAi_QuestDelay("subject_medicine", 0.1);
		break;

		case "subject_antiques":
			pchar.quest.subject_antiques1.win_condition.l1 = "locator";
			pchar.quest.subject_antiques1.win_condition.l1.location = "wr_residence";
			pchar.quest.subject_antiques1.win_condition.l1.locator_group = "goto";
			pchar.quest.subject_antiques1.win_condition.l1.locator = "goto10";
			pchar.quest.subject_antiques1.win_condition = "subject_antiques1";
		break;

		case "subject_antiques1":
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Antiques and Jewels"));
			LAi_QuestDelay("subject_antiques", 0.1);
		break;

		case "subject_law":
			pchar.quest.subject_law1.win_condition.l1 = "locator";
			pchar.quest.subject_law1.win_condition.l1.location = "wr_residence";
			pchar.quest.subject_law1.win_condition.l1.locator_group = "goto";
			pchar.quest.subject_law1.win_condition.l1.locator = "goto16";
			pchar.quest.subject_law1.win_condition = "subject_law1";
		break;

		case "subject_law1":
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Law"));
			LAi_QuestDelay("subject_law", 0.1);
		break;

		case "subject_travels":
			pchar.quest.subject_travels1.win_condition.l1 = "locator";
			pchar.quest.subject_travels1.win_condition.l1.location = "wr_study";
			pchar.quest.subject_travels1.win_condition.l1.locator_group = "goto";
			pchar.quest.subject_travels1.win_condition.l1.locator = "goto1";
			pchar.quest.subject_travels1.win_condition = "subject_travels1";
		break;

		case "subject_travels1":
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Travels around the World"));
			LAi_QuestDelay("subject_travels", 0.1);
		break;

		case "subject_history":
			pchar.quest.subject_history1.win_condition.l1 = "locator";
			pchar.quest.subject_history1.win_condition.l1.location = "wr_library";
			pchar.quest.subject_history1.win_condition.l1.locator_group = "goto";
			pchar.quest.subject_history1.win_condition.l1.locator = "goto16";
			pchar.quest.subject_history1.win_condition = "subject_history1";
		break;

		case "subject_history1":
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"History and Biographies"));
			LAi_QuestDelay("subject_history", 0.1);
		break;

		case "subject_maps":
			pchar.quest.subject_maps1.win_condition.l1 = "locator";
			pchar.quest.subject_maps1.win_condition.l1.location = "wr_study";
			pchar.quest.subject_maps1.win_condition.l1.locator_group = "goto";
			pchar.quest.subject_maps1.win_condition.l1.locator = "goto4";
			pchar.quest.subject_maps1.win_condition = "subject_maps1";
		break;

		case "subject_maps1":
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Maps and Documents"));
			LAi_QuestDelay("subject_maps", 0.1);
		break;

		case "subject_alchemy":
			pchar.quest.subject_alchemy1.win_condition.l1 = "locator";
			pchar.quest.subject_alchemy1.win_condition.l1.location = "wr_study";
			pchar.quest.subject_alchemy1.win_condition.l1.locator_group = "goto";
			pchar.quest.subject_alchemy1.win_condition.l1.locator = "goto5";
			pchar.quest.subject_alchemy1.win_condition = "subject_alchemy1";
		break;

		case "subject_alchemy1":
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Alchemy and Mysticism"));
			LAi_QuestDelay("subject_alchemy", 0.1);
		break;

		case "subject_novels":
			pchar.quest.subject_novels1.win_condition.l1 = "locator";
			pchar.quest.subject_novels1.win_condition.l1.location = "wr_study";
			pchar.quest.subject_novels1.win_condition.l1.locator_group = "goto";
			pchar.quest.subject_novels1.win_condition.l1.locator = "goto2";
			pchar.quest.subject_novels1.win_condition = "subject_novels1";
		break;

		case "subject_novels1":
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Novels about Hidden Treasure"));
			LAi_QuestDelay("subject_novels", 0.1);
		break;
//.................................................................................................
		case "tour_library":
			PlaySound("PEOPLE\run_wood.wav");
		break;
//.................................................................................................
//-------------------------------------------------------------------------------------------------
		case "monkey_gate":
			pchar.quest.monkey_gate1.win_condition.l1 = "locator";
			pchar.quest.monkey_gate1.win_condition.l1.location = "Redmond_Town_01";
			pchar.quest.monkey_gate1.win_condition.l1.locator_group = "reload";
			pchar.quest.monkey_gate1.win_condition.l1.locator = "reload6";
			pchar.quest.monkey_gate1.win_condition = "monkey_gate1";
		break;

		case "monkey_gate1":
			LAi_SetActorType(characterFromID("powdermonkey"));//stops from attacking
			PlaySound("OBJECTS\DUEL\monkey_attack2.wav");

			LAi_QuestDelay("monkey_gate2", 1.0);
		break;

		case "monkey_gate2":
			PlaySound("PEOPLE\recoil.wav");
			ChangeCharacterAddressGroup(CharacterFromID("powdermonkey"), "Redmond_Town_01", "officers", "reload_1_4_3");

			LAi_QuestDelay("monkey_gate3", 1.0);
		break;

		case "monkey_gate3":
			PlaySound("OBJECTS\DUEL\monkey_hit3.wav");
			ChangeCharacterAddressGroup(CharacterFromID("powdermonkey"), "none", "", "");

			LAi_QuestDelay("doctor_leaves", 0.1);
		break;
//-------------------------------------------------------------------------------------------------
		case "doctor_leaves":
			pchar.quest.doctor_leaves1.win_condition.l1 = "locator";
			pchar.quest.doctor_leaves1.win_condition.l1.location = "wr_library";
			pchar.quest.doctor_leaves1.win_condition.l1.locator_group = "goto";
			pchar.quest.doctor_leaves1.win_condition.l1.locator = "goto27";
			pchar.quest.doctor_leaves1.win_condition = "doctor_leaves1";
		break;

		case "doctor_leaves1":
			LAi_QuestDelay("doctor_leaves2", 0.5);
		break;

		case "doctor_leaves2":
			LAi_SetStayType(Pchar);
			PlaySound("VOICE\ENGLISH\Eng_m_a_008.wav");
			LAi_SetActorType(characterFromID("wr_voy"));
			LAi_ActorTurnToLocator(characterFromID("wr_voy"), "goto", "goto27");

			LAi_QuestDelay("doctor_leaves3", 1.0);
		break;

		case "doctor_leaves3":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto18");

			LAi_QuestDelay("doctor_leaves4", 2.0);
		break;

		case "doctor_leaves4":
			LAi_ActorGoToLocator(characterFromID("wr_voy"), "reload", "reload2", "doctor_leaves5", 1.5);
		break;

		case "doctor_leaves5":
			PlaySound("INTERFACE\closed_locked_door.wav");
			Locations[FindLocation("wr_library")].reload.l2.disable = 1;//locked to residence
			ChangeCharacterAddressGroup(CharacterFromID("wr_voy"), "none", "", "");
			Locations[FindLocation("wr_residence")].models.always.locators = "Res01_l_JRH1";
			locations[FindLocation("Redmond_UsurerHouse")].id.label = "Loanshark's Office";
			locations[FindLocation("Tavern_storeroom")].id.label = "Tavern storeroom";
			LAi_QuestDelay("librarian", 2.0);
		break;

		case "librarian":
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorDialog(characterFromID("Selkirk"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Selkirk"));
			Characters[GetCharacterIndex("Selkirk")].dialog.CurrentNode  = "librarian";
		break;

		case "librarian_over":
			//from selkirk dialog
			SetQuestHeader("Librarian");
			AddQuestRecord("Librarian", "1");
			DeleteQuestHeader("Woodes_Rogers_reward_4");

			LAi_SetPlayerType(Pchar);
			Pchar.quest.take_items_log = "6";
			GiveItem2Character(Pchar, "book22");
			GiveItem2Character(Pchar, "book21");
			GiveItem2Character(Pchar, "book33");
			GiveItem2Character(Pchar, "book34");
			GiveItem2Character(Pchar, "book23");
			GiveItem2Character(Pchar, "book36");
			DeleteAttribute(Pchar,"quest.take_items_log");

			LAi_QuestDelay("librarian_over2", 1.0);
		break;

		case "librarian_over2":
			LAi_SetCitizenType(CharacterFromID("Selkirk"));
			PlaySound("VOICE\ENGLISH\Eng_m_c_076.wav");
			if(!CheckAttribute(PChar,"bookpuzzle1")) PChar.bookpuzzle1 = 0;
		break;

		case "book23_check":
			//shipbuilding

			if(!CheckCharacterItem(Pchar,"book23") )
			{
				//pchar doesn't have it any longer - must be in box then!
				locations[FindLocation(Pchar.location)].box6.items.book23 = 0;
				Pchar.quest.wr_book23 = "placed";

				PChar.bookpuzzle1 = sti(PChar.bookpuzzle1) + 1;
				if(CheckAttribute(Pchar,"bookpuzzle1") && Pchar.bookpuzzle1 <= 2)
				{
					PlaySound("INTERFACE\shelf_cogs.wav");
				}
				else
				{
					LAi_QuestDelay("book23_home", 0.1);
				}
			}
		break;

		case "book33_check":
			//geography

			if(!CheckCharacterItem(Pchar,"book33") )
			{
				//pchar doesn't have it any longer - must be in box then!
				locations[FindLocation(Pchar.location)].box5.items.book33 = 0;
				Pchar.quest.wr_book33 = "placed";

				PChar.bookpuzzle1 = sti(PChar.bookpuzzle1) + 1;
				if(CheckAttribute(Pchar,"bookpuzzle1") && Pchar.bookpuzzle1 <= 2)
				{
					PlaySound("INTERFACE\shelf_cogs.wav");
				}
				else
				{
					LAi_QuestDelay("book33_home", 0.1);
				}
			}
		break;

		case "book34_check":
			//trade, economics

			if(!CheckCharacterItem(Pchar,"book34") )
			{
				//pchar doesn't have it any longer - must be in box then!
				locations[FindLocation(Pchar.location)].box2.items.book34 = 0;
				Pchar.quest.wr_book34 = "placed";

				PChar.bookpuzzle1 = sti(PChar.bookpuzzle1) + 1;
				if(CheckAttribute(Pchar,"bookpuzzle1") && Pchar.bookpuzzle1 <= 2)
				{
					PlaySound("INTERFACE\shelf_cogs.wav");
				}
				else
				{
					LAi_QuestDelay("book34_home", 0.1);
				}
			}
		break;
//---------------------------------------------------------------------------------------------------------
//.................................................................................................
		case "book23_home":
			PlaySound("INTERFACE\step_path.wav");
			Locations[FindLocation(Pchar.location)].models.always.locators = "Res02_l_JRH3";

			LAi_QuestDelay("book23_home1", 0.5);
		break;

		case "book23_home1":
			Locations[FindLocation("wr_library")].image = "";
			DoQuestReloadToLocation("wr_library", "goto", "goto18", "bookpuzzle1_finished");
		break;

		case "book33_home":
			PlaySound("INTERFACE\step_path.wav");
			Locations[FindLocation(Pchar.location)].models.always.locators = "Res02_l_JRH3";

			LAi_QuestDelay("book33_home1", 0.5);
		break;

		case "book33_home1":
			Locations[FindLocation("wr_library")].image = "";
			DoQuestReloadToLocation("wr_library", "goto", "goto17", "bookpuzzle1_finished");
		break;

		case "book34_home":
			PlaySound("INTERFACE\step_path.wav");
			Locations[FindLocation(Pchar.location)].models.always.locators = "Res02_l_JRH3";

			LAi_QuestDelay("book34_home1", 0.5);
		break;

		case "book34_home1":
			Locations[FindLocation("wr_library")].image = "";
			DoQuestReloadToLocation("wr_library", "goto", "goto14", "bookpuzzle1_finished");
		break;

		case "bookpuzzle1_finished":
			Locations[FindLocation("wr_library")].image = "wr_library.tga";
			PlaySound("INTERFACE\shelf_open.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto15");
			LAi_QuestDelay("bookpuzzle1_finished1", 1.0);
		break;

		case "bookpuzzle1_finished1":
			LAi_SetPlayerType(Pchar);
			LAi_QuestDelay("autoclose_both_shelves", 0.1);//starts loop
			LAi_QuestDelay("doctor_returns", 0.1);
		break;
//................................................................................................

		case "gunroom_door_visible":
			Locations[FindLocation("wr_library")].image = "";
			if(CheckAttribute(Pchar,"quest.medicine_quest") && Pchar.quest.medicine_quest == "started")
			{
				DoQuestReloadToLocation("wr_library", "goto", "goto15_M", "gunroom_door_visible1");
			}
			else DoQuestReloadToLocation("wr_library", "goto", "goto15", "gunroom_door_visible1");
		break;

		case "gunroom_door_visible1":
			Locations[FindLocation("wr_library")].image = "wr_library.tga";
			PlaySound("INTERFACE\shelf_open.wav");
		break;

		case "gunroom_door_hidden":
			Locations[FindLocation("wr_library")].image = "";
			if(CheckAttribute(Pchar,"quest.medicine_quest") && Pchar.quest.medicine_quest == "started")
			{
				DoQuestReloadToLocation("wr_library", "goto", "goto15_M", "gunroom_door_hidden1");
			}
			else DoQuestReloadToLocation("wr_library", "goto", "goto15", "gunroom_door_hidden1");
		break;

		case "gunroom_door_hidden1":
			Locations[FindLocation("wr_library")].image = "wr_library.tga";
			PlaySound("INTERFACE\shelf_close.wav");
		break;
//.................................................................................................
		case "autoclose_both_shelves":
			pchar.quest.autoclose_both_shelves1.win_condition.l1 = "locator";
			pchar.quest.autoclose_both_shelves1.win_condition.l1.location = "wr_study";
			pchar.quest.autoclose_both_shelves1.win_condition.l1.locator_group = "reload";
			pchar.quest.autoclose_both_shelves1.win_condition.l1.locator = "reload1";
			pchar.quest.autoclose_both_shelves1.win_condition = "autoclose_both_shelves1";
		break;

		case "autoclose_both_shelves1":
			PlaySound("INTERFACE\shelf_close.wav");

			if(CheckAttribute(Pchar,"quest.wr_library") && Pchar.quest.wr_library == "book25")
				Locations[FindLocation("wr_library")].models.always.locators = "Res02_l_JRH5";

			if(CheckAttribute(Pchar,"quest.wr_library") && Pchar.quest.wr_library == "mission5")
				Locations[FindLocation("wr_library")].models.always.locators = "Res02_l_JRH8";

			LAi_QuestDelay("autoopen_right_shelf", 0.1);
		break;

		case "autoopen_right_shelf":
			pchar.quest.autoopen_right_shelf1.win_condition.l1 = "locator";
			pchar.quest.autoopen_right_shelf1.win_condition.l1.location = "wr_library";
			pchar.quest.autoopen_right_shelf1.win_condition.l1.locator_group = "goto";
			pchar.quest.autoopen_right_shelf1.win_condition.l1.locator = "goto15";
			pchar.quest.autoopen_right_shelf1.win_condition = "autoopen_right_shelf1";
		break;

		case "autoopen_right_shelf1":
			if(CheckCharacterItem(Pchar,"corkscrews"))
			{
				TakeItemFromCharacter(Pchar, "corkscrews");
				Pchar.quest.chain = "removed";
			}

			if(CheckCharacterItem(Pchar,"chain"))
			{
				TakeItemFromCharacter(Pchar, "chain");
				PlaySound("AMBIENT\JAIL\chains2.wav");
				Pchar.quest.chain = "on";
				LAi_QuestDelay("chain_on_aha", 2.0);
			}

			if(CheckAttribute(Pchar,"quest.chain") && Pchar.quest.chain == "removed")
			{
				PlaySound("AMBIENT\JAIL\chains2.wav");
				LAi_QuestDelay("chain_removed_sound", 2.0);
			}
			else
			{
				if(CheckAttribute(Pchar,"quest.chain") && Pchar.quest.chain == "on")
				{
					//shorter loop if chain is on
					PlaySound("INTERFACE\step_path.wav");
					LAi_QuestDelay("chain_sound", 0.5);
				}
			}
			else
			{
				PlaySound("INTERFACE\step_path.wav");

				if(CheckAttribute(Pchar,"quest.wr_library") && Pchar.quest.wr_library == "book25")
					Locations[FindLocation(Pchar.location)].models.always.locators = "Res02_l_JRH6";

				if(CheckAttribute(Pchar,"quest.wr_library") && Pchar.quest.wr_library == "mission5")
					Locations[FindLocation(Pchar.location)].models.always.locators = "Res02_l_JRH9";

				LAi_QuestDelay("autoopen_right_shelf2", 0.5);
			}
		break;

		case "chain_on_aha":
			PlaySound("VOICE\ENGLISH\blaze_hah.wav");
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Now I can open the Chemistry shelf."));
			AddQuestRecord("Librarian", "6");
		break;

		case "chain_removed_sound":
			Pchar.quest.chain = "over";//resets to normal open
			Locations[FindLocation("wr_library")].reload.l5.disable = 0;//open to study
			Locations[FindLocation(Pchar.location)].models.always.locators = "Res02_l_JRH6";

			PlaySound("INTERFACE\step_path.wav");
			LAi_QuestDelay("autoopen_right_shelf2", 0.5);
		break;

		case "chain_sound":
			PlaySound("INTERFACE\locked_window.wav");

			if(CheckAttribute(Pchar,"quest.erotica") && Pchar.quest.erotica == "visited")
			{
				LAi_QuestDelay("autoopen_right_shelf", 0.1);//you'll get a new check if you forgot the corkscrews
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladebottlew4") && CheckCharacterItem(Pchar,"pistolbottlew4"))
				{
					Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Now I can't remove the chain - I need something to pick the lock with."));
				}

				LAi_QuestDelay("autoclose_both_shelves", 0.1);	//shorter loop if chain is on
			}
		break;

		case "autoopen_right_shelf2":
			Locations[FindLocation("wr_library")].image = "";
			DoQuestReloadToLocation("wr_library", "goto", "goto15", "autoopen_right_shelf3");
		break;

		case "autoopen_right_shelf3":
			Locations[FindLocation("wr_library")].image = "wr_library.tga";
			PlaySound("INTERFACE\shelf_open.wav");

			LAi_QuestDelay("autoclose_both_shelves", 0.1);	//loop
		break;
//.................................................................................................
//------------------------------------------------------------------------------------------------------------------
		case "doctor_returns":
			pchar.quest.doctor_returns1.win_condition.l1 = "locator";
			pchar.quest.doctor_returns1.win_condition.l1.location = "wr_library";
			pchar.quest.doctor_returns1.win_condition.l1.locator_group = "reload";
			pchar.quest.doctor_returns1.win_condition.l1.locator = "reload7";
			pchar.quest.doctor_returns1.win_condition = "doctor_returns1";
		break;

		case "doctor_returns1":
			LAi_SetStayType(Pchar);
			PlaySound("INTERFACE\knock.wav");

			LAi_QuestDelay("doctor_returns2", 1.0);
		break;

		case "doctor_returns2":
			Locations[FindLocation("wr_library")].reload.l2.disable = 0;//open to residence
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(CharacterFromID("wr_voy"), "wr_library", "reload", "reload2");
			LAi_QuestDelay("doctor_returns3", 1.0);
		break;

		case "doctor_returns3":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");
			LAi_QuestDelay("doctor_returns4", 1.0);
		break;

		case "doctor_returns4":
			LAi_SetPlayerType(Pchar);
			LAi_SetActorType(characterFromID("wr_voy"));
			LAi_ActorGoToLocator(characterFromID("wr_voy"), "sit", "sit1", "doctor_returns5", 1.0);
		break;

		case "doctor_returns5":
			ChangeCharacterAddressGroup(CharacterFromID("wr_voy"), "wr_library", "sit", "sit1");
			LAi_SetSitType(characterFromID("wr_voy"));
			Pchar.quest.med_Dover = "neutral";

			LAi_QuestDelay("fill_residence_box", 0.1);
		break;

		case "fill_residence_box":
			pchar.quest.fill_residence_box2.win_condition.l1 = "locator";
			pchar.quest.fill_residence_box2.win_condition.l1.location = "wr_residence";
			pchar.quest.fill_residence_box2.win_condition.l1.locator_group = "reload";
			pchar.quest.fill_residence_box2.win_condition.l1.locator = "reload2";
			pchar.quest.fill_residence_box2.win_condition = "fill_residence_box2";
		break;

		case "fill_residence_box2":
			Locations[FindLocation("wr_residence")].reload.l1.disable = 1;//locked to terrace

			locations[FindLocation(Pchar.location)].box1.items.book24 = 1;
			locations[FindLocation(Pchar.location)].box3.items.jewelry12 = 1;
		break;

		case "book21and24_check":
			//to prevent just taking the history book without returning the law book

			if(CheckCharacterItem(Pchar,"book21") && CheckCharacterItem(Pchar,"book24") )
			{
				TakeItemFromCharacter(Pchar, "book24");
				locations[FindLocation(Pchar.location)].box1.items.book24 = 1;
				Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Remember to return all books to their right places!"));
				PlaySound("PEOPLE\step_stairway.wav");
			}
		break;

		case "book21_check":
			//law

			if(!CheckCharacterItem(Pchar,"book21") )
			{
				//pchar doesn't have it any longer - must be in box then!
				Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Law book placed"));
				locations[FindLocation(Pchar.location)].box1.items.book21 = 0;
				Pchar.quest.wr_book21 = "placed";

				LAi_QuestDelay("book24_pickup_check", 0.1);
			}
		break;

		case "book24_pickup_check":
			if(CheckCharacterItem(Pchar,"book24") )
			{
				PlaySound("INTERFACE\important_item.wav");
			}
			else LAi_QuestDelay("book24_pickup_check", 0.5);
		break;
//------------------------------------------------------------------------------------------------------------------
//.................................................................................................

		case "book24_unlock_check":
			//history
			//now from itemlogic, after box has been launched

			if(!CheckCharacterItem(Pchar,"book24") )
			{
				//pchar doesn't have it any longer - must be in box then!
				Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"History book placed"));
				PlaySound("INTERFACE\key_unlock.wav");
				Locations[FindLocation("wr_library")].reload.l7.disable = 0;//unlocked to gunroom
				Locations[FindLocation("wr_gunroom")].reload.l2.disable = 0;//unlocked to library
				Pchar.quest.wr_gunroom = "unlocked";

				if(CheckAttribute(Pchar,"quest.wr_book24") && Pchar.quest.wr_book24 == "first_time")
				{
					//do nothing
				}
				else
				{
					LAi_QuestDelay("book24_first_time", 0.1);
					//story continues here, the first time history book is placed
				}
			}
		break;

		case "book24_lock_check":
			//history
			//now from itemlogic, after box has been launched

			if(CheckCharacterItem(Pchar,"book24") )
			{
				//pchar has the book - door is locked
				Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"History book picked up"));
				PlaySound("INTERFACE\key_lock.wav");
				Locations[FindLocation("wr_library")].reload.l7.disable = 1;//locked to gunroom
				Locations[FindLocation("wr_gunroom")].reload.l2.disable = 1;//locked to library
				Pchar.quest.wr_gunroom = "locked";
			}
		break;
//.................................................................................................
		case "water_tank":
			//from box2 in itemlogic
			if(CheckAttribute(Pchar,"quest.rum_water") && Pchar.quest.rum_water == "filled")
			{
				PlaySound("INTERFACE\rum_barrel_filled.wav");
				LAi_QuestDelay("water_tank2", 1.0);
			}

			if(CheckAttribute(Pchar,"quest.rum_water") && Pchar.quest.rum_water == "bladebucket")
			{
				if(CheckCharacterItem(Pchar,"pistolbucket"))
				{
					TakeItemFromCharacter(Pchar, "pistolbucket");
					EquipCharacterByItem(Pchar, "pistol204");
					PlaySound("INTERFACE\bucket_water.wav");

					Pchar.quest.rum_water = "filled";
					Pchar.quest.wheel_check = "0";//resets to "0" so a new check is possible from here on

					LAi_QuestDelay("water_exit_check", 0.1);
					LAi_QuestDelay("water_tank2", 1.0);
				}
				else
				{
					PlaySound("INTERFACE\rum_barrel_drip.wav");
					LAi_QuestDelay("water_tank2", 1.0);
				}
			}

			if(CheckAttribute(Pchar,"quest.rum_water") && Pchar.quest.rum_water == "pistolbucket")
			{
				if(CheckCharacterItem(Pchar,"bladebucket"))
				{
					TakeItemFromCharacter(Pchar, "bladebucket");
					EquipCharacterByItem(Pchar, "bladeA11");
					PlaySound("INTERFACE\bucket_water.wav");

					Pchar.quest.rum_water = "filled";
					Pchar.quest.wheel_check = "0";//resets to "0" so a new check is possible from here on

					LAi_QuestDelay("water_exit_check", 0.1);
					LAi_QuestDelay("water_tank2", 1.0);
				}
				else
				{
					PlaySound("INTERFACE\rum_barrel_drip.wav");
					LAi_QuestDelay("water_tank2", 1.0);
				}
			}

			if(CheckAttribute(Pchar,"quest.rum_water") && Pchar.quest.rum_water == "empty")
			{
				if(CheckCharacterItem(Pchar,"bladebucket") && CheckCharacterItem(Pchar,"pistolbucket") )
				{
					LAi_SetStayType(Pchar);
					TakeItemFromCharacter(Pchar, "bladebucket");
					EquipCharacterByItem(Pchar, "bladeA11");
					PlaySound("INTERFACE\bucket_water.wav");
					Pchar.quest.rum_water = "bladebucket";
				}
				else
				{
					if(CheckCharacterItem(Pchar,"bladebucket"))
					{
						TakeItemFromCharacter(Pchar, "bladebucket");
						EquipCharacterByItem(Pchar, "bladeA11");
						PlaySound("INTERFACE\bucket_water.wav");
						Pchar.quest.rum_water = "bladebucket";

						LAi_QuestDelay("water_tank2", 1.0);
					}
				}
				else
				{
					if(CheckCharacterItem(Pchar,"pistolbucket"))
					{
						TakeItemFromCharacter(Pchar, "pistolbucket");
						EquipCharacterByItem(Pchar, "pistol204");
						PlaySound("INTERFACE\bucket_water.wav");
						Pchar.quest.rum_water = "pistolbucket";

						LAi_QuestDelay("water_tank2", 1.0);
					}
				}
				else
				{
					PlaySound("INTERFACE\rum_barrel_drip.wav");
					LAi_QuestDelay("water_tank2", 1.0);
				}

			}
		break;

		case "water_tank2":
			ChangeCharacterAddressGroup(Pchar, "wr_gunroom", "box", "box5");
			PlaySound("PEOPLE\jump.wav");
			LAi_SetPlayerType(Pchar);
		break;
//.................................................................................................
		case "wheel_water":
			if(Pchar.location == "wr_gunroom")
			{
				if(CheckAttribute(Pchar,"quest.rum_wheel") && Pchar.quest.rum_wheel == "off") return;

				PlaySound("INTERFACE\running_water.wav");
				LAi_QuestDelay("wheel_water", 3.2);
			}
			else LAi_QuestDelay("gunroom_entre", 0.1);//loop
		break;
//.................................................................................................
		case "wheel_water_gps":
			if(Pchar.location == "wr_gunroom")
			{
				if(CheckAttribute(Pchar,"quest.rum_wheel") && Pchar.quest.rum_wheel == "off") return;

				PlaySound("INTERFACE\running_water.wav");
				LAi_QuestDelay("wheel_water_gps", 3.2);
			}
			else LAi_QuestDelay("gunroom_entre_gps", 0.1);//loop
		break;
//.................................................................................................
		case "gunroom_disable_fightmode":
			Locations[FindLocation("wr_gunroom")].image = "";
			DoQuestReloadToLocation("wr_gunroom", "goto", "goto7", "gunroom_disable_fightmode1");
		break;

		case "gunroom_disable_fightmode1":
			Locations[FindLocation("wr_gunroom")].image = "wr_gunroom.tga";
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(pchar, false);
		break;

		case "damper":
			Locations[FindLocation("wr_gunroom")].image = "";
			DoQuestReloadToLocation("wr_gunroom", "goto", "goto7", "damper1");
		break;

		case "damper1":
			Locations[FindLocation("wr_gunroom")].image = "wr_gunroom.tga";
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(PChar, false);

			if(Locations[FindLocation(Pchar.location)].models.always.locators == "tavern02_locators_JRH0")
			{
				LAi_QuestDelay("blacksmoke_short", 0.1);
			}

			if(Locations[FindLocation(Pchar.location)].models.always.locators == "tavern02_locators_JRH1_F")
			{
				if(CheckAttribute(Pchar,"quest.rum_molasses") && Pchar.quest.rum_molasses == "filled")
				LAi_QuestDelay("boiling_low", 0.1);

				LAi_QuestDelay("fire_3flames", 0.1);
			}


			if(Locations[FindLocation(Pchar.location)].models.always.locators == "tavern02_locators_JRH2_F")
			{
				if(CheckAttribute(Pchar,"quest.rum_molasses") && Pchar.quest.rum_molasses == "filled")
				{
					if(CheckAttribute(Pchar,"quest.rum_wheel") && Pchar.quest.rum_wheel == "on")
					LAi_QuestDelay("boiling_medium", 0.1);

					if(CheckAttribute(Pchar,"quest.rum_wheel") && Pchar.quest.rum_wheel == "off")
					LAi_QuestDelay("boiling_hard", 0.1);
				}
				LAi_QuestDelay("fire_5flames", 0.1);
			}
		break;

		case "blacksmoke_short":
			if(Locations[FindLocation(Pchar.location)].models.always.locators == "tavern02_locators_JRH0")
			{
				if(CheckAttribute(Pchar,"quest.rum_fire") && Pchar.quest.rum_fire == "lit")
				{
					CreateParticleSystem("smoke_inv_short" , 5.4, 0.64, 0.0, 5.1, 4.0, 0.0, sti(20) );

					LAi_QuestDelay("blacksmoke_short1", 2.0);
				}
			}
			else
			{
				return;
			}
		break;

		case "blacksmoke_short1":
			if(Locations[FindLocation(Pchar.location)].models.always.locators == "tavern02_locators_JRH0")
			{
				if(CheckAttribute(Pchar,"quest.rum_fire") && Pchar.quest.rum_fire == "lit")
				{
					PlaySound("OBJECTS\SHIPCHARGE\man2waitB.wav");
				}
			}
			else
			{
				return;
			}
		break;

		case "fire_3flames":
			if(Pchar.location == "wr_gunroom")
			{
				if(Locations[FindLocation(Pchar.location)].models.always.locators == "tavern02_locators_JRH1_F")
				{
					PlaySound3D("NATURE\fireplace2.wav", 6.1, 0.64, -0.065);
					LAi_QuestDelay("fire_3flames", 5.0);
				}
			}
			else LAi_QuestDelay("gunroom_entre", 0.1);//loop
		break;

		case "fire_5flames":
			if(Pchar.location == "wr_gunroom")
			{
				if(Locations[FindLocation(Pchar.location)].models.always.locators == "tavern02_locators_JRH2_F")
				{
					PlaySound3D("NATURE\fireplace3.wav", 6.1, 0.64, -0.065);
					LAi_QuestDelay("fire_5flames", 4.8);
				}
			}
			else LAi_QuestDelay("gunroom_entre", 0.1);//loop
		break;

		case "boiling_low":
			if(Pchar.location == "wr_gunroom")
			{
				if(Locations[FindLocation(Pchar.location)].models.always.locators == "tavern02_locators_JRH1_F")
				{
					if(CheckAttribute(Pchar,"quest.rum_molasses") && Pchar.quest.rum_molasses == "filled")
					{
						if(CheckAttribute(Pchar,"quest.rum_wheel") && Pchar.quest.rum_wheel == "off")
						{
							//Log_SetStringToLog("Low");
							PlaySound3D("INTERFACE\rumble1.wav", 5.1, 1.0, 1.1);

							LAi_QuestDelay("boiling_low", 5.0);
						}
						else LAi_QuestDelay("boiling_low", 0.1);//loop while in gunroom
					}
				}
			}
			else LAi_QuestDelay("gunroom_entre", 0.1);//loop
		break;

		case "boiling_medium":
			if(Pchar.location == "wr_gunroom")
			{
				if(Locations[FindLocation(Pchar.location)].models.always.locators == "tavern02_locators_JRH2_F")
				{
					if(CheckAttribute(Pchar,"quest.rum_molasses") && Pchar.quest.rum_molasses == "filled")
					{
						if(CheckAttribute(Pchar,"quest.rum_wheel") && Pchar.quest.rum_wheel == "on")
						{
							if(CheckAttribute(Pchar,"quest.rum_phase") && Pchar.quest.rum_phase == "2")
							{
								LAi_QuestDelay("distill_1st", 0.1);
								return;
							}

							//Log_SetStringToLog("Medium");
							PlaySound3D("INTERFACE\rumble1.wav", 5.1, 1.0, 1.1);
							PlaySound3D("INTERFACE\bubbles2.wav", 5.1, 1.0, 1.1);

							LAi_QuestDelay("boiling_medium", 5.0);
						}
						else LAi_QuestDelay("boiling_hard", 0.1);
					}
				}
			}
			else LAi_QuestDelay("gunroom_entre", 0.1);//loop
		break;

		case "boiling_hard":
			if(Locations[FindLocation(Pchar.location)].models.always.locators == "tavern02_locators_JRH2_F")
			{
				if(CheckAttribute(Pchar,"quest.rum_molasses") && Pchar.quest.rum_molasses == "filled")
				{
					if(CheckAttribute(Pchar,"quest.rum_wheel") && Pchar.quest.rum_wheel == "off")
					{
						Locations[FindLocation("wr_gunroom")].reload.l2.disable = 1;//to library
						//to avoid too many situations - you have to handle the distillery here in the gunroom
						Pchar.quest.rum_phase = "1";

						//Log_SetStringToLog("Hard");
						PlaySound3D("INTERFACE\rumble1.wav", 5.1, 1.0, 1.1);
						PlaySound("INTERFACE\rumble2.wav");
						PlaySound3D("INTERFACE\bubbles2.wav", 5.1, 1.0, 1.1);

						LAi_QuestDelay("boiling_steam_check", 5.0);
					}
					else LAi_QuestDelay("boiling_medium", 0.1);
				}
			}
		break;

		case "boiling_steam_check":
			if(Locations[FindLocation(Pchar.location)].models.always.locators == "tavern02_locators_JRH2_F")
			{
				if(CheckAttribute(Pchar,"quest.rum_wheel") && Pchar.quest.rum_wheel == "off")
				{
					LAi_QuestDelay("boiling_steam", 0.1);
				}
				else
				{
					Pchar.quest.rum_phase = "2";
					LAi_QuestDelay("boiling_medium", 0.1);
				}
			}
			else
			{
				Pchar.quest.rum_phase = "0";
				return;
			}
		break;

		case "boiling_steam":
			//Log_SetStringToLog("Steam");
			PlaySound3D("INTERFACE\rumble1.wav", 5.1, 1.0, 1.1);
			PlaySound("INTERFACE\rumble2.wav");
			PlaySound3D("INTERFACE\bubbles2.wav", 5.1, 1.0, 1.1);
			PlaySound("INTERFACE\steam1.wav");

			CreateParticleSystem("smoke_short" , 4.9, 2.0, 2.8, 4.9, 4.0, 2.8, sti(20) );
			CreateParticleSystem("smoke_short" , 4.9, 2.0, 2.8, 4.9, 4.0, 2.8, sti(20) );
			CreateParticleSystem("smoke_short" , 4.9, 2.0, 2.8, 4.9, 4.0, 2.8, sti(20) );
			CreateParticleSystem("smoke_short" , 4.9, 2.0, 2.8, 4.9, 4.0, 2.8, sti(20) );

			CreateParticleSystem("smoke_short" , 6.1, 2.8, 1.8, 6.1, 4.0, 1.8, sti(20) );
			CreateParticleSystem("smoke_short" , 6.1, 2.8, 1.8, 6.1, 4.0, 1.8, sti(20) );
			CreateParticleSystem("smoke_short" , 6.1, 2.8, 1.8, 6.1, 4.0, 1.8, sti(20) );
			CreateParticleSystem("smoke_short" , 6.1, 2.8, 1.8, 6.1, 4.0, 1.8, sti(20) );

			LAi_QuestDelay("boiling_shaking_check", 5.0);
		break;

		case "boiling_shaking_check":
			if(Locations[FindLocation(Pchar.location)].models.always.locators == "tavern02_locators_JRH2_F")
			{
				if(CheckAttribute(Pchar,"quest.rum_wheel") && Pchar.quest.rum_wheel == "off")
				{
					LAi_QuestDelay("boiling_shaking", 0.1);
				}
				else
				{
					Pchar.quest.rum_phase = "2";
					LAi_QuestDelay("boiling_medium", 0.1);
				}
			}
			else
			{
				Pchar.quest.rum_phase = "0";
				return;
			}
		break;

		case "boiling_shaking":
			//Log_SetStringToLog("Shaking");
			PlaySound3D("INTERFACE\rumble1.wav", 5.1, 1.0, 1.1);
			PlaySound("INTERFACE\rumble2.wav");
			PlaySound("INTERFACE\rumble3.wav");
			PlaySound3D("INTERFACE\bubbles2.wav", 5.1, 1.0, 1.1);
			PlaySound("INTERFACE\steam1.wav");

			CreateParticleSystem("smoke_short" , 4.9, 2.0, 2.8, 4.9, 4.0, 2.8, sti(20) );
			CreateParticleSystem("smoke_short" , 4.9, 2.0, 2.8, 4.9, 4.0, 2.8, sti(20) );
			CreateParticleSystem("smoke_short" , 4.9, 2.0, 2.8, 4.9, 4.0, 2.8, sti(20) );
			CreateParticleSystem("smoke_short" , 4.9, 2.0, 2.8, 4.9, 4.0, 2.8, sti(20) );

			CreateParticleSystem("smoke_short" , 6.1, 2.8, 1.8, 6.1, 4.0, 1.8, sti(20) );
			CreateParticleSystem("smoke_short" , 6.1, 2.8, 1.8, 6.1, 4.0, 1.8, sti(20) );
			CreateParticleSystem("smoke_short" , 6.1, 2.8, 1.8, 6.1, 4.0, 1.8, sti(20) );
			CreateParticleSystem("smoke_short" , 6.1, 2.8, 1.8, 6.1, 4.0, 1.8, sti(20) );

			CreateParticleSystem("smoke_short" , 3.9, 1.0, 1.6, 3.9, 4.0, 1.6, sti(20) );
			CreateParticleSystem("smoke_short" , 3.9, 1.0, 1.6, 3.9, 4.0, 1.6, sti(20) );
			CreateParticleSystem("smoke_short" , 3.9, 1.0, 1.6, 3.9, 4.0, 1.6, sti(20) );
			CreateParticleSystem("smoke_short" , 3.9, 1.0, 1.6, 3.9, 4.0, 1.6, sti(20) );

			LAi_QuestDelay("boiling_shaking_scared", 1.0);
			LAi_QuestDelay("boiling_alarm_check", 5.0);
		break;

		case "boiling_shaking_scared":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead1.wav");
			PlaySound("OBJECTS\VOICES\DEAD\male\dead1.wav");
		break;

		case "boiling_alarm_check":
			if(Locations[FindLocation(Pchar.location)].models.always.locators == "tavern02_locators_JRH2_F")
			{
				if(CheckAttribute(Pchar,"quest.rum_wheel") && Pchar.quest.rum_wheel == "off")
				{
					LAi_QuestDelay("boiling_alarm", 0.1);
				}
				else
				{
					Pchar.quest.rum_phase = "2";
					LAi_QuestDelay("boiling_medium", 0.1);
				}
			}
			else
			{
				Pchar.quest.rum_phase = "0";
				return;
			}
		break;

		case "boiling_alarm":
			//Log_SetStringToLog("Alarm");
			PlaySound3D("INTERFACE\rumble1.wav", 5.1, 1.0, 1.1);
			PlaySound("INTERFACE\rumble2.wav");
			PlaySound("INTERFACE\rumble3.wav");
			PlaySound3D("INTERFACE\bubbles2.wav", 5.1, 1.0, 1.1);
			PlaySound("INTERFACE\steam1.wav");
			PlaySound("INTERFACE\steam1.wav");
			PlaySound("INTERFACE\steam2.wav");

			CreateParticleSystem("smoke_short" , 4.9, 2.0, 2.8, 4.9, 4.0, 2.8, sti(20) );
			CreateParticleSystem("smoke_short" , 4.9, 2.0, 2.8, 4.9, 4.0, 2.8, sti(20) );
			CreateParticleSystem("smoke_short" , 4.9, 2.0, 2.8, 4.9, 4.0, 2.8, sti(20) );
			CreateParticleSystem("smoke_short" , 4.9, 2.0, 2.8, 4.9, 4.0, 2.8, sti(20) );

			CreateParticleSystem("smoke_short" , 6.1, 2.8, 1.8, 6.1, 4.0, 1.8, sti(20) );
			CreateParticleSystem("smoke_short" , 6.1, 2.8, 1.8, 6.1, 4.0, 1.8, sti(20) );
			CreateParticleSystem("smoke_short" , 6.1, 2.8, 1.8, 6.1, 4.0, 1.8, sti(20) );
			CreateParticleSystem("smoke_short" , 6.1, 2.8, 1.8, 6.1, 4.0, 1.8, sti(20) );

			CreateParticleSystem("smoke_short" , 3.9, 1.0, 1.6, 3.9, 4.0, 1.6, sti(20) );
			CreateParticleSystem("smoke_short" , 3.9, 1.0, 1.6, 3.9, 4.0, 1.6, sti(20) );
			CreateParticleSystem("smoke_short" , 3.9, 1.0, 1.6, 3.9, 4.0, 1.6, sti(20) );
			CreateParticleSystem("smoke_short" , 3.9, 1.0, 1.6, 3.9, 4.0, 1.6, sti(20) );

			CreateParticleSystem("smoke_short" , 5.3, 1.2, 0.7, 5.3, 4.0, 0.7, sti(20) );
			CreateParticleSystem("smoke_short" , 5.3, 1.2, 0.7, 5.3, 4.0, 0.7, sti(20) );
			CreateParticleSystem("smoke_short" , 5.3, 1.2, 0.7, 5.3, 4.0, 0.7, sti(20) );
			CreateParticleSystem("smoke_short" , 5.3, 1.2, 0.7, 5.3, 4.0, 0.7, sti(20) );

			LAi_QuestDelay("boiling_explosion_check", 5.0);
		break;

		case "boiling_explosion_check":
			if(Locations[FindLocation(Pchar.location)].models.always.locators == "tavern02_locators_JRH2_F")
			{
				if(CheckAttribute(Pchar,"quest.rum_wheel") && Pchar.quest.rum_wheel == "off")
				{
					LAi_QuestDelay("boiling_explosion", 0.1);
				}
				else
				{
					Pchar.quest.rum_phase = "2";
					LAi_QuestDelay("boiling_medium", 0.1);
				}
			}
			else
			{
				Pchar.quest.rum_phase = "0";
				return;
			}
		break;

		case "boiling_explosion":
			PauseAllSounds();
			PlaySound("OBJECTS\DUEL\pistol_musket.wav");
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire1.wav");
			PlaySound("OBJECTS\SHIPCHARGE\LG42H.wav");
			PlayStereoSound("OBJECTS\SHIPCHARGE\gunpowder_explosion.wav");
			PlaySound("PEOPLE\roof_broken2.wav");

			GetCharacterPos(Pchar, &u, &v, &w);

			CreateParticleSystem("fort_fire" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("fort_fire" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("fort_fire" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("fort_fire" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("fort_fire" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

			CreateParticleSystem("canfire" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("canfire" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("canfire" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("canfire" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("canfire" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

			CreateParticleSystem("gunfire_red" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("gunfire_red" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("gunfire_red" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("gunfire_red" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("gunfire_red" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

			CreateParticleSystem("stars_fire" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("stars_fire" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("stars_fire" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("stars_fire" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("stars_fire" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

			CreateParticleSystem("cancloud" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("cancloud" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("cancloud" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("cancloud" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("cancloud" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

			CreateParticleSystem("splinters", u, v+1.8, W, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", u-0.5, v+1.0, W, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", u, v+1.8, w, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", u-0.5, v+1.0, w, 0.0, 0.0, 0.0, 0);

			LAi_ApplyCharacterDamage(Pchar, 1000);
			LAi_SetActorType(Pchar);
			LAi_ActorSetLayMode(Pchar);

			ChangeCharacterAddressGroup(CharacterFromID("wr_man2"), "none", "", "");//bartender
			ChangeCharacterAddressGroup(CharacterFromID("wr_cor4"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("Defoe_incognito"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_oman1X"), "none", "", "");

			LAi_QuestDelay("boiling_killed", 9.0);//was 8
		break;

		case "boiling_killed":
			GameOverOrg("land");
		break;

		case "distill_sounds":
			if(CheckAttribute(Pchar,"quest.rum_phase") && Pchar.quest.rum_phase == "3") return;

			int dropsound = rand(3);

			switch (dropsound)
			{
				case 0:
					PlaySound("AMBIENT\CAVE\drop7.wav");
				break;

				case 1:
					PlaySound("AMBIENT\CAVE\drop9.wav");
				break;

				case 2:
					PlaySound("AMBIENT\CAVE\drop8.wav");
				break;

				case 3:
					PlaySound("AMBIENT\CAVE\drop10.wav");
				break;
			}

			LAi_QuestDelay("distill_sounds", 1.0);
		break;

		case "distill_1st":
			//Log_SetStringToLog("distill 1st");
			LAi_SetStayType(Pchar);
			PlaySound3D("INTERFACE\rumble1.wav", 5.1, 1.0, 1.1);
			PlaySound3D("INTERFACE\bubbles2.wav", 5.1, 1.0, 1.1);

			LAi_QuestDelay("distill_understand", 2.0);
			LAi_QuestDelay("distill_1st_pause", 5.0);
		break;

		case "distill_understand":
			PlaySound("VOICE\ENGLISH\blaze_hah.wav");
		break;

		case "distill_1st_pause":
			//a fake fade out - fade in
			Locations[FindLocation("wr_gunroom")].image = "";
			DoQuestReloadToLocation("wr_gunroom", "box", "box1", "distill_2nd");
		break;

		case "distill_2nd":
			Locations[FindLocation("wr_gunroom")].image = "wr_gunroom.tga";
			//Log_SetStringToLog("distill 2nd");
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"RUM has started to drip into the Barrel!"));
			LAi_QuestDelay("distill_sounds", 0.1);
			PlaySound3D("INTERFACE\rumble1.wav", 5.1, 1.0, 1.1);
			PlaySound3D("INTERFACE\bubbles2.wav", 5.1, 1.0, 1.1);

			LAi_QuestDelay("distill_yah", 3.0);
			LAi_QuestDelay("distill_2nd_pause", 5.0);
		break;

		case "distill_yah":
			PlaySound("OBJECTS\DUEL\man_attack6.wav");
		break;

		case "distill_2nd_pause":
			//a fake fade out - fade in
			Locations[FindLocation("wr_gunroom")].image = "";
			DoQuestReloadToLocation("wr_gunroom", "box", "box1", "distill_3rd");
		break;

		case "distill_3rd":
			Locations[FindLocation("wr_gunroom")].image = "wr_gunroom.tga";
			//Log_SetStringToLog("distill 3rd");
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"After one hour - least"));
			PlaySound3D("INTERFACE\rumble1.wav", 5.1, 1.0, 1.1);
			PlaySound3D("INTERFACE\bubbles2.wav", 5.1, 1.0, 1.1);

			LAi_QuestDelay("distill_finished", 5.0);
		break;

		case "distill_finished":
			Pchar.quest.rum_phase = "3";//stops dripping sound
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"The Barrel is now filled with RUM ..."));
			Pchar.quest.rum_wheel = "off";//autostops
			LAi_QuestDelay("distill_key", 2.0);
		break;

		case "distill_key":
			PauseAllSounds();
			PlaySound("INTERFACE\rum_key.wav");

			LAi_QuestDelay("distill_key1", 2.0);
		break;

		case "distill_key1":
			Pchar.quest.rum_phase = "4";
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem15", 1.0);//rum barrel
			Pchar.quest.rum_molasses = "empty";
			PlaySound("VOICE\ENGLISH\blaze_what_was_that.wav");

			LAi_QuestDelay("barrel_and_key", 0.1);
		break;
//.................................................................................................
		case "gunroom_entre":
			pchar.quest.gunroom_entre1.win_condition.l1 = "locator";
			pchar.quest.gunroom_entre1.win_condition.l1.location = "wr_gunroom";
			pchar.quest.gunroom_entre1.win_condition.l1.locator_group = "reload";
			pchar.quest.gunroom_entre1.win_condition.l1.locator = "reload2";
			pchar.quest.gunroom_entre1.win_condition = "gunroom_entre1";
		break;

		case "gunroom_entre1":
			LAi_QuestDelay("wheel_water", 0.1);
			LAi_QuestDelay("fire_3flames", 0.1);
			LAi_QuestDelay("fire_5flames", 0.1);
			LAi_QuestDelay("boiling_low", 0.1);
			LAi_QuestDelay("boiling_medium", 0.1);
			LAi_QuestDelay("boiling_hard", 0.1);
		break;
//.................................................................................................
		case "gunroom_entre_gps":
			pchar.quest.gunroom_entre_gps1.win_condition.l1 = "locator";
			pchar.quest.gunroom_entre_gps1.win_condition.l1.location = "wr_gunroom";
			pchar.quest.gunroom_entre_gps1.win_condition.l1.locator_group = "barmen";
			pchar.quest.gunroom_entre_gps1.win_condition.l1.locator = "stay";
			pchar.quest.gunroom_entre_gps1.win_condition = "gunroom_entre_gps1";
		break;

		case "gunroom_entre_gps1":
			LAi_QuestDelay("wheel_water_gps", 0.1);
		break;
//.................................................................................................
		case "gunroom_exit":
			pchar.quest.gunroom_exit1.win_condition.l1 = "locator";
			pchar.quest.gunroom_exit1.win_condition.l1.location = "wr_library";
			pchar.quest.gunroom_exit1.win_condition.l1.locator_group = "reload";
			pchar.quest.gunroom_exit1.win_condition.l1.locator = "reload7";
			pchar.quest.gunroom_exit1.win_condition = "gunroom_exit1";
		break;

		case "gunroom_exit1":
			if(Locations[FindLocation("wr_gunroom")].models.always.locators == "tavern02_locators_JRH0_S")
			Locations[FindLocation("wr_gunroom")].models.always.locators = "tavern02_locators_JRH0";
			//not black smoke for ever
		break;
//.................................................................................................
		case "gunroom_jump":
			pchar.quest.gunroom_jump1.win_condition.l1 = "locator";
			pchar.quest.gunroom_jump1.win_condition.l1.location = "wr_gunroom";
			pchar.quest.gunroom_jump1.win_condition.l1.locator_group = "goto";
			pchar.quest.gunroom_jump1.win_condition.l1.locator = "goto4";
			pchar.quest.gunroom_jump1.win_condition = "gunroom_jump1";
		break;

		case "gunroom_jump1":
			PlaySound("PEOPLE\Jump_counter.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_gunroom", "goto", "goto5");
			LAi_QuestDelay("gunroom_jump2", 0.5);
		break;

		case "gunroom_jump2":
			ChangeCharacterAddressGroup(Pchar, "wr_gunroom", "goto", "goto1");
				//LAi_QuestDelay("gunroom_jump", 0.1);//loop, no need to loop it yet
			LAi_QuestDelay("gunroom__monkey_jump", 1.0);
		break;

		case "gunroom__monkey_jump":
			PlaySound("PEOPLE\Jump_counter.wav");
			ChangeCharacterAddressGroup(CharacterFromID("PowderMonkey"), "wr_gunroom", "sit", "sit4M");
			LAi_SetActorType(characterFromID("powdermonkey"));//stops from attacking
			LAi_QuestDelay("gunroom__monkey_jump1", 1.0);
		break;

		case "gunroom__monkey_jump1":
			PlaySound("OBJECTS\DUEL\monkey_hit1.wav");
		break;
//.................................................................................................
		case "light_fire_enabled":
			pchar.quest.light_fire_enabled1.win_condition.l1 = "locator";
			pchar.quest.light_fire_enabled1.win_condition.l1.location = "wr_gunroom";
			pchar.quest.light_fire_enabled1.win_condition.l1.locator_group = "goto";
			pchar.quest.light_fire_enabled1.win_condition.l1.locator = "goto7";
			pchar.quest.light_fire_enabled1.win_condition = "light_fire_enabled1";
		break;

		case "light_fire_enabled1":
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], false);

			pchar.quest.light_fire_enabled2.win_condition.l1 = "locator";
			pchar.quest.light_fire_enabled2.win_condition.l1.location = "wr_gunroom";
			pchar.quest.light_fire_enabled2.win_condition.l1.locator_group = "goto";
			pchar.quest.light_fire_enabled2.win_condition.l1.locator = "goto6";
			pchar.quest.light_fire_enabled2.win_condition = "light_fire_enabled2";
		break;

		case "light_fire_enabled2":
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], true);
			LAi_QuestDelay("light_fire_enabled", 0.1);//loop
		break;
//.................................................................................................
		case "book24_first_time":
			Pchar.quest.wr_book24 = "first_time";

			ChangeCharacterAddressGroup(CharacterFromID("wr_cor4"), "wr_gunroom", "sit", "sit11");
			LAi_SetSitType(characterFromID("wr_cor4"));
			ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "wr_gunroom", "sit", "sit7");
			LAi_SetSitType(characterFromID("Woodes Rogers"));
			ChangeCharacterAddressGroup(CharacterFromID("Defoe_incognito"), "wr_gunroom", "sit", "sit5");
			LAi_SetSitType(characterFromID("Defoe_incognito"));
			EquipCharacterByItem(CharacterFromID("Defoe_incognito"), "pistol201");

			pchar.quest.defoe_icognito.win_condition.l1 = "locator";
			pchar.quest.defoe_icognito.win_condition.l1.location = "wr_gunroom";
			pchar.quest.defoe_icognito.win_condition.l1.locator_group = "goto";
			pchar.quest.defoe_icognito.win_condition.l1.locator = "goto8";
			pchar.quest.defoe_icognito.win_condition = "goto_defoe";
		break;

		case "goto_defoe":
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "goto9", "defoe_incognito", 1.0);
		break;

		case "defoe_incognito":
			LAi_SetActorType(CharacterFromID("Defoe_incognito"));
			LAi_ActorDialog(characterFromID("Defoe_incognito"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Defoe_incognito"));
			Characters[GetCharacterIndex("Defoe_incognito")].dialog.CurrentNode  = "start";
		break;

		case "gunroom_Rogers":
			ChangeCharacterAddressGroup(CharacterFromID("Defoe_incognito"), "wr_gunroom", "sit", "sit5");
			LAi_SetSitType(characterFromID("Defoe_incognito"));
			LAi_SetActorType(CharacterFromID("Woodes Rogers"));
			LAi_ActorDialog(characterFromID("Woodes Rogers"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Woodes Rogers"));
			Characters[GetCharacterIndex("Woodes Rogers")].dialog.CurrentNode  = "gunroom";
		break;

		case "wr_gunroom_done":
			//from wr dialog
			ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "wr_gunroom", "sit", "sit7");
			LAi_SetSitType(CharacterFromID("Woodes Rogers"));

			LAi_SetStayType(Pchar);
			LAi_QuestDelay("wr_gunroom_done2", 1.0);
		break;

		case "wr_gunroom_done2":
			LAi_SetActorType(CharacterFromID("wr_cor4"));
			LAi_ActorDialog(characterFromID("wr_cor4"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wr_cor4"));
			Characters[GetCharacterIndex("wr_cor4")].dialog.CurrentNode  = "navigator";
		break;

		case "dampier_mission":
			//from dampier dialog
			AddQuestRecord("Librarian", "2");

			ChangeCharacterAddressGroup(CharacterFromID("wr_cor4"), "wr_gunroom", "sit", "sit11");
			LAi_SetSitType(CharacterFromID("wr_cor4"));
			PlaySound("VOICE\ENGLISH\Fre_m_c_076.wav");
			Characters[GetCharacterIndex("wr_cor4")].greeting  = "Gr_wr_cor4";//from now on

			Pchar.quest.take_items_log = "3";
			GiveItem2Character(Pchar, "spyglass2");
			EquipCharacterbyItem(Pchar, "spyglass2");
			GiveItem2Character(Pchar, "map");
			GiveItem2Character(Pchar, "book25");
			Pchar.quest.wr_library = "book25";//needed for new serie of locators switch yes
			DeleteAttribute(Pchar,"quest.take_items_log");

			LAi_QuestDelay("defoe_rum", 2.0);//molly-coddle speak
		break;

		case "defoe_rum":
			LAi_SetActorType(CharacterFromID("Defoe_incognito"));
			LAi_ActorDialog(characterFromID("Defoe_incognito"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Defoe_incognito"));
			Characters[GetCharacterIndex("Defoe_incognito")].dialog.CurrentNode  = "rum";
		break;

		case "rum_check":
			//from Defoe dialog
			ChangeCharacterAddressGroup(CharacterFromID("Defoe_incognito"), "wr_gunroom", "sit", "sit5");
			LAi_SetSitType(characterFromID("Defoe_incognito"));
			LAi_SetPlayerType(Pchar);

			pchar.quest.rum_check2.win_condition.l1 = "locator";
			pchar.quest.rum_check2.win_condition.l1.location = "wr_gunroom";
			pchar.quest.rum_check2.win_condition.l1.locator_group = "goto";
			pchar.quest.rum_check2.win_condition.l1.locator = "goto8";
			pchar.quest.rum_check2.win_condition = "rum_check2";
		break;

		case "rum_check2":
			LAi_SetActorType(CharacterFromID("Defoe_incognito"));
			LAi_ActorDialog(characterFromID("Defoe_incognito"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Defoe_incognito"));
			Characters[GetCharacterIndex("Defoe_incognito")].dialog.CurrentNode  = "rum_check";
		break;

		case "Rogers_molasses":
			//from Defoe dialog
			ChangeCharacterAddressGroup(CharacterFromID("Defoe_incognito"), "wr_gunroom", "sit", "sit5");
			LAi_SetSitType(characterFromID("Defoe_incognito"));
			LAi_SetActorType(CharacterFromID("Woodes Rogers"));
			LAi_ActorDialog(characterFromID("Woodes Rogers"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Woodes Rogers"));
			Characters[GetCharacterIndex("Woodes Rogers")].dialog.CurrentNode  = "molasses";
		break;

		case "book25_check":
			//from Rogers dialog
			AddQuestRecord("Distiller", "2");

			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "wr_gunroom", "sit", "sit7");
			LAi_SetSitType(CharacterFromID("Woodes Rogers"));

			pchar.quest.derrick_sound.win_condition.l1 = "locator";
			pchar.quest.derrick_sound.win_condition.l1.location = "wr_gunroom";
			pchar.quest.derrick_sound.win_condition.l1.locator_group = "goto";
			pchar.quest.derrick_sound.win_condition.l1.locator = "goto3";
			pchar.quest.derrick_sound.win_condition = "derrick_sound";
		break;

		case "derrick_sound":
			if(CheckCharacterItem(Pchar,"book25"))
			{
				PlaySound("PEOPLE\wood2.wav");

				locations[FindLocation("wr_library")].type = "Rogers_residence";
				locations[FindLocation("Tavern_storeroom")].type = "Rogers_neutral";
				LAi_SetStayType(Pchar);
				Locations[FindLocation("wr_library")].models.always.locators = "Res02_l_JRH7";
				//Locations[FindLocation("wr_library")].reload.l9.disable = 0;//open to sea battles
				Pchar.quest.seabattles_enable = "yes";
				ChangeCharacterAddressGroup(CharacterFromID("Selkirk"), "none", "", "");
				Locations[FindLocation("wr_library")].reload.l2.disable = 1;//closed to residence, maybe Selkirk locked the door
				ChangeCharacterAddressGroup(characterFromID("wr_voy"), "wr_library", "goto", "goto14");
				LAi_SetStayType(characterFromID("wr_voy"));

				LAi_QuestDelay("derrick_sound2", 1.0);
			}
			else
			{
				LAi_QuestDelay("book25_check", 0.1);
			}
		break;

		case "derrick_sound2":
			PlaySound("VOICE\ENGLISH\blaze_what_was_that.wav");
			LAi_SetPlayerType(Pchar);

			pchar.quest.big_derrick_sound.win_condition.l1 = "locator";
			pchar.quest.big_derrick_sound.win_condition.l1.location = "wr_library";
			pchar.quest.big_derrick_sound.win_condition.l1.locator_group = "reload";
			pchar.quest.big_derrick_sound.win_condition.l1.locator = "reload7";
			pchar.quest.big_derrick_sound.win_condition = "big_derrick_sound";
		break;

		case "big_derrick_sound":
			LAi_QuestDelay("big_derrick_sound2", 1.0);
		break;

		case "big_derrick_sound2":
			PlaySound("PEOPLE\derrick_fall.wav");
			CreateParticleSystemX("blast_dirt", 1.8, 2.2, -4.4, 1.8, 2.2, -4.4,10);
			CreateParticleSystemX("blast_dirt", -1.2, 2.2, -4.4, -1.2, 2.2, -4.4,10);
			CreateParticleSystemX("blast_dirt", 1.8, 2.2, -4.4, 1.8, 2.2, -4.4,10);
			CreateParticleSystemX("blast_dirt", -1.2, 2.2, -4.4, -1.2, 2.2, -4.4,10);

			LAi_SetStayType(Pchar);
			LAi_QuestDelay("big_derrick_sound3", 3.0);
		break;

		case "big_derrick_sound3":
			PlaySound("VOICE\ENGLISH\blaze_hah.wav");
			LAi_SetPlayerType(Pchar);
		break;

		case "book22and26_check":
			//to prevent just taking the medicine book without returning the sea battles book

			if(CheckCharacterItem(Pchar,"book22") && CheckCharacterItem(Pchar,"book26") )
			{
				TakeItemFromCharacter(Pchar, "book26");
				locations[FindLocation(Pchar.location)].box7.items.book26 = 1;
				Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Remember to return all books to their right places!"));
				PlaySound("PEOPLE\step_stairway.wav");
			}
		break;

		case "book22_check":
			//sea battles

			if(!CheckCharacterItem(Pchar,"book22") )
			{
				//pchar doesn't have it any longer - must be in box then!
				locations[FindLocation(Pchar.location)].box7.items.book22 = 0;
				Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Sea Battles book placed"));
				Pchar.quest.wr_book22 = "placed";

				LAi_QuestDelay("book26_pickup_check", 0.1);
			}
		break;

		case "book26_pickup_check":
			if(CheckCharacterItem(Pchar,"book26") )
			{
				Log_SetStringToLog(XI_ConvertString("You take item"));
				PlaySound("INTERFACE\important_item.wav");
			}
			else LAi_QuestDelay("book26_pickup_check", 0.5);
		break;

		case "book26_check":
			//medicine

			if(!CheckCharacterItem(Pchar,"book26") )
			{
				//pchar doesn't have it any longer - must be in box then!
				locations[FindLocation(Pchar.location)].box12.items.book26 = 0;
				Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Medicine book placed"));
				Pchar.quest.wr_book26 = "placed";
				ChangeCharacterAddressGroup(Pchar, "wr_library", "goto", "goto22");

				LAi_QuestDelay("book26_finished", 0.1);	//story continues ...
			}
		break;

		case "book26_finished":
			LAi_SetStayType(Pchar);
			LAi_QuestDelay("book26_finished1", 1.0);
		break;

		case "book26_finished1":
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"A note falls out of the Medicine book!"));
			PlaySound("AMBIENT\SHOP\paper.wav");
			GiveItem2Character(Pchar, "note1");
			locations[FindLocation("wr_study")].id.label = "Woodes Rogers' study";

			LAi_QuestDelay("book26_finished2", 2.0);
		break;

		case "book26_finished2":
			//LAi_SetStayType(Pchar);
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload3");

			ChangeCharacterAddressGroup(characterFromID("Woodes Rogers"), "wr_library", "goto", "goto12");
			LAi_SetStayType(characterFromID("Woodes Rogers"));
			LAi_SetActorType(CharacterFromID("Woodes Rogers"));
			LAi_ActorGoToLocator(characterFromID("Woodes Rogers"), "reload", "reload5", "rogers_to_study", 3.0);
		break;

		case "rogers_to_study":
			PlaySound("INTERFACE\key_unlock.wav");
			Locations[FindLocation("wr_library")].reload.l5.disable = 0;//open to study
			ChangeCharacterAddressGroup(characterFromID("Woodes Rogers"), "none", "", "");
			LAi_SetPlayerType(Pchar);
			LAi_QuestDelay("fill_study_box", 0.1);
		break;

		case "fill_study_box":
			pchar.quest.fill_study_box1.win_condition.l1 = "locator";
			pchar.quest.fill_study_box1.win_condition.l1.location = "wr_study";
			pchar.quest.fill_study_box1.win_condition.l1.locator_group = "reload";
			pchar.quest.fill_study_box1.win_condition.l1.locator = "reload1";
			pchar.quest.fill_study_box1.win_condition = "fill_study_box1";
		break;

		case "fill_study_box1":
			locations[FindLocation(Pchar.location)].box1.items.picture4 = 1;
			locations[FindLocation(Pchar.location)].box1.items.picture8 = 1;

			locations[FindLocation(Pchar.location)].box2.items.book27 = 1;//chemistry

			locations[FindLocation(Pchar.location)].box3.items.glue = 1;

			locations[FindLocation(Pchar.location)].box4.items.picture1 = 1;
			locations[FindLocation(Pchar.location)].box4.items.picture2 = 1;
			locations[FindLocation(Pchar.location)].box4.items.picture3 = 1;
			locations[FindLocation(Pchar.location)].box4.items.picture5 = 1;
			locations[FindLocation(Pchar.location)].box4.items.picture6 = 1;
			locations[FindLocation(Pchar.location)].box4.items.picture7 = 1;

			locations[FindLocation(Pchar.location)].box5.items.bladebottlew4 = 1;
			locations[FindLocation(Pchar.location)].box5.items.pistolbottlew4 = 1;

			locations[FindLocation(Pchar.location)].box6.items.picture9 = 1;
			locations[FindLocation(Pchar.location)].box6.items.picture10 = 1;
			locations[FindLocation(Pchar.location)].box6.items.picture11 = 1;
			locations[FindLocation(Pchar.location)].box6.items.picture13 = 1;
			locations[FindLocation(Pchar.location)].box6.items.picture14 = 1;
			locations[FindLocation(Pchar.location)].box6.items.picture15 = 1;

			ChangeCharacterAddressGroup(CharacterFromID("wr_bri"), "wr_gunroom", "sit", "sit10");
			LAi_SetSitType(characterFromID("wr_bri"));
			ChangeCharacterAddressGroup(CharacterFromID("wr_pir13"), "wr_gunroom", "sit", "sit9");
			LAi_SetSitType(characterFromID("wr_pir13"));
			ChangeCharacterAddressGroup(characterFromID("wr_voy"), "wr_library", "goto", "goto22");//a better start loc for walking around?
			LAi_SetStayType(characterFromID("wr_voy"));
			LAi_SetCitizenType(characterFromID("wr_voy"));

			LAi_QuestDelay("wood_study", 0.1);
			LAi_QuestDelay("repair_book", 0.1);
			LAi_QuestDelay("gunroom_second", 0.1);
		break;
//..................................................................................................................
		case "book36and27_check":
			//to prevent just taking the chemistry book without returning the tresure tale book

			if(CheckCharacterItem(Pchar,"book36") && CheckCharacterItem(Pchar,"book27") )
			{
				TakeItemFromCharacter(Pchar, "book27");
				locations[FindLocation(Pchar.location)].box2.items.book27 = 1;
				Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Remember to return all books to their right places!"));
				PlaySound("PEOPLE\step_stairway.wav");
			}
		break;

		case "book36_check":
			//treasure tale, gunroom

			if(!CheckCharacterItem(Pchar,"book36") )
			{
				//pchar doesn't have it any longer - must be in box then!
				locations[FindLocation(Pchar.location)].box2.items.book36 = 0;
				Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Treasure Tale placed!"));
				Pchar.quest.wr_book36 = "placed";

				LAi_QuestDelay("book27_pickup_check", 0.1);
			}
		break;

		case "book27_pickup_check":
			if(CheckCharacterItem(Pchar,"book27") )
			{
				Log_SetStringToLog(XI_ConvertString("You take item"));
				PlaySound("INTERFACE\important_item.wav");
			}
			else LAi_QuestDelay("book27_pickup_check", 0.5);
		break;

		case "book27_check":
			//chemistry, library

			if(!CheckCharacterItem(Pchar,"book27") )
			{
				//pchar doesn't have it any longer - must be in box then!
				locations[FindLocation(Pchar.location)].box3.items.book27 = 0;
				Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Chemistry book placed"));
				Pchar.quest.wr_book27 = "placed";

				LAi_QuestDelay("book27_finished", 0.1);
			}
		break;
//..................................................................................................................
		case "wood_study":
			if(CheckCharacterItem(Pchar,"bladewood"))
			{
				EquipCharacterbyItem(Pchar, "bladewood");
				PlaySound("AMBIENT\TAVERN\move3.wav");
				PlaySound("PEOPLE\step_wood1.wav");
				PlaySound("PEOPLE\clothes1.wav");

				LAi_QuestDelay("place_wood", 0.1);
			}
			else LAi_QuestDelay("wood_study", 0.5);
		break;

		case "place_wood":
			pchar.quest.place_wood1.win_condition.l1 = "locator";
			pchar.quest.place_wood1.win_condition.l1.location = "wr_gunroom";
			pchar.quest.place_wood1.win_condition.l1.locator_group = "box";
			pchar.quest.place_wood1.win_condition.l1.locator = "box4";
			pchar.quest.place_wood1.win_condition = "place_wood1";
		break;

		case "place_wood1":
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladewood");
			EquipCharacterByItem(Pchar, "bladeA11");
			PlaySound("PEOPLE\wood2.wav");
			Pchar.quest.rum_fuel = "wood";		//fire enabled
			Locations[FindLocation("wr_gunroom")].models.always.l1 = "wood";

			LAi_QuestDelay("hint_fire_kits1", 0.1);
			LAi_QuestDelay("place_wood1_A", 1.0);
		break;
//----------------------------------------------------------------------------------
		case "place_wood1_A":
			Locations[FindLocation("wr_gunroom")].image = "";
			DoQuestReloadToLocation("wr_gunroom", "goto", "goto7", "place_wood2");
		break;
//----------------------------------------------------------------------------------
		case "place_wood2":
			Locations[FindLocation("wr_gunroom")].image = "wr_gunroom.tga";
			if(CheckAttribute(Pchar,"quest.rum_fire") && Pchar.quest.rum_fire == "lit")
			{
				LAi_QuestDelay("place_wood3", 1.0);
			}
			else LAi_QuestDelay("place_wood2", 0.5);
		break;

		case "place_wood3":
			PlaySound("INTERFACE\officers_ammo.wav");
			PlaySound("INTERFACE\officers_ammo.wav");
		break;
//..................................................................................................................
		case "hint_fire_kits1":
			pchar.quest.hint_fire_kits2.win_condition.l1 = "locator";
			pchar.quest.hint_fire_kits2.win_condition.l1.location = "wr_gunroom";
			pchar.quest.hint_fire_kits2.win_condition.l1.locator_group = "goto";
			pchar.quest.hint_fire_kits2.win_condition.l1.locator = "goto8";
			pchar.quest.hint_fire_kits2.win_condition = "hint_fire_kits2";
		break;

		case "hint_fire_kits2":
			if(CheckAttribute(Pchar,"quest.rum_fire") && Pchar.quest.rum_fire == "unlit")
			{
				LAi_SetActorType(Pchar);
				LAi_ActorTurnToLocator(Pchar, "sit", "sit9");

				LAi_QuestDelay("hint_fire_kits3", 1.0);
			}
			else return;
		break;

		case "hint_fire_kits3":
			LAi_SetActorType(characterFromID("wr_pir13"));
			LAi_ActorDialog(characterFromID("wr_pir13"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wr_pir13"));
			Characters[GetCharacterIndex("wr_pir13")].dialog.CurrentNode  = "fire_kits";
		break;

		case "hint_fire_kits4":
			//from E Cook dialog
			AddQuestRecord("Distiller", "3");

			ChangeCharacterAddressGroup(CharacterFromID("wr_pir13"), "wr_gunroom", "sit", "sit9");
			LAi_SetSitType(characterFromID("wr_pir13"));
			ChangeCharacterAddressGroup(Pchar, "wr_gunroom", "goto", "goto9");

			LAi_QuestDelay("hint_fire_kits5", 1.0);
		break;

		case "hint_fire_kits5":
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("hint_fire_kits1", 0.1);
		break;
//..................................................................................................................
		case "repair_book":
			if(CheckCharacterItem(Pchar,"picture7") && CheckCharacterItem(Pchar,"glue") && CheckCharacterItem(Pchar,"book25"))
			{
				LAi_SetStayType(Pchar);
				PlaySound("AMBIENT\SHOP\paper.wav");

				TakeItemFromCharacter(Pchar, "picture7");
				TakeItemFromCharacter(Pchar, "book25");
				TakeItemFromCharacter(Pchar, "glue");
				GiveItem2Character(Pchar, "book31");
				Pchar.quest.wr_book31 = "repaired";

				LAi_QuestDelay("repair_book1", 2.0);
			}
			else LAi_QuestDelay("repair_book", 0.5);
		break;

		case "repair_book1":
			LAi_SetPlayerType(Pchar);
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"I have repaired Dampier's book!"));
			PlaySound("OBJECTS\DUEL\man_attack6.wav");
		break;
//..................................................................................................................
		case "gunroom_second":
			pchar.quest.gunroom_second1.win_condition.l1 = "locator";
			pchar.quest.gunroom_second1.win_condition.l1.location = "wr_gunroom";
			pchar.quest.gunroom_second1.win_condition.l1.locator_group = "goto";
			pchar.quest.gunroom_second1.win_condition.l1.locator = "goto8";
			pchar.quest.gunroom_second1.win_condition = "gunroom_second1";
		break;

		case "gunroom_second1":
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "goto9", "book31_status", 1.0);
		break;

		case "book31_status":
			if(CheckCharacterItem(CharacterFromID("wr_cor4"),"book31"))
			{
				LAi_QuestDelay("defoe_fire", 0.1);//transfer to defoe dialog
			}
			else
			{
				if(CheckCharacterItem(Pchar,"book31"))
				{
					LAi_SetActorType(CharacterFromID("wr_cor4"));
					LAi_ActorDialog(characterFromID("wr_cor4"), pchar, "", 0.0, 0.0);
					LAi_ActorWaitDialog(Pchar, characterFromID("wr_cor4"));
					Characters[GetCharacterIndex("wr_cor4")].dialog.CurrentNode  = "book_repaired";
				}
				else
				{
					LAi_SetActorType(CharacterFromID("wr_cor4"));
					LAi_ActorDialog(characterFromID("wr_cor4"), pchar, "", 0.0, 0.0);
					LAi_ActorWaitDialog(Pchar, characterFromID("wr_cor4"));
					Characters[GetCharacterIndex("wr_cor4")].dialog.CurrentNode  = "repair_the_book";
				}
			}
		break;

		case "glasses":
			//from dampier dialog "book_repaired"

			TakeItemFromCharacter(Pchar, "book31");
			GiveItem2Character(CharacterFromID("wr_cor4"), "book31");//for checking reasons
			GiveItem2Character(Pchar, "glasses");
			GiveItem2Character(Pchar, "note2");
			TakeItemFromCharacter(Pchar, "note1");
			LAi_SetStayType(Pchar);
			ChangeCharacterAddressGroup(CharacterFromID("wr_cor4"), "wr_gunroom", "sit", "sit11");
			LAi_SetSitType(characterFromID("wr_cor4"));

			LAi_QuestDelay("defoe_fire", 1.0);//from dampier to defoe, was 2.0
		break;

		case "returned_to_library_dampier":
			//from dampier dialog "repair_the_book"
			//Log_SetStringToLog("returned_to_library");

			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(CharacterFromID("wr_cor4"), "wr_gunroom", "sit", "sit11");
			LAi_SetSitType(characterFromID("wr_cor4"));

			pchar.quest.returned_to_library_dampier1.win_condition.l1 = "locator";
			pchar.quest.returned_to_library_dampier1.win_condition.l1.location = "wr_library";
			pchar.quest.returned_to_library_dampier1.win_condition.l1.locator_group = "reload";
			pchar.quest.returned_to_library_dampier1.win_condition.l1.locator = "reload7";
			pchar.quest.returned_to_library_dampier1.win_condition = "returned_to_library_dampier1";
		break;

		case "returned_to_library_dampier1":
			LAi_QuestDelay("gunroom_second", 0.1);	//loop dampier
		break;

		case "defoe_fire":
			if(CheckAttribute(Pchar,"quest.rum_fire") && Pchar.quest.rum_fire == "lit")
			{
				//LAi_QuestDelay("2dialogs_over", 0.1);	//adventure continues here ...
				LAi_QuestDelay("3dialogs_over", 0.1);	//no HERE!
			}
			else
			{
				if(CheckAttribute(Pchar,"quest.rum_fuel") && Pchar.quest.rum_fuel == "wood")
				{
					LAi_SetActorType(CharacterFromID("Defoe_incognito"));
					LAi_ActorDialog(characterFromID("Defoe_incognito"), pchar, "", 0.0, 0.0);
					LAi_ActorWaitDialog(Pchar, characterFromID("Defoe_incognito"));
					Characters[GetCharacterIndex("Defoe_incognito")].dialog.CurrentNode  = "light_fire";
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladewood"))
				{
					LAi_SetActorType(CharacterFromID("Defoe_incognito"));
					LAi_ActorDialog(characterFromID("Defoe_incognito"), pchar, "", 0.0, 0.0);
					LAi_ActorWaitDialog(Pchar, characterFromID("Defoe_incognito"));
					Characters[GetCharacterIndex("Defoe_incognito")].dialog.CurrentNode  = "light_fire";
				}
			}
			else
			{
				LAi_SetActorType(CharacterFromID("Defoe_incognito"));
				LAi_ActorDialog(characterFromID("Defoe_incognito"), pchar, "", 0.0, 0.0);
				LAi_ActorWaitDialog(Pchar, characterFromID("Defoe_incognito"));
				Characters[GetCharacterIndex("Defoe_incognito")].dialog.CurrentNode  = "get_some_wood";
			}
		break;

		case "light_fire":
			ChangeCharacterAddressGroup(CharacterFromID("Defoe_incognito"), "wr_gunroom", "sit", "sit5");
			LAi_SetSitType(characterFromID("Defoe_incognito"));
			LAi_SetPlayerType(Pchar);

			if(CheckAttribute(Pchar,"quest.rum_fire") && Pchar.quest.rum_fire == "lit")
			{
				LAi_QuestDelay("2dialogs_over", 0.1);	//adventure continues here ...
			}
			else LAi_QuestDelay("light_fire", 0.5);
		break;

		case "2dialogs_over":
			pchar.quest.2dialogs_over1.win_condition.l1 = "locator";
			pchar.quest.2dialogs_over1.win_condition.l1.location = "wr_gunroom";
			pchar.quest.2dialogs_over1.win_condition.l1.locator_group = "goto";
			pchar.quest.2dialogs_over1.win_condition.l1.locator = "goto8";
			pchar.quest.2dialogs_over1.win_condition = "2dialogs_over1";
		break;

		case "2dialogs_over1":
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "goto9", "2dialogs_over2", 1.0);
		break;

		case "2dialogs_over2":
			LAi_SetActorType(CharacterFromID("wr_cor4"));
			LAi_ActorDialog(characterFromID("wr_cor4"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wr_cor4"));
			Characters[GetCharacterIndex("wr_cor4")].dialog.CurrentNode  = "return_the_book";
		break;

		case "3dialogs_over":
			//from dampier dialog
			AddQuestRecord("Librarian", "3");

			LAi_SetSitType(characterFromID("wr_cor4"));
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(characterFromID("Woodes Rogers"), "wr_study", "reload", "reload2");

			pchar.quest.rogers_study.win_condition.l1 = "locator";
			pchar.quest.rogers_study.win_condition.l1.location = "wr_study";
			pchar.quest.rogers_study.win_condition.l1.locator_group = "reload";
			pchar.quest.rogers_study.win_condition.l1.locator = "reload1";
			pchar.quest.rogers_study.win_condition = "rogers_study";
		break;

		case "rogers_study":
			LAi_SetStayType(Pchar);
			LAi_QuestDelay("rogers_study1", 2.0);
		break;

		case "rogers_study1":
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "goto8", "rogers_study2", 1.5);
		break;

		case "rogers_study2":
			LAi_SetActorType(CharacterFromID("Woodes Rogers"));
			LAi_ActorDialog(characterFromID("Woodes Rogers"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Woodes Rogers"));
			Characters[GetCharacterIndex("Woodes Rogers")].dialog.CurrentNode  = "3more_books";
		break;

		case "3more_books_done":
			//from wr dialog
			AddQuestRecord("Librarian", "4");

			LAi_SetStayType(Pchar);

			Pchar.quest.take_items_log = "3";
			GiveItem2Character(Pchar, "book28");//erotica
			GiveItem2Character(Pchar, "book29");//poetry
			GiveItem2Character(Pchar, "book35");//mercury
			DeleteAttribute(Pchar,"quest.take_items_log");

			LAi_SetActorType(CharacterFromID("Woodes Rogers"));
			LAi_ActorGoToLocator(characterFromID("Woodes Rogers"), "goto", "goto6", "rogers_before_sofa", 1.0);
		break;

		case "rogers_before_sofa":
			PlaySound("PEOPLE\yawn.wav");
			LAi_ActorAnimation(CharacterFromID("Woodes Rogers"), "death_0","rogers_sofa", 1.0);
		break;

		case "rogers_sofa":
			LAi_ActorSetLayMode(CharacterFromID("Woodes Rogers"));

			LAi_QuestDelay("rogers_sofa1", 0.1);//was 0.5
		break;

		case "rogers_sofa1":
			ChangeCharacterAddressGroup(characterFromID("Woodes Rogers"), "wr_study", "goto", "goto7");
			PlaySound("AMBIENT\JAIL\sigh2.wav");
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("rogers_sofa2", 2.0);
		break;

		case "rogers_sofa2":
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(characterFromID("wr_voy"), "wr_study", "reload", "reload1");

			LAi_QuestDelay("rogers_sofa3", 1.0);
		break;

		case "rogers_sofa3":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload1");

			LAi_QuestDelay("rogers_sofa4", 1.0);
		break;

		case "rogers_sofa4":
			LAi_SetPlayerType(Pchar);
			LAi_SetActorType(CharacterFromID("wr_voy"));
			LAi_ActorGoToLocator(characterFromID("wr_voy"), "goto", "goto5", "rogers_sofa5", 1.5);
		break;

		case "rogers_sofa5":
			ChangeCharacterAddressGroup(characterFromID("wr_voy"), "wr_study", "goto", "goto5");//for a better repeated startpoint?
			PlaySound("AMBIENT\SHOP\paper.wav");
			LAi_SetStayType(CharacterFromID("wr_voy"));
			//LAi_SetCitizenType(characterFromID("wr_voy"));
		break;

		case "chain":
			//from dover dialog
			Log_SetStringToLog(XI_ConvertString("You give item"));
			TakeItemFromCharacter(Pchar, "book35");
			GiveItem2Character(Pchar, "chain");
			PlaySound("AMBIENT\JAIL\chains2.wav");
		break;

		case "book27_finished":
			//from book27_check
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"A small Key is attached to the inside of the cover of the Chemistry book!"));
			PlaySound("INTERFACE\took_item.wav");
			GiveItem2Character(Pchar, "key10");
			ChangeCharacterAddressGroup(characterFromID("wr_voy"), "wr_study", "goto", "goto6");//at woodes rogers sofa

			LAi_QuestDelay("bladebottlew4_check", 0.1);
			LAi_QuestDelay("pistolbottlew4_check", 0.1);
		break;

		case "bladebottlew4_check":
			if(CheckCharacterItem(Pchar,"bladebottlew4") )
			{
				EquipCharacterByItem(Pchar, "bladebottlew4");

				LAi_QuestDelay("molasses_equiped_check", 0.1);//story continues ...
			}
			else
			{
				LAi_QuestDelay("bladebottlew4_check", 0.5);//loop check
			}
		break;

		case "pistolbottlew4_check":
			if(CheckCharacterItem(Pchar,"pistolbottlew4") )
			{
				EquipCharacterByItem(Pchar, "pistolbottlew4");

				LAi_QuestDelay("molasses_equiped_check", 0.1);//story continues ...
			}
			else
			{
				LAi_QuestDelay("pistolbottlew4_check", 0.5);//loop check
			}
		break;

		case "molasses_equiped_check":
			if(CheckCharacterItem(Pchar,"bladebottlew4") && CheckCharacterItem(Pchar,"pistolbottlew4"))
			{
				pchar.quest.shelf_is_stuck.win_condition.l1 = "locator";
				pchar.quest.shelf_is_stuck.win_condition.l1.location = "wr_library";
				pchar.quest.shelf_is_stuck.win_condition.l1.locator_group = "goto";
				pchar.quest.shelf_is_stuck.win_condition.l1.locator = "goto15";
				pchar.quest.shelf_is_stuck.win_condition = "shelf_is_stuck";
			}
			else
			{
				LAi_QuestDelay("molasses_equiped_check", 0.5);//loop check
			}
		break;

		case "shelf_is_stuck":
			pchar.quest.friday_erotica.win_condition.l1 = "locator";
			pchar.quest.friday_erotica.win_condition.l1.location = "wr_library";
			pchar.quest.friday_erotica.win_condition.l1.locator_group = "goto";
			pchar.quest.friday_erotica.win_condition.l1.locator = "goto27";
			pchar.quest.friday_erotica.win_condition = "friday_erotica";
		break;

		case "friday_erotica":
			LAi_SetStayType(Pchar);
			PlaySound("PEOPLE\counter_openclose.wav");

			ChangeCharacterAddressGroup(CharacterFromID("friday"), "wr_library", "goto", "goto20");
			Locations[FindLocation("wr_library")].reload.l5.disable = 1;//temp locked to study to avoid double autoclose/open

			LAi_SetActorType(CharacterFromID("friday"));
			LAi_ActorGoToLocator(characterFromID("friday"), "goto", "goto27", "friday_erotica1", 5.0);
		break;

		case "friday_erotica1":
			LAi_SetActorType(CharacterFromID("Friday"));
			LAi_ActorDialog(characterFromID("Friday"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Friday"));
			Characters[GetCharacterIndex("Friday")].dialog.CurrentNode  = "erotica";
		break;

		case "friday_erotica1_A":
			//from Friday dialog

			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Now where did HE come from!?"));
			LAi_SetPlayerType(Pchar);
			LAi_SetStayType(CharacterFromID("friday"));
		Pchar.quest.erotica_enable = "yes";

			pchar.quest.friday_erotica2.win_condition.l1 = "locator";
			pchar.quest.friday_erotica2.win_condition.l1.location = "wr_library";
			pchar.quest.friday_erotica2.win_condition.l1.locator_group = "box";
			pchar.quest.friday_erotica2.win_condition.l1.locator = "box10";
			pchar.quest.friday_erotica2.win_condition = "friday_erotica2";
		break;

		case "friday_erotica2":
			Pchar.quest.erotica = "visited";
			ChangeCharacterAddressGroup(characterFromID("friday"), "none", "", "");
			Locations[FindLocation("wr_library")].models.always.locators = "Res02_l_JRH5";//autoclose both shelves

			LAi_QuestDelay("autoopen_right_shelf", 0.1);
			LAi_QuestDelay("more_gunroom_characters", 0.1);
		break;

//.............................................................................................................................
		case "book28andCorkscrews_check":
			//to prevent just taking the corkscrews without returning the erotic book

			if(CheckCharacterItem(Pchar,"book28") && CheckCharacterItem(Pchar,"corkscrews") )
			{
				TakeItemFromCharacter(Pchar, "corkscrews");
				locations[FindLocation(Pchar.location)].box10.items.corkscrews = 1;
				Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Remember to return all books to their right places!"));
				PlaySound("PEOPLE\step_stairway.wav");
			}
		break;

		case "book28_check":
			//erotica

			if(!CheckCharacterItem(Pchar,"book28") )
			{
				//pchar doesn't have it any longer - must be in box then!
				locations[FindLocation(Pchar.location)].box10.items.book28 = 0;
				Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Erotic book placed"));
				Pchar.quest.wr_book28 = "placed";
			}
		break;
//.............................................................................................................................
		case "more_gunroom_characters":
			ChangeCharacterAddressGroup(CharacterFromID("wr_voy"), "wr_gunroom", "sit", "sit7");
			LAi_SetSitType(characterFromID("wr_voy"));
			//Characters[GetCharacterIndex("wr_voy")].dialog.CurrentNode  = "first_time";

			ChangeCharacterAddressGroup(CharacterFromID("Wench3"), "wr_gunroom", "waitress", "barmen");
			LAi_SetStayType(characterFromID("Wench3"));
			ChangeCharacterAddressGroup(characterFromID("friday"), "wr_gunroom", "sit", "sit1");
			LAi_SetSitType(characterFromID("friday"));

			Pchar.quest.rum_fire = "unlit";
			Pchar.quest.rum_fuel = "no";
			Locations[FindLocation("wr_gunroom")].models.always.l1 = "";	//wood is used

			if(Locations[FindLocation("wr_gunroom")].models.always.locators == "tavern02_locators_JRH1_F")
				Locations[FindLocation("wr_gunroom")].models.always.locators = "tavern02_locators_JRH1";

			if(Locations[FindLocation("wr_gunroom")].models.always.locators == "tavern02_locators_JRH2_F")
				Locations[FindLocation("wr_gunroom")].models.always.locators = "tavern02_locators_JRH2";

			Locations[FindLocation("wr_gunroom")].locators_radius.waitress.barmen = 2.2;

			pchar.quest.clothes.win_condition.l1 = "locator";
			pchar.quest.clothes.win_condition.l1.location = "wr_gunroom";
			pchar.quest.clothes.win_condition.l1.locator_group = "waitress";
			pchar.quest.clothes.win_condition.l1.locator = "barmen";
			pchar.quest.clothes.win_condition = "clothes";
		break;

		case "clothes":
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
			Characters[GetCharacterIndex("Wench3")].dialog.CurrentNode  = "clothes";
		break;

		case "clothes_done":
			//from Car K dialog
			LAi_SetStayType(characterFromID("Wench3"));
			SetModel(PChar, "Pira4M_HT", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);
			Pchar.quest.outfit = "blue_uniform_hat";

			PlaySound("PEOPLE\clothes1.wav");

			LAi_QuestDelay("clothes_done1", 1.0);
		break;

		case "clothes_done1":
			PlaySound("VOICE\ENGLISH\blaze_hah.wav");

			LAi_QuestDelay("clothes_done2", 0.5);
		break;

		case "clothes_done2":
			PlaySound("VOICE\ENGLISH\gr_wench3_mhm.wav");
		break;

		case "bartender_arrives":
			//from box3 gunroom itemlogic (molasses tank)
			PlaySound("INTERFACE\closed_door.wav");

			ChangeCharacterAddressGroup(CharacterFromID("wr_man2"), "wr_gunroom", "barmen", "stay");
			GiveItem2Character(CharacterFromID("wr_man2"), "bladebucket");
			EquipCharacterByItem(CharacterFromID("wr_man2"), "bladebucket");
			GiveItem2Character(CharacterFromID("wr_man2"), "pistolbucket");
			EquipCharacterByItem(CharacterFromID("wr_man2"), "pistolbucket");

			LAi_SetStayType(Pchar);

			Pchar.quest.bar_status = "0";
			Pchar.quest.bar_rum = "0";
			Pchar.quest.bar_wine = "0";
			Pchar.quest.bar_beer = "0";

			LAi_QuestDelay("bartender_arrives1", 1.0);
		break;

		case "bartender_arrives1":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "barmen", "stay");

			LAi_QuestDelay("Pchar_playertype", 1.0);
		break;
//------------------------------------------------------------------------------------------------------------------------
		case "water_exit_check":
			pchar.quest.water_exit_check1.win_condition.l1 = "locator";
			pchar.quest.water_exit_check1.win_condition.l1.location = "wr_gunroom";
			pchar.quest.water_exit_check1.win_condition.l1.locator_group = "goto";
			pchar.quest.water_exit_check1.win_condition.l1.locator = "goto8";
			pchar.quest.water_exit_check1.win_condition = "water_exit_check1";
		break;

		case "water_exit_check1":
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "goto9", "water_exit_check2", 1.0);
		break;

		case "water_exit_check2":
			//generated in "water_tank"
			if(CheckAttribute(Pchar,"quest.wheel_check") && Pchar.quest.wheel_check != "0")
			{
				LAi_SetActorType(CharacterFromID("wr_bri"));
				LAi_ActorDialog(characterFromID("wr_bri"), pchar, "", 0.0, 0.0);
				LAi_ActorWaitDialog(Pchar, characterFromID("wr_bri"));
				Characters[GetCharacterIndex("wr_bri")].dialog.CurrentNode  = "Courtney_Johnson";
			}
			else
			{
				LAi_SetActorType(CharacterFromID("Defoe_incognito"));
				LAi_ActorDialog(characterFromID("Defoe_incognito"), pchar, "", 0.0, 0.0);
				LAi_ActorWaitDialog(Pchar, characterFromID("Defoe_incognito"));
				Characters[GetCharacterIndex("Defoe_incognito")].dialog.CurrentNode  = "wheel_check";
			}
		break;

		case "wheel_check":
			//from defoe wrong exit dialog
			ChangeCharacterAddressGroup(CharacterFromID("Defoe_incognito"), "wr_gunroom", "sit", "sit5");
			LAi_SetSitType(characterFromID("Defoe_incognito"));
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("water_exit_check", 0.1);//loops until wheel is checked
		break;

		case "no_comments":
			//from courtney dialog
			AddQuestRecord("Librarian", "5");

			PlaySound("VOICE\ENGLISH\blaze_huh.wav");

			LAi_SetSitType(CharacterFromID("wr_bri"));

			LAi_QuestDelay("Johnson_huh", 1.0);
		break;

		case "Johnson_huh":
			PlaySound("VOICE\ENGLISH\defoe_meet.wav");
			LAi_SetStayType(characterFromID("Defoe_incognito"));
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Defoe_incognito"));

			LAi_QuestDelay("Johnson_huh2", 3.0);
		break;

		case "Johnson_huh2":
			PlaySound("AMBIENT\BROTHEL\bxm_talks1.wav");
			PlaySound("AMBIENT\BROTHEL\bxm_talks2.wav");
			LAi_SetSitType(characterFromID("Defoe_incognito"));
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("rogers_awake_check", 0.1);
		break;
//-----------------------------------------------------------------------------------------------------------------------
		case "rogers_awake_check":
			pchar.quest.rogers_awake_check1.win_condition.l1 = "locator";
			pchar.quest.rogers_awake_check1.win_condition.l1.location = "wr_study";
			pchar.quest.rogers_awake_check1.win_condition.l1.locator_group = "reload";
			pchar.quest.rogers_awake_check1.win_condition.l1.locator = "reload1";
			pchar.quest.rogers_awake_check1.win_condition = "rogers_awake_check1";
		break;

		case "rogers_awake_check1":
			if(CheckCharacterItem(Pchar,"book24"))
			{
				LAi_QuestDelay("rogers_awake", 0.1);
			}
			else
			{
				PlaySound("PEOPLE\yawn.wav");
				LAi_QuestDelay("rogers_awake_check", 0.5);//loops until book24 is brought to study
			}
		break;

		case "rogers_awake":
			LAi_SetSitType(CharacterFromID("Woodes Rogers"));
			ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "wr_study", "sit", "sit1");

			pchar.quest.rogers_awake2.win_condition.l1 = "locator";
			pchar.quest.rogers_awake2.win_condition.l1.location = "wr_study";
			pchar.quest.rogers_awake2.win_condition.l1.locator_group = "goto";
			pchar.quest.rogers_awake2.win_condition.l1.locator = "goto9";
			pchar.quest.rogers_awake2.win_condition = "rogers_awake2";
		break;

		case "rogers_awake2":
			LAi_SetActorType(CharacterFromID("Woodes Rogers"));
			LAi_ActorDialog(characterFromID("Woodes Rogers"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Woodes Rogers"));
			Characters[GetCharacterIndex("Woodes Rogers")].dialog.CurrentNode  = "mission5";
		break;

		case "mission5_given":
			//from rogers dialog
			SetQuestHeader("Woodes_Rogers_reward_5");
			AddQuestRecord("Woodes_Rogers_reward_5", "1");

			Pchar.quest.wr_library = "mission5";//needed for new serie of locators: 8 9 10 (poetry books are visible)
			Locations[FindLocation("wr_library")].models.always.locators = "Res02_l_JRH8";//must have been ...JRH5 (both up)

			PlaySound("VOICE\ENGLISH\gr_WR_friend3.wav");
			ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "wr_study", "sit", "sit1");
			LAi_SetSitType(CharacterFromID("Woodes Rogers"));

			ChangeCharacterAddressGroup(CharacterFromID("wr_oman1X"), "wr_library", "goto", "goto13");
			LAi_SetStayType(characterFromID("wr_oman1X"));

			LAi_QuestDelay("gunner_poetry", 0.1);
		break;

		case "gunner_poetry":
			if(CheckCharacterItem(Pchar,"book29"))
			{
				pchar.quest.gunner_poetry1.win_condition.l1 = "locator";
				pchar.quest.gunner_poetry1.win_condition.l1.location = "wr_library";
				pchar.quest.gunner_poetry1.win_condition.l1.locator_group = "goto";
				pchar.quest.gunner_poetry1.win_condition.l1.locator = "goto29";
				pchar.quest.gunner_poetry1.win_condition = "gunner_poetry1";
			}
			else
			{
				LAi_QuestDelay("gunner_poetry", 0.5);//loops until book29 is brought to gunner
			}
		break;

		case "gunner_poetry1":
			LAi_SetActorType(characterFromID("wr_oman1X"));
			LAi_ActorDialog(characterFromID("wr_oman1X"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wr_oman1X"));
			Characters[GetCharacterIndex("wr_oman1X")].dialog.CurrentNode  = "poetry";
		break;

		case "poetry_talk_finished":
			//from gunner dialog

			ChangeCharacterAddressGroup(CharacterFromID("wr_oman1X"), "wr_library", "sit", "sit2");
			LAi_SetSitType(characterFromID("wr_oman1X"));
			TakeItemFromCharacter(Pchar, "book29");
			GiveItem2Character(CharacterFromID("wr_oman1X"), "book29");

		break;

		case "book30_return":
			//from itmlogic
			//to prevent just taking the poetry books without an empty sack

			if(CheckCharacterItem(Pchar,"book30"))
			{
				TakeItemFromCharacter(Pchar, "book30");
				locations[FindLocation(Pchar.location)].box1.items.book30 = 1;
				Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"You need something to carry the books in!"));
				PlaySound("PEOPLE\step_stairway.wav");

				if(CheckAttribute(Pchar,"quest.rum_sack") && Pchar.quest.rum_sack == "no")
					LAi_QuestDelay("selkirk_sack", 0.1);
			}
		break;
//-------------------------------------------------------------------------------------------------------------------------
		case "selkirk_sack":
			Pchar.quest.rum_sack = "soon";
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "goto", "goto3", 2.0);

			pchar.quest.selkirk_sack1.win_condition.l1 = "locator";
			pchar.quest.selkirk_sack1.win_condition.l1.location = "wr_library";
			pchar.quest.selkirk_sack1.win_condition.l1.locator_group = "goto";
			pchar.quest.selkirk_sack1.win_condition.l1.locator = "goto3";
			pchar.quest.selkirk_sack1.win_condition = "selkirk_sack1";
		break;

		case "selkirk_sack1":
			ChangeCharacterAddressGroup(CharacterFromID("Selkirk"), "wr_library", "reload", "reload5");
			PlaySound("INTERFACE\closed_locked_door.wav");
			LAi_SetStayType(Pchar);

			LAi_SetActorType(characterFromID("Selkirk"));

			LAi_QuestDelay("selkirk_sack2", 1.0);
			LAi_ActorGoToLocator(characterFromID("Selkirk"), "goto", "goto3", "selkirk_sack3", 4.0);
		break;

		case "selkirk_sack2":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Selkirk"));
		break;

		case "selkirk_sack3":
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorDialog(characterFromID("Selkirk"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Selkirk"));
			Characters[GetCharacterIndex("Selkirk")].dialog.CurrentNode  = "sack";
		break;

		case "selkirk_got_glasses":
			//from selkirk dialog

			LAi_SetStayType(characterFromID("Selkirk"));
			PlaySound("VOICE\ENGLISH\Eng_m_c_072.wav");
			GiveItem2Character(Pchar, "emptysack");
			TakeItemFromCharacter(Pchar, "glasses");
			LAi_SetPlayerType(Pchar);
		break;

//-------------------------------------------------------------------------------------------------------------------------
		case "book30_pickup":
			//from itmlogic
			if(CheckCharacterItem(Pchar,"book30"))
			{
				AddQuestRecord("Librarian", "7");
				CloseQuestHeader("Librarian");

				TakeItemFromCharacter(Pchar, "book30");
				TakeItemFromCharacter(Pchar, "emptysack");
				GiveItem2Character(Pchar, "bladesack");
				EquipCharacterByItem(Pchar, "bladesack");

				PlaySound("PEOPLE\run_wood.wav");
				ChangeCharacterAddressGroup(CharacterFromID("wr_oman1X"), "wr_library", "reload", "reload1");
				LAi_SetStayType(characterFromID("wr_oman1X"));
				ChangeCharacterAddressGroup(CharacterFromID("Selkirk"), "wr_gunroom", "sit", "sit2");
				LAi_SetSitType(characterFromID("Selkirk"));
				ChangeCharacterAddressGroup(CharacterFromID("Dave Edna"), "wr_gunroom", "tables", "stay4");
				LAi_SetStayType(characterFromID("Dave Edna"));

				pchar.quest.gunner_walks.win_condition.l1 = "locator";
				pchar.quest.gunner_walks.win_condition.l1.location = "wr_library";
				pchar.quest.gunner_walks.win_condition.l1.locator_group = "goto";
				pchar.quest.gunner_walks.win_condition.l1.locator = "goto29";
				pchar.quest.gunner_walks.win_condition = "gunner_walks";
			}
		break;

		case "gunner_walks":
			LAi_SetStayType(Pchar);
			LAi_SetActorType(characterFromID("wr_oman1X"));

			LAi_QuestDelay("gunner_walks5", 5.0);
			LAi_ActorGoToLocator(characterFromID("wr_oman1X"), "reload", "reload2", "gunner_walks1", 12.0);
		break;

		case "gunner_walks1":
			ChangeCharacterAddressGroup(CharacterFromID("wr_oman1X"), "wr_residence", "reload", "reload7");
			LAi_SetStayType(characterFromID("wr_oman1X"));

			PlaySound("INTERFACE\key_unlock.wav");
			Locations[FindLocation("wr_library")].reload.l2.disable = 0;//open to residence
			Locations[FindLocation("wr_residence")].reload.l7.disable = 0;//open to armory
			Locations[FindLocation("wr_gunpowder")].reload.l3.disable = 0;//open to gunroom

			pchar.quest.gunner_walks2.win_condition.l1 = "locator";
			pchar.quest.gunner_walks2.win_condition.l1.location = "wr_residence";
			pchar.quest.gunner_walks2.win_condition.l1.locator_group = "reload";
			pchar.quest.gunner_walks2.win_condition.l1.locator = "reload2";
			pchar.quest.gunner_walks2.win_condition = "gunner_walks2";
		break;

		case "gunner_walks2":
			PlaySound("VOICE\ENGLISH\Eng_m_b_059.wav");
			LAi_QuestDelay("gunner_walks3", 2.5);
		break;

		case "gunner_walks3":
			ChangeCharacterAddressGroup(CharacterFromID("wr_oman1X"), "wr_gunroom", "sit", "sit6");
			LAi_SetSitType(characterFromID("wr_oman1X"));
			PlaySound("INTERFACE\closed_door.wav");

			pchar.quest.gunner_walks4.win_condition.l1 = "locator";
			pchar.quest.gunner_walks4.win_condition.l1.location = "wr_armory";
			pchar.quest.gunner_walks4.win_condition.l1.locator_group = "goto";
			pchar.quest.gunner_walks4.win_condition.l1.locator = "goto19";
			pchar.quest.gunner_walks4.win_condition = "gunner_walks4";
		break;

		case "gunner_walks4":
			PlaySound("INTERFACE\closed_door.wav");

			SetModel(characterFromID("Powdermonkey"), "monkey", "monkey", "monkey", 1.8, false);
			ChangeCharacterAddressGroup(CharacterFromID("PowderMonkey"), "wr_gunpowder", "randitem", "randitem7");
			LAi_SetActorType(characterFromID("powdermonkey"));//stops from attacking

			ChangeCharacterAddressGroup(CharacterFromID("wr_man2"), "wr_gunroom", "goto", "goto9");
			LAi_SetWaitressType(characterFromID("wr_man2"));

			pchar.quest.gunner_walks6.win_condition.l1 = "locator";
			pchar.quest.gunner_walks6.win_condition.l1.location = "wr_gunpowder";
			pchar.quest.gunner_walks6.win_condition.l1.locator_group = "reload";
			pchar.quest.gunner_walks6.win_condition.l1.locator = "reload3_D";
			pchar.quest.gunner_walks6.win_condition = "gunner_walks6";
		break;

		case "gunner_walks5":
			LAi_SetPlayerType(Pchar);
		break;

		case "gunner_walks6":
			LAi_ActorTurnToCharacter(characterFromID("PowderMonkey"), PChar);
			PlaySound("OBJECTS\DUEL\monkey_attack2.wav");

			LAi_QuestDelay("gunroom_entre_gps", 0.1);
			LAi_QuestDelay("gunroom_jump", 0.1);
			LAi_QuestDelay("place_sack", 0.1);
		break;
//--------------------------------------------------------------------------------------------------------------------------------------
		case "place_sack":
			pchar.quest.place_sack1.win_condition.l1 = "locator";
			pchar.quest.place_sack1.win_condition.l1.location = "wr_gunroom";
			pchar.quest.place_sack1.win_condition.l1.locator_group = "box";
			pchar.quest.place_sack1.win_condition.l1.locator = "box4";
			pchar.quest.place_sack1.win_condition = "place_sack1";
		break;

		case "place_sack1":
			Pchar.quest.disable_rebirth = true;			//if Pchar dies while distilling
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladesack");
			EquipCharacterByItem(Pchar, "bladeA11");
			PlaySound("PEOPLE\wood2.wav");
			Pchar.quest.rum_fuel = "sack";		//fire enabled
			Locations[FindLocation("wr_gunroom")].models.always.l1 = "sack2";

			LAi_QuestDelay("place_sack1_A", 1.0);
		break;
//---------------------------------------------------------------------------------------------
		case "place_sack1_A":
			Locations[FindLocation("wr_gunroom")].image = "";
			DoQuestReloadToLocation("wr_gunroom", "goto", "goto7", "place_sack2");
		break;
//---------------------------------------------------------------------------------------------
		case "place_sack2":
			Locations[FindLocation("wr_gunroom")].image = "wr_gunroom.tga";
			if(CheckAttribute(Pchar,"quest.rum_fire") && Pchar.quest.rum_fire == "lit")
			{
				LAi_QuestDelay("place_sack3", 1.0);
			}
			else LAi_QuestDelay("place_sack2", 0.5);
		break;

		case "place_sack3":
			PlaySound("INTERFACE\officers_ammo.wav");
			PlaySound("INTERFACE\officers_ammo.wav");
		break;
//--------------------------------------------------------------------------------------------------------------------------------------
		case "barrel_and_key":
			//from distill_key1

			if(CheckCharacterItem(Pchar,"bladebarrel"))
			{
				AddQuestRecord("Distiller", "4");
				CloseQuestHeader("Distiller");

				DeleteAttribute(PChar, "quest.disable_rebirth");
				EquipCharacterbyItem(Pchar, "bladebarrel");
				GiveItem2Character(Pchar, "key7");
				Locations[FindLocation("Tavern_storeroom")].locators_radius.box.box1 = 1.0;
				Locations[FindLocation("Tavern_storeroom")].locators_radius.reload.reload1 = 0.0001;
				TakeItemFromCharacter(Pchar, "note2");
				LAi_SetPlayerType(Pchar);

				LAi_QuestDelay("rogers_opens_library", 2.0);
				LAi_QuestDelay("rogers_opens_library4", 3.0);
			}
			else LAi_QuestDelay("barrel_and_key", 0.5);	//loops until items are taken
		break;

		case "rogers_opens_library":
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "wr_gunroom", "reload", "reload2");
			LAi_SetActorType(CharacterFromID("Woodes Rogers"));
			LAi_ActorGoToLocator(characterFromID("Woodes Rogers"), "goto", "goto9", "rogers_opens_library2", 7.0);

			Locations[FindLocation("wr_library")].reload.l2.disable = 1;//locked to residence
			Locations[FindLocation("wr_library")].reload.l7.disable = 0;//unlocked to gunroom
			Locations[FindLocation("wr_gunroom")].reload.l2.disable = 0;//unlocked to library
			Pchar.quest.wr_gunroom = "unlocked";
			Locations[FindLocation("wr_library")].models.always.locators = "Res02_l_JRH10";//both shelves down

			pchar.quest.windem_opens_attic.win_condition.l1 = "locator";
			pchar.quest.windem_opens_attic.win_condition.l1.location = "wr_library";
			pchar.quest.windem_opens_attic.win_condition.l1.locator_group = "reload";
			pchar.quest.windem_opens_attic.win_condition.l1.locator = "reload7";
			pchar.quest.windem_opens_attic.win_condition = "windem_opens_attic";
		break;

		case "windem_opens_attic":
			SetCurrentTime(21.00, 0);
			SetNextWeather("Red Sky");
			Pchar.quest.JRH_rain = "Cloudy";

			Locations[FindLocation("Storeroom_attic")].environment.weather = "true";

			locations[FindLocation(Pchar.location)].box4.items.book24 = 1;
			Locations[FindLocation("wr_library")].reload.l3.disable = 0;//unlocked to attic

			pchar.quest.windem_opens_attic1.win_condition.l1 = "locator";
			pchar.quest.windem_opens_attic1.win_condition.l1.location = "wr_library";
			pchar.quest.windem_opens_attic1.win_condition.l1.locator_group = "reload";
			pchar.quest.windem_opens_attic1.win_condition.l1.locator = "reload3";
			pchar.quest.windem_opens_attic1.win_condition = "windem_opens_attic1";
		break;

		case "rogers_opens_library2":
			LAi_ActorTurnToCharacter(characterFromID("Woodes Rogers"), PChar);
			PlaySound("VOICE\ENGLISH\gr_WR_friend4.wav");

			LAi_QuestDelay("rogers_opens_library3", 4.0);
		break;

		case "rogers_opens_library3":
			ResumeAllSounds();
			ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "wr_gunroom", "sit", "sit8");
			LAi_SetSitType(CharacterFromID("Woodes Rogers"));
		break;

		case "rogers_opens_library4":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto8");

			LAi_QuestDelay("rogers_opens_library5", 1.0);
		break;

		case "rogers_opens_library5":
			LAi_SetPlayerType(Pchar);
		break;

		case "windem_opens_attic1":
			LAi_SetStayType(Pchar);
			PlaySound("INTERFACE\closet_open.wav");

			LAi_QuestDelay("windem_opens_attic2", 1.0);
		break;

		case "windem_opens_attic2":
			ChangeCharacterAddressGroup(CharacterFromID("Charles Windem"), "wr_library", "goto", "goto30");
			PlaySound("PEOPLE\jump.wav");
			PlaySound("OBJECTS\VOICES\body_fallen1.wav");

			Locations[FindLocation("Charles_windem_room")].reload.l3.disable = 1;//locked to storeroom
			Locations[FindLocation("Tavern_storeroom")].reload.l2.disable = 1;//to tavern
			Locations[FindLocation("Tavern_storeroom")].reload.l4.disable = 1;//to windem room
			Locations[FindLocation("Tavern_storeroom")].models.always.locators = "store04_locators_JRH4";//with planks & reload5

			LAi_QuestDelay("windem_opens_attic3", 1.0);
		break;

		case "windem_opens_attic3":
			PlaySound("VOICE\ENGLISH\Eng_m_c_038.wav");

			LAi_SetPlayerType(Pchar);

			pchar.quest.windem_opens_attic4.win_condition.l1 = "locator";
			pchar.quest.windem_opens_attic4.win_condition.l1.location = "Charles_windem_room";
			pchar.quest.windem_opens_attic4.win_condition.l1.locator_group = "goto";
			pchar.quest.windem_opens_attic4.win_condition.l1.locator = "goto4";
			pchar.quest.windem_opens_attic4.win_condition = "windem_opens_attic4";
		break;

		case "windem_opens_attic4":
			Locations[FindLocation("Redmond_Town_01")].reload.l18.disable = 1;//window to residence

			Locations[FindLocation("Storeroom_attic")].environment.weather = "false";
			ChangeCharacterAddressGroup(Pchar, "Charles_windem_room", "reload", "reload1");

			pchar.quest.windem_opens_attic5.win_condition.l1 = "locator";
			pchar.quest.windem_opens_attic5.win_condition.l1.location = "Tavern_storeroom";
			pchar.quest.windem_opens_attic5.win_condition.l1.locator_group = "goto";
			pchar.quest.windem_opens_attic5.win_condition.l1.locator = "goto1";
			pchar.quest.windem_opens_attic5.win_condition = "windem_opens_attic5";
		break;

		case "windem_opens_attic5":
			LAi_SetSitType(Pchar);
			PlaySound("OBJECTS\VOICES\DEAD\male\dead6.wav");

			LAi_QuestDelay("windem_opens_attic6", 0.5);
		break;

		case "windem_opens_attic6":
			GetCharacterPos(Pchar, &x1, &y1, &z1);
			CreateParticleSystemX("blast_dirt", x1, y1, z1, x1, y1, z1,10);
			CreateParticleSystemX("blast_dirt", x2, y2, z2, x2, y2, z2,10);
			CreateParticleSystemX("blast_dirt", x3, y3, z3, x3, y3, z3,10);

			PlaySound("PEOPLE\jump.wav");
			PlaySound("PEOPLE\jump_roof.wav");
			PlaySound("PEOPLE\wood3.wav");

			Php = LAi_GetCharacterHP(Pchar);
			Php3 = Php/3;
			LAi_ApplyCharacterDamage(Pchar, Php3);
			LAi_SetActorType(Pchar);
			LAi_ActorSetLayMode(Pchar);

			LAi_QuestDelay("windem_opens_attic7", 2.0);
		break;

		case "windem_opens_attic7":
			LAi_SetSitType(Pchar);
			PlaySound("OBJECTS\DUEL\man_hit6.wav");

			LAi_QuestDelay("windem_opens_attic8", 1.0);
		break;

		case "windem_opens_attic8":
			LAi_SetPlayerType(Pchar);
		break;
//...................................................................................................................
		case "steplock_mother":
			//loop started with  case "in_daves_room1"

			pchar.quest.steplock_mother1.win_condition.l1 = "locator";
			pchar.quest.steplock_mother1.win_condition.l1.location = "wr_mother";
			pchar.quest.steplock_mother1.win_condition.l1.locator_group = "goto";
			pchar.quest.steplock_mother1.win_condition.l1.locator = "goto6";
			pchar.quest.steplock_mother1.win_condition = "steplock_mother1";
		break;

		case "steplock_mother1":
			if(CheckCharacterItem(Pchar,"bladebarrel"))
			{
				//way out of loop
				LAi_SetStayType(Pchar);
				PlaySound("INTERFACE\step_open.wav");

				LAi_QuestDelay("steplock_barrel", 2.0);
			}
			else
			{
				LAi_SetStayType(Pchar);
				PlaySound("INTERFACE\step_open.wav");

				LAi_QuestDelay("steplock_mother2", 2.0);
			}
		break;

		case "steplock_mother2":
			LAi_SetPlayerType(Pchar);

			pchar.quest.steplock_mother3.win_condition.l1 = "locator";
			pchar.quest.steplock_mother3.win_condition.l1.location = "wr_mother";
			pchar.quest.steplock_mother3.win_condition.l1.locator_group = "goto";
			pchar.quest.steplock_mother3.win_condition.l1.locator = "goto1";
			pchar.quest.steplock_mother3.win_condition = "steplock_mother3";
		break;

		case "steplock_mother3":
			PlaySound("INTERFACE\key_lock.wav");
			PlaySound("INTERFACE\key_lock.wav");

			LAi_QuestDelay("steplock_mother", 0.1);//loop
		break;
//...................................................................................................................
		case "steplock_barrel":
			Locations[FindLocation("wr_mother")].models.always.locators = "brothel_room_locators_JRH4";//with barrel

			Locations[FindLocation("wr_mother")].image = "";
			DoQuestReloadToLocation("wr_mother", "goto", "goto1", "steplock_barrel1");
		break;

		case "steplock_barrel1":
			Locations[FindLocation("wr_mother")].image = "wr_mother.tga";
			TakeItemFromCharacter(Pchar, "bladebarrel");
			EquipCharacterByItem(Pchar, "bladeA11");
			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("wr_shop_office")].reload.l6.disable = 0;//to roof
		break;
//...................................................................................................................
		case "reputation_mother":
			locations[FindLocation("wr_mother_stairs")].id.label = "Grandma's stairs";
			LAi_QuestDelay("office_ladder", 0.1);
			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_ActorGoToLocator(characterFromID("grandma"), "goto", "goto7", "reputation_mother1", 3.0);
		break;

		case "reputation_mother0":
			LAi_SetStayType(Pchar);
		break;

		case "reputation_mother1":
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "goto", "goto7", 2.5);

			pchar.quest.reputation_mother2.win_condition.l1 = "locator";
			pchar.quest.reputation_mother2.win_condition.l1.location = "wr_mother";
			pchar.quest.reputation_mother2.win_condition.l1.locator_group = "goto";
			pchar.quest.reputation_mother2.win_condition.l1.locator = "goto7";
			pchar.quest.reputation_mother2.win_condition = "reputation_mother2";
		break;

		case "reputation_mother2":
			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_ActorDialog(characterFromID("grandma"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("grandma"));
			Characters[GetCharacterIndex("grandma")].dialog.CurrentNode  = "reputation";
		break;

		case "reputation_up":
			//from grandma rogers dialog
			locations[FindLocation("wr_shop_office")].id.label = "Shop office";

			ChangeCharacterReputation(pchar, 40);//5p per level. this should give 'Hero'
			PlaySound("VOICE\ENGLISH\blaze_hah.wav");

			LAi_SetCitizenType(characterFromID("grandma"));

			bDisableFastReload = 1;
		Pchar.quest.JRH_sky = "";
			SetCurrentTime(23.00, 0);
			SetNextWeather("Clear");
		break;
//...................................................................................................................
		case "office_ladder":
			LAi_SetPlayerType(Pchar);

			pchar.quest.office_ladder1.win_condition.l1 = "locator";
			pchar.quest.office_ladder1.win_condition.l1.location = "wr_shop_office";
			pchar.quest.office_ladder1.win_condition.l1.locator_group = "goto";
			pchar.quest.office_ladder1.win_condition.l1.locator = "goto5";
			pchar.quest.office_ladder1.win_condition = "office_ladder1";
		break;

		case "office_ladder1":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto6");

			LAi_QuestDelay("office_ladder2", 1.5);
		break;

		case "office_ladder2":
			LAi_SetPlayerType(Pchar);
			PlaySound("AMBIENT\CHURCH\bench1.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_shop_office", "goto", "goto6");

			LAi_QuestDelay("office_ladder3", 1.0);
		break;

		case "office_ladder3":
			PlaySound("AMBIENT\CHURCH\bench1.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_shop_office", "reload", "reload6");

			if(CheckAttribute(Locations[FindLocation("wr_shop_office")],"reload.l6.disable") && Locations[FindLocation("wr_shop_office")].reload.l6.disable == 1)
			{
				LAi_QuestDelay("office_ladder4", 1.5);
			}
			else
			{
			//if open you'll reach the roof ...

				pchar.quest.office_roof_run.win_condition.l1 = "locator";
				pchar.quest.office_roof_run.win_condition.l1.location = "Redmond_Town_01";
				pchar.quest.office_roof_run.win_condition.l1.locator_group = "goto";
				pchar.quest.office_roof_run.win_condition.l1.locator = "goto63";
				pchar.quest.office_roof_run.win_condition = "office_roof_run";
			}
		break;

		case "office_ladder4":
			ChangeCharacterAddressGroup(Pchar, "wr_shop_office", "goto", "goto7");

			LAi_QuestDelay("office_ladder5", 0.7);
		break;

		case "office_ladder5":
			PlaySound("PEOPLE\jump.wav");
			LAi_SetSitType(Pchar);

			LAi_QuestDelay("office_ladder", 0.3);
		break;
//...................................................................................................................
		case "office_roof_run":
			PlaySound("PEOPLE\Run_roof.wav");
			LAi_QuestDelay("office_roof_run1", 1.5);
		break;

		case "office_roof_run1":
			PlaySound("PEOPLE\Run_roof.wav");
			ChangeCharacterAddressGroup(Pchar, "Redmond_Town_01", "goto", "goto61");
		break;
//...................................................................................................................
		case "bridge_visible":
			PlaySound("INTERFACE\shelf_cogs.wav");

			LAi_QuestDelay("bridge_visible1", 1.0);
		break;

		case "bridge_visible1":
			Locations[FindLocation("Redmond_Town_01")].image = "";
			DoQuestReloadToLocation("Redmond_Town_01", "goto", "goto61", "bridge_visible2");
		break;

		case "bridge_visible2":

			Locations[FindLocation("Redmond_Town_01")].image = "Redmond_Town_01.tga";//after merge
			PlaySound("PEOPLE\wood3.wav");

			pchar.quest.bridge_run.win_condition.l1 = "locator";
			pchar.quest.bridge_run.win_condition.l1.location = "Redmond_Town_01";
			pchar.quest.bridge_run.win_condition.l1.locator_group = "goto";
			pchar.quest.bridge_run.win_condition.l1.locator = "goto62";
			pchar.quest.bridge_run.win_condition = "bridge_run";
		break;

		case "bridge_run":
			PlaySound("PEOPLE\step_stairway.wav");
			LAi_QuestDelay("bridge_run1", 0.5);
		break;

		case "bridge_run1":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead1.wav");

			LAi_QuestDelay("bridge_run2", 1.5);
		break;

		case "bridge_run2":
			SetCurrentTime(12.00, 0);
			SetNextWeather("Blue Sky");
			Locations[FindLocation("Redmond_shipyard")].environment.weather = "true";	//to 'activate' temp weather for loft

			PlaySound("PEOPLE\Run_wood.wav");
			ChangeCharacterAddressGroup(Pchar, "Redmond_Town_01", "reload", "reload13");

			pchar.quest.shipyard_loft.win_condition.l1 = "locator";
			pchar.quest.shipyard_loft.win_condition.l1.location = "Redmond_shipyard";
			pchar.quest.shipyard_loft.win_condition.l1.locator_group = "goto";
			pchar.quest.shipyard_loft.win_condition.l1.locator = "goto11";
			pchar.quest.shipyard_loft.win_condition = "shipyard_loft";
		break;
//...................................................................................................................
		case "shipyard_loft":
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("shipyard_loft0", 2.0);
		break;

		case "shipyard_loft0":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "randitem", "randitem6");

			LAi_QuestDelay("shipyard_loft1", 2.0);
		break;

		case "shipyard_loft1":
			LAi_ActorTurnToLocator(Pchar, "box", "box1");

			LAi_QuestDelay("shipyard_loft2", 2.0);
		break;

		case "shipyard_loft2":
			PlaySound("PEOPLE\Run_wood.wav");
			ChangeCharacterAddressGroup(Pchar, "Redmond_shipyard", "box", "box1");
		break;

		case "shipyard_loft3":
			//from itemlocic box1
			LAi_ActorTurnToLocator(Pchar, "box", "box2");

			LAi_QuestDelay("shipyard_loft4", 2.0);
		break;

		case "shipyard_loft4":
			PlaySound("PEOPLE\Run_wood.wav");
			ChangeCharacterAddressGroup(Pchar, "Redmond_shipyard", "box", "box2");
		break;

		case "shipyard_loft5":
			//from itemlocic box2
			LAi_ActorTurnToLocator(Pchar, "randitem", "randitem3");

			LAi_QuestDelay("shipyard_loft6", 2.0);
		break;

		case "shipyard_loft6":
			ChangeCharacterAddressGroup(Pchar, "Redmond_shipyard", "goto", "goto9");

			pchar.quest.shipyard_loft7.win_condition.l1 = "locator";
			pchar.quest.shipyard_loft7.win_condition.l1.location = "Redmond_shipyard";
			pchar.quest.shipyard_loft7.win_condition.l1.locator_group = "goto";
			pchar.quest.shipyard_loft7.win_condition.l1.locator = "goto9";
			pchar.quest.shipyard_loft7.win_condition = "shipyard_loft7";
		break;

		case "shipyard_loft7":
			PlaySound("PEOPLE\Run_wood.wav");
			LAi_QuestDelay("shipyard_loft9", 1.0);
		break;

		case "shipyard_loft9":
			LAi_SetStayType(Pchar);
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem3", 2.0);

			LAi_QuestDelay("pistol5_check", 0.1);
		break;

		case "pistol5_check":
			if(CheckCharacterItem(Pchar,"pistol205"))
			{
				curExp = sti(Pchar.Experience);
				nextExp = CalculateExperienceFromRank(sti(Pchar.rank)+1);
				addExp = nextExp-curExp;
				AddCharacterExpNS(Pchar, addExp);
				int LEA = CalcCharacterSkill(Pchar, "Leadership");
				Pchar.skill.Leadership = LEA + 1;

				AddQuestRecord("Woodes_Rogers_reward_5", "2");
				CloseQuestHeader("Woodes_Rogers_reward_5");
				DeleteQuestHeader("Librarian");
				DeleteQuestHeader("Distiller");

				Pchar.quest.wr_quest1 = "pistol5";
				EquipCharacterByItem(Pchar, "pistol205");

				LAi_QuestDelay("pistol5_end", 0.1);
			}
			else
			{
				LAi_QuestDelay("pistol5_check", 0.5);//loop check
			}
		break;

		case "pistol5_end":
			PlaySound("PEOPLE\Run_wood.wav");
			ChangeCharacterAddressGroup(Pchar, "Redmond_shipyard", "goto", "goto13");

			LAi_QuestDelay("pistol5_end1", 1.0);
		break;

		case "pistol5_end1":
			PlaySound("OBJECTS\DUEL\man_attack1.wav");

			ChangeCharacterAddressGroup(Pchar, "Redmond_shipyard", "goto", "goto14");

			LAi_QuestDelay("pistol5_end2", 0.7);
		break;

		case "pistol5_end2":
			PlaySound("PEOPLE\jump.wav");
			LAi_SetSitType(Pchar);

			LAi_QuestDelay("pistol5_end3", 0.3);
		break;

		case "pistol5_end3":
			SetCurrentTime(23.00, 0);
			SetNextWeather("Clear");
			Locations[FindLocation("Redmond_shipyard")].environment.weather = "false";	//reset

			LAi_SetPlayerType(Pchar);

			bDisableFastReload = 0;
			locations[FindLocation("Loanshark_cellar")].id.label = "";
			Locations[FindLocation("Redmond_Town_01")].models.always.locators = "Red01_l_JRH4";	//bridge visible
			locations[FindLocation("Redmond_tavern")].id.label = "Redmond tavern";
			Locations[FindLocation("Tavern_storeroom")].reload.l2.disable = 0;//open to tavern
			ChangeCharacterAddressGroup(CharacterFromID("Charles Windem"), "none", "", "");//temp gone

			Locations[FindLocation("wr_bedroom")].reload.l2.disable = 0;//open to kitchen
			Locations[FindLocation("wr_kitchen")].reload.l2.disable = 1;//open to wr_bedroom
			Locations[FindLocation("wr_kitchen")].reload.l3.disable = 0;//open to food cellar
			Locations[FindLocation("wr_kitchen")].reload.l4.disable = 1;//closed to bootyroom
			Locations[FindLocation("Shop_stairs")].reload.l4.disable = 1;//closed to shop
			locations[FindLocation("Shop_stairs")].id.label = "Rogers' Paintings Furniture & Weapons";
			ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "wr_kitchen", "goto", "goto6");
			LAi_SetStayType(CharacterFromID("Woodes Rogers"));
			locations[FindLocation("wr_food_supply")].id.label = "Woodes Rogers' food cellar";
			Pchar.quest.gas_level = "0";			//start value
			Pchar.quest.very_foggy_mine = "no";		//start value
			Pchar.quest.key14_check = "not_started";	//start value
			Pchar.quest.swimtime = "no";			//start value
			Pchar.quest.caroline_well = "not_yet";		//start value
			Pchar.quest.rogers_angry = "not_yet";		//start value
			Pchar.quest.medicine_greedy = "not_yet";	//start value
			Pchar.quest.cavern_chestkey = "yes";		//start value, means "the key" is in the cavern chest, pchar is able to lock the chest
			Pchar.quest.Rosabella = "first_meeting";	//start value
			Pchar.quest.mine_enabled = "no";		//start value

	//this place works from shortcut "8" [8]

			pchar.quest.mission6.win_condition.l1 = "locator";
			pchar.quest.mission6.win_condition.l1.location = "wr_kitchen";
			pchar.quest.mission6.win_condition.l1.locator_group = "goto";
			pchar.quest.mission6.win_condition.l1.locator = "goto6";
			pchar.quest.mission6.win_condition = "mission6";
		break;
//...................................................................................................................
		case "mission6":
			LAi_SetActorType(CharacterFromID("Woodes Rogers"));
			LAi_ActorDialog(characterFromID("Woodes Rogers"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Woodes Rogers"));
			Characters[GetCharacterIndex("Woodes Rogers")].dialog.CurrentNode  = "mission6";
		break;

		case "mission6_given":
			//from wr dialog
			SetQuestHeader("Woodes_Rogers_reward_6");
			AddQuestRecord("Woodes_Rogers_reward_6", "1");
			DeleteQuestHeader("Woodes_Rogers_reward_5");

			locations[FindLocation("wr_crew")].id.label = "Crew's quarter";
			PlaySound("VOICE\ENGLISH\gr_WR_friend2.wav");
			LAi_SetActorType(CharacterFromID("Woodes Rogers"));
			LAi_ActorGoToLocator(characterFromID("Woodes Rogers"), "goto", "goto9", "mission6_given1", 7.0);//was goto9 hmm?

			pchar.quest.boatswain_dialog.win_condition.l1 = "locator";
			pchar.quest.boatswain_dialog.win_condition.l1.location = "wr_food_supply";
			pchar.quest.boatswain_dialog.win_condition.l1.locator_group = "goto";
			pchar.quest.boatswain_dialog.win_condition.l1.locator = "goto1";
			pchar.quest.boatswain_dialog.win_condition = "boatswain_dialog";
		break;

		case "mission6_given1":
			ChangeCharacterAddressGroup(CharacterFromID("Charles Windem"), "Redmond_Tavern", "merchant", "goto1");//reset
			LAi_SetBarmanType(characterFromID("Charles Windem"));
			LAi_SetCitizenType(characterFromID("Woodes Rogers"));
		break;

		case "boatswain_dialog":
			LAi_SetActorType(CharacterFromID("wr_boc5"));
			LAi_ActorDialog(characterFromID("wr_boc5"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wr_boc5"));
			Characters[GetCharacterIndex("wr_boc5")].dialog.CurrentNode  = "crew_level_up";
		break;
	//------------------------------------------------------------------------------------
		case "mine_no_thanks":
			//from boatswain dialog, open to crew ONLY after case "mine_no_money"
			LAi_SetStayType(CharacterFromID("wr_boc5"));

			//bsw dialog may restart if you just leave the cellar & return
			pchar.quest.mine_no_thanks1.win_condition.l1 = "locator";
			pchar.quest.mine_no_thanks1.win_condition.l1.location = "wr_kitchen";
			pchar.quest.mine_no_thanks1.win_condition.l1.locator_group = "reload";
			pchar.quest.mine_no_thanks1.win_condition.l1.locator = "reload3";
			pchar.quest.mine_no_thanks1.win_condition = "mine_no_thanks1";
		break;

		case "mine_no_thanks1":
			pchar.quest.boatswain_no_thanks_dialog.win_condition.l1 = "locator";
			pchar.quest.boatswain_no_thanks_dialog.win_condition.l1.location = "wr_food_supply";
			pchar.quest.boatswain_no_thanks_dialog.win_condition.l1.locator_group = "goto";
			pchar.quest.boatswain_no_thanks_dialog.win_condition.l1.locator = "goto1";
			pchar.quest.boatswain_no_thanks_dialog.win_condition = "boatswain_no_thanks_dialog";
		break;

		case "boatswain_no_thanks_dialog":
			LAi_SetActorType(CharacterFromID("wr_boc5"));
			LAi_ActorDialog(characterFromID("wr_boc5"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wr_boc5"));
			Characters[GetCharacterIndex("wr_boc5")].dialog.CurrentNode  = "mine11";
		break;
	//------------------------------------------------------------------------------------
		case "mine_no_money_first_time":
			//from boatswain dialog "mine5_first_time"

			SetQuestHeader("Open_the_mine");
			AddQuestRecord("Open_the_mine", "1");
			AddQuestRecord("Open_the_mine", "4");

			LAi_SetStayType(CharacterFromID("wr_boc5"));

			Locations[FindLocation("wr_kitchen")].reload.l6.disable = 0;//open to wr_crew
			ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "Redmond_Town_04", "goto", "goto_50");
			ChangeCharacterAddressGroup(CharacterFromID("wr_boc1"), "Redmond_Town_04", "goto", "goto_48");
			ChangeCharacterAddressGroup(CharacterFromID("wr_kor"), "Redmond_Town_04", "goto", "goto_49");
			Locations[FindLocation("wr_kitchen")].reload.l2.disable = 1;//to wr_bed
			locations[FindLocation("wr_mine")].id.label = "Redmond old mine";//off from start
			Locations[FindLocation("Redmond_Town_04")].reload.l19.disable = 0;//open from town to crew
			Locations[FindLocation("Redmond_Town_01")].reload.l26.disable = 1;//town to tavern storeroom

			pchar.quest.Rogers_terrace_04.win_condition.l1 = "locator";
			pchar.quest.Rogers_terrace_04.win_condition.l1.location = "Redmond_Town_04";
			pchar.quest.Rogers_terrace_04.win_condition.l1.locator_group = "reload";
			pchar.quest.Rogers_terrace_04.win_condition.l1.locator = "door_4";
			pchar.quest.Rogers_terrace_04.win_condition = "Rogers_terrace_04";
		break;

		case "Rogers_terrace_04":
			LAi_SetStayType(CharacterFromID("Woodes Rogers"));

			pchar.quest.Rogers_terrace_04_A.win_condition.l1 = "locator";
			pchar.quest.Rogers_terrace_04_A.win_condition.l1.location = "Redmond_Town_04";
			pchar.quest.Rogers_terrace_04_A.win_condition.l1.locator_group = "goto";
			pchar.quest.Rogers_terrace_04_A.win_condition.l1.locator = "goto_50";
			pchar.quest.Rogers_terrace_04_A.win_condition = "Rogers_terrace_04_A";
		break;

		case "Rogers_terrace_04_A":
			Locations[FindLocation("wr_crew")].reload.l5.disable = 1;	//closed from crew to town
			LAi_SetActorType(CharacterFromID("Woodes Rogers"));
			LAi_ActorTurnToCharacter(characterFromID("Woodes Rogers"), PChar);

			LAi_QuestDelay("Rogers_terrace_04_B", 1.0);
		break;

		case "Rogers_terrace_04_B":
			LAi_ActorDialog(characterFromID("Woodes Rogers"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Woodes Rogers"));
			Characters[GetCharacterIndex("Woodes Rogers")].dialog.CurrentNode  = "terrace_04";
		break;

		case "get_drunk":
			//from wr terrace 04 dialog

			pchar.quest.Rosabella_entre.win_condition.l1 = "locator";
			pchar.quest.Rosabella_entre.win_condition.l1.location = "wr_crew";
			pchar.quest.Rosabella_entre.win_condition.l1.locator_group = "reload";
			pchar.quest.Rosabella_entre.win_condition.l1.locator = "reload5";
			pchar.quest.Rosabella_entre.win_condition = "get_drunk1";
		break;

		case "get_drunk1":
			LAi_SetStayType(Pchar);							//inside crew tav again
			Locations[FindLocation("Redmond_Town_04")].reload.l19.disable = 1; 	//closed from town to crew
			PlaySound("INTERFACE\key_lock.wav");
			ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "Redmond_Shipyard", "reload", "officers2_1");

			LAi_QuestDelay("Rosabella_prepare_entre", 0.5);
			LAi_QuestDelay("Rosabella_entre", 1.0);
		break;

		case "Rosabella_prepare_entre":
			PauseAllSounds();
		break;

		case "Rosabella_entre":
			ChangeCharacterAddressGroup(CharacterFromID("rosabella"), "wr_crew", "reload", "reload1");
			LAi_SetStayType(CharacterFromID("rosabella"));
			PlaySound("INTERFACE\closed_door.wav");

			LAi_QuestDelay("Rosabella_entre1", 1.0);
		break;

		case "Rosabella_entre1":
			PlaySound("VOICE\ENGLISH\gr_Rosabella1.wav");

			LAi_QuestDelay("Rosabella_entre2", 1.5);
		break

		case "Rosabella_entre2":
			PlaySound("OBJECTS\SHIPCHARGE\hurrah.wav");

			LAi_QuestDelay("Rosabella_entre3", 1.0);
		break;

		case "Rosabella_entre3":
			PlaySound("OBJECTS\SHIPCHARGE\hurrah.wav");
			LAi_SetActorType(CharacterFromID("rosabella"));

			LAi_QuestDelay("Rosabella_entre5", 1.0);
			LAi_QuestDelay("Rosabella_entre6", 4.0);
			LAi_ActorGoToLocator(characterFromID("rosabella"), "goto", "goto4", "Rosabella_entre4", 7.0);
		break;

		case "Rosabella_entre5":
			PlaySound("OBJECTS\SHIPCHARGE\hurrah.wav");
		break;

		case "Rosabella_entre6":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
		break;

		case "Rosabella_entre4":
			ChangeCharacterAddressGroup(CharacterFromID("rosabella"), "wr_crew", "goto", "goto4");
			LAi_SetStayType(CharacterFromID("rosabella"));//yes, needed for dialog to start

			LAi_QuestDelay("mine_no_money1", 0.1);
		break;

		case "mine_no_money1":
			pchar.quest.boatswain_money_dialog.win_condition.l1 = "locator";
			pchar.quest.boatswain_money_dialog.win_condition.l1.location = "wr_food_supply";
			pchar.quest.boatswain_money_dialog.win_condition.l1.locator_group = "goto";
			pchar.quest.boatswain_money_dialog.win_condition.l1.locator = "goto1";
			pchar.quest.boatswain_money_dialog.win_condition = "boatswain_money_dialog";
		break;

		case "boatswain_money_dialog":
			LAi_SetActorType(CharacterFromID("wr_boc5"));
			LAi_ActorDialog(characterFromID("wr_boc5"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wr_boc5"));
			Characters[GetCharacterIndex("wr_boc5")].dialog.CurrentNode  = "mine4_repeat";
		break;
	//------------------------------------------------------------------------------------
		case "mine_no_money_repeat":
			//from boatswain dialog "mine5_repeat"

			pchar.quest.mine_no_money1_repeat.win_condition.l1 = "locator";
			pchar.quest.mine_no_money1_repeat.win_condition.l1.location = "wr_crew";
			pchar.quest.mine_no_money1_repeat.win_condition.l1.locator_group = "reload";
			pchar.quest.mine_no_money1_repeat.win_condition.l1.locator = "reload1";
			pchar.quest.mine_no_money1_repeat.win_condition = "mine_no_money1_repeat";
		break;

		case "mine_no_money1_repeat":
			pchar.quest.boatswain_money_dialog_repeat.win_condition.l1 = "locator";
			pchar.quest.boatswain_money_dialog_repeat.win_condition.l1.location = "wr_food_supply";
			pchar.quest.boatswain_money_dialog_repeat.win_condition.l1.locator_group = "goto";
			pchar.quest.boatswain_money_dialog_repeat.win_condition.l1.locator = "goto1";
			pchar.quest.boatswain_money_dialog_repeat.win_condition = "boatswain_money_dialog_repeat";
		break;

		case "boatswain_money_dialog_repeat":
			LAi_SetActorType(CharacterFromID("wr_boc5"));
			LAi_ActorDialog(characterFromID("wr_boc5"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wr_boc5"));
			Characters[GetCharacterIndex("wr_boc5")].dialog.CurrentNode  = "mine4_repeat";
		break;
	//------------------------------------------------------------------------------------
		case "rum_food_supply":
			ChangeCharacterAddressGroup(Pchar, "wr_food_supply", "box", "box12");
			PlaySound("PEOPLE\jump.wav");
		break;

		case "filling_rum_food_supply":
			ChangeCharacterAddressGroup(Pchar, "wr_food_supply", "box", "box12");
			PlaySound("PEOPLE\jump.wav");
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"My barrel is filled with rum!"));

			LAi_QuestDelay("filling_rum_food_supply1", 2.0);
		break;

		case "filling_rum_food_supply1":
			PlaySound("VOICE\ENGLISH\Spa_m_a_026.wav");
		break;
	//------------------------------------------------------------------------------------
		case "mine_open":
			//from boatswain dialog
			//Log_SetStringToLog("mine open");
			CloseQuestHeader("Open_the_mine");

			bDisableFastReload = 1;
			Pchar.quest.disable_rebirth = true;
			LAi_SetStayType(Pchar);
			LAi_SetActorType(CharacterFromID("wr_boc5"));
			LAi_ActorGoToLocator(characterFromID("wr_boc5"), "box", "box10", "mine_open1", 3.0);
		break;

		case "mine_open1":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box10");
			PlaySound("INTERFACE\key_unlock.wav");
			Pchar.quest.mine_enabled = "yes";
			locations[FindLocation("wr_mine")].id.label = "Port Royal old mine";

			LAi_QuestDelay("mine_open2", 1.0);
		break;

		case "mine_open2":
			LAi_SetActorType(CharacterFromID("wr_boc5"));
			LAi_ActorGoToLocator(characterFromID("wr_boc5"), "barmen", "stay", "mine_open3", 3.0);
			PlaySound("VOICE\ENGLISH\Spa_m_a_042.wav");//054
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("steplock_A_prison", 0.1);

			pchar.quest.gibbet_loop1.win_condition.l1 = "locator";
			pchar.quest.gibbet_loop1.win_condition.l1.location = "wr_prison";
			pchar.quest.gibbet_loop1.win_condition.l1.locator_group = "reload";
			pchar.quest.gibbet_loop1.win_condition.l1.locator = "reload16";
			pchar.quest.gibbet_loop1.win_condition = "gibbet_loop1";

			pchar.quest.guardroom_loop1.win_condition.l1 = "locator";
			pchar.quest.guardroom_loop1.win_condition.l1.location = "wr_prison";
			pchar.quest.guardroom_loop1.win_condition.l1.locator_group = "reload";
			pchar.quest.guardroom_loop1.win_condition.l1.locator = "reload13";
			pchar.quest.guardroom_loop1.win_condition = "guardroom_loop1";

			pchar.quest.take_ammo_controlroom.win_condition.l1 = "location";
			pchar.quest.take_ammo_controlroom.win_condition.l1.location = "wr_mine_control";
			pchar.quest.take_ammo_controlroom.win_condition = "take_ammo_controlroom";
		break;

		case "mine_open3":
			LAi_SetStayType(CharacterFromID("wr_boc5"));
		break;

		case "take_ammo_controlroom":
			gp = GetCharacterItem(Pchar, "gunpowder");
			pb = GetCharacterItem(Pchar, "pistolbullets");
			if(gp == 0)
			{
				TakenItems(Pchar, "gunpowder", 1);
				Pchar.quest.temp_gunpowder = "yes";
			    	//LogIt("temp_gunpowder = " + Pchar.quest.temp_gunpowder);
			    	//gp = GetCharacterItem(Pchar, "gunpowder");
			    	//LogIt("gp = " + gp);
			}
			if(pb == 0)
			{
				TakenItems(Pchar, "pistolbullets", 1);
				Pchar.quest.temp_pistolbullets = "yes";
			    	//LogIt("temp_pistolbullets = " + Pchar.quest.temp_pistolbullets);
			    	//pb = GetCharacterItem(Pchar, "pistolbullets");
			    	//LogIt("pb = " + pb);
			}

			Pchar.quest.give_ammo_controlroom.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.give_ammo_controlroom.win_condition.l1.location = "wr_mine_control";
			Pchar.quest.give_ammo_controlroom.win_condition = "give_ammo_controlroom";
		break;

		case "give_ammo_controlroom":
			if(CheckAttribute(Pchar,"quest.temp_gunpowder") && Pchar.quest.temp_gunpowder == "yes")
			{
				TakenItems(Pchar, "gunpowder", -1);
			    	//gp = GetCharacterItem(Pchar, "gunpowder");
			    	//LogIt("gp = " + gp);
				Pchar.quest.temp_gunpowder = "no";
			}
			if(CheckAttribute(Pchar,"quest.temp_pistolbullets") && Pchar.quest.temp_pistolbullets == "yes")
			{
				TakenItems(Pchar, "pistolbullets", -1);
			    	//pb = GetCharacterItem(Pchar, "pistolbullets");
			    	//LogIt("pb = " + pb);
				Pchar.quest.temp_pistolbullets = "no";
			}

			pchar.quest.take_ammo_controlroom.win_condition.l1 = "location";
			pchar.quest.take_ammo_controlroom.win_condition.l1.location = "wr_mine_control";
			pchar.quest.take_ammo_controlroom.win_condition = "take_ammo_controlroom";
		break;
	//------------------------------------------------------------------------------------
		case "crew_hatch_open":
			Locations[FindLocation("wr_crew")].image = "";
			DoQuestReloadToLocation("wr_crew", "goto", "goto5", "crew_hatch_open2");
		break;

		case "crew_hatch_open2":
			Locations[FindLocation("wr_crew")].image = "wr_crew.tga";
			PlaySound("PEOPLE\wood2.wav");

			LAi_QuestDelay("crew_hatch_open1", 1.5);
		break;

		case "crew_hatch_open1":
			PlaySound("INTERFACE\rusty.wav");
		break;

		case "crew_hatch_lock":
			Locations[FindLocation("wr_crew")].image = "";
			DoQuestReloadToLocation("wr_crew", "goto", "goto5", "crew_hatch_lock2");
		break;

		case "crew_hatch_lock2":
			Locations[FindLocation("wr_crew")].image = "wr_crew.tga";
			PlaySound("INTERFACE\closet_open.wav");

			LAi_QuestDelay("crew_hatch_lock1", 1.5);
		break;

		case "crew_hatch_lock1":
			PlaySound("INTERFACE\klonk.wav");
		break;
	//------------------------------------------------------------------------------------

		case "crew_hatch_lock_rosabella":
			//from Rosabella dialog
			Locations[FindLocation(Pchar.location)].models.always.locators = "tavern03_locators_JRH1";

			Locations[FindLocation("wr_crew")].image = "";
			DoQuestReloadToLocation("wr_crew", "goto", "goto6", "crew_hatch_lock_Rosabella_1");
		break;

		case "crew_hatch_lock_rosabella_1":
			AddQuestRecord("Open_the_mine", "3");
			Logit(LanguageConvertString(tmpLangFileID,"Yes! It's open now but I cannot see the chest any longer..."));
			Locations[FindLocation("wr_crew")].image = "wr_crew.tga";
			PlaySound("INTERFACE\closet_open.wav");

			LAi_QuestDelay("crew_hatch_lock1", 1.5);
		break;
	//------------------------------------------------------------------------------------
		case "wr_crew_dialog_over":
			LAi_QuestDelay("wr_crew_dialog_over1", 2.0);
		break;

		case "wr_crew_dialog_over1":
			LAi_SetSitType(CharacterFromID("wr_raoul"));
			LAi_SetSitType(CharacterFromID("wr_omat1"));
			LAi_SetSitType(CharacterFromID("wr_rabbl"));
			LAi_SetSitType(CharacterFromID("wr_sail4"));
			LAi_SetSitType(CharacterFromID("wr_snav"));
			LAi_SetSitType(CharacterFromID("wr_cha"));
			LAi_SetSitType(CharacterFromID("wr_hubspa"));
			LAi_SetSitType(CharacterFromID("wr_grey"));
			LAi_SetSitType(CharacterFromID("wr_bry1"));
			LAi_SetSitType(CharacterFromID("wr_oman2"));
			LAi_SetSitType(CharacterFromID("wr_sail1"));
			LAi_SetSitType(CharacterFromID("wr_kill"));
			LAi_SetSitType(CharacterFromID("wr_18_1"));
			LAi_SetSitType(CharacterFromID("wr_solspa4"));
			LAi_SetSitType(CharacterFromID("wr_vito"));
			LAi_SetSitType(CharacterFromID("wr_9SNat"));
			LAi_SetSitType(CharacterFromID("wr_ron"));
			LAi_SetSitType(CharacterFromID("wr_pir4"));
			LAi_SetSitType(CharacterFromID("wr_mong"));
			LAi_SetSitType(CharacterFromID("wr_cor3"));
			LAi_SetSitType(CharacterFromID("wr_fatj"));
			LAi_SetSitType(CharacterFromID("wr_fsh"));
			LAi_SetSitType(CharacterFromID("wr_fwn"));
			ChangeCharacterAddressGroup(CharacterFromID("wr_raoul"), "wr_crew", "sit", "sit21");
			ChangeCharacterAddressGroup(CharacterFromID("wr_omat1"), "wr_crew", "sit", "sit7");
			ChangeCharacterAddressGroup(CharacterFromID("wr_rabbl"), "wr_crew", "sit", "sit14");
			ChangeCharacterAddressGroup(CharacterFromID("wr_sail4"), "wr_crew", "sit", "sit16");
			ChangeCharacterAddressGroup(CharacterFromID("wr_snav"), "wr_crew", "sit", "sit22");
			ChangeCharacterAddressGroup(CharacterFromID("wr_boc1"), "Redmond_Town_04", "goto", "goto_48");
			ChangeCharacterAddressGroup(CharacterFromID("wr_cha"), "wr_crew", "sit", "sit20");
			ChangeCharacterAddressGroup(CharacterFromID("wr_hubspa"), "wr_shop_office", "sit", "sit1");
			ChangeCharacterAddressGroup(CharacterFromID("wr_kor"), "Redmond_Town_04", "goto", "goto_49");
			ChangeCharacterAddressGroup(CharacterFromID("wr_grey"), "wr_crew", "sit", "sit10");
			ChangeCharacterAddressGroup(CharacterFromID("wr_bry1"), "wr_crew", "sit", "sit12");
			ChangeCharacterAddressGroup(CharacterFromID("wr_oman2"), "wr_crew", "sit", "sit23");
			ChangeCharacterAddressGroup(CharacterFromID("wr_sail1"), "wr_crew", "sit", "sit19");
			ChangeCharacterAddressGroup(CharacterFromID("wr_kill"), "wr_crew", "sit", "sit25");
			ChangeCharacterAddressGroup(CharacterFromID("wr_18_1"), "wr_crew", "sit", "sit11");
			ChangeCharacterAddressGroup(CharacterFromID("wr_solspa4"), "wr_crew", "sit", "sit8");
			ChangeCharacterAddressGroup(CharacterFromID("wr_vito"), "wr_crew", "sit", "sit17");
			ChangeCharacterAddressGroup(CharacterFromID("wr_9SNat"), "wr_crew", "sit", "sit9");
			ChangeCharacterAddressGroup(CharacterFromID("wr_ron"), "wr_crew", "sit", "sit24");
			ChangeCharacterAddressGroup(CharacterFromID("wr_pir4"), "wr_crew", "sit", "sit6");
			ChangeCharacterAddressGroup(CharacterFromID("wr_mong"), "wr_crew", "sit", "sit5");
			ChangeCharacterAddressGroup(CharacterFromID("wr_cor3"), "wr_crew", "sit", "sit4");
			ChangeCharacterAddressGroup(CharacterFromID("wr_fatj"), "wr_crew", "sit", "sit3");
			ChangeCharacterAddressGroup(CharacterFromID("wr_fsh"), "wr_crew", "sit", "sit2");
			ChangeCharacterAddressGroup(CharacterFromID("wr_fwn"), "Redmond_shore_03", "sit", "sit1");

			LAi_SetCitizenType(CharacterFromID("wr_fralut"));
			LAi_SetBarmanType(CharacterFromID("wr_solhol"));

			LAi_SetStayType(CharacterFromID("wr_blm"));
			LAi_SetStayType(CharacterFromID("wr_fat2"));
			LAi_SetStayType(CharacterFromID("wr_hubspa5"));

			LAi_SetStayType(CharacterFromID("wr_prt7"));
			LAi_SetStayType(CharacterFromID("wr_blcor"));
			LAi_SetStayType(CharacterFromID("wr_sail7"));
			LAi_SetStayType(CharacterFromID("wr_oman1"));
			LAi_SetStayType(CharacterFromID("wr_boc4"));
			LAi_SetStayType(CharacterFromID("wr_cor1"));
			LAi_SetStayType(CharacterFromID("wr_nap"));
			LAi_SetStayType(CharacterFromID("wr_pir2"));
			LAi_SetStayType(CharacterFromID("wr_pir7"));
			LAi_SetStayType(CharacterFromID("wr_wll3"));
			LAi_SetStayType(CharacterFromID("wr_sol6f77"));
			LAi_SetStayType(CharacterFromID("wr_boc3"));
			LAi_SetStayType(CharacterFromID("wr_chv1"));
			LAi_SetStayType(CharacterFromID("wr_cor1_1"));
			LAi_SetStayType(CharacterFromID("wr_cor1_3"));
			LAi_SetStayType(CharacterFromID("wr_fsh1"));
			LAi_SetStayType(CharacterFromID("wr_kor1"));
			LAi_SetStayType(CharacterFromID("wr_man3"));
			LAi_SetStayType(CharacterFromID("wr_pir5"));
			LAi_SetStayType(CharacterFromID("wr_hubport"));
			LAi_SetStayType(CharacterFromID("wr_evl2"));
			LAi_SetStayType(CharacterFromID("wr_ltnorr"));
			LAi_SetStayType(CharacterFromID("wr_man4"));
			LAi_SetStayType(CharacterFromID("wr_man5_1"));
			LAi_SetStayType(CharacterFromID("wr_pir9"));
			LAi_SetStayType(CharacterFromID("wr_boc1"));
			LAi_SetStayType(CharacterFromID("wr_kor"));
			LAi_SetStayType(CharacterFromID("wr_bucc1"));
			LAi_SetStayType(CharacterFromID("wr_boc16"));
		break;
//...................................................................................................
		case "empty_barrel_gibbet":
			//from itemlogic
			Locations[FindLocation("wr_gibbet")].image = "";
			DoQuestReloadToLocation("wr_gibbet", "goto", "goto6", "empty_barrel_gibbet1");
		break;

		case "empty_barrel_gibbet1":
			Locations[FindLocation("wr_gibbet")].image = "wr_gibbet.tga";
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(CharacterFromID("wr_hanged"), "wr_gibbet", "goto", "goto3");
			LAi_SetActorType(CharacterFromID("wr_hanged"));
			LAi_ActorSetLayMode(CharacterFromID("wr_hanged"));

		        PlaySound("PEOPLE\wood3.wav");
		break;

		case "empty_barrel_gibbet2":
			//from itemlogic
			PlaySound("PEOPLE\creak.wav");
		break;

		case "empty_barrel_gibbet3":
			//from itemlogic
			LAi_SetStayType(Pchar);
		break;
	//------------------------------------------------------------------------------------
		case "cut_down_hanged":
			//from itemlogic
			LAi_SetStayType(Pchar);
			PlaySound("PEOPLE\blade_creak.wav");
		    	Locations[FindLocation("wr_gibbet")].models.always.locators = "Pri_l_gibbet_JRH2";//barrel down no skeleton

			LAi_QuestDelay("cut_down_hanged1", 2.0);
		break;

		case "cut_down_hanged1":
			Locations[FindLocation("wr_gibbet")].image = "";
			DoQuestReloadToLocation("wr_gibbet", "goto", "goto5", "cut_down_hanged2");
		break;

		case "cut_down_hanged2":
			Locations[FindLocation("wr_gibbet")].image = "wr_gibbet.tga";
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(CharacterFromID("wr_hanged"), "wr_gibbet", "goto", "goto3");//reset
			PlaySound("PEOPLE\wood3.wav");
			LAi_SetFightMode(PChar, false);

			LAi_QuestDelay("key12_check", 0.1);
			LAi_QuestDelay("key_box_sound", 1.0);
		break;

		case "key_box_sound":
			PlaySound("PEOPLE\key_box.wav");
		break;

		case "key12_check":
			if(CheckCharacterItem(Pchar,"key12"))
			{
				//way out of loop
				Locations[FindLocation("wr_food_supply")].reload.l1.disable = 1;//locked to kitchen so no quest items may be stored away in boxes
				LAi_ActorGoToLocatorJRH(characterFromID("wr_boc5"), "barmen", "stay", 3.0);
				Locations[FindLocation("wr_mine")].locators_radius.box.box1 = 1.0;		//box1 in charge
				Locations[FindLocation("wr_mine")].locators_radius.reload.reload6 = 0.0001;

				pchar.quest.tunnel1_loop1.win_condition.l1 = "locator";
				pchar.quest.tunnel1_loop1.win_condition.l1.location = "wr_dungeon3_right";
				pchar.quest.tunnel1_loop1.win_condition.l1.locator_group = "reload";
				pchar.quest.tunnel1_loop1.win_condition.l1.locator = "reload6";
				pchar.quest.tunnel1_loop1.win_condition = "tunnel1_loop1";
			}
			else LAi_QuestDelay("key12_check", 0.5);//loop
		break;
	//------------------------------------------------------------------------------------
		case "hammer_on_barrel":
			//from itemlogic
			PlaySound("PEOPLE\hammer_creak.wav");
		    	Locations[FindLocation("wr_gibbet")].models.always.locators = "Pri_l_gibbet_JRH3";//gibbet horizontal, still up

			LAi_QuestDelay("staytype_gibbet", 2.2);
			LAi_QuestDelay("hammer_on_barrel1", 3.2);
		break;

		case "hammer_on_barrel1":
			Locations[FindLocation("wr_gibbet")].image = "";
			DoQuestReloadToLocation("wr_gibbet", "goto", "goto7", "hammer_on_barrel2");
		break;

		case "hammer_on_barrel2":
			Locations[FindLocation("wr_gibbet")].image = "wr_gibbet.tga";
			LAi_SetPlayerType(Pchar);
			PlaySound("PEOPLE\wood3.wav");
			LAi_SetFightMode(PChar, false);

			LAi_QuestDelay("empty_barrel_check", 0.1);
		break;

		case "empty_barrel_check":
			if(CheckCharacterItem(Pchar,"bladebarrel2"))
			{
				//way out of loop
				EquipCharacterByItem(Pchar, "bladebarrel2");
				Pchar.quest.prison_barrel = "empty";
			}
			else LAi_QuestDelay("empty_barrel_check", 0.5);//loop
		break;
	//------------------------------------------------------------------------------------
		case "axe_on_skeleton":
			//from itemlogic
			PlaySound("PEOPLE\axe_skull.wav");
		    	Locations[FindLocation("wr_gibbet")].models.always.locators = "Pri_l_gibbet_JRH4";//skull + body

			ChangeCharacterAddressGroup(CharacterFromID("wr_hanged"), "none", "", "");

			ChangeCharacterAddressGroup(CharacterFromID("wr_hanged_body"), "wr_gibbet", "goto", "goto3");
			LAi_SetActorType(CharacterFromID("wr_hanged_body"));
			LAi_ActorSetLayMode(CharacterFromID("wr_hanged_body"));

			LAi_QuestDelay("staytype_gibbet", 1.1);
			LAi_QuestDelay("axe_on_skeleton1", 2.1);
		break;

		case "axe_on_skeleton1":
			Locations[FindLocation("wr_gibbet")].image = "";
			DoQuestReloadToLocation("wr_gibbet", "goto", "goto5", "axe_on_skeleton2");
		break;

		case "axe_on_skeleton2":
			Locations[FindLocation("wr_gibbet")].image = "wr_gibbet.tga";
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(CharacterFromID("wr_hanged_body"), "wr_gibbet", "goto", "goto3");//reset
			LAi_SetFightMode(PChar, false);

			LAi_QuestDelay("axe_on_skeleton3", 0.1);
		break;

		case "axe_on_skeleton3":
			if(CheckCharacterItem(Pchar,"bladeskull1"))
			{
				//way out of loop
				Logit(LanguageConvertString(tmpLangFileID,"Is this skull really heavy enough for the steplock in the cell?"));
				AddQuestRecord("Open_the_niche", "6");
				EquipCharacterByItem(Pchar, "bladeskull1");

				pchar.quest.place_skull.win_condition.l1 = "locator";
				pchar.quest.place_skull.win_condition.l1.location = "wr_prison";
				pchar.quest.place_skull.win_condition.l1.locator_group = "reload";
				pchar.quest.place_skull.win_condition.l1.locator = "reload15";
				pchar.quest.place_skull.win_condition = "place_skull";
			}
			else LAi_QuestDelay("axe_on_skeleton3", 0.5);//loop
		break;
	//------------------------------------------------------------------------------------
		case "saw_on_gibbet":
			//from itemlogic
			PlaySound("PEOPLE\saw_creak.wav");
		    	Locations[FindLocation("wr_gibbet")].models.always.locators = "Pri_l_gibbet_JRH5";//gibbet down

			LAi_QuestDelay("staytype_gibbet", 2.5);
			LAi_QuestDelay("saw_on_gibbet1", 5.0);//was 5.5
		break;

		case "saw_on_gibbet1":
			Locations[FindLocation("wr_gibbet")].image = "";
			DoQuestReloadToLocation("wr_gibbet", "goto", "goto8", "saw_on_gibbet2");
		break;

		case "saw_on_gibbet2":
			Locations[FindLocation("wr_gibbet")].image = "wr_gibbet.tga";
			PlaySound("PEOPLE\gibbet_fall.wav");
			GetCharacterPos(Pchar, &x1, &y1, &z1);
			CreateParticleSystemX("blast_dirt", x1, y1, z1, x1, y1, z1,10);
			CreateParticleSystemX("blast_dirt", x2, y2, z2, x2, y2, z2,10);
			CreateParticleSystemX("blast_dirt", x3, y3, z3, x3, y3, z3,10);

			SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem17", 2.2);//2.5?
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box3", 0.001);
			Locations[FindLocation("wr_gibbet")].models.always.locators = "Pri_l_gibbet_JRH6";
			//for coming visits to gibbet room (no box3)

			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(CharacterFromID("wr_hanged_body"), "wr_gibbet", "goto", "goto3");//reset
			LAi_SetFightMode(PChar, false);

			LAi_QuestDelay("saw_on_gibbet3", 0.1);
		break;

		case "saw_on_gibbet3":
			if(CheckCharacterItem(Pchar,"plank3"))			//plank 45
			{
				//way out of loop
				PlaySound("VOICE\ENGLISH\blaze_mhm.wav");
				Logit(LanguageConvertString(tmpLangFileID,"I got a plank, maybe I can use it in a similar way as the skull??"));
				AddQuestRecord("Open_the_chest", "6");
				TakeItemFromCharacter(Pchar, "plank3");
				GiveItem2Character(Pchar, "bladeplank");
				EquipCharacterByItem(Pchar, "bladeplank");

				if(CheckAttribute(Pchar,"quest.prison_barrel4") && Pchar.quest.prison_barrel4 == "ready_for_wall_plank")
				{
					//Log_SetStringToLog("barrel placed & plank ready check1");
					//this check also when placing barrel on steplock B
					Locations[FindLocation("wr_prison")].locators_radius.reload.reload19 = 0.0001;
					Locations[FindLocation("wr_prison")].locators_radius.box.box4 = 0.5;

					Locations[FindLocation("wr_prison")].models.always.locators = "Pri_l_JRH8";	//ok??
				}
			}
			else LAi_QuestDelay("saw_on_gibbet3", 0.5);//loop
		break;

		case "staytype_gibbet":
			LAi_SetstayType(Pchar);
		break;
	//------------------------------------------------------------------------------------
		case "pickaxe2_on_keybox":
			//from itemlogic
			//LAi_SetStayType(Pchar);
			PlaySound("PEOPLE\pickaxe_box.wav");
			Locations[FindLocation("wr_prison")].models.always.locators = "Pri_l_JRH0";//keybox13 outside fence
			Pchar.quest.keybox13_prison = "within_reach";

			LAi_QuestDelay("pickaxe2_on_keybox1", 1.0);//was 2.0
		break;

		case "pickaxe2_on_keybox1":
			Locations[FindLocation("wr_prison")].image = "";
			DoQuestReloadToLocation("wr_prison", "goto", "goto13", "pickaxe2_on_keybox2");
		break;

		case "pickaxe2_on_keybox2":
			Locations[FindLocation("wr_prison")].image = "wr_prison.tga";
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(PChar, false);

			LAi_QuestDelay("key13_check", 0.1);
		break;

		case "key13_check":
			if(CheckCharacterItem(Pchar,"key13"))
			{
				//way out of loop
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box3", 0.001);//this is in cell

				Locations[FindLocation("wr_mine")].locators_radius.box.box2 = 1.0;
				Locations[FindLocation("wr_mine")].locators_radius.reload.reload5 = 0.0001;

				pchar.quest.switch_room.win_condition.l1 = "locator";
				pchar.quest.switch_room.win_condition.l1.location = "wr_dungeon3_left";
				pchar.quest.switch_room.win_condition.l1.locator_group = "goto";
				pchar.quest.switch_room.win_condition.l1.locator = "goto2";
				pchar.quest.switch_room.win_condition = "switch_room";

				pchar.quest.tunnel2_loop1.win_condition.l1 = "locator";
				pchar.quest.tunnel2_loop1.win_condition.l1.location = "wr_dungeon3_left";
				pchar.quest.tunnel2_loop1.win_condition.l1.locator_group = "reload";
				pchar.quest.tunnel2_loop1.win_condition.l1.locator = "reload5";
				pchar.quest.tunnel2_loop1.win_condition = "tunnel2_loop1";
			}
			else LAi_QuestDelay("key13_check", 0.5);//loop
		break;
	//------------------------------------------------------------------------------------
	//3 key functions in here

		case "unlock_tunnel_B":
			Locations[FindLocation("wr_mine")].locators_radius.box.box1 = 0.0001;			//reset to normal
			Locations[FindLocation("wr_mine")].locators_radius.reload.reload6 = 1.0;
			Locations[FindLocation("wr_mine")].reload.l6.disable = 0;
			LAi_QuestDelay("remove_used_keys", 1.0);
			DoQuestReloadToLocation("wr_dungeon3_right", "goto", "goto1", "equip_pickaxe");
		break;

		case "equip_pickaxe":
			if(CheckCharacterItem(Pchar,"bladepickaxe2"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterbyItem(Pchar, "bladepickaxe2");
			}
			else LAi_QuestDelay("equip_pickaxe", 0.5);//loop
		break;
	//------------------------------------------------------------------------------------
		case "unlock_tunnel_A":
			Locations[FindLocation("wr_mine")].locators_radius.box.box2 = 0.0001;			//reset to normal
			Locations[FindLocation("wr_mine")].locators_radius.reload.reload5 = 1.0;
			Locations[FindLocation("wr_mine")].reload.l5.disable = 0;
			LAi_QuestDelay("remove_used_keys", 1.0);
			DoQuestReloadToLocation("wr_dungeon3_left", "goto", "goto6", "equip_hammer");
		break;

		case "equip_hammer":
			if(CheckCharacterItem(Pchar,"bladehammer"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterbyItem(Pchar, "bladehammer");
				ChangeCharacterAddressGroup(CharacterFromID("wr_boc5"), "wr_food_supply", "sit", "sit1");
				LAi_SetSitType(CharacterFromID("wr_boc5"));
			}
			else LAi_QuestDelay("equip_hammer", 0.5);//loop
		break;
	//------------------------------------------------------------------------------------
		case "unlock_tunnel_Z":
			Locations[FindLocation("wr_mine")].locators_radius.box.box3 = 0.0001;			//reset to normal
			Locations[FindLocation("wr_mine")].locators_radius.reload.reload4 = 1.0;
			Locations[FindLocation("wr_mine")].reload.l4.disable = 0;

			LAi_QuestDelay("remove_used_keys", 1.0);
			DoQuestReloadToLocation("wr_dungeon4_main", "goto", "goto1", "hint_light_torches");
		break;

		case "hint_light_torches":
			Logit(LanguageConvertString(tmpLangFileID,"Ok, there might be skeletons in here..."));
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
			Pchar.quest.met_4_skeletons = "yes";

			LAi_QuestDelay("equip_executioners_axe", 0.5);

			pchar.quest.fire_hint.win_condition.l1 = "locator";
			pchar.quest.fire_hint.win_condition.l1.location = "wr_dungeon4_main";
			pchar.quest.fire_hint.win_condition.l1.locator_group = "goto";
			pchar.quest.fire_hint.win_condition.l1.locator = "fire_hint";
			pchar.quest.fire_hint.win_condition = "fire_hint";
		break;

		case "fire_hint":
			LAi_SetStayType(Pchar);
			Logit(LanguageConvertString(tmpLangFileID,"...and how do I frighten them away with fire!?"));
			PlaySound("OBJECTS\VOICES\DEAD\male\dead1.wav");

			LAi_QuestDelay("pchar_playertype", 2.0);
		break;

		case "equip_executioners_axe":
			if(CheckCharacterItem(Pchar,"bladeaxe4"))
			{
				Logit(LanguageConvertString(tmpLangFileID,"I have found an axe that obviously has been used to cut off heads. Is that what I have to do?"));
				AddQuestRecord("Open_the_niche", "4");

				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterbyItem(Pchar, "bladeaxe4");
				Locations[FindLocation("wr_dungeon4_main")].reload.l1.disable = 0;//open to well
				Locations[FindLocation("Redmond_town_04")].reload.l19.disable = 0;//open to crew's quarter
				Locations[FindLocation("Redmond_town_exit_2")].models.always.locators = "Redexit2_l_JRH";
				Locations[FindLocation("wr_dungeon4_main")].environment.sea = "true";

				LAi_SetStayType(characterFromID("wr_dead7"));
				LAi_SetStayType(characterFromID("wr_dead8"));
				LAi_SetStayType(characterFromID("wr_dead9"));
				LAi_SetStayType(characterFromID("wr_dead11"));

				LAi_SetStayType(characterFromID("wr_no_head1"));
				LAi_SetStayType(characterFromID("wr_no_head2"));
				LAi_SetStayType(characterFromID("wr_no_head3"));

				Locations[FindLocation("wr_mine")].environment.weather = "false";

				ChangeCharacterAddressGroup(CharacterFromID("wench3"), "Redmond_town_exit_2", "goto", "goto8");

				LAi_QuestDelay("Caroline_opens_well", 0.1);

				SetCurrentTime(11.00, 0);
				SetNextWeather("Clear");
				Pchar.quest.JRH_rain = "Mine Fog 1";

				Pchar.quest.mine_skeletons = "mode4";
				LAi_QuestDelay("mine_skeletons_mode4", 0.1);

				LAi_QuestDelay("weather_dungeon4_main", 0.1);
			}
			else LAi_QuestDelay("equip_executioners_axe", 0.5);//loop
		break;

		case "remove_used_keys":
			if(CheckCharacterItem(Pchar,"key12")) TakeItemFromCharacter(Pchar, "key12");
			if(CheckCharacterItem(Pchar,"key13")) TakeItemFromCharacter(Pchar, "key13");
			if(CheckCharacterItem(Pchar,"key14")) TakeItemFromCharacter(Pchar, "key14");
		break;
	//------------------------------------------------------------------------------------
		case "unlock_kitchen":
			Locations[FindLocation("wr_bedroom")].locators_radius.box.box2 = 0.0001;		//reset to normal
			Locations[FindLocation("wr_bedroom")].locators_radius.reload.reload2 = 1.0;
			Locations[FindLocation("wr_bedroom")].reload.l2.disable = 0;
			DoQuestReloadToLocation("wr_kitchen", "reload", "reload2", "_");
		break;
	//------------------------------------------------------------------------------------
		case "unlock_shop":
			Locations[FindLocation("Redmond_UsurerHouse")].locators_radius.box.box1 = 0.0001;				//reset to normal reload in charge
			Locations[FindLocation("Redmond_UsurerHouse")].locators_radius.reload.locator1 = 1.0;
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l2.disable = 0;

			locations[FindLocation("wr_shop")].id.label = "Rogers' Paintings Furniture & Weapons";
			Locations[FindLocation("Redmond_UsurerHouse")].image = "";
			DoQuestReloadToLocation("wr_shop", "reload", "reload6", "after_unlock_shop");
		break;

		case "after_unlock_shop":
			Locations[FindLocation("Redmond_UsurerHouse")].image = "Inside_StoreSmall.tga";	//after merge
			Pchar.quest.wr_elevator = "up";//start position
			TakeItemFromCharacter(Pchar, "key6");

			ChangeCharacterAddressGroup(CharacterFromID("wr_bri"), "none", "", "");
			Locations[FindLocation("wr_residence")].reload.l2.disable = 1;	//closed to lib
			Locations[FindLocation("wr_library")].reload.l2.disable = 1;	//closed to residence

		//	LAi_QuestDelay("fill_shop_boxes", 0.1);

			pchar.quest.pistol3.win_condition.l1 = "locator";
			pchar.quest.pistol3.win_condition.l1.location = "wr_shop";
			pchar.quest.pistol3.win_condition.l1.locator_group = "goto";
			pchar.quest.pistol3.win_condition.l1.locator = "goto5";
			pchar.quest.pistol3.win_condition = "pistol3";
		break;
	//------------------------------------------------------------------------------------
		case "unlock_storeroom":
			Locations[FindLocation("Tavern_storeroom")].locators_radius.box.box1 = 0.0001;		//reset to normal
			Locations[FindLocation("Tavern_storeroom")].locators_radius.reload.reload1 = 0.5;
			Locations[FindLocation("Tavern_storeroom")].reload.l1.disable = 0;
			Locations[FindLocation("Redmond_Town_01")].reload.l26.disable = 0;
			DoQuestReloadToLocation("Redmond_Town_01", "reload", "door_7", "after_unlock_storeroom");
		break;
//[7] from here
		case "after_unlock_storeroom":
			TakeItemFromCharacter(Pchar, "key7");

			Locations[FindLocation("Tavern_storeroom")].reload.l1.disable = 0;//to town

			Locations[FindLocation("Redmond_Town_01")].reload.l26.name = "door_7";
			Locations[FindLocation("Redmond_Town_01")].reload.l26.go = "Tavern_storeroom";
			Locations[FindLocation("Redmond_Town_01")].reload.l26.emerge = "reload1";
			Locations[FindLocation("Redmond_Town_01")].reload.l26.autoreload = "0";
			Locations[FindLocation("Redmond_Town_01")].reload.l26.label = "Tavern storeroom.";

			Pchar.quest.wr_elevator = "up";
			Locations[FindLocation("wr_shop")].models.always.locators = "residence05_locators_JRH_Lup";
			Locations[FindLocation("Redmond_Town_01")].reload.l23.disable = 1;//reload6 to terrace
			locations[FindLocation("Redmond_UsurerHouse")].id.label = "TEMPORARY OUT OF GOLD. OPEN SOON AGAIN. Robyn Corrick - bank manager";

			ChangeCharacterAddressGroup(CharacterFromID("grandma"), "wr_mother", "goto", "goto2");
			LAi_SetStayType(CharacterFromID("grandma"));
			Locations[FindLocation("wr_mother")].reload.l1.disable = 0;//to stairs

			pchar.quest.reputation_mother.win_condition.l1 = "locator";
			pchar.quest.reputation_mother.win_condition.l1.location = "wr_mother";
			pchar.quest.reputation_mother.win_condition.l1.locator_group = "box";
			pchar.quest.reputation_mother.win_condition.l1.locator = "box1";
			pchar.quest.reputation_mother.win_condition = "reputation_mother";
		break;
//...................................................................................................
		case "gibbet_loop":
			DoQuestReloadToLocation("wr_prison", "goto", "goto7", "_");

			pchar.quest.gibbet_loop1.win_condition.l1 = "locator";
			pchar.quest.gibbet_loop1.win_condition.l1.location = "wr_prison";
			pchar.quest.gibbet_loop1.win_condition.l1.locator_group = "reload";
			pchar.quest.gibbet_loop1.win_condition.l1.locator = "reload16";
			pchar.quest.gibbet_loop1.win_condition = "gibbet_loop1";
		break;

		case "gibbet_loop1":
			DoQuestReloadToLocation("wr_gibbet", "goto", "goto1", "_");

			pchar.quest.gibbet_loop.win_condition.l1 = "locator";
			pchar.quest.gibbet_loop.win_condition.l1.location = "wr_gibbet";
			pchar.quest.gibbet_loop.win_condition.l1.locator_group = "reload";
			pchar.quest.gibbet_loop.win_condition.l1.locator = "reload1";
			pchar.quest.gibbet_loop.win_condition = "gibbet_loop";
		break;
	//-------------------------------------------------------------------------------------------
		case "guardroom_loop":
			pchar.quest.guardroom_loop1.win_condition.l1 = "locator";
			pchar.quest.guardroom_loop1.win_condition.l1.location = "wr_prison";
			pchar.quest.guardroom_loop1.win_condition.l1.locator_group = "reload";
			pchar.quest.guardroom_loop1.win_condition.l1.locator = "reload13";
			pchar.quest.guardroom_loop1.win_condition = "guardroom_loop1";
		break;

		case "guardroom_loop1":
			DoQuestReloadToLocation("wr_prison_guard", "reload", "reload1", "_");

			pchar.quest.guardroom_loop.win_condition.l1 = "locator";
			pchar.quest.guardroom_loop.win_condition.l1.location = "wr_prison_guard";
			pchar.quest.guardroom_loop.win_condition.l1.locator_group = "reload";
			pchar.quest.guardroom_loop.win_condition.l1.locator = "reload1";
			pchar.quest.guardroom_loop.win_condition = "guardroom_loop";
		break;
	//-------------------------------------------------------------------------------------------
		case "tunnel1_loop":
			pchar.quest.tunnel1_loop1.win_condition.l1 = "locator";
			pchar.quest.tunnel1_loop1.win_condition.l1.location = "wr_dungeon3_right";
			pchar.quest.tunnel1_loop1.win_condition.l1.locator_group = "reload";
			pchar.quest.tunnel1_loop1.win_condition.l1.locator = "reload6";
			pchar.quest.tunnel1_loop1.win_condition = "tunnel1_loop1";
		break;

		case "tunnel1_loop1":
			if(CheckAttribute(Pchar,"quest.swimming") && Pchar.quest.swimming == "done")
			{
				Locations[FindLocation("wr_dungeon3_right")].image = "wr_dungeon3_low.tga";//2 torches + hatch to lower tunnel
				DoQuestReloadToLocation("wr_dungeon3_right", "goto", "goto5", "tunnel1_loop");//last case door open
			}
			else
			{
				if(CheckAttribute(Pchar,"quest.swimming") && Pchar.quest.swimming == "now")
				{
					Locations[FindLocation("wr_dungeon3_left")].image = "wr_dungeon3_low.tga";
					DoQuestReloadToLocation("wr_dungeon3_left", "goto", "goto5", "tunnel1_loop");//temp, if swim back
				}
			}
			else DoQuestReloadToLocation("wr_dungeon3_right", "goto", "goto3", "tunnel1_loop");//start, door locked
		break;
	//-------------------------------------------------------------------------------------------
		case "tunnel2_loop":
			pchar.quest.tunnel2_loop1.win_condition.l1 = "locator";
			pchar.quest.tunnel2_loop1.win_condition.l1.location = "wr_dungeon3_left";
			pchar.quest.tunnel2_loop1.win_condition.l1.locator_group = "reload";
			pchar.quest.tunnel2_loop1.win_condition.l1.locator = "reload5";
			pchar.quest.tunnel2_loop1.win_condition = "tunnel2_loop1";
		break;

		case "tunnel2_loop1":
			DoQuestReloadToLocation("wr_dungeon3_left", "goto", "goto2", "tunnel2_loop");
		break;
	//-------------------------------------------------------------------------------------------
		case "tunnel3A_loop":
			pchar.quest.tunnel3A_loop1.win_condition.l1 = "locator";
			pchar.quest.tunnel3A_loop1.win_condition.l1.location = "wr_dungeon4_main";
			pchar.quest.tunnel3A_loop1.win_condition.l1.locator_group = "reload";
			pchar.quest.tunnel3A_loop1.win_condition.l1.locator = "reload8";
			pchar.quest.tunnel3A_loop1.win_condition = "tunnel3A_loop1";
		break;

		case "tunnel3A_loop1":
			DoQuestReloadToLocation("wr_dungeon4_main", "goto", "goto5", "tunnel3A_loop");
		break;
	//-------------------------------------------------------------------------------------------
		case "tunnel3B_loop":
			pchar.quest.tunnel3B_loop1.win_condition.l1 = "locator";
			pchar.quest.tunnel3B_loop1.win_condition.l1.location = "wr_dungeon4_main";
			pchar.quest.tunnel3B_loop1.win_condition.l1.locator_group = "reload";
			pchar.quest.tunnel3B_loop1.win_condition.l1.locator = "reload9";
			pchar.quest.tunnel3B_loop1.win_condition = "tunnel3B_loop1";
		break;

		case "tunnel3B_loop1":
			DoQuestReloadToLocation("wr_dungeon4_main", "goto", "goto4", "tunnel3B_loop");
		break;
	//-------------------------------------------------------------------------------------------
		case "tunnel1back_loop":
			pchar.quest.tunnel1back_loop1.win_condition.l1 = "locator";
			pchar.quest.tunnel1back_loop1.win_condition.l1.location = "wr_dungeon3_right";
			pchar.quest.tunnel1back_loop1.win_condition.l1.locator_group = "reload";
			pchar.quest.tunnel1back_loop1.win_condition.l1.locator = "reload7";
			pchar.quest.tunnel1back_loop1.win_condition = "tunnel1back_loop1";
		break;

		case "tunnel1back_loop1":
			Locations[FindLocation("wr_dungeon3_right")].image = "wr_dungeon3_right.tga";
			DoQuestReloadToLocation("wr_dungeon3_right", "goto", "goto4", "tunnel1back_loop");
		break;
	//-------------------------------------------------------------------------------------------
		//stop at other side of the wall
		case "tunnelM_loop":
			pchar.quest.tunnelM_loop1.win_condition.l1 = "locator";
			pchar.quest.tunnelM_loop1.win_condition.l1.location = "wr_dungeon3_right";
			pchar.quest.tunnelM_loop1.win_condition.l1.locator_group = "reload";
			pchar.quest.tunnelM_loop1.win_condition.l1.locator = "reload13";
			pchar.quest.tunnelM_loop1.win_condition = "tunnelM_loop1";
		break;

		case "tunnelM_loop1":
			DoQuestReloadToLocation("wr_dungeon3_right", "goto", "goto9", "tunnelM_loop");
		break;
	//-------------------------------------------------------------------------------------------
		case "tunnel_lowA_loop":
			pchar.quest.tunnel_lowA_loop1.win_condition.l1 = "locator";
			pchar.quest.tunnel_lowA_loop1.win_condition.l1.location = "wr_dungeon4_low";
			pchar.quest.tunnel_lowA_loop1.win_condition.l1.locator_group = "reload";
			pchar.quest.tunnel_lowA_loop1.win_condition.l1.locator = "reload4";
			pchar.quest.tunnel_lowA_loop1.win_condition = "tunnel_lowA_loop1";
		break;

		case "tunnel_lowA_loop1":
			DoQuestReloadToLocation("wr_dungeon4_low", "goto", "goto4", "tunnel_lowA_loop");
		break;
//-------------------------------------------------------------------------------------------
		case "tunnel_lowB_loop":
			pchar.quest.tunnel_lowB_loop1.win_condition.l1 = "locator";
			pchar.quest.tunnel_lowB_loop1.win_condition.l1.location = "wr_dungeon4_low";
			pchar.quest.tunnel_lowB_loop1.win_condition.l1.locator_group = "reload";
			pchar.quest.tunnel_lowB_loop1.win_condition.l1.locator = "reload5";
			pchar.quest.tunnel_lowB_loop1.win_condition = "tunnel_lowB_loop1";
		break;

		case "tunnel_lowB_loop1":
			DoQuestReloadToLocation("wr_dungeon4_low", "goto", "goto5", "tunnel_lowB_loop");
		break;
	//-------------------------------------------------------------------------------------------
		case "steplock_A_prison":
			//loop started with  case "mine_open2"

			//Log_SetStringToLog("steplock_A_prison");
			Locations[FindLocation("wr_prison")].image = "wr_prison.tga";
			LAi_SetPlayerType(Pchar);

			pchar.quest.steplock_A_prison1.win_condition.l1 = "locator";
			pchar.quest.steplock_A_prison1.win_condition.l1.location = "wr_prison";
			pchar.quest.steplock_A_prison1.win_condition.l1.locator_group = "goto";
			pchar.quest.steplock_A_prison1.win_condition.l1.locator = "goto2";
			pchar.quest.steplock_A_prison1.win_condition = "steplock_A_prison1";
		break;

		case "steplock_A_prison1":
			//Log_SetStringToLog("steplock_A_prison1");

			if(CheckCharacterItem(Pchar,"bladebarrel"))
			{
				//Log_SetStringToLog("1111111111");
				//filled barrel
				if(CheckAttribute(Pchar,"quest.prison_skull") && Pchar.quest.prison_skull == "placed")
				{
					//no steplock sound
					//Log_SetStringToLog("2222222222");
				}
				else
				{
					//Log_SetStringToLog("3333333333");
					PlaySound("INTERFACE\step_path.wav");
					locations[FindLocation("wr_dungeon3_right")].reload.l1.disable = 0;//ladder up to inner cell

					Locations[FindLocation("wr_dungeon3_right")].environment.weather = "true";//tunnel 1
					Locations[FindLocation("wr_dungeon3_left")].environment.weather = "true";//tunnel 2, already here?

					//SetNextWeather("Medium Foggy Mine");	//don't remove this weather even if pchar picks up the filled barrel again
					SetCurrentTime(11.00, 0);
					SetNextWeather("Clear");
					Pchar.quest.JRH_rain = "Mine Fog 1";

					if(CheckAttribute(Pchar,"quest.key14_check") && Pchar.quest.key14_check == "not_started")
					{
						//start this loop check only once
						LAi_QuestDelay("key14_check", 0.5);//start loop check
					}
				}

				LAi_SetStayType(Pchar);
				Pchar.quest.steplock_A_prison = "temp_open";

				LAi_QuestDelay("steplock_A_barrel", 0.5);
			}
			else
			{
				//Log_SetStringToLog("4444444444");
				if(CheckCharacterItem(Pchar,"bladebarrel2"))
				{
					//Log_SetStringToLog("555555555");
					//empty barrel
					//more like without any barrel
					LAi_SetStayType(Pchar);
					PlaySound("INTERFACE\step_path.wav");
					Pchar.quest.steplock_A_prison = "temp_open";

					LAi_QuestDelay("steplock_A_prison2", 0.5);
				}
			}
			else
			{
				//Log_SetStringToLog("66666666666");
				if(CheckAttribute(Pchar,"quest.prison_barrel4") && Pchar.quest.prison_barrel4 == "ready_for_wall_plank")
				{
					//no action, now steplock A is not activated anymore! ok?
					//Log_SetStringToLog("77777777");
					return;
				}
				else
				{
					//Log_SetStringToLog("888888888");
					LAi_SetStayType(Pchar);
					PlaySound("INTERFACE\step_path.wav");
					Pchar.quest.steplock_A_prison = "temp_open";

					LAi_QuestDelay("steplock_A_prison2", 0.5);
				}
			}
		break;

		case "key14_check":
			Pchar.quest.key14_check = "started";

			if(CheckCharacterItem(Pchar,"key14"))
			{
				//way out of loop
				Locations[FindLocation("wr_mine")].locators_radius.box.box3 = 1.0;		//box1 in charge
				Locations[FindLocation("wr_mine")].locators_radius.reload.reload4 = 0.0001;

				LAi_SetStayType(Pchar));

				LAi_QuestDelay("selkirk_in_prison", 1.0);	//story continues here

				pchar.quest.tunnel3A_loop1.win_condition.l1 = "locator";
				pchar.quest.tunnel3A_loop1.win_condition.l1.location = "wr_dungeon4_main";
				pchar.quest.tunnel3A_loop1.win_condition.l1.locator_group = "reload";
				pchar.quest.tunnel3A_loop1.win_condition.l1.locator = "reload8";
				pchar.quest.tunnel3A_loop1.win_condition = "tunnel3A_loop1";

				pchar.quest.tunnel3B_loop1.win_condition.l1 = "locator";
				pchar.quest.tunnel3B_loop1.win_condition.l1.location = "wr_dungeon4_main";
				pchar.quest.tunnel3B_loop1.win_condition.l1.locator_group = "reload";
				pchar.quest.tunnel3B_loop1.win_condition.l1.locator = "reload9";
				pchar.quest.tunnel3B_loop1.win_condition = "tunnel3B_loop1";

				pchar.quest.weather_redmond1.win_condition.l1 = "locator";
				pchar.quest.weather_redmond1.win_condition.l1.location = "wr_dungeon4_main";
				pchar.quest.weather_redmond1.win_condition.l1.locator_group = "reload";
				pchar.quest.weather_redmond1.win_condition.l1.locator = "reload4";
				pchar.quest.weather_redmond1.win_condition = "weather_redmond1";
			}
			else LAi_QuestDelay("key14_check", 0.5);//loop
		break;
//--------------------------------------------------------------------------------------------------------------------
		case "steplock_A_prison2":
			//Log_SetStringToLog("steplock_A_prison2");
			if(CheckAttribute(Pchar,"quest.prison_barrel") && Pchar.quest.prison_barrel == "empty")
			{
				//Log_SetStringToLog("steplock_A_prison2_1");
				Locations[FindLocation("wr_prison")].models.always.locators = "Pri_l_JRH2";//barrel on A floor hatch open
				LAi_QuestDelay("steplock_A_barrel1", 0.1);
			}
			else
			{
				//Log_SetStringToLog("steplock_A_prison2_2");
				if(CheckAttribute(Pchar,"quest.keybox13_prison") && Pchar.quest.keybox13_prison == "within_reach")
				{
					Locations[FindLocation("wr_prison")].models.always.locators = "Pri_l_JRH00";//open floor hatch
				}
				else
				{
					Locations[FindLocation("wr_prison")].models.always.locators = "Pri_l_JRH1";//open floor hatch
				}
			}

			Locations[FindLocation("wr_prison")].image = "";
			DoQuestReloadToLocation("wr_prison", "goto", "goto2", "steplock_A_prison4");
			LAi_QuestDelay("steplock_A_prison3", 0.1);
		break;

		case "steplock_A_prison3":
			//Log_SetStringToLog("steplock_A_prison3");
			PlaySound("INTERFACE\closet_Open.wav");
		break;

		case "steplock_A_prison4":
			//Log_SetStringToLog("steplock_A_prison4");
			Locations[FindLocation("wr_prison")].image = "wr_prison.tga";
			LAi_SetPlayerType(Pchar);

			if(CheckAttribute(Pchar,"quest.alternative_way_in") && Pchar.quest.alternative_way_in == "done")
			{

			}
			else
			{
				Logit(LanguageConvertString(tmpLangFileID,"That could maybe be the way in?"));
				Pchar.quest.alternative_way_in = "done";
				AddQuestRecord("Open_the_cell", "3");
			}

			pchar.quest.steplock_A_prison5.win_condition.l1 = "locator";
			pchar.quest.steplock_A_prison5.win_condition.l1.location = "wr_prison";
			pchar.quest.steplock_A_prison5.win_condition.l1.locator_group = "goto";
			pchar.quest.steplock_A_prison5.win_condition.l1.locator = "goto3";
			pchar.quest.steplock_A_prison5.win_condition = "steplock_A_prison5";
		break;
//----------------------------------------------------------------------------------------------------------
		case "steplock_A_prison4_Rogers":
			//Log_SetStringToLog("steplock_A_prison4");
			Locations[FindLocation("wr_prison")].image = "wr_prison.tga";
			LAi_SetPlayerType(Pchar);

			if(CheckAttribute(Pchar,"quest.prison_skull") && Pchar.quest.prison_skull == "placed")
			{
				if(CheckAttribute(Pchar,"quest.rogers_angry") && Pchar.quest.rogers_angry == "not_yet")
				{
					//rogers arrives, talks & opens cell

					Pchar.quest.rogers_angry = "done";
					LAi_SetStayType(Pchar);
					ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "wr_prison", "goto", "goto1");//was goto14
					LAi_SetStayType(CharacterFromID("Woodes Rogers"));

					LAi_QuestDelay("rogers_unlock_cell", 0.5);//why delay 2 sec?
				}
			}

			pchar.quest.steplock_A_prison5.win_condition.l1 = "locator";
			pchar.quest.steplock_A_prison5.win_condition.l1.location = "wr_prison";
			pchar.quest.steplock_A_prison5.win_condition.l1.locator_group = "goto";
			pchar.quest.steplock_A_prison5.win_condition.l1.locator = "goto3";
			pchar.quest.steplock_A_prison5.win_condition = "steplock_A_prison5";
		break;
//----------------------------------------------------------------------------------------------------------
		case "steplock_A_prison5":
			//Log_SetStringToLog("steplock_A_prison5");

			if(CheckAttribute(Pchar,"quest.prison_skull") && Pchar.quest.prison_skull == "placed")
			{
				LAi_QuestDelay("steplock_A_prison", 0.1);
				return;
			}

			if(CheckAttribute(Pchar,"quest.steplock_A_prison") && Pchar.quest.steplock_A_prison == "temp_open")
			{
				//Log_SetStringToLog("steplock_A_prison5_1");
				//this terrible double-check is to avoid locking the hatch immediately when 'reload to location' (hitting goto3 that is)
				Pchar.quest.steplock_A_prison = "something_else";
				LAi_QuestDelay("steplock_A_prison4", 0.1);
			}
			else
			{
				if(CheckAttribute(Pchar,"quest.prison_barrel2") && Pchar.quest.prison_barrel2 == "loop_off")
				{
					return;
				}
				else
				{
					//Log_SetStringToLog("steplock_A_prison5_2");
					LAi_SetStayType(Pchar);
					PlaySound("INTERFACE\step_path.wav");

					LAi_QuestDelay("steplock_A_prison6", 0.5);
				}
			}
		break;

		case "steplock_A_prison6":
			if(CheckAttribute(Pchar,"quest.prison_barrel") && Pchar.quest.prison_barrel == "empty")
			{
				if(CheckAttribute(Pchar,"quest.prison_barrel3") && Pchar.quest.prison_barrel3 == "pick_up")
				{
					//Log_SetStringToLog("steplock_A_prison6_1");
					Pchar.quest.prison_barrel3 = "leave_barrel";
					if(CheckAttribute(Pchar,"quest.keybox13_prison") && Pchar.quest.keybox13_prison == "within_reach")
					{
						Locations[FindLocation("wr_prison")].models.always.locators = "Pri_l_JRH0";//closed floor hatch
					}
					else
					{
						Locations[FindLocation("wr_prison")].models.always.locators = "Pri_l_JRH";//closed floor hatch
					}
				}
				else
				{
					//Log_SetStringToLog("steplock_A_prison6_2");
					Locations[FindLocation("wr_prison")].models.always.locators = "Pri_l_JRH3";//barrel on A BUT closed floor hatch
				}
			}
			else
			{
				//Log_SetStringToLog("steplock_A_prison6_3");
				if(CheckAttribute(Pchar,"quest.keybox13_prison") && Pchar.quest.keybox13_prison == "within_reach")
				{
					Locations[FindLocation("wr_prison")].models.always.locators = "Pri_l_JRH0";//closed floor hatch
				}
				else
				{
					Locations[FindLocation("wr_prison")].models.always.locators = "Pri_l_JRH";//closed floor hatch
				}
			}

			Locations[FindLocation("wr_prison")].image = "";
			DoQuestReloadToLocation("wr_prison", "goto", "goto12", "steplock_A_prison");//loop
			LAi_QuestDelay("steplock_A_prison7", 0.1);
		break;

		case "steplock_A_prison7":
			PlaySound("INTERFACE\closed_door.wav");
			PlaySound("PEOPLE\step_echo.wav");
			PlaySound("PEOPLE\step_stairway.wav");

			if(CheckAttribute(Pchar,"quest.prison_barrel") && Pchar.quest.prison_barrel == "empty")
			{
				LAi_QuestDelay("steplock_A_prison7_1", 1.0);
			}
		break;

		case "steplock_A_prison7_1":
			if(CheckAttribute(Pchar,"quest.barrel_too_light") && Pchar.quest.barrel_too_light == "done")
			{

			}
			else
			{
				Logit(LanguageConvertString(tmpLangFileID,"No, it's not heavy enough!"));
				Pchar.quest.barrel_too_light = "done";
				AddQuestRecord("Open_the_cell", "4");
			}
		break;

		case "steplock_A_prison8":
			//Log_SetStringToLog("steplock_A_prison8");

			Locations[FindLocation("wr_prison")].image = "wr_prison.tga";
			Pchar.quest.prison_barrel2 = "loop_on"//turn on 5 5_2 etc again
			LAi_QuestDelay("steplock_A_prison4", 0.1);
		break;
	//------------------------------------------------------------------------------------
		case "steplock_A_barrel":
			Log_SetStringToLog("steplock_A_barrel");
			if(CheckAttribute(Pchar,"quest.prison_skull") && Pchar.quest.prison_skull == "placed")
			{
				Locations[FindLocation("wr_prison")].models.always.locators = "Pri_l_JRH5";//skull, barrel on steplock A
			}
			else
			{
				Locations[FindLocation("wr_prison")].models.always.locators = "Pri_l_JRH2";//barrel on steplock A
				LAi_QuestDelay("steplock_A_prison3", 0.1);//closet_Open sound
			}

			Locations[FindLocation("wr_prison")].image = "";
			DoQuestReloadToLocation("wr_prison", "goto", "goto2", "steplock_A_barrel1");
		break;

		case "steplock_A_barrel1":
			//Log_SetStringToLog("steplock_A_barrel1");
			Locations[FindLocation("wr_prison")].image = "wr_prison.tga";

			if(CheckCharacterItem(Pchar,"bladebarrel"))
			{
				TakeItemFromCharacter(Pchar, "bladebarrel");
				if(CheckAttribute(Pchar,"quest.steplock_B_prison") && Pchar.quest.steplock_B_prison == "starter")
				{
					//Log_SetStringToLog("steplock_A_barrel1_1");
					//do nothing
				}
				else
				{
					//Log_SetStringToLog("steplock_A_barrel1_2");
					Pchar.quest.steplock_B_prison = "starter";

					LAi_QuestDelay("steplock_B_prison", 0.1);//starts steplock B loop
				}

				LAi_QuestDelay("steplock_A_barrel2", 2.0);
			}

			if(CheckCharacterItem(Pchar,"bladebarrel2")) TakeItemFromCharacter(Pchar, "bladebarrel2");

			if(CheckCharacterItem(Pchar,"bladeskull1"))
			{
				EquipCharacterByItem(Pchar, "bladeskull1");
			}
			else
			{
				EquipCharacterByItem(Pchar, "bladeA11");
			}

			LAi_SetPlayerType(Pchar);

			//picking up barrel again from steplock A is run from itemlogic box1
		break;

		case "steplock_A_barrel2":
			//Log_SetStringToLog("steplock_A_barrel2");
			if(CheckAttribute(Pchar,"quest.prison_skull") && Pchar.quest.prison_skull == "placed")
			{
				//no yah! sound
			}
			else
			{
				PlaySound("OBJECTS\DUEL\man_attack6.wav");
			}
		break;
	//------------------------------------------------------------------------------------
		case "steplock_B_prison":
			//Log_SetStringToLog("steplock_B_prison");
			//loop started with  case "steplock_A_barrel1"
			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("wr_prison")].image = "wr_prison.tga";

			pchar.quest.steplock_B_prison1.win_condition.l1 = "locator";
			pchar.quest.steplock_B_prison1.win_condition.l1.location = "wr_prison";
			pchar.quest.steplock_B_prison1.win_condition.l1.locator_group = "goto";
			pchar.quest.steplock_B_prison1.win_condition.l1.locator = "goto4";
			pchar.quest.steplock_B_prison1.win_condition = "steplock_B_prison1";
		break;

		case "steplock_B_prison1":
			if(CheckCharacterItem(Pchar,"bladebarrel"))
			{
				LAi_SetStayType(Pchar);
				PlaySound("INTERFACE\step_path.wav");
				Pchar.quest.steplock_B_prison = "temp_open";

				LAi_QuestDelay("steplock_B_barrel", 0.5);
			}
			else
			{
				LAi_SetStayType(Pchar);
				PlaySound("INTERFACE\step_path.wav");
				Pchar.quest.steplock_B_prison = "temp_open";

				LAi_QuestDelay("steplock_B_prison2", 0.5);
			}
		break;

		case "steplock_B_prison2":
			//Log_SetStringToLog("steplock_B_prison2");

			//Log_SetStringToLog("steplock_B_prison2_2");

			if(Locations[FindLocation(Pchar.location)].models.always.locators == "Pri_l_JRH2")//open floor
			{
				Locations[FindLocation("wr_prison")].models.always.locators = "Pri_l_JRH4";//open floor & wall hatch
			}

			if(Locations[FindLocation(Pchar.location)].models.always.locators == "Pri_l_JRH5")//skull, open floor
			{
				Locations[FindLocation("wr_prison")].models.always.locators = "Pri_l_JRH6";//skull, open floor 6 wall hatch
			}

			Locations[FindLocation("wr_prison")].image = "";
			DoQuestReloadToLocation("wr_prison", "goto", "goto4", "steplock_B_prison4");
			LAi_QuestDelay("steplock_B_prison3", 0.1);
		break;

		case "steplock_B_prison3":
			PlaySound("INTERFACE\metal_hatch_open.wav");

			if(CheckAttribute(Pchar,"quest.visible_niche") && Pchar.quest.visible_niche == "done")
			{

			}
			else
			{
				Pchar.quest.visible_niche = "done";
				Logit(LanguageConvertString(tmpLangFileID,"Oh yes! I knew it was something hidden in here."));
				AddQuestRecord("Open_the_niche", "2");
				CloseQuestHeader("Open_the_cell");
			}
		break;

		case "steplock_B_prison4":
			//Log_SetStringToLog("steplock_B_prison4");
			Locations[FindLocation("wr_prison")].image = "wr_prison.tga";
			LAi_SetPlayerType(Pchar);

			pchar.quest.steplock_B_prison5.win_condition.l1 = "locator";
			pchar.quest.steplock_B_prison5.win_condition.l1.location = "wr_prison";
			pchar.quest.steplock_B_prison5.win_condition.l1.locator_group = "goto";
			pchar.quest.steplock_B_prison5.win_condition.l1.locator = "goto5";
			pchar.quest.steplock_B_prison5.win_condition = "steplock_B_prison5";
		break;

		case "steplock_B_prison5":
			//Log_SetStringToLog("steplock_B_prison5");

			if(CheckAttribute(Pchar,"quest.steplock_B_prison") && Pchar.quest.steplock_B_prison == "temp_open")
			{
				//Log_SetStringToLog("steplock_B_prison5_1");
				//this terrible double-check is to avoid locking the hatch immediately when 'reload to location' (hitting goto5 that is)
				Pchar.quest.steplock_B_prison = "something_else";
				LAi_QuestDelay("steplock_B_prison4", 0.1);
			}
			else
			{
				//Log_SetStringToLog("steplock_B_prison5_2");
				LAi_SetStayType(Pchar);
				PlaySound("INTERFACE\step_path.wav");

				LAi_QuestDelay("steplock_B_prison6", 0.5);
			}
		break;

		case "steplock_B_prison6":

			//Log_SetStringToLog("steplock_B_prison6");

			if(Locations[FindLocation(Pchar.location)].models.always.locators == "Pri_l_JRH4")//open floor & wall hatch
			{
				//Log_SetStringToLog("steplock_B_prison6_1");
				Locations[FindLocation("wr_prison")].models.always.locators = "Pri_l_JRH2";//open floor
			}

			if(Locations[FindLocation(Pchar.location)].models.always.locators == "Pri_l_JRH6")//skull, open floor & wall hatch
			{
				//Log_SetStringToLog("steplock_B_prison6_2");
				Locations[FindLocation("wr_prison")].models.always.locators = "Pri_l_JRH5";//skull, open floor
			}

			if(Locations[FindLocation(Pchar.location)].models.always.locators == "Pri_l_JRH7_A")//skull, open floor & wall hatch, barrel
			{
				//Log_SetStringToLog("steplock_B_prison6_2");
				Locations[FindLocation("wr_prison")].models.always.locators = "Pri_l_JRH7";//skull, open floor
			}

			Locations[FindLocation("wr_prison")].image = "";
			DoQuestReloadToLocation("wr_prison", "goto", "goto9", "steplock_B_prison");//loop
			LAi_QuestDelay("steplock_B_prison7", 0.1);
		break;

		case "steplock_B_prison7":
			PlaySound("INTERFACE\metal_hatch_close.wav");
		break;

		case "steplock_B_prison8":
			//Log_SetStringToLog("steplock_B_prison8");

			LAi_QuestDelay("steplock_B_prison4", 0.1);
		break;
	//------------------------------------------------------------------------------------
		case "steplock_B_barrel":
			if(CheckCharacterItem(Pchar,"bladeplank"))
			{
				Locations[FindLocation("wr_prison")].models.always.locators = "Pri_l_JRH8";//skull, barrel on steplock B, floor & wall open, box4 VERY VISIBLE
			}
			else
			{
				Locations[FindLocation("wr_prison")].models.always.locators = "Pri_l_JRH8_A";//dito without box4, showing up too early
			}

			Locations[FindLocation("wr_prison")].image = "";
			DoQuestReloadToLocation("wr_prison", "goto", "goto4", "steplock_B_barrel1");
			LAi_QuestDelay("steplock_B_prison3", 0.1);//rusty sound
		break;

		case "steplock_B_barrel1":
			//Log_SetStringToLog("steplock_B_barrel1");
			Locations[FindLocation("wr_prison")].image = "wr_prison.tga";

			if(CheckCharacterItem(Pchar,"bladebarrel"))
			{
				//PUT DOWN BARREL
				TakeItemFromCharacter(Pchar, "bladebarrel");

				Pchar.quest.swimtime = "yes";
				if(Locations[FindLocation("wr_dungeon3_left")].models.always.locators == "d03_l_JRH_L1")
					Locations[FindLocation("wr_dungeon3_left")].models.always.locators = "d03_l_JRH_L3";

				if(Locations[FindLocation("wr_dungeon3_left")].models.always.locators == "d03_l_JRH_L2")
					Locations[FindLocation("wr_dungeon3_left")].models.always.locators = "d03_l_JRH_L4";

				Locations[FindLocation("wr_mine")].reload.l5.disable = 0;		//tunnelA
				Locations[FindLocation("wr_dungeon3_left")].environment.sea = "true";	//tunnelA
				Locations[FindLocation("wr_dungeon3_left")].environment.weather = "true";

				//better water
				SetCurrentTime(11.00, 0);
				SetNextWeather("Clear");
				Pchar.quest.JRH_rain = "Mine Fog 1";

				ChangeCharacterAddressGroup(CharacterFromID("wr_boc5"), "none", "", "");

				if(CheckAttribute(Pchar,"quest.monkey_swim_hint") && Pchar.quest.monkey_swim_hint == "done")
				{
					LAi_QuestDelay("before_swim", 0.1);
				}
				else LAi_QuestDelay("close_niche_qbook", 2.0);
			}

			Pchar.quest.prison_barrel4 = "ready_for_wall_plank";
			LAi_SetPlayerType(Pchar);

			if(CheckCharacterItem(Pchar,"bladeplank"))
			{
				//Log_SetStringToLog("barrel placed & plank ready check2");
				//this check also when finding plank for the first time in gibbet room

				Locations[FindLocation("wr_prison")].locators_radius.reload.reload19 = 0.0001;
				Locations[FindLocation("wr_prison")].locators_radius.box.box4 = 0.5;

				EquipCharacterByItem(Pchar, "bladeplank");
			}
			else EquipCharacterByItem(Pchar, "bladeA11");
		break;
//...................................................................................................
		case "loading_image_back_prison":
			Locations[FindLocation("wr_prison")].image = "wr_prison.tga";
		break;
//...................................................................................................
		case "mine_lights_1":
			Locations[FindLocation("wr_mine_control")].image = "";
			DoQuestReloadToLocation("wr_mine_control", "goto", "goto1", "loading_image_back_mine_control");
			//Log_SetStringToLog("1");
		break;

		case "mine_lights_2":
			Locations[FindLocation("wr_mine_control")].image = "";
			DoQuestReloadToLocation("wr_mine_control", "goto", "goto2", "loading_image_back_mine_control");
			//Log_SetStringToLog("2");
		break;

		case "mine_lights_3":
			Locations[FindLocation("wr_mine_control")].image = "";
			DoQuestReloadToLocation("wr_mine_control", "goto", "goto3", "loading_image_back_mine_control");
			//Log_SetStringToLog("3");
		break;

		case "mine_lights_1G":
			Locations[FindLocation("wr_mine_control")].image = "";
			DoQuestReloadToLocation("wr_mine_control", "goto", "goto1", "loading_image_back_mine_control");
			//Log_SetStringToLog("1G");
		break;

		case "mine_lights_2G":
			Locations[FindLocation("wr_mine_control")].image = "";
			DoQuestReloadToLocation("wr_mine_control", "goto", "goto2", "loading_image_back_mine_control");
			//Log_SetStringToLog("2G");
		break;

		case "mine_lights_3G":
			Locations[FindLocation("wr_mine_control")].image = "";
			DoQuestReloadToLocation("wr_mine_control", "goto", "goto3", "loading_image_back_mine_control");
			//Log_SetStringToLog("3G");
		break;

		case "mine_lights_1F":
			Pchar.quest.mine_skeletons = "mode1";
			LAi_QuestDelay("mine_skeletons_mode1", 0.1);

			Locations[FindLocation("wr_mine_control")].image = "";
			DoQuestReloadToLocation("wr_mine_control", "goto", "goto1", "loading_image_back_mine_control");
			//Log_SetStringToLog("1F");
		break;

		case "mine_lights_2F":
			Pchar.quest.mine_skeletons = "mode1";
			LAi_QuestDelay("mine_skeletons_mode1", 0.1);

			Locations[FindLocation("wr_mine_control")].image = "";
			DoQuestReloadToLocation("wr_mine_control", "goto", "goto2", "loading_image_back_mine_control");
			//Log_SetStringToLog("2F");
		break;

		case "mine_lights_3F":ī
			if(CheckAttribute(Pchar,"quest.very_foggy_mine") && Pchar.quest.very_foggy_mine == "yes")
			{
				Pchar.quest.mine_skeletons = "mode3";
				LAi_QuestDelay("mine_skeletons_mode3", 0.1);
			}
			else
			{
				Pchar.quest.mine_skeletons = "mode2";
				LAi_QuestDelay("mine_skeletons_mode2", 0.1);	//endast här & ett ställe till
			}

			Locations[FindLocation("wr_mine_control")].image = "";
			DoQuestReloadToLocation("wr_mine_control", "goto", "goto3", "loading_image_back_mine_control");
			//Log_SetStringToLog("3F");
		break;

		case "loading_image_back_mine_control":
			Locations[FindLocation("wr_mine_control")].image = "wr_mine_control.tga";
		break;

		case "mine_lights_gas_on":
			Locations[FindLocation("wr_mine_control")].image = "";
			DoQuestReloadToLocation("wr_mine_control", "goto", "goto4", "mine_lights_gas_effects");
		break;

		case "mine_lights_gas_effects":
			Locations[FindLocation("wr_mine_control")].image = "wr_mine_control.tga";
			//Log_SetStringToLog("gas level 1");
			Pchar.quest.gas_level = "1";
			PlaySound("INTERFACE\gas_on.wav");

			LAi_QuestDelay("mine_lights_gas_effects1", 2.0);
			LAi_QuestDelay("mine_lights_gas_level2", 10.0);
		break;

		case "mine_lights_gas_effects1":
			if(Locations[FindLocation(Pchar.location)].models.always.locators == "d02_l_JRH1_G" || Locations[FindLocation(Pchar.location)].models.always.locators == "d02_l_JRH2_G" || Locations[FindLocation(Pchar.location)].models.always.locators == "d02_l_JRH3_G")
			{
				//LogIt("gas level = " + Pchar.quest.gas_level);
				//Log_SetStringToLog("gas_effects1");
				PlaySound3D("NATURE\gas.wav", -27.1, 0.6, 16.2);
				CreateParticleSystem("smoke_short" , -27.8, 2.6, 16.3, -27.8, 4.6, 16.3, sti(20) );

				if(CheckAttribute(Pchar,"quest.gas_level") && Pchar.quest.gas_level == "2" || Pchar.quest.gas_level == "3" || Pchar.quest.gas_level == "4")
					CreateParticleSystem("waterfog" , -27.8, 2.6, 16.3, -27.8, 3.6, 16.3, sti(20) );//A

				if(CheckAttribute(Pchar,"quest.gas_level") && Pchar.quest.gas_level == "3" || Pchar.quest.gas_level == "4")
				{
					CreateParticleSystem("waterfog" , -26.8, 2.1, 13.9, -26.8, 3.6, 13.9, sti(20) );//B
					CreateParticleSystem("waterfog" , -25.4, 2.1, 18.0, -25.4, 3.6, 18.0, sti(20) );//D
				}

				if(CheckAttribute(Pchar,"quest.gas_level") && Pchar.quest.gas_level == "4")
				{
					CreateParticleSystem("waterfog" , -24.2, 2.1, 15.6, -24.2, 3.6, 15.6, sti(20) );//C
					CreateParticleSystem("waterfog" , -21.8, 2.1, 17.3, -21.8, 3.6, 17.3, sti(20) );//E

					if(!CheckAttribute(Pchar,"chr_ai.poison"))
					{
						//this is when poisoning has been stopped by leaving the control room
						Pchar.chr_ai.poison =  300;
						PlaySound("AMBIENT\JAIL\cough.wav");
					}
				}

				LAi_QuestDelay("mine_lights_gas_effects1", 3.6);

				pchar.quest.mine_lights_gas_effects_restart.win_condition.l1 = "locator";
				pchar.quest.mine_lights_gas_effects_restart.win_condition.l1.location = "wr_mine";
				pchar.quest.mine_lights_gas_effects_restart.win_condition.l1.locator_group = "reload";
				pchar.quest.mine_lights_gas_effects_restart.win_condition.l1.locator = "reload7";
				pchar.quest.mine_lights_gas_effects_restart.win_condition = "mine_lights_gas_effects_restart";
			}
			else return;
		break;

		case "mine_lights_gas_effects_restart":
			Pchar.chr_ai.poison =  0;

			pchar.quest.mine_lights_gas_effects.win_condition.l1 = "locator";
			pchar.quest.mine_lights_gas_effects.win_condition.l1.location = "wr_mine_control";
			pchar.quest.mine_lights_gas_effects.win_condition.l1.locator_group = "reload";
			pchar.quest.mine_lights_gas_effects.win_condition.l1.locator = "reload1";
			pchar.quest.mine_lights_gas_effects.win_condition = "mine_lights_gas_effects1";
		break;

		case "mine_lights_gas_level2":
			if(CheckAttribute(Pchar,"quest.gas_level") && Pchar.quest.gas_level == "0") return;

			if(CheckAttribute(Pchar,"quest.gas_level") && Pchar.quest.gas_level == "1")
			{
				//Log_SetStringToLog("gas level 2");
				Pchar.quest.gas_level = "2";
				LAi_QuestDelay("mine_lights_gas_level3", 10.0);
			}
		break;

		case "mine_lights_gas_level3":
			if(CheckAttribute(Pchar,"quest.gas_level") && Pchar.quest.gas_level == "0") return;

			if(CheckAttribute(Pchar,"quest.gas_level") && Pchar.quest.gas_level == "2")
			{
				//Log_SetStringToLog("gas level 3");
				Pchar.quest.gas_level = "3";
				LAi_QuestDelay("mine_lights_gas_level4", 10.0);
			}
		break;

		case "mine_lights_gas_level4":
			if(CheckAttribute(Pchar,"quest.gas_level") && Pchar.quest.gas_level == "0") return;

			if(CheckAttribute(Pchar,"quest.gas_level") && Pchar.quest.gas_level == "3")
			{
				if(CheckAttribute(Pchar,"chr_ai.poison") && Pchar.chr_ai.poison == "0")
				{
					//only in control room that is
					Pchar.chr_ai.poison =  300;
					PlaySound("AMBIENT\JAIL\cough.wav");
				}
				//Log_SetStringToLog("gas level 4");
				Pchar.quest.gas_level = "4";
			}
		break;

		case "mine_lights_gas_off":
			Pchar.chr_ai.poison =  0;
			//Log_SetStringToLog("gas level 0");
			Pchar.quest.gas_level = "0";
			Locations[FindLocation("wr_mine_control")].image = "";
			DoQuestReloadToLocation("wr_mine_control", "goto", "goto4", "mine_lights_gas_off_sound");
		break;

		case "mine_lights_gas_off_sound":
			Locations[FindLocation("wr_mine_control")].image = "wr_mine_control.tga";
			PlaySound("INTERFACE\gas_off1.wav");
			PlaySound("INTERFACE\gas_off2.wav");
		break;
	//------------------------------------------------------------------------------------
		case "mine_lights_fire_off":
			Pchar.quest.mine_skeletons = "mode1";
			LAi_QuestDelay("mine_skeletons_mode1", 0.1);

			Locations[FindLocation("wr_mine")].models.always.locators = "mine_l_JRH0";
			Locations[FindLocation("wr_dungeon4_main")].models.always.locators = "d04_l_JRH_OFF1";

			Locations[FindLocation("wr_dungeon3_right")].models.always.locators = "d03_l_JRH_R1";
			if(CheckAttribute(Pchar,"quest.swimtime") && Pchar.quest.swimtime == "yes")
			{
				Locations[FindLocation("wr_dungeon3_left")].models.always.locators = "d03_l_JRH_L3";
			}
			else
			{
				Locations[FindLocation("wr_dungeon3_left")].models.always.locators = "d03_l_JRH_L1";
			}
			//Log_SetStringToLog("gas level 0");
			Pchar.quest.gas_level = "0";

			Locations[FindLocation("wr_mine_control")].image = "";
			DoQuestReloadToLocation("wr_mine_control", "goto", "goto4", "mine_lights_fire_off_smoke");
		break;

		case "mine_lights_fire_off_smoke":
			Locations[FindLocation("wr_mine_control")].image = "wr_mine_control.tga";
			PlaySound("INTERFACE\fire_off.wav");
			CreateParticleSystem("smoke_inv_short" , -27.8, 2.6, 16.3, -27.8, 4.6, 16.3, sti(20) );
		break;

		case "mine_lights_fire_on_dmg1":
			Pchar.chr_ai.poison =  0;
			Pchar.quest.gas_level = "0";
			//Log_SetStringToLog("gas level 0");
			PlaySound("OBJECTS\VOICES\DEAD\male\dead2.wav");

			LAi_QuestDelay("mine_lights_fire_on", 0.5);
		break;

		case "mine_lights_fire_on_dmg2":
			Pchar.chr_ai.poison =  0;
			Pchar.quest.gas_level = "0";
			//Log_SetStringToLog("gas level 0");
			PlaySound("OBJECTS\VOICES\DEAD\male\dead6.wav");

			LAi_QuestDelay("mine_lights_fire_on", 0.5);
		break;
	//------------------------------------------------------------------------------------
		case "mine_lights_fire_on":
			Pchar.chr_ai.poison =  0;
			Pchar.quest.gas_level = "0";
			//Log_SetStringToLog("gas level 0");

			if(Locations[FindLocation(Pchar.location)].models.always.locators == "d02_l_JRH1_F")
			{
				Locations[FindLocation("wr_mine")].models.always.locators = "mine_l_JRH1";
				Locations[FindLocation("wr_dungeon4_main")].models.always.locators = "d04_l_JRH_OFF1";

				Locations[FindLocation("wr_dungeon3_right")].models.always.locators = "d03_l_JRH_R1";
				if(CheckAttribute(Pchar,"quest.swimtime") && Pchar.quest.swimtime == "yes")
				{
					Locations[FindLocation("wr_dungeon3_left")].models.always.locators = "d03_l_JRH_L3";
				}
				else
				{
					Locations[FindLocation("wr_dungeon3_left")].models.always.locators = "d03_l_JRH_L1";
				}
			}

			if(Locations[FindLocation(Pchar.location)].models.always.locators == "d02_l_JRH2_F")
			{
				Locations[FindLocation("wr_mine")].models.always.locators = "mine_l_JRH2";
				Locations[FindLocation("wr_dungeon4_main")].models.always.locators = "d04_l_JRH_OFF1";

				Locations[FindLocation("wr_dungeon3_right")].models.always.locators = "d03_l_JRH_R2";
				if(CheckAttribute(Pchar,"quest.swimtime") && Pchar.quest.swimtime == "yes")
				{
					Locations[FindLocation("wr_dungeon3_left")].models.always.locators = "d03_l_JRH_L4";
				}
				else
				{
					Locations[FindLocation("wr_dungeon3_left")].models.always.locators = "d03_l_JRH_L2";
				}
			}

			if(Locations[FindLocation(Pchar.location)].models.always.locators == "d02_l_JRH3_F")
			{
				Locations[FindLocation("wr_mine")].models.always.locators = "mine_l_JRH3";
				Locations[FindLocation("wr_dungeon4_main")].models.always.locators = "d04_l_JRH_ON1";

				//LAi_QuestDelay("dead_guys_reset", 0.1);//ok to start new loop, old one has "stopped"
				if(CheckAttribute(Pchar,"quest.very_foggy_mine") && Pchar.quest.very_foggy_mine == "yes")
				{
					Pchar.quest.mine_skeletons = "mode3";
					LAi_QuestDelay("mine_skeletons_mode3", 0.1);
				}
				else
				{
					Pchar.quest.mine_skeletons = "mode2";
					LAi_QuestDelay("mine_skeletons_mode2", 0.1);	//endast här & ett ställe till
				}

				Locations[FindLocation("wr_dungeon3_right")].models.always.locators = "d03_l_JRH_R1";
				if(CheckAttribute(Pchar,"quest.swimtime") && Pchar.quest.swimtime == "yes")
				{
					Locations[FindLocation("wr_dungeon3_left")].models.always.locators = "d03_l_JRH_L3";
				}
				else
				{
					Locations[FindLocation("wr_dungeon3_left")].models.always.locators = "d03_l_JRH_L1";
				}
			}

			if(CheckAttribute(Pchar,"quest.gas_level") && Pchar.quest.gas_level == "3")
			{
				Locations[FindLocation("wr_mine_control")].image = "";
				DoQuestReloadToLocation("wr_mine_control", "goto", "goto4", "mine_lights_fire_sound");
			}
			else
			{
				Locations[FindLocation("wr_mine_control")].image = "";
				DoQuestReloadToLocation("wr_mine_control", "goto", "goto5", "mine_lights_fire_sound");
			}
		break;

		case "mine_lights_fire_sound":
			Locations[FindLocation("wr_mine_control")].image = "wr_mine_control.tga";
			PlaySound("INTERFACE\fire_on.wav");
			LAi_QuestDelay("mine_lights_fire_sound1", 0.5);
		break;

		case "mine_lights_fire_sound1":
			if(Locations[FindLocation(Pchar.location)].models.always.locators == "d02_l_JRH1_F" || Locations[FindLocation(Pchar.location)].models.always.locators == "d02_l_JRH2_F" || Locations[FindLocation(Pchar.location)].models.always.locators == "d02_l_JRH3_F")
			{
				LAi_SetFightMode(PChar, false);
				PlaySound3D("NATURE\fireplace3.wav", -27.1, 0.6, 16.2);
				LAi_QuestDelay("mine_lights_fire_sound1", 5.0);

				pchar.quest.mine_lights_fire_sound_restart.win_condition.l1 = "locator";
				pchar.quest.mine_lights_fire_sound_restart.win_condition.l1.location = "wr_mine";
				pchar.quest.mine_lights_fire_sound_restart.win_condition.l1.locator_group = "reload";
				pchar.quest.mine_lights_fire_sound_restart.win_condition.l1.locator = "reload7";
				pchar.quest.mine_lights_fire_sound_restart.win_condition = "mine_lights_fire_sound_restart";
			}
			else return;
		break;

		case "mine_lights_fire_sound_restart":
			pchar.quest.mine_lights_fire_sound.win_condition.l1 = "locator";
			pchar.quest.mine_lights_fire_sound.win_condition.l1.location = "wr_mine_control";
			pchar.quest.mine_lights_fire_sound.win_condition.l1.locator_group = "reload";
			pchar.quest.mine_lights_fire_sound.win_condition.l1.locator = "reload1";
			pchar.quest.mine_lights_fire_sound.win_condition = "mine_lights_fire_sound1";
		break;
	//------------------------------------------------------------------------------------
		case "torch_unable":
			Pchar.quest.torch_enable = "no";//start value
			//LogIt("torch_enable = " + Pchar.quest.torch_enable);

			pchar.quest.torch_enable.win_condition.l1 = "locator";
			pchar.quest.torch_enable.win_condition.l1.location = "wr_mine_control";
			pchar.quest.torch_enable.win_condition.l1.locator_group = "goto";
			pchar.quest.torch_enable.win_condition.l1.locator = "goto5";
			pchar.quest.torch_enable.win_condition = "torch_enable";
		break;

		case "torch_enable":
			Pchar.quest.torch_enable = "yes";
			//LogIt("torch_enable = " + Pchar.quest.torch_enable);

			pchar.quest.torch_unable.win_condition.l1 = "locator";
			pchar.quest.torch_unable.win_condition.l1.location = "wr_mine_control";
			pchar.quest.torch_unable.win_condition.l1.locator_group = "goto";
			pchar.quest.torch_unable.win_condition.l1.locator = "goto6";
			pchar.quest.torch_unable.win_condition = "torch_unable";
		break;
//...................................................................................................
		case "place_skull":
			//from case "axe_on_skeleton3"
			//Log_SetStringToLog("skull");

			LAi_QuestDelay("place_skull1", 1.0);
		break;

		case "place_skull1":
			//Log_SetStringToLog("skull1");
			ChangeCharacterAddressGroup(Pchar, "wr_prison", "goto", "goto20");
			PlaySound("PEOPLE\run_stone.wav");

			LAi_QuestDelay("place_skull3", 1.0);
		break;

		case "place_skull3":
			//Log_SetStringToLog("skull3");
			EquipCharacterByItem(Pchar, "bladeskull1");
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(Pchar, true);

			LAi_QuestDelay("place_skull4", 1.0);
		break;

		case "place_skull4":
			//Log_SetStringToLog("skull4");
			PlaySound("PEOPLE\step_echo2.wav");
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladeskull1");
		    	Locations[FindLocation("wr_prison")].models.always.locators = "Pri_l_JRH5";//skull, open floor
			Pchar.quest.prison_skull = "placed";

			LAi_QuestDelay("place_skull5", 0.5);
		break;

		case "place_skull5":
			//Log_SetStringToLog("skull5");
			Locations[FindLocation("wr_prison")].image = "";
			DoQuestReloadToLocation("wr_prison", "goto", "goto20", "place_skull6");
		break;
	//.........................................................................................
		case "place_skull6":
			//Log_SetStringToLog("skull6");
			AddQuestRecord("Open_the_niche", "1");

			Locations[FindLocation("wr_prison")].image = "wr_prison.tga";
			PlaySound("VOICE\ENGLISH\blaze_hah.wav");

			LAi_SetFightMode(PChar, false);
			EquipCharacterByItem(Pchar, "bladeA11");
		break;
//...................................................................................................
		case "rogers_unlock_cell":
			//started from "steplock_A_prison" above
			PlaySound("VOICE\ENGLISH\gr_WR_friend4.wav");

			LAi_QuestDelay("rogers_unlock_cell0", 1.0);
		break;

		case "rogers_unlock_cell0":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(PChar, characterFromID("Woodes Rogers"));

			LAi_QuestDelay("rogers_unlock_cell1", 1.0);
		break;

		case "rogers_unlock_cell1":
			LAi_SetActorType(CharacterFromID("Woodes Rogers"));
			LAi_ActorDialog(characterFromID("Woodes Rogers"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Woodes Rogers"));
			Characters[GetCharacterIndex("Woodes Rogers")].dialog.CurrentNode  = "unlock_cell";
		break;

		case "cell_door_is_opened":
			//from rogers dialog
			LAi_SetActorType(CharacterFromID("Woodes Rogers"));
			LAi_ActorGoToLocator(CharacterFromID("Woodes Rogers"), "goto", "goto14", "cell_door_is_opened1", 2.0);
		break;

		case "cell_door_is_opened1":
			LAi_SetStayType(CharacterFromID("Woodes Rogers"));
			PlaySound("INTERFACE\key_unlock.wav");
			Pchar.quest.prison_celldoor = "open";

			LAi_QuestDelay("rogers_getting_angry", 1.0);
		break;

		case "rogers_getting_angry":
			LAi_SetActorType(CharacterFromID("Woodes Rogers"));
			LAi_ActorDialog(characterFromID("Woodes Rogers"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Woodes Rogers"));
			Characters[GetCharacterIndex("Woodes Rogers")].dialog.CurrentNode  = "getting_angry";
		break;

		case "angry_and_gone":
			//from rogers dialog
			PlaySound("VOICE\ENGLISH\gr_WR_host1.wav");
			LAi_SetActorType(CharacterFromID("Woodes Rogers"));
			LAi_ActorGoToLocatorJRH(characterFromID("Woodes Rogers"), "reload", "reload10", 3.0);//was reload9 3 sec

			LAi_QuestDelay("angry_and_gone1", 2.0);
		break;

		case "angry_and_gone1":
			ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "none", "", "");

			PlaySound("INTERFACE\closed_door.wav");
			PlaySound("INTERFACE\closed_door.wav");
			PlaySound("INTERFACE\closed_door.wav");

			LAi_SetPlayerType(Pchar);
		break;
//...................................................................................................
		case "place_plank_on_wall":
			Locations[FindLocation("wr_prison")].image = "";
			DoQuestReloadToLocation("wr_prison", "goto", "goto10", "place_plank_on_wall1");
		break;

		case "place_plank_on_wall1":
			Locations[FindLocation("wr_prison")].image = "wr_prison.tga";
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(PChar, false);

			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladeplank");

			PlaySound("PEOPLE\wood1.wav");

			LAi_QuestDelay("place_plank_on_wall3", 0.5);
			LAi_QuestDelay("place_plank_on_wall2", 1.5);
		break;

		case "place_plank_on_wall3":
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			EquipcharacterByItem(Pchar, "bladeA11");
		break;

		case "place_plank_on_wall2":
			ChangeCharacterAddressGroup(Pchar, "wr_prison", "goto", "goto11");
			PlaySound("PEOPLE\jump.wav");
			LAi_SetPlayerType(Pchar);
		break;
//...................................................................................................
		case "get_all_3_items":
			if(CheckCharacterItem(Pchar,"jewelry5") && CheckCharacterItem(Pchar,"pistol206") && CheckCharacterItem(Pchar,"blue_uniform"))
			{
				curExp = sti(Pchar.Experience);
				nextExp = CalculateExperienceFromRank(sti(Pchar.rank)+1);
				addExp = nextExp-curExp;
				AddCharacterExpNS(Pchar, addExp);
				int REP = CalcCharacterSkill(Pchar, "Repair");
				Pchar.skill.Repair = REP + 1;

				AddQuestRecord("Woodes_Rogers_reward_6", "2");
				CloseQuestHeader("Open_the_chest");

				LAi_QuestDelay("equip_pistol6", 1.0);
			}
			else
			{
				LAi_QuestDelay("not_all_3_items", 1.0);
			}
		break;

		case "not_all_3_items":
			ChangeCharacterAddressGroup(Pchar, "wr_prison", "reload", "reload17");
			PlaySound("PEOPLE\jump.wav");
		break;

		case "equip_pistol6":
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			EquipCharacterByItem(Pchar, "pistol206");
			PlaySound("OBJECTS\DUEL\reload1.wav");

			LAi_QuestDelay("equip_blue_uniform", 1.0);
		break;

		case "equip_blue_uniform":
			SetModel(PChar, "Pira4M_HTU", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);
			Pchar.quest.outfit = "blue_uniform_hat";

			PlaySound("PEOPLE\clothes1.wav");
			TakeItemFromCharacter(Pchar, "blue_uniform");

			LAi_QuestDelay("equip_blue_uniform1", 1.0);
		break;

		case "equip_blue_uniform1":
			PlaySound("OBJECTS\DUEL\man_attack6.wav");

			LAi_QuestDelay("ready_for_skeleton", 1.0);
		break;

		case "ready_for_skeleton":
			ChangeCharacterAddressGroup(Pchar, "wr_prison", "goto", "goto30");
			PlaySound("PEOPLE\jump.wav");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("ready_for_skeleton1", 1.0);
		break;

		case "ready_for_skeleton1":
			PlaySound("OBJECTS\VOICES\DEAD\skeleton\skeleton_dead02.wav");
			ChangeCharacterAddressGroup(CharacterFromID("wr_hanged_body"), "wr_prison", "goto", "goto7");
			LAi_SetStayType(CharacterFromID("wr_hanged_body"));

			LAi_QuestDelay("ready_for_skeleton2", 1.0);
		break;

		case "ready_for_skeleton2":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto6");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("skeleton_no_skull", 2.0);
		break;

		case "skeleton_no_skull":
			LAi_SetActorType(CharacterFromID("wr_hanged_body"));
			LAi_ActorGoToLocator(characterFromID("wr_hanged_body"), "goto", "goto12", "skeleton_no_skull1", 1.0);
		break;

		case "skeleton_no_skull1":
			LAi_SetStayType(CharacterFromID("wr_hanged_body"));
			PlaySound("INTERFACE\rusty.wav");

			LAi_QuestDelay("skeleton_no_skull2", 2.0);
		break;

		case "skeleton_no_skull2":
			ChangeCharacterAddressGroup(CharacterFromID("wr_hanged_body"), "wr_prison", "box", "box9");
			LAi_QuestDelay("skeleton_no_skull3", 1.0);
		break;

		case "skeleton_no_skull3":
			LAi_QuestDelay("skeleton_no_skull3_A", 1.0);

			LAi_SetActorType(CharacterFromID("wr_hanged_body"));
			LAi_ActorGoToLocator(characterFromID("wr_hanged_body"), "goto", "goto13", "skeleton_no_skull4", 2.0);
		break;

		case "skeleton_no_skull3_A":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto10");
		break;

		case "skeleton_no_skull4":
			LAi_SetStayType(CharacterFromID("wr_hanged_body"));
			PlaySound("OBJECTS\VOICES\DEAD\skeleton\skeleton_dead01.wav");

			LAi_QuestDelay("skeleton_no_skull4_A", 0.5);//was 1.0
		break;

		case "skeleton_no_skull4_A":
			LAi_SetSitType(CharacterFromID("wr_hanged_body"));
			PlaySound("PEOPLE\step_echo2.wav");

			LAi_QuestDelay("skeleton_no_skull5", 0.5);
		break;

		case "skeleton_no_skull5":
			Locations[FindLocation("wr_prison")].models.always.locators = "Pri_l_JRH12";//no skull, floor closed, barrel under chest, plank on wall
			Locations[FindLocation("wr_prison")].image = "";
			DoQuestReloadToLocation("wr_prison", "goto", "goto31", "skeleton_no_skull6");//was goto14
		break;

		case "skeleton_no_skull6":
			Locations[FindLocation("wr_prison")].image = "wr_prison.tga";
			Locations[FindLocation("wr_prison")].reload.l15.disable = 1;//floor hatch
			PlaySound("INTERFACE\closed_door.wav");
			PlaySound("PEOPLE\step_echo.wav");
			PlaySound("PEOPLE\step_stairway.wav");

			ChangeCharacterAddressGroup(CharacterFromID("wr_hanged_body"), "wr_prison", "goto", "goto13");
			LAi_SetStayType(CharacterFromID("wr_hanged_body"));

			LAi_SetActorType(CharacterFromID("wr_hanged_body"));
			LAi_ActorTurnToLocator(CharacterFromID("wr_hanged_body"), "goto", "goto14");

			LAi_QuestDelay("skeleton_no_skull7", 1.0);
		break;

		case "skeleton_no_skull7":
			PlaySound("OBJECTS\VOICES\skeleton_body2.wav");
			PlaySound("OBJECTS\DUEL\club1.wav");

			ChangeCharacterAddressGroup(CharacterFromID("wr_hanged_body"), "none", "", "");
			LAi_SetStayType(CharacterFromID("wr_hanged"));
			ChangeCharacterAddressGroup(CharacterFromID("wr_hanged"), "wr_prison", "goto", "goto15");

			LAi_QuestDelay("skeleton_no_skull8", 1.0);
		break;

		case "skeleton_no_skull8":
			LAi_QuestDelay("skeleton_no_skull9_A", 0.5);

			LAi_SetActorType(CharacterFromID("wr_hanged"));
			LAi_ActorGoToLocator(characterFromID("wr_hanged"), "goto", "goto16", "skeleton_no_skull9", 1.0);
		break;

		case "skeleton_no_skull9_A":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto6");
		break;

		case "skeleton_no_skull9":
			LAi_SetStayType(CharacterFromID("wr_hanged"));
			PlaySound("INTERFACE\rusty.wav");

			LAi_QuestDelay("skeleton_no_skull10", 1.0);
		break;

		case "skeleton_no_skull10":
			ChangeCharacterAddressGroup(CharacterFromID("wr_hanged"), "wr_prison", "box", "box8");
			LAi_SetPlayerType(Pchar);
			Pchar.quest.prison_celldoor = "locked";

			LAi_QuestDelay("skeleton_no_skull11", 1.0);
		break;

		case "skeleton_no_skull11":
			LAi_SetActorType(CharacterFromID("wr_hanged"));
			LAi_ActorTurnToLocator(CharacterFromID("wr_hanged"), "box", "box9");

			pchar.quest.skeleton_no_skull12.win_condition.l1 = "locator";
			pchar.quest.skeleton_no_skull12.win_condition.l1.location = "wr_prison";
			pchar.quest.skeleton_no_skull12.win_condition.l1.locator_group = "box";
			pchar.quest.skeleton_no_skull12.win_condition.l1.locator = "box9";
			pchar.quest.skeleton_no_skull12.win_condition = "skeleton_no_skull12";
		break;

		case "skeleton_no_skull12":
			PlaySound("INTERFACE\key_lock.wav");

			LAi_QuestDelay("skeleton_no_skull13", 1.0);
		break;

		case "skeleton_no_skull13":
			PlaySound("OBJECTS\DUEL\skeleton_attack3.wav");

			LAi_SetActorType(CharacterFromID("wr_hanged"));
			LAi_ActorGoToLocator(characterFromID("wr_hanged"), "reload", "reload13", "skeleton_no_skull14", 2.0);
		break;

		case "skeleton_no_skull14":
			AddQuestRecord("Woodes_Rogers_reward_6", "3");

			ChangeCharacterAddressGroup(CharacterFromID("wr_hanged"), "none", "", "");
			Pchar.quest.prison_barrel4 = "ready_to_remove_plank_from_wall";
		break;

		case "remove_plank_from_wall1":
			Locations[FindLocation("wr_prison")].models.always.locators = "Pri_l_JRH13";
			Locations[FindLocation("wr_prison")].image = "";
			DoQuestReloadToLocation("wr_prison", "goto", "goto8", "remove_plank_from_wall2");
		break;

		case "remove_plank_from_wall2":
			Locations[FindLocation("wr_prison")].image = "wr_prison.tga";
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			GiveItem2Character(Pchar, "bladeplank");
			EquipCharacterByItem(Pchar, "bladeplank");

			PlaySound("INTERFACE\elevator_gate.wav");
			PlaySound("OBJECTS\DUEL\sword_broken.wav");

			LAi_QuestDelay("remove_plank_from_wall3", 1.5);
		break;

		case "remove_plank_from_wall3":
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");

			LAi_QuestDelay("remove_plank_from_wall4", 1.0);
		break;

		case "remove_plank_from_wall4":
			ChangeCharacterAddressGroup(Pchar, "wr_prison", "goto", "goto11");
			PlaySound("PEOPLE\jump.wav");
		break;

		case "place_plank_on_floor":
			//from itemlogic prison box7
			Locations[FindLocation("wr_prison")].image = "wr_prison.tga";
			PlaySound("PEOPLE\wood2.wav");

			LAi_QuestDelay("steplock_A_plank", 0.1);
		break;

		case "steplock_A_plank":
			//Log_SetStringToLog("steplock_A_plank");
			//loop started from place_plank_on_floor
			Locations[FindLocation("wr_prison")].image = "wr_prison.tga";
			LAi_SetPlayerType(Pchar);

			pchar.quest.steplock_A_plank1.win_condition.l1 = "locator";
			pchar.quest.steplock_A_plank1.win_condition.l1.location = "wr_prison";
			pchar.quest.steplock_A_plank1.win_condition.l1.locator_group = "goto";
			pchar.quest.steplock_A_plank1.win_condition.l1.locator = "goto17";
			pchar.quest.steplock_A_plank1.win_condition = "steplock_A_plank1";
		break;

		case "steplock_A_plank1":
			if(CheckCharacterItem(Pchar,"bladebarrel"))
			{
				LAi_SetStayType(Pchar);
				PlaySound("INTERFACE\step_path.wav");

				LAi_QuestDelay("steplock_A_plank_barrel", 0.5);
			}
			else
			{
				LAi_SetStayType(Pchar);
				PlaySound("INTERFACE\step_path.wav");

				LAi_QuestDelay("steplock_A_plank2", 0.5);
			}
		break;

		case "steplock_A_plank2":
			//Log_SetStringToLog("steplock_A_plank2");

			//Log_SetStringToLog("steplock_A_plank2_2");

			if(Locations[FindLocation(Pchar.location)].models.always.locators == "Pri_l_JRH14")//closed floor
			{
				Locations[FindLocation("wr_prison")].models.always.locators = "Pri_l_JRH15";//open floor
			}

			Locations[FindLocation("wr_prison")].image = "";
			DoQuestReloadToLocation("wr_prison", "goto", "goto17", "steplock_A_plank4");
			LAi_QuestDelay("steplock_A_plank3", 0.1);
		break;

		case "steplock_A_plank3":
			//Log_SetStringToLog("steplock_A_plank3");
			PlaySound("INTERFACE\closet_open.wav");
		break;

		case "steplock_A_plank4":
			//Log_SetStringToLog("steplock_A_plank4");
			Locations[FindLocation("wr_prison")].image = "wr_prison.tga";
			LAi_SetPlayerType(Pchar);

			pchar.quest.steplock_A_plank5.win_condition.l1 = "locator";
			pchar.quest.steplock_A_plank5.win_condition.l1.location = "wr_prison";
			pchar.quest.steplock_A_plank5.win_condition.l1.locator_group = "goto";
			pchar.quest.steplock_A_plank5.win_condition.l1.locator = "goto19";
			pchar.quest.steplock_A_plank5.win_condition = "steplock_A_plank5";
		break;

		case "steplock_A_plank5":
			//Log_SetStringToLog("steplock_A_plank5");

			//Log_SetStringToLog("steplock_A_plank5_2");
			LAi_SetStayType(Pchar);
			PlaySound("INTERFACE\key_lock.wav");

			LAi_QuestDelay("steplock_A_plank6", 0.5);
		break;

		case "steplock_A_plank6":
			//Log_SetStringToLog("steplock_A_plank6");

			if(Locations[FindLocation(Pchar.location)].models.always.locators == "Pri_l_JRH15")//open floor
			{
				//Log_SetStringToLog("steplock_A_plank6_1");
				Locations[FindLocation("wr_prison")].models.always.locators = "Pri_l_JRH14";//closed floor
			}

			Locations[FindLocation("wr_prison")].image = "";
			DoQuestReloadToLocation("wr_prison", "goto", "goto20", "steplock_A_plank");//loop
			LAi_QuestDelay("steplock_A_plank7", 0.1);
			LAi_QuestDelay("steplock_A_plank8", 0.1);//enable barrel pickup cell
		break;

		case "steplock_A_plank7":
			PlaySound("INTERFACE\closed_door.wav");
			PlaySound("PEOPLE\step_echo.wav");
			PlaySound("PEOPLE\step_stairway.wav");
		break;

		case "steplock_A_plank8":
			//Log_SetStringToLog("steplock_A_plank8");
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem19", 0.5);

			LAi_QuestDelay("steplock_A_plank_barrel_prepare", 0.1);
		break;

		case "steplock_A_plank_barrel_prepare":
			if(CheckCharacterItem(Pchar,"bladebarrel"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterbyItem(Pchar, "bladebarrel");
			}
			else LAi_QuestDelay("steplock_A_plank_barrel_prepare", 0.5);
		break;

		case "steplock_A_plank_barrel":
			Locations[FindLocation("wr_prison")].models.always.locators = "Pri_l_JRH16";//barrel on plank on floor & floor hatch open
			Locations[FindLocation("wr_prison")].image = "";
			DoQuestReloadToLocation("wr_prison", "goto", "goto18", "steplock_A_plank_barrel1");
			LAi_QuestDelay("steplock_A_plank3", 0.1);//open sound
		break;

		case "steplock_A_plank_barrel1":
			Locations[FindLocation("wr_prison")].image = "wr_prison.tga";
			Locations[FindLocation("wr_prison")].reload.l15.disable = 0;//floor hatch
			if(CheckCharacterItem(Pchar,"bladebarrel"))
			{
				if(IsEquipCharacterByItem(Pchar, "bladebarrel")) RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "bladebarrel");
			}
			LAi_SetPlayerType(Pchar);

			if(CheckCharacterItem(Pchar,"bladeA11"))
			{
				EquipcharacterByItem(Pchar, "bladeA11");
			}
			else EquipcharacterByItem(Pchar, "bladeX4");

			LAi_QuestDelay("steplock_A_plank_barrel2", 1.0);
		break;

		case "steplock_A_plank_barrel2":
			PlaySound("OBJECTS\DUEL\man_attack6.wav");
			CloseQuestHeader("Woodes_Rogers_reward_6");

			LAi_QuestDelay("bsw_ready_for_exit", 0.1);
		break;
//--------------------------------------------------------------------------------------------------------------------
		case "switch_room":
			Locations[FindLocation("wr_mine")].models.always.locators = "Mine_l_JRH1";//all on except 2

			pchar.quest.switch_room1.win_condition.l1 = "locator";
			pchar.quest.switch_room1.win_condition.l1.location = "wr_mine";
			pchar.quest.switch_room1.win_condition.l1.locator_group = "goto";
			pchar.quest.switch_room1.win_condition.l1.locator = "goto2";		//was goto4
			pchar.quest.switch_room1.win_condition = "switch_room1";
		break;

		case "switch_room1":
			PlaySound("VOICE\ENGLISH\Spa_m_a_032.wav");//042
			Locations[FindLocation("wr_mine")].reload.l7.disable = 0;//open to control room
			LAi_SetStayType(CharacterFromID("wr_boc5"));
			ChangeCharacterAddressGroup(CharacterFromID("wr_boc5"), "wr_mine", "reload", "reload7");

			LAi_QuestDelay("switch_room2", 2.0);
		break;

		case "switch_room2":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload7");

			LAi_QuestDelay("switch_room3", 1.0);
		break;

		case "switch_room3":
			LAi_SetPlayerType(Pchar);
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");

			pchar.quest.switch_room4.win_condition.l1 = "locator";
			pchar.quest.switch_room4.win_condition.l1.location = "wr_mine";
			pchar.quest.switch_room4.win_condition.l1.locator_group = "goto";
			pchar.quest.switch_room4.win_condition.l1.locator = "goto17";
			pchar.quest.switch_room4.win_condition = "switch_room4";
		break;

		case "switch_room4":
			LAi_SetActorType(CharacterFromID("wr_boc5"));
			LAi_ActorDialog(characterFromID("wr_boc5"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wr_boc5"));
			Characters[GetCharacterIndex("wr_boc5")].dialog.CurrentNode  = "switch_room";
		break;

		case "switch_room_open":
			AddQuestRecord("Open_the_cell", "5");

			LAi_SetActorType(CharacterFromID("wr_boc5"));
			LAi_ActorGoToLocator(characterFromID("wr_boc5"), "goto", "goto3", "switch_room_open1", 8.0);

			LAi_QuestDelay("torch_unable", 0.1);
		break;

		case "switch_room_open1":
			ChangeCharacterAddressGroup(CharacterFromID("wr_boc5"), "wr_mine", "goto", "goto3");
			LAi_SetCitizenType(CharacterFromID("wr_boc5"));
		break;
//--------------------------------------------------------------------------------------------------------------------
		case "selkirk_in_prison":
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(CharacterFromID("Selkirk"), "wr_prison", "goto", "goto1");
			LAi_SetStayType(characterFromID("Selkirk"));

			LAi_QuestDelay("selkirk_in_prison1", 1.0);
		break;

		case "selkirk_in_prison1":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto6");

			LAi_QuestDelay("selkirk_in_prison2", 1.0);
		break;

		case "selkirk_in_prison2":
			LAi_SetStayType(Pchar));
			LAi_SetActorType(characterFromID("Selkirk"));
			LAi_ActorGoToLocator(characterFromID("Selkirk"), "goto", "goto13", "selkirk_in_prison3", 0.7);
		break;

		case "selkirk_in_prison3":
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorDialog(characterFromID("Selkirk"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Selkirk"));
			Characters[GetCharacterIndex("Selkirk")].dialog.CurrentNode  = "warning";
		break;

		case "warning_finished":
			//from selkirk dialog

			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(characterFromID("friday"), "wr_prison", "goto", "goto1");
			LAi_SetStayType(characterFromID("friday"));

			LAi_QuestDelay("selkirk_in_prison4", 1.0);
		break;

		case "selkirk_in_prison4":
			LAi_SetActorType(characterFromID("Friday"));
			LAi_ActorGoToLocator(characterFromID("Friday"), "goto", "goto14", "selkirk_in_prison5", 2.0);
		break;

		case "selkirk_in_prison5":
			PlaySound("VOICE\ENGLISH\gr_friday3.wav");

			LAi_QuestDelay("selkirk_in_prison6", 2.0);
		break;

		case "selkirk_in_prison6":
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorDialog(characterFromID("Selkirk"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Selkirk"));
			Characters[GetCharacterIndex("Selkirk")].dialog.CurrentNode  = "new_warning";
		break;

		case "new_warning_finished":
			//from selkirk dialog

			AddQuestRecord("Open_the_niche", "3");
			CloseQuestHeader("Open_the_cell");
			PlaySound("VOICE\ENGLISH\Eng_m_c_076.wav");

			LAi_QuestDelay("selkirk_in_prison7", 1.0);
		break;

		case "selkirk_in_prison7":
			LAi_SetActorType(characterFromID("Selkirk"));
			LAi_ActorGoToLocatorJRH(characterFromID("Selkirk"), "reload", "reload9", 5.0);

			LAi_QuestDelay("selkirk_in_prison8", 0.5);
			LAi_QuestDelay("selkirk_in_prison9", 2.0);
			LAi_QuestDelay("selkirk_in_prison10", 3.0);
		break;

		case "selkirk_in_prison8":
			LAi_SetActorType(characterFromID("Friday"));
			LAi_ActorGoToLocatorJRH(characterFromID("Friday"), "reload", "reload9", 6.0);
		break;

		case "selkirk_in_prison9":
			ChangeCharacterAddressGroup(CharacterFromID("Selkirk"), "none", "", "");
			LAi_SetPlayerType(Pchar));
		break;

		case "selkirk_in_prison10":
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(CharacterFromID("Friday"), "none", "", "");
		break;
//-------------------------------------------------------------------------------------------------------------------
		//attack loop for dead guys in dungeon4_main

		case "mine_skeletons_mode1":
			//4 at torches
			//Log_SetStringToLog("MODE 1");

			//Z stop at door to loop X
			Locations[FindLocation("wr_dungeon4_main")].reload.l2.go = "wr_dungeon4_main";
			Locations[FindLocation("wr_dungeon4_main")].reload.l2.emerge = "goto10";

			ChangeCharacterAddressGroup(CharacterFromID("wr_dead1"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead2"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead3"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead4"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead5"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead6"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead10"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead12"), "none", "", "");

			ChangeCharacterAddressGroup(characterFromID("wr_dead7"), "wr_dungeon4_main", "goto", "skel7");
			ChangeCharacterAddressGroup(characterFromID("wr_dead8"), "wr_dungeon4_main", "goto", "skel8");
			ChangeCharacterAddressGroup(characterFromID("wr_dead9"), "wr_dungeon4_main", "goto", "skel9");
			ChangeCharacterAddressGroup(characterFromID("wr_dead11"), "wr_dungeon4_main", "goto", "skel11");

			pchar.quest.mine_skeletons_attack.win_condition.l1 = "locator";
			pchar.quest.mine_skeletons_attack.win_condition.l1.location = "wr_dungeon4_main";
			pchar.quest.mine_skeletons_attack.win_condition.l1.locator_group = "goto";
			pchar.quest.mine_skeletons_attack.win_condition.l1.locator = "goto7";		//after crossing
			pchar.quest.mine_skeletons_attack.win_condition = "mine_skeletons_attack";
		break;

		case "mine_skeletons_mode2":
			//8 at crossing, 4 at door to loop
			//Log_SetStringToLog("MODE 2");

			if(CheckAttribute(Pchar,"quest.met_4_skeletons") && Pchar.quest.met_4_skeletons == "yes")
			{
				PlaySound("OBJECTS\VOICES\DEAD\skeleton\skeleton_dead02.wav");
				PlaySound("OBJECTS\VOICES\DEAD\skeleton\skeleton_dead02.wav");

				LAi_QuestDelay("fire_scared_them_away", 1.5);
			}

			//Z stop at door to loop X
			Locations[FindLocation("wr_dungeon4_main")].reload.l2.go = "wr_dungeon4_main";
			Locations[FindLocation("wr_dungeon4_main")].reload.l2.emerge = "goto10";

			ChangeCharacterAddressGroup(CharacterFromID("wr_dead1"), "wr_dungeon4_main", "goto", "skel1");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead2"), "wr_dungeon4_main", "goto", "skel2");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead3"), "wr_dungeon4_main", "goto", "skel3");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead4"), "wr_dungeon4_main", "goto", "skel4");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead5"), "wr_dungeon4_main", "goto", "skel5");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead6"), "wr_dungeon4_main", "goto", "skel6");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead10"), "wr_dungeon4_main", "goto", "skel10");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead12"), "wr_dungeon4_main", "goto", "skel12");

			ChangeCharacterAddressGroup(CharacterFromID("wr_dead7"), "wr_dungeon4_main", "goto", "skel17");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead8"), "wr_dungeon4_main", "goto", "skel18");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead9"), "wr_dungeon4_main", "goto", "skel19");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead11"), "wr_dungeon4_main", "goto", "skel21");

			pchar.quest.mine_skeletons_attack.win_condition.l1 = "locator";
			pchar.quest.mine_skeletons_attack.win_condition.l1.location = "wr_dungeon4_main";
			pchar.quest.mine_skeletons_attack.win_condition.l1.locator_group = "goto";
			pchar.quest.mine_skeletons_attack.win_condition.l1.locator = "goto6";		//crossing center
			pchar.quest.mine_skeletons_attack.win_condition = "mine_skeletons_attack";
		break;

		case "fire_scared_them_away":
			PlaySound("VOICE\ENGLISH\blaze_lets_go.wav");

			pchar.quest.fire_scared_them_away1.win_condition.l1 = "locator";
			pchar.quest.fire_scared_them_away1.win_condition.l1.location = "wr_dungeon4_main";
			pchar.quest.fire_scared_them_away1.win_condition.l1.locator_group = "goto";
			pchar.quest.fire_scared_them_away1.win_condition.l1.locator = "fire_worked";
			pchar.quest.fire_scared_them_away1.win_condition = "fire_scared_them_away1";
		break;

		case "fire_scared_them_away1":
			PlaySound("OBJECTS\DUEL\man_attack6.wav");
			Logit(LanguageConvertString(tmpLangFileID,"Yes, the fire scared them away!"));
		break;

		case "mine_skeletons_mode3":
			//very foggy, 8 at crossing
			//Log_SetStringToLog("MODE 3");

			//Z to loop X
			Locations[FindLocation("wr_dungeon4_main")].reload.l2.go = "wr_dungeon4_loop";
			Locations[FindLocation("wr_dungeon4_main")].reload.l2.emerge = "goto3";

			ChangeCharacterAddressGroup(characterFromID("wr_dead7"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("wr_dead8"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("wr_dead9"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("wr_dead11"), "none", "", "");

			ChangeCharacterAddressGroup(CharacterFromID("wr_dead1"), "wr_dungeon4_main", "goto", "skel1");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead2"), "wr_dungeon4_main", "goto", "skel2");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead3"), "wr_dungeon4_main", "goto", "skel3");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead4"), "wr_dungeon4_main", "goto", "skel4");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead5"), "wr_dungeon4_main", "goto", "skel5");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead6"), "wr_dungeon4_main", "goto", "skel6");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead10"), "wr_dungeon4_main", "goto", "skel10");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead12"), "wr_dungeon4_main", "goto", "skel12");

			pchar.quest.mine_skeletons_attack1.win_condition.l1 = "locator";
			pchar.quest.mine_skeletons_attack1.win_condition.l1.location = "wr_dungeon4_main";
			pchar.quest.mine_skeletons_attack1.win_condition.l1.locator_group = "goto";
			pchar.quest.mine_skeletons_attack1.win_condition.l1.locator = "skel5";		//crossing side
			pchar.quest.mine_skeletons_attack1.win_condition = "mine_skeletons";

			pchar.quest.mine_skeletons_attack2.win_condition.l1 = "locator";
			pchar.quest.mine_skeletons_attack2.win_condition.l1.location = "wr_dungeon4_main";
			pchar.quest.mine_skeletons_attack2.win_condition.l1.locator_group = "goto";
			pchar.quest.mine_skeletons_attack2.win_condition.l1.locator = "skel6";		//crossing side
			pchar.quest.mine_skeletons_attack2.win_condition = "mine_skeletons_attack";
		break;

		case "mine_skeletons_mode4":
			//way back: flooded, 8 at crossing, 4 at entrance door
			//Log_SetStringToLog("MODE 4");

			//Z to loop X
			Locations[FindLocation("wr_dungeon4_main")].reload.l2.go = "wr_dungeon4_loop";
			Locations[FindLocation("wr_dungeon4_main")].reload.l2.emerge = "goto3";

			Locations[FindLocation("wr_mine")].reload.l4.disable = 1;		//mine to tunnel z
			Locations[FindLocation("wr_dungeon4_main")].reload.l6.disable = 1;	//tunnel z to mine

			ChangeCharacterAddressGroup(CharacterFromID("wr_dead1"), "wr_dungeon4_main", "goto", "skel1");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead2"), "wr_dungeon4_main", "goto", "skel2");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead3"), "wr_dungeon4_main", "goto", "skel3");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead4"), "wr_dungeon4_main", "goto", "skel4");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead5"), "wr_dungeon4_main", "goto", "skel5");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead6"), "wr_dungeon4_main", "goto", "skel6");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead10"), "wr_dungeon4_main", "goto", "skel10");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead12"), "wr_dungeon4_main", "goto", "skel12");

			ChangeCharacterAddressGroup(characterFromID("wr_dead7"), "wr_dungeon4_main", "goto", "skel37");
			ChangeCharacterAddressGroup(characterFromID("wr_dead8"), "wr_dungeon4_main", "goto", "skel38");
			ChangeCharacterAddressGroup(characterFromID("wr_dead9"), "wr_dungeon4_main", "goto", "skel39");
			ChangeCharacterAddressGroup(characterFromID("wr_dead11"), "wr_dungeon4_main", "goto", "skel41");

			pchar.quest.mine_skeletons_attack.win_condition.l1 = "locator";
			pchar.quest.mine_skeletons_attack.win_condition.l1.location = "wr_dungeon4_main";
			pchar.quest.mine_skeletons_attack.win_condition.l1.locator_group = "goto";
			pchar.quest.mine_skeletons_attack.win_condition.l1.locator = "goto6";		//crossing center
			pchar.quest.mine_skeletons_attack.win_condition = "mine_skeletons_attack";
		break;

		case "mine_skeletons_mode5":
			//entrance from well: 8 at crossing, 4 at entrance door
			//Log_SetStringToLog("MODE 5");

			//Z to loop X
			Locations[FindLocation("wr_dungeon4_main")].reload.l2.go = "wr_dungeon4_loop";
			Locations[FindLocation("wr_dungeon4_main")].reload.l2.emerge = "goto3";

			ChangeCharacterAddressGroup(CharacterFromID("wr_dead1"), "wr_dungeon4_main", "goto", "skel1");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead2"), "wr_dungeon4_main", "goto", "skel2");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead3"), "wr_dungeon4_main", "goto", "skel3");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead4"), "wr_dungeon4_main", "goto", "skel4");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead5"), "wr_dungeon4_main", "goto", "skel5");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead6"), "wr_dungeon4_main", "goto", "skel6");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead10"), "wr_dungeon4_main", "goto", "skel10");
			ChangeCharacterAddressGroup(CharacterFromID("wr_dead12"), "wr_dungeon4_main", "goto", "skel12");

			ChangeCharacterAddressGroup(characterFromID("wr_dead7"), "wr_dungeon4_main", "goto", "skel37");
			ChangeCharacterAddressGroup(characterFromID("wr_dead8"), "wr_dungeon4_main", "goto", "skel38");
			ChangeCharacterAddressGroup(characterFromID("wr_dead9"), "wr_dungeon4_main", "goto", "skel39");
			ChangeCharacterAddressGroup(characterFromID("wr_dead11"), "wr_dungeon4_main", "goto", "skel41");

			pchar.quest.mine_skeletons_attack.win_condition.l1 = "locator";
			pchar.quest.mine_skeletons_attack.win_condition.l1.location = "wr_dungeon4_main";
			pchar.quest.mine_skeletons_attack.win_condition.l1.locator_group = "goto";
			pchar.quest.mine_skeletons_attack.win_condition.l1.locator = "goto6";		//crossing center
			pchar.quest.mine_skeletons_attack.win_condition = "mine_skeletons_attack";
		break;

//-------------------------------------------------------------------------------------------------------------------		break;
		case "mine_skeletons_attack":
			//Log_SetStringToLog("4dead main attack");

			LAi_SetActorType(characterFromID("wr_dead1"));
			LAi_SetActorType(characterFromID("wr_dead2"));
			LAi_SetActorType(characterFromID("wr_dead3"));
			LAi_SetActorType(characterFromID("wr_dead4"));
			LAi_SetActorType(characterFromID("wr_dead5"));
			LAi_SetActorType(characterFromID("wr_dead6"));
			LAi_SetActorType(characterFromID("wr_dead7"));
			LAi_SetActorType(characterFromID("wr_dead8"));
			LAi_SetActorType(characterFromID("wr_dead9"));
			LAi_SetActorType(characterFromID("wr_dead10"));
			LAi_SetActorType(characterFromID("wr_dead11"));
			LAi_SetActorType(characterFromID("wr_dead12"));

			LAi_ActorAttack(CharacterFromID("wr_dead1"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("wr_dead2"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("wr_dead3"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("wr_dead4"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("wr_dead5"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("wr_dead6"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("wr_dead7"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("wr_dead8"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("wr_dead9"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("wr_dead10"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("wr_dead11"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("wr_dead12"), Pchar, "");

			if(CheckAttribute(Pchar,"quest.mine_skeletons") && Pchar.quest.mine_skeletons == "mode2")
			{

				Locations[FindLocation("wr_mine")].environment.weather = "true";

				SetCurrentTime(11.00, 0);
				SetNextWeather("Clear");
				Pchar.quest.JRH_rain = "Mine Fog 2";
				Pchar.quest.skeleton_mode3_check = "first_time";		//only time it's used
				Pchar.quest.very_foggy_mine = "yes";

				LAi_QuestDelay("dead_loop_guys_reset", 0.1);
			}

			Pchar.quest.mine_skeletons_reset.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.mine_skeletons_reset.win_condition.l1.location = "wr_dungeon4_main";
			Pchar.quest.mine_skeletons_reset.win_condition = "mine_skeletons_reset";
		break;

		case "mine_skeletons_reset":
			//Log_SetStringToLog("dead guys reset");

			LAi_SetStayType(characterFromID("wr_dead1"));
			LAi_SetStayType(characterFromID("wr_dead2"));
			LAi_SetStayType(characterFromID("wr_dead3"));
			LAi_SetStayType(characterFromID("wr_dead4"));
			LAi_SetStayType(characterFromID("wr_dead5"));
			LAi_SetStayType(characterFromID("wr_dead6"));
			LAi_SetStayType(characterFromID("wr_dead7"));
			LAi_SetStayType(characterFromID("wr_dead8"));
			LAi_SetStayType(characterFromID("wr_dead9"));
			LAi_SetStayType(characterFromID("wr_dead10"));
			LAi_SetStayType(characterFromID("wr_dead11"));
			LAi_SetStayType(characterFromID("wr_dead12"));

			if(CheckAttribute(Pchar,"quest.skeleton_mode3_check") && Pchar.quest.skeleton_mode3_check == "first_time")
			{
				Logit(LanguageConvertString(tmpLangFileID,"Hmm, very foggy now - maybe the Skeletons can't see me?"));
				PlaySound("VOICE\ENGLISH\blaze_hah.wav");

				Pchar.quest.skeleton_mode3_check = "next_time";	//don't repeat this
				Pchar.quest.mine_skeletons = "mode3";

				LAi_QuestDelay("mine_skeletons_mode3", 0.1);	//skeletons are repositioned here etc
				return;						//to avoid double checkpoints
			}

			switch(Pchar.quest.mine_skeletons)
			{
				case "mode1":
					pchar.quest.mine_skeletons_attack.win_condition.l1 = "locator";
					pchar.quest.mine_skeletons_attack.win_condition.l1.location = "wr_dungeon4_main";
					pchar.quest.mine_skeletons_attack.win_condition.l1.locator_group = "goto";
					pchar.quest.mine_skeletons_attack.win_condition.l1.locator = "goto7";		//after crossing
					pchar.quest.mine_skeletons_attack.win_condition = "mine_skeletons_attack";
				break;

				case "mode2":
					pchar.quest.mine_skeletons_attack.win_condition.l1 = "locator";
					pchar.quest.mine_skeletons_attack.win_condition.l1.location = "wr_dungeon4_main";
					pchar.quest.mine_skeletons_attack.win_condition.l1.locator_group = "goto";
					pchar.quest.mine_skeletons_attack.win_condition.l1.locator = "goto6";		//crossing center
					pchar.quest.mine_skeletons_attack.win_condition = "mine_skeletons_attack";
				break;

				case "mode3":
					pchar.quest.mine_skeletons_attack1.win_condition.l1 = "locator";
					pchar.quest.mine_skeletons_attack1.win_condition.l1.location = "wr_dungeon4_main";
					pchar.quest.mine_skeletons_attack1.win_condition.l1.locator_group = "goto";
					pchar.quest.mine_skeletons_attack1.win_condition.l1.locator = "skel5";		//crossing side
					pchar.quest.mine_skeletons_attack1.win_condition = "mine_skeletons";

					pchar.quest.mine_skeletons_attack2.win_condition.l1 = "locator";
					pchar.quest.mine_skeletons_attack2.win_condition.l1.location = "wr_dungeon4_main";
					pchar.quest.mine_skeletons_attack2.win_condition.l1.locator_group = "goto";
					pchar.quest.mine_skeletons_attack2.win_condition.l1.locator = "skel6";		//crossing side
					pchar.quest.mine_skeletons_attack2.win_condition = "mine_skeletons_attack";
				break;

				case "mode4":
					pchar.quest.mine_skeletons_attack.win_condition.l1 = "locator";
					pchar.quest.mine_skeletons_attack.win_condition.l1.location = "wr_dungeon4_main";
					pchar.quest.mine_skeletons_attack.win_condition.l1.locator_group = "goto";
					pchar.quest.mine_skeletons_attack.win_condition.l1.locator = "goto6";		//crossing center
					pchar.quest.mine_skeletons_attack.win_condition = "mine_skeletons_attack";
				break;

				case "mode5":
					pchar.quest.mine_skeletons_attack.win_condition.l1 = "locator";
					pchar.quest.mine_skeletons_attack.win_condition.l1.location = "wr_dungeon4_main";
					pchar.quest.mine_skeletons_attack.win_condition.l1.locator_group = "goto";
					pchar.quest.mine_skeletons_attack.win_condition.l1.locator = "goto6";		//crossing center
					pchar.quest.mine_skeletons_attack.win_condition = "mine_skeletons_attack";
				break;
			}
		break;

//-------------------------------------------------------------------------------------------------------------------
		case "dead_loop_guys_reset":
			LAi_SetStayType(characterFromID("wr_dead13"));
			LAi_SetStayType(characterFromID("wr_dead14"));
			LAi_SetStayType(characterFromID("wr_dead15"));
			LAi_SetStayType(characterFromID("wr_dead16"));

			LAi_SetStayType(characterFromID("wr_no_head1"));
			LAi_SetStayType(characterFromID("wr_no_head2"));
			LAi_SetStayType(characterFromID("wr_no_head3"));

			pchar.quest.4dead_loop_attack.win_condition.l1 = "locator";
			pchar.quest.4dead_loop_attack.win_condition.l1.location = "wr_dungeon4_loop";
			pchar.quest.4dead_loop_attack.win_condition.l1.locator_group = "goto";
			pchar.quest.4dead_loop_attack.win_condition.l1.locator = "goto7";	//in loop
			pchar.quest.4dead_loop_attack.win_condition = "4dead_loop_attack";

			pchar.quest.3nohead_loop_attack.win_condition.l1 = "locator";
			pchar.quest.3nohead_loop_attack.win_condition.l1.location = "wr_dungeon4_loop";
			pchar.quest.3nohead_loop_attack.win_condition.l1.locator_group = "goto";
			pchar.quest.3nohead_loop_attack.win_condition.l1.locator = "goto9";	//in dead end
			pchar.quest.3nohead_loop_attack.win_condition = "3nohead_loop_attack";
		break;

		case "4dead_loop_attack":
			LAi_SetActorType(characterFromID("wr_dead13"));
			LAi_SetActorType(characterFromID("wr_dead14"));
			LAi_SetActorType(characterFromID("wr_dead15"));
			LAi_SetActorType(characterFromID("wr_dead16"));

			LAi_ActorAttack(CharacterFromID("wr_dead13"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("wr_dead14"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("wr_dead15"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("wr_dead16"), Pchar, "");

			Pchar.quest.tunnelX_3.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.tunnelX_3.win_condition.l1.location = "wr_dungeon4_loop";
			Pchar.quest.tunnelX_3.win_condition = "dead_loop_guys_reset";
		break;
//-------------------------------------------------------------------------------------------------------------------
		case "3nohead_loop_attack":
			LAi_SetActorType(characterFromID("wr_no_head1"));
			LAi_SetActorType(characterFromID("wr_no_head2"));
			LAi_SetActorType(characterFromID("wr_no_head3"));

			LAi_ActorAttack(CharacterFromID("wr_no_head1"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("wr_no_head2"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("wr_no_head3"), Pchar, "");

			Pchar.quest.tunnelX_3.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.tunnelX_3.win_condition.l1.location = "wr_dungeon4_loop";
			Pchar.quest.tunnelX_3.win_condition = "dead_loop_guys_reset";
		break;
//--------------------------------------------------------------------------------------------------------------------
		case "Caroline_opens_well":
			//from bladeaxe4 item check
			pchar.quest.Caroline_opens_well1.win_condition.l1 = "locator";
			pchar.quest.Caroline_opens_well1.win_condition.l1.location = "Redmond_town_exit_2";
			pchar.quest.Caroline_opens_well1.win_condition.l1.locator_group = "goto";
			pchar.quest.Caroline_opens_well1.win_condition.l1.locator = "goto9";			//was reload3
			pchar.quest.Caroline_opens_well1.win_condition = "Caroline_opens_well1";
		break;

		case "Caroline_opens_well1":
			LAi_QuestDelay("Caroline_opens_well2", 1.0);
		break;

		case "Caroline_opens_well2":
			LAi_SetActorType(CharacterFromID("wench3"));
			LAi_ActorDialog(characterFromID("wench3"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wench3"));
			Characters[GetCharacterIndex("wench3")].dialog.CurrentNode  = "open_well";
		break;

		case "open_well_done":
			AddQuestRecord("Open_the_niche", "5");

			PlaySound("OBJECTS\VOICES\DEAD\female\dead_wom3.wav");
			LAi_SetActorType(characterFromID("wench3"));
			LAi_ActorRunToLocator(characterFromID("wench3"), "reload", "reload2", "open_well_done1", 4.0);
		break;

		case "open_well_done1":
			Pchar.quest.caroline_well = "done";
			ChangeCharacterAddressGroup(characterFromID("wench3"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("wr_boc5"), "wr_mine", "goto", "goto3");
			LAi_SetStayType(characterFromID("wr_boc5"));
		break;
//--------------------------------------------------------------------------------------------------------------------
		case "weather_dungeon4_main":
			SetCurrentTime(11.00, 0);
			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Mine Fog 1";

			Pchar.quest.mine_skeletons = "mode4";
			LAi_QuestDelay("mine_skeletons_mode4", 0.1);

			ChangeCharacterAddressGroup(characterFromID("wr_dead7"), "wr_dungeon4_main", "goto", "skel37");
			ChangeCharacterAddressGroup(characterFromID("wr_dead8"), "wr_dungeon4_main", "goto", "skel38");
			ChangeCharacterAddressGroup(characterFromID("wr_dead9"), "wr_dungeon4_main", "goto", "skel39");
			ChangeCharacterAddressGroup(characterFromID("wr_dead11"), "wr_dungeon4_main", "goto", "skel41");

			pchar.quest.weather_dungeon4_loop.win_condition.l1 = "locator";
			pchar.quest.weather_dungeon4_loop.win_condition.l1.location = "wr_dungeon4_main";
			pchar.quest.weather_dungeon4_loop.win_condition.l1.locator_group = "reload";
			pchar.quest.weather_dungeon4_loop.win_condition.l1.locator = "reload2";
			pchar.quest.weather_dungeon4_loop.win_condition = "weather_dungeon4_loop";
		break;

		case "weather_dungeon4_loop":
			SetCurrentTime(11.00, 0);
			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Mine Fog 2";

			ChangeCharacterAddressGroup(characterFromID("wr_dead7"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("wr_dead8"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("wr_dead9"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("wr_dead11"), "none", "", "");

			pchar.quest.weather_dungeon4_main.win_condition.l1 = "locator";
			pchar.quest.weather_dungeon4_main.win_condition.l1.location = "wr_dungeon4_loop";
			pchar.quest.weather_dungeon4_main.win_condition.l1.locator_group = "reload";
			pchar.quest.weather_dungeon4_main.win_condition.l1.locator = "reload3";
			pchar.quest.weather_dungeon4_main.win_condition = "weather_dungeon4_main";
		break;
//--------------------------------------------------------------------------------------------------------------------
		case "weather_redmond":
			SetCurrentTime(11.00, 0);
			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Mine Fog 1";

			pchar.quest.weather_redmond1.win_condition.l1 = "locator";
			pchar.quest.weather_redmond1.win_condition.l1.location = "wr_dungeon4_main";
			pchar.quest.weather_redmond1.win_condition.l1.locator_group = "reload";
			pchar.quest.weather_redmond1.win_condition.l1.locator = "reload4";
			pchar.quest.weather_redmond1.win_condition = "weather_redmond1";
		break;

		case "weather_redmond1":
			LAi_SetStayType(characterFromID("wr_dead1"));
			LAi_SetStayType(characterFromID("wr_dead2"));
			LAi_SetStayType(characterFromID("wr_dead3"));
			LAi_SetStayType(characterFromID("wr_dead4"));
			LAi_SetStayType(characterFromID("wr_dead5"));
			LAi_SetStayType(characterFromID("wr_dead6"));
			LAi_SetStayType(characterFromID("wr_dead7"));
			LAi_SetStayType(characterFromID("wr_dead8"));
			LAi_SetStayType(characterFromID("wr_dead9"));
			LAi_SetStayType(characterFromID("wr_dead10"));
			LAi_SetStayType(characterFromID("wr_dead11"));
			LAi_SetStayType(characterFromID("wr_dead12"));

			SetCurrentTime(7.00, 0);
			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Clear";
			LAi_QuestDelay("return_to_mine", 0.1);

			pchar.quest.weather_redmond.win_condition.l1 = "locator";
			pchar.quest.weather_redmond.win_condition.l1.location = "wr_dungeon4_main";
			pchar.quest.weather_redmond.win_condition.l1.locator_group = "reload";
			pchar.quest.weather_redmond.win_condition.l1.locator = "reload5";
			pchar.quest.weather_redmond.win_condition = "weather_redmond";
		break;
//--------------------------------------------------------------------------------------------------------------------
		case "return_to_mine":
			pchar.quest.return_to_mine1.win_condition.l1 = "locator";
			pchar.quest.return_to_mine1.win_condition.l1.location = "wr_mine";
			pchar.quest.return_to_mine1.win_condition.l1.locator_group = "goto";
			pchar.quest.return_to_mine1.win_condition.l1.locator = "goto13";
			pchar.quest.return_to_mine1.win_condition = "return_to_mine1";
		break;

		case "return_to_mine1":
			LAi_QuestDelay("watching_you_senor", 0.5);
			Locations[FindLocation("wr_dungeon3_right")].environment.sea = "true";	//tunnelB
						//for tunnelB, doesnt' help
			SetCurrentTime(11.00, 0);
			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Mine Fog 1";

			Locations[FindLocation("wr_mine")].reload.l4.disable = 1;		//tunnelZ
			Locations[FindLocation("wr_mine")].reload.l5.disable = 1;		//tunnelA

			pchar.quest.return_to_mine2.win_condition.l1 = "locator";
			pchar.quest.return_to_mine2.win_condition.l1.location = "wr_mine";
			pchar.quest.return_to_mine2.win_condition.l1.locator_group = "reload";
			pchar.quest.return_to_mine2.win_condition.l1.locator = "reload6";
			pchar.quest.return_to_mine2.win_condition = "return_to_mine2";
		break;

		case "return_to_mine2":
			SetCurrentTime(11.00, 0);
			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Mine Fog 1";
		break;
//--------------------------------------------------------------------------------------------------------------------
		case "watching_you_senor":
			PlaySound("VOICE\ENGLISH\Spa_m_a_032.wav");
			LAi_QuestDelay("watching_you_senor1", 2.0);
		break;

		case "watching_you_senor1":
			PlaySound("INTERFACE\key_lock.wav");
		break;
//--------------------------------------------------------------------------------------------------------------------
		case "close_niche_qbook":
			Logit(LanguageConvertString(tmpLangFileID,"The niche stays open now but how can I reach the Chest?"));
			CloseQuestHeader("Open_the_niche");
			SetQuestHeader("Open_the_chest");
			AddQuestRecord("Open_the_chest", "1");

			LAi_QuestDelay("monkey_swim_hint1", 2.0);
		break;

		case "monkey_swim_hint1":
			Pchar.quest.monkey_swim_hint = "done";
			SetModel(characterFromID("Powdermonkey"), "monkey", "monkey", "monkey", 1.8, false);
			ChangeCharacterAddressGroup(CharacterFromID("PowderMonkey"), "wr_prison", "goto", "goto7");
			LAi_SetActorType(characterFromID("powdermonkey"));

			PlaySound("OBJECTS\DUEL\monkey_attack1.wav");

			LAi_QuestDelay("monkey_swim_hint2", 1.0);
		break;

		case "monkey_swim_hint2":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box8");

			LAi_QuestDelay("monkey_swim_hint3", 1.0);
		break;

		case "monkey_swim_hint3":
			LAi_SetActorType(characterFromID("powdermonkey"));
			LAi_ActorGoToLocator(characterFromID("PowderMonkey"), "reload", "reload13", "", "");

			LAi_QuestDelay("monkey_swim_hint4", 2.0);
		break;

		case "monkey_swim_hint4":
			Logit(LanguageConvertString(tmpLangFileID,"Never mind - let's see what that Monkey is up to..."));
			AddQuestRecord("Open_the_chest", "2");

			PlaySound("VOICE\ENGLISH\blaze_mhm.wav");
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(CharacterFromID("PowderMonkey"), "none", "", "");

			LAi_QuestDelay("before_swim", 0.1);
		break;

		case "before_swim":
			//story continues from "steplock_B_barrel1"
			SetModel(characterFromID("Powdermonkey"), "monkey", "monkey", "monkey", 1.8, false);
			ChangeCharacterAddressGroup(CharacterFromID("PowderMonkey"), "wr_mine", "goto", "monkey");
			LAi_SetActorType(characterFromID("powdermonkey"));//stops from attacking

			pchar.quest.before_swim1.win_condition.l1 = "locator";
			pchar.quest.before_swim1.win_condition.l1.location = "wr_mine";
			pchar.quest.before_swim1.win_condition.l1.locator_group = "goto";
			pchar.quest.before_swim1.win_condition.l1.locator = "goto2";		//was goto4
			pchar.quest.before_swim1.win_condition = "before_swim1";
		break;

		case "before_swim1":
			if(CheckAttribute(Pchar,"quest.swimtime") && Pchar.quest.swimtime == "yes")
			{
				PlaySound("OBJECTS\DUEL\monkey_hit1.wav");
			}

		    	pchar.quest.after_swim.win_condition.l1 = "locator";
			pchar.quest.after_swim.win_condition.l1.location = "wr_dungeon3_left";
			pchar.quest.after_swim.win_condition.l1.locator_group = "goto";
			pchar.quest.after_swim.win_condition.l1.locator = "new_shaft";
			pchar.quest.after_swim.win_condition = "after_swim";
		break;

		case "after_swim":
		    	PlaySound("VOICE\ENGLISH\blaze_mhm.wav");
			Logit(LanguageConvertString(tmpLangFileID,"I'm gonna search this new shaft thoroughly at low tide!"));
			AddQuestRecord("Open_the_chest", "3");

			pchar.quest.after_swim1.win_condition.l1 = "locator";
			pchar.quest.after_swim1.win_condition.l1.location = "wr_dungeon3_left";
			pchar.quest.after_swim1.win_condition.l1.locator_group = "reload";
			pchar.quest.after_swim1.win_condition.l1.locator = "reload7";
			pchar.quest.after_swim1.win_condition = "after_swim1";
		break;

		case "after_swim1":
			Pchar.quest.swimming = "now";

			Locations[FindLocation("wr_prison_guard")].reload.l2.disable = 1;	//locked guard to mine
			Locations[FindLocation("wr_mine")].reload.l3.disable = 1;		//and back

			pchar.quest.after_swim2_A.win_condition.l1 = "locator";
			pchar.quest.after_swim2_A.win_condition.l1.location = "wr_dungeon3_right";
			pchar.quest.after_swim2_A.win_condition.l1.locator_group = "reload";
			pchar.quest.after_swim2_A.win_condition.l1.locator = "reload2";
			pchar.quest.after_swim2_A.win_condition = "after_swim2";
		break;

		case "after_swim2":
			Pchar.quest.swimming = "done";
			Pchar.quest.swimtime = "no";

			Locations[FindLocation("wr_dungeon3_left")].environment.weather = "false";
			Locations[FindLocation("wr_dungeon3_left")].environment.sea = "false";

			Locations[FindLocation("wr_dungeon3_right")].environment.weather = "false";
			Locations[FindLocation("wr_dungeon3_right")].environment.sea = "false";

			Locations[FindLocation("wr_mine")].reload.l5.disable = 1;//tunnel2
			Locations[FindLocation("wr_mine")].models.always.locators = "Mine_l_JRH0";//mine unlit
			Locations[FindLocation("wr_mine_control")].models.always.locators = "d02_l_JRH3";//pos tunnelZ
			Locations[FindLocation("wr_dungeon3_left")].models.always.locators = "d03_l_JRH_L1";//unlit tunnelA left
			Locations[FindLocation("wr_dungeon3_right")].models.always.locators = "d03_l_JRH_R1";//unlit tunnelA right + B
			Pchar.quest.gas_level = "0";

			ChangeCharacterAddressGroup(CharacterFromID("Dave Edna"), "wr_mine", "officers", "reload2_3");
			LAi_SetStayType(characterFromID("Dave Edna"));
			ChangeCharacterAddressGroup(CharacterFromID("PowderMonkey"), "wr_mine", "reload", "reload7");

			pchar.quest.after_swim3.win_condition.l1 = "locator";
			pchar.quest.after_swim3.win_condition.l1.location = "wr_mine";
			pchar.quest.after_swim3.win_condition.l1.locator_group = "goto";
			pchar.quest.after_swim3.win_condition.l1.locator = "goto5";		//was goto2
			pchar.quest.after_swim3.win_condition = "after_swim3";

			pchar.quest.tunnel1back_loop1.win_condition.l1 = "locator";
			pchar.quest.tunnel1back_loop1.win_condition.l1.location = "wr_dungeon3_right";
			pchar.quest.tunnel1back_loop1.win_condition.l1.locator_group = "reload";
			pchar.quest.tunnel1back_loop1.win_condition.l1.locator = "reload7";
			pchar.quest.tunnel1back_loop1.win_condition = "tunnel1back_loop1";

			pchar.quest.tunnelM_loop1.win_condition.l1 = "locator";
			pchar.quest.tunnelM_loop1.win_condition.l1.location = "wr_dungeon3_right";
			pchar.quest.tunnelM_loop1.win_condition.l1.locator_group = "reload";
			pchar.quest.tunnelM_loop1.win_condition.l1.locator = "reload13";
			pchar.quest.tunnelM_loop1.win_condition = "tunnelM_loop1";
		break;

		case "after_swim3":
			LAi_SetActorType(CharacterFromID("Dave Edna"));
			LAi_ActorTurnToCharacter(CharacterFromID("Dave Edna"), Pchar);

			PlaySound("VOICE\ENGLISH\Dave_Edna_5.wav");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("after_swim4", 2.5);
		break;

		case "after_swim4":
			PlaySound("OBJECTS\DUEL\monkey_attack2.wav");

			LAi_QuestDelay("after_swim5", 1.5);
		break;

		case "after_swim5":
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
			Logit(LanguageConvertString(tmpLangFileID,"What's wrong with the lights - did the Monkey turned them out?"));
			AddQuestRecord("Open_the_chest", "4");

			LAi_SetCitizenType(characterFromID("Dave Edna"));
			LAi_SetPlayerType(Pchar);

			pchar.quest.after_swim6.win_condition.l1 = "locator";
			pchar.quest.after_swim6.win_condition.l1.location = "wr_mine_control";
			pchar.quest.after_swim6.win_condition.l1.locator_group = "reload";
			pchar.quest.after_swim6.win_condition.l1.locator = "reload1";
			pchar.quest.after_swim6.win_condition = "after_swim6";

			pchar.quest.tunnel_lowA_loop1.win_condition.l1 = "locator";
			pchar.quest.tunnel_lowA_loop1.win_condition.l1.location = "wr_dungeon4_low";
			pchar.quest.tunnel_lowA_loop1.win_condition.l1.locator_group = "reload";
			pchar.quest.tunnel_lowA_loop1.win_condition.l1.locator = "reload4";
			pchar.quest.tunnel_lowA_loop1.win_condition = "tunnel_lowA_loop1";

			pchar.quest.tunnel_lowB_loop1.win_condition.l1 = "locator";
			pchar.quest.tunnel_lowB_loop1.win_condition.l1.location = "wr_dungeon4_low";
			pchar.quest.tunnel_lowB_loop1.win_condition.l1.locator_group = "reload";
			pchar.quest.tunnel_lowB_loop1.win_condition.l1.locator = "reload5";
			pchar.quest.tunnel_lowB_loop1.win_condition = "tunnel_lowB_loop1";
		break;

		case "after_swim6":
			ChangeCharacterAddressGroup(CharacterFromID("Dave Edna"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("PowderMonkey"), "none", "", "");

			LAi_QuestDelay("equip_saw", 0.1);
		break;

		case "equip_saw":
			pchar.quest.equip_saw1.win_condition.l1 = "locator";
			pchar.quest.equip_saw1.win_condition.l1.location = "wr_dungeon4_low";
			pchar.quest.equip_saw1.win_condition.l1.locator_group = "goto";
			pchar.quest.equip_saw1.win_condition.l1.locator = "cavern";
			pchar.quest.equip_saw1.win_condition = "equip_saw0";
		break;

		case "equip_saw0":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto6");
			LAi_SetStayType(Pchar);
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("blast_dirt" , u-14.0, v, w, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("PEOPLE\cavern1.wav");

			LAi_QuestDelay("cavern_chest_go", 0.1);
			LAi_QuestDelay("equip_saw1", 1.5);
		break;

		case "equip_saw1":
			PlaySound("VOICE\ENGLISH\blaze_what_was_that.wav");

			LAi_QuestDelay("equip_saw2", 1.0);
		break;

		case "equip_saw2":
			if(CheckCharacterItem(Pchar,"bladesaw"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterbyItem(Pchar, "bladesaw");

				LAi_QuestDelay("fall_to_blue_cavern", 1.0);
			}
			else LAi_QuestDelay("equip_saw2", 0.5);//loop
		break;

		case "fall_to_blue_cavern":
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("cancloud" , u-14.0, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-12.0, v, w, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("PEOPLE\cavern2.wav");

			LAi_QuestDelay("cavern_smoke", 2.0);
			LAi_QuestDelay("cavern_smoke1", 4.0);
			LAi_QuestDelay("cavern_smoke2", 6.5);
			LAi_QuestDelay("cavern_smoke3", 8.0);
			LAi_QuestDelay("cavern_smoke4", 9.0);
			LAi_QuestDelay("cavern_smoke5", 9.5);
			LAi_QuestDelay("cavern_smoke6", 9.8);

			LAi_QuestDelay("fall_to_blue_cavern1", 11.0);
		break;

		case "cavern_smoke":
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("cancloud" , u-12.0, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-10.0, v, w, 0.0, 0.0, 0.0, sti(20) );
		break;

		case "cavern_smoke1":
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("cancloud" , u-10.0, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-8.0, v, w+0.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-7.0, v, w-0.2, 0.0, 0.0, 0.0, sti(20) );
		break;

		case "cavern_smoke2":
			LAi_SetActorType(Pchar);
			LAi_ActorAfraid(Pchar, Pchar, false);

			PlaySound("PEOPLE\cavern2_A.wav");

			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("cancloud" , u-8.0, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-6.0, v, w-0.3, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-6.0, v, w+0.3, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-5.0, v, w-0.1, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-5.0, v, w+0.1, 0.0, 0.0, 0.0, sti(20) );
		break;

		case "cavern_smoke3":
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("cancloud" , u-6.5, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-5.0, v, w-0.3, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-4.0, v, w+0.3, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-3.0, v, w-0.1, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-2.0, v, w+0.1, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-2.0, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-2.0, v, w, 0.0, 0.0, 0.0, sti(20) );
		break;

		case "cavern_smoke4":
			PlaySound("PEOPLE\cavern2_A.wav");

			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("cancloud" , u-5.0, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-4.0, v, w-0.3, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-3.0, v, w+0.3, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-4.0, v, w-0.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-3.0, v, w+0.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-2.0, v, w-0.1, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-2.0, v, w+0.1, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-1.0, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-1.0, v, w, 0.0, 0.0, 0.0, sti(20) );
		break;

		case "cavern_smoke5":
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("cancloud" , u-3.5, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-3.0, v, w-0.4, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-2.0, v, w+0.4, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-3.0, v, w-0.3, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-2.0, v, w+0.3, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-1.0, v, w-0.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-1.0, v, w+0.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-1.0, v, w-0.1, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-1.0, v, w+0.1, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );

			CreateParticleSystem("cancloud" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
		break;

		case "cavern_smoke6":
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("cancloud" , u-2.0, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-2.0, v, w-0.4, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-1.0, v, w+0.4, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-2.0, v, w-0.3, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u-1.0, v, w+0.3, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w-0.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w+0.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w-0.1, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w+0.1, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u+0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u+0.5, v, w, 0.0, 0.0, 0.0, sti(20) );

			CreateParticleSystem("cancloud" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("cancloud" , u, v, w, 0.0, 0.0, 0.0, sti(20) );
		break;

		case "fall_to_blue_cavern1":
			DoQuestReloadToLocation("wr_cavern", "goto", "goto1", "fall_to_blue_cavern2");
		break;

		case "fall_to_blue_cavern2":
			SetCurrentTime(7.00, 0);
			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Clear";

			LAi_SetSitType(Pchar);

			LAi_QuestDelay("fall_to_blue_cavern3", 0.5);
			LAi_QuestDelay("fall_to_blue_cavern3A", 1.0);
		break;

		case "fall_to_blue_cavern3A":
			PauseAllSounds();
		break;

		case "fall_to_blue_cavern3":
			PlaySound("PEOPLE\cavern3.wav");
			PlaySound("PEOPLE\cavern3.wav");
			PlaySound("PEOPLE\cavern3.wav");
			PlaySound("PEOPLE\Jump_stone.wav");

			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystemX("ball_splash", u, v-1.5, w, 0.0, 0.0, 0.0, 0);

			LAi_SetActorType(Pchar);
			LAi_ActorSetLayMode(Pchar);
			Php = LAi_GetCharacterHP(Pchar);
			Php3 = Php/3;
			LAi_ApplyCharacterDamage(Pchar, Php3);

			LAi_QuestDelay("fall_to_blue_cavern4", 2.0);
		break;

		case "fall_to_blue_cavern4":
			LAi_SetPoorType(Pchar);
			PlaySound("PEOPLE\step_water.wav");

			LAi_QuestDelay("fall_to_blue_cavern5", 1.0);
		break;

		case "fall_to_blue_cavern5":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead7.wav");

			LAi_QuestDelay("fall_to_blue_cavern6", 2.0);
		break;

		case "fall_to_blue_cavern6":
			LAi_SetPlayerType(Pchar);
			PlaySound("PEOPLE\step_water1.wav");

			LAi_QuestDelay("fall_to_blue_cavern7", 1.5);
		break;

		case "fall_to_blue_cavern7":
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");

			LAi_QuestDelay("blue_cavern_slide", 1.0);
		break;

		case "blue_cavern_slide":
			PlaySound("PEOPLE\cavern4.wav");
			PlaySound("PEOPLE\cavern2_A.wav");
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("blast_dirt" , u, v, w-0.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w+0.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w-0.1, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w+0.1, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w, 0.0, 0.0, 0.0, sti(20) );

			LAi_SetActorType(Pchar);
			LAi_ActorSetLayMode(Pchar);
			Php = LAi_GetCharacterHP(Pchar);
			Php2 = Php/2;
			LAi_ApplyCharacterDamage(Pchar, Php2);

			LAi_QuestDelay("cavern_smoke7", 2.0);
			LAi_QuestDelay("cavern_smoke8", 4.0);
			LAi_QuestDelay("cavern_smoke9", 6.0);
			LAi_QuestDelay("cavern_smoke10", 8.0);
			LAi_QuestDelay("blue_cavern_slide1", 9.0);
		break;

		case "cavern_smoke7":
			CreateParticleSystem("blast_dirt" , u, v, w-0.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w+0.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w-0.1, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w+0.1, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w, 0.0, 0.0, 0.0, sti(20) );
		break;

		case "cavern_smoke8":
			CreateParticleSystem("blast_dirt" , u, v, w-0.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w+0.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w-0.1, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w+0.1, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w, 0.0, 0.0, 0.0, sti(20) );
		break;

		case "cavern_smoke9":
			CreateParticleSystem("blast_dirt" , u, v, w-0.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w+0.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w-0.1, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w+0.1, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w, 0.0, 0.0, 0.0, sti(20) );
		break;

		case "cavern_smoke10":
			CreateParticleSystem("blast_dirt" , u, v, w-0.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w+0.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w-0.1, 0.0, 0.0, 0.0, sti(20) );
		break;

		case "blue_cavern_slide1":
			LAi_SetPoorType(Pchar);
			PlaySound("PEOPLE\step_water.wav");

			LAi_QuestDelay("blue_cavern_slide2", 1.0);
		break;

		case "blue_cavern_slide2":
			PlaySound("AMBIENT\JAIL\cough.wav");

			LAi_QuestDelay("blue_cavern_slide3", 2.0);
		break;

		case "blue_cavern_slide3":
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash1.wav");
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("pirate_captains", 0.1);//also direct from "pistol5_end3" (works from [8])
		break;

		case "pirate_captains":
			PostEvent("LoadSceneSound", 0);

			SetCharacterShipLocation(characterFromID("pir_cap1"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap2"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap3"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap4"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap5"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap6"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap7"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap8"), "wr_cave_shore");

			SetCharacterShipLocation(characterFromID("pir_cap9"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap10"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap11"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap12"), "wr_cave_shore");

			SetCharacterShipLocation(characterFromID("pir_cap13"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap14"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap15"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap16"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap17"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap18"), "wr_cave_shore");

			SetCharacterShipLocation(characterFromID("pir_cap19"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap20"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap21"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap22"), "Redmond_shore_02");
			SetCharacterShipLocation(characterFromID("pir_cap23"), "wr_cave_shore");	//ladder

			SetCharacterShipLocation(characterFromID("CoastBrother1"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother2"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother3"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother4"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother5"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother6"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother7"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother8"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother9"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother10"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother11"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother12"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother13"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother14"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother15"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother16"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother17"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother19"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother22"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother23"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother24"), "wr_cannon_tower");

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap1"), "wr_church_attic", "sit", "sit1");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap2"), "wr_church_attic", "sit", "sit3");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap3"), "wr_church_attic", "sit", "sit2");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap4"), "wr_church_attic", "sit", "stay4");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap6"), "wr_church_attic", "sit", "sit6");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap7"), "wr_church_attic", "sit", "stay7");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap8"), "wr_church_attic", "sit", "sit8");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap11"), "wr_church_attic", "sit", "sit11");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap14"), "wr_church_attic", "sit", "sit14");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap15"), "wr_church_attic", "sit", "sit15");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap16"), "wr_church_attic", "sit", "stay16");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap18"), "wr_church_attic", "sit", "stay18");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap21"), "wr_church_attic", "sit", "stay13");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap24"), "wr_church_attic", "sit", "stay20");

			//--------------------------------------------------------------------------------------------

			pchar.quest.church_attic.win_condition.l1 = "location";
			pchar.quest.church_attic.win_condition.l1.location = "wr_church_outside";
			pchar.quest.church_attic.win_condition = "church_attic";
		break;

		case "church_attic":
			//Log_SetStringToLog("reading church_attic");

			pchar.quest.church_attic1.win_condition.l1 = "locator";
			pchar.quest.church_attic1.win_condition.l1.location = "wr_church_attic";
			pchar.quest.church_attic1.win_condition.l1.locator_group = "goto";
			pchar.quest.church_attic1.win_condition.l1.locator = "goto3";
			pchar.quest.church_attic1.win_condition = "church_attic1";
		break;

		case "church_attic1":
			//Log_SetStringToLog("reading church_attic1");

			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_SetActorType(CharacterFromID("pir_cap2"));
			LAi_SetActorType(CharacterFromID("pir_cap3"));
			LAi_SetActorType(CharacterFromID("pir_cap4"));
			LAi_SetActorType(CharacterFromID("pir_cap5"));
			LAi_SetActorType(CharacterFromID("pir_cap6"));
			LAi_SetActorType(CharacterFromID("pir_cap7"));
			LAi_SetActorType(CharacterFromID("pir_cap8"));
			LAi_SetActorType(CharacterFromID("pir_cap9"));
			LAi_SetActorType(CharacterFromID("pir_cap10"));
			LAi_SetActorType(CharacterFromID("pir_cap11"));
			LAi_SetActorType(CharacterFromID("pir_cap14"));
			LAi_SetActorType(CharacterFromID("pir_cap15"));
			LAi_SetActorType(CharacterFromID("pir_cap16"));
			LAi_SetActorType(CharacterFromID("pir_cap17"));
			LAi_SetActorType(CharacterFromID("pir_cap18"));
			LAi_SetActorType(CharacterFromID("pir_cap20"));
			LAi_SetActorType(CharacterFromID("pir_cap21"));
			LAi_SetActorType(CharacterFromID("pir_cap22"));
			LAi_SetActorType(CharacterFromID("pir_cap23"));
			LAi_SetActorType(CharacterFromID("pir_cap24"));

			//---------------------------------------------

			LAi_SetActorType(CharacterFromID("pir_cap26"));
			LAi_SetActorType(CharacterFromID("pir_cap27"));
			LAi_SetActorType(CharacterFromID("pir_cap28"));
			LAi_SetActorType(CharacterFromID("pir_cap29"));
			LAi_SetActorType(CharacterFromID("pir_cap30"));
			LAi_SetActorType(CharacterFromID("pir_cap31"));
			LAi_SetActorType(CharacterFromID("pir_cap32"));


			LAi_ActorTurnToLocator(characterFromID("pir_cap1"), "goto", "goto11");
			LAi_ActorTurnToCharacter(characterFromID("pir_cap2"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap3"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap4"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap5"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap6"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap7"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap8"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap9"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap10"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap11"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap14"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap15"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap16"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap17"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap18"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap20"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap21"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap22"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap23"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap24"), Pchar);

			//------------------------------------------------------------

			LAi_ActorTurnToCharacter(characterFromID("pir_cap26"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap27"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap28"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap29"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap30"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap31"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap32"), Pchar);

			LAi_SetSitType(CharacterFromID("pir_cap1"));
			LAi_SetStayType(CharacterFromID("pir_cap2"));
			LAi_SetStayType(CharacterFromID("pir_cap3"));
			LAi_SetStayType(CharacterFromID("pir_cap4"));
			LAi_SetStayType(CharacterFromID("pir_cap5"));
			LAi_SetStayType(CharacterFromID("pir_cap6"));
			LAi_SetStayType(CharacterFromID("pir_cap7"));
			LAi_SetStayType(CharacterFromID("pir_cap8"));
			LAi_SetStayType(CharacterFromID("pir_cap9"));
			LAi_SetStayType(CharacterFromID("pir_cap10"));
			LAi_SetStayType(CharacterFromID("pir_cap11"));
			LAi_SetStayType(CharacterFromID("pir_cap14"));
			LAi_SetStayType(CharacterFromID("pir_cap15"));
			LAi_SetStayType(CharacterFromID("pir_cap16"));
			LAi_SetStayType(CharacterFromID("pir_cap17"));
			LAi_SetStayType(CharacterFromID("pir_cap18"));
			LAi_SetStayType(CharacterFromID("pir_cap20"));
			LAi_SetStayType(CharacterFromID("pir_cap21"));
			LAi_SetStayType(CharacterFromID("pir_cap22"));
			LAi_SetStayType(CharacterFromID("pir_cap23"));
			LAi_SetStayType(CharacterFromID("pir_cap24"));

			//--------------------------------------------

			LAi_SetStayType(CharacterFromID("pir_cap26"));
			LAi_SetStayType(CharacterFromID("pir_cap27"));
			LAi_SetStayType(CharacterFromID("pir_cap28"));
			LAi_SetStayType(CharacterFromID("pir_cap29"));
			LAi_SetStayType(CharacterFromID("pir_cap30"));
			LAi_SetStayType(CharacterFromID("pir_cap31"));
			LAi_SetStayType(CharacterFromID("pir_cap32"));

			LAi_QuestDelay("church_attic_sound", 1.0);

			pchar.quest.church_attic_sound3.win_condition.l1 = "locator";
			pchar.quest.church_attic_sound3.win_condition.l1.location = "wr_church_attic";
			pchar.quest.church_attic_sound3.win_condition.l1.locator_group = "goto";
			pchar.quest.church_attic_sound3.win_condition.l1.locator = "goto4";
			pchar.quest.church_attic_sound3.win_condition = "church_attic_sound3";
		break;

		case "church_attic_sound":
			PlaySound("INTERFACE\closed_door.wav");

			LAi_QuestDelay("church_attic_sound1", 0.5);
		break;

		case "church_attic_sound1":
			PlaySound("AMBIENT\pirate_captains.wav");

			LAi_QuestDelay("church_attic_sound2", 2.5);
		break;

		case "church_attic_sound2":
			PlaySound("VOICE\ENGLISH\pir_capDD.wav");
		break;

		case "church_attic_sound3":
			PlaySound("VOICE\ENGLISH\pir_capP.wav");

			pchar.quest.church_attic4.win_condition.l1 = "locator";
			pchar.quest.church_attic4.win_condition.l1.location = "wr_church_attic";
			pchar.quest.church_attic4.win_condition.l1.locator_group = "goto";
			pchar.quest.church_attic4.win_condition.l1.locator = "goto11";
			pchar.quest.church_attic4.win_condition = "church_attic4";
		break;

		case "church_attic2":
			//from itemlogic
			LAi_SetActorType(CharacterFromID("pir_cap2"));
			LAi_SetActorType(CharacterFromID("pir_cap3"));
			LAi_SetActorType(CharacterFromID("pir_cap4"));
			LAi_SetActorType(CharacterFromID("pir_cap5"));
			LAi_SetActorType(CharacterFromID("pir_cap6"));
			LAi_SetActorType(CharacterFromID("pir_cap7"));
			LAi_SetActorType(CharacterFromID("pir_cap8"));
			LAi_SetActorType(CharacterFromID("pir_cap9"));
			LAi_SetActorType(CharacterFromID("pir_cap10"));
			LAi_SetActorType(CharacterFromID("pir_cap11"));
			LAi_SetActorType(CharacterFromID("pir_cap14"));
			LAi_SetActorType(CharacterFromID("pir_cap15"));
			LAi_SetActorType(CharacterFromID("pir_cap16"));
			LAi_SetActorType(CharacterFromID("pir_cap17"));
			LAi_SetActorType(CharacterFromID("pir_cap18"));
			LAi_SetActorType(CharacterFromID("pir_cap20"));
			LAi_SetActorType(CharacterFromID("pir_cap21"));
			LAi_SetActorType(CharacterFromID("pir_cap22"));
			LAi_SetActorType(CharacterFromID("pir_cap23"));
			LAi_SetActorType(CharacterFromID("pir_cap24"));

			//---------------------------------------------

			LAi_SetActorType(CharacterFromID("pir_cap26"));
			LAi_SetActorType(CharacterFromID("pir_cap27"));
			LAi_SetActorType(CharacterFromID("pir_cap28"));
			LAi_SetActorType(CharacterFromID("pir_cap29"));
			LAi_SetActorType(CharacterFromID("pir_cap30"));
			LAi_SetActorType(CharacterFromID("pir_cap31"));
			LAi_SetActorType(CharacterFromID("pir_cap32"));

			LAi_ActorTurnToCharacter(characterFromID("pir_cap2"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap3"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap4"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap5"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap6"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap7"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap8"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap9"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap10"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap11"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap14"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap15"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap16"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap17"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap18"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap20"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap21"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap22"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap23"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap24"), Pchar);

			//------------------------------------------------------------

			LAi_ActorTurnToCharacter(characterFromID("pir_cap26"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap27"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap28"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap29"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap30"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap31"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("pir_cap32"), Pchar);

			LAi_SetStayType(CharacterFromID("pir_cap2"));
			LAi_SetStayType(CharacterFromID("pir_cap3"));
			LAi_SetStayType(CharacterFromID("pir_cap4"));
			LAi_SetStayType(CharacterFromID("pir_cap5"));
			LAi_SetStayType(CharacterFromID("pir_cap6"));
			LAi_SetStayType(CharacterFromID("pir_cap7"));
			LAi_SetStayType(CharacterFromID("pir_cap8"));
			LAi_SetStayType(CharacterFromID("pir_cap9"));
			LAi_SetStayType(CharacterFromID("pir_cap10"));
			LAi_SetStayType(CharacterFromID("pir_cap11"));
			LAi_SetStayType(CharacterFromID("pir_cap14"));
			LAi_SetStayType(CharacterFromID("pir_cap15"));
			LAi_SetStayType(CharacterFromID("pir_cap16"));
			LAi_SetStayType(CharacterFromID("pir_cap17"));
			LAi_SetStayType(CharacterFromID("pir_cap18"));
			LAi_SetStayType(CharacterFromID("pir_cap20"));
			LAi_SetStayType(CharacterFromID("pir_cap21"));
			LAi_SetStayType(CharacterFromID("pir_cap22"));
			LAi_SetStayType(CharacterFromID("pir_cap23"));
			LAi_SetStayType(CharacterFromID("pir_cap24"));

			//--------------------------------------------

			LAi_SetStayType(CharacterFromID("pir_cap26"));
			LAi_SetStayType(CharacterFromID("pir_cap27"));
			LAi_SetStayType(CharacterFromID("pir_cap28"));
			LAi_SetStayType(CharacterFromID("pir_cap29"));
			LAi_SetStayType(CharacterFromID("pir_cap30"));
			LAi_SetStayType(CharacterFromID("pir_cap31"));
			LAi_SetStayType(CharacterFromID("pir_cap32"));
		break;

		case "church_attic4":
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap1"), "wr_church_attic", "sit", "stay1");
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorTurnToCharacter(characterFromID("pir_cap1"), Pchar);

			LAi_QuestDelay("church_attic5", 1.0);
		break;

		case "church_attic5":
			PlaySound("OBJECTS\SHIPCHARGE\gunner_fire.wav");

			LAi_QuestDelay("church_attic8", 1.0);
		break;

		case "church_attic8":
			LAi_SetStayType(CharacterFromID("pir_cap1"));

			LAi_SetActorType(CharacterFromID("pir_cap3"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap3"), "sit", "sit1");
			LAi_SetStayType(CharacterFromID("pir_cap3"));

			LAi_SetActorType(CharacterFromID("pir_cap2"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap2"), "goto", "locator9");
			LAi_SetStayType(CharacterFromID("pir_cap2"));

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap4"), "wr_church_attic", "sit", "sit4");
			LAi_SetActorType(CharacterFromID("pir_cap4"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap4"), "sit", "sit9");
			LAi_SetSitType(CharacterFromID("pir_cap4"));

			LAi_SetStayType(CharacterFromID("pir_cap5"));
			LAi_SetPoorType(CharacterFromID("pir_cap8"));

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap7"), "wr_church_attic", "sit", "sit7");
			LAi_SetSitType(CharacterFromID("pir_cap7"));

			LAi_SetActorType(CharacterFromID("pir_cap9"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap9"), "sit", "sit1");
			LAi_SetPoorType(CharacterFromID("pir_cap9"));

			LAi_SetActorType(CharacterFromID("pir_cap10"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap10"), "sit", "sit2");
			LAi_SetPoorType(CharacterFromID("pir_cap10"));

			LAi_SetActorType(CharacterFromID("pir_cap11"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap11"), "sit", "sit2");
			LAi_SetStayType(CharacterFromID("pir_cap11"));

			LAi_SetActorType(CharacterFromID("pir_cap14"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap14"), "sit", "sit11");
			LAi_SetPoorType(CharacterFromID("pir_cap14"));

			LAi_SetActorType(CharacterFromID("pir_cap15"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap15"), "sit", "sit8");
			LAi_SetPoorType(CharacterFromID("pir_cap15"));

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap16"), "wr_church_attic", "sit", "sit16");
			LAi_SetActorType(CharacterFromID("pir_cap16"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap16"), "goto", "goto10");
			LAi_SetSitType(CharacterFromID("pir_cap16"));

			LAi_SetActorType(CharacterFromID("pir_cap17"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap17"), "sit", "sit13");
			LAi_SetPoorType(CharacterFromID("pir_cap17"));

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap18"), "wr_church_attic", "sit", "sit18");
			LAi_SetActorType(CharacterFromID("pir_cap18"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap18"), "goto", "goto2");
			LAi_SetSitType(CharacterFromID("pir_cap18"));

			LAi_SetActorType(CharacterFromID("pir_cap20"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap20"), "sit", "sit16");
			LAi_SetStayType(CharacterFromID("pir_cap20"));

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap21"), "wr_church_attic", "sit", "sit13");
			LAi_SetActorType(CharacterFromID("pir_cap21"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap21"), "sit", "sit17");
			LAi_SetSitType(CharacterFromID("pir_cap21"));

			LAi_SetActorType(CharacterFromID("pir_cap22"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap22"), "sit", "sit8");
			LAi_SetPoorType(CharacterFromID("pir_cap22"));

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap23"), "wr_church_attic", "sit", "sit21");
			LAi_SetActorType(CharacterFromID("pir_cap23"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap23"), "sit", "sit10");
			LAi_SetPoorType(CharacterFromID("pir_cap23"));

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap24"), "wr_church_attic", "sit", "sit20");
			LAi_SetActorType(CharacterFromID("pir_cap24"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap24"), "sit", "sit18");
			LAi_SetSitType(CharacterFromID("pir_cap24"));

			//-------------------------------------------------------------------------------------------

			LAi_SetStayType(CharacterFromID("pir_cap26"));

			LAi_SetActorType(CharacterFromID("pir_cap27"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap27"), "sit", "sit28");
			LAi_SetPoorType(CharacterFromID("pir_cap27"));

			LAi_SetActorType(CharacterFromID("pir_cap28"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap28"), "sit", "sit26");
			LAi_SetPoorType(CharacterFromID("pir_cap28"));

			LAi_SetPoorType(CharacterFromID("pir_cap29"));
			LAi_SetStayType(CharacterFromID("pir_cap30"));
			LAi_SetPoorType(CharacterFromID("pir_cap31"));
			LAi_SetStayType(CharacterFromID("pir_cap32"));

			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "who_are_you";
		break;

		case "tell_your_story_done":
			LAi_SetActorType(CharacterFromID("pir_cap1"));//not talkable!
			PlaySound("AMBIENT\pirate_captains.wav");

			LAi_QuestDelay("tell_your_story_done1", 3.0);	//was 4.0
		break;

		case "tell_your_story_done1":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "tell_your_story2";
		break;

		case "tell_your_story2_done":
			//a fake fade out - fade in
			Locations[FindLocation("wr_church_attic")].image = "";
			DoQuestReloadToLocation("wr_church_attic", "goto", "goto11", "tell_your_story2_done1");
		break;

		case "tell_your_story2_done1":
			Locations[FindLocation("wr_church_attic")].image = "wr_church_attic.tga";

			LAi_SetActorType(CharacterFromID("pir_cap3"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap3"), "sit", "sit1");
			LAi_SetStayType(CharacterFromID("pir_cap3"));

			LAi_SetActorType(CharacterFromID("pir_cap2"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap2"), "goto", "locator9");
			LAi_SetStayType(CharacterFromID("pir_cap2"));

			LAi_SetActorType(CharacterFromID("pir_cap4"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap4"), "sit", "sit9");
			LAi_SetSitType(CharacterFromID("pir_cap4"));

			LAi_SetStayType(CharacterFromID("pir_cap5"));
			LAi_SetPoorType(CharacterFromID("pir_cap8"));

			LAi_SetActorType(CharacterFromID("pir_cap9"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap9"), "sit", "sit1");
			LAi_SetPoorType(CharacterFromID("pir_cap9"));

			LAi_SetActorType(CharacterFromID("pir_cap10"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap10"), "sit", "sit2");
			LAi_SetPoorType(CharacterFromID("pir_cap10"));

			LAi_SetActorType(CharacterFromID("pir_cap11"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap11"), "sit", "sit2");
			LAi_SetStayType(CharacterFromID("pir_cap11"));

			LAi_SetActorType(CharacterFromID("pir_cap14"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap14"), "sit", "sit11");
			LAi_SetPoorType(CharacterFromID("pir_cap14"));

			LAi_SetActorType(CharacterFromID("pir_cap15"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap15"), "sit", "sit8");
			LAi_SetPoorType(CharacterFromID("pir_cap15"));

			LAi_SetActorType(CharacterFromID("pir_cap16"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap16"), "goto", "goto10");
			LAi_SetSitType(CharacterFromID("pir_cap16"));

			LAi_SetActorType(CharacterFromID("pir_cap17"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap17"), "sit", "sit13");
			LAi_SetPoorType(CharacterFromID("pir_cap17"));

			LAi_SetActorType(CharacterFromID("pir_cap18"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap18"), "goto", "goto2");
			LAi_SetSitType(CharacterFromID("pir_cap18"));

			LAi_SetActorType(CharacterFromID("pir_cap20"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap20"), "sit", "sit16");
			LAi_SetStayType(CharacterFromID("pir_cap20"));

			LAi_SetActorType(CharacterFromID("pir_cap21"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap21"), "sit", "sit17");
			LAi_SetSitType(CharacterFromID("pir_cap21"));

			LAi_SetActorType(CharacterFromID("pir_cap22"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap22"), "sit", "sit8");
			LAi_SetPoorType(CharacterFromID("pir_cap22"));

			LAi_SetActorType(CharacterFromID("pir_cap23"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap23"), "sit", "sit10");
			LAi_SetPoorType(CharacterFromID("pir_cap23"));

			LAi_SetActorType(CharacterFromID("pir_cap24"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap24"), "sit", "sit18");
			LAi_SetSitType(CharacterFromID("pir_cap24"));

			//-------------------------------------------------------------------

			LAi_SetActorType(CharacterFromID("pir_cap27"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap27"), "sit", "sit28");
			LAi_SetPoorType(CharacterFromID("pir_cap27"));

			LAi_SetActorType(CharacterFromID("pir_cap28"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap28"), "sit", "sit26");
			LAi_SetPoorType(CharacterFromID("pir_cap28"));

			LAi_SetActorType(CharacterFromID("pir_cap32"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap32"), "sit", "sit28");


			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "tell_your_story3";
		break;

		case "tell_your_story3_done":
			PlaySound("VOICE\ENGLISH\pir_capD.wav");

			LAi_QuestDelay("what_to_do", 2.0);//was 3.0
		break;

		case "what_to_do":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "what_to_do";
		break;

		case "what_to_do_done":
			LAi_SetActorType(CharacterFromID("pir_cap1"));//not talkable!
			PlaySound("VOICE\ENGLISH\pir_capI.wav");

			LAi_QuestDelay("church_attic_sound5", 2.5);
		break;

		case "church_attic_sound5":
			PlaySound("OBJECTS\ABORDAGE\abordage_wining.wav");

			LAi_QuestDelay("medicine_talk", 4.0);
		break;

		case "medicine_talk":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "medicine_talk";
		break;

		case "medicine_talk2_done":
			LAi_SetActorType(CharacterFromID("pir_cap1"));//not talkable!
			PlaySound("OBJECTS\SHIPCHARGE\hurrah.wav");

			LAi_QuestDelay("medicine_talk3", 1.0);
		break;

		case "medicine_talk3":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "medicine_talk3";
		break;

		case "medicine_quest_no":
			PlaySound("OBJECTS\duel\pistol_big.wav");

			LAi_QuestDelay("medicine_quest_no1", 0.5);
		break;

		case "medicine_quest_no1":
			PlaySound("OBJECTS\duel\pistol_grape.wav");
			LAi_KillCharacter(Pchar);

			LAi_QuestDelay("medicine_quest_no2", 4.0);
		break;

		case "medicine_quest_no2":
			GameOverOrg("land");
		break;

		case "medicine_quest_yes4_done":
			SetQuestHeader("Charles_Vanes_quest");
			AddQuestRecord("Charles_Vanes_quest", "1");
			AddQuestRecord("Charles_Vanes_quest", "8");
			PlaySound("VOICE\ENGLISH\pir_capEE.wav");

			LAi_QuestDelay("medicine_quest_yes4_done1", 2.0);
		break;

		case "medicine_quest_yes4_done1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto4");

			LAi_QuestDelay("medicine_quest_yes4_done2", 2.0);
		break;

		case "medicine_quest_yes4_done2":
			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("wr_church_attic_stairs")].reload.l2.disable = 1;	//to attic
			Locations[FindLocation("wr_church_inside")].reload.l8.disable = 0;		//chapel stairs
			locations[FindLocation("wr_chapel_stairs")].id.label = "Chapel stairs";
			PlaySound("PEOPLE\Run_roof.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_church_attic", "reload", "reload4");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap19"), "wr_church_inside", "goto", "goto11");//crew

			LAi_QuestDelay("chapel_prisoners", 1.5);
		break;

		case "chapel_prisoners":
			PlaySound("VOICE\ENGLISH\pir_capZ.wav");

			pchar.quest.chapel_prisoners1.win_condition.l1 = "locator";
			pchar.quest.chapel_prisoners1.win_condition.l1.location = "wr_church_attic_stairs";
			pchar.quest.chapel_prisoners1.win_condition.l1.locator_group = "goto";
			pchar.quest.chapel_prisoners1.win_condition.l1.locator = "attic";		//was reload2
			pchar.quest.chapel_prisoners1.win_condition = "chapel_prisoners1";
		break;

		case "chapel_prisoners1":
			PlaySound("INTERFACE\closed_locked_door.wav");

			LAi_SetCitizenType(CharacterFromID("wr_bri"));
			ChangeCharacterAddressGroup(CharacterFromID("wr_bri"), "wr_chapel", "goto", "goto10");
			RemoveCharacterEquip(CharacterFromID("wr_bri"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(CharacterFromID("wr_bri"), "blade4");

			LAi_SetSitType(CharacterFromID("Defoe_incognito"));
			ChangeCharacterAddressGroup(CharacterFromID("Defoe_incognito"), "wr_chapel", "sit", "sit18");
			RemoveCharacterEquip(CharacterFromID("Defoe_incognito"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(CharacterFromID("Defoe_incognito"), "pistol201");

			ChangeCharacterAddressGroup(CharacterFromID("Sarah Fitter"), "none", "", "");//real Sarah removed
			ChangeCharacterAddressGroup(CharacterFromID("Laurence Wellman"), "none", "", "");//real Wellman removed
			ChangeCharacterAddressGroup(CharacterFromID("Father Bernard"), "none", "", "");//real Bernard removed

			pchar.quest.chapel_prisoners2.win_condition.l1 = "location";
			pchar.quest.chapel_prisoners2.win_condition.l1.location = "wr_chapel";
			pchar.quest.chapel_prisoners2.win_condition = "chapel_prisoners2";
		break;

		case "chapel_prisoners2":
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap12"), "wr_church_outside", "goto", "goto2");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap25"), "Redmond_shore_02", "goto", "goto10");
			locations[FindLocation("wr_cavern")].reload.l2.disable = 0;//open to shore

			Locations[FindLocation("Redmond_town_exit_2")].reload.l1.disable = 1;	//to town
			Locations[FindLocation("Redmond_shore_02")].models.always.locators = "shore03_l_JRH";

			Locations[FindLocation("wr_dungeon4_main")].environment.weather = "false";
			Locations[FindLocation("wr_dungeon4_main")].environment.sea = "false";
			Locations[FindLocation("wr_dungeon4_loop")].environment.weather = "false";
			Locations[FindLocation("wr_dungeon4_loop")].environment.sea = "false";

			ChangeCharacterAddressGroup(CharacterFromID("Red_guard_1"), "Redmond_town_exit_2", "goto", "goto11");
			ChangeCharacterAddressGroup(CharacterFromID("Red_guard_2"), "Redmond_town_exit_2", "goto", "goto12");

			Locations[FindLocation("wr_dungeon4_main")].models.always.locators = "d04_l_JRH_OFF2";
			Locations[FindLocation("wr_dungeon4_loop")].models.always.locators = "d04_l_JRH_OFF2";
			Locations[FindLocation("wr_prison_guard")].models.always.locators = "Hut_locators_JRH2";//fallen chair
			Locations[FindLocation("wr_prison_guard")].reload.l3.disable = 0;			//to tunnelZ loop
			Locations[FindLocation("wr_prison_guard")].locators_radius.reload.reload3 = 0.5;	//floor hatch

			Pchar.quest.mine_skeletons = "mode5";
			LAi_QuestDelay("mine_skeletons_mode5", 0.1);

			pchar.quest.chapel_prisoners3.win_condition.l1 = "locator";
			pchar.quest.chapel_prisoners3.win_condition.l1.location = "wr_chapel";
			pchar.quest.chapel_prisoners3.win_condition.l1.locator_group = "goto";
			pchar.quest.chapel_prisoners3.win_condition.l1.locator = "goto13";
			pchar.quest.chapel_prisoners3.win_condition = "chapel_prisoners3";
		break;

		case "chapel_prisoners3":
			LAi_SetActorType(CharacterFromID("fake_Silehard"));
			LAi_ActorDialog(characterFromID("fake_Silehard"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("fake_Silehard"));
			Characters[GetCharacterIndex("fake_Silehard")].dialog.CurrentNode  = "chapel_prisoners";
		break;

		case "chapel_prisoners_done":
			//from prisoner Silehard dialog
			LAi_SetHuberStayType(CharacterFromID("fake_Silehard"));

			pchar.quest.back_in_prison.win_condition.l1 = "location";
			pchar.quest.back_in_prison.win_condition.l1.location = "wr_prison";
			pchar.quest.back_in_prison.win_condition = "back_in_prison";
		break;

		case "back_in_prison":
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
			Logit(LanguageConvertString(tmpLangFileID,"Wonder what I'm supposed to do with that Saw?"));
			AddQuestRecord("Open_the_chest", "5");
		break;
//-----------------------------------------------------------------------------------------------------------------------------
		case "bsw_ready_for_exit":
			//from "steplock_A_plank_barrel1"
			ChangeCharacterAddressGroup(characterFromID("wr_boc5"), "wr_mine", "officers", "reload2_1");
			LAi_SetStayType(characterFromID("wr_boc5"));
			Locations[FindLocation("wr_mine")].locators_radius.officers.reload2_1 = 2.0;
			Locations[FindLocation("wr_mine")].locators_radius.goto.goto2 = 0.5;
			Locations[FindLocation("wr_dungeon3_left")].models.always.locators = "d03_l_JRH_L1";
			Locations[FindLocation("wr_dungeon3_right")].models.always.locators = "d03_l_JRH_R1";
			Locations[FindLocation("wr_mine")].models.always.locators = "Mine_l_JRH1";
			Locations[FindLocation("wr_mine_control")].models.always.locators = "d02_l_JRH1_F";
			Locations[FindLocation("wr_mine")].reload.l7.disable = 1;		//to mine control room
			Locations[FindLocation("wr_mine")].reload.l5.disable = 1;		//to tunnelA
			Locations[FindLocation("wr_mine")].reload.l1.disable = 1;		//to food cellar

			pchar.quest.bsw_ready_for_exit1.win_condition.l1 = "locator";
			pchar.quest.bsw_ready_for_exit1.win_condition.l1.location = "wr_mine";
			pchar.quest.bsw_ready_for_exit1.win_condition.l1.locator_group = "officers";
			pchar.quest.bsw_ready_for_exit1.win_condition.l1.locator = "reload2_1";
			pchar.quest.bsw_ready_for_exit1.win_condition = "bsw_ready_for_exit1";
		break;

		case "bsw_ready_for_exit1":
			LAi_SetActorType(CharacterFromID("wr_boc5"));
			LAi_ActorDialog(characterFromID("wr_boc5"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wr_boc5"));
			Characters[GetCharacterIndex("wr_boc5")].dialog.CurrentNode  = "mine_exit";
		break;

		case "mine_exit_done":
			//from bsw dialog
			LAi_SetStayType(Pchar);
			TakeItemFromCharacter(Pchar, "jewelry5");
			PlaySound("VOICE\ENGLISH\Spa_m_a_042.wav");

			LAi_QuestDelay("mine_exit_done1", 1.0);
		break;

		case "mine_exit_done1":
			LAi_SetActorType(CharacterFromID("wr_boc5"));
			LAi_ActorGoToLocator(CharacterFromID("wr_boc5"), "reload", "reload2", "mine_exit_done2", 2.0);
		break;

		case "mine_exit_done2":
			LAi_SetStayType(CharacterFromID("wr_boc5"));
			PlaySound("INTERFACE\key_unlock.wav");

			Locations[FindLocation("wr_mine")].reload.l2.go = "Loanshark_cellar";
			Locations[FindLocation("wr_mine")].reload.l2.emerge = "reload1";
			Locations[FindLocation("wr_mine")].reload.l2.label = "Loanshark cellar.";
			Locations[FindLocation("wr_mine")].reload.l2.disable = 0;
			Locations[FindLocation("Loanshark_cellar")].reload.l1.disable = 0;
			locations[FindLocation("Loanshark_cellar")].id.label = "Loanshark cellar";
			Locations[FindLocation("Redmond_UsurerHouse")].models.always.locators = "ss_l_JRH3";
			LAi_SetPlayerType(Pchar);
			SetCurrentTime(9.00, 0);
			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Clear";
			Locations[FindLocation("Redmond_Town_01")].models.always.locators = "Red01_l_JRH5";	//bridge visible + exit backdoor loanshark
			ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "Redmond_Town_01", "goto", "goto29");
			LAi_SetStayType(CharacterFromID("Woodes Rogers"));

			LAi_QuestDelay("rogers_talks_medicine", 1.0);
		break;

//[9] starts with "rogers_talks_medicine"
		case "rogers_talks_medicine":
			Locations[FindLocation("Redmond_shore_02")].models.always.locators = "shore03_l";	//no tartane until meds are collected
		Locations[FindLocation("Redmond_Town_01")].image = "Town_Redmond_Town_01.tga";	//was missing
			Locations[FindLocation("Redmond_Town_01")].reload.l10.disable = 0;	//to loanshark
			Locations[FindLocation("Redmond_Town_01")].reload.l20.disable = 0;	//to loanshark nackdoor
			Locations[FindLocation("Redmond_Town_01")].reload.l11.disable = 0;	//to tavern
			Locations[FindLocation("Redmond_town_01")].reload.l31.disable = 0;	//to tavern from balcony
			Locations[FindLocation("Redmond_Town_01")].reload.l13.disable = 1;	//to governor (kidnapped)
			Locations[FindLocation("Redmond_Town_01")].reload.l16.go = "WR_kitchen";
			Locations[FindLocation("Redmond_Town_01")].reload.l16.emerge = "reload1";
			Locations[FindLocation("Redmond_Town_01")].reload.l16.label = "Woodes Rogers' kitchen.";
			Locations[FindLocation("Redmond_Town_01")].reload.l16.disable = 0;	//to kitchen
			Locations[FindLocation("Redmond_Town_01")].reload.l23.disable = 1;	//to terrace
			Locations[FindLocation("Redmond_Town_01")].reload.l26.disable = 0;	//to tavern storeroom
			Locations[FindLocation("Redmond_Town_01")].reload.l27.disable = 0;	//to shop
			Locations[FindLocation("Redmond_Town_01")].reload.l18.disable = 1;	//window to residence
			Locations[FindLocation("Redmond_Town_04")].reload.l19.disable = 0;	//crew
			Locations[FindLocation("Redmond_Port")].reload.l6.disable = 1;		//to Harbor master (kidnapped)
			Locations[FindLocation("Redmond_town_exit_2")].models.always.locators = "redexit2_l";	//no well entrance any longer
			Locations[FindLocation("Redmond_town_exit_2")].reload.l1.disable = 0;	//to town
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l2.disable = 1;	//to shop
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l3.disable = 1;	//to library
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l6.disable = 0;	//hatch LS cellar
			Locations[FindLocation("Loanshark_cellar")].reload.l1.disable = 1;	//to mine
			Locations[FindLocation("wr_residence")].models.always.locators = "Res01_l_JRH2";
			Locations[FindLocation("wr_residence")].reload.l1.disable = 1;		//to terrace
			Locations[FindLocation("wr_residence")].reload.l7.disable = 1;		//to armory
			Locations[FindLocation("wr_residence")].reload.l3.disable = 0;//window
			Locations[FindLocation("Redmond_town_01")].reload.l18.disable = 0;//window
			Locations[FindLocation("wr_armory")].models.always.locators = "LS_l_JRH6";
			Locations[FindLocation("wr_armory")].reload.l1.disable = 1;		//locked from this start
			Locations[FindLocation("wr_gunpowder")].reload.l3.disable = 1;		//to gunroom

			Locations[FindLocation("Tavern_storeroom")].models.always.locators = "store04_locators_JRH1";
			Locations[FindLocation("Tavern_storeroom")].reload.l1.disable = 0;	//to town
			Locations[FindLocation("Tavern_storeroom")].reload.l3.disable = 0;	//to library
			Locations[FindLocation("wr_kitchen")].models.always.locators = "FlamHouse_locators_JRH1";
			Locations[FindLocation("wr_kitchen")].reload.l1.disable = 0;		//to town
			Locations[FindLocation("wr_kitchen")].reload.l2.disable = 0;		//to Rogers bed
			Locations[FindLocation("wr_kitchen")].reload.l3.disable = 0;		//to food supply
			Locations[FindLocation("wr_kitchen")].reload.l4.disable = 0;		//to booty room
			Locations[FindLocation("wr_kitchen")].reload.l5.disable = 0;		//to Caroline bed
			Locations[FindLocation("wr_kitchen")].reload.l6.disable = 0;		//to crew
			Locations[FindLocation("wr_food_supply")].reload.l1.disable = 0;	//to kitchen
			Locations[FindLocation("wr_food_supply")].reload.l2.disable = 1;	//to mine
			Locations[FindLocation("wr_crew")].models.always.locators = "tavern03_locators_JRH1";//counter open
			Locations[FindLocation("wr_crew")].reload.l3.disable = 0;		//counter
			Locations[FindLocation("wr_crew")].reload.l4.disable = 0;		//counter
			Locations[FindLocation("wr_crew")].reload.l5.disable = 0;		//to town
			Locations[FindLocation("Redmond_tavern")].models.always.locators = "LT_l_JRH2";
			Locations[FindLocation("Redmond_tavern")].reload.l1.disable = 0;	//to town
			Locations[FindLocation("Redmond_tavern")].reload.l2.disable = 0;	//to upstairs
			Locations[FindLocation("Redmond_tavern")].reload.l3.disable = 1;	//to balcony
			Locations[FindLocation("JRH_tavern_upstairs")].models.always.locators = "LH_F2_l_JRH_open";
			Locations[FindLocation("JRH_tavern_upstairs")].reload.l2.disable = 0;	//to wr bed
			Locations[FindLocation("wr_bedroom")].reload.l2.disable = 0;		//to kitchen
			Locations[FindLocation("Shop_stairs")].reload.l4.disable = 0;		//to shop
			Locations[FindLocation("Shop_stairs")].reload.l8.disable = 1;		//to Dave bed
			Locations[FindLocation("Dave_Edna_room")].locators_radius.reload.reload1 = 0.0001;
			Locations[FindLocation("Dave_Edna_room")].locators_radius.box.box3 = 1.0;
			locations[FindLocation("Shop_stairs")].id.label = "Rogers' Paintings Furniture & Weapons";
			locations[FindLocation("Shop_stairs")].id.label = "Rogers' Paintings Furniture & Weapons";
			Locations[FindLocation("wr_shop")].models.always.locators = "residence05_locators_JRH_Lup_mdc";
			Pchar.quest.wr_elevator = "up";
			Locations[FindLocation("wr_shop")].reload.l2.disable = 0;		//to shop office
			locations[FindLocation("wr_shop_office")].id.label = "Shop office";
			Locations[FindLocation("wr_shop")].reload.l3.disable = 0;		//to shop stairs
			Locations[FindLocation("wr_shop")].reload.l6.disable = 0;		//to loanshark
			Locations[FindLocation("wr_shop_office")].reload.l1.disable = 0;	//to shop
			Locations[FindLocation("wr_shop_office")].reload.l2.disable = 1;	//to mother stairs
			Locations[FindLocation("wr_shop_office")].reload.l6.disable = 1;	//to roof
			Locations[FindLocation("wr_mother")].models.always.locators = "brothel_room_locators_JRH3";//without barrel
			Locations[FindLocation("wr_mother")].reload.l1.disable = 0;		//to mother stairs
			Locations[FindLocation("wr_library")].models.always.locators = "Res02_l_JRH12";		//no derricks
			Locations[FindLocation("wr_library")].locators_radius.reload.reload2 = 0.5;
			Locations[FindLocation("wr_library")].reload.l1.disable = 0;		//to storeroom
			Locations[FindLocation("wr_library")].reload.l2.disable = 0;		//to residence
			Locations[FindLocation("wr_library")].reload.l3.disable = 1;		//to attic
			Locations[FindLocation("wr_library")].reload.l5.disable = 1;		//to study
			Locations[FindLocation("wr_library")].reload.l6.disable = 0;		//to loanshark
			Locations[FindLocation("wr_library")].reload.l7.disable = 0;		//to gunroom
			Locations[FindLocation("wr_library")].reload.l10.disable = 1;		//to erotica
			locations[FindLocation("wr_library")].type = "Rogers_residence";
			Locations[FindLocation("wr_gunroom")].models.always.locators = "tavern02_locators_JRH1_F";
			locations[FindLocation("wr_church_inside")].type = "tavern";

			ChangeCharacterAddressGroup(CharacterFromID("wr_boc5"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_voy"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_pir13"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_boc4"), "wr_library", "goto", "goto2");
			ChangeCharacterAddressGroup(CharacterFromID("wr_cor1_1"), "wr_library", "goto", "goto3");
			ChangeCharacterAddressGroup(CharacterFromID("wr_cor4"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_man2"), "none", "", "");

			ChangeCharacterAddressGroup(CharacterFromID("Dave Edna"), "Shop_stairs", "barmen", "bar2");
			LAi_SetBarmanType(characterFromID("Dave Edna"));
			ChangeCharacterAddressGroup(CharacterFromID("wench3"), "ck_bedroom", "goto", "goto5");
			LAi_SetStayType(characterFromID("wench3"));
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "wr_booty", "sit", "sit3");
			LAi_SetSitType(CharacterFromID("Selkirk"));
			ChangeCharacterAddressGroup(CharacterFromID("rosabella"), "wr_crew", "goto", "goto4");
			LAi_SetStayType(CharacterFromID("rosabella"));
			ChangeCharacterAddressGroup(CharacterFromID("wr_oman1X"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap19"), "none", "", "");

			bDisableFastReload = 0;			//on again after mine
			DeleteAttribute(PChar, "quest.disable_rebirth");

			Pchar.quest.crew_gold = "placed";	//so Rosabella doesn't do anything
			Pchar.quest.wr_kitchendoor = "repaired";
			Pchar.quest.wr_library = "medicine";
			Pchar.quest.rum_water = "filled";
			Pchar.quest.rum_molasses = "empty";	//after process
			Pchar.quest.rum_wheel = "off";		//autostops after process
			Pchar.quest.rum_damper = "half_open";	//probably open after process
			Pchar.quest.rum_fire = "lit";		//probably lit after process
			Pchar.quest.rum_fuel = "sack";		//book sack still there
			Pchar.quest.rum_phase = "4";		//after process

			Pchar.quest.medicine_quest = "started";
			Pchar.quest.wr_quest2 = "medicine";
			Pchar.quest.med_Cook = "no_chest";
			Pchar.quest.med_Selkirk = "church_hint";
			Pchar.quest.med_grandma = "start";
			Pchar.quest.med_Dampier = "start";
			Pchar.quest.prescriptions = "no";
			Pchar.quest.mine_enabled = "yes";	//gate food cellar is open

	//		LAi_QuestDelay("wr_quest1_check", 1.0);

			pchar.quest.rogers_talks_medicine1.win_condition.l1 = "locator";
			pchar.quest.rogers_talks_medicine1.win_condition.l1.location = "Redmond_Town_01";
			pchar.quest.rogers_talks_medicine1.win_condition.l1.locator_group = "reload";
			pchar.quest.rogers_talks_medicine1.win_condition.l1.locator = "reload7";
			pchar.quest.rogers_talks_medicine1.win_condition = "rogers_talks_medicine1";
		break;

	case "wr_quest1_check":
		LogIt("wr_quest1 = " + Pchar.quest.wr_quest1);
		LogIt("med_Cook = " + Pchar.quest.med_Cook);

	//	LogIt("med_apothecary = " + Pchar.quest.med_apothecary);
	//	LogIt("med_grandma = " + Pchar.quest.med_grandma);
	//	LogIt("medicine_quest = " + Pchar.quest.medicine_quest);

		LAi_QuestDelay("wr_quest1_check", 10.0);
	break;

		case "rogers_talks_medicine1":
			LAi_SetStayType(Pchar);

			locations[FindLocation("Redmond_UsurerHouse")].id.label = "Loanshark's Office";
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l1.disable = 0;	//to town
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l3.disable = 0;	//to library
			ChangeCharacterAddressGroup(CharacterFromID("Redmond Usurer"), "Redmond_UsurerHouse", "sit", "sit1");
			LAi_SetStayType(CharacterFromID("Redmond Usurer"));

			LAi_QuestDelay("rogers_talks_medicine2", 1.0);
		break;

		case "rogers_talks_medicine2":
			LAi_SetActorType(CharacterFromID("Woodes Rogers"));
			LAi_ActorDialog(characterFromID("Woodes Rogers"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Woodes Rogers"));
			Characters[GetCharacterIndex("Woodes Rogers")].dialog.CurrentNode  = "medicine_quest";
		break;

		case "medicine_quest_given":
			//from wr dialog

			GiveItem2Character(Pchar, "cough_syrup");
			GiveItem2Character(CharacterFromID("Thomas O'Reily"), "rolls_of_bandages");

			LAi_SetPlayerType(Pchar);
			LAi_SetCitizenType(CharacterFromID("Woodes Rogers"));

			DeleteQuestHeader("Open_the_mine");
			DeleteQuestHeader("Open_the_cell");
			DeleteQuestHeader("Open_the_niche");
			DeleteQuestHeader("Open_the_chest");
			DeleteQuestHeader("Woodes_Rogers_reward_6");

			AddQuestRecord("Charles_Vanes_quest", "2");

			SetQuestHeader("Medicine_chest");
			AddQuestRecord("Medicine_chest", "1");
			SetQuestHeader("Mercury");
			AddQuestRecord("Mercury", "1");
			SetQuestHeader("Tincture_of_Laudenum");
			AddQuestRecord("Tincture_of_Laudenum", "1");
			SetQuestHeader("Confectio_Damocritis");
			AddQuestRecord("Confectio_Damocritis", "1");
			SetQuestHeader("Etherbottle");
			AddQuestRecord("Etherbottle", "1");
			SetQuestHeader("Antidote");
			AddQuestRecord("Antidote", "1");
			SetQuestHeader("Acetum_Saturninum");
			AddQuestRecord("Acetum_Saturninum", "1");
			SetQuestHeader("Extra_drugs");
			AddQuestRecord("Extra_drugs", "8");

			LAi_QuestDelay("surgery_kit_check", 0.1);
			LAi_QuestDelay("rolls_of_bandages_check", 0.1);
			LAi_QuestDelay("Claire_3_items_check", 0.1);
			LAi_QuestDelay("Acetum_check", 0.1);
			LAi_QuestDelay("Antidote_check", 0.1);
			LAi_QuestDelay("Etherbottle_check", 0.1);
			LAi_QuestDelay("Confectio_check", 0.1);
			LAi_QuestDelay("Laudenum_check", 0.1);
			LAi_QuestDelay("Mercury_check", 0.1);

			LAi_QuestDelay("steplock_armory", 0.1);
			LAi_QuestDelay("armory_jump_new", 0.1);
			LAi_QuestDelay("light_fire_enabled1", 0.1);
			LAi_QuestDelay("subject_sound_architecture", 0.1);
			LAi_QuestDelay("steplock_mother", 0.1);
			LAi_QuestDelay("office_ladder", 0.1);
			LAi_QuestDelay("dave_chest_hint", 0.1);	//quest continues
		break;
	//.....................................................................................................
		case "rolls_of_bandages_check":
			Pchar.quest.rolls_of_bandages_taken.win_condition.l1 = "item";
			Pchar.quest.rolls_of_bandages_taken.win_condition.l1.character = Pchar.id;
			Pchar.quest.rolls_of_bandages_taken.win_condition.l1.item = "rolls_of_bandages";
			Pchar.quest.rolls_of_bandages_taken.win_condition = "rolls_of_bandages_taken";
		break;

		case "rolls_of_bandages_taken":
			AddQuestRecord("Extra_drugs", "6");

			if(CheckCharacterItem(Pchar,"pistolmdchest_F1"))
			{
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE );
				TakeItemFromCharacter(Pchar, "pistolmdchest_F1");
				GiveItem2Character(Pchar, "pistolmdchest_F1_C");
				EquipCharacterByItem(Pchar, "pistolmdchest_F1_C");
			}
			else
			{
				if(CheckCharacterItem(Pchar,"pistolmdchest_F2B"))
				{
					RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE );
					TakeItemFromCharacter(Pchar, "pistolmdchest_F2A");
					TakeItemFromCharacter(Pchar, "pistolmdchest_F2B");

					GiveItem2Character(Pchar, "pistolmdchest_F2A_C");	//to the left of F2B_C
					GiveItem2Character(Pchar, "pistolmdchest_F2B_C");
					EquipCharacterByItem(Pchar, "pistolmdchest_F2B_C");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"pistolmdchest_F2B_S"))
				{
					RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE );
					TakeItemFromCharacter(Pchar, "pistolmdchest_F2A_S");
					TakeItemFromCharacter(Pchar, "pistolmdchest_F2B_S");

					GiveItem2Character(Pchar, "pistolmdchest_F2A_CS");
					GiveItem2Character(Pchar, "pistolmdchest_F2B_CS");
					EquipCharacterByItem(Pchar, "pistolmdchest_F2B_CS");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"pistolmdchest_F3B"))
				{
					RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE );
					TakeItemFromCharacter(Pchar, "pistolmdchest_F3A");
					TakeItemFromCharacter(Pchar, "pistolmdchest_F3B");

					GiveItem2Character(Pchar, "pistolmdchest_F3A_C");
					GiveItem2Character(Pchar, "pistolmdchest_F3B_C");
					EquipCharacterByItem(Pchar, "pistolmdchest_F3B_C");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"pistolmdchest_F3B_S"))
				{
					RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE );
					TakeItemFromCharacter(Pchar, "pistolmdchest_F3A_S");
					TakeItemFromCharacter(Pchar, "pistolmdchest_F3B_S");

					GiveItem2Character(Pchar, "pistolmdchest_F3A_CS");
					GiveItem2Character(Pchar, "pistolmdchest_F3B_CS");
					EquipCharacterByItem(Pchar, "pistolmdchest_F3B_CS");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"pistolmdchest_F4C"))
				{
					RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE );
					TakeItemFromCharacter(Pchar, "pistolmdchest_F4A");
					TakeItemFromCharacter(Pchar, "pistolmdchest_F4B");
					TakeItemFromCharacter(Pchar, "pistolmdchest_F4C");

					GiveItem2Character(Pchar, "pistolmdchest_F4A_C");
					GiveItem2Character(Pchar, "pistolmdchest_F4B_C");
					GiveItem2Character(Pchar, "pistolmdchest_F4C_C");
					EquipCharacterByItem(Pchar, "pistolmdchest_F4C_C");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"pistolmdchest_F4C_S"))
				{
					RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE );
					TakeItemFromCharacter(Pchar, "pistolmdchest_F4A_S");
					TakeItemFromCharacter(Pchar, "pistolmdchest_F4B_S");
					TakeItemFromCharacter(Pchar, "pistolmdchest_F4C_S");

					GiveItem2Character(Pchar, "pistolmdchest_F4A_CS");
					GiveItem2Character(Pchar, "pistolmdchest_F4B_CS");
					GiveItem2Character(Pchar, "pistolmdchest_F4C_CS");
					EquipCharacterByItem(Pchar, "pistolmdchest_F4C_CS");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"pistolmdchest_F5C"))
				{
					RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE );
					TakeItemFromCharacter(Pchar, "pistolmdchest_F5A");
					TakeItemFromCharacter(Pchar, "pistolmdchest_F5B");
					TakeItemFromCharacter(Pchar, "pistolmdchest_F5C");

					GiveItem2Character(Pchar, "pistolmdchest_F5A_C");
					GiveItem2Character(Pchar, "pistolmdchest_F5B_C");
					GiveItem2Character(Pchar, "pistolmdchest_F5C_C");
					EquipCharacterByItem(Pchar, "pistolmdchest_F5C_C");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"pistolmdchest_F5C_S"))
				{
					RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE );
					TakeItemFromCharacter(Pchar, "pistolmdchest_F5A_S");
					TakeItemFromCharacter(Pchar, "pistolmdchest_F5B_S");
					TakeItemFromCharacter(Pchar, "pistolmdchest_F5C_S");

					GiveItem2Character(Pchar, "pistolmdchest_F5A_CS");
					GiveItem2Character(Pchar, "pistolmdchest_F5B_CS");
					GiveItem2Character(Pchar, "pistolmdchest_F5C_CS");
					EquipCharacterByItem(Pchar, "pistolmdchest_F5C_CS");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"pistolmdchest_F6"))
				{
					RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE );
					TakeItemFromCharacter(Pchar, "pistolmdchest_F6");

					GiveItem2Character(Pchar, "pistolmdchest_F6_C");
					EquipCharacterByItem(Pchar, "pistolmdchest_F6_C");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"pistolmdchest_F6_S"))
				{
					RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE );
					TakeItemFromCharacter(Pchar, "pistolmdchest_F6_S");

					GiveItem2Character(Pchar, "pistolmdchest_F6_CS");
					EquipCharacterByItem(Pchar, "pistolmdchest_F6_CS");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"pistolmdsack"))
				{
					TakeItemFromCharacter(Pchar, "pistolmdsack");

					GiveItem2Character(Pchar, "pistolmdclothsack");
					EquipCharacterByItem(Pchar, "pistolmdclothsack");
				}
			}
			else
			{
				TakeItemFromCharacter(Pchar, "rolls_of_bandages");
				GiveItem2Character(Pchar, "pistolmdcloth");
				EquipCharacterByItem(Pchar, "pistolmdcloth");
				//don't give back rolls_of_bandages, pistolmdcloth replaces it!
			}

			LAi_QuestDelay("all_extra_drugs_check", 0.1);
		break;

		case "surgery_kit_check":
			pchar.quest.surgery_kit_check1.win_condition.l1 = "location";
			pchar.quest.surgery_kit_check1.win_condition.l1.location = "wr_shop";
			pchar.quest.surgery_kit_check1.win_condition = "surgery_kit_check1";
		break;

		case "surgery_kit_check1":
			if(Pchar.location == "wr_shop")
			{
				if(CheckCharacterItem(Pchar,"surgery_kit"))
				{
					AddQuestRecord("Extra_drugs", "1");
					TakeItemFromCharacter(Pchar, "surgery_kit");

					if(CheckCharacterItem(Pchar,"medicine_leaves"))
					{
						if(CheckCharacterItem(Pchar,"mdchest_B4") || CheckCharacterItem(Pchar,"key11"))
						{
							TakeItemFromCharacter(Pchar, "key11");

							if(CheckCharacterItem(Pchar,"surgery_saw"))
							{
								TakeItemFromCharacter(Pchar, "surgery_saw");
								if(CheckCharacterItem(Pchar,"bladeprescriptions"))
								{
									TakeItemFromCharacter(Pchar, "bladeprescriptions");
									GiveItem2Character(Pchar, "prescriptions");
									GiveItem2Character(Pchar, "bladesurgcan3_r");
									if(IsEquipCharacterByItem(Pchar, "bladefish") || IsEquipCharacterByItem(Pchar, "bladeviolin"))
									{

									}
									else EquipCharacterByItem(Pchar, "bladesurgcan3_r");
								}
								else
								{
									GiveItem2Character(Pchar, "bladesurgcan3");
									if(IsEquipCharacterByItem(Pchar, "bladefish") || IsEquipCharacterByItem(Pchar, "bladeviolin"))
									{

									}
									else EquipCharacterByItem(Pchar, "bladesurgcan3");
								}
							}
							else
							{
								if(CheckCharacterItem(Pchar,"bladeprescriptions"))
								{
									TakeItemFromCharacter(Pchar, "bladeprescriptions");
									GiveItem2Character(Pchar, "prescriptions");
									GiveItem2Character(Pchar, "bladesurgcan2_r");
									if(IsEquipCharacterByItem(Pchar, "bladefish") || IsEquipCharacterByItem(Pchar, "bladeviolin"))
									{

									}
									else EquipCharacterByItem(Pchar, "bladesurgcan2_r");
								}
								else
								{
									GiveItem2Character(Pchar, "bladesurgcan2");
									if(IsEquipCharacterByItem(Pchar, "bladefish") || IsEquipCharacterByItem(Pchar, "bladeviolin"))
									{

									}
									else EquipCharacterByItem(Pchar, "bladesurgcan2");
								}
							}
						}
						else
						{

							if(CheckCharacterItem(Pchar,"bladeprescriptions"))
							{
								TakeItemFromCharacter(Pchar, "bladeprescriptions");
								GiveItem2Character(Pchar, "prescriptions");
								GiveItem2Character(Pchar, "bladesurgcan_r");
								if(IsEquipCharacterByItem(Pchar, "bladefish") || IsEquipCharacterByItem(Pchar, "bladeviolin"))
								{

								}
								else EquipCharacterByItem(Pchar, "bladesurgcan_r");
							}
							else
							{
								GiveItem2Character(Pchar, "bladesurgcan");
								if(IsEquipCharacterByItem(Pchar, "bladefish") || IsEquipCharacterByItem(Pchar, "bladeviolin"))
								{

								}
								else EquipCharacterByItem(Pchar, "bladesurgcan");
							}
						}
					}
					else
					{
						if(CheckCharacterItem(Pchar,"mdchest_B4") || CheckCharacterItem(Pchar,"key11"))
						{
							TakeItemFromCharacter(Pchar, "key11");

							if(CheckCharacterItem(Pchar,"surgery_saw"))
							{
								TakeItemFromCharacter(Pchar, "surgery_saw");
								if(CheckCharacterItem(Pchar,"bladeprescriptions"))
								{
									TakeItemFromCharacter(Pchar, "bladeprescriptions");
									GiveItem2Character(Pchar, "prescriptions");
									GiveItem2Character(Pchar, "bladesurgery3_r");
									if(IsEquipCharacterByItem(Pchar, "bladefish") || IsEquipCharacterByItem(Pchar, "bladeviolin"))
									{

									}
									else EquipCharacterByItem(Pchar, "bladesurgery3_r");
								}
								else
								{
									GiveItem2Character(Pchar, "bladesurgery3");
									if(IsEquipCharacterByItem(Pchar, "bladefish") || IsEquipCharacterByItem(Pchar, "bladeviolin"))
									{

									}
									else EquipCharacterByItem(Pchar, "bladesurgery3");
								}
							}
							else
							{
								if(CheckCharacterItem(Pchar,"bladeprescriptions"))
								{
									TakeItemFromCharacter(Pchar, "bladeprescriptions");
									GiveItem2Character(Pchar, "prescriptions");
									GiveItem2Character(Pchar, "bladesurgery2_r");
									if(IsEquipCharacterByItem(Pchar, "bladefish") || IsEquipCharacterByItem(Pchar, "bladeviolin"))
									{

									}
									else EquipCharacterByItem(Pchar, "bladesurgery2_r");
								}
								else
								{
									GiveItem2Character(Pchar, "bladesurgery2");
									if(IsEquipCharacterByItem(Pchar, "bladefish") || IsEquipCharacterByItem(Pchar, "bladeviolin"))
									{

									}
									else EquipCharacterByItem(Pchar, "bladesurgery2");
								}
							}
						}
						else
						{
							if(CheckCharacterItem(Pchar,"bladeprescriptions"))
							{
								TakeItemFromCharacter(Pchar, "bladeprescriptions");
								GiveItem2Character(Pchar, "prescriptions");
								GiveItem2Character(Pchar, "bladesurgery_r");
								if(IsEquipCharacterByItem(Pchar, "bladefish") || IsEquipCharacterByItem(Pchar, "bladeviolin"))
								{

								}
								else EquipCharacterByItem(Pchar, "bladesurgery_r");
							}
							else
							{
								GiveItem2Character(Pchar, "bladesurgery");
								if(IsEquipCharacterByItem(Pchar, "bladefish") || IsEquipCharacterByItem(Pchar, "bladeviolin"))
								{

								}
								else EquipCharacterByItem(Pchar, "bladesurgery");
							}
						}
					}

					LAi_QuestDelay("all_extra_drugs_check", 0.1);
				}
				else LAi_QuestDelay("surgery_kit_check1", 0.5);//loops if pchar still in shop
			}
			else LAi_QuestDelay("surgery_kit_check", 0.1);
		break;



		case "Acetum_check":
			Pchar.quest.Acetum_taken.win_condition.l1 = "item";
			Pchar.quest.Acetum_taken.win_condition.l1.character = Pchar.id;
			Pchar.quest.Acetum_taken.win_condition.l1.item = "meds1";
			Pchar.quest.Acetum_taken.win_condition = "Acetum_taken";
		break;

		case "Acetum_taken":
			AddQuestRecord("Acetum_Saturninum", "2");
			CloseQuestHeader("Acetum_Saturninum");

			LAi_QuestDelay("Claire_3_items_taken", 0.1);
			LAi_QuestDelay("all6_meds_check", 0.1);
		break;

		case "Claire_3_items_check":
			Pchar.quest.mortar_ointment_taken.win_condition.l1 = "item";
			Pchar.quest.mortar_ointment_taken.win_condition.l1.character = Pchar.id;
			Pchar.quest.mortar_ointment_taken.win_condition.l1.item = "mortar_ointment";
			Pchar.quest.mortar_ointment_taken.win_condition = "Claire_3_items_taken";

			Pchar.quest.bloodletting_taken.win_condition.l1 = "item";
			Pchar.quest.bloodletting_taken.win_condition.l1.character = Pchar.id;
			Pchar.quest.bloodletting_taken.win_condition.l1.item = "blood_letting";
			Pchar.quest.bloodletting_taken.win_condition = "Claire_3_items_taken";
		break;

		case "Claire_3_items_taken":
			//ev questrecord in here

			if(CheckCharacterItem(Pchar,"mortar_ointment") && CheckCharacterItem(Pchar,"blood_letting")
			&& CheckCharacterItem(Pchar,"cough_syrup"))
			{
				TakeItemFromCharacter(Pchar, "empty_large_drawer");
				TakeItemFromCharacter(Pchar, "cough_syrup");
				TakeItemFromCharacter(Pchar, "mortar_ointment");
				TakeItemFromCharacter(Pchar, "blood_letting");
				GiveItem2Character(Pchar, "filled_large_drawer");

				if(CheckCharacterItem(Pchar,"meds1") || CheckCharacterItem(Pchar,"pistolmdchest_F3B") || CheckCharacterItem(Pchar,"pistolmdchest_F3B_C")
				    || CheckCharacterItem(Pchar,"pistolmdchest_F3B_S") || CheckCharacterItem(Pchar,"pistolmdchest_F3B_CS"))
				{
					Pchar.quest.med_Claire = "acetum";
				}
			}
		break;

		case "Antidote_check":
			Pchar.quest.Antidote_taken.win_condition.l1 = "item";
			Pchar.quest.Antidote_taken.win_condition.l1.character = Pchar.id;
			Pchar.quest.Antidote_taken.win_condition.l1.item = "Potion3";
			Pchar.quest.Antidote_taken.win_condition = "Antidote_taken";
		break;

		case "Antidote_taken":
			AddQuestRecord("Antidote", "2");
			CloseQuestHeader("Antidote");

			LAi_QuestDelay("all6_meds_check", 0.1);
		break;

		case "Etherbottle_check":
			Pchar.quest.Etherbottle_taken.win_condition.l1 = "item";
			Pchar.quest.Etherbottle_taken.win_condition.l1.character = Pchar.id;
			Pchar.quest.Etherbottle_taken.win_condition.l1.item = "pistolgas";
			Pchar.quest.Etherbottle_taken.win_condition = "Etherbottle_taken";
		break;

		case "Etherbottle_taken":
			AddQuestRecord("Etherbottle", "3");
			CloseQuestHeader("Etherbottle");

			LAi_QuestDelay("all6_meds_check", 0.1);
		break;

		case "Confectio_check":
			Pchar.quest.Confectio_taken.win_condition.l1 = "item";
			Pchar.quest.Confectio_taken.win_condition.l1.character = Pchar.id;
			Pchar.quest.Confectio_taken.win_condition.l1.item = "meds2";
			Pchar.quest.Confectio_taken.win_condition = "Confectio_taken";
		break;

		case "Confectio_taken":
			AddQuestRecord("Confectio_Damocritis", "4");
			CloseQuestHeader("Confectio_Damocritis");

			LAi_QuestDelay("all6_meds_check", 0.1);
		break;

		case "Laudenum_check":
			Pchar.quest.Laudenum_taken.win_condition.l1 = "item";
			Pchar.quest.Laudenum_taken.win_condition.l1.character = Pchar.id;
			Pchar.quest.Laudenum_taken.win_condition.l1.item = "meds3";
			Pchar.quest.Laudenum_taken.win_condition = "Laudenum_taken";
		break;

		case "Laudenum_taken":
			AddQuestRecord("Tincture_of_Laudenum", "4");
			CloseQuestHeader("Tincture_of_Laudenum");
		break;

		case "Mercury_check":
			Pchar.quest.Mercury_taken.win_condition.l1 = "item";
			Pchar.quest.Mercury_taken.win_condition.l1.character = Pchar.id;
			Pchar.quest.Mercury_taken.win_condition.l1.item = "mercury_bottles";
			Pchar.quest.Mercury_taken.win_condition = "Mercury_taken";
		break;

		case "Mercury_taken":
			AddQuestRecord("Mercury", "4");
			CloseQuestHeader("Mercury");

			LAi_QuestDelay("all6_meds_check", 0.1);
		break;
	//.....................................................................................................
		case "armory_jump_new":
			pchar.quest.armory_jump1_new.win_condition.l1 = "locator";
			pchar.quest.armory_jump1_new.win_condition.l1.location = "wr_armory";
			pchar.quest.armory_jump1_new.win_condition.l1.locator_group = "goto";
			pchar.quest.armory_jump1_new.win_condition.l1.locator = "goto14";
			pchar.quest.armory_jump1_new.win_condition = "armory_jump1_new";
		break;

		case "armory_jump1_new":
			PlaySound("PEOPLE\Jump_counter.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_armory", "goto", "goto15");

			LAi_QuestDelay("armory_jump2_new", 0.5);
		break;

		case "armory_jump2_new":
			ChangeCharacterAddressGroup(Pchar, "wr_armory", "officers", "reload1_2");

			LAi_QuestDelay("armory_jump_new", 0.1);//loop

			pchar.quest.gps_start_new.win_condition.l1 = "locator";
			pchar.quest.gps_start_new.win_condition.l1.location = "wr_gunpowder";
			pchar.quest.gps_start_new.win_condition.l1.locator_group = "reload";
			pchar.quest.gps_start_new.win_condition.l1.locator = "reload1";
			pchar.quest.gps_start_new.win_condition = "gps_start_new";
		break;

		case "gps_start_new":
			if(CheckAttribute(Pchar,"quest.new_gps") && Pchar.quest.new_gps == "visit_already")
			{
				return;
			}
			else
			{
				//this refill is to get ammo when starting from [9]
				//(without getting it doubled up)

				locations[FindLocation(Pchar.location)].box3.items.gunpowder = 0;
				locations[FindLocation(Pchar.location)].box4.items.pistolbullets = 0;
				locations[FindLocation(Pchar.location)].box4.items.pistolgrapes = 0;
				locations[FindLocation(Pchar.location)].box4.items.musketbullets = 0;

				locations[FindLocation(Pchar.location)].box3.items.gunpowder = 1225;
				locations[FindLocation(Pchar.location)].box4.items.pistolbullets = 855;
				locations[FindLocation(Pchar.location)].box4.items.pistolgrapes = 496;
				locations[FindLocation(Pchar.location)].box4.items.musketbullets = 186;

				Pchar.quest.new_gps = "visit_already";
			}
		break;
	//.....................................................................................................
		case "dave_chest_hint":
			pchar.quest.dave_chest_hint1.win_condition.l1 = "locator";
			pchar.quest.dave_chest_hint1.win_condition.l1.location = "Shop_stairs";
			pchar.quest.dave_chest_hint1.win_condition.l1.locator_group = "goto";
			pchar.quest.dave_chest_hint1.win_condition.l1.locator = "goto1";
			pchar.quest.dave_chest_hint1.win_condition = "dave_chest_hint1";
		break;

		case "dave_chest_hint1":
			LAi_SetStayType(Pchar);
			LAi_SetStayType(characterFromID("Dave Edna"));

			LAi_QuestDelay("dave_chest_hint2", 1.0);
		break;

		case "dave_chest_hint2":
			LAi_SetActorType(characterFromID("Dave Edna"));
			LAi_ActorTurnToLocator(characterFromID("Dave Edna"), "goto", "goto1");

			LAi_QuestDelay("dave_chest_hint3", 1.0);
		break;

		case "dave_chest_hint3":
			LAi_SetActorType(characterFromID("Dave Edna"));
			LAi_ActorDialog(characterFromID("Dave Edna"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Dave Edna"));
			Characters[GetCharacterIndex("Dave Edna")].dialog.CurrentNode  = "chest_hint";
		break;

		case "chest_hint_done":
			//from dave dialog
			AddQuestRecord("Medicine_chest", "10");
			PlaySound("VOICE\ENGLISH\Dave_Edna_6.wav");
			LAi_SetBarmanType(characterFromID("Dave Edna"));

			LAi_SetPlayerType(Pchar);

			Locations[FindLocation("wr_shop")].models.always.locators = "residence05_locators_JRH_Lup_mdc";//chest placed
			Pchar.quest.wr_elevator = "up";
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l2.disable = 0;	//to shop
			Pchar.quest.chest_hint = "dave";

			pchar.quest.chest_rope.win_condition.l1 = "locator";
			pchar.quest.chest_rope.win_condition.l1.location = "wr_shop_office";
			pchar.quest.chest_rope.win_condition.l1.locator_group = "reload";
			pchar.quest.chest_rope.win_condition.l1.locator = "reload1";
			pchar.quest.chest_rope.win_condition = "chest_rope";
		break;

		case "chest_rope":
			locations[FindLocation(Pchar.location)].box2.items.mdchest_rope = 1;

			LAi_QuestDelay("equip_chest_rope", 0.1);
		break;

		case "equip_chest_rope":
			if(CheckCharacterItem(Pchar,"mdchest_rope"))
			{
				PlaySound("INTERFACE\important_item.wav");
				Log_SetStringToLog(XI_ConvertString("You take item"));
				SetModel(PChar, "Pira4M_HTU_r", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

				TakeItemFromCharacter(Pchar, "mdchest_rope");

				Locations[FindLocation("wr_shop")].locators_radius.randitem.randitem7 = 1.5;
				Locations[FindLocation("wr_shop")].locators_radius.box.box13 = 0.01;

				LAi_QuestDelay("equip_chest_rope1", 1.0);
			}
			else LAi_QuestDelay("equip_chest_rope", 0.5);//loop
		break;

		case "equip_chest_rope1":
			PlaySound("VOICE\ENGLISH\Spa_m_b_053.wav");

			LAi_QuestDelay("equip_med_chest", 0.1);
		break;

		case "equip_med_chest":
			if(CheckCharacterItem(Pchar,"mdchest"))
			{
				PlaySound("INTERFACE\important_item.wav");
				TakeItemFromCharacter(Pchar, "mdchest");	//fake chest

				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);

				if(CheckCharacterItem(Pchar,"pistolmdcloth"))
				{
					TakeItemFromCharacter(Pchar, "pistolmdcloth");
					GiveItem2Character(Pchar, "rolls_of_bandages");
					GiveItem2Character(Pchar, "pistolmdchest_F1_C");		//equipable chest
					EquipCharacterByItem(Pchar, "pistolmdchest_F1_C");
				}
				else
				{
					GiveItem2Character(Pchar, "pistolmdchest_F1");
					EquipCharacterByItem(Pchar, "pistolmdchest_F1");
				}

				GiveItem2Character(Pchar, "empty_large_drawer");
				PlaySound("OBJECTS\DUEL\man_attack1.wav");

				ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "none", "", "");

				Pchar.quest.wr_quest1 = "medicine_chest";
				Pchar.quest.med_Cook = "chest";
				AddQuestRecord("Medicine_chest", "2");

				LAi_QuestDelay("grandma_port_hint", 1.0);
			}
			else LAi_QuestDelay("equip_med_chest", 0.5);//loop
		break;

		case "grandma_port_hint":
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(CharacterFromID("grandma"), "wr_shop", "reload", "reload3");
			LAi_SetStayType(characterFromID("grandma"));
			LAi_SetActorType(Pchar);

			LAi_QuestDelay("grandma_port_hint1", 1.0);
		break;

		case "grandma_port_hint1":
			LAi_ActorTurnToLocator(Pchar, "sit", "sit1");
			LAi_SetActorType(characterFromID("grandma"));
			LAi_ActorGoToLocator(CharacterFromID("grandma"), "goto", "goto6", "grandma_port_hint2", 1.0);
		break;

		case "grandma_port_hint2":
			ChangeCharacterAddressGroup(CharacterFromID("grandma"), "wr_shop", "goto", "goto18");

			LAi_QuestDelay("grandma_port_hint3", 0.5);
		break;

		case "grandma_port_hint3":
			ChangeCharacterAddressGroup(CharacterFromID("grandma"), "wr_shop", "sit", "sit1");
			LAi_SetSitType(characterFromID("grandma"));
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
			LAi_SetPlayerType(Pchar);
		break;

		case "port_hint_done":
			//from voluntary grandma dialog
			AddQuestRecord("Extra_drugs", "9");
			AddQuestRecord("Tincture_of_Laudenum", "5");
			AddQuestRecord("Confectio_Damocritis", "5");

			Locations[FindLocation("Redmond_Port")].models.always.locators = "RedPort_l_JRH";//for boatswain & barrel

			if(CheckAttribute(Pchar,"quest.med_grandma") && Pchar.quest.med_grandma == "start")
			{
				Pchar.quest.med_grandma = "port_hint";
				ChangeCharacterAddressGroup(CharacterFromID("wr_boc5"), "Redmond_Port", "sit", "sit1");
				LAi_SetSitType(characterFromID("wr_boc5"));
			}
		break;
	//.....................................................................................................
		case "church_hint_done":
			//from selkirk dialog
			AddQuestRecord("Medicine_chest", "11");
			AddQuestRecord("Extra_drugs", "10");

			ChangeCharacterAddressGroup(CharacterFromID("wr_pir13"), "Redmond_town_03", "goto", "med1");
			LAi_SetStayType(CharacterFromID("wr_pir13"));

			Locations[FindLocation("Redmond_town_03")].models.always.locators = "Red03_l_JRH1";//JRH1 is the right here
			locations[FindLocation("Redmond_Town_03")].type = "silent_town";

			if(CheckAttribute(Pchar,"quest.church_bells") && Pchar.quest.church_bells == "on")
			{
				return;
				//start the bells only once
			}
			else
			{
				Pchar.quest.church_bells = "on";
				LAi_QuestDelay("church_bells", 0.1);
				LAi_QuestDelay("church_bells", 2.0);
			}
		break;

		case "church_bells":
			if(CheckAttribute(Pchar,"quest.church_bells") && Pchar.quest.church_bells == "on")
			{
				if(Pchar.location == "Redmond_town_03" || Pchar.location == "Redmond_church")
				{
					int bellsound = rand(4);

					switch (bellsound)
					{
						case 0:
							PlaySound("AMBIENT\CHURCH\bell1.wav");
						break;

						case 1:
							PlaySound("AMBIENT\CHURCH\bell2.wav");
						break;

						case 2:
							PlaySound("AMBIENT\CHURCH\bell3.wav");
						break;

						case 3:
							PlaySound("AMBIENT\CHURCH\bell4.wav");
						break;

						case 4:
							PlaySound("AMBIENT\CHURCH\bell.wav");
						break;
					}

				}
				LAi_QuestDelay("church_bells", 4.0);
			}
			else return;
		break;

	//.....................................................................................................
		case "dampier_hint_done":
			//from rogers 2:nd dialog
			ChangeCharacterAddressGroup(CharacterFromID("wr_cor4"), "wr_gunroom", "sit", "sit12");
			LAi_SetSitType(CharacterFromID("wr_cor4"));
			ChangeCharacterAddressGroup(CharacterFromID("wr_man2"), "none", "", "");
		break;

		case "open_back_tailor_hint":
			//from dampier dialog
			AddQuestRecord("Mercury", "5");
			AddQuestRecord("Medicine_chest", "4");

		ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "none", "", "");//better to remove him
			ChangeCharacterAddressGroup(CharacterFromID("wr_voy"), "Redmond_town_04", "goto", "goto_44");
			LAi_SetStayType(CharacterFromID("wr_voy"));
			SetModel(CharacterFromID("wr_voy"), "wr_voy2", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);
			Pchar.quest.med_Dover = "bring_empty_bottles";
			ChangeCharacterAddressGroup(CharacterFromID("Claire Voyant"), "Redmond_town_04", "merchant", "merchant3");
			GiveItem2Character(characterFromID("Claire Voyant"), "meds1");
			GiveItem2Character(characterFromID("Claire Voyant"), "mortar_ointment");
			GiveItem2Character(characterFromID("Claire Voyant"), "blood_letting");

			Pchar.quest.wr_quest1 = "just_greeting";
		break;

		case "open_back_tailor_hint1":
			//direct from dampier dialog
			PlaySound("VOICE\ENGLISH\blaze_hah.wav");
		break;
	//.....................................................................................................
		case "food_mission_given":
			//from Cook dialog
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "med3", "food_mission_given1", 2.0);
		break;

		case "food_mission_given1":
			LAi_ActorTurnToLocator(Pchar, "goto", "goto39");

			LAi_QuestDelay("food_mission_given2", 1.0);
		break;

		case "food_mission_given2":
			LAi_SetPlayerType(CharacterFromID("wr_pir13"));
			LAi_SetFightMode(CharacterFromID("wr_pir13"), true);

			LAi_QuestDelay("food_mission_given3", 1.0);
		break;

		case "food_mission_given3":
			PlaySound("PEOPLE\roof_creak.wav");

			LAi_QuestDelay("food_mission_given4", 3.0);
		break;

		case "food_mission_given4":
			AddQuestRecord("Medicine_chest", "3");
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);

			if(CheckCharacterItem(Pchar,"pistolmdchest_F1"))
			{
				TakeItemFromCharacter(Pchar, "pistolmdchest_F1");
				GiveItem2Character(Pchar, "pistolmdchest_F2A");
				GiveItem2Character(Pchar, "pistolmdchest_F2B");
				EquipCharacterByItem(Pchar, "pistolmdchest_F2B");
			}
			else
			{
				if(CheckCharacterItem(Pchar,"pistolmdchest_F1_C"))
				{
					TakeItemFromCharacter(Pchar, "pistolmdchest_F1_C");
					TakeItemFromCharacter(Pchar, "rolls_of_bandages");

					GiveItem2Character(Pchar, "pistolmdchest_F2A_C");
					GiveItem2Character(Pchar, "pistolmdchest_F2B_C");
					EquipCharacterByItem(Pchar, "pistolmdchest_F2B_C");
					GiveItem2Character(Pchar, "rolls_of_bandages");
				}
			}

			LAi_QuestDelay("food_mission_given5", 1.0);
		break;

		case "food_mission_given5":
			LAi_SetFightMode(CharacterFromID("wr_pir13"), false);
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");

			LAi_ActorTurnToLocator(Pchar, "goto", "med1");

			LAi_QuestDelay("food_mission_given6", 1.0);
		break;

		case "food_mission_given6":
			PlaySound("VOICE\ENGLISH\Eng_m_c_005.wav");
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("food_mission_given7", 2.0);
		break;

		case "food_mission_given7":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead7.wav");

			//was in "equip_med_chest"
			ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "wr_library", "sit", "sit1");

	Characters[GetCharacterIndex("Woodes Rogers")].dialog.CurrentNode  = "Dampier_hint";
	//		Pchar.quest.wr_quest1 = "medicine_chest";
	//	Characters[GetCharacterIndex("Woodes Rogers")].dialog.CurrentNode  = "First time";
			LAi_SetSitType(characterFromID("Woodes Rogers"));

			LAi_QuestDelay("apothecary_port", 0.1);
		break;

		case "apothecary_port":
			ChangeCharacterAddressGroup(characterFromID("fake_Apothecary"), "Redmond_port", "goto", "goto_26");
			LAi_SetStayType(characterFromID("fake_Apothecary"));
			Pchar.quest.med_apothecary = "port_royal";
			ChangeCharacterAddressGroup(characterFromID("wr_boc5"), "Redmond_port", "goto", "goto_60");
			LAi_SetPoorType(characterFromID("wr_boc5"));
			Characters[GetCharacterIndex("wr_boc5")].dialog.CurrentNode  = "food_keys";
		break;

		case "violin_mission":
			//from apothecary dialog
			AddQuestRecord("Confectio_Damocritis", "2");
			AddQuestRecord("Tincture_of_Laudenum", "2");
			Pchar.quest.med_Dave = "violin";
			LAi_SetCitizenType(characterFromID("fake_Apothecary"));
			ChangeCharacterAddressGroup(characterFromID("grandma"), "wr_mother", "goto", "snoring");
			LAi_SetActorType(characterFromID("grandma"));
			LAi_ActorSetLayMode(characterFromID("grandma"));
		break;

		case "return_to_port1":
			//from Cook dialog: food mission
			ChangeCharacterAddressGroup(characterFromID("fake_Apothecary"), "Redmond_port", "goto", "goto_26");
			LAi_SetStayType(characterFromID("fake_Apothecary"));
			Pchar.quest.med_apothecary = "port_royal";
			ChangeCharacterAddressGroup(characterFromID("wr_boc5"), "Redmond_port", "goto", "goto_60");
			LAi_SetPoorType(characterFromID("wr_boc5"));
			Characters[GetCharacterIndex("wr_boc5")].dialog.CurrentNode  = "food_keys";
		break;

		case "food_keys_given":
			//from Anderson dialog
			PlaySound("VOICE\ENGLISH\Spa_m_a_023.wav");

			Locations[FindLocation("wr_food_supply")].models.always.locators = "store03_locators_JRH1";//ri6 foodchest

			Pchar.quest.food_keys_given1.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.food_keys_given1.win_condition.l1.location = "Redmond_port";
			Pchar.quest.food_keys_given1.win_condition = "food_keys_given1";
		break;

		case "food_keys_given1":
			ChangeCharacterAddressGroup(characterFromID("wr_boc5"), "none", "", "");

			pchar.quest.food_keys_given2.win_condition.l1 = "location";
			pchar.quest.food_keys_given2.win_condition.l1.location = "wr_food_supply";
			pchar.quest.food_keys_given2.win_condition = "food_keys_given2";
		break;

		case "food_keys_given2":
			locations[FindLocation(Pchar.location)].box3.items.meat = 1;
			locations[FindLocation(Pchar.location)].box4.items.ale = 1;
			locations[FindLocation(Pchar.location)].box5.items.bread = 1;
			locations[FindLocation(Pchar.location)].box6.items.bladefish = 1;

			LAi_QuestDelay("bread_check", 0.1);
			LAi_QuestDelay("meat_check", 0.1);
			LAi_QuestDelay("ale_check", 0.1);
			LAi_QuestDelay("bladefish_check", 0.1);
			LAi_QuestDelay("all_food_check", 0.1);
		break;
	//................................................................................
		case "bread_check":
			Pchar.quest.bread_taken.win_condition.l1 = "item";
			Pchar.quest.bread_taken.win_condition.l1.character = Pchar.id;
			Pchar.quest.bread_taken.win_condition.l1.item = "bread";
			Pchar.quest.bread_taken.win_condition = "bread_taken";
		break;

		case "bread_taken":
			if(CheckCharacterItem(Pchar,"pistolfoodchest") || CheckCharacterItem(Pchar,"pistolfoodchest2"))
			{
				return;
			}
			else
			{
				TakeItemFromCharacter(Pchar, "bread");
				locations[FindLocation(Pchar.location)].box5.items.bread = 1;
				Logit(LanguageConvertString(tmpLangFileID,"I'll need a foodchest first."));
				PlaySound("VOICE\ENGLISH\blaze_hah.wav");

				LAi_QuestDelay("bread_check", 0.5);
			}
		break;
	//................................................................................
		case "meat_check":
			Pchar.quest.meat_taken.win_condition.l1 = "item";
			Pchar.quest.meat_taken.win_condition.l1.character = Pchar.id;
			Pchar.quest.meat_taken.win_condition.l1.item = "meat";
			Pchar.quest.meat_taken.win_condition = "meat_taken";
		break;

		case "meat_taken":
			if(CheckCharacterItem(Pchar,"pistolfoodchest") || CheckCharacterItem(Pchar,"pistolfoodchest2"))
			{
				return;
			}
			else
			{
				TakeItemFromCharacter(Pchar, "meat");
				locations[FindLocation(Pchar.location)].box3.items.meat = 1;
				Logit(LanguageConvertString(tmpLangFileID,"I'll need a foodchest first."));
				PlaySound("VOICE\ENGLISH\blaze_hah.wav");

				LAi_QuestDelay("meat_check", 0.5);
			}
		break;
	//................................................................................
		case "ale_check":
			Pchar.quest.ale_taken.win_condition.l1 = "item";
			Pchar.quest.ale_taken.win_condition.l1.character = Pchar.id;
			Pchar.quest.ale_taken.win_condition.l1.item = "ale";
			Pchar.quest.ale_taken.win_condition = "ale_taken";
		break;

		case "ale_taken":
			if(CheckCharacterItem(Pchar,"pistolfoodchest"))
			{
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "pistolfoodchest");
				GiveItem2Character(Pchar, "pistolfoodchest2");
				EquipCharacterByItem(Pchar, "pistolfoodchest2");
			}
			else
			{
				TakeItemFromCharacter(Pchar, "ale");
				locations[FindLocation(Pchar.location)].box4.items.ale = 1;
				Logit(LanguageConvertString(tmpLangFileID,"I'll need a foodchest first."));
				PlaySound("VOICE\ENGLISH\blaze_hah.wav");

				LAi_QuestDelay("ale_check", 0.5);
			}
		break;
	//................................................................................
		case "bladefish_check":
			Pchar.quest.bladefish_taken.win_condition.l1 = "item";
			Pchar.quest.bladefish_taken.win_condition.l1.character = Pchar.id;
			Pchar.quest.bladefish_taken.win_condition.l1.item = "bladefish";
			Pchar.quest.bladefish_taken.win_condition = "bladefish_taken";
		break;

		case "bladefish_taken":
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			EquipCharacterByItem(Pchar, "bladefish");
		break;
	//......................................................................................................................
		case "pickup_foodchest_place_mdchest":
			//from itemlogic
			Locations[FindLocation("wr_food_supply")].image = "";
			DoQuestReloadToLocation("wr_food_supply", "goto", "goto3", "pickup_foodchest_place_mdchest1");
		break;

		case "pickup_foodchest_place_mdchest1":
			Locations[FindLocation("wr_food_supply")].image = "wr_food_supply.tga";
			GiveItem2Character(Pchar, "pistolfoodchest");
			EquipCharacterByItem(Pchar, "pistolfoodchest");
			GiveItem2Character(Pchar, "2winebottles");
			PlaySound("OBJECTS\DUEL\man_attack1.wav");
		break;
	//......................................................................................................................
		case "pickup_mdchest_place_nothing":
			//from itemlogic
			Locations[FindLocation("wr_food_supply")].image = "";
			DoQuestReloadToLocation("wr_food_supply", "goto", "goto3", "pickup_mdchest_place_nothing1");
		break;

		case "pickup_mdchest_place_nothing1":
			Locations[FindLocation("wr_food_supply")].image = "wr_food_supply.tga";
			PlaySound("INTERFACE\important_item.wav");
			Log_SetStringToLog(XI_ConvertString("You take item"));

			switch(Pchar.quest.med_chest)
			{
				case "F2B_placed":
					GiveItem2Character(Pchar, "pistolmdchest_F2A");
					GiveItem2Character(Pchar, "pistolmdchest_F2B");
					EquipCharacterByItem(Pchar, "pistolmdchest_F2B");
					if(CheckAttribute(Pchar,"quest.cellar_md_B2") && Pchar.quest.cellar_md_B2 == "placed")
					{
			 			GiveItem2Character(Pchar, "mdchest_B2");
					}
				break;

				case "F2B_C_placed":
					if(CheckAttribute(Pchar,"quest.cellar_bandages") && Pchar.quest.cellar_bandages == "placed")
					{
						GiveItem2Character(Pchar, "pistolmdchest_F2A_C");
						GiveItem2Character(Pchar, "pistolmdchest_F2B_C");
						EquipCharacterByItem(Pchar, "pistolmdchest_F2B_C");
						if(CheckAttribute(Pchar,"quest.cellar_md_B2") && Pchar.quest.cellar_md_B2 == "placed")
			 			{
							GiveItem2Character(Pchar, "mdchest_B2");
						}
						GiveItem2Character(Pchar, "rolls_of_bandages");
					}
					else
					{
						GiveItem2Character(Pchar, "pistolmdchest_F2A");
						GiveItem2Character(Pchar, "pistolmdchest_F2B");
						EquipCharacterByItem(Pchar, "pistolmdchest_F2B");
						if(CheckAttribute(Pchar,"quest.cellar_md_B2") && Pchar.quest.cellar_md_B2 == "placed")
			 			{
							GiveItem2Character(Pchar, "mdchest_B2");
						}
					}
				break;

				case "F2B_S_placed":
					GiveItem2Character(Pchar, "pistolmdchest_F2A_S");
					GiveItem2Character(Pchar, "pistolmdchest_F2B_S");
					EquipCharacterByItem(Pchar, "pistolmdchest_F2B_S");
					if(CheckAttribute(Pchar,"quest.cellar_md_B2") && Pchar.quest.cellar_md_B2 == "placed")
					{
			 			GiveItem2Character(Pchar, "mdchest_B2");
					}
					if(CheckAttribute(Pchar,"quest.cellar_leeches") && Pchar.quest.cellar_leeches == "placed")
					{
						GiveItem2Character(Pchar, "leeches");
					}
				break;

				case "F2B_CS_placed":
					if(CheckAttribute(Pchar,"quest.cellar_bandages") && Pchar.quest.cellar_bandages == "placed")
					{
						GiveItem2Character(Pchar, "pistolmdchest_F2A_CS");
						GiveItem2Character(Pchar, "pistolmdchest_F2B_CS");
						EquipCharacterByItem(Pchar, "pistolmdchest_F2B_CS");
						if(CheckAttribute(Pchar,"quest.cellar_md_B2") && Pchar.quest.cellar_md_B2 == "placed")
			 			{
							GiveItem2Character(Pchar, "mdchest_B2");
						}
						GiveItem2Character(Pchar, "rolls_of_bandages");
					}
					else
					{
						GiveItem2Character(Pchar, "pistolmdchest_F2A_S");
						GiveItem2Character(Pchar, "pistolmdchest_F2B_S");
						EquipCharacterByItem(Pchar, "pistolmdchest_F2B_S");
						if(CheckAttribute(Pchar,"quest.cellar_md_B2") && Pchar.quest.cellar_md_B2 == "placed")
			 			{
							GiveItem2Character(Pchar, "mdchest_B2");
						}
					}

					if(CheckAttribute(Pchar,"quest.cellar_leeches") && Pchar.quest.cellar_leeches == "placed")
					{
						GiveItem2Character(Pchar, "leeches");
					}
				break;

				case "F3B_placed":
					GiveItem2Character(Pchar, "pistolmdchest_F3A");
					GiveItem2Character(Pchar, "pistolmdchest_F3B");
					EquipCharacterByItem(Pchar, "pistolmdchest_F3B");
					if(CheckAttribute(Pchar,"quest.cellar_md_B3") && Pchar.quest.cellar_md_B3 == "placed")
					{
			 			GiveItem2Character(Pchar, "mdchest_B3");
					}
				break;

				case "F3B_C_placed":
					if(CheckAttribute(Pchar,"quest.cellar_bandages") && Pchar.quest.cellar_bandages == "placed")
					{
						GiveItem2Character(Pchar, "pistolmdchest_F3A_C");
						GiveItem2Character(Pchar, "pistolmdchest_F3B_C");
						EquipCharacterByItem(Pchar, "pistolmdchest_F3B_C");
						if(CheckAttribute(Pchar,"quest.cellar_md_B3") && Pchar.quest.cellar_md_B3 == "placed")
			 			{
							GiveItem2Character(Pchar, "mdchest_B3");
						}
						GiveItem2Character(Pchar, "rolls_of_bandages");
					}
					else
					{
						GiveItem2Character(Pchar, "pistolmdchest_F3A");
						GiveItem2Character(Pchar, "pistolmdchest_F3B");
						EquipCharacterByItem(Pchar, "pistolmdchest_F3B");
						if(CheckAttribute(Pchar,"quest.cellar_md_B3") && Pchar.quest.cellar_md_B3 == "placed")
			 			{
							GiveItem2Character(Pchar, "mdchest_B3");
						}
					}
				break;

				case "F3B_S_placed":
					GiveItem2Character(Pchar, "pistolmdchest_F3A_S");
					GiveItem2Character(Pchar, "pistolmdchest_F3B_S");
					EquipCharacterByItem(Pchar, "pistolmdchest_F3B_S");
					if(CheckAttribute(Pchar,"quest.cellar_md_B3") && Pchar.quest.cellar_md_B3 == "placed")
					{
			 				GiveItem2Character(Pchar, "mdchest_B3");
					}
					if(CheckAttribute(Pchar,"quest.cellar_leeches") && Pchar.quest.cellar_leeches == "placed")
					{
						GiveItem2Character(Pchar, "leeches");
					}
				break;

				case "F3B_CS_placed":
					if(CheckAttribute(Pchar,"quest.cellar_bandages") && Pchar.quest.cellar_bandages == "placed")
					{
						GiveItem2Character(Pchar, "pistolmdchest_F3A_CS");
						GiveItem2Character(Pchar, "pistolmdchest_F3B_CS");
						EquipCharacterByItem(Pchar, "pistolmdchest_F3B_CS");
						if(CheckAttribute(Pchar,"quest.cellar_md_B3") && Pchar.quest.cellar_md_B3 == "placed")
			 			{
							GiveItem2Character(Pchar, "mdchest_B3");
						}
						GiveItem2Character(Pchar, "rolls_of_bandages");
					}
					else
					{
						GiveItem2Character(Pchar, "pistolmdchest_F3A_S");
						GiveItem2Character(Pchar, "pistolmdchest_F3B_S");
						EquipCharacterByItem(Pchar, "pistolmdchest_F3B_S");
						if(CheckAttribute(Pchar,"quest.cellar_md_B3") && Pchar.quest.cellar_md_B3 == "placed")
			 			{
							GiveItem2Character(Pchar, "mdchest_B3");
						}
					}

					if(CheckAttribute(Pchar,"quest.cellar_leeches") && Pchar.quest.cellar_leeches == "placed")
					{
						GiveItem2Character(Pchar, "leeches");
					}
				break;

				case "cloth_placed":
					GiveItem2Character(Pchar, "pistolmdcloth");
					EquipCharacterByItem(Pchar, "pistolmdcloth");
				break;

				case "sack_placed":
					GiveItem2Character(Pchar, "pistolmdsack");
					EquipCharacterByItem(Pchar, "pistolmdsack");
					if(CheckAttribute(Pchar,"quest.cellar_leeches") && Pchar.quest.cellar_leeches == "placed")
					{
						GiveItem2Character(Pchar, "leeches");
					}
				break;

				case "clothsack_placed":
					GiveItem2Character(Pchar, "pistolmdclothsack");
					EquipCharacterByItem(Pchar, "pistolmdclothsack");
					if(CheckAttribute(Pchar,"quest.cellar_leeches") && Pchar.quest.cellar_leeches == "placed")
					{
						GiveItem2Character(Pchar, "leeches");
					}
				break;
			}

			if(CheckAttribute(Pchar,"quest.cellar_meds1") && Pchar.quest.cellar_meds1 == "placed")
			 	GiveItem2Character(Pchar, "meds1");
			if(CheckAttribute(Pchar,"quest.cellar_meds2") && Pchar.quest.cellar_meds2 == "placed")
			 	GiveItem2Character(Pchar, "meds2");
			if(CheckAttribute(Pchar,"quest.cellar_meds3") && Pchar.quest.cellar_meds3 == "placed")
			 	GiveItem2Character(Pchar, "meds3");
			if(CheckAttribute(Pchar,"quest.cellar_Potion3") && Pchar.quest.cellar_Potion3 == "placed")
			 	GiveItem2Character(Pchar, "Potion3");
			if(CheckAttribute(Pchar,"quest.cellar_Pistolgas") && Pchar.quest.cellar_Pistolgas == "placed")
			 	GiveItem2Character(Pchar, "Pistolgas");
			if(CheckAttribute(Pchar,"quest.cellar_mercury") && Pchar.quest.cellar_mercury == "placed")
			 	GiveItem2Character(Pchar, "mercury_bottles");
			if(CheckAttribute(Pchar,"quest.cellar_emptyb") && Pchar.quest.cellar_emptyb == "placed")
			 	GiveItem2Character(Pchar, "empty_bottles");

			PlaySound("OBJECTS\DUEL\man_attack1.wav");

			LAi_QuestDelay("all6_meds_check", 0.1);//you placed F2 but have added more meds while all other meds were stacked here
		break;
	//......................................................................................................................
		case "all_food_check":
			if(CheckCharacterItem(Pchar,"pistolfoodchest2") && CheckCharacterItem(Pchar,"2winebottles")
				&& CheckCharacterItem(Pchar,"meat") && CheckCharacterItem(Pchar,"bread")
				&& CheckCharacterItem(Pchar,"ale") && CheckCharacterItem(Pchar,"bladefish"))
			{
				Pchar.quest.all_food_check1.win_condition.l1 = "ExitFromLocation";
				Pchar.quest.all_food_check1.win_condition.l1.location = "wr_food_supply";
				Pchar.quest.all_food_check1.win_condition = "all_food_check1";
			}
			else LAi_QuestDelay("all_food_check", 0.5);
		break;

		case "all_food_check1":
			TakeItemFromCharacter(Pchar, "key15");
			ChangeCharacterAddressGroup(characterFromID("fake_Elias_Belt"), "Redmond_town_03", "goto", "med2");
			ChangeCharacterAddressGroup(characterFromID("fake_Gillian_Atterbury"), "Redmond_town_03", "goto", "med3");
		break;

		case "church_queue_2":
			int med2;

			switch (rand(17))
			{
				case 0: med2 = 0; ChangeCharacterAddressGroup(characterFromID("fake_Red_Docker_1"), "Redmond_town_03", "goto", "med2"); break;
				case 1: med2 = 1; ChangeCharacterAddressGroup(characterFromID("fake_Red_Docker_2"), "Redmond_town_03", "goto", "med2"); break;
				case 2: med2 = 2; ChangeCharacterAddressGroup(characterFromID("fake_Gillian_Atterbury"), "Redmond_town_03", "goto", "med2"); break;
				case 3: med2 = 3; ChangeCharacterAddressGroup(characterFromID("fake_Griffith_Peabody"), "Redmond_town_03", "goto", "med2"); break;
				case 4: med2 = 4; ChangeCharacterAddressGroup(characterFromID("fake_Henry"), "Redmond_town_03", "goto", "med2"); break;
				case 5: med2 = 5; ChangeCharacterAddressGroup(characterFromID("fake_Jane_Attwell"), "Redmond_town_03", "goto", "med2"); break;
				case 6: med2 = 6; ChangeCharacterAddressGroup(characterFromID("fake_Marvin_Peutherer"), "Redmond_town_03", "goto", "med2"); break;
				case 7: med2 = 7; ChangeCharacterAddressGroup(characterFromID("fake_Samuel_Vallentain"), "Redmond_town_03", "goto", "med2"); break;
				case 8: med2 = 8; ChangeCharacterAddressGroup(characterFromID("fake_Elias_Belt"), "Redmond_town_03", "goto", "med2"); break;
				case 9: med2 = 9; ChangeCharacterAddressGroup(characterFromID("fake_Patrick_Bisset"), "Redmond_town_03", "goto", "med2"); break;
				case 10: med2 = 10; ChangeCharacterAddressGroup(characterFromID("fake_Flora_Kempster"), "Redmond_town_03", "goto", "med2"); break;
				case 11: med2 = 11; ChangeCharacterAddressGroup(characterFromID("fake_Randolf_Potter"), "Redmond_town_03", "goto", "med2"); break;
				case 12: med2 = 12; ChangeCharacterAddressGroup(characterFromID("fake_Morys_Biddulph"), "Redmond_town_03", "goto", "med2"); break;
				case 13: med2 = 13; ChangeCharacterAddressGroup(characterFromID("fake_Roger_Hayes"), "Redmond_town_03", "goto", "med2"); break;
				case 14: med2 = 14; ChangeCharacterAddressGroup(characterFromID("fake_smoker2"), "Redmond_town_03", "goto", "med2"); break;
				case 15: med2 = 15; ChangeCharacterAddressGroup(characterFromID("fake_Flann_Marrow"), "Redmond_town_03", "goto", "med2"); break;
				case 16: med2 = 16; ChangeCharacterAddressGroup(characterFromID("fake_red_blacksmith"), "Redmond_town_03", "goto", "med2"); break;
				case 17: med2 = 17; ChangeCharacterAddressGroup(characterFromID("fake_Eng_soldier_31"), "Redmond_town_03", "goto", "med2"); break;
			}

			LAi_QuestDelay("church_queue_3", 0.1);
		break;

		case "church_queue_3":
			int med3;

			switch (rand(17))
			{
				case 0: med3 = 0; if(med3 == med2)
					{ LAi_QuestDelay("church_queue_3", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Red_Docker_1"), "Redmond_town_03", "goto", "med3");  LAi_QuestDelay("church_queue_4", 0.1); } break;

				case 1: med3 = 1; if(med3 == med2)
					{ LAi_QuestDelay("church_queue_3", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Red_Docker_2"), "Redmond_town_03", "goto", "med3");  LAi_QuestDelay("church_queue_4", 0.1); } break;

				case 2: med3 = 2; if(med3 == med2)
					{ LAi_QuestDelay("church_queue_3", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Gillian_Atterbury"), "Redmond_town_03", "goto", "med3");  LAi_QuestDelay("church_queue_4", 0.1); } break;

				case 3: med3 = 3; if(med3 == med2)
					{ LAi_QuestDelay("church_queue_3", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Griffith_Peabody"), "Redmond_town_03", "goto", "med3");  LAi_QuestDelay("church_queue_4", 0.1); } break;

				case 4: med3 = 4; if(med3 == med2)
					{ LAi_QuestDelay("church_queue_3", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Henry"), "Redmond_town_03", "goto", "med3");  LAi_QuestDelay("church_queue_4", 0.1); } break;

				case 5: med3 = 5; if(med3 == med2)
					{ LAi_QuestDelay("church_queue_3", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Jane_Attwell"), "Redmond_town_03", "goto", "med3");  LAi_QuestDelay("church_queue_4", 0.1); } break;

				case 6: med3 = 6; if(med3 == med2)
					{ LAi_QuestDelay("church_queue_3", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Marvin_Peutherer"), "Redmond_town_03", "goto", "med3");  LAi_QuestDelay("church_queue_4", 0.1); } break;

				case 7: med3 = 7; if(med3 == med2)
					{ LAi_QuestDelay("church_queue_3", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Samuel_Vallentain"), "Redmond_town_03", "goto", "med3");  LAi_QuestDelay("church_queue_4", 0.1); } break;

				case 8: med3 = 8; if(med3 == med2)
					{ LAi_QuestDelay("church_queue_3", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Elias_Belt"), "Redmond_town_03", "goto", "med3");  LAi_QuestDelay("church_queue_4", 0.1); } break;

				case 9: med3 = 9; if(med3 == med2)
					{ LAi_QuestDelay("church_queue_3", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Patrick_Bisset"), "Redmond_town_03", "goto", "med3");  LAi_QuestDelay("church_queue_4", 0.1); } break;

				case 10: med3 = 10; if(med3 == med2)
					{ LAi_QuestDelay("church_queue_3", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Flora_Kempster"), "Redmond_town_03", "goto", "med3");  LAi_QuestDelay("church_queue_4", 0.1); } break;

				case 11: med3 = 11; if(med3 == med2)
					{ LAi_QuestDelay("church_queue_3", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Randolf_Potter"), "Redmond_town_03", "goto", "med3");  LAi_QuestDelay("church_queue_4", 0.1); } break;

				case 12: med3 = 12; if(med3 == med2)
					{ LAi_QuestDelay("church_queue_3", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Morys_Biddulph"), "Redmond_town_03", "goto", "med3");  LAi_QuestDelay("church_queue_4", 0.1); } break;

				case 13: med3 = 13; if(med3 == med2)
					{ LAi_QuestDelay("church_queue_3", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Roger_Hayes"), "Redmond_town_03", "goto", "med3");  LAi_QuestDelay("church_queue_4", 0.1); } break;

				case 14: med3 = 14; if(med3 == med2)
					{ LAi_QuestDelay("church_queue_3", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_smoker2"), "Redmond_town_03", "goto", "med3");  LAi_QuestDelay("church_queue_4", 0.1); } break;

				case 15: med3 = 15; if(med3 == med2)
					{ LAi_QuestDelay("church_queue_3", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Flann_Marrow"), "Redmond_town_03", "goto", "med3");  LAi_QuestDelay("church_queue_4", 0.1); } break;

				case 16: med3 = 16; if(med3 == med2)
					{ LAi_QuestDelay("church_queue_3", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_red_blacksmith"), "Redmond_town_03", "goto", "med3");  LAi_QuestDelay("church_queue_4", 0.1); } break;

				case 17: med3 = 17; if(med3 == med2)
					{ LAi_QuestDelay("church_queue_3", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Eng_soldier_31"), "Redmond_town_03", "goto", "med3");  LAi_QuestDelay("church_queue_4", 0.1); } break;
			}
		break;

		case "church_queue_4":
			int med4;

			switch (rand(17))
			{
				case 0: med4 = 0; if(med4 == med2 || med4 == med3)
					{ LAi_QuestDelay("church_queue_4", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Red_Docker_1"), "Redmond_town_03", "goto", "med4");  LAi_QuestDelay("church_queue_5", 0.1); } break;

				case 1: med4 = 1; if(med4 == med2 || med4 == med3)
					{ LAi_QuestDelay("church_queue_4", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Red_Docker_2"), "Redmond_town_03", "goto", "med4");  LAi_QuestDelay("church_queue_5", 0.1); } break;

				case 2: med4 = 2; if(med4 == med2 || med4 == med3)
					{ LAi_QuestDelay("church_queue_4", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Gillian_Atterbury"), "Redmond_town_03", "goto", "med4");  LAi_QuestDelay("church_queue_5", 0.1); } break;

				case 3: med4 = 3; if(med4 == med2 || med4 == med3)
					{ LAi_QuestDelay("church_queue_4", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Griffith_Peabody"), "Redmond_town_03", "goto", "med4");  LAi_QuestDelay("church_queue_5", 0.1); } break;

				case 4: med4 = 4; if(med4 == med2 || med4 == med3)
					{ LAi_QuestDelay("church_queue_4", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Henry"), "Redmond_town_03", "goto", "med4");  LAi_QuestDelay("church_queue_5", 0.1); } break;

				case 5: med4 = 5; if(med4 == med2 || med4 == med3)
					{ LAi_QuestDelay("church_queue_4", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Jane_Attwell"), "Redmond_town_03", "goto", "med4");  LAi_QuestDelay("church_queue_5", 0.1); } break;

				case 6: med4 = 6; if(med4 == med2 || med4 == med3)
					{ LAi_QuestDelay("church_queue_4", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Marvin_Peutherer"), "Redmond_town_03", "goto", "med4");  LAi_QuestDelay("church_queue_5", 0.1); } break;

				case 7: med4 = 7; if(med4 == med2 || med4 == med3)
					{ LAi_QuestDelay("church_queue_4", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Samuel_Vallentain"), "Redmond_town_03", "goto", "med4");  LAi_QuestDelay("church_queue_5", 0.1); } break;

				case 8: med4 = 8; if(med4 == med2 || med4 == med3)
					{ LAi_QuestDelay("church_queue_4", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Elias_Belt"), "Redmond_town_03", "goto", "med4");  LAi_QuestDelay("church_queue_5", 0.1); } break;

				case 9: med4 = 9; if(med4 == med2 || med4 == med3)
					{ LAi_QuestDelay("church_queue_4", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Patrick_Bisset"), "Redmond_town_03", "goto", "med4");  LAi_QuestDelay("church_queue_5", 0.1); } break;

				case 10: med4 = 10; if(med4 == med2 || med4 == med3)
					{ LAi_QuestDelay("church_queue_4", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Flora_Kempster"), "Redmond_town_03", "goto", "med4");  LAi_QuestDelay("church_queue_5", 0.1); } break;

				case 11: med4 = 11; if(med4 == med2 || med4 == med3)
					{ LAi_QuestDelay("church_queue_4", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Randolf_Potter"), "Redmond_town_03", "goto", "med4");  LAi_QuestDelay("church_queue_5", 0.1); } break;

				case 12: med4 = 12; if(med4 == med2 || med4 == med3)
					{ LAi_QuestDelay("church_queue_4", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Morys_Biddulph"), "Redmond_town_03", "goto", "med4");  LAi_QuestDelay("church_queue_5", 0.1); } break;

				case 13: med4 = 13; if(med4 == med2 || med4 == med3)
					{ LAi_QuestDelay("church_queue_4", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Roger_Hayes"), "Redmond_town_03", "goto", "med4");  LAi_QuestDelay("church_queue_5", 0.1); } break;

				case 14: med4 = 14; if(med4 == med2 || med4 == med3)
					{ LAi_QuestDelay("church_queue_4", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_smoker2"), "Redmond_town_03", "goto", "med4");  LAi_QuestDelay("church_queue_5", 0.1); } break;

				case 15: med4 = 15; if(med4 == med2 || med4 == med3)
					{ LAi_QuestDelay("church_queue_4", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Flann_Marrow"), "Redmond_town_03", "goto", "med4");  LAi_QuestDelay("church_queue_5", 0.1); } break;

				case 16: med4 = 16; if(med4 == med2 || med4 == med3)
					{ LAi_QuestDelay("church_queue_4", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_red_blacksmith"), "Redmond_town_03", "goto", "med4");  LAi_QuestDelay("church_queue_5", 0.1); } break;

				case 17: med4 = 17; if(med4 == med2 || med4 == med3)
					{ LAi_QuestDelay("church_queue_4", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Eng_soldier_31"), "Redmond_town_03", "goto", "med4");  LAi_QuestDelay("church_queue_5", 0.1); } break;
			}
		break;

		case "church_queue_5":
			int med5;
			switch (rand(17))
			{
				case 0: med5 = 0; if(med5 == med2 || med5 == med3 || med5 == med4)
					{ LAi_QuestDelay("church_queue_5", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Red_Docker_1"), "Redmond_town_03", "goto", "med5");  LAi_QuestDelay("church_queue_6", 0.1); } break;

				case 1: med5 = 1; if(med5 == med2 || med5 == med3 || med5 == med4)
					{ LAi_QuestDelay("church_queue_5", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Red_Docker_2"), "Redmond_town_03", "goto", "med5");  LAi_QuestDelay("church_queue_6", 0.1); } break;

				case 2: med5 = 2; if(med5 == med2 || med5 == med3 || med5 == med4)
					{ LAi_QuestDelay("church_queue_5", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Gillian_Atterbury"), "Redmond_town_03", "goto", "med5");  LAi_QuestDelay("church_queue_6", 0.1); } break;

				case 3: med5 = 3; if(med5 == med2 || med5 == med3 || med5 == med4)
					{ LAi_QuestDelay("church_queue_5", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Griffith_Peabody"), "Redmond_town_03", "goto", "med5");  LAi_QuestDelay("church_queue_6", 0.1); } break;

				case 4: med5 = 4; if(med5 == med2 || med5 == med3 || med5 == med4)
					{ LAi_QuestDelay("church_queue_5", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Henry"), "Redmond_town_03", "goto", "med5");  LAi_QuestDelay("church_queue_6", 0.1); } break;

				case 5: med5 = 5; if(med5 == med2 || med5 == med3 || med5 == med4)
					{ LAi_QuestDelay("church_queue_5", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Jane_Attwell"), "Redmond_town_03", "goto", "med5");  LAi_QuestDelay("church_queue_6", 0.1); } break;

				case 6: med5 = 6; if(med5 == med2 || med5 == med3 || med5 == med4)
					{ LAi_QuestDelay("church_queue_5", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Marvin_Peutherer"), "Redmond_town_03", "goto", "med5");  LAi_QuestDelay("church_queue_6", 0.1); } break;

				case 7: med5 = 7; if(med5 == med2 || med5 == med3 || med5 == med4)
					{ LAi_QuestDelay("church_queue_5", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Samuel_Vallentain"), "Redmond_town_03", "goto", "med5");  LAi_QuestDelay("church_queue_6", 0.1); } break;

				case 8: med5 = 8; if(med5 == med2 || med5 == med3 || med5 == med4)
					{ LAi_QuestDelay("church_queue_5", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Elias_Belt"), "Redmond_town_03", "goto", "med5");  LAi_QuestDelay("church_queue_6", 0.1); } break;

				case 9: med5 = 9; if(med5 == med2 || med5 == med3 || med5 == med4)
					{ LAi_QuestDelay("church_queue_5", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Patrick_Bisset"), "Redmond_town_03", "goto", "med5");  LAi_QuestDelay("church_queue_6", 0.1); } break;

				case 10: med5 = 10;if(med5 == med2 || med5 == med3 || med5 == med4)
					{ LAi_QuestDelay("church_queue_5", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Flora_Kempster"), "Redmond_town_03", "goto", "med5");  LAi_QuestDelay("church_queue_6", 0.1); } break;

				case 11: med5 = 11; if(med5 == med2 || med5 == med3 || med5 == med4)
					{ LAi_QuestDelay("church_queue_5", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Randolf_Potter"), "Redmond_town_03", "goto", "med5");  LAi_QuestDelay("church_queue_6", 0.1); } break;

				case 12: med5 = 12; if(med5 == med2 || med5 == med3 || med5 == med4)
					{ LAi_QuestDelay("church_queue_5", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Morys_Biddulph"), "Redmond_town_03", "goto", "med5");  LAi_QuestDelay("church_queue_6", 0.1); } break;

				case 13: med5 = 13; if(med5 == med2 || med5 == med3 || med5 == med4)
					{ LAi_QuestDelay("church_queue_5", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Roger_Hayes"), "Redmond_town_03", "goto", "med5");  LAi_QuestDelay("church_queue_6", 0.1); } break;

				case 14: med5 = 14; if(med5 == med2 || med5 == med3 || med5 == med4)
					{ LAi_QuestDelay("church_queue_5", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_smoker2"), "Redmond_town_03", "goto", "med5");  LAi_QuestDelay("church_queue_6", 0.1); } break;

				case 15: med5 = 15; if(med5 == med2 || med5 == med3 || med5 == med4)
					{ LAi_QuestDelay("church_queue_5", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Flann_Marrow"), "Redmond_town_03", "goto", "med5");  LAi_QuestDelay("church_queue_6", 0.1); } break;

				case 16: med5 = 16; if(med5 == med2 || med5 == med3 || med5 == med4)
					{ LAi_QuestDelay("church_queue_5", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_red_blacksmith"), "Redmond_town_03", "goto", "med5");  LAi_QuestDelay("church_queue_6", 0.1); } break;

				case 17: med5 = 17; if(med5 == med2 || med5 == med3 || med5 == med4)
					{ LAi_QuestDelay("church_queue_5", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Eng_soldier_31"), "Redmond_town_03", "goto", "med5");  LAi_QuestDelay("church_queue_6", 0.1); } break;
			}
		break;

		case "church_queue_6":
		    if(rand(2) <2)
		    {
			//67% chance for a queue longer than 4 persons
			int med6;

			switch (rand(17))
			{
				case 0: med6 = 0; if(med6 == med2 || med6 == med3 || med6 == med4 || med6 == med5)
					{ LAi_QuestDelay("church_queue_6", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Red_Docker_1"), "Redmond_town_03", "goto", "med6");  LAi_QuestDelay("church_queue_7", 0.1); } break;

				case 1: med6 = 1; if(med6 == med2 || med6 == med3 || med6 == med4 || med6 == med5)
					{ LAi_QuestDelay("church_queue_6", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Red_Docker_2"), "Redmond_town_03", "goto", "med6");  LAi_QuestDelay("church_queue_7", 0.1); } break;

				case 2: med6 = 2;
					if(med6 == med2 || med6 == med3 || med6 == med4 || med6 == med5)
					{ LAi_QuestDelay("church_queue_6", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Gillian_Atterbury"), "Redmond_town_03", "goto", "med6");  LAi_QuestDelay("church_queue_7", 0.1); } break;

				case 3: med6 = 3; if(med6 == med2 || med6 == med3 || med6 == med4 || med6 == med5)
					{ LAi_QuestDelay("church_queue_6", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Griffith_Peabody"), "Redmond_town_03", "goto", "med6");  LAi_QuestDelay("church_queue_7", 0.1); } break;

				case 4: med6 = 4; if(med6 == med2 || med6 == med3 || med6 == med4 || med6 == med5)
					{ LAi_QuestDelay("church_queue_6", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Henry"), "Redmond_town_03", "goto", "med6");  LAi_QuestDelay("church_queue_7", 0.1); } break;

				case 5: med6 = 5; if(med6 == med2 || med6 == med3 || med6 == med4 || med6 == med5)
					{ LAi_QuestDelay("church_queue_6", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Jane_Attwell"), "Redmond_town_03", "goto", "med6");  LAi_QuestDelay("church_queue_7", 0.1); } break;

				case 6: med6 = 6; if(med6 == med2 || med6 == med3 || med6 == med4 || med6 == med5)
					{ LAi_QuestDelay("church_queue_6", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Marvin_Peutherer"), "Redmond_town_03", "goto", "med6");  LAi_QuestDelay("church_queue_7", 0.1); } break;

				case 7: med6 = 7; if(med6 == med2 || med6 == med3 || med6 == med4 || med6 == med5)
					{ LAi_QuestDelay("church_queue_6", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Samuel_Vallentain"), "Redmond_town_03", "goto", "med6");  LAi_QuestDelay("church_queue_7", 0.1); } break;

				case 8: med6 = 8; if(med6 == med2 || med6 == med3 || med6 == med4 || med6 == med5)
					{ LAi_QuestDelay("church_queue_6", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Elias_Belt"), "Redmond_town_03", "goto", "med6");  LAi_QuestDelay("church_queue_7", 0.1); } break;

				case 9: med6 = 9; if(med6 == med2 || med6 == med3 || med6 == med4 || med6 == med5)
					{ LAi_QuestDelay("church_queue_6", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Patrick_Bisset"), "Redmond_town_03", "goto", "med6");  LAi_QuestDelay("church_queue_7", 0.1); } break;

				case 10: med6 = 10; if(med6 == med2 || med6 == med3 || med6 == med4 || med6 == med5)
					{ LAi_QuestDelay("church_queue_6", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Flora_Kempster"), "Redmond_town_03", "goto", "med6");  LAi_QuestDelay("church_queue_7", 0.1); } break;

				case 11: med6 = 11; if(med6 == med2 || med6 == med3 || med6 == med4 || med6 == med5)
					{ LAi_QuestDelay("church_queue_6", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Randolf_Potter"), "Redmond_town_03", "goto", "med6");  LAi_QuestDelay("church_queue_7", 0.1); } break;

				case 12: med6 = 12; if(med6 == med2 || med6 == med3 || med6 == med4 || med6 == med5)
					{ LAi_QuestDelay("church_queue_6", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Morys_Biddulph"), "Redmond_town_03", "goto", "med6");  LAi_QuestDelay("church_queue_7", 0.1); } break;

				case 13: med6 = 13; if(med6 == med2 || med6 == med3 || med6 == med4 || med6 == med5)
					{ LAi_QuestDelay("church_queue_6", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Roger_Hayes"), "Redmond_town_03", "goto", "med6");  LAi_QuestDelay("church_queue_7", 0.1); } break;

				case 14: med6 = 14; if(med6 == med2 || med6 == med3 || med6 == med4 || med6 == med5)
					{ LAi_QuestDelay("church_queue_6", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_smoker2"), "Redmond_town_03", "goto", "med6");  LAi_QuestDelay("church_queue_7", 0.1); } break;

				case 15: med6 = 15; if(med6 == med2 || med6 == med3 || med6 == med4 || med6 == med5)
					{ LAi_QuestDelay("church_queue_6", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Flann_Marrow"), "Redmond_town_03", "goto", "med6");  LAi_QuestDelay("church_queue_7", 0.1); } break;

				case 16: med6 = 16; if(med6 == med2 || med6 == med3 || med6 == med4 || med6 == med5)
					{ LAi_QuestDelay("church_queue_6", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_red_blacksmith"), "Redmond_town_03", "goto", "med6");  LAi_QuestDelay("church_queue_7", 0.1); } break;

				case 17: med6 = 17; if(med6 == med2 || med6 == med3 || med6 == med4 || med6 == med5)
					{ LAi_QuestDelay("church_queue_6", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Eng_soldier_31"), "Redmond_town_03", "goto", "med6");  LAi_QuestDelay("church_queue_7", 0.1); } break;
			}
		    } else LAi_QuestDelay("church_queue_reset", 0.1);
		break;

		case "church_queue_7":
		    if(rand(1) <1)
		    {
			//50% chance for a queue longer than 5 persons
			int med7;

			switch (rand(17))
			{
				case 0: med7 = 0; if(med7 == med2 || med7 == med3 || med7 == med4 || med7 == med5 || med7 == med6)
					{ LAi_QuestDelay("church_queue_7", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Red_Docker_1"), "Redmond_town_03", "goto", "med7");  LAi_QuestDelay("church_queue_reset", 0.1); } break;

				case 1: med7 = 1; if(med7 == med2 || med7 == med3 || med7 == med4 || med7 == med5 || med7 == med6)
					{ LAi_QuestDelay("church_queue_7", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Red_Docker_2"), "Redmond_town_03", "goto", "med7");  LAi_QuestDelay("church_queue_reset", 0.1); } break;

				case 2: med7 = 2; if(med7 == med2 || med7 == med3 || med7 == med4 || med7 == med5 || med7 == med6)
					{ LAi_QuestDelay("church_queue_7", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Gillian_Atterbury"), "Redmond_town_03", "goto", "med7");  LAi_QuestDelay("church_queue_reset", 0.1); } break;

				case 3: med7 = 3; if(med7 == med2 || med7 == med3 || med7 == med4 || med7 == med5 || med7 == med6)
					{ LAi_QuestDelay("church_queue_7", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Griffith_Peabody"), "Redmond_town_03", "goto", "med7");  LAi_QuestDelay("church_queue_reset", 0.1); } break;

				case 4: med7 = 4; if(med7 == med2 || med7 == med3 || med7 == med4 || med7 == med5 || med7 == med6)
					{ LAi_QuestDelay("church_queue_7", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Henry"), "Redmond_town_03", "goto", "med7");  LAi_QuestDelay("church_queue_reset", 0.1); } break;

				case 5: med7 = 5; if(med7 == med2 || med7 == med3 || med7 == med4 || med7 == med5 || med7 == med6)
					{ LAi_QuestDelay("church_queue_7", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Jane_Attwell"), "Redmond_town_03", "goto", "med7");  LAi_QuestDelay("church_queue_reset", 0.1); } break;

				case 6: med7 = 6; if(med7 == med2 || med7 == med3 || med7 == med4 || med7 == med5 || med7 == med6)
					{ LAi_QuestDelay("church_queue_7", 0.1);	}
					else { ChangeCharacterAddressGroup(characterFromID("fake_Marvin_Peutherer"), "Redmond_town_03", "goto", "med7");  LAi_QuestDelay("church_queue_reset", 0.1); } break;

				case 7: med7 = 7; if(med7 == med2 || med7 == med3 || med7 == med4 || med7 == med5 || med7 == med6)
					{ LAi_QuestDelay("church_queue_7", 0.1);	}
					else { ChangeCharacterAddressGroup(characterFromID("fake_Samuel_Vallentain"), "Redmond_town_03", "goto", "med7");  LAi_QuestDelay("church_queue_reset", 0.1); } break;

				case 8: med7 = 8; if(med7 == med2 || med7 == med3 || med7 == med4 || med7 == med5 || med7 == med6)
					{ LAi_QuestDelay("church_queue_7", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_Elias_Belt"), "Redmond_town_03", "goto", "med7");  LAi_QuestDelay("church_queue_reset", 0.1); } break;

				case 9: med7 = 9; if(med7 == med2 || med7 == med3 || med7 == med4 || med7 == med5 || med7 == med6)
					{ LAi_QuestDelay("church_queue_7", 0.1);	}
					else { ChangeCharacterAddressGroup(characterFromID("fake_Patrick_Bisset"), "Redmond_town_03", "goto", "med7");  LAi_QuestDelay("church_queue_reset", 0.1); } break;

				case 10: med7 = 10; if(med7 == med2 || med7 == med3 || med7 == med4 || med7 == med5 || med7 == med6)
					{ LAi_QuestDelay("church_queue_7", 0.1);	}
					else { ChangeCharacterAddressGroup(characterFromID("fake_Flora_Kempster"), "Redmond_town_03", "goto", "med7");  LAi_QuestDelay("church_queue_reset", 0.1); } break;

				case 11: med7 = 11; if(med7 == med2 || med7 == med3 || med7 == med4 || med7 == med5 || med7 == med6)
					{ LAi_QuestDelay("church_queue_7", 0.1);	}
					else { ChangeCharacterAddressGroup(characterFromID("fake_Randolf_Potter"), "Redmond_town_03", "goto", "med7");  LAi_QuestDelay("church_queue_reset", 0.1); } break;

				case 12: med7 = 12; if(med7 == med2 || med7 == med3 || med7 == med4 || med7 == med5 || med7 == med6)
					{ LAi_QuestDelay("church_queue_7", 0.1);	}
					else { ChangeCharacterAddressGroup(characterFromID("fake_Morys_Biddulph"), "Redmond_town_03", "goto", "med7");  LAi_QuestDelay("church_queue_reset", 0.1); } break;

				case 13: med7 = 13; if(med7 == med2 || med7 == med3 || med7 == med4 || med7 == med5 || med7 == med6)
					{ LAi_QuestDelay("church_queue_7", 0.1);	}
					else { ChangeCharacterAddressGroup(characterFromID("fake_Roger_Hayes"), "Redmond_town_03", "goto", "med7");  LAi_QuestDelay("church_queue_reset", 0.1); } break;

				case 14: med7 = 14; if(med7 == med2 || med7 == med3 || med7 == med4 || med7 == med5 || med7 == med6)
					{ LAi_QuestDelay("church_queue_7", 0.1); }
					else { ChangeCharacterAddressGroup(characterFromID("fake_smoker2"), "Redmond_town_03", "goto", "med7");  LAi_QuestDelay("church_queue_reset", 0.1); } break;

				case 15: med7 = 15; if(med7 == med2 || med7 == med3 || med7 == med4 || med7 == med5 || med7 == med6)
					{ LAi_QuestDelay("church_queue_7", 0.1);	}
					else { ChangeCharacterAddressGroup(characterFromID("fake_Flann_Marrow"), "Redmond_town_03", "goto", "med7");  LAi_QuestDelay("church_queue_reset", 0.1); } break;

				case 16: med7 = 16; if(med7 == med2 || med7 == med3 || med7 == med4 || med7 == med5 || med7 == med6)
					{ LAi_QuestDelay("church_queue_7", 0.1);	}
					else { ChangeCharacterAddressGroup(characterFromID("fake_red_blacksmith"), "Redmond_town_03", "goto", "med7");  LAi_QuestDelay("church_queue_reset", 0.1); } break;

				case 17: med7 = 17; if(med7 == med2 || med7 == med3 || med7 == med4 || med7 == med5 || med7 == med6)
					{ LAi_QuestDelay("church_queue_7", 0.1);	}
					else { ChangeCharacterAddressGroup(characterFromID("fake_Eng_soldier_31"), "Redmond_town_03", "goto", "med7");  LAi_QuestDelay("church_queue_reset", 0.1); } break;
			}
		    } else LAi_QuestDelay("church_queue_reset", 0.1);
		break;

		case "church_queue_reset":
			Pchar.quest.church_queue_reset.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.church_queue_reset.win_condition.l1.location = "Redmond_town_03";
			Pchar.quest.church_queue_reset.win_condition = "church_queue_reset1";
		break;

		case "church_queue_reset1":
			ChangeCharacterAddressGroup(characterFromID("fake_Red_Docker_1"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("fake_Red_Docker_2"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("fake_Gillian_Atterbury"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("fake_Griffith_Peabody"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("fake_Henry"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("fake_Jane_Attwell"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("fake_Marvin_Peutherer"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("fake_Samuel_Vallentain"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("fake_Elias_Belt"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("fake_Patrick_Bisset"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("fake_Flora_Kempster"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("fake_Randolf_Potter"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("fake_Morys_Biddulph"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("fake_Roger_Hayes"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("fake_smoker2"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("fake_Flann_Marrow"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("fake_red_blacksmith"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("fake_Eng_soldier_31"), "none", "", "");

			if(CheckAttribute(Pchar,"quest.med_Cook") && Pchar.quest.med_Cook == "collection")
			{
				return;//stops queue
			}
			else LAi_QuestDelay("church_queue_2", 0.1);//starts all over again, new queue
		break;

		case "food_delivered":
			//from Cook dialog

			AddQuestRecord("Medicine_chest", "5");

			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladefish");
			TakeItemFromCharacter(Pchar, "pistolfoodchest2");
			TakeItemFromCharacter(Pchar, "2winebottles");
			TakeItemFromCharacter(Pchar, "bread");
			TakeItemFromCharacter(Pchar, "ale");
			TakeItemFromCharacter(Pchar, "meat");

			if(CheckCharacterItem(Pchar,"bladeviolin"))
			{
				EquipCharacterByItem(Pchar, "bladeviolin");
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladesurgcan3_r"))
				{
					EquipCharacterByItem(Pchar, "bladesurgcan3_r");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladesurgcan2_r"))
				{
					EquipCharacterByItem(Pchar, "bladesurgcan2_r");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladesurgcan_r"))
				{
					EquipCharacterByItem(Pchar, "bladesurgcan_r");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladesurgcan3"))
				{
					EquipCharacterByItem(Pchar, "bladesurgcan3");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladesurgcan2"))
				{
					EquipCharacterByItem(Pchar, "bladesurgcan2");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladesurgcan"))
				{
					EquipCharacterByItem(Pchar, "bladesurgcan");
				}
			}
			else
			{

				if(CheckCharacterItem(Pchar,"bladesurgery3_r"))
				{
					EquipCharacterByItem(Pchar, "bladesurgery3_r");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladesurgery2_r"))
				{
					EquipCharacterByItem(Pchar, "bladesurgery2_r");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladesurgery_r"))
				{
					EquipCharacterByItem(Pchar, "bladesurgery_r");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladesurgery3"))
				{
					EquipCharacterByItem(Pchar, "bladesurgery3");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladesurgery2"))
				{
					EquipCharacterByItem(Pchar, "bladesurgery2");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladesurgery"))
				{
					EquipCharacterByItem(Pchar, "bladesurgery");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladeprescriptions"))
				{
					EquipCharacterByItem(Pchar, "bladeprescriptions");
				}
			}
			else EquipCharacterByItem(Pchar, "bladeX4");

			LAi_QuestDelay("food_delivered1", 0.5);
		break;

		case "food_delivered1":
			Locations[FindLocation("Redmond_town_03")].models.always.locators = "Red03_l_JRH2";//table + foodchest + fish

			DoQuestReloadToLocation("Redmond_town_03", "goto", "med8", "_");

			ChangeCharacterAddressGroup(characterFromID("fake_Elias_Belt"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("fake_Gillian_Atterbury"), "none", "", "");
			LAi_QuestDelay("church_queue_2", 0.1);//directly to random queue system (from 2 persons)

			Pchar.quest.med_monkey_food = "done";

			if(CheckAttribute(Pchar,"quest.med_monkey_all6") && Pchar.quest.med_monkey_all6 == "done")
			{
				ChangeCharacterAddressGroup(CharacterFromID("grandma"), "wr_kitchen", "goto", "goto8");
				LAi_SetStayType(characterFromID("grandma"));
				LAi_QuestDelay("grandma_monkey_gunner", 0.1);
			}
		break;

		case "grandma_monkey_gunner":
			Locations[FindLocation("wr_residence")].reload.l7.disable = 0;		//to armory
	Locations[FindLocation("wr_armory")].reload.l1.disable = 0;	//to gps
			SetModel(characterFromID("Powdermonkey"), "monkey", "monkey", "monkey", 1.8, false);
			ChangeCharacterAddressGroup(CharacterFromID("PowderMonkey"), "wr_residence", "sit", "sit3");
			LAi_SetActorType(characterFromID("powdermonkey"));//stops from attacking
			ChangeCharacterAddressGroup(CharacterFromID("wr_oman1X"), "wr_gunpowder", "reload", "reload3_D");
			LAi_SetStayType(characterFromID("wr_oman1X"));
			RemoveCharacterEquip(CharacterFromID("wr_oman1X"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_oman1X"), "blade4");

			GiveItem2Character(characterFromID("wr_oman1X"), "bladep2");
			EquipCharacterByItem(CharacterFromID("wr_oman1X"), "bladep2");

			Pchar.quest.med_Gunn = "prepare_explosion";
			Pchar.quest.med_grandma = "hint_Gunn";

			pchar.quest.monkey_residence.win_condition.l1 = "location";
			pchar.quest.monkey_residence.win_condition.l1.location = "wr_residence";
			pchar.quest.monkey_residence.win_condition = "monkey_residence";
		break;

		case "gunner_hint_done":
			//from grandma dialog
			AddQuestRecord("Medicine_chest", "12");
		break;
	//.....................................................................................................
		case "friday_medicine":
			//from Selkirk dialog (chest broken open & food mission given)
			PlaySound("INTERFACE\closed_locked_door.wav");
			ChangeCharacterAddressGroup(characterFromID("friday"), "wr_booty", "goto", "goto9");
			LAi_SetStayType(characterFromID("friday"));
			GiveItem2Character(characterFromID("friday"), "medicine_leaves");

			LAi_QuestDelay("cannabis_check", 0.1);
		break;

		case "cannabis_check":
			if(CheckCharacterItem(Pchar,"medicine_leaves"))
			{
				AddQuestRecord("Extra_drugs", "2");
				Pchar.quest.med_Friday = "medicine_done";

				GiveItem2Character(characterFromID("friday"), "bladeaxe1");
				EquipCharacterByItem(characterFromID("friday"), "bladeaxe1");
				TakeNItems(characterFromID("friday"), "pistolrock", 2);
				EquipCharacterByItem(characterFromID("friday"), "pistolrock");

				if(CheckCharacterItem(Pchar,"bladesurgery3_r"))
				{
					TakeItemFromCharacter(Pchar, "bladesurgery3_r");
					GiveItem2Character(Pchar, "bladesurgcan3_r");
					if(IsEquipCharacterByItem(Pchar, "bladefish") || IsEquipCharacterByItem(Pchar, "bladeviolin"))
					{

					}
					else EquipCharacterByItem(Pchar, "bladesurgcan3_r");
				}

				if(CheckCharacterItem(Pchar,"bladesurgery2_r"))
				{
					TakeItemFromCharacter(Pchar, "bladesurgery2_r");
					GiveItem2Character(Pchar, "bladesurgcan2_r");
					if(IsEquipCharacterByItem(Pchar, "bladefish") || IsEquipCharacterByItem(Pchar, "bladeviolin"))
					{

					}
					else EquipCharacterByItem(Pchar, "bladesurgcan2_r");
				}

				if(CheckCharacterItem(Pchar,"bladesurgery_r"))
				{
					TakeItemFromCharacter(Pchar, "bladesurgery_r");
					GiveItem2Character(Pchar, "bladesurgcan_r");
					if(IsEquipCharacterByItem(Pchar, "bladefish") || IsEquipCharacterByItem(Pchar, "bladeviolin"))
					{

					}
					else EquipCharacterByItem(Pchar, "bladesurgcan_r");
				}

				if(CheckCharacterItem(Pchar,"bladesurgery3"))
				{
					TakeItemFromCharacter(Pchar, "bladesurgery3");
					GiveItem2Character(Pchar, "bladesurgcan3");
					if(IsEquipCharacterByItem(Pchar, "bladefish") || IsEquipCharacterByItem(Pchar, "bladeviolin"))
					{

					}
					else EquipCharacterByItem(Pchar, "bladesurgcan3");
				}

				if(CheckCharacterItem(Pchar,"bladesurgery2"))
				{
					TakeItemFromCharacter(Pchar, "bladesurgery2");
					GiveItem2Character(Pchar, "bladesurgcan2");
					if(IsEquipCharacterByItem(Pchar, "bladefish") || IsEquipCharacterByItem(Pchar, "bladeviolin"))
					{

					}
					else EquipCharacterByItem(Pchar, "bladesurgcan2");
				}

				if(CheckCharacterItem(Pchar,"bladesurgery"))
				{
					TakeItemFromCharacter(Pchar, "bladesurgery");
					GiveItem2Character(Pchar, "bladesurgcan");
					if(IsEquipCharacterByItem(Pchar, "bladefish") || IsEquipCharacterByItem(Pchar, "bladeviolin"))
					{

					}
					else EquipCharacterByItem(Pchar, "bladesurgcan");
				}

				LAi_QuestDelay("all_extra_drugs_check", 0.1);
			}
			else LAi_QuestDelay("cannabis_check", 0.5);
		break;
//.....................................................................................................
		case "violin_bought":
			//from dave violin dialog
			PlaySound("INTERFACE\coins8.wav");
			AddMoneyToCharacter(Pchar,-2000);

			Locations[FindLocation("wr_shop_office")].reload.l2.disable = 0;	//to mother stairs
			locations[FindLocation("wr_mother_stairs")].id.label = "Grandma's stairs";

			pchar.quest.grandma_boxes.win_condition.l1 = "location";
			pchar.quest.grandma_boxes.win_condition.l1.location = "wr_mother";
			pchar.quest.grandma_boxes.win_condition = "grandma_boxes";
		break;

		case "grandma_boxes":
			//from violin_mission
			locations[FindLocation(Pchar.location)].box2.items.leeches = 1;
			locations[FindLocation(Pchar.location)].box5.items.bag_of_herbs = 1;

			if(CheckAttribute(Pchar,"quest.wr_elevator") && Pchar.quest.wr_elevator == "down")
			{
				PlaySound("INTERFACE\elevator_3.wav");
				Pchar.quest.wr_elevator = "up";
				Locations[FindLocation("wr_shop")].models.always.locators = "residence05_locators_JRH_Lup_mdc";
			}

			LAi_QuestDelay("equip_bag_of_herbs", 0.1);
			LAi_QuestDelay("leeches_check", 0.1);
			LAi_QuestDelay("grandma_snoring", 4.0);

			pchar.quest.place_violin1.win_condition.l1 = "location";
			pchar.quest.place_violin1.win_condition.l1.location = "Dave_Edna_room";
			pchar.quest.place_violin1.win_condition = "place_violin1";
		break;
	//-----------------------------------------------------------------------------------------------------
		case "equip_bag_of_herbs":
			if(CheckCharacterItem(Pchar,"bag_of_herbs"))
			{
				PlaySound("INTERFACE\important_item.wav");
				Log_SetStringToLog(XI_ConvertString("You take item"));
				Pchar.quest.med_bag_of_herbs = "yes";
				TakeItemFromCharacter(Pchar, "bag_of_herbs");
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE );

			//---------------------------------------------------------------------

				if(CheckCharacterItem(Pchar,"pistolmdchest_F2B"))
				{
					TakeItemFromCharacter(Pchar, "pistolmdchest_F2A");
					TakeItemFromCharacter(Pchar, "pistolmdchest_F2B");

					GiveItem2Character(Pchar, "pistolmdchest_F2A_S");
					GiveItem2Character(Pchar, "pistolmdchest_F2B_S");
					EquipCharacterByItem(Pchar, "pistolmdchest_F2B_S");
				}
				else
				{
					if(CheckCharacterItem(Pchar,"pistolmdchest_F2B_C"))
					{
						TakeItemFromCharacter(Pchar, "pistolmdchest_F2A_C");
						TakeItemFromCharacter(Pchar, "pistolmdchest_F2B_C");
						TakeItemFromCharacter(Pchar, "rolls_of_bandages");

						GiveItem2Character(Pchar, "pistolmdchest_F2A_CS");
						GiveItem2Character(Pchar, "pistolmdchest_F2B_CS");
						EquipCharacterByItem(Pchar, "pistolmdchest_F2B_CS");
						GiveItem2Character(Pchar, "rolls_of_bandages");
					}
				}
				else
				{
					if(CheckCharacterItem(Pchar,"pistolmdchest_F3B"))
					{
						TakeItemFromCharacter(Pchar, "pistolmdchest_F3A");
						TakeItemFromCharacter(Pchar, "pistolmdchest_F3B");

						GiveItem2Character(Pchar, "pistolmdchest_F3A_S");
						GiveItem2Character(Pchar, "pistolmdchest_F3B_S");
						EquipCharacterByItem(Pchar, "pistolmdchest_F3B_S");
					}
				}
				else
				{
					if(CheckCharacterItem(Pchar,"pistolmdchest_F3B_C"))
					{
						TakeItemFromCharacter(Pchar, "pistolmdchest_F3A_C");
						TakeItemFromCharacter(Pchar, "pistolmdchest_F3B_C");
						TakeItemFromCharacter(Pchar, "rolls_of_bandages");

						GiveItem2Character(Pchar, "pistolmdchest_F3A_CS");
						GiveItem2Character(Pchar, "pistolmdchest_F3B_CS");
						EquipCharacterByItem(Pchar, "pistolmdchest_F3B_CS");
						GiveItem2Character(Pchar, "rolls_of_bandages");
					}
				}
				else
				{
					if(CheckCharacterItem(Pchar,"pistolmdchest_F4C"))
					{
						TakeItemFromCharacter(Pchar, "pistolmdchest_F4A");
						TakeItemFromCharacter(Pchar, "pistolmdchest_F4B");
						TakeItemFromCharacter(Pchar, "pistolmdchest_F4C");

						GiveItem2Character(Pchar, "pistolmdchest_F4A_S");
						GiveItem2Character(Pchar, "pistolmdchest_F4B_S");
						GiveItem2Character(Pchar, "pistolmdchest_F4C_S");
						EquipCharacterByItem(Pchar, "pistolmdchest_F4C_S");
					}
				}
				else
				{
					if(CheckCharacterItem(Pchar,"pistolmdchest_F4C_C"))
					{
						TakeItemFromCharacter(Pchar, "pistolmdchest_F4A_C");
						TakeItemFromCharacter(Pchar, "pistolmdchest_F4B_C");
						TakeItemFromCharacter(Pchar, "pistolmdchest_F4C_C");
						TakeItemFromCharacter(Pchar, "rolls_of_bandages");

						GiveItem2Character(Pchar, "pistolmdchest_F4A_CS");
						GiveItem2Character(Pchar, "pistolmdchest_F4B_CS");
						GiveItem2Character(Pchar, "pistolmdchest_F4C_CS");
						EquipCharacterByItem(Pchar, "pistolmdchest_F4C_CS");
						GiveItem2Character(Pchar, "rolls_of_bandages");
					}
				}
				else
				{
					if(CheckCharacterItem(Pchar,"pistolmdchest_F5C"))
					{
						TakeItemFromCharacter(Pchar, "pistolmdchest_F5A");
						TakeItemFromCharacter(Pchar, "pistolmdchest_F5B");
						TakeItemFromCharacter(Pchar, "pistolmdchest_F5C");

						GiveItem2Character(Pchar, "pistolmdchest_F5A_S");
						GiveItem2Character(Pchar, "pistolmdchest_F5B_S");
						GiveItem2Character(Pchar, "pistolmdchest_F5C_S");
						EquipCharacterByItem(Pchar, "pistolmdchest_F5C_S");
					}
				}
				else
				{
					if(CheckCharacterItem(Pchar,"pistolmdchest_F5C_C"))
					{
						TakeItemFromCharacter(Pchar, "pistolmdchest_F5A_C");
						TakeItemFromCharacter(Pchar, "pistolmdchest_F5B_C");
						TakeItemFromCharacter(Pchar, "pistolmdchest_F5C_C");
						TakeItemFromCharacter(Pchar, "rolls_of_bandages");

						GiveItem2Character(Pchar, "pistolmdchest_F5A_CS");
						GiveItem2Character(Pchar, "pistolmdchest_F5B_CS");
						GiveItem2Character(Pchar, "pistolmdchest_F5C_CS");
						EquipCharacterByItem(Pchar, "pistolmdchest_F5C_CS");
						GiveItem2Character(Pchar, "rolls_of_bandages");
					}
				}
				else
				{
					if(CheckCharacterItem(Pchar,"pistolmdchest_F6"))
					{
						TakeItemFromCharacter(Pchar, "pistolmdchest_F6");

						GiveItem2Character(Pchar, "pistolmdchest_F6_S");
						EquipCharacterByItem(Pchar, "pistolmdchest_F6_S");
					}
				}
				else
				{
					if(CheckCharacterItem(Pchar,"pistolmdchest_F6_C"))
					{
						TakeItemFromCharacter(Pchar, "pistolmdchest_F6_S");
						TakeItemFromCharacter(Pchar, "rolls_of_bandages");

						GiveItem2Character(Pchar, "pistolmdchest_F6_CS");
						EquipCharacterByItem(Pchar, "pistolmdchest_F6_CS");
						GiveItem2Character(Pchar, "rolls_of_bandages");
					}
				}
				else
				{
					if(CheckCharacterItem(Pchar,"pistolmdcloth"))
					{
						TakeItemFromCharacter(Pchar, "pistolmdcloth");

						GiveItem2Character(Pchar, "pistolmdclothsack");
						EquipCharacterByItem(Pchar, "pistolmdclothsack");
					}
				}
				else
				{
					GiveItem2Character(Pchar, "pistolmdsack");
					EquipCharacterByItem(Pchar, "pistolmdsack");
				}

			//--------------------------------------------------------------------

			//fix uniform later
				SetModel(PChar, "Pira4M_HTU_cr", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);
			}
			else LAi_QuestDelay("equip_bag_of_herbs", 0.5);//loop
		break;
	//-----------------------------------------------------------------------------------------------------
		case "leeches_check":
			Pchar.quest.leeches_taken.win_condition.l1 = "item";
			Pchar.quest.leeches_taken.win_condition.l1.character = Pchar.id;
			Pchar.quest.leeches_taken.win_condition.l1.item = "leeches";
			Pchar.quest.leeches_taken.win_condition = "leeches_taken";
		break;

		case "leeches_taken":
			if(CheckAttribute(Pchar,"quest.med_bag_of_herbs") && Pchar.quest.med_bag_of_herbs == "yes")
			{
				AddQuestRecord("Extra_drugs", "3");

				LAi_QuestDelay("all_extra_drugs_check", 0.1);
			}
			else
			{
				TakeItemFromCharacter(Pchar, "leeches");
				locations[FindLocation(Pchar.location)].box2.items.leeches = 1;
				Logit(LanguageConvertString(tmpLangFileID,"I could use a box or bag or anything to carry this in."));
				PlaySound("VOICE\ENGLISH\blaze_hah.wav");

				LAi_QuestDelay("leeches_check", 0.5);
			}
		break;
	//-----------------------------------------------------------------------------------------------------
		case "grandma_snoring":
			if(Pchar.location == "wr_mother")
			{
				PlaySound("PEOPLE\snoring.wav");
				LAi_QuestDelay("grandma_snoring", 3.5);
			}
			else
			{
				pchar.quest.grandma_snoring.win_condition.l1 = "location";
				pchar.quest.grandma_snoring.win_condition.l1.location = "wr_mother";
				pchar.quest.grandma_snoring.win_condition = "grandma_snoring";
			}
		break;

		case "unlock_daves_room":
			Locations[FindLocation("Shop_stairs")].reload.l8.disable = 0;		//to Dave bed
			Locations[FindLocation("Dave_Edna_room")].locators_radius.reload.reload1 = 1.5;
			Locations[FindLocation("Dave_Edna_room")].locators_radius.box.box3 = 0.0001;

			DoQuestReloadToLocation("Shop_stairs", "reload", "reload8", "_");
		break;

		case "place_violin1":
			locations[FindLocation(Pchar.location)].box2.items.bladeviolin = 1;

			LAi_QuestDelay("violin_equip", 0.1);
		break;

		case "violin_equip":
			if(CheckCharacterItem(Pchar,"bladeviolin"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladeviolin");
				AddQuestRecord("Confectio_Damocritis", "3");
				AddQuestRecord("Tincture_of_Laudenum", "3");

				ChangeCharacterAddressGroup(characterFromID("fake_Apothecary"), "Redmond_port", "goto", "goto_37");
				LAi_SetOfficerType(characterFromID("fake_Apothecary"));
			}
			else LAi_QuestDelay("violin_equip", 0.5);
		break;
//.....................................................................................................
		case "violin_delivered":
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladeviolin");

			if(CheckCharacterItem(Pchar,"bladefish"))
			{
				EquipCharacterByItem(Pchar, "bladefish");
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladesurgcan3_r"))
				{
					EquipCharacterByItem(Pchar, "bladesurgcan3_r");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladesurgcan2_r"))
				{
					EquipCharacterByItem(Pchar, "bladesurgcan2_r");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladesurgcan_r"))
				{
					EquipCharacterByItem(Pchar, "bladesurgcan_r");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladesurgcan3"))
				{
					EquipCharacterByItem(Pchar, "bladesurgcan3");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladesurgcan2"))
				{
					EquipCharacterByItem(Pchar, "bladesurgcan2");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladesurgcan"))
				{
					EquipCharacterByItem(Pchar, "bladesurgcan");
				}
			}
			else
			{

				if(CheckCharacterItem(Pchar,"bladesurgery3_r"))
				{
					EquipCharacterByItem(Pchar, "bladesurgery3_r");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladesurgery2_r"))
				{
					EquipCharacterByItem(Pchar, "bladesurgery2_r");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladesurgery_r"))
				{
					EquipCharacterByItem(Pchar, "bladesurgery_r");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladesurgery3"))
				{
					EquipCharacterByItem(Pchar, "bladesurgery3");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladesurgery2"))
				{
					EquipCharacterByItem(Pchar, "bladesurgery2");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladesurgery"))
				{
					EquipCharacterByItem(Pchar, "bladesurgery");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladeprescriptions"))
				{
					EquipCharacterByItem(Pchar, "bladeprescriptions");
				}
			}
			else EquipCharacterByItem(Pchar, "bladeX4");

			GiveItem2Character(Pchar, "meds2");
			GiveItem2Character(Pchar, "meds3");
			GiveItem2Character(Pchar, "anti_scurvy_pills");

			GiveItem2Character(characterFromID("fake_apothecary"), "bladeviolin");
			EquipCharacterByItem(characterFromID("fake_apothecary"), "bladeviolin");
			PauseAllSounds();

			LAi_QuestDelay("violin_delivered1", 1.0);
		break;

		case "violin_delivered1":
			LAi_SetStayType(characterFromID("fake_Apothecary"));
			PlaySound("PEOPLE\air_violin.wav");

			LAi_QuestDelay("violin_delivered2", 4.0);
			LAi_QuestDelay("restart_port_music", 5.0);
		break;

		case "violin_delivered2":
			LAi_SetCitizenType(characterFromID("fake_Apothecary"));

			Pchar.quest.violin_delivered3.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.violin_delivered3.win_condition.l1.location = "Redmond_port";
			Pchar.quest.violin_delivered3.win_condition = "violin_delivered3";
		break;

		case "violin_delivered3":
			ChangeCharacterAddressGroup(characterFromID("fake_apothecary"), "none", "", "");
		break;

		case "restart_port_music":
			PostEvent("LoadSceneSound", 0);
		break;
//.....................................................................................................
//.....................................................................................................
		case "bring_empty_bottles":
			//from Dover dialog outside tailor
			ChangeCharacterAddressGroup(characterFromID("wr_cor4"), "none", "", "");
			AddQuestRecord("Mercury", "2");
			Pchar.quest.med_Dover2 = "inside_tailors";
			Pchar.quest.med_Windem = "empty_bottles";
			LAi_SetActorType(characterFromID("wr_voy"));
			LAi_ActorGoToLocator(characterFromID("wr_voy"), "reload", "door_6", "bring_empty_bottles2", 2.0);
		break;

		case "bring_empty_bottles2":
			ChangeCharacterAddressGroup(characterFromID("wr_voy"), "Redmond_TailorsShop", "goto", "locator6");
			LAi_SetStayType(characterFromID("wr_voy"));
		break;
//.....................................................................................................
		case "Windem_bottles":
			//from Windem dialog - Pchar has the empty bottles
			AddQuestRecord("Mercury", "3");
			Pchar.quest.med_Dover = "got_empty_bottles";
			Pchar.quest.med_Windem = "got_empty_bottles";	//bottle dialog over
			ChangeCharacterAddressGroup(CharacterFromID("wr_voy"), "Redmond_town_04", "goto", "goto_44");
			SetModel(CharacterFromID("wr_voy"), "wr_voy3", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);
		break;

		case "got_mercury_bottles":
			//from Dover dialog
			PlaySound("VOICE\ENGLISH\Eng_m_a_011.wav");
			LAi_SetActorType(characterFromID("wr_voy"));
			LAi_ActorGoToLocator(characterFromID("wr_voy"), "reload", "door_6", "got_mercury_bottles2", 2.0);
		break;

		case "got_mercury_bottles2":
			ChangeCharacterAddressGroup(characterFromID("wr_voy"), "Redmond_TailorsShop", "goto", "locator6");
			LAi_SetStayType(characterFromID("wr_voy"));
		break;

		case "all6_meds_check":
			//from individuel checks
			if(CheckCharacterItem(Pchar,"meds1") && CheckCharacterItem(Pchar,"meds2") && CheckCharacterItem(Pchar,"meds3") &&
			   CheckCharacterItem(Pchar,"Potion3") && CheckCharacterItem(Pchar,"Pistolgas") && CheckCharacterItem(Pchar,"mercury_bottles"))
			{
				AddQuestRecord("Medicine_chest", "9");

				if(CheckCharacterItem(Pchar,"pistolmdchest_F2B"))
				{
					RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE );
					TakeItemFromCharacter(Pchar, "pistolmdchest_F2A");
					TakeItemFromCharacter(Pchar, "pistolmdchest_F2B");

					GiveItem2Character(Pchar, "pistolmdchest_F3A");
					GiveItem2Character(Pchar, "pistolmdchest_F3B");
					EquipCharacterByItem(Pchar, "pistolmdchest_F3B");
				}
				else
				{
					if(CheckCharacterItem(Pchar,"pistolmdchest_F2B_C"))
					{
						RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE );
						TakeItemFromCharacter(Pchar, "pistolmdchest_F2A_C");
						TakeItemFromCharacter(Pchar, "pistolmdchest_F2B_C");
						TakeItemFromCharacter(Pchar, "rolls_of_bandages");

						GiveItem2Character(Pchar, "pistolmdchest_F3A_C");
						GiveItem2Character(Pchar, "pistolmdchest_F3B_C");
						EquipCharacterByItem(Pchar, "pistolmdchest_F3B_C");
						GiveItem2Character(Pchar, "rolls_of_bandages");
					}
				}
				else
				{
					if(CheckCharacterItem(Pchar,"pistolmdchest_F2B_S"))
					{
						RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE );
						TakeItemFromCharacter(Pchar, "pistolmdchest_F2A_S");
						TakeItemFromCharacter(Pchar, "pistolmdchest_F2B_S");

						GiveItem2Character(Pchar, "pistolmdchest_F3A_S");
						GiveItem2Character(Pchar, "pistolmdchest_F3B_S");
						EquipCharacterByItem(Pchar, "pistolmdchest_F3B_S");
					}
				}
				else
				{
					if(CheckCharacterItem(Pchar,"pistolmdchest_F2B_CS"))
					{
						RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE );
						TakeItemFromCharacter(Pchar, "pistolmdchest_F2A_CS");
						TakeItemFromCharacter(Pchar, "pistolmdchest_F2B_CS");
						TakeItemFromCharacter(Pchar, "rolls_of_bandages");

						GiveItem2Character(Pchar, "pistolmdchest_F3A_CS");
						GiveItem2Character(Pchar, "pistolmdchest_F3B_CS");
						EquipCharacterByItem(Pchar, "pistolmdchest_F3B_CS");
						GiveItem2Character(Pchar, "rolls_of_bandages");
					}
				}

				TakeItemFromCharacter(Pchar, "mdchest_B2");//didn't disappear
				GiveItem2Character(Pchar, "mdchest_B3");

				TakeItemFromCharacter(Pchar, "meds1");
				TakeItemFromCharacter(Pchar, "meds2");
				TakeItemFromCharacter(Pchar, "meds3");
				TakeItemFromCharacter(Pchar, "Potion3");
				TakeItemFromCharacter(Pchar, "Pistolgas");
				TakeItemFromCharacter(Pchar, "Mercury_bottles");

				TakeItemFromCharacter(Pchar, "anti_scurvy_pills");
				TakeItemFromCharacter(Pchar, "filled_medium_drawer");

				Pchar.quest.med_monkey_all6 = "done";

				if(CheckAttribute(Pchar,"quest.med_monkey_food") && Pchar.quest.med_monkey_food == "done")
				{
					ChangeCharacterAddressGroup(CharacterFromID("grandma"), "Redmond_town_01", "goto", "goto40");//was 47
					LAi_SetStayType(characterFromID("grandma"));
					LAi_QuestDelay("grandma_monkey_gunner", 0.1);
				}
			}
		break;

		case "monkey_residence":
			PlaySound("OBJECTS\DUEL\monkey_attack2.wav");
			Locations[FindLocation("wr_gunpowder")].locators_radius.goto.goto5 = 0.001;
	Locations[FindLocation("wr_armory")].locators_radius.goto.goto1 = 0.0001;	//steplock is off
	Locations[FindLocation("wr_armory")].locators_radius.goto.goto14 = 0.0001;	//jump counter is off
		break;

		case "gunner_opens_chest":
			//from Gunn dialog
			Pchar.quest.med_Gunn = "neutral";
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "goto5", "gunner_opens_chest0", 1.0);
		break;

		case "gunner_opens_chest0":
			LAi_ActorTurnToLocator(Pchar, "officers", "reload1_2");

			LAi_QuestDelay("gunner_opens_chest1", 0.5);
		break;

		case "gunner_opens_chest1":
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], false);//temp only
			LAi_SetPlayerType(CharacterFromID("wr_oman1X"));
			LAi_SetFightMode(CharacterFromID("wr_oman1X"), true);

			LAi_QuestDelay("gunner_opens_chest2", 1.5);
		break;

		case "gunner_opens_chest2":
			GetCharacterPos(CharacterFromID("wr_oman1X"), &u, &v, &w);
			CreateParticleSystem("gunfire_red" , u+0.3, v+1.5, w+0.4, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("stars_fire" , u+0.3, v+1.5, w+0.4, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("OBJECTS\duel\GI_ValidClick.wav");

			LAi_QuestDelay("gunner_opens_chest3", 1.0);
		break;

		case "gunner_opens_chest3":
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("fort_fire" , u+0.1, v+1.2, w-0.5, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("OBJECTS\SHIPCHARGE\bomb_lit.wav");
			LAi_SetPlayerType(CharacterFromID("wr_oman1X"));
			LAi_SetFightMode(CharacterFromID("wr_oman1X"), false);
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], true);//reset

			LAi_QuestDelay("gunner_opens_chest4", 2.0);
		break;

		case "gunner_opens_chest4":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead1.wav");

			LAi_QuestDelay("gunner_opens_chest5", 1.0);
		break;

		case "gunner_opens_chest5":
			PlaySound("OBJECTS\DUEL\pistol_mtoon.wav");

			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("canfire" , u+0.1, v+1.2, w-0.5, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("splinters", u+0.1, v+1.2, w-0.5, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", u+0.1, v+1.2, w-0.5, 0.0, 0.0, 0.0, 0);

			Php = LAi_GetCharacterHP(Pchar);
			Php3 = Php/3;
			LAi_ApplyCharacterDamage(Pchar, Php3);

			if(CheckCharacterItem(Pchar,"pistolmdchest_F3B"))
			{
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "pistolmdchest_F3A");
				TakeItemFromCharacter(Pchar, "pistolmdchest_F3B");
				TakeItemFromCharacter(Pchar, "mdchest_B3");

				GiveItem2Character(Pchar, "pistolmdchest_F4A");
				GiveItem2Character(Pchar, "pistolmdchest_F4B");
				GiveItem2Character(Pchar, "pistolmdchest_F4C");
				EquipCharacterByItem(Pchar, "pistolmdchest_F4C");
				GiveItem2Character(Pchar, "mdchest_B4");
			}

			if(CheckCharacterItem(Pchar,"pistolmdchest_F3B_C"))
			{
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "pistolmdchest_F3A_C");
				TakeItemFromCharacter(Pchar, "pistolmdchest_F3B_C");
				TakeItemFromCharacter(Pchar, "mdchest_B3");

				GiveItem2Character(Pchar, "pistolmdchest_F4A_C");
				GiveItem2Character(Pchar, "pistolmdchest_F4B_C");
				GiveItem2Character(Pchar, "pistolmdchest_F4C_C");
				EquipCharacterByItem(Pchar, "pistolmdchest_F4C_C");
				GiveItem2Character(Pchar, "mdchest_B4");
			}

			if(CheckCharacterItem(Pchar,"pistolmdchest_F3B_S"))
			{
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "pistolmdchest_F3A_S");
				TakeItemFromCharacter(Pchar, "pistolmdchest_F3B_S");
				TakeItemFromCharacter(Pchar, "mdchest_B3");

				GiveItem2Character(Pchar, "pistolmdchest_F4A_S");
				GiveItem2Character(Pchar, "pistolmdchest_F4B_S");
				GiveItem2Character(Pchar, "pistolmdchest_F4C_S");
				EquipCharacterByItem(Pchar, "pistolmdchest_F4C_S");
				GiveItem2Character(Pchar, "mdchest_B4");
			}

			if(CheckCharacterItem(Pchar,"pistolmdchest_F3B_CS"))
			{
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "pistolmdchest_F3A_CS");
				TakeItemFromCharacter(Pchar, "pistolmdchest_F3B_CS");
				TakeItemFromCharacter(Pchar, "mdchest_B3");

				GiveItem2Character(Pchar, "pistolmdchest_F4A_CS");
				GiveItem2Character(Pchar, "pistolmdchest_F4B_CS");
				GiveItem2Character(Pchar, "pistolmdchest_F4C_CS");
				EquipCharacterByItem(Pchar, "pistolmdchest_F4C_CS");
				GiveItem2Character(Pchar, "mdchest_B4");
			}

			if(CheckCharacterItem(Pchar,"bladesurgery"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "bladesurgery");
				GiveItem2Character(Pchar, "bladesurgery2");
				EquipCharacterByItem(Pchar, "bladesurgery2");
			}

			if(CheckCharacterItem(Pchar,"bladesurgcan"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "bladesurgcan");
				GiveItem2Character(Pchar, "bladesurgcan2");
				EquipCharacterByItem(Pchar, "bladesurgcan2");
			}

			if(CheckCharacterItem(Pchar,"bladesurgery_r"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "bladesurgery_r");
				GiveItem2Character(Pchar, "bladesurgery2_r");
				EquipCharacterByItem(Pchar, "bladesurgery2_r");
			}

			if(CheckCharacterItem(Pchar,"bladesurgcan_r"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "bladesurgcan_r");
				GiveItem2Character(Pchar, "bladesurgcan2_r");
				EquipCharacterByItem(Pchar, "bladesurgcan2_r");
			}

			TakeItemFromCharacter(Pchar, "filled_large_drawer");

			LAi_tmpl_ani_PlayAnimation(Pchar, "afraid", 2.0);
			CreateParticleSystem("stars_short" , u, v+1, w, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("gunner_opens_chest6", 2.0);
		break;

		case "gunner_opens_chest6":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead4.wav");
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("gunner_opens_chest7", 2.0);
		break;

		case "gunner_opens_chest7":
			PlaySound("VOICE\ENGLISH\Eng_m_b_064.wav");

			LAi_QuestDelay("gunner_opens_chest8", 2.0);
		break;

		case "gunner_opens_chest8":
			LAi_SetActorType(CharacterFromID("wr_oman1X"));
			LAi_ActorDialog(CharacterFromID("wr_oman1X"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wr_oman1X"));
			Characters[GetCharacterIndex("wr_oman1X")].dialog.CurrentNode  = "hidden_key";
		break;

		case "hidden_key":
			AddQuestRecord("Medicine_chest", "6");

			Log_SetStringToLog(XI_ConvertString("You take item"));
			PlaySound("INTERFACE\took_item.wav");
			PlaySound("VOICE\ENGLISH\Eng_m_b_081.wav");
			LAi_SetStayType(CharacterFromID("wr_oman1X"));

			LAi_QuestDelay("hidden_key1", 3.5);
		break;

		case "hidden_key1":
			PlaySound("VOICE\ENGLISH\Blaze_sigh.wav");

			LAi_QuestDelay("prepare_pick_up_collection", 0.1);
		break;

		case "prepare_pick_up_collection":
			ChangeCharacterAddressGroup(CharacterFromID("grandma"), "none", "", "");
			Pchar.quest.church_bells = "off";
			Pchar.quest.med_Cook = "collection";
			//(was) too early, maybe food was not delivered yet! oh but it has to be now I think!
			Locations[FindLocation("Redmond_town_03")].models.always.locators = "Red03_l_JRH3";//table, bottles but no food
		break;

		case "collection_picked_up":
			Locations[FindLocation("Redmond_town_03")].models.always.locators = "Red03_l_JRH1";//table

			locations[FindLocation("Redmond_Town_03")].type = "blues_town";
			DoQuestReloadToLocation("Redmond_town_03", "goto", "med8", "collection_picked_up1");
		break;

		case "collection_picked_up1":
			AddQuestRecord("Medicine_chest", "7");
			PlaySound("VOICE\ENGLISH\Eng_m_c_058.wav");
			Pchar.quest.med_Cook = "nothing";//just greeting
			LAi_SetCitizenType(CharacterFromID("wr_pir13"));

			if(CheckCharacterItem(Pchar,"pistolmdchest_F4C"))
			{
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "pistolmdchest_F4A");
				TakeItemFromCharacter(Pchar, "pistolmdchest_F4B");
				TakeItemFromCharacter(Pchar, "pistolmdchest_F4C");

				GiveItem2Character(Pchar, "pistolmdchest_F5A");
				GiveItem2Character(Pchar, "pistolmdchest_F5B");
				GiveItem2Character(Pchar, "pistolmdchest_F5C");
				EquipCharacterByItem(Pchar, "pistolmdchest_F5C");
			}

			if(CheckCharacterItem(Pchar,"pistolmdchest_F4C_C"))
			{
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "pistolmdchest_F4A_C");
				TakeItemFromCharacter(Pchar, "pistolmdchest_F4B_C");
				TakeItemFromCharacter(Pchar, "pistolmdchest_F4C_C");

				GiveItem2Character(Pchar, "pistolmdchest_F5A_C");
				GiveItem2Character(Pchar, "pistolmdchest_F5B_C");
				GiveItem2Character(Pchar, "pistolmdchest_F5C_C");
				EquipCharacterByItem(Pchar, "pistolmdchest_F5C_C");
			}

			if(CheckCharacterItem(Pchar,"pistolmdchest_F4C_S"))
			{
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "pistolmdchest_F4A_S");
				TakeItemFromCharacter(Pchar, "pistolmdchest_F4B_S");
				TakeItemFromCharacter(Pchar, "pistolmdchest_F4C_S");

				GiveItem2Character(Pchar, "pistolmdchest_F5A_S");
				GiveItem2Character(Pchar, "pistolmdchest_F5B_S");
				GiveItem2Character(Pchar, "pistolmdchest_F5C_S");
				EquipCharacterByItem(Pchar, "pistolmdchest_F5C_S");
			}

			if(CheckCharacterItem(Pchar,"pistolmdchest_F4C_CS"))
			{
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "pistolmdchest_F4A_CS");
				TakeItemFromCharacter(Pchar, "pistolmdchest_F4B_CS");
				TakeItemFromCharacter(Pchar, "pistolmdchest_F4C_CS");

				GiveItem2Character(Pchar, "pistolmdchest_F5A_CS");
				GiveItem2Character(Pchar, "pistolmdchest_F5B_CS");
				GiveItem2Character(Pchar, "pistolmdchest_F5C_CS");
				EquipCharacterByItem(Pchar, "pistolmdchest_F5C_CS");
			}

			//give back the one without visible key, surg kit remains open
			TakeItemFromCharacter(Pchar, "mdchest_B4");
			GiveItem2Character(Pchar, "mdchest_B3");

			if(CheckCharacterItem(Pchar,"bladesurgery2") || CheckCharacterItem(Pchar,"bladesurgcan2")
				|| CheckCharacterItem(Pchar,"bladesurgery2_r") || CheckCharacterItem(Pchar,"bladesurgcan2_r"))
			{
				//do nothing
			}
			else
			{
				//you havn't picked up the surgery_kit in shop yet
				GiveItem2Character(Pchar, "key11");
			}

			ChangeCharacterAddressGroup(CharacterFromID("wr_will"), "Redmond_town_03", "officers", "door_10_2");
			LAi_SetOfficerType(CharacterFromID("wr_will"));
			Locations[FindLocation("Redmond_town_01")].reload.l9.disable = 0;//open to shipyard even if it's night

			Pchar.quest.violin_delivered3.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.violin_delivered3.win_condition.l1.location = "Redmond_town_03";
			Pchar.quest.violin_delivered3.win_condition = "collection_picked_up2";
		break;

		case "collection_picked_up2":
			Locations[FindLocation("Redmond_town_03")].models.always.locators = "Red03_l";//reset to normal
			ChangeCharacterAddressGroup(CharacterFromID("wr_pir13"), "none", "", "");

			Locations[FindLocation("Redmond_shipyard")].models.always.locators = "sh01_l_JRH1";//chest on floor etc
			ChangeCharacterAddressGroup(CharacterFromID("wr_bochat"), "Redmond_shipyard", "officers", "reload2_3");
			LAi_SetStayType(CharacterFromID("wr_bochat"));
			Locations[FindLocation("Redmond_shipyard")].locators_radius.officers.reload2_3 = 2.0;

			LAi_QuestDelay("collection_picked_up3", 0.1);
		break;

		case "collection_picked_up3":
			pchar.quest.Morgan_shipfix.win_condition.l1 = "location";
			pchar.quest.Morgan_shipfix.win_condition.l1.location = "Redmond_shipyard";
			pchar.quest.Morgan_shipfix.win_condition = "Morgan_shipfix";
		break;

		case "Morgan_hint":
			//from wr messenger_dialog
			LAi_SetCitizenType(CharacterFromID("wr_will"));
			AddQuestRecord("Medicine_chest", "13");
		break;

		case "Morgan_shipfix":
			ChangeCharacterAddressGroup(CharacterFromID("wr_will"), "none", "", "");
			locations[FindLocation(Pchar.location)].box3.items.surgery_saw = 1;

			pchar.quest.Morgan_shipfix1.win_condition.l1 = "locator";
			pchar.quest.Morgan_shipfix1.win_condition.l1.location = "Redmond_shipyard";
			pchar.quest.Morgan_shipfix1.win_condition.l1.locator_group = "officers";
			pchar.quest.Morgan_shipfix1.win_condition.l1.locator = "reload2_3";
			pchar.quest.Morgan_shipfix1.win_condition = "Morgan_shipfix1";

			Pchar.quest.surgery_saw_check.win_condition.l2 = "item";
			Pchar.quest.surgery_saw_check.win_condition.l2.character = Pchar.id;
			Pchar.quest.surgery_saw_check.win_condition.l2.item = "surgery_saw";
			Pchar.quest.surgery_saw_check.win_condition = "surgery_saw_check";
		break;

		case "Morgan_shipfix1":
			LAi_SetActorType(CharacterFromID("wr_bochat"));
			LAi_ActorDialog(CharacterFromID("wr_bochat"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wr_bochat"));
			Characters[GetCharacterIndex("wr_bochat")].dialog.CurrentNode  = "Morgan_shiprepair";
		break;

		case "surgery_saw_check":
			//Pchar can't have bladefish (delivered before shipyard messenger arrives) or bladeviolin (delivered for 2 apoth items)
			//also if any surgkit it is opened earlier (by gunner) or by key found in back
			if(CheckCharacterItem(Pchar,"bladesurgery2"))
			{
				AddQuestRecord("Extra_drugs", "4");
				TakeItemFromCharacter(Pchar, "surgery_saw");
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "bladesurgery2");
				GiveItem2Character(Pchar, "bladesurgery3");
				EquipCharacterByItem(Pchar, "bladesurgery3");
			}

			if(CheckCharacterItem(Pchar,"bladesurgcan2"))
			{
				AddQuestRecord("Extra_drugs", "4");
				TakeItemFromCharacter(Pchar, "surgery_saw");
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "bladesurgcan2");
				GiveItem2Character(Pchar, "bladesurgcan3");
				EquipCharacterByItem(Pchar, "bladesurgcan3");
			}

			if(CheckCharacterItem(Pchar,"bladesurgery2_r"))
			{
				AddQuestRecord("Extra_drugs", "4");
				TakeItemFromCharacter(Pchar, "surgery_saw");
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "bladesurgery2_r");
				GiveItem2Character(Pchar, "bladesurgery3_r");
				EquipCharacterByItem(Pchar, "bladesurgery3_r");
			}

			if(CheckCharacterItem(Pchar,"bladesurgcan2_r"))
			{
				AddQuestRecord("Extra_drugs", "4");
				TakeItemFromCharacter(Pchar, "surgery_saw");
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "bladesurgcan2_r");
				GiveItem2Character(Pchar, "bladesurgcan3_r");
				EquipCharacterByItem(Pchar, "bladesurgcan3_r");
			}

			LAi_QuestDelay("all_extra_drugs_check", 0.1);
		break;

		//..................................................................................................
		//loop if you got to carpenter without the medicine chest
		case "carpenter_go_get_the_chest":
			Pchar.quest.carpenter_go_get_the_chest1.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.carpenter_go_get_the_chest1.win_condition.l1.location = "Redmond_shipyard";
			Pchar.quest.carpenter_go_get_the_chest1.win_condition = "carpenter_go_get_the_chest1";
		break;

		case "carpenter_go_get_the_chest1":
			pchar.quest.carpenter_go_get_the_chest2.win_condition.l1 = "locator";
			pchar.quest.carpenter_go_get_the_chest2.win_condition.l1.location = "Redmond_shipyard";
			pchar.quest.carpenter_go_get_the_chest2.win_condition.l1.locator_group = "officers";
			pchar.quest.carpenter_go_get_the_chest2.win_condition.l1.locator = "reload2_3";
			pchar.quest.carpenter_go_get_the_chest2.win_condition = "carpenter_go_get_the_chest2";
		break;

		case "carpenter_go_get_the_chest2":
			LAi_SetActorType(CharacterFromID("wr_bochat"));
			LAi_ActorDialog(CharacterFromID("wr_bochat"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wr_bochat"));
			Characters[GetCharacterIndex("wr_bochat")].dialog.CurrentNode  = "repair_chest_intro";
		break;
		//..................................................................................................
		case "carpenter_repairs_chest":
			//from carpenter dialog
			AddQuestRecord("Extra_drugs", "11");

			LAi_SetStayType(Pchar);
			PlaySound("OBJECTS\DUEL\man_attack1.wav");

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);

			TakeItemFromCharacter(Pchar, "mdchest_B3");

			if(CheckCharacterItem(Pchar,"pistolmdchest_F5C"))
			{
				TakeItemFromCharacter(Pchar, "pistolmdchest_F5A");
				TakeItemFromCharacter(Pchar, "pistolmdchest_F5B");
				TakeItemFromCharacter(Pchar, "pistolmdchest_F5C");
			}

			if(CheckCharacterItem(Pchar,"pistolmdchest_F5C_C"))
			{
				TakeItemFromCharacter(Pchar, "rolls_of_bandages");
				TakeItemFromCharacter(Pchar, "pistolmdchest_F5A_C");
				TakeItemFromCharacter(Pchar, "pistolmdchest_F5B_C");
				TakeItemFromCharacter(Pchar, "pistolmdchest_F5C_C");
				GiveItem2Character(Pchar, "pistolmdcloth");
				EquipCharacterByItem(Pchar, "pistolmdcloth");
			}

			if(CheckCharacterItem(Pchar,"pistolmdchest_F5C_S"))
			{
				TakeItemFromCharacter(Pchar, "pistolmdchest_F5A_S");
				TakeItemFromCharacter(Pchar, "pistolmdchest_F5B_S");
				TakeItemFromCharacter(Pchar, "pistolmdchest_F5C_S");
				GiveItem2Character(Pchar, "pistolmdsack");
				EquipCharacterByItem(Pchar, "pistolmdsack");
			}

			if(CheckCharacterItem(Pchar,"pistolmdchest_F5C_CS"))
			{
				TakeItemFromCharacter(Pchar, "rolls_of_bandages");
				TakeItemFromCharacter(Pchar, "pistolmdchest_F5A_CS");
				TakeItemFromCharacter(Pchar, "pistolmdchest_F5B_CS");
				TakeItemFromCharacter(Pchar, "pistolmdchest_F5C_CS");
				GiveItem2Character(Pchar, "pistolmdclothsack");
				EquipCharacterByItem(Pchar, "pistolmdclothsack");
			}

			RemoveCharacterEquip(CharacterFromID("wr_bochat"), GUN_ITEM_TYPE);
			GiveItem2Character(CharacterFromID("wr_bochat"), "pistolmdchest_F5C");
			EquipCharacterByItem(CharacterFromID("wr_bochat"), "pistolmdchest_F5C");

			LAi_QuestDelay("carpenter_repair_sounds", 1.0);

			Pchar.quest.carpenter_repairs_chest1.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.carpenter_repairs_chest1.win_condition.l1.location = "Redmond_shipyard";
			Pchar.quest.carpenter_repairs_chest1.win_condition = "carpenter_repairs_chest1";
		break;

		case "carpenter_repair_sounds":
			LAi_QuestDelay("quality_takes_time", 1.5);

			Pchar.quest.repair_sounds = "on";
			LAi_SetActorType(CharacterFromID("wr_bochat"));
			LAi_ActorGoToLocator(CharacterFromID("wr_bochat"), "goto", "goto5", "carpenter_repair_sounds0", 5.0);
		break;

		case "quality_takes_time":
			PlaySound("VOICE\ENGLISH\Por_m_b_021.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto5");
		break;

		case "carpenter_repair_sounds0":
			LAi_SetPlayerType(Pchar);
			RemoveCharacterEquip(CharacterFromID("wr_bochat"), GUN_ITEM_TYPE);
			EquipCharacterByItem(CharacterFromID("wr_bochat"), "pistol1");

			LAi_QuestDelay("carpenter_repair_sounds1", 0.1);
		break;

		case "carpenter_repair_sounds1":
			if(CheckAttribute(Pchar,"quest.repair_sounds") && Pchar.quest.repair_sounds == "on")
			{
				if(Pchar.location == "Redmond_Shipyard")
				{
					int repairsound = rand(9);

					switch (repairsound)
					{
						case 0:
							PlaySound("AMBIENT\SHIPYARD\hammer.wav");
							LAi_QuestDelay("carpenter_repair_sounds1", 5.0);
						break;

						case 1:
							PlaySound("AMBIENT\SHIPYARD\hammer.wav");
							LAi_QuestDelay("carpenter_repair_sounds1", 5.0);
						break;

						case 2:
							PlaySound("AMBIENT\SHIPYARD\hammer.wav");
							LAi_QuestDelay("carpenter_repair_sounds1", 5.0);
						break;

						case 3:
							PlaySound("PEOPLE\axe_saw.wav");
							LAi_QuestDelay("carpenter_repair_sounds1", 5.0);
						break;

						case 4:
							PlaySound("PEOPLE\saw_creak.wav");
							LAi_QuestDelay("carpenter_repair_sounds1", 5.0);
						break;

						case 5:
							PlaySound("AMBIENT\SHIPYARD\axe.wav");
							LAi_QuestDelay("carpenter_repair_sounds1", 5.0);
						break;

						case 6:
							PlaySound("PEOPLE\pickaxe_box.wav");
							LAi_QuestDelay("carpenter_repair_sounds1", 2.0);
						break;

						case 7:
							PlaySound("PEOPLE\blade_creak.wav");
							LAi_QuestDelay("carpenter_repair_sounds1", 2.0);
						break;

						case 8:
							PlaySound("PEOPLE\chopchop.wav");
							LAi_QuestDelay("carpenter_repair_sounds1", 2.0);
						break;

						case 9:
							PlaySound("PEOPLE\basket.wav");
							LAi_QuestDelay("carpenter_repair_sounds1", 2.0);
						break;
					}
				}
			}
			else return;
		break;

		case "carpenter_repairs_chest1":
			ChangeCharacterAddressGroup(CharacterFromID("wr_bochat"), "Redmond_shipyard", "goto", "goto20");
			LAi_SetStayType(CharacterFromID("wr_bochat"));

			Pchar.quest.repair_sounds = "off";

			RemoveCharacterEquip(CharacterFromID("wr_bochat"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(CharacterFromID("wr_bochat"), "pistolmdchest_F5C");
			GiveItem2Character(CharacterFromID("wr_bochat"), "pistolmdchest_F6");
			EquipCharacterByItem(CharacterFromID("wr_bochat"), "pistolmdchest_F6");

			pchar.quest.carpenter_repairs_chest2.win_condition.l1 = "locator";
			pchar.quest.carpenter_repairs_chest2.win_condition.l1.location = "Redmond_shipyard";
			pchar.quest.carpenter_repairs_chest2.win_condition.l1.locator_group = "officers";
			pchar.quest.carpenter_repairs_chest2.win_condition.l1.locator = "reload2_3";
			pchar.quest.carpenter_repairs_chest2.win_condition = "carpenter_repairs_chest2";
		break;

		case "carpenter_repairs_chest2":
			LAi_SetActorType(CharacterFromID("wr_bochat"));
			LAi_ActorDialog(CharacterFromID("wr_bochat"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wr_bochat"));
			Characters[GetCharacterIndex("wr_bochat")].dialog.CurrentNode  = "chest_repaired";
		break;

		case "carpenter_returns_chest":
			//from carpenter dialog
			AddQuestRecord("Charles_Vanes_quest", "3");
			AddQuestRecord("Medicine_chest", "8");
			CloseQuestHeader("Medicine_chest");

			DeleteQuestHeader("Acetum_Saturninum");
			DeleteQuestHeader("Mercury");
			DeleteQuestHeader("Tincture_of_Laudenum");
			DeleteQuestHeader("Confectio_Damocritis");
			DeleteQuestHeader("Etherbottle");
			DeleteQuestHeader("Antidote");

			PlaySound("OBJECTS\DUEL\man_attack1.wav");

			RemoveCharacterEquip(CharacterFromID("wr_bochat"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(CharacterFromID("wr_bochat"), "pistolmdchest_F6");
			EquipCharacterByItem(CharacterFromID("wr_bochat"), "pistol1");

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);

			if(CheckCharacterItem(Pchar,"pistolmdclothsack"))
			{
				TakeItemFromCharacter(Pchar, "pistolmdclothsack");
				GiveItem2Character(Pchar, "rolls_of_bandages");
				GiveItem2Character(Pchar, "pistolmdchest_F6_CS");
				EquipCharacterByItem(Pchar, "pistolmdchest_F6_CS");
			}
			else
			{
				if(CheckCharacterItem(Pchar,"pistolmdsack"))
				{
					TakeItemFromCharacter(Pchar, "pistolmdsack");
					GiveItem2Character(Pchar, "pistolmdchest_F6_S");
					EquipCharacterByItem(Pchar, "pistolmdchest_F6_S");
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar,"pistolmdcloth"))
				{
					TakeItemFromCharacter(Pchar, "pistolmdcloth");
					GiveItem2Character(Pchar, "rolls_of_bandages");
					GiveItem2Character(Pchar, "pistolmdchest_F6_C");
					EquipCharacterByItem(Pchar, "pistolmdchest_F6_C");
				}
			}
			else
			{
				GiveItem2Character(Pchar, "pistolmdchest_F6");
				EquipCharacterByItem(Pchar, "pistolmdchest_F6");
			}

			Locations[FindLocation("Redmond_shore_02")].models.always.locators = "shore03_l_JRH";//tartane etc
			ChangeCharacterAddressGroup(characterFromID("Woodes Rogers"), "Redmond_shipyard", "goto", "goto2");
			LAi_SetStayType(characterFromID("Woodes Rogers"));

			LAi_QuestDelay("ready_for_Vane_yet", 1.0);
		break;


		case "ready_for_Vane_yet":
			LAi_SetActorType(CharacterFromID("Woodes Rogers"));
			LAi_ActorDialog(CharacterFromID("Woodes Rogers"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Woodes Rogers"));
			Characters[GetCharacterIndex("Woodes Rogers")].dialog.CurrentNode  = "attack_carpenter";
		break;

		case "attack_carpenter":
			//from WR dialog
			PlaySound("VOICE\ENGLISH\gr_WR_host8.wav");
			LAi_LocationFightDisable(&Locations[FindLocation("Redmond_shipyard")], false);
			LAi_SetPlayerType(CharacterFromID("Woodes Rogers"));
			LAi_SetFightMode(CharacterFromID("Woodes Rogers"), true);

			LAi_QuestDelay("attack_carpenter1", 1.0);
		break;

		case "attack_carpenter1":
			PlaySound("VOICE\ENGLISH\Por_m_b_044.wav");

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("wr_bochat"));

			LAi_QuestDelay("attack_carpenter2", 1.0);
		break;

		case "attack_carpenter2":
			LAi_SetActorType(CharacterFromID("wr_bochat"));
			LAi_ActorRunToLocator(characterFromID("wr_bochat"), "reload", "reload2", "", 3.0);

			LAi_QuestDelay("attack_carpenter3", 2.0);
		break;

		case "attack_carpenter3":
			PlaySound("INTERFACE\closed_locked_door.wav");
			ChangeCharacterAddressGroup(CharacterFromID("wr_bochat"), "none", "", "");
			LAi_SetActorType(CharacterFromID("Woodes Rogers"));

			LAi_QuestDelay("attack_carpenter4", 1.0);
		break;

		case "attack_carpenter4":
			PlaySound("VOICE\ENGLISH\gr_WR_host9.wav");
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], true);//reset

			LAi_QuestDelay("attack_carpenter5", 5.0);
		break;

		case "attack_carpenter5":
			LAi_SetActorType(CharacterFromID("Woodes Rogers"));
			LAi_ActorDialog(CharacterFromID("Woodes Rogers"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Woodes Rogers"));
			Characters[GetCharacterIndex("Woodes Rogers")].dialog.CurrentNode  = "ready_for_Vane_yet";
		break;
	//........................................................................................................
		case "teleport_to_tartane":
			//from wr dialog
			ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "none", "", "");
			SetCurrentTime(20.00, 0);
			SetNextWeather("Red Sky");

			LAi_SetPlayerType(Pchar);
			DoQuestReloadToLocation("Redmond_shore_02", "reload", "reload2", "ayeaye_Captain");
		break;

		case "ayeaye_Captain":
			pchar.quest.ayeaye_Captain1.win_condition.l1 = "locator";
			pchar.quest.ayeaye_Captain1.win_condition.l1.location = "Redmond_shore_02";
			pchar.quest.ayeaye_Captain1.win_condition.l1.locator_group = "reload";
			pchar.quest.ayeaye_Captain1.win_condition.l1.locator = "reload4D";
			pchar.quest.ayeaye_Captain1.win_condition = "ayeaye_Captain1";
		break;

		case "ayeaye_Captain1":
			PlaySound("VOICE\ENGLISH\ayay_captain.wav");
			SetCurrentTime(23.00, 0);
			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Clear";

			LAi_QuestDelay("cannon_tower", 0.1);
		break;

		case "collect_more_drugs":
			//from wr dialog
			LAi_SetStayType(CharacterFromID("Woodes Rogers"));
			Pchar.quest.collect_more_drugs = "yes";

			SetCurrentTime(18.00, 0);
			LAi_SetPlayerType(Pchar);

			Pchar.quest.rogers_not_in_shipyard.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.rogers_not_in_shipyard.win_condition.l1.location = "Redmond_shipyard";
			Pchar.quest.rogers_not_in_shipyard.win_condition = "rogers_not_in_shipyard";
		break;

		case "rogers_not_in_shipyard":
			ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "none", "", "");

			LAi_QuestDelay("ayeaye_Captain", 0.1);
		break;

		case "all_extra_drugs_check":
			//from 6 different pick-ups
			//Log_SetStringToLog("all_extra_drugs_check");

			if(CheckCharacterItem(Pchar,"rolls_of_bandages") || CheckCharacterItem(Pchar,"pistolmdclothsack"))
			{
				if(CheckCharacterItem(Pchar,"bladesurgcan3_r") && CheckCharacterItem(Pchar,"leeches"))
				{
					//Log_SetStringToLog("all extra found!");
					AddQuestRecord("Extra_drugs", "7");
					CloseQuestHeader("Extra_drugs");

					PlaySound("OBJECTS\DUEL\man_attack6.wav");

					if(CheckAttribute(Pchar,"quest.collect_more_drugs") && Pchar.quest.collect_more_drugs == "yes")
					{
						LAi_QuestDelay("teleport_to_tartane", 1.0);
					}
				}
				//else Log_SetStringToLog("not all yet");
			}
			//else Log_SetStringToLog("not all yet");
		break;
	//-------------------------------------------------------------------------------------------------------
		case "cavern_chest_stop":
			//started when falling down through mine AND (= OR) in b_r many cases
			LAi_SetPlayerType(Pchar);

			pchar.quest.cavern_chest_go.win_condition.l1 = "locator";
			pchar.quest.cavern_chest_go.win_condition.l1.location = "wr_cavern";
			pchar.quest.cavern_chest_go.win_condition.l1.locator_group = "goto";
			pchar.quest.cavern_chest_go.win_condition.l1.locator = "goto6";
			pchar.quest.cavern_chest_go.win_condition = "cavern_chest_go";
		break;

		case "cavern_chest_go":
			LAi_SetStayType(Pchar);

			pchar.quest.cavern_chest_stop.win_condition.l1 = "locator";
			pchar.quest.cavern_chest_stop.win_condition.l1.location = "wr_cavern";
			pchar.quest.cavern_chest_stop.win_condition.l1.locator_group = "goto";
			pchar.quest.cavern_chest_stop.win_condition.l1.locator = "goto5";
			pchar.quest.cavern_chest_stop.win_condition = "cavern_chest_stop";
		break;
	//.......................................................................................................
		//[10] starts from here

		case "cannon_tower":
			Pchar.quest.mandala_position = "1";		//start value
	//Pchar.quest.cavern_chestkey = "no";		//pchar has to find the key (in the cannon tower)
			Pchar.quest.cell2_check = "off";		//start value => cell4 is chosen (bomb)
			//Log_SetStringToLog("cell2_check = off");

			Locations[FindLocation("wr_cave_shore")].reload.l111.disable = 1;//to cavern
			Locations[FindLocation("wr_cave_shore")].reload.l2.disable = 0;//to cannon tower
			Locations[FindLocation("wr_cavern")].reload.l1.disable = 1;//to church outside
			Locations[FindLocation("wr_cavern")].models.always.locators = "cavern_l_JRH_ground_open";

			Locations[FindLocation("wr_church_inside")].reload.l8.disable = 1;	//to chapel stairs
			Locations[FindLocation("wr_church_inside")].type = "Vane_church_tavern";//temp while pircaps here
			Locations[FindLocation("wr_church_attic_stairs")].reload.l2.emerge = "reload4";//go down again
			Locations[FindLocation("wr_church_attic")].type = "Vane_jungle";

			if(CheckCharacterPerk(Pchar, "BasicDefence")) { p1 = 1; }else{ p1 = 0; }
			if(CheckCharacterPerk(Pchar, "Gunman")) { p2 = 1; }else{ p2 = 0; }
			if(CheckCharacterPerk(Pchar, "GunProfessional")) { p3 = 1; }else{ p3 = 0; }
			if(CheckCharacterPerk(Pchar, "IronWill")) { p4 = 1; }else{ p4 = 0; }
			if(CheckCharacterPerk(Pchar, "GunFighter")) { p5 = 1; }else{ p5 = 0; }

			ptot = p1 + p2 + p3 + p4 + p5;
			int Aperks = 5 - ptot;
			int i1, i2, i3, i4, i5, i6, itot, Mperks, Bperks, Tperks;

			if(CheckCharacterItem(Pchar,"rolls_of_bandages")) { i1 = 1; }else{ i1 = 0; }
			if(CheckCharacterItem(Pchar,"prescriptions")) { i2 = 1; }else{ i2 = 0; }
			if(CheckCharacterItem(Pchar,"medicine_leaves")) { i3 = 1; }else{ i3 = 0; }
			if(CheckCharacterItem(Pchar,"leeches")) { i4 = 1; }else{ i4 = 0; }

			if(CheckCharacterItem(Pchar,"bladesurgcan3_r") || CheckCharacterItem(Pchar,"bladesurgcan3")
			|| CheckCharacterItem(Pchar,"bladesurgery3_r") || CheckCharacterItem(Pchar,"bladesurgery3"))
			{
				i5 = 1;
				i6 = 1;
			}
			else
			{
				if(CheckCharacterItem(Pchar,"bladesurgcan2_r") || CheckCharacterItem(Pchar,"bladesurgcan2")
				|| CheckCharacterItem(Pchar,"bladesurgery2_r") || CheckCharacterItem(Pchar,"bladesurgery2"))
				{
					i5 = 1;
					i6 = 0;
				}
			}
			else
			{
				i5 = 0;
				i6 = 0;
			}

			itot = i1 + i2 + i3 + i4 + i5 + i6;

			if(itot == 6)
			{
				Mperks = 3;
			}
			else
			{
				if(itot >= 4)
				{
					Mperks = 2;
				}
			}
			else
			{
				if(itot >= 3)
				{
					Mperks = 1;
				}
			}
			else Mperks = 0;

			Bperks = Mperks - Aperks; if(Bperks <= 0) Bperks = 0; Tperks = Aperks + Bperks;
			Pchar.quest.Aperks = Aperks; Pchar.quest.Bperks = Bperks; Pchar.quest.Tperks = Tperks;

		/*	LogIt("Mperks = " + Mperks);
			LogIt("Aperks = " + Pchar.quest.Aperks);
			LogIt("Bperks = " + Pchar.quest.Bperks);
			LogIt("Tperks = " + Pchar.quest.Tperks);	*/

	//temp not in church
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap1"), "none", "", "");

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap23"), "wr_sacristy", "sit", "sit3");
			LAi_SetSitType(CharacterFromID("pir_cap23"));		//Taylor

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap16"), "wr_sacristy", "sit", "sit4");
			LAi_SetSitType(CharacterFromID("pir_cap16"));		//Roberts

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap8"), "wr_sacristy", "sit", "sit5");
			LAi_SetSitType(CharacterFromID("pir_cap8"));		//La Buze

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap18"), "wr_sacristy", "goto", "goto2");
			LAi_SetStayType(CharacterFromID("pir_cap18"));		//Rackham


			ChangeCharacterAddressGroup(CharacterFromID("pir_cap6"), "wr_church_inside", "goto", "goto4");
			LAi_SetCitizenType(CharacterFromID("pir_cap6"));	//Cocklyn

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap2"), "wr_church_inside", "sit", "sit3");
			LAi_SetSitType(CharacterFromID("pir_cap2"));		//Bellamy

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap3"), "wr_church_inside", "goto", "stay_s3");
			LAi_SetStayType(CharacterFromID("pir_cap3"));		//Williams

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap10"), "wr_church_inside", "sit", "sit6");
			LAi_SetSitType(CharacterFromID("pir_cap10"));		//

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap20"), "wr_church_inside", "sit", "sit9");
			LAi_SetSitType(CharacterFromID("pir_cap20"));		//Condent

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap21"), "wr_church_inside", "sit", "sit15");
			LAi_SetSitType(characterFromID("pir_cap21"));

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap22"), "wr_church_inside", "sit", "sit11");
			LAi_SetSitType(CharacterFromID("pir_cap22"));		//

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap14"), "wr_church_inside", "sit", "sit21");
			LAi_SetSitType(CharacterFromID("pir_cap14"));		//Kennedy

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap7"), "wr_church_inside", "sit", "sit19");
			LAi_SetSitType(CharacterFromID("pir_cap7"));		//Anstis

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap24"), "wr_church_inside", "goto", "stay2");
			LAi_SetStayType(CharacterFromID("pir_cap24"));		//Spriggs

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap17"), "wr_church_inside", "sit", "poor1");
			LAi_SetPoorType(CharacterFromID("pir_cap17"));		//Lowther

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap4"), "wr_church_inside", "sit", "poor2");
			LAi_SetPoorType(CharacterFromID("pir_cap4"));		//blackman

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap5"), "wr_church_inside", "goto", "stay_s6");
			LAi_SetStayType(CharacterFromID("pir_cap5"));		//Davis

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap11"), "wr_church_inside", "goto", "goto6");
			LAi_SetStayType(CharacterFromID("pir_cap11"));		//Gow

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap15"), "wr_church_inside", "goto", "stay4");
			LAi_SetStayType(CharacterFromID("pir_cap15"));		//England

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap9"), "wr_church_inside", "sit", "poor3");
			LAi_SetPoorType(CharacterFromID("pir_cap9"));		//

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap26"), "none", "", ""); 	//not yet
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap27"), "none", "", ""); 	//not yet
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap28"), "none", "", ""); 	//not yet
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap29"), "none", "", ""); 	//not yet
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap30"), "none", "", ""); 	//not yet
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap31"), "none", "", ""); 	//not yet
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap32"), "none", "", ""); 	//not yet
		/*
			pchar.quest.cannon_tower_key.win_condition.l1 = "location";
			pchar.quest.cannon_tower_key.win_condition.l1.location = "wr_cannon_tower";
			pchar.quest.cannon_tower_key.win_condition = "cannon_tower_key";
		*/
			Pchar.quest.disable_rebirth = true;
			Pchar.quest.cavern_chestkey = "yes";
			LAi_QuestDelay("pircaps_officertypes", 0.1);
			LAi_QuestDelay("between_turn_around", 1.0);//move this reference downwards later


			pchar.quest.cell4_backoff1.win_condition.l1 = "locator";
			pchar.quest.cell4_backoff1.win_condition.l1.location = "wr_animists";
			pchar.quest.cell4_backoff1.win_condition.l1.locator_group = "goto";
			pchar.quest.cell4_backoff1.win_condition.l1.locator = "crypt_closed";
			pchar.quest.cell4_backoff1.win_condition = "cell4_backoff1";
		break;
	//.......................................................................................................
		case "cell4_backoff":
			pchar.quest.cell4_backoff1.win_condition.l1 = "locator";
			pchar.quest.cell4_backoff1.win_condition.l1.location = "wr_animists";
			pchar.quest.cell4_backoff1.win_condition.l1.locator_group = "goto";
			pchar.quest.cell4_backoff1.win_condition.l1.locator = "crypt_closed";
			pchar.quest.cell4_backoff1.win_condition = "cell4_backoff1";
		break;

		case "cell4_backoff1":
			ChangeCharacterAddressGroup(Pchar, "wr_animists", "goto", "goto42");
			Logit(LanguageConvertString(tmpLangFileID,"There's a steplock under the box."));
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");

			LAi_QuestDelay("cell4_backoff", 0.1);
		break;
	//.......................................................................................................
		//from itemlogic
		case "cavern_key_gone":
			ChangeCharacterAddressGroup(Pchar, "wr_cavern", "goto", "goto5");
		break;
	//.......................................................................................................
		//these  from itmlogic: cavern to church outside
		case "cavern_chest_lock":
			Locations[FindLocation("wr_cavern")].image = "";
			DoQuestReloadToLocation("wr_cavern", "goto", "goto5", "cavern_chest_lock1");
		break;

		case "cavern_chest_lock1":
			Locations[FindLocation("wr_cavern")].image = "wr_cavern.tga";
			if(CheckCharacterItem(Pchar,"key16"))
			{
				TakeItemFromCharacter(Pchar, "key16");
				Pchar.quest.JRH_rain = "";//reset, enables rain again
			}

			Locations[FindLocation("wr_church_outside")].reload.l1.disable = 1;
			Locations[FindLocation("wr_Cavern")].reload.l1.disable = 1;
		break;
	//.......................................................................................................
		//these 8 from itmlogic: cavern to church outside
		case "cavern_place_chest":
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladechest_red");
			EquipCharacterbyItem(Pchar, "bladeanchor");
			TakeItemFromCharacter(Pchar, "bladeX4");

			Locations[FindLocation("wr_cavern")].image = "";
			DoQuestReloadToLocation("wr_cavern", "goto", "goto5", "cavern_place_chest1")
		break;

		case "cavern_place_chest1":
			Locations[FindLocation("wr_cavern")].image = "wr_cavern.tga";
			LAi_SetFightMode(Pchar, false);
			PlaySound("PEOPLE\wood3.wav");
			CreateParticleSystem("blast_dirt", 3.3, 0.9, -16.6, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("Vane_ladder", 0.1);		//from here to [17]
		break;

		case "cavern_church_unlock":
			Locations[FindLocation("wr_cavern")].image = "";
			DoQuestReloadToLocation("wr_cavern", "goto", "goto5", "cavern_church_unlock1");
		break;

		case "cavern_church_unlock1":
			Locations[FindLocation("wr_cavern")].image = "wr_cavern.tga";
			PlaySound("PEOPLE\creak.wav");

			Locations[FindLocation("wr_church_outside")].reload.l1.disable = 0;
			Locations[FindLocation("wr_Cavern")].reload.l1.disable = 0;

			LAi_QuestDelay("cavern_church_unlock2", 1.0);
		break;

		case "cavern_church_unlock2":
			PlaySound("INTERFACE\rusty.wav");
		break;

		case "cavern_church_lock":
			Locations[FindLocation("wr_cavern")].image = "";
			DoQuestReloadToLocation("wr_cavern", "goto", "goto5", "cavern_church_lock1");
		break;

		case "cavern_church_lock1":
			Locations[FindLocation("wr_cavern")].image = "wr_cavern.tga";
			PlaySound("PEOPLE\wood3.wav");
			CreateParticleSystem("blast_dirt", 3.3, 0.9, -16.6, 0.0, 0.0, 0.0, sti(20) );

			Locations[FindLocation("wr_church_outside")].reload.l1.disable = 1;
			Locations[FindLocation("wr_Cavern")].reload.l1.disable = 1;

			LAi_QuestDelay("cavern_church_lock2", 1.0);
		break;

		case "cavern_church_lock2":
			PlaySound("INTERFACE\rusty_close.wav");
		break;
	//.......................................................................................................
		//these 4 from itmlogic: cave shore to cavern

		case "blue_cavern_unlock":
			locations[FindLocation("wr_cannon_tower")].image = "";		//temp off
			DoQuestReloadToLocation("wr_cannon_tower", "goto", "goto5", "blue_cavern_unlock1");
		break;

		case "blue_cavern_unlock1":
			PlaySound("INTERFACE\rum_wheel.wav");
			Locations[FindLocation("wr_cave_shore")].reload.l111.disable = 0;
			Locations[FindLocation("wr_Cavern")].reload.l2.disable = 0;
			locations[FindLocation("wr_cannon_tower")].image = "wr_cannon_tower.tga";
		
			if(CheckAttribute(Pchar, "quest.Spriggs") && Pchar.quest.Spriggs == "on_shore")
			{
				if(CheckAttribute(Pchar, "Winter_walks") && Pchar.Winter_walks == "done")
				{
					//don't repeat
				}
				else
				{
					ChangeCharacterAddressGroup(CharacterFromID("pir_cap21"), "wr_cave_shore", "reload", "rock1_back");//Winter
					LAi_SetStayType(CharacterFromID("pir_cap21"));
					Pchar.quest.Winter = "on_shore";

					pchar.quest.Winter_walks.win_condition.l1 = "locator";
					pchar.quest.Winter_walks.win_condition.l1.location = "wr_cave_shore";
					pchar.quest.Winter_walks.win_condition.l1.locator_group = "goto";
					pchar.quest.Winter_walks.win_condition.l1.locator = "megaphone";
					pchar.quest.Winter_walks.win_condition = "Winter_walks";
				}
			}
		break;

		case "blue_cavern_lock":
			locations[FindLocation("wr_cannon_tower")].image = "";		//temp off
			DoQuestReloadToLocation("wr_cannon_tower", "goto", "goto5", "blue_cavern_lock1");
		break;

		case "blue_cavern_lock1":
			PlaySound("INTERFACE\shelf_close.wav");
			Locations[FindLocation("wr_cave_shore")].reload.l111.disable = 1;
			Locations[FindLocation("wr_Cavern")].reload.l2.disable = 1;
			locations[FindLocation("wr_cannon_tower")].image = "wr_cannon_tower.tga";
		break;
	//.......................................................................................................
/*
		case "cannon_tower_key":
			Pchar.quest.key16_check.win_condition.l1 = "item";
			Pchar.quest.key16_check.win_condition.l1.character = Pchar.id;
			Pchar.quest.key16_check.win_condition.l1.item = "key16";
			Pchar.quest.key16_check.win_condition = "key16_check";
		break;

		case "key16_check":
			Pchar.quest.disable_rebirth = true;
			Pchar.quest.cavern_chestkey = "yes";

			LAi_QuestDelay("pircaps_officertypes", 0.1);
			LAi_QuestDelay("between_turn_around", 1.0);//move this reference downwards later
		break;
*/
	//.......................................................................................................
		case "pircaps_officertypes":
			pchar.quest.pircaps_officertypes1.win_condition.l1 = "locator";
			pchar.quest.pircaps_officertypes1.win_condition.l1.location = "wr_church_inside";
			pchar.quest.pircaps_officertypes1.win_condition.l1.locator_group = "goto";
			pchar.quest.pircaps_officertypes1.win_condition.l1.locator = "goto8";
			pchar.quest.pircaps_officertypes1.win_condition = "pircaps_officertypes1";
		break;

		case "pircaps_officertypes1":
			LAi_SetOfficerType(CharacterFromID("pir_cap6"));
			LAi_SetOfficerType(CharacterFromID("pir_cap2"));
			LAi_SetOfficerType(CharacterFromID("pir_cap14"));
			LAi_SetOfficerType(CharacterFromID("pir_cap20"));
			LAi_SetOfficerType(CharacterFromID("pir_cap21"));
			LAi_SetOfficerType(CharacterFromID("pir_cap22"));
			LAi_SetOfficerType(CharacterFromID("pir_cap7"));
			LAi_SetOfficerType(CharacterFromID("pir_cap24"));
			LAi_SetOfficerType(CharacterFromID("pir_cap17"));
			LAi_SetOfficerType(CharacterFromID("pir_cap4"));
			LAi_SetOfficerType(CharacterFromID("pir_cap11"));
			LAi_SetOfficerType(CharacterFromID("pir_cap5"));
			LAi_SetOfficerType(CharacterFromID("pir_cap15"));
			LAi_SetOfficerType(CharacterFromID("pir_cap9"));
			LAi_SetOfficerType(CharacterFromID("pir_cap10"));
			LAi_SetOfficerType(CharacterFromID("pir_cap3"));

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap2"), "wr_church_inside", "goto", "stay_s3");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap7"), "wr_church_inside", "goto", "stay_s19");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap10"), "wr_church_inside", "goto", "stay_s6");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap20"), "wr_church_inside", "goto", "stay_s9");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap21"), "wr_church_inside", "goto", "stay_s15");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap22"), "wr_church_inside", "goto", "stay_s11");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap14"), "wr_church_inside", "goto", "stay_s21");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap17"), "wr_church_inside", "goto", "stay_p1");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap15"), "wr_church_inside", "goto", "stay_st4");

			PlaySound("OBJECTS\ABORDAGE\abordage_loosing.wav");
			PlaySound("AMBIENT\crew_negative.wav");

			LAi_QuestDelay("pircaps_officertypes2", 4.0);	//was 6.0
		break;

		case "pircaps_officertypes2":
			PlaySound("OBJECTS\SHIPCHARGE\gunner_fire.wav");
			PlaySound("OBJECTS\SHIPCHARGE\gunner_fire.wav");
			LAi_SetStayType(CharacterFromID("pir_cap1"));
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap1"), "wr_church_inside", "goto", "goto2");
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorTurnToCharacter(characterFromID("pir_cap1"), Pchar);
			Locations[FindLocation("wr_church_inside")].reload.l2.disable = 0;	//to sacristy
			locations[FindLocation("wr_sacristy")].id.label = "Sacristy";

			LAi_QuestDelay("pircaps_officertypes3", 1.0);
		break;

		case "pircaps_officertypes3":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto2");

			LAi_QuestDelay("pircaps_officertypes4", 1.5);
		break;

		case "pircaps_officertypes4":
			PlaySound("VOICE\ENGLISH\pir_capGGG.wav");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap18"), "wr_church_inside", "reload", "reload2");
			LAi_SetActorType(CharacterFromID("pir_cap18"));
			LAi_ActorTurnToCharacter(characterFromID("pir_cap18"), Pchar);

			LAi_QuestDelay("pircaps_officertypes5", 1.5);
		break;

		case "pircaps_officertypes5":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "church_captains";
		break;

		case "Vane_sacristy":
			//from Vane dialog
			LAi_SetActorType(CharacterFromID("pir_cap18"));
			LAi_ActorTurnToLocator(CharacterFromID("pir_cap18"), "goto", "goto10");
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorTurnToLocator(CharacterFromID("pir_cap1"), "goto", "goto10");

			LAi_QuestDelay("Vane_sacristy1", 0.5);
		break;

		case "Vane_sacristy1":
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap18"), "wr_sacristy", "goto", "goto2");
			LAi_SetStayType(CharacterFromID("pir_cap18"));

			LAi_QuestDelay("Vane_sacristy2", 0.5);
		break;

		case "Vane_sacristy2":
			PlaySound("INTERFACE\closed_door.wav");

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap1"), "wr_sacristy", "sit", "sit1");
			LAi_SetSitType(CharacterFromID("pir_cap1"));
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("Vane_sacristy3", 0.2);
		break;

		case "Vane_sacristy3":
			PlaySound("PEOPLE\wood3.wav");

			LAi_QuestDelay("Vane_sacristy3_A", 1.0);

			pchar.quest.Vane_sacristy4.win_condition.l1 = "location";
			pchar.quest.Vane_sacristy4.win_condition.l1.location = "wr_sacristy";
			pchar.quest.Vane_sacristy4.win_condition = "Vane_sacristy4";
		break;

		case "Vane_sacristy3_A":
			PlaySound("AMBIENT\cheer.wav");
		break;

		case "Vane_sacristy4":
			LAi_SetStayType(Pchar);

			//just to be sure...
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			EquipCharacterByItem(Pchar, "bladeX4");//if no surg kit at all fists stays equipped, else problems entering sacristy
			if(CheckCharacterItem(Pchar,"bladesurgcan3_r")) EquipCharacterByItem(Pchar, "bladesurgcan3_r");
			if(CheckCharacterItem(Pchar,"bladesurgcan3")) EquipCharacterByItem(Pchar, "bladesurgcan3");
			if(CheckCharacterItem(Pchar,"bladesurgery3_r")) EquipCharacterByItem(Pchar, "bladesurgery3_r");
			if(CheckCharacterItem(Pchar,"bladesurgery3")) EquipCharacterByItem(Pchar, "bladesurgery3");
			if(CheckCharacterItem(Pchar,"bladesurgcan2_r")) EquipCharacterByItem(Pchar, "bladesurgcan2_r");
			if(CheckCharacterItem(Pchar,"bladesurgcan2")) EquipCharacterByItem(Pchar, "bladesurgcan2");
			if(CheckCharacterItem(Pchar,"bladesurgery2_r")) EquipCharacterByItem(Pchar, "bladesurgery2_r");
			if(CheckCharacterItem(Pchar,"bladesurgery2")) EquipCharacterByItem(Pchar, "bladesurgery2");

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			if(CheckCharacterItem(Pchar,"pistolmdchest_F6")) EquipCharacterByItem(Pchar, "pistolmdchest_F6");
			if(CheckCharacterItem(Pchar,"pistolmdchest_F6_C")) EquipCharacterByItem(Pchar, "pistolmdchest_F6_C");
			if(CheckCharacterItem(Pchar,"pistolmdchest_F6_S")) EquipCharacterByItem(Pchar, "pistolmdchest_F6_S");
			if(CheckCharacterItem(Pchar,"pistolmdchest_F6_CS")) EquipCharacterByItem(Pchar, "pistolmdchest_F6_CS");

			LAi_QuestDelay("Vane_sacristy_Roberts", 1.0);

			pchar.quest.Vane_sacristy5.win_condition.l1 = "locator";
			pchar.quest.Vane_sacristy5.win_condition.l1.location = "wr_sacristy";
			pchar.quest.Vane_sacristy5.win_condition.l1.locator_group = "goto";
			pchar.quest.Vane_sacristy5.win_condition.l1.locator = "goto6";
			pchar.quest.Vane_sacristy5.win_condition = "Vane_sacristy5";
		break;

		case "Vane_sacristy_Roberts":
			PlaySound("VOICE\ENGLISH\pir_capKK.wav");
			LAi_SetStayType(CharacterFromID("pir_cap16"));	//Roberts

			LAi_QuestDelay("Vane_sacristy_Roberts1", 2.0);
		break;

		case "Vane_sacristy_Roberts1":
			LAi_SetPlayerType(Pchar);
		break;

		case "Vane_sacristy5":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "medicine_delivered";
		break;

		case "Vane_sacristy_sit_down":
			//from Vane dialog: also closes to blue cavern

			int DEF = CalcCharacterSkill(Pchar, "Defence");
			Pchar.skill.Defence = DEF + 1;

			LAi_SetSitType(CharacterFromID("pir_cap16"));
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap1"), "wr_sacristy", "sit", "sit1");
			LAi_SetSitType(CharacterFromID("pir_cap1"));
			LAi_SetActorType(Pchar);
			LAi_ActorRunToLocator(Pchar, "goto", "goto5", "Vane_sacristy_sit_down1", 1.0);
		break;

		case "Vane_sacristy_sit_down1":
			ChangeCharacterAddressGroup(Pchar, "wr_sacristy", "sit", "sit2");

			LAi_QuestDelay("Vane_sacristy_sit_down2", 1.0);
		break;

		case "Vane_sacristy_sit_down2":
			PlaySound("AMBIENT\SHOP\sigh1.wav");
			LAi_SetSitType(Pchar);

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap8"), "wr_sacristy", "goto", "goto4");
			LAi_SetStayType(CharacterFromID("pir_cap8"));

			LAi_QuestDelay("Vane_sacristy_sit_down3", 0.5);
		break;

		case "Vane_sacristy_sit_down3":
			LAi_SetActorType(CharacterFromID("pir_cap8"));
			LAi_ActorGoToLocator(CharacterFromID("pir_cap8"), "goto", "goto5", "Vane_sacristy_sit_down4", 3.0);
		break;

		case "Vane_sacristy_sit_down4":
			LAi_ActorTurnToLocator(CharacterFromID("pir_cap8"), "sit", "sit2");

			LAi_QuestDelay("Vane_sacristy_sit_down5", 0.5);
		break;

		case "Vane_sacristy_sit_down5":
			string pchar_gun = GetCharacterEquipByGroup(PCHAR, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, pchar_gun);
			GiveItem2Character(CharacterFromID("pir_cap8"), pchar_gun);
			EquipCharacterByItem(CharacterFromID("pir_cap8"), pchar_gun);

			if(!IsEquipCharacterByItem(Pchar, "bladeX4"))
			{
				string pchar_blade = GetCharacterEquipByGroup(PCHAR, BLADE_ITEM_TYPE);
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, pchar_blade);
			}

			SetModel(PChar, "Pira4M_HTU", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);//HTU !

			TakeItemFromCharacter(Pchar, "rolls_of_bandages");
			TakeItemFromCharacter(Pchar, "prescriptions");
			TakeItemFromCharacter(Pchar, "medicine_leaves");
			TakeItemFromCharacter(Pchar, "leeches");
			TakeItemFromCharacter(Pchar, "surgery_saw");
			TakeItemFromCharacter(Pchar, "medicine_list");

			DeleteQuestHeader("Medicine_chest");
			DeleteQuestHeader("Extra_drugs");

			LAi_QuestDelay("Vane_sacristy_sit_down6", 1.0);
		break;

		case "Vane_sacristy_sit_down6":
			PlaySound("VOICE\ENGLISH\pir_capLL.wav");
			LAi_SetActorType(CharacterFromID("pir_cap8"));
			LAi_ActorGoToLocator(CharacterFromID("pir_cap8"), "goto", "goto4", "Vane_sacristy_sit_down7", 3.0);

			LAi_QuestDelay("Vane_sacristy_sit_down8", 2.5);
		break;

		case "Vane_sacristy_sit_down7":
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap8"), "wr_sacristy", "sit", "sit5");
			LAi_SetSitType(CharacterFromID("pir_cap8"));

			RemoveCharacterEquip(CharacterFromID("pir_cap8"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(CharacterFromID("pir_cap8"), pchar_gun);
			EquipCharacterByItem(CharacterFromID("pir_cap8"), "pistol3");
		break;

		case "Vane_sacristy_sit_down8":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "return_items";
		break;

		case "Vane_sacristy_Rackham_items":
			//from Vane dialog
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap1"), "wr_sacristy", "sit", "sit1");
			LAi_SetSitType(CharacterFromID("pir_cap1"));
			LAi_SetActorType(CharacterFromID("pir_cap18"));
			LAi_ActorGoToLocator(CharacterFromID("pir_cap18"), "goto", "goto5", "Vane_sacristy_Rackham_items1", 3.0);
		break;

		case "Vane_sacristy_Rackham_items1":
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);

			TakeItemFromCharacter(Pchar, "pistol206");
			GiveItem2Character(Pchar, "bladeA11");
			GiveItem2Character(Pchar, "pistol201");
			GiveItem2Character(Pchar, "pistol202");
			GiveItem2Character(Pchar, "pistol203");
			GiveItem2Character(Pchar, "pistol204");
			GiveItem2Character(Pchar, "pistol205");
			GiveItem2Character(Pchar, "pistol206");

			if(!CheckCharacterItem(Pchar,"powderflask"))
			{
				GiveItem2Character(Pchar, "powderflask");
				EquipCharacterbyItem(Pchar, "powderflask");
			}
			if(!CheckCharacterItem(Pchar,"ammopouch"))
			{
				GiveItem2Character(Pchar, "ammopouch");
				EquipCharacterbyItem(Pchar, "ammopouch");
			}

			TakeNItems(Pchar, "gunpowder", -100);
			TakeNItems(Pchar, "pistolbullets", -100);
			TakeNItems(Pchar, "pistolgrapes", -100);
			TakeNItems(Pchar, "musketbullets", -100);

			TakeNItems(Pchar, "gunpowder", 12);
			TakeNItems(Pchar, "pistolbullets", 12);

			LAi_QuestDelay("Vane_sacristy_Rackham_items2", 0.5);
		break;

		case "Vane_sacristy_Rackham_items2":
			PlaySound("OBJECTS\DUEL\sabre_sh.wav");
			EquipCharacterByItem(Pchar, "bladeA11");

			LAi_QuestDelay("Vane_sacristy_Rackham_items3", 1.5);
		break;


		case "Vane_sacristy_Rackham_items3":
			PlaySound("OBJECTS\DUEL\reload1.wav");
			PlaySound("OBJECTS\DUEL\reload1.wav");
			EquipCharacterByItem(Pchar, "pistol203");

			LAi_QuestDelay("Vane_sacristy_Rackham_items4", 0.5);
		break;

		case "Vane_sacristy_Rackham_items4":
			LAi_QuestDelay("Vane_sacristy_Rackham_items4A", 1.0);
			LAi_ActorGoToLocator(CharacterFromID("pir_cap18"), "goto", "goto2", "Vane_sacristy_Rackham_items5", 3.0);
		break;

		case "Vane_sacristy_Rackham_items4A":
			//being pushed by Rackham
			ChangeCharacterAddressGroup(Pchar, "wr_sacristy", "sit", "sit2");
		break;

		case "Vane_sacristy_Rackham_items5":
			LAi_ActorTurnToLocator(CharacterFromID("pir_cap18"), "goto", "goto5");

			LAi_QuestDelay("Vane_sacristy_Rackham_items6", 0.5);
		break;

		case "Vane_sacristy_Rackham_items6":
			PlaySound("VOICE\ENGLISH\pir_capCC.wav");
			LAi_SetStayType(CharacterFromID("pir_cap18"));

			LAi_QuestDelay("Vane_sacristy_perks", 2.0);
		break;

		case "Vane_sacristy_perks":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "perk_talk";
		break;

		case "search_perks":
			//from Vane dialog
			AddQuestRecord("Charles_Vanes_quest", "4");

		Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "First time";
			PlaySound("VOICE\ENGLISH\pir_capR10.wav");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap1"), "wr_sacristy", "sit", "sit1");
			LAi_SetSitType(CharacterFromID("pir_cap1"));
			LAi_SetStayType(Pchar);

			Pchar.quest.pircap_perks = "start";

			LAi_QuestDelay("search_perks1", 1.0);
		break;

		case "search_perks1":
			ChangeCharacterAddressGroup(Pchar, "wr_sacristy", "goto", "goto5");
			LAi_SetPlayerType(Pchar);

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap6"), "wr_church_inside", "goto", "goto4");
			LAi_SetCitizenType(CharacterFromID("pir_cap6"));	//Cocklyn

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap2"), "wr_church_inside", "sit", "sit3");
			LAi_SetSitType(CharacterFromID("pir_cap2"));		//Bellamy

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap3"), "wr_church_inside", "goto", "stay_s3");
			LAi_SetStayType(CharacterFromID("pir_cap3"));		//Williams

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap10"), "wr_church_inside", "sit", "sit6");
			LAi_SetSitType(CharacterFromID("pir_cap10"));		//

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap20"), "wr_church_inside", "sit", "sit9");
			LAi_SetSitType(CharacterFromID("pir_cap20"));		//Condent

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap21"), "wr_church_inside", "sit", "sit15");
			LAi_SetSitType(characterFromID("pir_cap21"));

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap22"), "wr_church_inside", "sit", "sit11");
			LAi_SetSitType(CharacterFromID("pir_cap22"));		//

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap14"), "wr_church_inside", "sit", "sit21");
			LAi_SetSitType(CharacterFromID("pir_cap14"));		//Kennedy

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap7"), "wr_church_inside", "sit", "sit19");
			LAi_SetSitType(CharacterFromID("pir_cap7"));		//Anstis

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap24"), "wr_church_inside", "goto", "stay2");
			LAi_SetStayType(CharacterFromID("pir_cap24"));		//Spriggs

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap17"), "wr_church_inside", "sit", "poor1");
			LAi_SetPoorType(CharacterFromID("pir_cap17"));		//Lowther

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap4"), "wr_church_inside", "sit", "poor2");
			LAi_SetPoorType(CharacterFromID("pir_cap4"));		//blackman

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap5"), "wr_church_inside", "goto", "stay_s6");
			LAi_SetStayType(CharacterFromID("pir_cap5"));		//Davis

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap11"), "wr_church_inside", "goto", "goto6");
			LAi_SetStayType(CharacterFromID("pir_cap11"));		//Gow

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap15"), "wr_church_inside", "goto", "stay4");
			LAi_SetStayType(CharacterFromID("pir_cap15"));		//England

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap9"), "wr_church_inside", "sit", "poor3");
			LAi_SetPoorType(CharacterFromID("pir_cap9"));		//
		break;

		case "perk_gunfighter":
			//from Taylor dialog
			LAi_Fade("", "perk_gunfighter1");
		break;

		case "perk_gunfighter1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Master Gunfighter' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_gunprofessional":
			//from La Bouche dialog
			LAi_Fade("", "perk_gunprofessional1");
		break;

		case "perk_gunprofessional1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Professional Gunman' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_gunman":
			//from Rackham dialog
			LAi_Fade("", "perk_gunman1");
		break;

		case "perk_gunman1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Gunman' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_ironwill":
			//from Roberts dialog
			LAi_Fade("", "perk_ironwill1");
		break;

		case "perk_ironwill1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Iron Will' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_BasicDefence":
			//from Vane dialog
			LAi_Fade("", "perk_BasicDefence1");
		break;

		case "perk_BasicDefence1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Basic Defence' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_LightRepair":
			//from repair dialog
			LAi_Fade("", "perk_LightRepair1");
		break;

		case "perk_LightRepair1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Light Repairs' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_InstantRepair":
			//from repair dialog
			LAi_Fade("", "perk_InstantRepair1");
		break;

		case "perk_InstantRepair1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Quick Repairs' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_BasicBattleState":
			//from defence dialog
			LAi_Fade("", "perk_BasicBattleState1");
		break;

		case "perk_BasicBattleState1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Basic Ship Defence' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_AdvancedBattleState":
			//from defence dialog
			LAi_Fade("", "perk_AdvancedBattleState1");
		break;

		case "perk_AdvancedBattleState1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Advanced Ship Defence' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_ShipDefenceProfessional":
			//from defence dialog
			LAi_Fade("", "perk_ShipDefenceProfessional1");
		break;

		case "perk_ShipDefenceProfessional1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Professional Ship Defence' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_SharedExperience":
			//from leadershp dialog
			LAi_Fade("", "perk_SharedExperience1");
		break;

		case "perk_SharedExperience1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Shared Experience' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_Brander":
			//from leadershp dialog
			LAi_Fade("", "perk_Brander1");
		break;

		case "perk_Brander1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Fire-ship' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_Troopers":
			//from leadershp dialog
			LAi_Fade("", "perk_Troopers1");
		break;

		case "perk_Troopers1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Landing Party' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_BasicLandOwner":
			//from commerce dialog
			LAi_Fade("", "perk_BasicLandOwner1");
		break;

		case "perk_BasicLandOwner1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Land Owner' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_BasicCommerce":
			//from commerce dialog
			LAi_Fade("", "perk_BasicCommerce1");
		break;

		case "perk_BasicCommerce1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Basic Commerce' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_AdvancedCommerce":
			//from commerce dialog
			LAi_Fade("", "perk_AdvancedCommerce1");
		break;

		case "perk_AdvancedCommerce1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Advanced Commerce' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_Trustworthy":
			//from commerce dialog
			LAi_Fade("", "perk_Trustworthy1");
		break;

		case "perk_Trustworthy1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Trustworthy Lad' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_LongRangeGrappling":
			//from boarding dialog
			LAi_Fade("", "perk_LongRangeGrappling1");
		break;

		case "perk_LongRangeGrappling1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Long Range Boarding' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_MusketsShoot":
			//from boarding dialog
			LAi_Fade("", "perk_MusketsShoot1");
		break;

		case "perk_MusketsShoot1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Musket Volley' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_GrapplingProfessional":
			//from boarding dialog
			LAi_Fade("", "perk_GrapplingProfessional1");
		break;

		case "perk_GrapplingProfessional1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Master Of Boarding' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_InstantBoarding":
			//from boarding dialog
			LAi_Fade("", "perk_InstantBoarding1");
		break;

		case "perk_InstantBoarding1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Instant Boarding' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_ShipSpeedUp":
			//from navigation dialog
			LAi_Fade("", "perk_ShipSpeedUp1");
		break;

		case "perk_ShipSpeedUp1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Speed Increase' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_ShipTurnRateUp":
			//from navigation dialog
			LAi_Fade("", "perk_ShipTurnRateUp1");
		break;

		case "perk_ShipTurnRateUp1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Maneuverability' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_StormProfessional":
			//from navigation dialog
			LAi_Fade("", "perk_StormProfessional1");
		break;

		case "perk_StormProfessional1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Storm Helmsman' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_Turn180":
			//from navigation dialog
			LAi_Fade("", "perk_Turn1801");
		break;

		case "perk_Turn1801":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Quick Turn-Around' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_SandbankManeuver":
			//from navigation dialog
			LAi_Fade("", "perk_SandbankManeuver1");
		break;

		case "perk_SandbankManeuver1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Sense Fairway' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_SailingProfessional":
			//from navigation dialog
			LAi_Fade("", "perk_SailingProfessional1");
		break;

		case "perk_SailingProfessional1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Sea Wolf' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_AdvancedDefence":
			//from fencingA, B dialog
			LAi_Fade("", "perk_AdvancedDefence1");
		break;

		case "perk_AdvancedDefence1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Advanced Defence' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_Toughness":
			//from fencingB dialog
			LAi_Fade("", "perk_Toughness1");
		break;

		case "perk_Toughness1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Toughness' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_Rush":
			//from fencingB dialog
			LAi_Fade("", "perk_Rush1");
		break;

		case "perk_Rush1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Rush' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_CriticalHit":
			//from fencingA dialog
			LAi_Fade("", "perk_CriticalHit1");
		break;

		case "perk_CriticalHit1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Critical Hit' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_SwordplayProfessional":
			//from fencingA dialog
			LAi_Fade("", "perk_SwordplayProfessional1");
		break;

		case "perk_SwordplayProfessional1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Professional Fencer' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_FastReload":
			//from cannonA, C dialog
			LAi_Fade("", "perk_FastReload1");
		break;

		case "perk_FastReload1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Fast Reload' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_ImmediateReload":
			//from cannonC dialog
			LAi_Fade("", "perk_ImmediateReload1");
		break;

		case "perk_ImmediateReload1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Pre-reloading' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_LongRangeShoot":
			//from cannonA dialog
			LAi_Fade("", "perk_LongRangeShoot1");
		break;

		case "perk_LongRangeShoot1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Increased Volley Range' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_CannonProfessional":
			//from cannonA dialog
			LAi_Fade("", "perk_CannonProfessional1");
		break;

		case "perk_CannonProfessional1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Professional Cannoneer' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_HullDamageUp":
			//from cannonB dialog
			LAi_Fade("", "perk_HullDamageUp1");
		break;

		case "perk_HullDamageUp1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Increased Ship Damage' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_SailsDamageUp":
			//from cannonB dialog
			LAi_Fade("", "perk_SailsDamageUp1");
		break;

		case "perk_SailsDamageUp1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Increased Sail Damage' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_CrewDamageUp":
			//from cannonB dialog
			LAi_Fade("", "perk_CrewDamageUp1");
		break;

		case "perk_CrewDamageUp1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Increased Crew Damage' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "perk_CriticalShoot":
			//from cannonB, A dialog
			LAi_Fade("", "perk_CriticalShoot1");
		break;

		case "perk_CriticalShoot1":
			Logit(LanguageConvertString(tmpLangFileID,"You have learned the 'Critical Shot' ability"));
			PlaySound("INTERFACE\notebook_01.wav");

			LAi_QuestDelay("reset_pircaps", 1.5);
		break;

		case "reset_pircaps":
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap1"), "wr_sacristy", "sit", "sit1");
			LAi_SetSitType(CharacterFromID("pir_cap1"));

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap23"), "wr_sacristy", "sit", "sit3");
			LAi_SetSitType(CharacterFromID("pir_cap23"));		//Taylor

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap16"), "wr_sacristy", "sit", "sit4");
			LAi_SetSitType(CharacterFromID("pir_cap16"));		//Roberts

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap8"), "wr_sacristy", "sit", "sit5");
			LAi_SetSitType(CharacterFromID("pir_cap8"));		//La Buze

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap18"), "wr_sacristy", "goto", "goto2");
			LAi_SetStayType(CharacterFromID("pir_cap18"));		//Rackham

			//ChangeCharacterAddressGroup(CharacterFromID("pir_cap6"), "wr_church_inside", "goto", "goto4");
			LAi_SetCitizenType(CharacterFromID("pir_cap6"));	//Cocklyn

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap2"), "wr_church_inside", "sit", "sit3");
			LAi_SetSitType(CharacterFromID("pir_cap2"));		//Bellamy

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap3"), "wr_church_inside", "goto", "stay_s3");
			LAi_SetStayType(CharacterFromID("pir_cap3"));		//Williams

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap10"), "wr_church_inside", "sit", "sit6");
			LAi_SetSitType(CharacterFromID("pir_cap10"));		//

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap20"), "wr_church_inside", "sit", "sit9");
			LAi_SetSitType(CharacterFromID("pir_cap20"));		//Condent

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap21"), "wr_church_inside", "sit", "sit15");
			LAi_SetSitType(characterFromID("pir_cap21"));

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap22"), "wr_church_inside", "sit", "sit11");
			LAi_SetSitType(CharacterFromID("pir_cap22"));		//

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap14"), "wr_church_inside", "sit", "sit21");
			LAi_SetSitType(CharacterFromID("pir_cap14"));		//Kennedy

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap7"), "wr_church_inside", "sit", "sit19");
			LAi_SetSitType(CharacterFromID("pir_cap7"));		//Anstis

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap24"), "wr_church_inside", "goto", "stay2");
			LAi_SetStayType(CharacterFromID("pir_cap24"));		//Spriggs

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap17"), "wr_church_inside", "sit", "poor1");
			LAi_SetPoorType(CharacterFromID("pir_cap17"));		//Lowther

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap4"), "wr_church_inside", "sit", "poor2");
			LAi_SetPoorType(CharacterFromID("pir_cap4"));		//blackman

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap5"), "wr_church_inside", "goto", "stay_s6");
			LAi_SetStayType(CharacterFromID("pir_cap5"));		//Davis

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap11"), "wr_church_inside", "goto", "goto6");
			LAi_SetStayType(CharacterFromID("pir_cap11"));		//Gow

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap15"), "wr_church_inside", "goto", "stay4");
			LAi_SetStayType(CharacterFromID("pir_cap15"));		//England

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap9"), "wr_church_inside", "sit", "poor3");
			LAi_SetPoorType(CharacterFromID("pir_cap9"));		//

			//LogIt("Aperks = " + Pchar.quest.Aperks);
			//LogIt("Bperks = " + Pchar.quest.Bperks);

			if(CheckAttribute(Pchar,"quest.Bperks") && Pchar.quest.Bperks == 0)
			{
				if(CheckAttribute(Pchar,"quest.Aperks") && Pchar.quest.Aperks == 0)
				{
					//no perks left

					if(Pchar.location == "wr_sacristy")
					{
						LAi_SetStayType(Pchar);

						LAi_QuestDelay("Vane_monk_talk", 1.0);
					}
					else
					{
						PlaySound("VOICE\ENGLISH\blaze_lets_go.wav");
						Logit(LanguageConvertString(tmpLangFileID,"That was it. I'll go back to Charles Vane."));

						pchar.quest.Vane_prisoner_talk.win_condition.l1 = "locator";
						pchar.quest.Vane_prisoner_talk.win_condition.l1.location = "wr_sacristy";
						pchar.quest.Vane_prisoner_talk.win_condition.l1.locator_group = "goto";
						pchar.quest.Vane_prisoner_talk.win_condition.l1.locator = "goto6";
						pchar.quest.Vane_prisoner_talk.win_condition = "Vane_monk_talk";
					}
				}
				else
				{
					//Aperks left

					if(Pchar.location == "wr_church_inside")
					{
						PlaySound("VOICE\ENGLISH\blaze_hah.wav");
						Logit(LanguageConvertString(tmpLangFileID,"Maybe the Captains in the Sacristy know more..."));
					}
				}
			}
			else
			{
				if(CheckAttribute(Pchar,"quest.Aperks") && Pchar.quest.Aperks == 0)
				{
					//Bperks left

					if(Pchar.location == "wr_sacristy")
					{
						PlaySound("VOICE\ENGLISH\blaze_hah.wav");
						Logit(LanguageConvertString(tmpLangFileID,"Maybe the Captains in the Church know more..."));
					}
				}
				else
				{
					//both left - no comment
				}
			}
		break;

		case "Vane_monk_talk":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "monk_talk";
		break;

		case "prisoners_leave":
			//from Vane dialog
			AddQuestRecord("Charles_Vanes_quest", "5");

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap1"), "wr_sacristy", "sit", "sit1");
			LAi_SetSitType(CharacterFromID("pir_cap1"));

			if(CheckAttribute(Pchar,"quest.sit_sacristy") && Pchar.quest.sit_sacristy == "yes")
			{
				LAi_SetStayType(Pchar);

				LAi_QuestDelay("Rackham_extra_sash", 1.0);
			}
			else
			{

				LAi_SetActorType(Pchar);
				LAi_ActorTurnToCharacter(Pchar, characterFromID("pir_cap18"));
				LAi_SetOfficerType(CharacterFromID("pir_cap18"));

				LAi_QuestDelay("Rackham_sash", 3.0);
			}
		break;

		case "Rackham_extra_sash":
			ChangeCharacterAddressGroup(Pchar, "wr_sacristy", "goto", "goto5");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("pir_cap18"));

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap23"), "wr_sacristy", "sit", "sit3");
			LAi_SetSitType(CharacterFromID("pir_cap23"));		//Taylor

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap16"), "wr_sacristy", "sit", "sit4");
			LAi_SetSitType(CharacterFromID("pir_cap16"));		//Roberts

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap8"), "wr_sacristy", "sit", "sit5");
			LAi_SetSitType(CharacterFromID("pir_cap8"));		//La Buze

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap18"), "wr_sacristy", "goto", "goto2");
			LAi_SetStayType(CharacterFromID("pir_cap18"));		//Rackham

			//ChangeCharacterAddressGroup(CharacterFromID("pir_cap6"), "wr_church_inside", "goto", "goto4");
			LAi_SetCitizenType(CharacterFromID("pir_cap6"));	//Cocklyn

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap2"), "wr_church_inside", "sit", "sit3");
			LAi_SetSitType(CharacterFromID("pir_cap2"));		//Bellamy

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap3"), "wr_church_inside", "goto", "stay_s3");
			LAi_SetStayType(CharacterFromID("pir_cap3"));		//Williams

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap10"), "wr_church_inside", "sit", "sit6");
			LAi_SetSitType(CharacterFromID("pir_cap10"));		//

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap20"), "wr_church_inside", "sit", "sit9");
			LAi_SetSitType(CharacterFromID("pir_cap20"));		//Condent

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap21"), "wr_church_inside", "sit", "sit15");
			LAi_SetSitType(characterFromID("pir_cap21"));

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap22"), "wr_church_inside", "sit", "sit11");
			LAi_SetSitType(CharacterFromID("pir_cap22"));		//

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap14"), "wr_church_inside", "sit", "sit21");
			LAi_SetSitType(CharacterFromID("pir_cap14"));		//Kennedy

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap7"), "wr_church_inside", "sit", "sit19");
			LAi_SetSitType(CharacterFromID("pir_cap7"));		//Anstis

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap24"), "wr_church_inside", "goto", "stay2");
			LAi_SetStayType(CharacterFromID("pir_cap24"));		//Spriggs

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap17"), "wr_church_inside", "sit", "poor1");
			LAi_SetPoorType(CharacterFromID("pir_cap17"));		//Lowther

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap4"), "wr_church_inside", "sit", "poor2");
			LAi_SetPoorType(CharacterFromID("pir_cap4"));		//blackman

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap5"), "wr_church_inside", "goto", "stay_s6");
			LAi_SetStayType(CharacterFromID("pir_cap5"));		//Davis

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap11"), "wr_church_inside", "goto", "goto6");
			LAi_SetStayType(CharacterFromID("pir_cap11"));		//Gow

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap15"), "wr_church_inside", "goto", "stay4");
			LAi_SetStayType(CharacterFromID("pir_cap15"));		//England

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap9"), "wr_church_inside", "sit", "poor3");
			LAi_SetPoorType(CharacterFromID("pir_cap9"));		//

			LAi_QuestDelay("Rackham_sash", 1.0);
		break;

		case "Rackham_sash":
			PlaySound("VOICE\ENGLISH\pir_capCC.wav");
			LAi_SetActorType(characterFromID("pir_cap18"));
			LAi_ActorTurnToCharacter(characterFromID("pir_cap18"), Pchar);

			LAi_QuestDelay("Rackham_sash1", 2.0);
		break;

		case "Rackham_sash1":
			LAi_SetStayType(Pchar);
			PlaySound("PEOPLE\clothes1.wav");
			SetModel(PChar, "Pira4M_HTUS", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			LAi_QuestDelay("Rackham_sash2", 1.0);
		break;

		case "Rackham_sash2":
			LAi_SetActorType(CharacterFromID("pir_cap18"));
			LAi_ActorGoToLocator(CharacterFromID("pir_cap18"), "goto", "goto2", "Rackham_sash3", 3.0);
		break;

		case "Rackham_sash3":
			LAi_ActorTurnToCharacter(characterFromID("pir_cap18"), Pchar);

			LAi_QuestDelay("Rackham_sash4", 0.5);
		break;

		case "Rackham_sash4":
			PlaySound("VOICE\ENGLISH\pir_capLL.wav");
			LAi_SetStayType(CharacterFromID("pir_cap18"));
			Locations[FindLocation("wr_church_inside")].reload.l8.disable = 0;	//to chapel stairs
			Locations[FindLocation("wr_chapel")].reload.l2.disable = 0;		//to temple stairs
			locations[FindLocation("wr_animists_stairs")].id.label = "Temple stairs";

			//6 chapel prisoners gone
			ChangeCharacterAddressGroup(CharacterFromID("fake_Silehard"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("fake_Sarah_Fitter"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("fake_Laurence_Wellman"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_bri"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("Defoe_incognito"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("fake_father_Bernard"), "wr_animists", "goto", "goto21");
			LAi_SetStayType(CharacterFromID("fake_father_Bernard"));

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap19"), "wr_church_inside", "goto", "goto11");//crew

			Pchar.quest.prisoner_Silehard = "in";
			Pchar.quest.prisoner_Bernard = "in";
			Pchar.quest.prisoner_Wellman = "in";
			Pchar.quest.prisoner_Fitter = "in";
			Pchar.quest.prisoner_Courtney = "in";
			Pchar.quest.prisoner_Defoe = "in";

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("pir_cap8"));

			LAi_QuestDelay("Rackham_sash5", 2.0);
		break;

		case "Rackham_sash5":
			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("wr_chapel")].environment.weather = "true";

			pchar.quest.temple_daytime.win_condition.l1 = "location";
			pchar.quest.temple_daytime.win_condition.l1.location = "wr_chapel_stairs";
			pchar.quest.temple_daytime.win_condition = "temple_daytime";
		break;

		case "temple_daytime":
			SetCurrentTime(11.00, 0);
			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Clear";

			pchar.quest.fill_temple_boxes.win_condition.l1 = "location";
			pchar.quest.fill_temple_boxes.win_condition.l1.location = "wr_animists";
			pchar.quest.fill_temple_boxes.win_condition = "fill_temple_boxes";
		break;

		case "fill_temple_boxes":
			locations[FindLocation("wr_crypt")].id.label = "Port Royal catacombs";
			Locations[FindLocation("wr_chapel")].environment.weather = "false";
			Pchar.quest.JRH_rain = "";
			locations[FindLocation(Pchar.location)].box4.items.pistolmine = 1;
			locations[FindLocation(Pchar.location)].box5.items.note3 = 1;

			LAi_QuestDelay("Defoe_in_animists", 0.1);//starts loop below

			pchar.quest.Defoe_food_talk.win_condition.l1 = "locator";
			pchar.quest.Defoe_food_talk.win_condition.l1.location = "wr_animists";
			pchar.quest.Defoe_food_talk.win_condition.l1.locator_group = "goto";
			pchar.quest.Defoe_food_talk.win_condition.l1.locator = "goto42";
			pchar.quest.Defoe_food_talk.win_condition = "Defoe_food_talk";

			pchar.quest.cell2_check_on.win_condition.l1 = "locator";
			pchar.quest.cell2_check_on.win_condition.l1.location = "wr_animists";
			pchar.quest.cell2_check_on.win_condition.l1.locator_group = "box";
			pchar.quest.cell2_check_on.win_condition.l1.locator = "box11";
			pchar.quest.cell2_check_on.win_condition = "cell2_check_on";
		break;
//-----------------------------------------------------------------------------------------------------------
		case "Defoe_in_animists":
			if(CheckAttribute(Pchar,"quest.prisoner_Defoe") && Pchar.quest.prisoner_Defoe == "in")
			{
				ChangeCharacterAddressGroup(CharacterFromID("prisoner_defoe_incognito"), "wr_animists", "goto", "goto23");

				pchar.quest.Defoe_in_cell4.win_condition.l1 = "location";
				pchar.quest.Defoe_in_cell4.win_condition.l1.location = "wr_animists";
				pchar.quest.Defoe_in_cell4.win_condition = "Defoe_in_cell4";
			}
			else return;	//loop ends
		break;

		case "Defoe_in_cell4":
			ChangeCharacterAddressGroup(CharacterFromID("prisoner_defoe_incognito"), "wr_animists", "goto", "goto23");

			pchar.quest.Defoe_in_animists.win_condition.l1 = "location";
			pchar.quest.Defoe_in_animists.win_condition.l1.location = "wr_animists";
			pchar.quest.Defoe_in_animists.win_condition = "Defoe_in_animists";
		break;
//-----------------------------------------------------------------------------------------------------------
		case "cell2_check_on":
			//Log_SetStringToLog("cell2_check = on");
			Pchar.quest.cell2_check = "on";

			pchar.quest.cell2_check_off.win_condition.l1 = "locator";
			pchar.quest.cell2_check_off.win_condition.l1.location = "wr_animists";
			pchar.quest.cell2_check_off.win_condition.l1.locator_group = "box";
			pchar.quest.cell2_check_off.win_condition.l1.locator = "box10";
			pchar.quest.cell2_check_off.win_condition = "cell2_check_off";
		break;

		case "cell2_check_off":
			//Log_SetStringToLog("cell2_check = off");
			Pchar.quest.cell2_check = "off";

			pchar.quest.cell2_check_on.win_condition.l1 = "locator";
			pchar.quest.cell2_check_on.win_condition.l1.location = "wr_animists";
			pchar.quest.cell2_check_on.win_condition.l1.locator_group = "box";
			pchar.quest.cell2_check_on.win_condition.l1.locator = "box11";
			pchar.quest.cell2_check_on.win_condition = "cell2_check_on";
		break;
//-----------------------------------------------------------------------------------------------------------
		case "Defoe_food_talk":
			LAi_SetActorType(CharacterFromID("prisoner_defoe_incognito"));
			LAi_ActorDialog(characterFromID("prisoner_defoe_incognito"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("prisoner_defoe_incognito"));
			Characters[GetCharacterIndex("prisoner_defoe_incognito")].dialog.CurrentNode  = "food_talk";
		break;

		case "Defoe_food_talk_done":
			//from Defoe dialog
			Pchar.quest.prisoner_Defoe = "out";
			LAi_SetStayType(Pchar);

			ChangeCharacterAddressGroup(CharacterFromID("prisoner_defoe_incognito"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("prisoner_defoe"), "wr_animists", "goto", "goto23");

			LAi_QuestDelay("Defoe_food_talk_done1", 1.0);
		break;
	//-----------------------------------------------------------------------------------------------
		case "Defoe_food_talk_done1":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box14");

			LAi_SetActorType(CharacterFromID("prisoner_defoe"));
			LAi_ActorGoToLocator(CharacterFromID("prisoner_defoe"), "goto", "goto44", "Defoe_food_talk_done2", 1.5);//was 1.0
		break;

		case "Defoe_food_talk_done2":
			PlaySound("PEOPLE\run_stone.wav");
			LAi_QuestDelay("Defoe_food_talk_done3", 1.0);
		break;

		case "Defoe_food_talk_done3":
			PlaySound("INTERFACE\rusty.wav");
			ChangeCharacterAddressGroup(CharacterFromID("prisoner_defoe"), "wr_animists", "box", "box14");

			LAi_QuestDelay("Defoe_food_talk_done4", 1.0);
		break;

		case "Defoe_food_talk_done4":
			LAi_SetActorType(CharacterFromID("prisoner_defoe"));
			LAi_ActorGoToLocator(CharacterFromID("prisoner_defoe"), "goto", "goto6", "Defoe_go_eat", 10.0);

			LAi_QuestDelay("Defoe_food_talk_done5", 2.0);
		break;

		case "Defoe_food_talk_done5":
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("temple_axe", 0.1);

			pchar.quest.Defoe_go_eat.win_condition.l1 = "location";
			pchar.quest.Defoe_go_eat.win_condition.l1.location = "wr_animists";
			pchar.quest.Defoe_go_eat.win_condition = "Defoe_go_eat";
		break;

		case "temple_axe":
			if(CheckCharacterItem(Pchar,"bladeaxe5"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladeaxe5");
				return;
			}
			else LAi_QuestDelay("temple_axe", 0.5);	//loops until axe is found
		break;

		case "Defoe_go_eat":
			ChangeCharacterAddressGroup(CharacterFromID("prisoner_defoe"), "wr_animists", "goto", "goto31");
			LAi_SetSitType(CharacterFromID("prisoner_defoe"));
		break;

		case "axe5_to_minebomb":
			//from itemlogic box 4 animists
			PlaySound("PEOPLE\axe_creak.wav");

			LAi_QuestDelay("axe5_to_minebomb1", 2.0);
		break;

		case "axe5_to_minebomb1":
			LAi_SetFightMode(Pchar, false);
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], true);	//reset disable
			LAi_SetPlayerType(Pchar);
			Pchar.quest.mine_bomb = "open";

			LAi_QuestDelay("temple_bomb", 0.1);
		break;

		case "temple_bomb":
			if(CheckCharacterItem(Pchar,"pistolmine"))
			{
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "pistolmine");
				SetModel(PChar, "Pira4M_HTUS_cr", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);//HTU !

				LAi_QuestDelay("place_temple_bomb", 0.1);
			}
			else LAi_QuestDelay("temple_bomb", 0.5);	//loops until bomb is found
		break;

		case "place_temple_bomb":
			pchar.quest.place_temple_bomb1.win_condition.l1 = "locator";
			pchar.quest.place_temple_bomb1.win_condition.l1.location = "wr_animists";
			pchar.quest.place_temple_bomb1.win_condition.l1.locator_group = "goto";
			pchar.quest.place_temple_bomb1.win_condition.l1.locator = "goto42";
			pchar.quest.place_temple_bomb1.win_condition = "place_temple_bomb1";
		break;

		case "place_temple_bomb1":
			if(CheckCharacterItem(Pchar,"pistolmine"))
			{
				if(!IsEquipCharacterByItem(Pchar, "pistolmine")) EquipCharacterByItem(Pchar, "pistolmine");

				LAi_SetActorType(Pchar);
				LAi_ActorTurnToLocator(Pchar, "randitem", "randitem8");

				LAi_QuestDelay("place_temple_bomb2", 1.0);
			}
			else LAi_QuestDelay("place_temple_bomb", 0.5);
		break;

		case "place_temple_bomb2":
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "pistolmine");
			SetModel(PChar, "Pira4M_HTUS", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);//HTU !

			Locations[FindLocation("wr_animists")].models.always.l5 = "mine_bomb";

			LAi_QuestDelay("place_temple_bomb3", 0.5);
		break;

		case "place_temple_bomb3":
			locations[FindLocation("wr_animists")].image = "";		//temp off
			DoQuestReloadToLocation("wr_animists", "goto", "goto42", "place_temple_bomb4");
		break;

		case "place_temple_bomb4":
			locations[FindLocation("wr_animists")].image = "wr_animists.tga";
			PlaySound("PEOPLE\wood3.wav");
			CreateParticleSystemX("blast_dirt", -5.0, 0.7, -13.1, 0.0, 0.0, 0.0, 10);
			Pchar.quest.mine_bomb2 = "placed";
			LAi_SetPlayerType(Pchar);
			if(CheckAttribute(Pchar,"quest.prisoner_Silehard") && Pchar.quest.prisoner_Silehard == "gone")
			{
				ChangeCharacterAddressGroup(CharacterFromID("prisoner_defoe"), "wr_animists", "goto", "goto36");
				LAi_SetSitType(CharacterFromID("prisoner_defoe"));

				GiveItem2Character(CharacterFromID("prisoner_defoe"), "pistolspade");
				EquipCharacterbyItem(CharacterFromID("prisoner_defoe"), "pistolspade");
			}

			LAi_QuestDelay("place_temple_bomb5", 1.5);
		break;

		case "place_temple_bomb5":
			PlaySound("VOICE\ENGLISH\blaze_mhm.wav");
			Logit(LanguageConvertString(tmpLangFileID,"That's it! But how do I release the Mine?"));
		break;
//-----------------------------------------------------------------------------------------------------------
		case "from_box5_temple":
			ChangeCharacterAddressGroup(Pchar, "wr_animists", "box", "box17");
			PlaySound("PEOPLE\step_stairway.wav");
		break;
//-----------------------------------------------------------------------------------------------------------
		case "temple_sit_function_OFF":
			LAi_SetPlayerType(Pchar);
			LAi_QuestDelay("temple_sit_function_OFF1", 1.0);
		break;

		case "temple_sit_function_OFF1":
			PlaySound("PEOPLE\step_stone2.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_animists", "goto", "goto40");
		break;

		case "temple_mandala_turn":
			if(CheckAttribute(Pchar,"quest.mandala_position") && Pchar.quest.mandala_position == "1")
			{
				LAi_QuestDelay("mandala_position_2", 0.1);
			}

			if(CheckAttribute(Pchar,"quest.mandala_position") && Pchar.quest.mandala_position == "2")
			{
				LAi_QuestDelay("mandala_position_3", 0.1);
			}

			if(CheckAttribute(Pchar,"quest.mandala_position") && Pchar.quest.mandala_position == "3")
			{
				LAi_QuestDelay("mandala_position_4", 0.1);
			}

			if(CheckAttribute(Pchar,"quest.mandala_position") && Pchar.quest.mandala_position == "4")
			{
				LAi_QuestDelay("mandala_position_5", 0.1);
			}

			if(CheckAttribute(Pchar,"quest.mandala_position") && Pchar.quest.mandala_position == "5")
			{
				LAi_QuestDelay("mandala_position_1", 0.1);
			}
		break;

		case "mandala_position_1":
			Locations[FindLocation(Pchar.location)].models.always.locators = "scave_l_JRH_ON1";

			Pchar.quest.mandala_position = "1";
			Locations[FindLocation(Pchar.location)].filespath.textures = "locations\inside\ANIMISTS_Cave\mandala1";

			Locations[FindLocation("wr_animists")].reload.l2.disable = 0;		//animists_stairs

			LAi_QuestDelay("mandala_finish", 0.1);
		break;

		case "mandala_position_2":
			Locations[FindLocation(Pchar.location)].models.always.locators = "scave_l_JRH_ON2";

			Pchar.quest.mandala_position = "2";
			Locations[FindLocation(Pchar.location)].filespath.textures = "locations\inside\ANIMISTS_Cave\mandala2";

			Locations[FindLocation("wr_animists")].reload.l2.disable = 1;		//animists_stairs

			if(CheckAttribute(Pchar,"quest.prisoner_Silehard") && Pchar.quest.prisoner_Silehard == "in")
			{
				LAi_QuestDelay("prisoner_Silehard_runs", 2.0);
			}

			LAi_QuestDelay("mandala_finish", 0.1);
		break;

		case "mandala_position_3":
			Locations[FindLocation(Pchar.location)].models.always.locators = "scave_l_JRH_ON3";

			Pchar.quest.mandala_position = "3";
			Locations[FindLocation(Pchar.location)].filespath.textures = "locations\inside\ANIMISTS_Cave\mandala3";

			if(CheckAttribute(Pchar,"quest.prisoner_Courtney") && Pchar.quest.prisoner_Courtney == "in")
			{
				ChangeCharacterAddressGroup(CharacterFromID("prisoner_Silehard"), "wr_animists", "reload", "reload2");
				LAi_SetStayType(CharacterFromID("prisoner_Silehard"));

				LAi_QuestDelay("prisoner_Courtney_runs", 2.0);
			}

			if(CheckAttribute(Pchar,"quest.prisoner_Bernard") && Pchar.quest.prisoner_Bernard == "in")
			{
				LAi_QuestDelay("prisoner_Bernard_runs", 2.5);
			}

			LAi_QuestDelay("mandala_finish", 0.1);
		break;

		case "mandala_position_4":
			Locations[FindLocation(Pchar.location)].models.always.locators = "scave_l_JRH_ON4";

			Pchar.quest.mandala_position = "4";
			Locations[FindLocation(Pchar.location)].filespath.textures = "locations\inside\ANIMISTS_Cave\mandala4";

			if(CheckAttribute(Pchar,"quest.prisoner_Fitter") && Pchar.quest.prisoner_Fitter == "in")
			{

				ChangeCharacterAddressGroup(CharacterFromID("prisoner_wr_bri"), "wr_animists", "goto", "queue2");
				LAi_SetStayType(CharacterFromID("prisoner_wr_bri"));
				ChangeCharacterAddressGroup(CharacterFromID("fake_father_Bernard"), "wr_animists", "goto", "queue3");
				LAi_SetStayType(CharacterFromID("fake_father_Bernard"));

				LAi_QuestDelay("prisoner_Sarah_runs", 2.0);
			}

			LAi_QuestDelay("mandala_finish", 0.1);
		break;

		case "mandala_position_5":
			Locations[FindLocation(Pchar.location)].models.always.locators = "scave_l_JRH_ON5";

			Pchar.quest.mandala_position = "5";
			Locations[FindLocation(Pchar.location)].filespath.textures = "locations\inside\ANIMISTS_Cave\mandala5";

			if(CheckAttribute(Pchar,"quest.prisoner_Wellman") && Pchar.quest.prisoner_Wellman == "in")
			{
				ChangeCharacterAddressGroup(CharacterFromID("prisoner_Sarah_Fitter"), "wr_animists", "goto", "queue4");
				LAi_SetStayType(CharacterFromID("prisoner_Sarah_Fitter"));

				LAi_QuestDelay("prisoner_Wellman_runs", 2.0);
			}

			LAi_QuestDelay("mandala_finish", 0.1);
		break;

		case "mandala_finish":
			Locations[FindLocation("wr_animists")].image = "";
			DoQuestReloadToLocation("wr_animists", "goto", "goto38", "mandala_finish_1");
		break;

		case "mandala_finish_1":
			Locations[FindLocation("wr_animists")].image = "wr_animists.tga";
			PlaySound("INTERFACE\stone_mandala.wav");
			CreateParticleSystemX("blast_dirt", -4.0, 1.6, -0.4, -4.0, 3.6, -0.4, 10);

			LAi_QuestDelay("mandala_finish_2", 2.0);
		break;

		case "mandala_finish_2":
			if(CheckAttribute(Pchar,"quest.mandala_position") && Pchar.quest.mandala_position == "1")
			{
				PlaySound("INTERFACE\closet_Open.wav");
				if(CheckAttribute(Pchar,"quest.prisoner_Silehard") && Pchar.quest.prisoner_Silehard == "out")
					LAi_QuestDelay("temple_prisoners_gone", 2.0);

			}
			else PlaySound("INTERFACE\rusty.wav");

			LAi_QuestDelay("mandala_finish_3", 1.0);
		break;

		case "mandala_finish_3":
			LAi_SetPlayerType(Pchar);
			LAi_QuestDelay("mandala_finish_4", 1.0);
		break;

		case "mandala_finish_4":
			PlaySound("PEOPLE\step_stone2.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_animists", "goto", "goto40");
		break;

		case "temple_lever_ON":
			Locations[FindLocation("wr_animists")].image = "";
			DoQuestReloadToLocation("wr_animists", "goto", "goto39", "temple_lever_ON_A");
		break;

		case "temple_lever_ON_A":
			Locations[FindLocation("wr_animists")].image = "wr_animists.tga";
			PlaySound("INTERFACE\shelf_cogs.wav");
		break;

		case "temple_lever_OFF":
			Locations[FindLocation("wr_animists")].image = "";
			DoQuestReloadToLocation("wr_animists", "goto", "goto39", "temple_lever_OFF_A");
		break;

		case "temple_lever_OFF_A":
			Locations[FindLocation("wr_animists")].image = "wr_animists.tga";
			PlaySound("INTERFACE\shelf_close.wav");
		break;
//-----------------------------------------------------------------------------------------------------------
		case "prisoner_Silehard_runs":
			ChangeCharacterAddressGroup(CharacterFromID("prisoner_Silehard"), "wr_animists", "goto", "goto6");
			LAi_SetActorType(CharacterFromID("prisoner_Silehard"));
			LAi_ActorRunToLocator(CharacterFromID("prisoner_Silehard"), "reload", "reload2", "prisoner_Silehard_staytype", 10.0);
			Pchar.quest.prisoner_Silehard = "out";
		break;

		case "prisoner_Courtney_runs":
			ChangeCharacterAddressGroup(CharacterFromID("prisoner_wr_bri"), "wr_animists", "goto", "goto6");
			LAi_SetActorType(CharacterFromID("prisoner_wr_bri"));
			LAi_ActorRunToLocator(CharacterFromID("prisoner_wr_bri"), "goto", "queue2", "prisoner_Courtney_staytype", 10.0);
			Pchar.quest.prisoner_Courtney = "out";
		break;

		case "prisoner_Bernard_runs":
			ChangeCharacterAddressGroup(CharacterFromID("fake_father_Bernard"), "wr_animists", "goto", "goto6");
			LAi_SetActorType(CharacterFromID("fake_father_Bernard"));
			LAi_ActorRunToLocator(CharacterFromID("fake_father_Bernard"), "goto", "queue3", "prisoner_Bernard_staytype", 10.0);
			Pchar.quest.prisoner_Bernard = "out";
		break;

		case "prisoner_Sarah_runs":
			ChangeCharacterAddressGroup(CharacterFromID("prisoner_Sarah_Fitter"), "wr_animists", "goto", "goto6");
			LAi_SetActorType(CharacterFromID("prisoner_Sarah_Fitter"));
			LAi_ActorRunToLocator(CharacterFromID("prisoner_Sarah_Fitter"), "goto", "queue4", "prisoner_Sarah_staytype", 10.0);
			Pchar.quest.prisoner_Fitter = "out";
		break;

		case "prisoner_Wellman_runs":
			ChangeCharacterAddressGroup(CharacterFromID("prisoner_Laurence_Wellman"), "wr_animists", "goto", "goto6");
			LAi_SetActorType(CharacterFromID("prisoner_Laurence_Wellman"));
			LAi_ActorRunToLocator(CharacterFromID("prisoner_Laurence_Wellman"), "goto", "queue5", "prisoner_Wellman_staytype", 10.0);
			Pchar.quest.prisoner_Wellman = "out";

			LAi_QuestDelay("prisoner_Wellman_runs_alone", 4.0);
		break;

		case "prisoner_Wellman_runs_alone":
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");

			LAi_QuestDelay("prisoner_Wellman_runs_alone1", 1.0);
		break;

		case "prisoner_Wellman_runs_alone1":
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"What? There should be TWO prisoners in the last cell!"));
		break;

//-----------------------------------------------------------------------------------------------------------
		case "prisoner_Silehard_staytype":
			ChangeCharacterAddressGroup(CharacterFromID("prisoner_Silehard"), "wr_animists", "reload", "reload2");
			LAi_SetStayType(CharacterFromID("prisoner_Silehard"));
		break;

		case "prisoner_Courtney_staytype":
			ChangeCharacterAddressGroup(CharacterFromID("prisoner_wr_bri"), "wr_animists", "goto", "queue2");
			LAi_SetStayType(CharacterFromID("prisoner_wr_bri"));
		break;

		case "prisoner_Bernard_staytype":
			ChangeCharacterAddressGroup(CharacterFromID("fake_father_Bernard"), "wr_animists", "goto", "queue3");
			LAi_SetStayType(CharacterFromID("fake_father_Bernard"));
		break;

		case "prisoner_Sarah_staytype":
			ChangeCharacterAddressGroup(CharacterFromID("prisoner_Sarah_Fitter"), "wr_animists", "goto", "queue4");
			LAi_SetStayType(CharacterFromID("prisoner_Sarah_Fitter"));
		break;

		case "prisoner_Wellman_staytype":
			ChangeCharacterAddressGroup(CharacterFromID("prisoner_Laurence_Wellman"), "wr_animists", "goto", "queue5");
			LAi_SetStayType(CharacterFromID("prisoner_Laurence_Wellman"));
		break;
//-----------------------------------------------------------------------------------------------------------
		case "temple_prisoners_gone":
			PlaySound("OBJECTS\SHIPCHARGE\hurrah.wav");

			ChangeCharacterAddressGroup(CharacterFromID("prisoner_Silehard"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("fake_father_Bernard"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("prisoner_Sarah_Fitter"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("prisoner_Laurence_Wellman"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("prisoner_wr_bri"), "none", "", "");

			Pchar.quest.prisoner_Silehard = "gone";

			Locations[FindLocation("wr_animists_stairs")].reload.l2.disable = 1;	//to chapel, not opened again during this visit

			if(CheckAttribute(Pchar,"quest.mine_bomb2") && Pchar.quest.mine_bomb2 == "placed")
			{
				ChangeCharacterAddressGroup(CharacterFromID("prisoner_defoe"), "wr_animists", "goto", "goto36");
				LAi_SetSitType(CharacterFromID("prisoner_defoe"));

				GiveItem2Character(CharacterFromID("prisoner_defoe"), "pistolspade");
				EquipCharacterbyItem(CharacterFromID("prisoner_defoe"), "pistolspade");
			}
		break;
//-----------------------------------------------------------------------------------------------------------
		case "Defoe_sledge":
			//from Defoe dialog

			RemoveCharacterEquip(CharacterFromID("prisoner_defoe"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(CharacterFromID("prisoner_defoe"), "pistolspade");
			GiveItem2Character(Pchar, "pistolspade");
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			EquipCharacterbyItem(Pchar, "pistolspade");

			LAi_QuestDelay("Defoe_sledge1", 1.0);

			Locations[FindLocation("wr_animists")].locators_radius.box.box6 = 0.0001;

			pchar.quest.ready_for_defence.win_condition.l1 = "locator";
			pchar.quest.ready_for_defence.win_condition.l1.location = "wr_animists";
			pchar.quest.ready_for_defence.win_condition.l1.locator_group = "goto";
			pchar.quest.ready_for_defence.win_condition.l1.locator = "sledge2";
			pchar.quest.ready_for_defence.win_condition = "ready_for_defence";
		break;

		case "Defoe_sledge1":
			ChangeCharacterAddressGroup(CharacterFromID("prisoner_defoe"), "wr_animists", "goto", "goto36");
			LAi_SetSitType(CharacterFromID("prisoner_defoe"));
			PlaySound("AMBIENT\SHOP\sigh1.wav");
			LAi_SetPlayerType(Pchar);

			Locations[FindLocation("wr_animists")].locators_radius.box.box7 = 0.8;	//very small from start

			pchar.quest.ready_for_minebomb.win_condition.l1 = "locator";
			pchar.quest.ready_for_minebomb.win_condition.l1.location = "wr_animists";
			pchar.quest.ready_for_minebomb.win_condition.l1.locator_group = "goto";
			pchar.quest.ready_for_minebomb.win_condition.l1.locator = "goto42";
			pchar.quest.ready_for_minebomb.win_condition = "ready_for_minebomb";
		break;
//-----------------------------------------------------------------------------------------------------------
		case "ready_for_defence":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "randitem", "randitem10");

			LAi_QuestDelay("ready_for_defence1", 1.0);
		break;

		case "ready_for_defence1":
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], false);//temp only
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(Pchar, true);	//now pchar has to "shoot" with the pistolspade
			LAi_LockFightMode(Pchar, true);
		break;

		case "sledge_to_defence":
			//from LAi_events
			PlaySound("OBJECTS\DUEL\sword_fallen.wav");
			LAi_LockFightMode(Pchar, false);
			LAi_SetFightMode(Pchar, false);
			LAi_SetPlayerType(Pchar);

			Locations[FindLocation("wr_animists")].locators_radius.randitem.randitem10 = 1.5;

			LAi_QuestDelay("sledge_to_defence1", 1.0);
		break;

		case "sledge_to_defence1":
			locations[FindLocation("wr_animists")].image = "";
			DoQuestReloadToLocation("wr_animists", "goto", "sledge2", "temple_defence");
		break;

		case "temple_defence":
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], true);
			locations[FindLocation("wr_animists")].image = "wr_animists.tga";
			if(CheckCharacterItem(Pchar,"bladedefense"))
			{
				//moved up
				//LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], true);	//reset to diasable

				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladedefense");
				EquipCharacterByItem(Pchar, "pistolspade");

				Pchar.quest.temple_defence = "picked_up";
			}
			else LAi_QuestDelay("temple_defence", 0.5);	//loops until defence is picked up
		break;
//-----------------------------------------------------------------------------------------------------------
		case "ready_for_minebomb":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "bomb_look");

			LAi_QuestDelay("ready_for_minebomb1", 1.0);
		break;

		case "ready_for_minebomb1":
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], false);//temp only
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(Pchar, true);	//now pchar has to "shoot" with the pistolspade
			LAi_LockFightMode(Pchar, true);
		break;

		case "sledge_to_minebomb":
			//from LAi_events
			PauseAllSounds();
			PlaySound("INTERFACE\damper_close.wav");
			if(!CheckCharacterItem(Pchar,"bladedefense"))
			{
				LAi_SetFightMode(Pchar, false);
			}

			CreateParticleSystem("fort_fire" , -5.0, 0.7, -13.1, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("OBJECTS\SHIPCHARGE\bomb_lit.wav");

			Locations[FindLocation("wr_animists")].locators_radius.box.box7 = 0.0001;

			LAi_QuestDelay("sledge_to_minebomb1", 3.0);	//was 2.0
		break;

		case "sledge_to_minebomb1":
			ResumeAllSounds();

			PlaySound("OBJECTS\DUEL\pistol_musket.wav");
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire1.wav");
			PlaySound("OBJECTS\SHIPCHARGE\LG42H.wav");
			PlayStereoSound("OBJECTS\SHIPCHARGE\gunpowder_explosion.wav");
			PlaySound("PEOPLE\roof_broken2.wav");

			GetCharacterPos(Pchar, &u, &v, &w);

			CreateParticleSystem("fort_fire" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("fort_fire" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("fort_fire" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("fort_fire" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("fort_fire" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

			CreateParticleSystem("canfire" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("canfire" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("canfire" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("canfire" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("canfire" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

			CreateParticleSystem("gunfire_red" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("gunfire_red" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("gunfire_red" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("gunfire_red" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("gunfire_red" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

			CreateParticleSystem("stars_fire" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("stars_fire" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("stars_fire" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("stars_fire" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("stars_fire" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

			CreateParticleSystem("cancloud" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("cancloud" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("cancloud" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("cancloud" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("cancloud" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

			CreateParticleSystem("splinters", u, v+1.8, W, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", u-0.5, v+1.0, W, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", u, v+1.8, w, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", u-0.5, v+1.0, w, 0.0, 0.0, 0.0, 0);

			Php = LAi_GetCharacterHP(Pchar);
			Php2 = Php/2;
			LAi_ApplyCharacterDamage(Pchar, Php2);

			if(CheckCharacterItem(Pchar,"bladedefense"))
			{
				LAi_QuestDelay("sledge_to_minebomb3", 5.0);
				LAi_QuestDelay("sledge_to_minebomb2", 2.5);
			}
			else
			{
				LAi_QuestDelay("dead_by_minebomb", 1.0);
			}
		break;
	//...................................................................
		case "dead_by_minebomb":
			LAi_KillCharacter(Pchar);

			LAi_QuestDelay("dead_by_minebomb1", 5.0);//4.0 was ok
		break;

		case "dead_by_minebomb1":
			LAi_ApplyCharacterDamage(Pchar, 1000);
			if(LAi_IsDead(Pchar)) GameOverOrg("land");
		break;
	//...................................................................
		case "sledge_to_minebomb2":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead6.wav");

			Php = LAi_GetCharacterHP(Pchar);
			Php2 = Php/2;
			LAi_ApplyCharacterDamage(Pchar, Php2);
		break;

		case "sledge_to_minebomb3":
			LAi_SetActorType(Pchar);
			LAi_ActorSetLayMode(Pchar);

			Locations[FindLocation("wr_animists")].reload.l1.disable = 0;			//open to crypt
			Locations[FindLocation("wr_animists")].locators_radius.goto.crypt_closed = 0.0001;	//was 0.3 what use?
			Locations[FindLocation("wr_animists")].models.always.l4 = "";			//no wood_box
			Locations[FindLocation("wr_animists")].models.always.l5 = "";			//no mine_bomb

			Locations[FindLocation("wr_animists")].type = "Vane_silent_temple";		//music off

			DoQuestReloadToLocation("wr_animists", "goto", "goto42", "sledge_to_minebomb4");
		break;

		case "sledge_to_minebomb4":
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], true);	//reset to diasable

			Php = LAi_GetCharacterHP(Pchar);
			Php2 = Php/2;
			LAi_ApplyCharacterDamage(Pchar, Php2);

			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("cancloud" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );

			LAi_SetFightMode(Pchar, false);//here?
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "pistolspade");

			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladedefense");
			TakeItemFromCharacter(Pchar, "bladeaxe5");
			EquipCharacterByItem(Pchar, "bladeA11");
			EquipCharacterByItem(Pchar, "pistol203");
			TakeItemFromCharacter(Pchar, "note3");
			locations[FindLocation("wr_animists")].box5.items.note3 = 0;//if not picked up

			SetModel(PChar, "Pira4M_HTUS", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			LAi_QuestDelay("sledge_to_minebomb5", 4.0);
		break;

		case "sledge_to_minebomb5":
			LAi_SetSitType(Pchar);
			PlaySound("OBJECTS\VOICES\DEAD\male\dead7.wav");

			LAi_QuestDelay("sledge_to_minebomb6", 2.0);
		break;

		case "sledge_to_minebomb6":
			PlaySound("AMBIENT\SHOP\sigh1.wav");
			LAi_SetstayType(Pchar);

			LAi_QuestDelay("sledge_to_minebomb7", 1.0);
		break;

		case "sledge_to_minebomb7":
			PlaySound("INTERFACE\step_open.wav");

			LAi_QuestDelay("sledge_to_minebomb8", 2.0);
		break;

		case "sledge_to_minebomb8":
			PlaySound("VOICe\ENGLISH\blaze_what_was_that.wav");

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto19");	//was reload9

			LAi_QuestDelay("ready_for_ships0", 1.0);
			LAi_QuestDelay("sledge_to_minebomb9", 1.0);
		break;

		case "sledge_to_minebomb9":
			LAi_SetPlayerType(Pchar);

			pchar.quest.Bernard_shipyard_hint.win_condition.l1 = "locator";
			pchar.quest.Bernard_shipyard_hint.win_condition.l1.location = "Redmond_church";
			pchar.quest.Bernard_shipyard_hint.win_condition.l1.locator_group = "goto";
			pchar.quest.Bernard_shipyard_hint.win_condition.l1.locator = "goto13";
			pchar.quest.Bernard_shipyard_hint.win_condition = "Bernard_shipyard_hint";
		break;

		case "Bernard_shipyard_hint":
			LAi_SetActorType(CharacterFromID("Father Bernard"));
			LAi_ActorDialog(characterFromID("Father Bernard"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Father Bernard"));
			Characters[GetCharacterIndex("Father Bernard")].dialog.CurrentNode  = "shipyard_hint";
		break;
//-----------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------
	//[11] from here ...
		case "ready_for_ships":
			DoQuestReloadToLocation("Redmond_shore_03", "officers", "reload2_1", "ready_for_ships0");
		break;

		case "ready_for_ships0":
			DeleteAttribute(PChar, "quest.disable_rebirth");
			SetCurrentTime(8.00, 0);
   			SetNextWeather("Clear");
   			Pchar.quest.JRH_rain = "Clear";

			LAi_SetPlayerType(Pchar);
			DeleteAttribute(&Locations[FindLocation("Shipyard_shore")],"vcskip");

			Pchar.quest.book49_check = "off";
			Pchar.quest.scroll46 = "on_counter";
			Pchar.quest.beltkey = "in_lock";
			Pchar.quest.gall_captain = "locked";
			Pchar.quest.ship_wc = "start";
			Pchar.quest.captains_door = "closed";
			Pchar.quest.gold_door = "locked";
			Pchar.quest.cannon_ram = "0";
			Pchar.quest.cannon_wad = "0";					//0 means not even "ready"
			Pchar.quest.deck_bell = "ok";
			Pchar.quest.cannon_goodspile = "current";
			Pchar.quest.cannon_enable_move = "no";
			Pchar.quest.cannon_priming = "no";
			Pchar.quest.cannon_temp = "cold";
			Pchar.quest.cannon_powder = "0";
			Pchar.quest.cannon_ball = "0";
			Pchar.quest.ammodeck = "locked";
			Pchar.quest.guncrew = "locked_in";			//free later
			Pchar.quest.anchor = "up";
			Pchar.quest.pinion_pos_left = "free";			//(small, large)
			Pchar.quest.pinion_pos_right = "free";			//(small, large)
			Pchar.quest.wheel_pos_left = "free";			//(wheel)
			Pchar.quest.wheel_pos_right = "free";			//(wheel)
			Pchar.quest.anchor_mechanism = "not_ready";		//(complete)
			Pchar.quest.deck_position = "elsewhere";		//(cannon, mechanism_L, mechanism_R)
			Pchar.quest.farm_water = "off";
			Pchar.quest.alchemy_lever = "down";
			Pchar.quest.alchemy_plank = "up";			//always up now - may be removed
			Pchar.quest.apparatus_level = "start";			//start
			Pchar.quest.farmbooty_fillbottle = "off";
			Pchar.quest.apparatus_liquid = "none";
			Pchar.quest.apparatus_cooling = "0";
			Pchar.quest.mixtable_bottle = "ME0";			//start
			Pchar.quest.anchor_size = "large";			//(small) later
			Pchar.quest.Minerva_copper = "no";
			Pchar.quest.Minerva_silver = "no";
			Pchar.quest.Minerva_gold = "no";
			Pchar.quest.apparatus_hint = "yes";
			Pchar.quest.process_hint = "yes";

			SetCharacterShipLocation(characterFromID("CoastBrother29"), "Redmond_shore_ship");//PrisonShip
			SetCharacterShipLocation(characterFromID("CoastBrother30"), "Redmond_shore_ship");//PrisonShip
			SetCharacterShipLocation(characterFromID("CoastBrother32"), "Redmond_shore_ship");//tartane2
			SetCharacterShipLocation(characterFromID("CoastBrother33"), "Redmond_shore_03");//tartane2
			SetCharacterShipLocation(characterFromID("CoastBrother25"), "wr_port");		//prize ship galleon
			SetCharacterShipLocation(characterFromID("CoastBrother26"), "wr_port");		//prize ship corvette
		//	SetCharacterShipLocation(characterFromID("CoastBrother27"), "wr_port");		//boat2 but later
			SetCharacterShipLocation(characterFromID("wr_aub"), "wr_ships");		//boat2

		Locations[FindLocation("Redmond_church")].models.always.locators = "church_l_JRH";
			Locations[FindLocation("Redmond_Town_01")].models.always.locators = "Red01_l_JRH5";	//bridge visible + exit backdoor loanshark
			Locations[FindLocation("Redmond_town_exit_2")].models.always.locators = "Redexit2_l_JRH";//well
			Locations[FindLocation("Redmond_tavern")].models.always.locators = "LT_l_JRH3";
			Locations[FindLocation("Redmond_UsurerHouse")].models.always.locators = "ss_l_JRH3";
			Locations[FindLocation("Redmond_shore_02")].models.always.locators = "shore03_l";	//no tartane

			Locations[FindLocation("wr_church_inside")].type = "Vane_church";	//reset from "Vane_church_tavern"
			Locations[FindLocation("wr_animists_stairs")].reload.l2.disable = 1;	//to chapel, already locked earlier by game
			Locations[FindLocation("wr_animists")].reload.l1.disable = 0;		//to crypt
			locations[FindLocation("wr_crypt")].id.label = "Port Royal catacombs";
			locations[FindLocation("Redmond_church")].reload.l3.disable = 0;	//to crypt
			Locations[FindLocation("Redmond_Town_01")].reload.l13.disable = 0;	//to governor's residence
			Locations[FindLocation("Redmond_Town_01")].reload.l18.disable = 1;	//to window
			Locations[FindLocation("Redmond_Town_01")].reload.l23.disable = 1;	//to gate
			Locations[FindLocation("Redmond_Town_01")].reload.l20.disable = 1;	//to backdoor LS
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l4.disable = 1;	//to counter
			locations[FindLocation("Redmond_tavern")].reload.l3.disable = 1;	//to balcony
			locations[FindLocation("Redmond_tavern")].reload.l6.disable = 1;	//to storeroom
			Locations[FindLocation("Redmond_Port")].reload.l6.disable = 0;		//to harbour office
			Locations[FindLocation("Redmond_Town_exit_2")].reload.l1.disable = 0;	//to town
			Locations[FindLocation("Redmond_Town_exit_2")].reload.l5.disable = 1;	//to well

			locations[FindLocation("wr_crypt")].id.label = "Port Royal catacombs";
			locations[FindLocation("WR_kitchen")].id.label = "Woodes Rogers' kitchen";
			locations[FindLocation("Tavern_storeroom")].id.label = "Tavern storeroom";
			locations[FindLocation("Shop_stairs")].id.label = "Rogers' Paintings Furniture & Weapons";
			locations[FindLocation("wr_crew")].id.label = "Crew's quarter";
			locations[FindLocation("wr_library")].id.label = "Woodes Rogers' library";
			locations[FindLocation("Loanshark_cellar")].id.label = "Loanshark cellar";

			Locations[FindLocation("Redmond_shipyard")].locators_radius.officers.reload2_1 = 2.0;

			ChangeCharacterAddressGroup(CharacterFromID("Red_guard_1"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("Red_guard_2"), "none", "", "");

			ChangeCharacterAddressGroup(CharacterFromID("Claire Voyant"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("Sarah Fitter"), "Redmond_town_04", "merchant", "merchant1");
			ChangeCharacterAddressGroup(CharacterFromID("Laurence Wellman"), "Redmond_Head_port_house", "goto", "locator1");
			ChangeCharacterAddressGroup(CharacterFromID("Father Bernard"), "Redmond_church", "goto", "goto11");
			ChangeCharacterAddressGroup(characterFromID("Woodes Rogers"), "Redmond_shipyard", "officers", "reload2_1");
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "Redmond_shipyard", "officers", "reload2_2");
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "Redmond_shipyard", "goto", "goto18");
			LAi_SetstayType(characterFromID("Woodes Rogers"));
			LAi_SetstayType(characterFromID("Selkirk"));
			LAi_SetstayType(characterFromID("Wench3"));

			ChangeCharacterAddressGroup(characterFromID("fake_Red_Docker_1"), "Shipyard_Shore", "sit", "sit1");
			ChangeCharacterAddressGroup(characterFromID("fake_Red_Docker_2"), "Shipyard_Shore", "goto", "goto4");
			ChangeCharacterAddressGroup(characterFromID("fake_Gillian_Atterbury"), "Shipyard_Shore", "goto", "goto2");
			ChangeCharacterAddressGroup(characterFromID("fake_Griffith_Peabody"), "Shipyard_Shore", "goto", "citizen01");
			ChangeCharacterAddressGroup(characterFromID("fake_Elias_Belt"), "Shipyard_Shore", "goto", "goto23");
			LAi_SetSitType(characterFromID("fake_Red_Docker_1"));
			LAi_SetCitizenType(characterFromID("fake_Red_Docker_2"));
			LAi_SetStayType(characterFromID("fake_Gillian_Atterbury"));
			LAi_SetCitizenType(characterFromID("fake_Griffith_Peabody"));
			LAi_SetCitizenType(characterFromID("fake_Elias_Belt"));

			ChangeCharacterAddressGroup(characterFromID("guncrew_1"), "wr_gall_hold_second", "goto", "stay2");
			ChangeCharacterAddressGroup(characterFromID("guncrew_2"), "wr_gall_hold_second", "goto", "stay1");
			ChangeCharacterAddressGroup(characterFromID("guncrew_3"), "wr_gall_hold_second", "goto", "stay4");
			ChangeCharacterAddressGroup(characterFromID("guncrew_4"), "wr_gall_hold_second", "goto", "stay3");

			LAi_QuestDelay("enter_farmhouse", 0.1);
			LAi_QuestDelay("enter_farmbedroom", 0.1);

			pchar.quest.ready_for_ships1.win_condition.l1 = "locator";
			pchar.quest.ready_for_ships1.win_condition.l1.location = "Redmond_shipyard";
			pchar.quest.ready_for_ships1.win_condition.l1.locator_group = "officers";
			pchar.quest.ready_for_ships1.win_condition.l1.locator = "reload2_1";
			pchar.quest.ready_for_ships1.win_condition = "ready_for_ships1";
		break;
//---------------------------------------------------------------------------------------------------
		case "ready_for_ships1":
			Locations[FindLocation("wr_animists")].type = "Vane_temple";		//reset music

			LAi_SetActorType(CharacterFromID("Woodes Rogers"));
			LAi_ActorDialog(CharacterFromID("Woodes Rogers"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Woodes Rogers"));
			Characters[GetCharacterIndex("Woodes Rogers")].dialog.CurrentNode  = "Spotswood_talk";
		break;

		case "Spotswood_talk_done":
			//from rogers dialog

			LAi_SetActorType(CharacterFromID("wench3"));
			LAi_ActorDialog(characterFromID("wench3"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wench3"));
			Characters[GetCharacterIndex("wench3")].dialog.CurrentNode  = "warning_officers";
		break;

		case "warning_officers_done":
			//from caroline dialog

			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorDialog(characterFromID("Selkirk"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Selkirk"));
			Characters[GetCharacterIndex("Selkirk")].dialog.CurrentNode  = "Dampier_bad";
		break;

		case "Dampier_warning_given":
			//from selkirk dialog

			LAi_SetActorType(CharacterFromID("Woodes Rogers"));
			LAi_ActorDialog(CharacterFromID("Woodes Rogers"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Woodes Rogers"));
			Characters[GetCharacterIndex("Woodes Rogers")].dialog.CurrentNode  = "officers_no_problems";
		break;

		case "officers_no_problems_done":
			//from rogers dialog
			SetCurrentTime(9.00, 0);
   			SetNextWeather("Clear");

			SetQuestHeader("Woodes_Rogers_reward_7");
			AddQuestRecord("Woodes_Rogers_reward_7", "1");

			LAi_SetStayType(CharacterFromID("Woodes Rogers"));
			LAi_SetStayType(CharacterFromID("wench3"));
			LAi_SetStayType(CharacterFromID("Selkirk"));

			PlaySound("VOICE\ENGLISH\gr_WR_friend3.wav");
			Locations[FindLocation("Redmond_shipyard")].reload.l2.disable = 0;	//to stairs
			locations[FindLocation("shipyard_stairs")].id.label = "Shipyard stairs";

			pchar.quest.3mainchar_gone.win_condition.l1 = "location";
			pchar.quest.3mainchar_gone.win_condition.l1.location = "Shipyard_shore";
			pchar.quest.3mainchar_gone.win_condition = "3mainchar_gone";
		break;

		case "3mainchar_gone":
			locations[FindLocation("shipyard_stairs")].reload.l1.disable = 1;//back to shya
			Pchar.quest.disable_rebirth = true;

			ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "none", "", "");

			LAi_QuestDelay("stonehouse_inside", 0.1);
			LAi_QuestDelay("defoes_cabin", 0.1);
			LAi_QuestDelay("shipyard_docks", 0.1);
			LAi_QuestDelay("subject_defoe_pirates", 0.1);
			LAi_QuestDelay("subject_defoe_travels", 0.1);
			LAi_QuestDelay("subject_defoe_alchemy", 0.1);
			LAi_QuestDelay("subject_defoe_selkirk", 0.1);
		//	LAi_QuestDelay("at_boatshore", 0.1);
			LAi_QuestDelay("at_prisonships", 0.1);

		//----------------------------------------------------------------------------------------
			pchar.quest.shyashore_backloop7_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop7_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop7_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop7_A.win_condition.l1.locator = "reload7";
			pchar.quest.shyashore_backloop7_A.win_condition = "shyashore_backloop7_A";

			pchar.quest.shyashore_backloop8_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop8_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop8_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop8_A.win_condition.l1.locator = "reload8";
			pchar.quest.shyashore_backloop8_A.win_condition = "shyashore_backloop8_A";
		//----------------------------------------------------------------------------------------
			pchar.quest.shyashore_backloop15_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop15_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop15_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop15_A.win_condition.l1.locator = "reload15";
			pchar.quest.shyashore_backloop15_A.win_condition = "shyashore_backloop15_A";

			pchar.quest.shyashore_backloop12_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop12_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop12_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop12_A.win_condition.l1.locator = "reload12";
			pchar.quest.shyashore_backloop12_A.win_condition = "shyashore_backloop12_A";

			pchar.quest.shyashore_backloop16_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop16_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop16_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop16_A.win_condition.l1.locator = "reload16";
			pchar.quest.shyashore_backloop16_A.win_condition = "shyashore_backloop16_A";

			pchar.quest.shyashore_backloop14_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop14_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop14_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop14_A.win_condition.l1.locator = "reload14";
			pchar.quest.shyashore_backloop14_A.win_condition = "shyashore_backloop14_A";

			pchar.quest.shyashore_backloop17_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop17_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop17_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop17_A.win_condition.l1.locator = "reload17";
			pchar.quest.shyashore_backloop17_A.win_condition = "shyashore_backloop17_A";

			pchar.quest.shyashore_backloop28_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop28_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop28_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop28_A.win_condition.l1.locator = "reload28";
			pchar.quest.shyashore_backloop28_A.win_condition = "shyashore_backloop28_A";
		//----------------------------------------------------------------------------------------
			pchar.quest.shyashore_backloop22_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop22_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop22_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop22_A.win_condition.l1.locator = "reload22";
			pchar.quest.shyashore_backloop22_A.win_condition = "shyashore_backloop22_A";

			pchar.quest.shyashore_backloop23_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop23_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop23_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop23_A.win_condition.l1.locator = "reload23";
			pchar.quest.shyashore_backloop23_A.win_condition = "shyashore_backloop23_A";

			pchar.quest.shyashore_backloop24_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop24_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop24_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop24_A.win_condition.l1.locator = "reload24";
			pchar.quest.shyashore_backloop24_A.win_condition = "shyashore_backloop24_A";

			pchar.quest.shyashore_backloop25_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop25_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop25_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop25_A.win_condition.l1.locator = "reload25";
			pchar.quest.shyashore_backloop25_A.win_condition = "shyashore_backloop25_A";
		//----------------------------------------------------------------------------------------
			pchar.quest.shyashore_backloop26_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop26_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop26_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop26_A.win_condition.l1.locator = "reload26";
			pchar.quest.shyashore_backloop26_A.win_condition = "shyashore_backloop26_A";

			pchar.quest.shyashore_backloop27_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop27_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop27_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop27_A.win_condition.l1.locator = "reload27";
			pchar.quest.shyashore_backloop27_A.win_condition = "shyashore_backloop27_A";

			pchar.quest.shyashore_backloop21_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop21_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop21_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop21_A.win_condition.l1.locator = "reload21";
			pchar.quest.shyashore_backloop21_A.win_condition = "shyashore_backloop21_A";
		//----------------------------------------------------------------------------------------
			pchar.quest.shyashore_backloop18_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop18_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop18_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop18_A.win_condition.l1.locator = "reload18";
			pchar.quest.shyashore_backloop18_A.win_condition = "shyashore_backloop18_A";

			pchar.quest.shyashore_backloop10_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop10_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop10_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop10_A.win_condition.l1.locator = "reload10";
			pchar.quest.shyashore_backloop10_A.win_condition = "shyashore_backloop10_A";

			pchar.quest.shyashore_backloop11_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop11_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop11_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop11_A.win_condition.l1.locator = "reload11";
			pchar.quest.shyashore_backloop11_A.win_condition = "shyashore_backloop11_A";

			pchar.quest.shyashore_backloop19_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop19_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop19_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop19_A.win_condition.l1.locator = "reload19";
			pchar.quest.shyashore_backloop19_A.win_condition = "shyashore_backloop19_A";

			pchar.quest.shyashore_backloop20_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop20_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop20_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop20_A.win_condition.l1.locator = "reload20";
			pchar.quest.shyashore_backloop20_A.win_condition = "shyashore_backloop20_A";

			pchar.quest.shyashore_backloop6_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop6_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop6_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop6_A.win_condition.l1.locator = "reload6";
			pchar.quest.shyashore_backloop6_A.win_condition = "shyashore_backloop6_A";
		//----------------------------------------------------------------------------------------
			pchar.quest.shyashore_backloop13_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop13_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop13_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop13_A.win_condition.l1.locator = "reload13";
			pchar.quest.shyashore_backloop13_A.win_condition = "shyashore_backloop13_A";

			pchar.quest.shyashore_backloop9_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop9_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop9_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop9_A.win_condition.l1.locator = "reload9";
			pchar.quest.shyashore_backloop9_A.win_condition = "shyashore_backloop9_A";
		//----------------------------------------------------------------------------------------
		//----------------------------------------------------------------------------------------
			pchar.quest.shoreship_backloop6_A.win_condition.l1 = "locator";
			pchar.quest.shoreship_backloop6_A.win_condition.l1.location = "Redmond_shore_ship";
			pchar.quest.shoreship_backloop6_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shoreship_backloop6_A.win_condition.l1.locator = "reload6";
			pchar.quest.shoreship_backloop6_A.win_condition = "shoreship_backloop6_A";
		//----------------------------------------------------------------------------------------
		//----------------------------------------------------------------------------------------
			pchar.quest.boatshore_backloop3_A.win_condition.l1 = "locator";
			pchar.quest.boatshore_backloop3_A.win_condition.l1.location = "Redmond_shore_03";
			pchar.quest.boatshore_backloop3_A.win_condition.l1.locator_group = "reload";
			pchar.quest.boatshore_backloop3_A.win_condition.l1.locator = "reload3";
			pchar.quest.boatshore_backloop3_A.win_condition = "boatshore_backloop3_A";
		//----------------------------------------------------------------------------------------
		//----------------------------------------------------------------------------------------
			pchar.quest.wrport_backloop7_A.win_condition.l1 = "locator";
			pchar.quest.wrport_backloop7_A.win_condition.l1.location = "wr_port";
			pchar.quest.wrport_backloop7_A.win_condition.l1.locator_group = "reload";
			pchar.quest.wrport_backloop7_A.win_condition.l1.locator = "reload7";
			pchar.quest.wrport_backloop7_A.win_condition = "wrport_backloop7_A";

			pchar.quest.wrport_backloop8_A.win_condition.l1 = "locator";
			pchar.quest.wrport_backloop8_A.win_condition.l1.location = "wr_port";
			pchar.quest.wrport_backloop8_A.win_condition.l1.locator_group = "reload";
			pchar.quest.wrport_backloop8_A.win_condition.l1.locator = "reload8";
			pchar.quest.wrport_backloop8_A.win_condition = "wrport_backloop8_A";
	/*
			pchar.quest.wrport_backloop4_A.win_condition.l1 = "locator";
			pchar.quest.wrport_backloop4_A.win_condition.l1.location = "wr_port";
			pchar.quest.wrport_backloop4_A.win_condition.l1.locator_group = "reload";
			pchar.quest.wrport_backloop4_A.win_condition.l1.locator = "reload4";
			pchar.quest.wrport_backloop4_A.win_condition = "wrport_backloop4_A";

			pchar.quest.wrport_backloop5_A.win_condition.l1 = "locator";
			pchar.quest.wrport_backloop5_A.win_condition.l1.location = "wr_port";
			pchar.quest.wrport_backloop5_A.win_condition.l1.locator_group = "reload";
			pchar.quest.wrport_backloop5_A.win_condition.l1.locator = "reload5";
			pchar.quest.wrport_backloop5_A.win_condition = "wrport_backloop5_A";

			pchar.quest.wrport_backloop6_A.win_condition.l1 = "locator";
			pchar.quest.wrport_backloop6_A.win_condition.l1.location = "wr_port";
			pchar.quest.wrport_backloop6_A.win_condition.l1.locator_group = "reload";
			pchar.quest.wrport_backloop6_A.win_condition.l1.locator = "reload6";
			pchar.quest.wrport_backloop6_A.win_condition = "wrport_backloop6_A";

			pchar.quest.wrport_backloop9_A.win_condition.l1 = "locator";
			pchar.quest.wrport_backloop9_A.win_condition.l1.location = "wr_port";
			pchar.quest.wrport_backloop9_A.win_condition.l1.locator_group = "reload";
			pchar.quest.wrport_backloop9_A.win_condition.l1.locator = "reload9";
			pchar.quest.wrport_backloop9_A.win_condition = "wrport_backloop9_A";

			pchar.quest.wrport_backloop10_A.win_condition.l1 = "locator";
			pchar.quest.wrport_backloop10_A.win_condition.l1.location = "wr_port";
			pchar.quest.wrport_backloop10_A.win_condition.l1.locator_group = "reload";
			pchar.quest.wrport_backloop10_A.win_condition.l1.locator = "reload10";
			pchar.quest.wrport_backloop10_A.win_condition = "wrport_backloop10_A";
	*/
		break;
	//.................................................................................................
		case "at_prisonships":
			pchar.quest.at_prisonships1.win_condition.l1 = "location";
			pchar.quest.at_prisonships1.win_condition.l1.location = "Redmond_shore_ship";
			pchar.quest.at_prisonships1.win_condition = "at_prisonships1";
		break;

		case "at_prisonships1":
			SetCurrentTime(10.00, 0);
   			SetNextWeather("Clear");

			pchar.quest.at_boatshore.win_condition.l1 = "location";
			pchar.quest.at_boatshore.win_condition.l1.location = "Redmond_shore_03";
			pchar.quest.at_boatshore.win_condition = "at_boatshore";
		break;

		case "at_boatshore":
			SetNextWind("E",30);
		break;

		case "stonehouse_inside":
			pchar.quest.stonehouse_inside1.win_condition.l1 = "location";
			pchar.quest.stonehouse_inside1.win_condition.l1.location = "stonehouse_inside";
			pchar.quest.stonehouse_inside1.win_condition = "stonehouse_inside1";
		break;

		case "stonehouse_inside1":
			locations[FindLocation(Pchar.location)].box1.items.book41 = 1;
		break;

		case "defoes_cabin":
			pchar.quest.defoes_cabin1.win_condition.l1 = "location";
			pchar.quest.defoes_cabin1.win_condition.l1.location = "Defoes_cabin";
			pchar.quest.defoes_cabin1.win_condition = "defoes_cabin1";
		break;

		case "defoes_cabin1":
			locations[FindLocation(Pchar.location)].box3.items.book48 = 1;
		break;

		case "shipyard_docks":
			pchar.quest.shipyard_docks1.win_condition.l1 = "locator";
			pchar.quest.shipyard_docks1.win_condition.l1.location = "shipyard_docks";
			pchar.quest.shipyard_docks1.win_condition.l1.locator_group = "goto";
			pchar.quest.shipyard_docks1.win_condition.l1.locator = "goto9";
			pchar.quest.shipyard_docks1.win_condition = "shipyard_docks1";
		break;

		case "shipyard_docks1":
			PlaySound("PEOPLE\run_wood.wav");

			LAi_QuestDelay("shipyard_docks2", 1.0);
		break;

		case "shipyard_docks2":
			PlaySound("PEOPLE\Jump_Counter.wav");
			ChangeCharacterAddressGroup(Pchar, "shipyard_docks", "goto", "goto8");

			LAi_QuestDelay("shipyard_docks3", 0.5);
		break;

		case "shipyard_docks3":
			ChangeCharacterAddressGroup(Pchar, "shipyard_docks", "goto", "dock1");

			pchar.quest.shipyard_docks4.win_condition.l1 = "locator";
			pchar.quest.shipyard_docks4.win_condition.l1.location = "shipyard_docks";
			pchar.quest.shipyard_docks4.win_condition.l1.locator_group = "reload";
			pchar.quest.shipyard_docks4.win_condition.l1.locator = "reload5";
			pchar.quest.shipyard_docks4.win_condition = "shipyard_docks4";
		break;

		case "shipyard_docks4":
			PlaySound("PEOPLE\Jump.wav");
			LAi_SetSitType(Pchar);

			LAi_QuestDelay("shipyard_docks5", 0.5);
		break;

		case "shipyard_docks5":
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("shipyard_docks", 0.1);	//loop restart
		break;

		case "subject_defoe_pirates":
			pchar.quest.subject_defoe_pirates1.win_condition.l1 = "locator";
			pchar.quest.subject_defoe_pirates1.win_condition.l1.location = "Defoes_cabin";
			pchar.quest.subject_defoe_pirates1.win_condition.l1.locator_group = "box";
			pchar.quest.subject_defoe_pirates1.win_condition.l1.locator = "box1";
			pchar.quest.subject_defoe_pirates1.win_condition = "subject_defoe_pirates1";
		break;

		case "subject_defoe_pirates1":
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Contemporary Notorious Pirates"));
			LAi_QuestDelay("subject_defoe_pirates", 0.1);
		break;

		case "subject_defoe_travels":
			pchar.quest.subject_defoe_travels1.win_condition.l1 = "locator";
			pchar.quest.subject_defoe_travels1.win_condition.l1.location = "Defoes_cabin";
			pchar.quest.subject_defoe_travels1.win_condition.l1.locator_group = "box";
			pchar.quest.subject_defoe_travels1.win_condition.l1.locator = "box2";
			pchar.quest.subject_defoe_travels1.win_condition = "subject_defoe_travels1";
		break;

		case "subject_defoe_travels1":
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Roger's journals: A Cruising Voyage Round the World"));
			LAi_QuestDelay("subject_defoe_travels", 0.1);
		break;

		case "subject_defoe_alchemy":
			pchar.quest.subject_defoe_alchemy1.win_condition.l1 = "locator";
			pchar.quest.subject_defoe_alchemy1.win_condition.l1.location = "Defoes_cabin";
			pchar.quest.subject_defoe_alchemy1.win_condition.l1.locator_group = "box";
			pchar.quest.subject_defoe_alchemy1.win_condition.l1.locator = "box3";
			pchar.quest.subject_defoe_alchemy1.win_condition = "subject_defoe_alchemy1";
		break;

		case "subject_defoe_alchemy1":
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Practical Alchemy"));
			LAi_QuestDelay("subject_defoe_alchemy", 0.1);
		break;

		case "subject_defoe_selkirk":
			pchar.quest.subject_defoe_selkirk1.win_condition.l1 = "locator";
			pchar.quest.subject_defoe_selkirk1.win_condition.l1.location = "Defoes_cabin";
			pchar.quest.subject_defoe_selkirk1.win_condition.l1.locator_group = "box";
			pchar.quest.subject_defoe_selkirk1.win_condition.l1.locator = "box6";
			pchar.quest.subject_defoe_selkirk1.win_condition = "subject_defoe_selkirk1";
		break;

		case "subject_defoe_selkirk1":
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Selkirk research"));
			LAi_QuestDelay("subject_defoe_selkirk", 0.1);
		break;
	//.................................................................................................
		case "shyashore_backloop7":
			pchar.quest.shyashore_backloop7_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop7_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop7_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop7_A.win_condition.l1.locator = "reload7";
			pchar.quest.shyashore_backloop7_A.win_condition = "shyashore_backloop7_A";
		break;

		case "shyashore_backloop7_A":
			ChangeCharacterAddressGroup(Pchar, "shipyard_shore", "goto", "goto11");

			LAi_QuestDelay("shyashore_backloop7", 0.1);
		break;


		case "shyashore_backloop8":
			pchar.quest.shyashore_backloop8_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop8_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop8_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop8_A.win_condition.l1.locator = "reload8";
			pchar.quest.shyashore_backloop8_A.win_condition = "shyashore_backloop8_A";

		break;

		case "shyashore_backloop8_A":
			ChangeCharacterAddressGroup(Pchar, "shipyard_shore", "goto", "back12");

			LAi_QuestDelay("shyashore_backloop8", 0.1);
		break;
	//-------------------------------------------------------------------------------------------------
		case "shyashore_backloop15":
			pchar.quest.shyashore_backloop15_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop15_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop15_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop15_A.win_condition.l1.locator = "reload15";
			pchar.quest.shyashore_backloop15_A.win_condition = "shyashore_backloop15_A";
		break;

		case "shyashore_backloop15_A":
			ChangeCharacterAddressGroup(Pchar, "shipyard_shore", "goto", "back16");

			LAi_QuestDelay("shyashore_backloop15", 0.1);
		break;


		case "shyashore_backloop12":
			pchar.quest.shyashore_backloop12_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop12_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop12_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop12_A.win_condition.l1.locator = "reload12";
			pchar.quest.shyashore_backloop12_A.win_condition = "shyashore_backloop12_A";
		break;

		case "shyashore_backloop12_A":
			ChangeCharacterAddressGroup(Pchar, "shipyard_shore", "goto", "goto14");

			LAi_QuestDelay("shyashore_backloop12", 0.1);
		break;


		case "shyashore_backloop16":
			pchar.quest.shyashore_backloop16_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop16_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop16_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop16_A.win_condition.l1.locator = "reload16";
			pchar.quest.shyashore_backloop16_A.win_condition = "shyashore_backloop16_A";
		break;

		case "shyashore_backloop16_A":
			ChangeCharacterAddressGroup(Pchar, "shipyard_shore", "goto", "goto17");

			LAi_QuestDelay("shyashore_backloop16", 0.1);
		break;


		case "shyashore_backloop14":
			pchar.quest.shyashore_backloop14_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop14_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop14_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop14_A.win_condition.l1.locator = "reload14";
			pchar.quest.shyashore_backloop14_A.win_condition = "shyashore_backloop14_A";
		break;

		case "shyashore_backloop14_A":
			ChangeCharacterAddressGroup(Pchar, "shipyard_shore", "goto", "goto17");

			LAi_QuestDelay("shyashore_backloop14", 0.1);
		break;


		case "shyashore_backloop17":
			pchar.quest.shyashore_backloop17_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop17_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop17_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop17_A.win_condition.l1.locator = "reload17";
			pchar.quest.shyashore_backloop17_A.win_condition = "shyashore_backloop17_A";
		break;

		case "shyashore_backloop17_A":
			ChangeCharacterAddressGroup(Pchar, "shipyard_shore", "goto", "goto18");

			LAi_QuestDelay("shyashore_backloop17", 0.1);
		break;

		case "shyashore_backloop28":
			pchar.quest.shyashore_backloop28_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop28_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop28_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop28_A.win_condition.l1.locator = "reload28";
			pchar.quest.shyashore_backloop28_A.win_condition = "shyashore_backloop28_A";
		break;

		case "shyashore_backloop28_A":
			ChangeCharacterAddressGroup(Pchar, "shipyard_shore", "goto", "goto28");

			LAi_QuestDelay("shyashore_backloop28", 0.1);
		break;
	//-------------------------------------------------------------------------------------------------
		case "shyashore_backloop22":
			pchar.quest.shyashore_backloop22_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop22_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop22_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop22_A.win_condition.l1.locator = "reload22";
			pchar.quest.shyashore_backloop22_A.win_condition = "shyashore_backloop22_A";
		break;

		case "shyashore_backloop22_A":
			ChangeCharacterAddressGroup(Pchar, "shipyard_shore", "goto", "goto23");

			LAi_QuestDelay("shyashore_backloop22", 0.1);
		break;


		case "shyashore_backloop23":
			pchar.quest.shyashore_backloop23_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop23_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop23_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop23_A.win_condition.l1.locator = "reload23";
			pchar.quest.shyashore_backloop23_A.win_condition = "shyashore_backloop23_A";
		break;

		case "shyashore_backloop23_A":
			ChangeCharacterAddressGroup(Pchar, "shipyard_shore", "goto", "goto23");

			LAi_QuestDelay("shyashore_backloop23", 0.1);
		break;


		case "shyashore_backloop24":
			pchar.quest.shyashore_backloop24_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop24_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop24_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop24_A.win_condition.l1.locator = "reload24";
			pchar.quest.shyashore_backloop24_A.win_condition = "shyashore_backloop24_A";
		break;

		case "shyashore_backloop24_A":
			ChangeCharacterAddressGroup(Pchar, "shipyard_shore", "goto", "goto23");

			LAi_QuestDelay("shyashore_backloop24", 0.1);
		break;


		case "shyashore_backloop25":
			pchar.quest.shyashore_backloop25_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop25_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop25_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop25_A.win_condition.l1.locator = "reload25";
			pchar.quest.shyashore_backloop25_A.win_condition = "shyashore_backloop25_A";
		break;

		case "shyashore_backloop25_A":
			ChangeCharacterAddressGroup(Pchar, "shipyard_shore", "goto", "goto23");

			LAi_QuestDelay("shyashore_backloop25", 0.1);
		break;
	//-------------------------------------------------------------------------------------------------
		case "shyashore_backloop26":
			pchar.quest.shyashore_backloop26_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop26_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop26_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop26_A.win_condition.l1.locator = "reload26";
			pchar.quest.shyashore_backloop26_A.win_condition = "shyashore_backloop26_A";
		break;

		case "shyashore_backloop26_A":
			ChangeCharacterAddressGroup(Pchar, "shipyard_shore", "goto", "back26");

			LAi_QuestDelay("shyashore_backloop26", 0.1);
		break;


		case "shyashore_backloop27":
			pchar.quest.shyashore_backloop27_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop27_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop27_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop27_A.win_condition.l1.locator = "reload27";
			pchar.quest.shyashore_backloop27_A.win_condition = "shyashore_backloop27_A";
		break;

		case "shyashore_backloop27_A":
			ChangeCharacterAddressGroup(Pchar, "shipyard_shore", "goto", "back27");

			LAi_QuestDelay("shyashore_backloop27", 0.1);
		break;


		case "shyashore_backloop21":
			pchar.quest.shyashore_backloop21_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop21_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop21_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop21_A.win_condition.l1.locator = "reload21";
			pchar.quest.shyashore_backloop21_A.win_condition = "shyashore_backloop21_A";
		break;

		case "shyashore_backloop21_A":
			ChangeCharacterAddressGroup(Pchar, "shipyard_shore", "goto", "back21");

			LAi_QuestDelay("shyashore_backloop21", 0.1);
		break;
	//-------------------------------------------------------------------------------------------------
		case "shyashore_backloop18":
			pchar.quest.shyashore_backloop18_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop18_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop18_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop18_A.win_condition.l1.locator = "reload18";
			pchar.quest.shyashore_backloop18_A.win_condition = "shyashore_backloop18_A";
		break;

		case "shyashore_backloop18_A":
			ChangeCharacterAddressGroup(Pchar, "shipyard_shore", "goto", "back19");

			LAi_QuestDelay("shyashore_backloop18", 0.1);
		break;


		case "shyashore_backloop10":
			pchar.quest.shyashore_backloop10_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop10_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop10_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop10_A.win_condition.l1.locator = "reload10";
			pchar.quest.shyashore_backloop10_A.win_condition = "shyashore_backloop10_A";
		break;

		case "shyashore_backloop10_A":
			ChangeCharacterAddressGroup(Pchar, "shipyard_shore", "goto", "goto5");

			LAi_QuestDelay("shyashore_backloop10", 0.1);
		break;


		case "shyashore_backloop11":
			pchar.quest.shyashore_backloop11_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop11_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop11_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop11_A.win_condition.l1.locator = "reload11";
			pchar.quest.shyashore_backloop11_A.win_condition = "shyashore_backloop11_A";
		break;

		case "shyashore_backloop11_A":
			ChangeCharacterAddressGroup(Pchar, "shipyard_shore", "goto", "goto3");

			LAi_QuestDelay("shyashore_backloop11", 0.1);
		break;


		case "shyashore_backloop19":
			pchar.quest.shyashore_backloop19_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop19_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop19_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop19_A.win_condition.l1.locator = "reload19";
			pchar.quest.shyashore_backloop19_A.win_condition = "shyashore_backloop19_A";
		break;

		case "shyashore_backloop19_A":
			ChangeCharacterAddressGroup(Pchar, "shipyard_shore", "goto", "back20");

			LAi_QuestDelay("shyashore_backloop19", 0.1);
		break;


		case "shyashore_backloop20":
			pchar.quest.shyashore_backloop20_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop20_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop20_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop20_A.win_condition.l1.locator = "reload20";
			pchar.quest.shyashore_backloop20_A.win_condition = "shyashore_backloop20_A";
		break;

		case "shyashore_backloop20_A":
			ChangeCharacterAddressGroup(Pchar, "shipyard_shore", "goto", "back20");

			LAi_QuestDelay("shyashore_backloop20", 0.1);
		break;


		case "shyashore_backloop6":
			pchar.quest.shyashore_backloop6_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop6_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop6_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop6_A.win_condition.l1.locator = "reload6";
			pchar.quest.shyashore_backloop6_A.win_condition = "shyashore_backloop6_A";
		break;

		case "shyashore_backloop6_A":
			ChangeCharacterAddressGroup(Pchar, "shipyard_shore", "goto", "goto10");

			LAi_QuestDelay("shyashore_backloop6", 0.1);
		break;
	//-------------------------------------------------------------------------------------------------
		case "shyashore_backloop13":
			pchar.quest.shyashore_backloop13_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop13_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop13_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop13_A.win_condition.l1.locator = "reload13";
			pchar.quest.shyashore_backloop13_A.win_condition = "shyashore_backloop13_A";
		break;

		case "shyashore_backloop13_A":
			ChangeCharacterAddressGroup(Pchar, "shipyard_shore", "goto", "goto15");

			LAi_QuestDelay("shyashore_backloop13", 0.1);
		break;


		case "shyashore_backloop9":
			pchar.quest.shyashore_backloop9_A.win_condition.l1 = "locator";
			pchar.quest.shyashore_backloop9_A.win_condition.l1.location = "shipyard_shore";
			pchar.quest.shyashore_backloop9_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shyashore_backloop9_A.win_condition.l1.locator = "reload9";
			pchar.quest.shyashore_backloop9_A.win_condition = "shyashore_backloop9_A";
		break;

		case "shyashore_backloop9_A":
			ChangeCharacterAddressGroup(Pchar, "shipyard_shore", "goto", "goto13");

			LAi_QuestDelay("shyashore_backloop9", 0.1);
		break;
	//-------------------------------------------------------------------------------------------------
	//-------------------------------------------------------------------------------------------------
		case "shoreship_backloop6":
			pchar.quest.shoreship_backloop6_A.win_condition.l1 = "locator";
			pchar.quest.shoreship_backloop6_A.win_condition.l1.location = "Redmond_shore_ship";
			pchar.quest.shoreship_backloop6_A.win_condition.l1.locator_group = "reload";
			pchar.quest.shoreship_backloop6_A.win_condition.l1.locator = "reload6";
			pchar.quest.shoreship_backloop6_A.win_condition = "shoreship_backloop6_A";
		break;

		case "shoreship_backloop6_A":
			ChangeCharacterAddressGroup(Pchar, "Redmond_shore_ship", "goto", "back_off");

			LAi_QuestDelay("shoreship_backloop6", 0.1);
		break;
	//-------------------------------------------------------------------------------------------------
	//-------------------------------------------------------------------------------------------------
		case "boatshore_backloop3":
			pchar.quest.boatshore_backloop3_A.win_condition.l1 = "locator";
			pchar.quest.boatshore_backloop3_A.win_condition.l1.location = "Redmond_shore_03";
			pchar.quest.boatshore_backloop3_A.win_condition.l1.locator_group = "reload";
			pchar.quest.boatshore_backloop3_A.win_condition.l1.locator = "reload3";
			pchar.quest.boatshore_backloop3_A.win_condition = "boatshore_backloop3_A";
		break;

		case "boatshore_backloop3_A":
			ChangeCharacterAddressGroup(Pchar, "Redmond_shore_03", "goto", "goto10");

			LAi_QuestDelay("boatshore_backloop3", 0.1);
		break;
	//-------------------------------------------------------------------------------------------------
	//-------------------------------------------------------------------------------------------------
		case "wrport_backloop7":
			pchar.quest.wrport_backloop7_A.win_condition.l1 = "locator";
			pchar.quest.wrport_backloop7_A.win_condition.l1.location = "wr_port";
			pchar.quest.wrport_backloop7_A.win_condition.l1.locator_group = "reload";
			pchar.quest.wrport_backloop7_A.win_condition.l1.locator = "reload7";
			pchar.quest.wrport_backloop7_A.win_condition = "wrport_backloop7_A";
		break;

		case "wrport_backloop7_A":
			ChangeCharacterAddressGroup(Pchar, "wr_port", "goto", "goto22");

			LAi_QuestDelay("wrport_backloop7", 0.1);
		break;


		case "wrport_backloop8":
			pchar.quest.wrport_backloop8_A.win_condition.l1 = "locator";
			pchar.quest.wrport_backloop8_A.win_condition.l1.location = "wr_port";
			pchar.quest.wrport_backloop8_A.win_condition.l1.locator_group = "reload";
			pchar.quest.wrport_backloop8_A.win_condition.l1.locator = "reload8";
			pchar.quest.wrport_backloop8_A.win_condition = "wrport_backloop8_A";
		break;

		case "wrport_backloop8_A":
			ChangeCharacterAddressGroup(Pchar, "wr_port", "goto", "goto23");

			LAi_QuestDelay("wrport_backloop8", 0.1);
		break;

	/*
		case "wrport_backloop4":
			pchar.quest.wrport_backloop4_A.win_condition.l1 = "locator";
			pchar.quest.wrport_backloop4_A.win_condition.l1.location = "wr_port";
			pchar.quest.wrport_backloop4_A.win_condition.l1.locator_group = "reload";
			pchar.quest.wrport_backloop4_A.win_condition.l1.locator = "reload4";
			pchar.quest.wrport_backloop4_A.win_condition = "wrport_backloop4_A";
		break;

		case "wrport_backloop4_A":
			ChangeCharacterAddressGroup(Pchar, "wr_port", "goto", "goto20");

			LAi_QuestDelay("wrport_backloop4", 0.1);
		break;


		case "wrport_backloop5":
			pchar.quest.wrport_backloop5_A.win_condition.l1 = "locator";
			pchar.quest.wrport_backloop5_A.win_condition.l1.location = "wr_port";
			pchar.quest.wrport_backloop5_A.win_condition.l1.locator_group = "reload";
			pchar.quest.wrport_backloop5_A.win_condition.l1.locator = "reload5";
			pchar.quest.wrport_backloop5_A.win_condition = "wrport_backloop5_A";
		break;

		case "wrport_backloop5_A":
			ChangeCharacterAddressGroup(Pchar, "wr_port", "goto", "goto21");

			LAi_QuestDelay("wrport_backloop5", 0.1);
		break;


		case "wrport_backloop6":
			pchar.quest.wrport_backloop6_A.win_condition.l1 = "locator";
			pchar.quest.wrport_backloop6_A.win_condition.l1.location = "wr_port";
			pchar.quest.wrport_backloop6_A.win_condition.l1.locator_group = "reload";
			pchar.quest.wrport_backloop6_A.win_condition.l1.locator = "reload6";
			pchar.quest.wrport_backloop6_A.win_condition = "wrport_backloop6_A";
		break;

		case "wrport_backloop6_A":
			ChangeCharacterAddressGroup(Pchar, "wr_port", "goto", "goto21");

			LAi_QuestDelay("wrport_backloop6", 0.1);
		break;


		case "wrport_backloop9":
			pchar.quest.wrport_backloop9_A.win_condition.l1 = "locator";
			pchar.quest.wrport_backloop9_A.win_condition.l1.location = "wr_port";
			pchar.quest.wrport_backloop9_A.win_condition.l1.locator_group = "reload";
			pchar.quest.wrport_backloop9_A.win_condition.l1.locator = "reload9";
			pchar.quest.wrport_backloop9_A.win_condition = "wrport_backloop9_A";
		break;

		case "wrport_backloop9_A":
			ChangeCharacterAddressGroup(Pchar, "wr_port", "goto", "goto24");

			LAi_QuestDelay("wrport_backloop9", 0.1);
		break;


		case "wrport_backloop10":
			pchar.quest.wrport_backloop10_A.win_condition.l1 = "locator";
			pchar.quest.wrport_backloop10_A.win_condition.l1.location = "wr_port";
			pchar.quest.wrport_backloop10_A.win_condition.l1.locator_group = "reload";
			pchar.quest.wrport_backloop10_A.win_condition.l1.locator = "reload10";
			pchar.quest.wrport_backloop10_A.win_condition = "wrport_backloop10_A";
		break;

		case "wrport_backloop10_A":
			ChangeCharacterAddressGroup(Pchar, "wr_port", "goto", "goto24");

			LAi_QuestDelay("wrport_backloop10", 0.1);
		break;
	*/
	//.................................................................................................
		case "enter_ships":
			pchar.quest.enter_ships1.win_condition.l1 = "location";
			pchar.quest.enter_ships1.win_condition.l1.location = "wr_ships";
			pchar.quest.enter_ships1.win_condition = "enter_ships1";
		break;

		case "enter_ships1":
			LAi_QuestDelay("Long_goods1", 0.1);
			LAi_QuestDelay("crew_hatch_backoff", 0.1);
			LAi_QuestDelay("fall_to_hold", 0.1);

			LAi_QuestDelay("label_copperlock", 0.1);
			LAi_QuestDelay("label_silverlock", 0.1);
			LAi_QuestDelay("label_goldlock", 0.1);

			pchar.quest.take_ammo_ships.win_condition.l1 = "location";
			pchar.quest.take_ammo_ships.win_condition.l1.location = "wr_ships";
			pchar.quest.take_ammo_ships.win_condition = "take_ammo_ships";
		break;
	//.................................................................................................
		case "take_ammo_ships":
			if(CheckAttribute(Pchar,"quest.seadogs_ammo") && Pchar.quest.seadogs_ammo == "yes")
			{
				return;//ends this loop
			}

			gp = GetCharacterItem(Pchar, "gunpowder");
			pb = GetCharacterItem(Pchar, "pistolbullets");
			if(gp == 0)
			{
				TakenItems(Pchar, "gunpowder", 1);
				Pchar.quest.temp_gunpowder = "yes";
			    	//LogIt("temp_gunpowder = " + Pchar.quest.temp_gunpowder);
			    	//gp = GetCharacterItem(Pchar, "gunpowder");
			    	//LogIt("gp = " + gp);
			}
			if(pb == 0)
			{
				TakenItems(Pchar, "pistolbullets", 1);
				Pchar.quest.temp_pistolbullets = "yes";
			    	//LogIt("temp_pistolbullets = " + Pchar.quest.temp_pistolbullets);
			    	//pb = GetCharacterItem(Pchar, "pistolbullets");
			    	//LogIt("pb = " + pb);
			}

			Pchar.quest.give_ammo_ships.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.give_ammo_ships.win_condition.l1.location = "wr_ships";
			Pchar.quest.give_ammo_ships.win_condition = "give_ammo_ships";
		break;

		case "give_ammo_ships":
			if(CheckAttribute(Pchar,"quest.temp_gunpowder") && Pchar.quest.temp_gunpowder == "yes")
			{
				TakenItems(Pchar, "gunpowder", -1);
			    	//gp = GetCharacterItem(Pchar, "gunpowder");
			    	//LogIt("gp = " + gp);
				Pchar.quest.temp_gunpowder = "no";
			}
			if(CheckAttribute(Pchar,"quest.temp_pistolbullets") && Pchar.quest.temp_pistolbullets == "yes")
			{
				TakenItems(Pchar, "pistolbullets", -1);
			    	//pb = GetCharacterItem(Pchar, "pistolbullets");
			    	//LogIt("pb = " + pb);
				Pchar.quest.temp_pistolbullets = "no";
			}

			pchar.quest.take_ammo_ships.win_condition.l1 = "location";
			pchar.quest.take_ammo_ships.win_condition.l1.location = "wr_ships";
			pchar.quest.take_ammo_ships.win_condition = "take_ammo_ships";
		break;
	//.................................................................................................
		case "Long_goods1":
			LAi_SetActorType(characterFromID("wr_aub"));
			LAi_ActorDialog(characterFromID("wr_aub"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wr_aub"));
			Characters[GetCharacterIndex("wr_aub")].dialog.CurrentNode  = "dialog_start";
		break;

		case "Long_goods2":
			//from Long dialog
			LAi_SetPlayerType(Pchar);

			PlaySound("VOICE\ENGLISH\Eng_m_c_058.wav");

			if(CheckAttribute(Pchar,"quest.cotton") && Pchar.quest.cotton == "yes")
			{
				if(CheckAttribute(Pchar,"quest.chocolate") && Pchar.quest.chocolate == "yes")
				{
					if(CheckAttribute(Pchar,"quest.sugar") && Pchar.quest.sugar == "yes")
					{
						Logit(LanguageConvertString(tmpLangFileID,"You have received Cotton, Chocolate and Sugar goods."));
						PlaySound("INTERFACE\Important_item.wav");

						LAi_QuestDelay("Important_item_sound", 0.5);
						LAi_QuestDelay("Important_item_sound", 1.0);
					}
					else
					{
						Logit(LanguageConvertString(tmpLangFileID,"You have received Cotton and Chocolate goods."));
						PlaySound("INTERFACE\Important_item.wav");

						LAi_QuestDelay("Important_item_sound", 0.5);
					}
				}
				else
				{
					if(CheckAttribute(Pchar,"quest.sugar") && Pchar.quest.sugar == "yes")
					{
						Logit(LanguageConvertString(tmpLangFileID,"You have received Cotton and Sugar goods."));
						PlaySound("INTERFACE\Important_item.wav");

						LAi_QuestDelay("Important_item_sound", 0.5);
					}
					else
					{
						Logit(LanguageConvertString(tmpLangFileID,"You have received Cotton goods."));
						PlaySound("INTERFACE\Important_item.wav");
					}
				}
			}
			else
			{
				if(CheckAttribute(Pchar,"quest.chocolate") && Pchar.quest.chocolate == "yes")
				{
					if(CheckAttribute(Pchar,"quest.sugar") && Pchar.quest.sugar == "yes")
					{
						Logit(LanguageConvertString(tmpLangFileID,"You have received Chocolate and Sugar goods."));
						PlaySound("INTERFACE\Important_item.wav");

						LAi_QuestDelay("Important_item_sound", 0.5);
					}
					else
					{
						Logit(LanguageConvertString(tmpLangFileID,"You have received Chocolate goods."));
						PlaySound("INTERFACE\Important_item.wav");
					}
				}
				else
				{
					if(CheckAttribute(Pchar,"quest.sugar") && Pchar.quest.sugar == "yes")
					{
						Logit(LanguageConvertString(tmpLangFileID,"You have received Sugar goods."));
						PlaySound("INTERFACE\Important_item.wav");
					}
				}
			}

			LAi_QuestDelay("Long_amnesty", 2.0);
		break;

		case "Long_short_delay":
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("Long_amnesty", 2.0);
		break;

		case "Long_amnesty":
			LAi_SetActorType(characterFromID("wr_aub"));
			LAi_ActorDialog(characterFromID("wr_aub"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wr_aub"));
			Characters[GetCharacterIndex("wr_aub")].dialog.CurrentNode  = "amnesty";
		break;

		case "Long_amnesty1":
			//from Long dialog
			LAi_SetPlayerType(Pchar);

			GiveItem2Character(Pchar, "amnesty_doc");
			RMAmnesty(Pchar, England);
			RMAmnesty(Pchar, France);
			RMAmnesty(Pchar, Holland);
			RMAmnesty(Pchar, Spain);
			RMAmnesty(Pchar, Portugal);

			Logit(LanguageConvertString(tmpLangFileID,"Yes, I have got a 'Woodes-Rogers'!"));
			PlaySound("OBJECTS\DUEL\man_attack6.wav");

			LAi_QuestDelay("ship_barrels_backoff", 0.1);
			LAi_QuestDelay("turn_to_brass_wheel", 0.1);

			LAi_QuestDelay("Stradling_galley", 2.0);
		break;

		case "Stradling_galley":
			LAi_SetActorType(characterFromID("wr_aub"));
			LAi_ActorDialog(characterFromID("wr_aub"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wr_aub"));
			Characters[GetCharacterIndex("wr_aub")].dialog.CurrentNode  = "open_galley";
		break;

		case "Long_to_quarterdeck":
			SetQuestHeader("Open_the_galley");
			AddQuestRecord("Open_the_galley", "1");
			SetQuestHeader("Repair_the_anchor");
			AddQuestRecord("Repair_the_anchor", "1");

			LAi_SetActorType(characterFromID("wr_aub"));
			LAi_ActorGoToLocator(CharacterFromID("wr_aub"), "rld", "captain", "Long_to_quarterdeck1", 11.0);
		break;

		case "Long_to_quarterdeck1":
			ChangeCharacterAddressGroup(CharacterFromID("wr_aub"), "wr_ships", "rld", "captain");
			LAi_SetStayType(characterFromID("wr_aub"));
		break;

		case "Important_item_sound":
			PlaySound("INTERFACE\Important_item.wav");
		break;
	//.................................................................................................
		case "turn_to_brass_wheel":
			pchar.quest.turn_to_brass_wheel1.win_condition.l1 = "location";
			pchar.quest.turn_to_brass_wheel1.win_condition.l1.location = "wr_corv_smallcabin_L";
			pchar.quest.turn_to_brass_wheel1.win_condition = "turn_to_brass_wheel1";
		break;

		case "turn_to_brass_wheel1":
			LAi_QuestDelay("turn_to_brass_wheel2", 2.0);
		break;

		case "turn_to_brass_wheel2":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box3");

			LAi_QuestDelay("Pchar_playertype", 1.0);
		break;
	//.................................................................................................
		case "fall_to_hold":
			pchar.quest.fall_to_hold1.win_condition.l1 = "locator";
			pchar.quest.fall_to_hold1.win_condition.l1.location = "wr_ships";
			pchar.quest.fall_to_hold1.win_condition.l1.locator_group = "reload";
			pchar.quest.fall_to_hold1.win_condition.l1.locator = "reload12";
			pchar.quest.fall_to_hold1.win_condition = "fall_to_hold1";
		break;

		case "fall_to_hold1":
			LAi_SetSitType(Pchar);

			pchar.quest.fall_to_hold2.win_condition.l1 = "location";
			pchar.quest.fall_to_hold2.win_condition.l1.location = "wr_gall_hold_first";
			pchar.quest.fall_to_hold2.win_condition = "fall_to_hold2";
		break;

		case "fall_to_hold2":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead6.wav");

			LAi_QuestDelay("fall_to_hold3", 0.7);
		break;

		case "fall_to_hold3":
			PlaySound("PEOPLE\jump.wav");
			if(IsEquipCharacterByItem(Pchar, "bladeplank2") && IsEquipCharacterByItem(Pchar, "pistolplank2"))
			PlaySound("PEOPLE\place_planks.wav");

			LAi_ApplyCharacterDamage(Pchar, 10);

			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("stars_short" , u, v+1, w, 0.0, 0.0, 0.0, sti(20) );
			LAi_SetPoorType(Pchar);

			LAi_QuestDelay("fall_to_hold5", 0.5);
			LAi_QuestDelay("fall_to_hold4", 2.0);
		break;

		case "fall_to_hold4":
			PlaySound("OBJECTS\DUEL\man_attack5.wav");

			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "wr_gall_hold_first", "goto", "angry");

			LAi_QuestDelay("fall_to_hold", 0.1);
		break;

		case "fall_to_hold5":
			string weaponID7 = GetCharacterEquipByGroup(Pchar,BLADE_ITEM_TYPE);
			aref weapon7;
			Items_FindItem(weaponID7, &weapon7);

			string weaponID8 = GetCharacterEquipByGroup(Pchar,GUN_ITEM_TYPE);
			aref weapon8;
			Items_FindItem(weaponID8, &weapon8);

			if(CheckAttribute(weapon7, "id"))
			{
				if(weapon7.id == "bladebottle_CE0" || weapon7.id == "bladebottle_CW1" || weapon7.id == "bladebottle_CT1_sulf"
				|| weapon7.id == "bladebottle_CT1_nitr" || weapon7.id == "bladebottle_CT1_hydr" || weapon7.id == "bladebottle_CT1_hydrnitr"
				|| weapon7.id == "bladebottle_CT2_sulf_w" || weapon7.id == "bladebottle_CT2_sulf_c" || weapon7.id == "bladebottle_CT2_hydr"
				|| weapon7.id == "bladebottle_CT2_hydrnitr" || weapon7.id == "bladebottle_CA2" || weapon7.id == "bladebottle_CG2"
				|| weapon7.id == "bladebottle_CP2" || weapon7.id == "bladetop" || weapon7.id == "bladebottle_CT2_nitr_w"
				|| weapon7.id == "bladebottle_CB1")
				{
					RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
					TakeNItems(Pchar, weaponID7, -20);
					EquipCharacterByItem(Pchar, "bladeX4");
					PlaySound("AMBIENT\TAVERN\tinkle4.wav");
					PlaySound("AMBIENT\TAVERN\drop44.wav");
					pchar.quest.glassexplosion_sound = "done";
				}
			}

			if(CheckAttribute(weapon8, "id"))
			{
				if(weapon8.id == "pistolretort" || weapon8.id == "pistolglass_tube")
				{
					RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
					TakeNItems(Pchar, weaponID8, -20);
					EquipCharacterByItem(Pchar, "pistolhand");
					if(CheckAttribute(pchar,"quest.glassexplosion_sound") && pchar.quest.glassexplosion_sound == "done")
					{
						//don't play it twice
					}
					else
					{
						PlaySound("AMBIENT\TAVERN\tinkle4.wav");
						PlaySound("AMBIENT\TAVERN\drop44.wav");
					}
				}
			}
		break;
	//.................................................................................................
		case "label_copperlock":
			pchar.quest.label_copperlock1.win_condition.l1 = "locator";
			pchar.quest.label_copperlock1.win_condition.l1.location = "wr_corv_deck1";
			pchar.quest.label_copperlock1.win_condition.l1.locator_group = "reload";
			pchar.quest.label_copperlock1.win_condition.l1.locator = "reload4";
			pchar.quest.label_copperlock1.win_condition = "label_copperlock1";
		break;

		case "label_copperlock1":
			if(CheckAttribute(Pchar,"quest.qbook_open_copper") && Pchar.quest.qbook_open_copper == "done")
			{

			}
			else
			{
				Pchar.quest.qbook_open_copper = "done";
				AddQuestRecord("Alchemy_copper", "1");
				if(CheckCharacterItem(Pchar,"pistolcopperas"))
				{
					Pchar.quest.Minerva_copper = "info";
				}
			}
		break;

		case "label_silverlock":
			pchar.quest.label_silverlock1.win_condition.l1 = "locator";
			pchar.quest.label_silverlock1.win_condition.l1.location = "wr_gall_hold_first";
			pchar.quest.label_silverlock1.win_condition.l1.locator_group = "box";
			pchar.quest.label_silverlock1.win_condition.l1.locator = "box7";
			pchar.quest.label_silverlock1.win_condition = "label_silverlock1";
		break;

		case "label_silverlock1":
			Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"This heavy cast iron door has a silver lock"));
			LAi_QuestDelay("label_silverlock", 0.1);

			if(CheckAttribute(Pchar,"quest.qbook_open_silver") && Pchar.quest.qbook_open_silver == "done")
			{

			}
			else
			{
				Pchar.quest.qbook_open_silver = "done";
				AddQuestRecord("Alchemy_silver", "1");
				if(CheckCharacterItem(Pchar,"pistolnitre"))
				{
					Pchar.quest.Minerva_silver = "info";
				}
			}
		break;

		case "label_goldlock":
			pchar.quest.label_goldlock1.win_condition.l1 = "locator";
			pchar.quest.label_goldlock1.win_condition.l1.location = "wr_gall_deck2_stern";
			pchar.quest.label_goldlock1.win_condition.l1.locator_group = "reload";
			pchar.quest.label_goldlock1.win_condition.l1.locator = "reload5";
			pchar.quest.label_goldlock1.win_condition = "label_goldlock1";
		break;

		case "label_goldlock1":
			if(CheckAttribute(Pchar,"quest.qbook_open_gold") && Pchar.quest.qbook_open_gold == "done")
			{

			}
			else
			{
				Pchar.quest.qbook_open_gold = "done";
				AddQuestRecord("Alchemy_gold", "1");
				if(CheckCharacterItem(Pchar,"pistolsalt"))
				{
					Pchar.quest.Minerva_gold = "info";
				}
			}
		break;
	//.................................................................................................
		case "crew_hatch_backoff":
			pchar.quest.crew_hatch_backoff1.win_condition.l1 = "locator";
			pchar.quest.crew_hatch_backoff1.win_condition.l1.location = "wr_ships";
			pchar.quest.crew_hatch_backoff1.win_condition.l1.locator_group = "box";
			pchar.quest.crew_hatch_backoff1.win_condition.l1.locator = "box4";
			pchar.quest.crew_hatch_backoff1.win_condition = "crew_hatch_backoff1";
		break;

		case "crew_hatch_backoff1":
			if(Locations[FindLocation("wr_ships")].models.always.l2 == "deck_box")
			{
				//float x, y, z;
				GetCharacterPos(Pchar, &x, &y, &z);
				nearloc = LAi_FindNearestFreeLocator("goto", x, y, z);
				ChangeCharacterAddressGroup(Pchar, "wr_ships", "goto", nearloc);

				LAi_QuestDelay("crew_hatch_backoff", 0.1);	//loop
			}
			else return;				//stops this when goods_pile is gone
		break;
	//.................................................................................................
		case "ship_barrels_backoff":
			pchar.quest.ship_barrels_backoff1.win_condition.l1 = "locator";
			pchar.quest.ship_barrels_backoff1.win_condition.l1.location = "wr_ships";
			pchar.quest.ship_barrels_backoff1.win_condition.l1.locator_group = "box";
			pchar.quest.ship_barrels_backoff1.win_condition.l1.locator = "box7";
			pchar.quest.ship_barrels_backoff1.win_condition = "ship_barrels_backoff1";
		break;

		case "ship_barrels_backoff1":
			if(CheckAttribute(pchar,"quest.cannon_goodspile") && Pchar.quest.cannon_goodspile == "current")
			{
				ChangeCharacterAddressGroup(Pchar, "wr_ships", "goto", "box7");

				LAi_QuestDelay("ship_barrels_backoff", 0.1);	//loop
			}
			else return;
		break;
	//.................................................................................................
		case "shipcannon_up_box5":
			//from box5 wr_ships itemlogic
			LAi_SetSitType(Pchar);
			PlaySound("PEOPLE\creak.wav");

			LAi_QuestDelay("shipcannon_up_box5_1", 1.0);
		break;

		case "shipcannon_up_box5_1":
			Locations[FindLocation("wr_ships")].locators_radius.box.box5 = 0.0001;
			Locations[FindLocation("wr_ships")].locators_radius.box.box6 = 0.7;
			LAi_SetPlayerType(Pchar);

			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_S1" || Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_S1X")
				Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_S2";
			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_W1")
				Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_W2";
			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_N1")
				Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_N2";
			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_E1")
				Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_E2";

			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_S0")
			{
				Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_S2";
				Locations[FindLocation("wr_ships")].reload.l6.disable = 0;
				Locations[FindLocation("wr_corv_crew")].reload.l4.disable = 0;
			}
			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_W0")
			{
				Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_W2";
				Locations[FindLocation("wr_ships")].reload.l6.disable = 0;
				Locations[FindLocation("wr_corv_crew")].reload.l4.disable = 0;
			}
			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_N0")
			{
				Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_N2";
				Locations[FindLocation("wr_ships")].reload.l6.disable = 0;
				Locations[FindLocation("wr_corv_crew")].reload.l4.disable = 0;
			}
			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_E0")
			{
				Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_E2";
				Locations[FindLocation("wr_ships")].reload.l6.disable = 0;
				Locations[FindLocation("wr_corv_crew")].reload.l4.disable = 0;
			}

			Locations[FindLocation("wr_ships")].image = "";
			DoQuestReloadToLocation("wr_ships", "goto", "box5", "_");
			Locations[FindLocation("wr_ships")].image = "wr_ships.tga";
		break;
	//------------------------------------------------------------------------------------------------
		case "shipcannon_down":
			//from box6 wr_ships itemlogic
			Locations[FindLocation("wr_ships")].locators_radius.box.box6 = 0.0001;
			Locations[FindLocation("wr_ships")].locators_radius.box.box5 = 0.7;

			if(CheckAttribute(Pchar,"quest.cannon_goodspile") && Pchar.quest.cannon_goodspile == "gone")
			{
				if(CheckAttribute(Pchar,"quest.cannonbox") && Pchar.quest.cannonbox == "crashed")
				{
					Locations[FindLocation("wr_ships")].locators_radius.box.box7 = 0.0001;
				}
				else Locations[FindLocation("wr_ships")].locators_radius.box.box7 = 0.7;
			}

			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_S2")
			{
				if(Locations[FindLocation("wr_ships")].models.always.l2 == "")
				{
					Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_S0";
					Locations[FindLocation("wr_ships")].reload.l6.disable = 1;
					Locations[FindLocation("wr_corv_crew")].reload.l4.disable = 1;
				}
				else Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_S1";
			}
			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_W2")
			{
				if(Locations[FindLocation("wr_ships")].models.always.l2 == "")
				{
					Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_W0";
					Locations[FindLocation("wr_ships")].reload.l6.disable = 1;
					Locations[FindLocation("wr_corv_crew")].reload.l4.disable = 1;
				}
				else Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_W1";
			}
			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_N2")
			{
				if(Locations[FindLocation("wr_ships")].models.always.l2 == "")
				{
					Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_N0";
					Locations[FindLocation("wr_ships")].reload.l6.disable = 1;
					Locations[FindLocation("wr_corv_crew")].reload.l4.disable = 1;
				}
				else Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_N1";
			}
			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_E2")
			{
				if(Locations[FindLocation("wr_ships")].models.always.l2 == "")
				{
					Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_E0";
					Locations[FindLocation("wr_ships")].reload.l6.disable = 1;
					Locations[FindLocation("wr_corv_crew")].reload.l4.disable = 1;
				}
				else Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_E1";
			}

			Locations[FindLocation("wr_ships")].image = "";
			DoQuestReloadToLocation("wr_ships", "goto", "box6", "shipcannon_down1");
		break;

		case "shipcannon_down1":
			Locations[FindLocation("wr_ships")].image = "wr_ships.tga";
			CreateParticleSystemX("blast_dirt", -0.4, 3.6, -4.1, -0.4, 3.6, -4.1, 10);
			PlaySound("PEOPLE\wood3.wav");
		break;
	//------------------------------------------------------------------------------------------------
		case "shipcannon_high_up_box7":
			//from box7 wr_ships itemlogic
			LAi_SetSitType(Pchar);
			PlaySound("PEOPLE\creak.wav");

			LAi_QuestDelay("shipcannon_high_up_box7_1", 1.0);
		break;

		case "shipcannon_high_up_box7_1":
			Locations[FindLocation("wr_ships")].locators_radius.box.box5 = 0.0001;
			Locations[FindLocation("wr_ships")].locators_radius.box.box6 = 0.7;
			Locations[FindLocation("wr_ships")].locators_radius.box.box7 = 0.0001;
			LAi_SetPlayerType(Pchar);

			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_S2" || Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_S1" || Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_S1X")
				Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_S3";
			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_W2" || Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_W1")
				Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_W3";
			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_N2" || Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_N1")
				Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_N3";
			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_E2" || Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_E1")
				Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_E3";

			LAi_QuestDelay("guncrew_ohoh", 0.1);

			Locations[FindLocation("wr_ships")].image = "";
			DoQuestReloadToLocation("wr_ships", "goto", "box7", "guncrew_dismiss");
			Locations[FindLocation("wr_ships")].image = "wr_ships.tga";
		break;
	//------------------------------------------------------------------------------------------------
		case "guncrew_ohoh":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead1.wav");
		break;
	//.................................................................................................
		case "shipcannon_hard_down":
			//from box6 wr_ships itemlogic
			Pchar.quest.cannonbox = "crashed";

			Locations[FindLocation("wr_ships")].locators_radius.box.box6 = 0.0001;
			Locations[FindLocation("wr_ships")].locators_radius.box.box5 = 0.7;
			Locations[FindLocation("wr_ships")].locators_radius.box.box7 = 0.0001;
			Locations[FindLocation("wr_ships")].locators_radius.box.box4 = 0.0001;		//stop crew hatch backoff

			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_S3")
				Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_S0";
			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_W3")
				Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_W0";
			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_N3")
				Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_N0";
			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_E3")
				Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_E0";

			Locations[FindLocation("wr_ships")].image = "";
			DoQuestReloadToLocation("wr_ships", "goto", "box6", "shipcannon_hard_down1");
		break;

		case "shipcannon_hard_down1":
			Locations[FindLocation("wr_ships")].image = "wr_ships.tga";
			CreateParticleSystemX("blast_dirt", -0.4, 2.7, -4.1, -0.4, 3.6, -4.1, 10);
			CreateParticleSystemX("blast_dirt", -0.4, 2.7, -4.1, -0.4, 3.6, -4.1, 10);
			CreateParticleSystemX("blast_dirt", -0.4, 3.0, -4.1, -0.4, 3.6, -4.1, 10);
			CreateParticleSystemX("blast_dirt", -0.4, 3.0, -4.1, -0.4, 3.6, -4.1, 10);
			CreateParticleSystem("splinters", -0.4, 2.6, -4.1,  0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -0.4, 2.6, -4.1,  0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", -0.4, 2.6, -4.1,  0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -0.4, 2.6, -4.1,  0.0, 0.0, 0.0, 0);
			PlaySound("PEOPLE\roof_broken1.wav");
			PlaySound("PEOPLE\roof_broken1.wav");
			PlaySound("PEOPLE\wood2.wav");

			LAi_QuestDelay("shipcannon_hard_down2", 1.5);
		break;

		case "shipcannon_hard_down2":
			CreateParticleSystemX("blast_dirt", -0.4, 2.7, -4.1, -0.4, 3.6, -4.1, 10);
			CreateParticleSystemX("blast_dirt", -0.4, 2.7, -4.1, -0.4, 3.6, -4.1, 10);
			CreateParticleSystemX("blast_dirt", -0.4, 3.0, -4.1, -0.4, 3.6, -4.1, 10);
			CreateParticleSystemX("blast_dirt", -0.4, 3.0, -4.1, -0.4, 3.6, -4.1, 10);

			pchar.quest.corv_crew_entre.win_condition.l1 = "location";
			pchar.quest.corv_crew_entre.win_condition.l1.location = "wr_corv_crew";
			pchar.quest.corv_crew_entre.win_condition = "corv_crew_entre";
		break;
	//.................................................................................................
		case "anchor_up_animation":
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("anchor_up_animation1", 0.25);
		break;

		case "anchor_up_animation1":
			LAi_SetSitType(Pchar);

			LAi_QuestDelay("anchor_up_animation2", 0.25);
		break;

		case "anchor_up_animation2":
			LAi_SetPlayerType(Pchar);
		break;
	//.................................................................................................
		case "anchor_down_ships":
			//from box8 wr_ships itemlogic
			Locations[FindLocation("wr_ships")].image = "";
			DoQuestReloadToLocation("wr_ships", "goto", "box8", "anchor_down_ships1");
		break;

		case "anchor_down_ships1":
			LAi_SetPlayerType(Pchar);

			if(CheckAttribute(Pchar,"quest.elevatorG_status") && Pchar.quest.elevatorG_status == "elevator_ready")
			{
				if(!CheckAttribute(Pchar,"quest.bladeirontool") || Pchar.quest.bladeirontool != "picked_up")
				{
					if(CheckAttribute(Pchar,"quest.qbook_see_tool") && Pchar.quest.qbook_see_tool == "done")
					{

					}
					else
					{
						pchar.quest.see_tool_under_elevator.win_condition.l1 = "locator";
						pchar.quest.see_tool_under_elevator.win_condition.l1.location = "wr_ships";
						pchar.quest.see_tool_under_elevator.win_condition.l1.locator_group = "goto";
						pchar.quest.see_tool_under_elevator.win_condition.l1.locator = "see_tool";
						pchar.quest.see_tool_under_elevator.win_condition = "see_tool_under_elevator";
					}
				}

				if(CheckAttribute(Pchar,"quest.plank_position") && Pchar.quest.plank_position == "air")
				{
					pchar.quest.see_planks_in_the_air.win_condition.l1 = "locator";
					pchar.quest.see_planks_in_the_air.win_condition.l1.location = "wr_ships";
					pchar.quest.see_planks_in_the_air.win_condition.l1.locator_group = "goto";
					pchar.quest.see_planks_in_the_air.win_condition.l1.locator = "see_tool";
					pchar.quest.see_planks_in_the_air.win_condition = "see_planks_in_the_air";
				}
			}

			if(CheckAttribute(Pchar,"quest.anchor_mechanism") && Pchar.quest.anchor_mechanism == "anchor_lost")
			{
				PlaySound("AMBIENT\CAVE\drop3.wav");
				PlaySound("AMBIENT\CAVE\drop3.wav");

				LAi_QuestDelay("anchor_guard1", 1.0);
			}
			else
			{
				PlaySound("INTERFACE\_Yakordrop1.wav");
				CreateParticleSystemX("ball_splash", -2.1, 2.6, 18.8, 0.0, 0.0, 0.0, 0);

				if(CheckAttribute(Pchar,"quest.broadside") && Pchar.quest.broadside == "prepared")
				{
					Pchar.quest.broadside = "started";
					//means don't repeat this

					LAi_QuestDelay("corvette_broadside", 2.0);	//was broadside
				}
			}

			Locations[FindLocation("wr_ships")].image = "wr_ships.tga";
		break;
	//.................................................................................................
		case "see_tool_under_elevator":
			LAi_SetStayType(Pchar);
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");
			Logit(LanguageConvertString(tmpLangFileID,"There's something under the elevator!"));
			Pchar.quest.qbook_see_tool = "done";
			AddQuestRecord("Open_the_galley", "6");

			LAi_QuestDelay("Pchar_playertype", 2.0);
		break;

		case "see_planks_in_the_air":
			if(CheckAttribute(Pchar,"quest.plank_position") && Pchar.quest.plank_position == "air")
			{
				if(!CheckAttribute(Pchar,"quest.bladeirontool") || Pchar.quest.bladeirontool != "picked_up")
				{
					LAi_SetStayType(Pchar);
					PlaySound("VOICE\ENGLISH\blaze_huh.wav");
					Logit(LanguageConvertString(tmpLangFileID,"Not exactly what I had in mind!"));

					LAi_QuestDelay("Pchar_playertype", 2.0);
				}
			}
		break;
	//.................................................................................................
		case "anchor_up_ships":
			//from box9 wr_ships itemlogic
			Locations[FindLocation("wr_ships")].image = "";
			DoQuestReloadToLocation("wr_ships", "goto", "box9", "anchor_up_ships1");
		break;

		case "anchor_up_ships1":
			if(CheckAttribute(Pchar,"quest.anchor_mechanism") && Pchar.quest.anchor_mechanism == "anchor_lost")
			{
				PlaySound("AMBIENT\CAVE\drop4.wav");
				PlaySound("AMBIENT\CAVE\drop4.wav");

				LAi_QuestDelay("anchor_guard2", 1.0);
			}
			else
			{
				PlaySound("INTERFACE\anchor_up.wav");
				CreateParticleSystemX("ball_splash", -2.1, 2.9, 18.3, 0.0, 0.0, 0.0, 0);
			}

			if(CheckAttribute(Pchar,"quest.plank_position") && Pchar.quest.plank_position == "deck")
			{
				if(CheckAttribute(Pchar,"quest.elevator_position") && Pchar.quest.elevator_position == "deck")
				{
					pchar.quest.planks_and_elevator_on_deck.win_condition.l1 = "locator";
					pchar.quest.planks_and_elevator_on_deck.win_condition.l1.location = "wr_ships";
					pchar.quest.planks_and_elevator_on_deck.win_condition.l1.locator_group = "goto";
					pchar.quest.planks_and_elevator_on_deck.win_condition.l1.locator = "see_tool";
					pchar.quest.planks_and_elevator_on_deck.win_condition = "planks_and_elevator_on_deck";
				}
			}

			Locations[FindLocation("wr_ships")].image = "wr_ships.tga";
		break;
	//.................................................................................................
		case "planks_and_elevator_on_deck":
			if(CheckAttribute(Pchar,"quest.plank_position") && Pchar.quest.plank_position == "deck")
			{
				if(CheckAttribute(Pchar,"quest.elevator_position") && Pchar.quest.elevator_position == "deck")
				{
					if(!CheckAttribute(Pchar,"quest.bladeirontool") || Pchar.quest.bladeirontool != "picked_up")
					{
						LAi_SetStayType(Pchar);
						PlaySound("VOICE\ENGLISH\blaze_very_nice.wav");
						Logit(LanguageConvertString(tmpLangFileID,"I think I can reach the Tool now!"));

						if(CheckAttribute(Pchar,"quest.qbook_reach_tool") && Pchar.quest.qbook_reach_tool == "done")
						{

						}
						else
						{
							Pchar.quest.qbook_reach_tool = "done";
							AddQuestRecord("Open_the_galley", "8");

							LAi_QuestDelay("Pchar_playertype", 2.0);
						}
					}
				}
			}
		break;
	//.................................................................................................
	//.................................................................................................
		case "anchor_down_corvette":
			//from box8 wr_ships itemlogic
			Locations[FindLocation("wr_ships")].image = "";
			DoQuestReloadToLocation("wr_corvette", "goto", "box8", "anchor_down_corvette1");
		break;

		case "anchor_down_corvette1":
			PlaySound("INTERFACE\_Yakordrop1.wav");
			CreateParticleSystemX("ball_splash", -2.1, 2.6, 18.8, 0.0, 0.0, 0.0, 0);
			Locations[FindLocation("wr_ships")].image = "wr_corvette.tga";
		break;
	//.................................................................................................
		case "anchor_up_corvette":
			//from box9 wr_ships itemlogic
			Locations[FindLocation("wr_ships")].image = "";
			DoQuestReloadToLocation("wr_corvette", "goto", "box9", "anchor_up_corvette1");
		break;

		case "anchor_up_corvette1":
			PlaySound("INTERFACE\anchor_up.wav");
			CreateParticleSystemX("ball_splash", -2.1, 2.9, 18.3, 0.0, 0.0, 0.0, 0);
			Locations[FindLocation("wr_ships")].image = "wr_corvette.tga";
		break;
	//.................................................................................................
		case "stay_at_stuck8":
			//from itemlogic wr_ships box8
			if(!LAi_IsFightMode(Pchar))
			{
				ChangeCharacterAddressGroup(Pchar, "wr_ships", "goto", "box8");
				Pchar.quest.deck_position = "elsewhere";			//reset
				LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], true);
			}
			else LAi_QuestDelay("stay_at_stuck8", 1.0);//loops until not fightmode
		break;

		case "stay_at_stuck9":
			//from itemlogic wr_ships box9
			if(!LAi_IsFightMode(Pchar))
			{
				ChangeCharacterAddressGroup(Pchar, "wr_ships", "goto", "box9");
				Pchar.quest.deck_position = "elsewhere";			//reset
				LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], true);
			}
			else LAi_QuestDelay("stay_at_stuck9", 1.0);//loops until not fightmode
		break;
	//................................................................................................
		case "at_mechanism_L":
			//anchor mechanism complete check:
			if(CheckAttribute(pchar,"quest.wheel_pos_right") && pchar.quest.wheel_pos_right == "wheel")
			{
				if(CheckAttribute(pchar,"quest.pinion_pos_right") && pchar.quest.pinion_pos_right == "large")
				{
					if(CheckAttribute(pchar,"quest.pinion_pos_left") && pchar.quest.pinion_pos_left == "small")
					{
						pchar.quest.anchor_mechanism = "complete";
						//if(CheckAttribute(Pchar,"quest.anchor") && Pchar.quest.anchor == "up")
						//no can't be up - you have at least been there ounce
						Locations[FindLocation("wr_ships")].locators_radius.box.box8 = 0.0001;
						if(IsEquipCharacterByItem(Pchar, "pistolhand")) RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
						TakeItemFromCharacter(Pchar, "pistolhand");

						if(CheckAttribute(Pchar,"quest.qbook_close_anchor") && Pchar.quest.qbook_close_anchor == "done")
						{

						}
						else
						{
							Pchar.quest.qbook_close_anchor = "done";
							AddQuestRecord("Repair_the_anchor", "3");
							CloseQuestHeader("Repair_the_anchor");
						}

						LAi_QuestDelay("elevator_ropes_check", 0.1);
					}
				}
			}

			Locations[FindLocation("wr_ships")].image = "";
			DoQuestReloadToLocation("wr_ships", "goto", "stuck8", "wr_ships_loadingimage_back");
		break;

		case "at_mechanism_R":
			//anchor mechanism complete check:
			if(CheckAttribute(pchar,"quest.wheel_pos_right") && pchar.quest.wheel_pos_right == "wheel")
			{
				if(CheckAttribute(pchar,"quest.pinion_pos_right") && pchar.quest.pinion_pos_right == "large")
				{
					if(CheckAttribute(pchar,"quest.pinion_pos_left") && pchar.quest.pinion_pos_left == "small")
					{
						pchar.quest.anchor_mechanism = "complete";
						//if(CheckAttribute(Pchar,"quest.anchor") && Pchar.quest.anchor == "up")
						//no can't be up - you have at least been there once
						Locations[FindLocation("wr_ships")].locators_radius.box.box8 = 0.0001;
						if(IsEquipCharacterByItem(Pchar, "pistolhand")) RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
						TakeItemFromCharacter(Pchar, "pistolhand");

						if(CheckAttribute(Pchar,"quest.qbook_close_anchor") && Pchar.quest.qbook_close_anchor == "done")
						{

						}
						else
						{
							Pchar.quest.qbook_close_anchor = "done";
							AddQuestRecord("Repair_the_anchor", "3");
							CloseQuestHeader("Repair_the_anchor");
						}

						LAi_QuestDelay("elevator_ropes_check", 0.1);
					}
				}
			}

			Locations[FindLocation("wr_ships")].image = "";
			DoQuestReloadToLocation("wr_ships", "goto", "stuck9", "wr_ships_loadingimage_back");
		break;

		case "wr_ships_loadingimage_back":
			LAi_SetFightMode(pchar, false);
			LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], true);
			Locations[FindLocation("wr_ships")].image = "wr_ships.tga";
			Locations[FindLocation("wr_gall_hold_first")].image = "wr_gall_hold_first.tga";
			Locations[FindLocation("wr_gall_deck2_prow")].image = "wr_gall_deck2_prow.tga";
		break;
	//................................................................................................
		case "wheel_on_hub_already":
			PlaySound("VOICE\ENGLISH\blaze_hah.wav");

			LAi_SetFightMode(Pchar, false);
		break;

		case "wheel_blocking":
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");

			LAi_SetFightMode(Pchar, false);
		break;
	//................................................................................................
		case "elevator_ropes_check":
			if(CheckCharacterItem(Pchar,"elevator_ropes"))
			{
				SetModel(PChar, "Pira4M_HTUS_r2", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

				Pchar.quest.elevator_ropes = "picked_up";
				Locations[FindLocation("wr_ships")].models.always.l14 = "";	//no visible ropes

				Locations[FindLocation("wr_ships")].locators_radius.box.box10 = 0.5;
				Locations[FindLocation("wr_ships")].locators_radius.box.box22 = 0.0001;

				Locations[FindLocation("wr_ships")].image = "";
				DoQuestReloadToLocation("wr_ships", "goto", "pickup_ropes", "elevator_ropes_check2");

			}
			else LAi_QuestDelay("elevator_ropes_check", 0.5);	//loops until item picked up
		break;

		case "elevator_ropes_check2":
			LAi_SetFightMode(pchar, false);
			LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], true);
			Locations[FindLocation("wr_ships")].image = "wr_ships.tga";
			Locations[FindLocation("wr_gall_hold_first")].image = "wr_gall_hold_first.tga";
			Locations[FindLocation("wr_gall_deck2_prow")].image = "wr_gall_deck2_prow.tga";

			if(CheckCharacterItem(Pchar,"elevator_ropes"))
			{
				if(CheckAttribute(Pchar,"quest.qbook_ropes_found") && Pchar.quest.qbook_ropes_found == "done")
				{

				}
				else
				{
						Logit(LanguageConvertString(tmpLangFileID,"Okay, I got these ropes - but I'm not sure where to use them."));
						Pchar.quest.qbook_ropes_found = "done";
						AddQuestRecord("Open_the_galley", "3");
				}
			}

		break;

		case "place_elevator_ropes":
			Locations[FindLocation("wr_ships")].locators_radius.box.box10 = 0.0001;
			Locations[FindLocation("wr_ships")].locators_radius.box.box22 = 0.5;
			Locations[FindLocation("wr_ships")].image = "";
			DoQuestReloadToLocation("wr_ships", "goto", "reload16", "place_elevator_ropes2");
		break;

		case "place_elevator_ropes2":
			LAi_SetFightMode(pchar, false);
			LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], true);
			Locations[FindLocation("wr_ships")].image = "wr_ships.tga";
			Locations[FindLocation("wr_gall_hold_first")].image = "wr_gall_hold_first.tga";
			Locations[FindLocation("wr_gall_deck2_prow")].image = "wr_gall_deck2_prow.tga";

			LAi_QuestDelay("place_elevator_ropes3", 1.0);
		break;

		case "place_elevator_ropes3":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "see_ropes");

			LAi_QuestDelay("place_elevator_ropes4", 1.0);
		break;

		case "place_elevator_ropes4":
			LAi_SetPlayerType(Pchar);

			PlaySound("VOICE\ENGLISH\blaze_hah.wav");

			//LogIt("Pchar.quest.anchor = " + Pchar.quest.anchor);

			if(CheckAttribute(Pchar,"quest.anchor"))
			{
				if(Pchar.quest.anchor == "up")
				{
					Logit(LanguageConvertString(tmpLangFileID,"Hmm, they go all the way down into the hold?"));
					AddQuestRecord("Open_the_galley", "4");
				}

				if(Pchar.quest.anchor == "down")
				{
					Logit(LanguageConvertString(tmpLangFileID,"Hmm, maybe I can make them go all the way down into the hold?"));
					AddQuestRecord("Open_the_galley", "5");
				}
			}
		break;

		case "ropes_to_elevator":
			//from box1 wr_gall_hold_first itemlogic
			LAi_SetSitType(Pchar);
			PlaySound("PEOPLE\creak.wav");

			LAi_QuestDelay("ropes_to_elevator1", 1.0);
		break;

		case "ropes_to_elevator1":
			Pchar.quest.elevatorG_status = "elevator_ready";
			Locations[FindLocation("wr_gall_hold_first")].locators_radius.box.box1 = 0.0001;
			LAi_SetPlayerType(Pchar);

			Locations[FindLocation("wr_gall_hold_first")].models.always.l4 = "";	//no elevator without ropes
			Locations[FindLocation("wr_gall_hold_first")].models.always.l3 = "elevator&ropes_G0";
			Locations[FindLocation("wr_ships")].models.always.l7 = "elevator&ropes_G0";

			Locations[FindLocation("wr_gall_hold_first")].image = "";
			DoQuestReloadToLocation("wr_gall_hold_first", "goto", "goto1", "check_hold_planks");
			Locations[FindLocation("wr_gall_hold_first")].image ="wr_gall_hold_first.tga";
		break;
	//................................................................................................
		case "mast_so_what":
			//from itemlogic 2 diff cases, mast & hold_first

			PlaySound("VOICE\ENGLISH\blaze_mhm.wav");
			Logit(LanguageConvertString(tmpLangFileID,"And..?"));
		break;
	//................................................................................................
		case "unlock_prow_left":
			Locations[FindLocation("wr_gall_deck2_prow")].locators_radius.box.box2 = 0.0001;
			Locations[FindLocation("wr_gall_deck2_prow")].locators_radius.reload.reload2 = 1.0;
			Locations[FindLocation("wr_gall_deck2_prow")].reload.l2.disable = 0;
			Locations[FindLocation("wr_ships")].reload.l11.disable = 0;

			DoQuestReloadToLocation("wr_ships", "reload", "reload11", "_");
		break;

		case "unlock_prow_right":
			Locations[FindLocation("wr_gall_deck2_prow")].locators_radius.box.box1 = 0.0001;
			Locations[FindLocation("wr_gall_deck2_prow")].locators_radius.reload.reload3 = 1.0;
			Locations[FindLocation("wr_gall_deck2_prow")].reload.l3.disable = 0;
			Locations[FindLocation("wr_ships")].reload.l10.disable = 0;

			DoQuestReloadToLocation("wr_ships", "reload", "reload10", "_");
		break;

		case "unlock_prow_galley":
			Locations[FindLocation("wr_gall_deck2_prow")].locators_radius.box.box5 = 0.0001;
			Locations[FindLocation("wr_gall_deck2_prow")].locators_radius.reload.reload1 = 1.0;
			Locations[FindLocation("wr_gall_deck2_prow")].reload.l1.disable = 0;

			DoQuestReloadToLocation("wr_gall_galley_flooded", "reload", "reload1", "_");
		break;
	//................................................................................................
		case "check_hold_planks":
			if(CheckCharacterItem(Pchar,"temp_plank0"))
			{
				TakeItemFromCharacter(Pchar, "temp_plank0");
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				GiveItem2Character(Pchar, "bladeplank2");
				GiveItem2Character(Pchar, "pistolplank2");
				EquipCharacterbyItem(Pchar, "bladeplank2");
				EquipCharacterbyItem(Pchar, "pistolplank2");

				Pchar.quest.plank_position = "picked_up";
				Locations[FindLocation("wr_ships")].locators_radius.box.box11 = 2.0;

				PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
				Logit(LanguageConvertString(tmpLangFileID,"How can two planks help me get the Tool from the elevator?"));
				AddQuestRecord("Open_the_galley", "7");

				pchar.quest.Long_elevator_down.win_condition.l1 = "location";
				pchar.quest.Long_elevator_down.win_condition.l1.location = "wr_gall_deck2_prow";
				pchar.quest.Long_elevator_down.win_condition = "Long_elevator_down";
			}
			else LAi_QuestDelay("check_hold_planks", 0.5);	//loops until item picked up
		break;
	//................................................................................................
		case "Long_elevator_down":
			Pchar.quest.anchor = "up";
			Locations[FindLocation("wr_ships")].models.always.l5 = "anchor1";		//down
			Locations[FindLocation("wr_ships")].models.always.l6 = "elevator&ropes_C1";	//deck

			Locations[FindLocation("wr_ships")].locators_radius.reload.reload7 = 0.0001;
			Locations[FindLocation("wr_ships")].locators_radius.randitem.randitem2 = 1.5;	//with p.u. elevator_ropes

			Locations[FindLocation("wr_ships")].models.always.l7 = "elevator&ropes_G0";	//hold
			Locations[FindLocation("wr_ships")].models.always.l8 = "";		   	//invisible irontool
			Locations[FindLocation("wr_gall_hold_first")].models.always.l3 = "elevator&ropes_G0";
			Locations[FindLocation("wr_gall_hold_first")].models.always.l5 = "";	     	//invisible irontool
			Locations[FindLocation("wr_gall_hold_first")].locators_radius.randitem.randitem10 = 0.0001;   //disable pick up planks in hold
			Locations[FindLocation("wr_ships")].locators_radius.reload.reload12 = 1.0;   	//enable fall
			Pchar.quest.elevator_position = "hold";
			Locations[FindLocation("wr_ships")].locators_radius.box.box11 = 2.0;

			Locations[FindLocation("wr_ships")].locators_radius.box.box8 = 0.5;
			Locations[FindLocation("wr_ships")].locators_radius.box.box9 = 0.0001;

			ChangeCharacterAddressGroup(CharacterFromID("wr_aub"), "wr_ships", "goto", "box8");
			LAi_SetStayType(CharacterFromID("wr_aub"));

			pchar.quest.Long_elevator_down1.win_condition.l1 = "ExitFromLocation";
			pchar.quest.Long_elevator_down1.win_condition.l1.location = "wr_gall_deck2_prow";
			pchar.quest.Long_elevator_down1.win_condition = "Long_elevator_down1";
		break;

		case "Long_elevator_down1":
			PlaySound("PEOPLE\drill_water.wav");

			pchar.quest.Long_elevator_down2.win_condition.l1 = "location";
			pchar.quest.Long_elevator_down2.win_condition.l1.location = "wr_ships";
			pchar.quest.Long_elevator_down2.win_condition = "Long_elevator_down2";
		break;

		case "Long_elevator_down2":
			LAi_QuestDelay("Long_elevator_down3", 5.0);
		break;

		case "Long_elevator_down3":
			PlaySound("VOICE\ENGLISH\Eng_m_c_039.wav");

			LAi_SetActorType(characterFromID("wr_aub"));
			LAi_ActorGoToLocator(CharacterFromID("wr_aub"), "rld", "captain", "Long_to_quarterdeck", 15.0);
		break;
	//................................................................................................
		case "place_planks_on_deck":
			Locations[FindLocation("wr_ships")].image = "";
			DoQuestReloadToLocation("wr_ships", "goto", "place_planks", "wr_ships_loadingimage_back");
		break;
	//................................................................................................
		case "pick_up_pinion_small":
			Locations[FindLocation("wr_ships")].models.always.locators = "udeck_l_JRH_E1";//normal case
			Locations[FindLocation("wr_gall_deck2_prow")].image = "";
			DoQuestReloadToLocation("wr_gall_deck2_prow", "goto", "pinion", "wr_ships_loadingimage_back");
		break;

		case "pick_up_pinion_large":
			Locations[FindLocation("wr_ships")].models.always.locators = "udeck_l_JRH_E1";//normal case
			Locations[FindLocation("wr_ships")].image = "";
			DoQuestReloadToLocation("wr_ships", "goto", "backoff2", "wr_ships_loadingimage_back");//was backoff7
		break;

		case "pick_up_pistolwheel":
			Locations[FindLocation("wr_ships")].models.always.locators = "udeck_l_JRH_E1";//normal case
			DoQuestReloadToLocation("wr_corv_deck1", "reload", "reload7", "see_belt_through_ladder");
		break;

		case "see_belt_through_ladder":
			pchar.quest.see_belt_through_ladder1.win_condition.l1 = "locator";
			pchar.quest.see_belt_through_ladder1.win_condition.l1.location = "wr_corv_deck1";
			pchar.quest.see_belt_through_ladder1.win_condition.l1.locator_group = "reload";
			pchar.quest.see_belt_through_ladder1.win_condition.l1.locator = "reload5";
			pchar.quest.see_belt_through_ladder1.win_condition = "see_belt_through_ladder1";
		break;

		case "see_belt_through_ladder1":
			LAi_SetStayType(Pchar);
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");
			Logit(LanguageConvertString(tmpLangFileID,"Hmm, is that what I'm looking for?"));

			LAi_QuestDelay("see_belt_through_ladder2", 2.0);
		break;

		case "see_belt_through_ladder2":
			LAi_SetPlayerType(Pchar);
			AddQuestRecord("Woodes_Rogers_reward_7", "2");
		break;
	//................................................................................................
		case "pick_up_bladeirontool":
			Locations[FindLocation("wr_gall_hold_first")].image = "";
			DoQuestReloadToLocation("wr_gall_hold_first", "reload", "reload5", "pick_up_bladeirontool1");
		break;

		case "pick_up_bladeirontool1":
			Locations[FindLocation("wr_gall_hold_first")].image = "wr_gall_hold_first.tga";
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			GiveItem2Character(Pchar,"bladeirontool");
			EquipCharacterByItem(Pchar, "bladeirontool");
			LAi_SetFightMode(Pchar, false);
			PlaySound("OBJECTS\DUEL\man_attack6.wav");

			Locations[FindLocation("wr_gall_deck2_prow")].locators_radius.reload.reload1 = 0.0001;
			Locations[FindLocation("wr_gall_deck2_prow")].locators_radius.box.box4 = 1.0;
		break;
	//................................................................................................
		case "remove_plank_prow":
			PlaySound("PEOPLE\blade_creak.wav");

			LAi_QuestDelay("remove_plank_prow1", 1.5);
		break;

		case "remove_plank_prow1":
			Locations[FindLocation("wr_gall_deck2_prow")].image = "";
			DoQuestReloadToLocation("wr_gall_deck2_prow", "goto", "goto1", "remove_plank_prow2");
		break;

		case "remove_plank_prow2":
			Locations[FindLocation("wr_gall_deck2_prow")].image = "wr_gall_deck2_prow.tga";
			if(CheckCharacterItem(Pchar,"plank1_long"))
			{
				PlaySound("PEOPLE\place_planks.wav");
				TakeItemFromCharacter(Pchar, "plank1_long");
				Locations[FindLocation("wr_gall_deck2_prow")].locators_radius.randitem.randitem5 = 0.0001;
				Locations[FindLocation("wr_gall_deck2_prow")].reload.l1.disable = 0;
				Locations[FindLocation("wr_gall_deck2_prow")].locators_radius.reload.reload1 = 1.0;
				LAi_SetFightMode(Pchar, false);

				LAi_QuestDelay("remove_plank_prow3", 1.0);
			}
			else LAi_QuestDelay("remove_plank_prow2", 0.5);	//loops until item picked up
		break;

		case "remove_plank_prow3":
			DoQuestReloadToLocation("wr_gall_galley", "reload", "reload1", "enter_galley");

			//in galleon galley find
			//hint about farm & alchemy + info H2SO4 => farm open now!
			//or find copperas in galley => distill process has been enabled all the time? (without copperas)
		break;

		case "enter_galley":
			CloseQuestHeader("Open_the_galley");

			pchar.quest.enter_galley1.win_condition.l1 = "location";
			pchar.quest.enter_galley1.win_condition.l1.location = "wr_gall_galley";
			pchar.quest.enter_galley1.win_condition = "enter_galley1";
		break;

		case "enter_galley1":
			locations[FindLocation(Pchar.location)].box4.items.pistolcopperas = 18;
			//locations[FindLocation(Pchar.location)].box4.items.book42 = 1;

			LAi_QuestDelay("copperas_check", 0.1);
		break;
	//................................................................................................
		case "enter_farmhouse":
			pchar.quest.cauldron_check.win_condition.l1 = "location";
			pchar.quest.cauldron_check.win_condition.l1.location = "wr_farm_kitchen";
			pchar.quest.cauldron_check.win_condition = "cauldron_check";
		break;

		case "cauldron_check":
			if(CheckCharacterItem(Pchar,"cauldron1"))
			{
				PlaySound("INTERFACE\wheel_take.wav");
				TakeItemFromCharacter(Pchar, "cauldron1");
				GiveItem2Character(Pchar,"bladecauldron");
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladecauldron");
				return;
			}
			else LAi_QuestDelay("cauldron_check", 0.5);	//loops until item picked up
		break;
	//................................................................................................
		case "enter_farmbedroom":
			pchar.quest.stuffy_air.win_condition.l1 = "location";
			pchar.quest.stuffy_air.win_condition.l1.location = "wr_farm_bedroom";
			pchar.quest.stuffy_air.win_condition = "stuffy_air";
		break;

		case "stuffy_air":
			if(CheckAttribute(pchar,"quest.Minerva") && pchar.quest.Minerva == "arrived")
			{

			}
			else
			{
				PlaySound("VOICE\ENGLISH\blaze_puh.wav");
				Logit(LanguageConvertString(tmpLangFileID,"Oh!! It's really hot and stuffy in here - think I have to open the window!"));
			}
		break;
	//................................................................................................
		case "Minerva1":
			pchar.quest.Minerva = "arrived";
			Locations[FindLocation("wr_farm_bedroom")].reload.l2.disable = 0;
			locations[FindLocation("wr_farm_corridor")].id.label = "Rogers' passage";
			PlaySound("INTERFACE\key_unlock.wav");
			ChangeCharacterAddressGroup(characterFromID("Minerva"), "wr_farm_bedroom", "reload", "reload2");

			LAi_QuestDelay("Minerva2", 2.5);
		break;

		case "Minerva2":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto8");

			LAi_QuestDelay("Minerva2_A", 1.0);
		break;

		case "Minerva2_A":
			LAi_SetActorType(CharacterFromID("Minerva"));
			LAi_ActorDialog(characterFromID("Minerva"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Minerva"));
			Characters[GetCharacterIndex("Minerva")].dialog.CurrentNode  = "welcome";
		break;

		case "Minerva3":
			//from Minerva dialog
			AddQuestRecord("Woodes_Rogers_reward_7", "6");
			LAi_SetActorType(characterFromID("Minerva"));
			LAi_ActorGoToLocator(CharacterFromID("Minerva"), "goto", "goto7", "Minerva4", 2.0);
		break;

		case "Minerva4":
			LAi_SetStayType(characterFromID("Minerva"));

			LAi_QuestDelay("Minerva5", 1.0);
		break;

		case "Minerva5":
			PlaySound("PEOPLE\counter_openclose.wav");
			ChangeCharacterAddressGroup(characterFromID("Minerva"), "wr_farm_kitchen", "waitress", "barmen");
			LAi_SetWaitressType(characterFromID("Minerva"));

			LAi_SetPlayerType(Pchar);
		break;
	//................................................................................................
		case "book42_pickup_check":
			//started by entering Minervas room
			if(CheckCharacterItem(Pchar,"book42") )
			{
				GiveItem2Character(Pchar,"book43");
				GiveItem2Character(Pchar,"book44");
			}
			else LAi_QuestDelay("book42_pickup_check", 0.5);
		break;

		case "book49_pickup_check":
			//started by moving chart (first time)
			if(CheckCharacterItem(Pchar,"book49") )
			{
				GiveItem2Character(Pchar,"book50");
			}
			else LAi_QuestDelay("book49_pickup_check", 0.5);
		break;
	//................................................................................................
		case "open_bedroom_window":
			//from itemlogic box...
			DoQuestReloadToLocation("wr_farm_bedroom", "goto", "goto4", "open_bedroom_window1");
		break;

		case "open_bedroom_window1":
			PlaySound("PEOPLE\counter_open.wav");
			Locations[FindLocation("wr_farm_bedroom")].image = "wr_farm_bedroom.tga";
		break;
	//................................................................................................
		case "close_bedroom_window":
			//from itemlogic box...
			DoQuestReloadToLocation("wr_farm_bedroom", "goto", "goto4", "close_bedroom_window1");
		break;

		case "close_bedroom_window1":
			PlaySound("PEOPLE\counter_close.wav");
			Locations[FindLocation("wr_farm_bedroom")].image = "wr_farm_bedroom.tga";

			if(CheckAttribute(pchar,"quest.Minerva") && pchar.quest.Minerva == "arrived")
			{

			}
			else LAi_QuestDelay("Minerva1", 1.0);
		break;
	//................................................................................................
		case "change_bedroom_chart":
			//from itemlogic box...
			DoQuestReloadToLocation("wr_farm_bedroom", "goto", "chart", "change_bedroom_chart1");
		break;

		case "change_bedroom_chart1":
			PlaySound("INTERFACE\chart_move.wav");
			Locations[FindLocation("wr_farm_bedroom")].image = "wr_farm_bedroom.tga";
		break;
	//................................................................................................
		case "stay_at_candle":
			//from itemlogic wr_farm_corridor box1
			if(!LAi_IsFightMode(Pchar))
			{
				ChangeCharacterAddressGroup(Pchar, "wr_farm_corridor", "goto", "candle_free");
				LAi_LocationFightDisable(&Locations[FindLocation("wr_farm_corridor")], true);
			}
			else LAi_QuestDelay("stay_at_candle", 1.0);//loops until not fightmode
		break;

		case "pick_up_book46":
			Locations[FindLocation("wr_farm_corridor")].image = "";
			DoQuestReloadToLocation("wr_farm_corridor", "goto", "candle_stuck", "pick_up_book46_1");
		break;

		case "pick_up_book46_1":
			LAi_SetFightMode(pchar, false);
			LAi_LocationFightDisable(&Locations[FindLocation("wr_farm_corridor")], true);
			Locations[FindLocation("wr_farm_corridor")].image = "wr_farm_corridor.tga";

			if(Locations[FindLocation(Pchar.location)].models.always.locators == "StoreSmall_locators_JRH_normal")
			Pchar.quest.keymiddle = "on_counter";
		break;

		case "corridor_lit":
			Locations[FindLocation("wr_farm_corridor")].image = "";
			DoQuestReloadToLocation("wr_farm_corridor", "goto", "candle_stuck", "corridor_lit_1");
		break;

		case "corridor_lit_1":
			LAi_SetFightMode(pchar, false);
			LAi_LocationFightDisable(&Locations[FindLocation("wr_farm_corridor")], true);
			Locations[FindLocation("wr_farm_corridor")].image = "wr_farm_corridor.tga";
		break;

		case "pick_up_key18":
			Locations[FindLocation("wr_farm_corridor")].locators_radius.box.box1 = 0.001;
			Locations[FindLocation("wr_farm_corridor")].image = "";
			DoQuestReloadToLocation("wr_farm_corridor", "goto", "candle_stuck", "pick_up_key18_1");
		break;

		case "pick_up_key18_1":
			LAi_SetFightMode(pchar, false);
			LAi_LocationFightDisable(&Locations[FindLocation("wr_farm_corridor")], true);
			Locations[FindLocation("wr_farm_corridor")].image = "wr_farm_corridor.tga";
		break;
	//................................................................................................
		case "unlock_from_corridor":
			//from itemlogic box2
			locations[FindLocation("wr_farm_servant")].id.label = "Minervas room";
			Locations[FindLocation("wr_farm_corridor")].locators_radius.box.box2 = 0.0001;		//doesn't_help: move box2 a little
			Locations[FindLocation("wr_farm_corridor")].locators_radius.reload.reload2 = 0.5;
			Locations[FindLocation("wr_farm_corridor")].reload.l5.disable = 0;
			TakeItemFromCharacter(Pchar, "key18");
			DoQuestReloadToLocation("wr_farm_servant", "reload", "reload3", "servant_room");
		break;
	//................................................................................................
		case "servant_room":
			//from "unlock_from_corridor"

			Logit(LanguageConvertString(tmpLangFileID,"Minervas Room"));
			locations[FindLocation(Pchar.location)].box2.items.book47 = 1;

			LAi_QuestDelay("alchemy_fire_level_down", 0.1);
			LAi_QuestDelay("place_distillery_items", 0.1);
			LAi_QuestDelay("book42_pickup_check", 0.1);
		break;
	//................................................................................................
		case "pull_carpet":
			ChangeCharacterAddressGroup(Pchar, "wr_farm_servant", "goto", "pull");
			LAi_SetSitType(Pchar);

			LAi_QuestDelay("pull_carpet1", 0.5);
		break;

		case "pull_carpet1":
			PlaySound("OBJECTS\DUEL\man_attack1.wav");

			Locations[FindLocation("wr_farm_servant")].image = "";

			LAi_QuestDelay("pull_carpet2", 1.0);
		break;

		case "pull_carpet2":
			DoQuestReloadToLocation("wr_farm_servant", "goto", "push", "pull_carpet3");
		break;

		case "pull_carpet3":
			if(Locations[FindLocation("wr_farm_servant")].models.always.locators == "sh_l_JRH2_open")
			{
				CreateParticleSystem("blast_dirt_small" , -3.5, 0.0, -0.6, 0.0, 0.0, 0.0, sti(20) );

			}

			if(Locations[FindLocation("wr_farm_servant")].models.always.locators == "sh_l_JRH2_closed_doc")
			{
				CreateParticleSystem("blast_dirt_small" , 0.0, 0.0, -0.7, 0.0, 0.0, 0.0, sti(20) );
			}

			PlaySound("INTERFACE\carpet_move.wav");
			Locations[FindLocation("wr_farm_servant")].image = "wr_farm_servant.tga";

			LAi_QuestDelay("pull_carpet4", 1.0);
		break;

		case "pull_carpet4":
			LAi_SetPlayerType(Pchar);
		break;
	//................................................................................................
		case "unlock_from_alchemy":
			//from itemlogic box6
			ChangeCharacterAddressGroup(characterFromID("Minerva"), "wr_farm_booty", "waitress", "barmen");
			LAi_SetWaitressType(characterFromID("Minerva"));
			Locations[FindLocation("wr_farm_alchemy")].locators_radius.box.box6 = 0.0001;
			Locations[FindLocation("wr_farm_alchemy")].locators_radius.reload.reload1 = 0.6;
			Locations[FindLocation("wr_farm_booty")].models.always.locators = "sklad_locators_JRH2";	//door visible
			Pchar.quest.boat_to_prizeships = "not_yet";

			DoQuestReloadToLocation("wr_farm_booty", "reload", "reload2", "unlock_from_alchemy1");//was "_"
		break;

		case "unlock_from_alchemy1":
			LAi_SetActorType(characterFromID("Minerva"));
			LAi_ActorDialog(characterFromID("Minerva"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Minerva"));
			Characters[GetCharacterIndex("Minerva")].dialog.CurrentNode  = "assemble_apparatus";
		break;

		case "unlock_from_alchemy2":
			//from Minerva dialog
			LAi_SetWaitressType(characterFromID("Minerva"));
			SetQuestHeader("Alchemy_apparatus");
			AddQuestRecord("Alchemy_apparatus", "4");
		break;
//.............................................................................................................
		case "switch_to_potion_cognac":
			//from itemlogic
			Logit(LanguageConvertString(tmpLangFileID,"I put away the Cognac now - Maybe I'll need it further on."));
			PlaySound("INTERFACE\button2.wav");

			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladebottle_CB2");
			GiveItem2Character(Pchar,"cognac");

			if(CheckCharacterItem(Pchar,"bladeA11"))
			{
				EquipCharacterByItem(Pchar, "bladeA11");
			}
			else
			{
				if(!CheckCharacterItem(Pchar,"bladeX4"))
				{
					GiveItem2Character(Pchar,"bladeX4");
				}
				EquipCharacterByItem(Pchar, "bladeX4");
			}

			if(CheckAttribute(Pchar, "quest.boat_to_prizeships") && Pchar.quest.boat_to_prizeships == "not_yet")
			{
				Pchar.quest.boat_to_prizeships = "arrived";
				LAi_QuestDelay("boat_to_prizeships", 1.0);
			}
		break;
//.............................................................................................................
		case "boat_to_prizeships":
			PlaySound("INTERFACE\closet_open.wav");
			ChangeCharacterAddressGroup(characterFromID("wr_pir5"), "wr_port", "goto", "character2");
			ChangeCharacterAddressGroup(characterFromID("wr_hubport"), "wr_port", "goto", "character7");
			Locations[FindLocation("wr_port")].locators_radius.reload.reload1 = 1.5;
			SetCharacterShipLocation(characterFromID("CoastBrother27"), "wr_port");		//boat2
			ChangeCharacterAddressGroup(characterFromID("Minerva"), "wr_farm_alchemy", "reload", "reload1");
			LAi_SetStayType(characterFromID("Minerva"));

			LAi_QuestDelay("boat_to_prizeships1", 1.0);
		break;

		case "boat_to_prizeships1":
			LAi_SetActorType(characterFromID("Minerva"));
			LAi_ActorDialog(characterFromID("Minerva"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Minerva"));
			Characters[GetCharacterIndex("Minerva")].dialog.CurrentNode  = "boat_is_here";
		break;

		case "boat_to_prizeships2":
			LAi_SetPlayerType(Pchar);

			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(characterFromID("Minerva"), "wr_farm_booty", "waitress", "barmen");
			LAi_SetWaitressType(characterFromID("Minerva"));

			LAi_QuestDelay("enter_ships", 0.1);
		break;
	//................................................................................................
		case "alchemy_fire_level_down":
			pchar.quest.alchemy_fire_level_down1.win_condition.l1 = "location";
			pchar.quest.alchemy_fire_level_down1.win_condition.l1.location = "wr_farm_alchemy";
			pchar.quest.alchemy_fire_level_down1.win_condition = "alchemy_fire_level_down1";
		break;

		case "alchemy_fire_level_down1":
			if(CheckAttribute(Pchar, "gas_is_lost") && Pchar.gas_is_lost == "yes")
			{
				PlaySound("OBJECTS\VOICES\DEAD\male\dead7.wav");
				Logit(LanguageConvertString(tmpLangFileID,"Oh no, there's no gas left in the bottle!"));
				Pchar.gas_is_lost = "no";
			}

			LAi_QuestDelay("alchemy_acid_fog", 0.1);
			LAi_QuestDelay("alchemy_acid_fogL", 0.1);

			Pchar.quest.alchemy_fire_level_down2.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.alchemy_fire_level_down2.win_condition.l1.location = "wr_farm_alchemy";
			Pchar.quest.alchemy_fire_level_down2.win_condition = "alchemy_fire_level_down2";
		break;
//JRH LY1_gas is lost if leaving alchemy 
		case "alchemy_fire_level_down2":
			if(locations[FindLocation("wr_farm_alchemy")].models.always.l16 == "bottle_LY1_gas") 
			{
				locations[FindLocation("wr_farm_alchemy")].models.always.l16 = "bottle_LE0";
				Pchar.gas_is_lost = "yes";
			}

			if(Locations[FindLocation("wr_farm_alchemy")].models.always.locators == "mediumhouse01_locators_JRH1")
			{
				Locations[FindLocation("wr_farm_alchemy")].models.always.locators = "mediumhouse01_locators_JRH0";
			}

			if(Locations[FindLocation("wr_farm_alchemy")].models.always.locators == "mediumhouse01_locators_JRH2")
			{
				Locations[FindLocation("wr_farm_alchemy")].models.always.locators = "mediumhouse01_locators_JRH1";

				pchar.quest.alchemy_fire_low.win_condition.l1 = "location";
				pchar.quest.alchemy_fire_low.win_condition.l1.location = "wr_farm_alchemy";
				pchar.quest.alchemy_fire_low.win_condition = "alchemy_fire_low";
			}

			LAi_QuestDelay("alchemy_fire_level_down", 0.1);
		break;
	//................................................................................................
		case "place_distillery_items":
			pchar.quest.place_distillery_items1.win_condition.l1 = "location";
			pchar.quest.place_distillery_items1.win_condition.l1.location = "wr_farm_booty";
			pchar.quest.place_distillery_items1.win_condition = "place_distillery_items1";
		break;

		case "place_distillery_items1":
			locations[FindLocation(Pchar.location)].box4.items.pistolretort = 16;
			locations[FindLocation(Pchar.location)].box3.items.bladetop = 14;
			locations[FindLocation(Pchar.location)].box2.items.pistolglass_tube = 13;
			locations[FindLocation(Pchar.location)].box6.items.bladebottle_CE0 = 13;

			locations[FindLocation(Pchar.location)].box1.items.bladebottle_CP2 = 3;
			locations[FindLocation(Pchar.location)].box1.items.book51 = 1;		//champagne to cognac
		break;

		case "stay_at_fireplace":
			//from itemlogic wr_farm_alchemy box4
			if(!LAi_IsFightMode(Pchar))
			{
				Pchar.quest.lab_position = "elsewhere";			//reset
				ChangeCharacterAddressGroup(Pchar, "wr_farm_alchemy", "goto", "fireplace");
				LAi_LocationFightDisable(&Locations[FindLocation("wr_farm_alchemy")], true);
			}
			else LAi_QuestDelay("stay_at_fireplace", 1.0);//loops until not fightmode
		break;

		case "place_distillery_item":
			Locations[FindLocation("wr_farm_alchemy")].image = "";
			DoQuestReloadToLocation("wr_farm_alchemy", "goto", "fireplace", "wr_farm_loadingimage_back");
		break;

		case "wr_farm_loadingimage_back":
			LAi_SetFightMode(pchar, false);
//postman start
			if(!CheckAttribute(Pchar,"postman") || Pchar.postman != "arrived")
			{
				if(CheckCharacterItem(Pchar,"bladebottle_CT1_nitr") && CheckCharacterItem(Pchar,"bladebottle_CV1_sc"))
				{
					Pchar.postman = "arrived";					

					LAi_QuestDelay("postman1", 1.0);
				}
			}
//sloop start
			if(!CheckAttribute(Pchar,"sloop") || Pchar.sloop != "arrived")
			{
				if(CheckCharacterItem(Pchar,"bladebottle_BS2_LH"))
				{
					Pchar.sloop = "arrived";					

					LAi_QuestDelay("sloop1", 1.0);
				}
			}

			if(CheckCharacterItem(Pchar,"bladebottle_CB2"))
			{
				if(CheckAttribute(Pchar, "quest.boat_to_prizeships") && Pchar.quest.boat_to_prizeships == "not_yet")
				{
					//only first time you make cognac from alcohol & water

					LAi_SetStayType(Pchar);	//waiting for 1) switch to potion cognac 2) Minerva to arrive
				}
			}
			else LAi_SetPlayerType(Pchar);

			Locations[FindLocation("wr_farm_alchemy")].image = "wr_farm_alchemy.tga";

			if(locations[FindLocation("wr_farm_alchemy")].models.always.l5 == "bottle_MB2")
			{
				PlaySound("OBJECTS\DUEL\man_attack6.wav");
				Logit(LanguageConvertString(tmpLangFileID,"I have made Cognac!"));
			}
			if(locations[FindLocation("wr_farm_alchemy")].models.always.l5 == "bottle_MT2_sulf_w")
			{
				PlaySound("OBJECTS\DUEL\man_attack6.wav");
				Logit(LanguageConvertString(tmpLangFileID,"I have made Diluted Sulfuric Acid!"));
			}
			if(locations[FindLocation("wr_farm_alchemy")].models.always.l5 == "bottle_MT2_nitr_w")
			{
				PlaySound("OBJECTS\DUEL\man_attack6.wav");
				Logit(LanguageConvertString(tmpLangFileID,"I have made Aqua Fortis!"));
			}
			if(locations[FindLocation("wr_farm_alchemy")].models.always.l5 == "bottle_MA2")
			{
				PlaySound("OBJECTS\DUEL\man_attack6.wav");
				Logit(LanguageConvertString(tmpLangFileID,"I have made Aqua Regis!"));
			}

			if(locations[FindLocation("wr_farm_alchemy")].models.always.l5 == "bottle_MT2_hydr")
			{
				PlaySound("VOICE\ENGLISH\blaze_hah.wav");
				Logit(LanguageConvertString(tmpLangFileID,"It smells like Hydrochloricic Acid."));
			}

			//-----------------------------------------------------------------------------------------
//JRH mhm
			if(locations[FindLocation("wr_farm_alchemy")].models.always.l16 == "bottle_LTc_hydr")
			{
				PlaySound("VOICE\ENGLISH\blaze_mhm.wav");
				Logit(LanguageConvertString(tmpLangFileID,"I think that's the right mixture."));
			}

			if(locations[FindLocation("wr_farm_alchemy")].models.always.l16 == "bottle_LG2_mix2")
			{
				PlaySound("VOICE\ENGLISH\blaze_mhm.wav");
				Logit(LanguageConvertString(tmpLangFileID,"I think that's the right mixture."));
			}

			if(locations[FindLocation("wr_farm_alchemy")].models.always.l16 == "bottle_LL2_s")
			{
				PlaySound("VOICE\ENGLISH\blaze_mhm.wav");
				Logit(LanguageConvertString(tmpLangFileID,"I think that's the right mixture."));
			}

			if(locations[FindLocation("wr_farm_alchemy")].models.always.l16 == "bottle_LU2")
			{
				PlaySound("OBJECTS\DUEL\man_attack6.wav");
				Logit(LanguageConvertString(tmpLangFileID,"I have made Liquor Hepatis!"));
			}

			if(locations[FindLocation("wr_farm_alchemy")].models.always.l16 == "bottle_LY2_mix9")
			{
				PlaySound("VOICE\ENGLISH\blaze_mhm.wav");
				Logit(LanguageConvertString(tmpLangFileID,"I think that's the right mixture."));
			}

			if(locations[FindLocation("wr_farm_alchemy")].models.always.l5 == "bottle_MC2")
			{
				PlaySound("OBJECTS\DUEL\man_attack6.wav");
				Logit(LanguageConvertString(tmpLangFileID,"I have made Black Pulvis Solaris!"));
			}

			if(locations[FindLocation("wr_farm_alchemy")].models.always.l5 == "bottle_MR2")
			{
				PlaySound("OBJECTS\DUEL\man_attack6.wav");
				Logit(LanguageConvertString(tmpLangFileID,"I have made Red Pulvis Solaris!"));
			}

			if(locations[FindLocation("wr_farm_alchemy")].models.always.l5 == "bottle_MT2_mix11")
			{
				PlaySound("VOICE\ENGLISH\blaze_mhm.wav");
				Logit(LanguageConvertString(tmpLangFileID,"I think that's the right mixture."));
			}

			if(locations[FindLocation("wr_farm_alchemy")].models.always.l16 == "bottle_LP2_ps")
			{
				PlaySound("OBJECTS\DUEL\man_attack6.wav");
				Logit(LanguageConvertString(tmpLangFileID,"I have made Pulvis Solaris!"));
			}

			if(locations[FindLocation("wr_farm_alchemy")].models.always.l16 == "bottle_AU2")
			{
				Pchar.Q2_mix = "15";
				LAi_SetStayType(Pchar);
				PauseAllSounds();//stops music
				locations[FindLocation("wr_farm_alchemy")].type = "silent_residence";
				PostEvent("LoadSceneSound", 0.1);
				
				PlaySound("PEOPLE\transform.wav");
				PlaySound("PEOPLE\transform.wav");
				CreateParticleSystem("stars_short" , -1.25, 1.4, -2.2, 0.0, 0.0, 0.0, sti(20) );

				LAi_QuestDelay("pchar_oh", 2.0);
				LAi_QuestDelay("pchar_oh", 2.0);
				LAi_QuestDelay("pchar_playertype", 4.0);
				Logit(LanguageConvertString(tmpLangFileID,"I think that's the right mixture."));
			}
		break;		
//postman--------------------------------------------------------------------------------------------------------
		case "postman1":
			PlaySound("AMBIENT\SEASHORE\fanfare2.wav");
			ChangeCharacterAddressGroup(characterFromID("postman"), "wr_port", "goto", "goto13");
		
			LAi_QuestDelay("postman2", 3.0);
			LAi_QuestDelay("postman5", 10.0);

			pchar.quest.postman3.win_condition.l1 = "location";
			pchar.quest.postman3.win_condition.l1.location = "wr_farm_kitchen";
			pchar.quest.postman3.win_condition = "postman3";
		break;

		case "postman2":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "cavalry";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "postman3":
			PlaySound("AMBIENT\SEASHORE\fanfare2.wav");

			LAi_QuestDelay("postman4", 3.0);

			pchar.quest.postman_dialog.win_condition.l1 = "locator";
			pchar.quest.postman_dialog.win_condition.l1.location = "wr_port";
			pchar.quest.postman_dialog.win_condition.l1.locator_group = "goto";
			pchar.quest.postman_dialog.win_condition.l1.locator = "goto13";
			pchar.quest.postman_dialog.win_condition = "postman_dialog";
		break;

		case "postman4":
			PlaySound("OBJECTS\DUEL\man_attack5.wav");
		break;

		case "postman5":
			if(pchar.location == "wr_port" || pchar.location == "wr_farm_kitchen")
			{
				//don't play it here
			}
			else 
			{
				PlaySound("AMBIENT\SEASHORE\fanfare2.wav");

				LAi_QuestDelay("postman6", 3.0);
			}
		break;

		case "postman6":
			PlaySound("VOICE\ENGLISH\Dut_m_a_017.wav");
		break;

		case "postman_dialog":
			LAi_SetActorType(characterFromID("postman"));
			LAi_ActorDialog(characterFromID("postman"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("postman"));
			characters[GetCharacterIndex("postman")].dialog.CurrentNode = "package";
		break;

		case "postman_done":
			LAi_SetStayType(pchar);
			PlaySound("VOICE\ENGLISH\Dupin_good_day.wav");
			LAi_SetActorType(characterFromID("postman"));
			LAi_ActorRunToLocator(CharacterFromID("postman"), "goto", "goto16", "", 7.0);

			LAi_QuestDelay("postman_done1", 4.0);
		break;

		case "postman_done1":
			PlaySound("AMBIENT\SEASHORE\fanfare2.wav");
			PlaySound("AMBIENT\SEASHORE\fanfare2.wav");

			LAi_QuestDelay("pchar_ooh", 3.0);
			LAi_QuestDelay("postman_done2", 3.0);
		break;

		case "postman_done2":
			ChangeCharacterAddressGroup(characterFromID("postman"), "none", "", "");
			LAi_SetPlayerType(pchar);
		break;
//postman--------------------------------------------------------------------------------------------------------
//sloop----------------------------------------------------------------------------------------------------------
		case "sloop1":
			Locations[FindLocation("Tutorial_Deck")].WeaponsLocker.items.blade10 = 1;
			Locations[FindLocation("Tutorial_Deck")].WeaponsLocker.items.Pistol6 = 1;

			Locations[FindLocation("Tutorial_Deck")].box1.items.shirt_shoes = 1;
			Locations[FindLocation("Tutorial_Deck")].box1.items.spyglass3 = 1;
			Locations[FindLocation("Tutorial_Deck")].box1.items.compass2 = 1;
			Locations[FindLocation("Tutorial_Deck")].box1.items.map = 1;
			Locations[FindLocation("Tutorial_Deck")].box1.items.medical2 = 1;
			Locations[FindLocation("Tutorial_Deck")].box1.items.potionrum = 2;
		//	Locations[FindLocation("Tutorial_Deck")].box1.money = 3000;	//was 1500

			Locations[FindLocation("Tutorial_Deck")].box2.items.ammopouch = 1;
			Locations[FindLocation("Tutorial_Deck")].box2.items.powderflask = 1;
			Locations[FindLocation("Tutorial_Deck")].box2.items.gunpowder = 12;
			Locations[FindLocation("Tutorial_Deck")].box2.items.pistolbullets = 12;

			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire_01.wav");
			Island_SetReloadEnableLocal("Redmond", "reload_1", true);	//to wr_port
			Locations[FindLocation("wr_port")].models.always.locators = "QCport_l_JRHsea";
			SetCharacterShipLocation(Pchar, "wr_port");

			LAi_QuestDelay("pchar_huh", 3.0);
			LAi_QuestDelay("sloop_new_shot", 20.0);

			ChangeCharacterAddressGroup(characterFromID("Claire Voyant"), "wr_port", "goto", "claire");	
			ChangeCharacterAddressGroup(characterFromID("Defoe"), "wr_port", "goto", "defoe");
			LAi_SetStayType(characterFromID("Claire Voyant"));
			LAi_SetStayType(characterFromID("Defoe"));
	
			pchar.quest.sloop2.win_condition.l1 = "locator";
			pchar.quest.sloop2.win_condition.l1.location = "wr_port";
			pchar.quest.sloop2.win_condition.l1.locator_group = "goto";
			pchar.quest.sloop2.win_condition.l1.locator = "sloop";
			pchar.quest.sloop2.win_condition = "sloop2";
		break;

		case "sloop_new_shot":
			if(pchar.location != "wr_port")
			{
				PlaySound("OBJECTS\SHIPCHARGE\cannon_fire_01.wav");

				LAi_QuestDelay("sloop_new_comment", 3.0);
			}
		break;

		case "sloop_new_comment":
			if(pchar.location != "wr_port") LAi_QuestDelay("pchar_lets_go", 0.01);
		break;

		case "sloop2":
			if(CheckAttribute(Pchar,"book72_caesarL") && Pchar.book72_caesarL == "read")
			{
			    if(CheckAttribute(Pchar,"book72_edenL") && Pchar.book72_edenL == "read")
			    {
				if(CheckAttribute(Pchar,"book72_handsL") && Pchar.book72_handsL == "read")
				{
				    if(CheckAttribute(Pchar,"book72_richardsL") && Pchar.book72_richardsL == "read")
				    {
					locations[FindLocation("wr_farm_bedroom")].box5.items.book72_closed = 1;
				    }
				}
			    }
			}

			locations[FindLocation("wr_farm_alchemy2")].box3.items.pistolfunnel = 1;
			locations[FindLocation("wr_farm_alchemy2")].box19.items.book70 = 1;
			if(Pchar.model == "Howard_Pyle_1") Pchar.bandages_trousersQ = "keep";

			LAi_SetActorType(CharacterFromID("Claire Voyant"));
			LAi_ActorDialog(characterFromID("Claire Voyant"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Claire Voyant"));
			Characters[GetCharacterIndex("Claire Voyant")].dialog.CurrentNode  = "sloop2";
		break;
		
		case "sloop3":
			LAi_SetActorType(CharacterFromID("Defoe"));
			LAi_ActorDialog(characterFromID("Defoe"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Defoe"));
			Characters[GetCharacterIndex("Defoe")].dialog.CurrentNode  = "sloop3";
		break;

		case "sloop4":
			LAi_SetActorType(CharacterFromID("Claire Voyant"));
			LAi_ActorDialog(characterFromID("Claire Voyant"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Claire Voyant"));
			Characters[GetCharacterIndex("Claire Voyant")].dialog.CurrentNode  = "sloop4";
		break;

		case "sloop5":
			LAi_SetActorType(CharacterFromID("Defoe"));
			LAi_ActorDialog(characterFromID("Defoe"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Defoe"));
			Characters[GetCharacterIndex("Defoe")].dialog.CurrentNode  = "sloop5";
		break;


		case "sloop6":
			LAi_SetActorType(CharacterFromID("Claire Voyant"));
			LAi_ActorDialog(characterFromID("Claire Voyant"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Claire Voyant"));
			Characters[GetCharacterIndex("Claire Voyant")].dialog.CurrentNode  = "sloop6";
		break;
	
		case "sloop7":
			LAi_SetActorType(CharacterFromID("Defoe"));
			LAi_ActorDialog(characterFromID("Defoe"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Defoe"));
			Characters[GetCharacterIndex("Defoe")].dialog.CurrentNode  = "sloop7";
		break;

		case "sloop8":
			weaponID7 = GetCharacterEquipByGroup(Pchar,BLADE_ITEM_TYPE);
			weaponID8 = GetCharacterEquipByGroup(Pchar,GUN_ITEM_TYPE);
		
			if(!CheckCharacterItem(CharacterFromID("Claire Voyant"),"bladeX4")) 
			{ GiveItem2Character(CharacterFromID("Claire Voyant"), "bladeX4"); }
			EquipCharacterByItem(CharacterFromID("Claire Voyant"), "bladeX4");
			GiveItem2Character(CharacterFromID("Claire Voyant"), weaponID8);
			EquipCharacterByItem(CharacterFromID("Claire Voyant"), weaponID8);

			GiveItem2Character(CharacterFromID("Defoe"), weaponID7);
			EquipCharacterByItem(CharacterFromID("Defoe"), weaponID7);
			PlaySound("INTERFACE\button2.wav");
			PlaySound("PEOPLE\clothes1.wav");

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			DeleteAttribute(Pchar, "items");

			//give back some items to pchar
			GiveItem2Character(Pchar, "bladeX4");
			GiveItem2Character(Pchar, "mapBB1");

		 	if(CheckAttribute(locations[FindLocation("wr_farm_bedroom")].box5.items,"book72_richardsL") 
			&& locations[FindLocation("wr_farm_bedroom")].box5.items.book72_closed == 0)
			{
				//it has not been returned, so you'll still need it
				GiveItem2Character(Pchar, "book72_closed");
			}

			if(Pchar.model == "Howard_Pyle_1") GiveItem2Character(Pchar, "bandages_trousersQ");
	
			LAi_SetActorType(CharacterFromID("Claire Voyant"));
			LAi_ActorDialog(characterFromID("Claire Voyant"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Claire Voyant"));
			Characters[GetCharacterIndex("Claire Voyant")].dialog.CurrentNode  = "sloop8";
		break;

		case "sloop9":
			LAi_SetActorType(CharacterFromID("Defoe"));
			LAi_ActorDialog(characterFromID("Defoe"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Defoe"));
			Characters[GetCharacterIndex("Defoe")].dialog.CurrentNode  = "sloop9";
		break;

		case "sloop10":
			LAi_SetStayType(pchar);
			LAi_SetActorType(CharacterFromID("Defoe"));
			LAi_SetActorType(CharacterFromID("Claire Voyant"));
			LAi_ActorGoToLocator(CharacterFromID("Claire Voyant"), "reload", "reload2", "lock_farm", 5.0);
			LAi_ActorGoToLocator(CharacterFromID("Defoe"), "reload", "reload2", "_", 5.0);

			LAi_QuestDelay("sloop11", 2.0);
		break;

		case "sloop11":
			LAi_SetActorType(pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");
		break;

		case "lock_farm":
			PlaySound("INTERFACE\closed_locked_door.wav");
			Locations[FindLocation("wr_port")].reload.l2.disable = 1;	
			ChangeCharacterAddressGroup(characterFromID("Claire Voyant"), "none", "", "");	
			ChangeCharacterAddressGroup(characterFromID("Defoe"), "none", "", "");
			LAi_SetPlayerType(pchar);
		break;

//q2 alchemy part 2
	//ALL READY HERE FOR ALCHEMY PART 2


		case "return_farm_items_Mona":

			Locations[FindLocation("wr_port")].reload.l2.disable = 0;
			ChangeCharacterAddressGroup(characterFromID("Minerva"), "wr_farm_kitchen", "goto", "goto1");
			LAi_SetStayType(CharacterFromID("Minerva"));
	
			pchar.quest.Minerva_alchemy2.win_condition.l1 = "locator";
			pchar.quest.Minerva_alchemy2.win_condition.l1.location = "wr_farm_kitchen";
			pchar.quest.Minerva_alchemy2.win_condition.l1.locator_group = "goto";
			pchar.quest.Minerva_alchemy2.win_condition.l1.locator = "goto1";
			pchar.quest.Minerva_alchemy2.win_condition = "Minerva_alchemy2";


			if(CheckAttribute(Pchar, "Q2_mix") && Pchar.Q2_mix == "9")
			{
				//part 1 is played through
			}
			else
			{
				ChangeCharacterAddressGroup(characterFromID("wr_sol6f77"), "none", "", "");		//boatshore
				ChangeCharacterAddressGroup(characterFromID("wr_fwn"), "none", "", "");			//boatshore
				Locations[FindLocation("Redmond_shore_03")].models.always.locators = "shore10_l_JRH1";
				Locations[FindLocation("Redmond_shore_03")].locators_radius.reload.reload1 = 0.001;
				Locations[FindLocation("wr_farm_booty")].models.always.locators = "sklad_locators_JRH2";
				Locations[FindLocation("wr_farm_bedroom")].reload.l2.disable = 0;
				Locations[FindLocation("wr_farm_corridor")].filespath.textures = "locations\inside\Corridor\normal";
				Locations[FindLocation("wr_farm_corridor")].locators_radius.box.box1 = 0.001;
				Locations[FindLocation("wr_farm_corridor")].models.always.locators = "storeSmall_locators_JRH_normal";
				Locations[FindLocation("wr_farm_corridor")].reload.l5.disable = 0;
				Locations[FindLocation("wr_farm_servant")].models.always.locators = "sh_l_JRH2_open";
				Locations[FindLocation("wr_farm_servant")].reload.l2.disable = 0;
				Locations[FindLocation("wr_farm_alchemy")].reload.l2.disable = 0;
				Locations[FindLocation("wr_farm_alchemy")].reload.l3.disable = 0;
				Locations[FindLocation("wr_farm_alchemy")].locators_radius.box.box6 = 0.0001;
				Locations[FindLocation("wr_farm_alchemy")].locators_radius.reload.reload1 = 0.6;
				locations[FindLocation("wr_farm_alchemy")].models.always.l9 = "cauldron3_w";
				locations[FindLocation("wr_farm_alchemy")].models.always.l10 = "retort_E0";
				locations[FindLocation("wr_farm_alchemy")].models.always.l11 = "top3";
				locations[FindLocation("wr_farm_alchemy")].models.always.l12 = "glass_tube3";

				Locations[FindLocation("wr_farm_alchemy2")].reload.l1.disable = 0;
				Locations[FindLocation("wr_farm_alchemy2")].reload.l2.disable = 0;
				Locations[FindLocation("wr_farm_alchemy2")].reload.l3.disable = 0;
				locations[FindLocation("wr_farm_booty2")].id.label = "Rogers' secret storeroom";

				locations[FindLocation("wr_farm_servant")].id.label = "Minervas room";
				locations[FindLocation("wr_farm_corridor")].id.label = "Rogers' passage";

				Locations[FindLocation("wr_farm_alchemy")].locators_radius.box.box7 = 0.5;	//mixtable big bottle
				locations[FindLocation("wr_farm_alchemy")].models.always.l16 = "bottle_LE0";	//should be on here
				locations[FindLocation("wr_farm_alchemy")].models.always.l15 = "hatch7";

				Locations[FindLocation("wr_farm_kitchen")].items.randitem1 = "key8";		//invisible model
				Locations[FindLocation("wr_farm_bedroom")].items.randitem7 = "key8";
				Locations[FindLocation("wr_farm_corridor")].models.always.l1 = "";
				Locations[FindLocation("wr_farm_servant")].items.randitem6 = "key8";
				Locations[FindLocation("wr_farm_servant")].items.randitem7 = "key8";
				Locations[FindLocation("wr_farm_alchemy")].items.randitem6 = "key8";

				Locations[FindLocation("wr_farm_kitchen")].locators_radius.randitem.randitem1 = 0.0001;
				Locations[FindLocation("wr_farm_bedroom")].locators_radius.randitem.randitem7 = 0.0001;
				Locations[FindLocation("wr_farm_servant")].locators_radius.randitem.randitem6 = 0.0001;
				Locations[FindLocation("wr_farm_servant")].locators_radius.randitem.randitem7 = 0.0001;
				Locations[FindLocation("wr_farm_alchemy")].locators_radius.randitem.randitem6 = 0.0001;
				Locations[FindLocation("wr_farm_alchemy2")].locators_radius.box.box17 = 0.0001;
				Locations[FindLocation("wr_farm_alchemy2")].locators_radius.box.box18 = 0.0001;
	
				Pchar.quest.distillery_items = "open";
				//Pchar.quest.farm_water = "off";
				Pchar.quest.alchemy_lever = "down";
				Pchar.quest.alchemy_plank = "up";
				Pchar.quest.apparatus_level = "glass_tube";		
				Pchar.quest.farmbooty_fillbottle = "off";
				Pchar.quest.apparatus_liquid = "none";
				Pchar.quest.apparatus_cooling = "2";
				Pchar.quest.mixtable_bottle = "ME0";
				pchar.quest.Minerva = "arrived";
				Pchar.quest.cauldron = "water";
				Pchar.quest.retort = "yes";
				Pchar.quest.block_water = "yes";
		
				//new attributes Q2
				Pchar.alchemy2_grinder = "empty";
				Pchar.use_only_big_bottle = "yes";
				Pchar.quest.qbook_receiver = "done";
				Pchar.quest.distillery_items_Q2 = "open";

				//these 4 to fake that part 1 is done
				Pchar.Q2_mix = "9";
				Pchar.postman = "arrived";
				Pchar.sloop = "arrived";
				Pchar.farm_counter = "open";		//bedroom

				pchar.quest.wrport_backloop7_A.win_condition.l1 = "locator";
				pchar.quest.wrport_backloop7_A.win_condition.l1.location = "wr_port";
				pchar.quest.wrport_backloop7_A.win_condition.l1.locator_group = "reload";
				pchar.quest.wrport_backloop7_A.win_condition.l1.locator = "reload7";
				pchar.quest.wrport_backloop7_A.win_condition = "wrport_backloop7_A";

				pchar.quest.wrport_backloop8_A.win_condition.l1 = "locator";
				pchar.quest.wrport_backloop8_A.win_condition.l1.location = "wr_port";
				pchar.quest.wrport_backloop8_A.win_condition.l1.locator_group = "reload";
				pchar.quest.wrport_backloop8_A.win_condition.l1.locator = "reload8";
				pchar.quest.wrport_backloop8_A.win_condition = "wrport_backloop8_A";

				pchar.quest.alchemy2_fire_level_down1.win_condition.l1 = "location";
				pchar.quest.alchemy2_fire_level_down1.win_condition.l1.location = "wr_farm_alchemy2";
				pchar.quest.alchemy2_fire_level_down1.win_condition = "alchemy2_fire_level_down1";
			
				pchar.quest.ovenstop1.win_condition.l1 = "locator";
				pchar.quest.ovenstop1.win_condition.l1.location = "wr_farm_alchemy2";
				pchar.quest.ovenstop1.win_condition.l1.locator_group = "goto";
				pchar.quest.ovenstop1.win_condition.l1.locator = "ovenstop1";
				pchar.quest.ovenstop1.win_condition = "ovenback1";

				pchar.quest.ovenstop2.win_condition.l1 = "locator";
				pchar.quest.ovenstop2.win_condition.l1.location = "wr_farm_alchemy2";
				pchar.quest.ovenstop2.win_condition.l1.locator_group = "goto";
				pchar.quest.ovenstop2.win_condition.l1.locator = "ovenstop2";
				pchar.quest.ovenstop2.win_condition = "ovenback2";

				pchar.quest.ovenstop3.win_condition.l1 = "locator";
				pchar.quest.ovenstop3.win_condition.l1.location = "wr_farm_alchemy2";
				pchar.quest.ovenstop3.win_condition.l1.locator_group = "goto";
				pchar.quest.ovenstop3.win_condition.l1.locator = "ovenstop3";
				pchar.quest.ovenstop3.win_condition = "ovenback2";

				pchar.quest.woodstop.win_condition.l1 = "locator";
				pchar.quest.woodstop.win_condition.l1.location = "wr_farm_alchemy2";
				pchar.quest.woodstop.win_condition.l1.locator_group = "goto";
				pchar.quest.woodstop.win_condition.l1.locator = "woodstop";
				pchar.quest.woodstop.win_condition = "woodback";

				pchar.quest.p2_kitchen_items.win_condition.l1 = "location";
				pchar.quest.p2_kitchen_items.win_condition.l1.location = "wr_farm_kitchen";
				pchar.quest.p2_kitchen_items.win_condition = "p2_kitchen_items";

				pchar.quest.p2_bedroom_items.win_condition.l1 = "location";
				pchar.quest.p2_bedroom_items.win_condition.l1.location = "wr_farm_bedroom";
				pchar.quest.p2_bedroom_items.win_condition = "p2_bedroom_items";

				pchar.quest.p2_booty_items.win_condition.l1 = "location";
				pchar.quest.p2_booty_items.win_condition.l1.location = "wr_farm_booty";
				pchar.quest.p2_booty_items.win_condition = "p2_booty_items";

				pchar.quest.p2_alchemy_items.win_condition.l1 = "location";
				pchar.quest.p2_alchemy_items.win_condition.l1.location = "wr_farm_alchemy";
				pchar.quest.p2_alchemy_items.win_condition = "p2_alchemy_items";

				pchar.quest.p2_alchemy2_items.win_condition.l1 = "location";
				pchar.quest.p2_alchemy2_items.win_condition.l1.location = "wr_farm_alchemy2";
				pchar.quest.p2_alchemy2_items.win_condition = "p2_alchemy2_items";

				pchar.quest.p2_servant_items.win_condition.l1 = "location";
				pchar.quest.p2_servant_items.win_condition.l1.location = "wr_farm_servant";
				pchar.quest.p2_servant_items.win_condition = "p2_servant_items";
			}
		break;

		case "return_farm_items_new_game":
			Locations[FindLocation("wr_port")].reload.l2.disable = 0;
			ChangeCharacterAddressGroup(characterFromID("Minerva"), "wr_farm_kitchen", "goto", "goto1");
			LAi_SetStayType(CharacterFromID("Minerva"));
	
			pchar.quest.Minerva_alchemy2.win_condition.l1 = "locator";
			pchar.quest.Minerva_alchemy2.win_condition.l1.location = "wr_farm_kitchen";
			pchar.quest.Minerva_alchemy2.win_condition.l1.locator_group = "goto";
			pchar.quest.Minerva_alchemy2.win_condition.l1.locator = "goto1";
			pchar.quest.Minerva_alchemy2.win_condition = "Minerva_alchemy2";

				ChangeCharacterAddressGroup(characterFromID("wr_sol6f77"), "none", "", "");		//boatshore
				ChangeCharacterAddressGroup(characterFromID("wr_fwn"), "none", "", "");			//boatshore
				Locations[FindLocation("Redmond_shore_03")].models.always.locators = "shore10_l_JRH1";
				Locations[FindLocation("Redmond_shore_03")].locators_radius.reload.reload1 = 0.001;
				Locations[FindLocation("wr_farm_booty")].models.always.locators = "sklad_locators_JRH2";
				Locations[FindLocation("wr_farm_bedroom")].reload.l2.disable = 0;
				Locations[FindLocation("wr_farm_corridor")].filespath.textures = "locations\inside\Corridor\normal";
				Locations[FindLocation("wr_farm_corridor")].locators_radius.box.box1 = 0.001;
				Locations[FindLocation("wr_farm_corridor")].models.always.locators = "storeSmall_locators_JRH_normal";
				Locations[FindLocation("wr_farm_corridor")].reload.l5.disable = 0;
				Locations[FindLocation("wr_farm_servant")].models.always.locators = "sh_l_JRH2_open";
				Locations[FindLocation("wr_farm_servant")].reload.l2.disable = 0;
				Locations[FindLocation("wr_farm_alchemy")].reload.l2.disable = 0;
				Locations[FindLocation("wr_farm_alchemy")].reload.l3.disable = 0;
				Locations[FindLocation("wr_farm_alchemy")].locators_radius.box.box6 = 0.0001;
				Locations[FindLocation("wr_farm_alchemy")].locators_radius.reload.reload1 = 0.6;
				locations[FindLocation("wr_farm_alchemy")].models.always.l9 = "cauldron3_w";
				locations[FindLocation("wr_farm_alchemy")].models.always.l10 = "retort_E0";
				locations[FindLocation("wr_farm_alchemy")].models.always.l11 = "top3";
				locations[FindLocation("wr_farm_alchemy")].models.always.l12 = "glass_tube3";

				Locations[FindLocation("wr_farm_alchemy2")].reload.l1.disable = 0;
				Locations[FindLocation("wr_farm_alchemy2")].reload.l2.disable = 0;
				Locations[FindLocation("wr_farm_alchemy2")].reload.l3.disable = 0;
				locations[FindLocation("wr_farm_booty2")].id.label = "Rogers' secret storeroom";

				locations[FindLocation("wr_farm_servant")].id.label = "Minervas room";
				locations[FindLocation("wr_farm_corridor")].id.label = "Rogers' passage";

				Locations[FindLocation("wr_farm_alchemy")].locators_radius.box.box7 = 0.5;	//mixtable big bottle
				locations[FindLocation("wr_farm_alchemy")].models.always.l16 = "bottle_LE0";	//should be on here
				locations[FindLocation("wr_farm_alchemy")].models.always.l15 = "hatch7";

				Locations[FindLocation("wr_farm_kitchen")].items.randitem1 = "key8";		//invisible model
				Locations[FindLocation("wr_farm_bedroom")].items.randitem7 = "key8";
				Locations[FindLocation("wr_farm_corridor")].models.always.l1 = "";
				Locations[FindLocation("wr_farm_servant")].items.randitem6 = "key8";
				Locations[FindLocation("wr_farm_servant")].items.randitem7 = "key8";
				Locations[FindLocation("wr_farm_alchemy")].items.randitem6 = "key8";

				Locations[FindLocation("wr_farm_kitchen")].locators_radius.randitem.randitem1 = 0.0001;
				Locations[FindLocation("wr_farm_bedroom")].locators_radius.randitem.randitem7 = 0.0001;
				Locations[FindLocation("wr_farm_servant")].locators_radius.randitem.randitem6 = 0.0001;
				Locations[FindLocation("wr_farm_servant")].locators_radius.randitem.randitem7 = 0.0001;
				Locations[FindLocation("wr_farm_alchemy")].locators_radius.randitem.randitem6 = 0.0001;
				Locations[FindLocation("wr_farm_alchemy2")].locators_radius.box.box17 = 0.0001;
				Locations[FindLocation("wr_farm_alchemy2")].locators_radius.box.box18 = 0.0001;
	
				Pchar.quest.distillery_items = "open";
				//Pchar.quest.farm_water = "off";
				Pchar.quest.alchemy_lever = "down";
				Pchar.quest.alchemy_plank = "up";
				Pchar.quest.apparatus_level = "glass_tube";		
				Pchar.quest.farmbooty_fillbottle = "off";
				Pchar.quest.apparatus_liquid = "none";
				Pchar.quest.apparatus_cooling = "2";
				Pchar.quest.mixtable_bottle = "ME0";
				pchar.quest.Minerva = "arrived";
				Pchar.quest.cauldron = "water";
				Pchar.quest.retort = "yes";
				Pchar.quest.block_water = "yes";
		
				//new attributes Q2
				Pchar.alchemy2_grinder = "empty";
				Pchar.use_only_big_bottle = "yes";
				Pchar.quest.qbook_receiver = "done";
				Pchar.quest.distillery_items_Q2 = "open";

				//these 4 to fake that part 1 is done
				Pchar.Q2_mix = "9";
				Pchar.postman = "arrived";
				Pchar.sloop = "arrived";
				Pchar.farm_counter = "open";		//bedroom

				pchar.quest.p2_kitchen_items.win_condition.l1 = "location";
				pchar.quest.p2_kitchen_items.win_condition.l1.location = "wr_farm_kitchen";
				pchar.quest.p2_kitchen_items.win_condition = "p2_kitchen_items";

				pchar.quest.p2_bedroom_items.win_condition.l1 = "location";
				pchar.quest.p2_bedroom_items.win_condition.l1.location = "wr_farm_bedroom";
				pchar.quest.p2_bedroom_items.win_condition = "p2_bedroom_items";

				pchar.quest.p2_booty_items.win_condition.l1 = "location";
				pchar.quest.p2_booty_items.win_condition.l1.location = "wr_farm_booty";
				pchar.quest.p2_booty_items.win_condition = "p2_booty_items";

				pchar.quest.p2_alchemy_items.win_condition.l1 = "location";
				pchar.quest.p2_alchemy_items.win_condition.l1.location = "wr_farm_alchemy";
				pchar.quest.p2_alchemy_items.win_condition = "p2_alchemy_items";

				pchar.quest.p2_alchemy2_items.win_condition.l1 = "location";
				pchar.quest.p2_alchemy2_items.win_condition.l1.location = "wr_farm_alchemy2";
				pchar.quest.p2_alchemy2_items.win_condition = "p2_alchemy2_items";

				pchar.quest.p2_servant_items.win_condition.l1 = "location";
				pchar.quest.p2_servant_items.win_condition.l1.location = "wr_farm_servant";
				pchar.quest.p2_servant_items.win_condition = "p2_servant_items";
		
		break;

		case "Minerva_alchemy2":
			LAi_SetActorType(CharacterFromID("Minerva"));
			LAi_ActorDialog(characterFromID("Minerva"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Minerva"));
			Characters[GetCharacterIndex("Minerva")].dialog.CurrentNode  = "alchemy_part2";
		break;

		case "Minerva_alchemy2_done":
			TakeNItems(pchar, "gunpowder", -100);
			TakeNItems(pchar, "pistolbullets", -100);
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE); 
			TakeItemFromCharacter(Pchar, "pistol6" );
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE); 
			TakeItemFromCharacter(Pchar, "blade11" );

			GiveItem2Character(characterFromID("Minerva"),"blade11");
			EquipCharacterByItem(characterFromID("Minerva"), "blade11");
			GiveItem2Character(characterFromID("Minerva"),"pistol6");
			EquipCharacterByItem(characterFromID("Minerva"), "pistol6");

			PlaySound("OBJECTS\DUEL\pistol_out1original.wav");
			PlaySound("VOICE\ENGLISH\Fre_f_a_012.wav");
			LAi_SetWaitressType(characterFromID("Minerva"));
		break;

		case "p2_kitchen_items":
			locations[FindLocation(pchar.location)].box1.items.pistolretort3 = 0;
			locations[FindLocation(pchar.location)].box1.items.pistolretort3 = 4;
		break;

		case "p2_bedroom_items":
			locations[FindLocation(pchar.location)].box5.items.bandages_trousersX = 0;
		break;

		case "p2_booty_items":
			locations[FindLocation(pchar.location)].box4.items.pistolretort = 0;
			locations[FindLocation(pchar.location)].box3.items.bladetop = 0;
			locations[FindLocation(pchar.location)].box2.items.pistolglass_tube = 0;
			locations[FindLocation(pchar.location)].box6.items.bladebottle_CE0 = 0;
			locations[FindLocation(pchar.location)].box5.items.bladebottle_BE0 = 0;
			locations[FindLocation(pchar.location)].box4.items.pistolretort = 15;
			locations[FindLocation(pchar.location)].box3.items.bladetop = 13;
			locations[FindLocation(pchar.location)].box2.items.pistolglass_tube = 12;
			locations[FindLocation(pchar.location)].box6.items.bladebottle_CE0 = 11;
			locations[FindLocation(pchar.location)].box5.items.bladebottle_BE0 = 8;
			locations[FindLocation(pchar.location)].box7.items.pistolbucket_dung = 0;
			locations[FindLocation(pchar.location)].box7.items.pistolstonebasket_G = 0;
			locations[FindLocation(pchar.location)].box7.items.pistolsulphur_WR = 0;
			locations[FindLocation(pchar.location)].box7.items.pistolbucket_dung = 3;
			locations[FindLocation(pchar.location)].box7.items.pistolstonebasket_G = 5;
			locations[FindLocation(pchar.location)].box7.items.pistolsulphur_WR = 4;
		break;

		case "p2_alchemy_items":
			locations[FindLocation(pchar.location)].box1.items.pistolcalciumsack = 0;
			locations[FindLocation(pchar.location)].box1.items.pistolcharcoal_WR = 0;
			locations[FindLocation(pchar.location)].box1.items.pistolcalciumsack = 4;
			locations[FindLocation(pchar.location)].box1.items.pistolcharcoal_WR = 6;
		break;

		case "p2_alchemy2_items":
			locations[FindLocation(pchar.location)].box1.items.pistolsalt = 0;
			locations[FindLocation(pchar.location)].box2.items.pistolcloth = 0;
			locations[FindLocation(pchar.location)].box3.items.pistolfunnel = 0;
			locations[FindLocation(pchar.location)].box3.items.bladebottle_CE0 = 0;
			locations[FindLocation(pchar.location)].box1.items.pistolsalt = 4;
			locations[FindLocation(pchar.location)].box2.items.pistolcloth = 6;
			locations[FindLocation(pchar.location)].box3.items.pistolfunnel = 1;
			locations[FindLocation(pchar.location)].box3.items.bladebottle_CE0 = 9;
			locations[FindLocation(pchar.location)].box19.items.myrrh = 0;
		break;

		case "p2_servant_items":
			locations[FindLocation(pchar.location)].box1.items.pistolnitre = 0;
			locations[FindLocation(pchar.location)].box1.items.pistolnitre = 3;
		break;



//sloop----------------------------------------------------------------------------------------------------------

//------------------------------------------------------------------------------------------------------------------
//gold, single bar
		case "making_gold":
			Locations[FindLocation(Pchar.location)].models.always.l16 = "goldbar";
			Locations[FindLocation("wr_farm_alchemy2")].locators_radius.box.box6 = 0.0001;
			Locations[FindLocation("wr_farm_alchemy2")].image = "";
			DoQuestReloadToLocation("wr_farm_alchemy2", "goto", "gold", "making_gold1");
		break;

		case "making_gold1":
			LAi_SetFightMode(pchar, false);
			LAi_SetStayType(Pchar);
				
			PlaySound("OBJECTS\duel\rocket.wav");
			CreateParticleSystem("rocket_fire" , -7.3, 3.8, 7.3, 5.1, 4.0, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , -7.3, 3.8, 7.3, 5.1, 4.0, 0.0, sti(20) );	//3

			Locations[FindLocation("wr_farm_alchemy2")].image = "wr_farm_alchemy2.tga";
			LAi_LocationFightDisable(&Locations[FindLocation("wr_farm_alchemy2")], true);

			LAi_QuestDelay("for_longer_rocket_fire", 0.7);
			LAi_QuestDelay("pchar_oh", 2.0);
			LAi_QuestDelay("cheer_applause", 3.0);
		break;

		case "for_longer_rocket_fire":
			CreateParticleSystem("rocket_fire" , -7.3, 3.8, 7.3, 5.1, 4.0, 0.0, sti(20) );
		break;

		case "cheer_applause":
			PlaySound("AMBIENT\cheer2.wav");

			LAi_QuestDelay("after_single_goldbar", 4.0);
		break;

		case "after_single_goldbar":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "after_single_goldbar";
			LAi_ActorSelfDialog(pchar, "");
		break;
	
	//................................................................................................
//gold, pile of bars
		case "making_more_gold":
			Locations[FindLocation(Pchar.location)].models.always.l2 = "goldbars";
			Locations[FindLocation(Pchar.location)].models.always.l3 = "goldbars_chest";
			Locations[FindLocation("wr_farm_booty2")].locators_radius.box.box5 = 0.0001;
			Locations[FindLocation("wr_farm_booty2")].image = "";
			DoQuestReloadToLocation("wr_farm_booty2", "goto", "goto1", "making_more_gold1");
		break;

		case "making_more_gold1":
			LAi_SetFightMode(pchar, false);
			LAi_SetStayType(Pchar);
				
			PlaySound("OBJECTS\duel\rocket.wav");
			CreateParticleSystem("rocket_fire" , 0.7, 1.0, 2.3, 5.1, 4.0, 0.0, sti(20) );
			CreateParticleSystem("rocket_fire" , 1.0, 1.1, 2.1, 5.1, 4.0, 0.0, sti(20) );
			CreateParticleSystem("rocket_fire" , 1.2, 1.2, 1.9, 5.1, 4.0, 0.0, sti(20) );
			CreateParticleSystem("rocket_fire" , 1.4, 1.0, 1.6, 5.1, 4.0, 0.0, sti(20) );
			CreateParticleSystem("rocket_fire" , 1.7, 1.0, 1.4, 5.1, 4.0, 0.0, sti(20) );

			CreateParticleSystem("smoke_short" , 0.7, 1.0, 2.3, 5.1, 4.0, 0.0, sti(20) );	//3
			CreateParticleSystem("smoke_short" , 1.0, 1.1, 2.1, 5.1, 4.0, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 1.2, 1.2, 1.9, 5.1, 4.0, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 1.4, 1.0, 1.6, 5.1, 4.0, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 1.7, 1.0, 1.4, 5.1, 4.0, 0.0, sti(20) );

			Locations[FindLocation("wr_farm_booty2")].image = "wr_booty.tga";
			LAi_LocationFightDisable(&Locations[FindLocation("wr_farm_booty2")], true);

			LAi_QuestDelay("for_more_longer_rocket_fire", 0.7);
			LAi_QuestDelay("for_more_longer_smoke_short", 4.0);
			LAi_QuestDelay("pchar_yah", 3.0);
			LAi_QuestDelay("fanfare", 4.0);
		break;

		case "for_more_longer_rocket_fire":
			CreateParticleSystem("rocket_fire" , 0.7, 1.0, 2.3, 5.1, 4.0, 0.0, sti(20) );
			CreateParticleSystem("rocket_fire" , 1.0, 1.1, 2.1, 5.1, 4.0, 0.0, sti(20) );
			CreateParticleSystem("rocket_fire" , 1.2, 1.2, 1.9, 5.1, 4.0, 0.0, sti(20) );
			CreateParticleSystem("rocket_fire" , 1.4, 1.0, 1.6, 5.1, 4.0, 0.0, sti(20) );
			CreateParticleSystem("rocket_fire" , 1.7, 1.0, 1.4, 5.1, 4.0, 0.0, sti(20) );
		break;

		case "for_more_longer_smoke_short":
			CreateParticleSystem("smoke_short" , 0.7, 1.0, 2.3, 5.1, 4.0, 0.0, sti(20) );	//3
			CreateParticleSystem("smoke_short" , 1.0, 1.1, 2.1, 5.1, 4.0, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 1.2, 1.2, 1.9, 5.1, 4.0, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 1.4, 1.0, 1.6, 5.1, 4.0, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 1.7, 1.0, 1.4, 5.1, 4.0, 0.0, sti(20) );
		break;

		case "fanfare":
			PlaySound("AMBIENT\SEASHORE\fanfare.wav");

			LAi_QuestDelay("after_many_goldbars", 12.0);
		break;

		case "after_many_goldbars":
			locations[FindLocation("wr_farm_alchemy2")].type = "Blackbeard_house";
			locations[FindLocation("wr_farm_booty2")].type = "Blackbeard_house";
			PostEvent("LoadSceneSound", 0.1);

			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "after_many_goldbars";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "captain_around":
			PlaySound("VOICE\ENGLISH\grandma_2.wav");

			LAi_QuestDelay("knock_on_door", 2.5);
		break;

		case "knock_on_door":
			PlaySound("INTERFACE\knock.wav");
			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("wr_farm_booty2")].reload.l1.emerge = "pchar";
			Locations[FindLocation("wr_farm_alchemy2")].models.always.locators = "TwoFloorHouse_locators_JRH0";//just to be sure

			ChangeCharacterAddressGroup(CharacterFromID("friday"), "wr_farm_alchemy2", "quest", "door1");
			ChangeCharacterAddressGroup(CharacterFromID("Dave Edna"), "wr_farm_alchemy2", "quest", "door2");
			ChangeCharacterAddressGroup(CharacterFromID("wench3"), "wr_farm_alchemy2", "quest", "stair1");
			ChangeCharacterAddressGroup(CharacterFromID("Minerva"), "wr_farm_alchemy2", "quest", "stair2");
			ChangeCharacterAddressGroup(CharacterFromID("powdermonkey"), "wr_farm_alchemy2", "quest", "monkey");
			ChangeCharacterAddressGroup(CharacterFromID("Selkirk"), "wr_farm_alchemy2", "quest", "floor3");
			ChangeCharacterAddressGroup(CharacterFromID("grandma"), "wr_farm_alchemy2", "quest", "floor1");
			ChangeCharacterAddressGroup(CharacterFromID("Defoe"), "wr_farm_alchemy2", "quest", "floor2");
			ChangeCharacterAddressGroup(CharacterFromID("Claire Voyant"), "wr_farm_alchemy2", "quest", "floor4");
		
			ChangeCharacterAddressGroup(CharacterFromID("caesar"), "wr_farm_alchemy2", "quest", "officer1");
			ChangeCharacterAddressGroup(CharacterFromID("hands"), "wr_farm_alchemy2", "quest", "officer3");
			ChangeCharacterAddressGroup(CharacterFromID("pell"), "wr_farm_alchemy2", "quest", "officer2");

			SetModel(characterFromID("grandma"), "Grandma_boss", "man", "man", 1.8, true);
			SetModel(characterFromID("Dave Edna"), "Dave_officer", "man", "man", 1.8, true);
			SetModel(characterFromID("wench3"), "Caroline_officer", "man", "man", 1.8, true);
			SetModel(characterFromID("Selkirk"), "Selkirk_officer", "man", "man", 1.8, true);
			SetModel(characterFromID("Friday"), "Friday_officer", "man", "man", 1.8, true);
			SetModel(characterFromID("hands"), "bb_hands2", "man", "man", 1.8, true);
			SetModel(characterFromID("Pell"), "bb_Pell", "man", "man", 1.8, true);
			
			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_SetActorType(CharacterFromID("Dave Edna"));
			LAi_SetActorType(CharacterFromID("wench3"));
			LAi_SetActorType(CharacterFromID("Minerva"));
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_SetActorType(CharacterFromID("Friday"));
			LAi_SetActorType(CharacterFromID("Defoe"));
			LAi_SetActorType(CharacterFromID("Claire Voyant"));
			LAi_SetActorType(CharacterFromID("caesar"));
			LAi_SetActorType(CharacterFromID("hands"));
			LAi_SetActorType(CharacterFromID("pell"));

			LAi_QuestDelay("Im_coming", 1.0);
		break;

		case "Im_coming":
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");

			pchar.quest.quest_end1.win_condition.l1 = "location";
			pchar.quest.quest_end1.win_condition.l1.location = "wr_farm_alchemy2";
			pchar.quest.quest_end1.win_condition = "quest_end1";
		break;

		case "quest_end1":
			LAi_SetActorType(Pchar);
			LAi_QuestDelay("pchar_ohoh", 1.0);

			LAi_QuestDelay("grandma_finale", 3.0);
		break;

		case "grandma_finale":
			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_ActorDialog(characterFromID("grandma"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("grandma"));
			Characters[GetCharacterIndex("grandma")].dialog.CurrentNode  = "finale";
		break;

		case "Pyle_group":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "quest", "officer3");

			LAi_QuestDelay("grandma_finale1_A", 2.0);
		break;		

		case "grandma_finale1_A":
			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_ActorDialog(characterFromID("grandma"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("grandma"));
			Characters[GetCharacterIndex("grandma")].dialog.CurrentNode  = "finale1_A";
		break;

		case "monkey_protest":
			PlaySound("OBJECTS\VOICES\DEAD\monkey\monkey_dead1.wav");

			LAi_QuestDelay("monkey_protest1", 1.0);
		break;

		case "monkey_protest1":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "quest", "monkey");
			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_ActorTurnToLocator(CharacterFromID("grandma"), "quest", "monkey");

			LAi_QuestDelay("grandma_finale2", 1.0);
		break;

		case "grandma_finale2":
			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_ActorDialog(characterFromID("grandma"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("grandma"));
			Characters[GetCharacterIndex("grandma")].dialog.CurrentNode  = "finale2";
		break;

		case "claire_platina":
			LAi_SetActorType(CharacterFromID("Claire Voyant"));
			LAi_ActorDialog(characterFromID("Claire Voyant"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Claire Voyant"));
			Characters[GetCharacterIndex("Claire Voyant")].dialog.CurrentNode  = "platina";
		break;

		case "wait_grandma_finale5":
			LAi_QuestDelay("grandma_finale5", 2.0);
		break;

		case "grandma_finale5":
			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_ActorDialog(characterFromID("grandma"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("grandma"));
			Characters[GetCharacterIndex("grandma")].dialog.CurrentNode  = "finale5";
		break;

		case "the_very_end":
			locx = stf(loadedLocation.locators.quest.turn_around.x);
       			locy = stf(loadedLocation.locators.quest.turn_around.y);
       			locz = stf(loadedLocation.locators.quest.turn_around.z);
       			locCameraToPos(locx, locy, locz, false);

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "quest", "turn_around");
			PlaySound("INTERFACE\blues_end.wav");

			LAi_QuestDelay("the_very_end1", 6.0);
			LAi_QuestDelay("the_very_end2", 10.0);
		break;

		case "the_very_end1":
			LAi_ActorAnimation(Pchar, "hands up", "_", 11.0);

			LAi_QuestDelay("pchar_sigh", 0.01);
			LAi_QuestDelay("pchar_sigh", 0.01);
		break;

		case "the_very_end2":
			Event("DoInfoShower","sl","game prepare",true);
			SetEventHandler("frame","Main_Start",1);
			InterfaceStates.Buttons.Resume.enable = false;
		break;
	
	//................................................................................................
		case "glass_on_stool_sound":
			PlaySound("PEOPLE\step_stairway2.wav");
		break;
	
		case "retort_check":
			//from itemlogic box
			if(CheckCharacterItem(Pchar,"pistolretort"))
			{
				PlaySound("INTERFACE\button2.wav");
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "pistolretort");
				return;
			}
			else LAi_QuestDelay("retort_check", 0.5);	//loops until item picked up
		break;

		case "top_check":
			//from itemlogic box
			if(CheckCharacterItem(Pchar,"bladetop"))
			{
				PlaySound("INTERFACE\button2.wav");
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladetop");
				return;
			}
			else LAi_QuestDelay("top_check", 0.5);	//loops until item picked up
		break;

		case "glass_tube_check":
			//from itemlogic box
			if(CheckCharacterItem(Pchar,"pistolglass_tube"))
			{
				PlaySound("INTERFACE\button2.wav");
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "pistolglass_tube");
				return;
			}
			else LAi_QuestDelay("glass_tube_check", 0.5);	//loops until item picked up
		break;

		case "empty_bottle_check":
			//from itemlogic box
			if(CheckCharacterItem(Pchar,"bladebottle_CE0"))
			{
				PlaySound("INTERFACE\button2.wav");
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladebottle_CE0");
				return;
			}
			else LAi_QuestDelay("empty_bottle_check", 0.5);	//loops until item picked up
		break;

		case "big_empty_bottle_check":
			//from itemlogic box
			if(CheckCharacterItem(Pchar,"bladebottle_BE0"))
			{
				PlaySound("INTERFACE\button2.wav");
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladebottle_BE0");
				return;
			}
			else LAi_QuestDelay("big_empty_bottle_check", 0.5);	//loops until item picked up
		break;

		case "champagne_bottle_check":
			//from itemlogic box
			if(CheckCharacterItem(Pchar,"bladebottle_CP2"))
			{
				PlaySound("INTERFACE\button2.wav");
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladebottle_CP2");
				return;
			}
			else LAi_QuestDelay("champagne_bottle_check", 0.5);	//loops until item picked up
		break;
//JRH autuequip alchemy items
		case "pistolbucket_dung_check":
			//from itemlogic box
			if(CheckCharacterItem(Pchar,"pistolbucket_dung"))
			{
				weaponID7 = GetCharacterEquipByGroup(Pchar,BLADE_ITEM_TYPE);
				if(weaponID7 == "") EquipCharacterByItem(Pchar, "bladeX4");
				
				PlaySound("INTERFACE\cancel.wav");
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "pistolbucket_dung");
				return;
			}
			else LAi_QuestDelay("pistolbucket_dung_check", 0.5);	//loops until item picked up
		break;

		case "pistolstonebasket_G_check":
			//from itemlogic box
			if(CheckCharacterItem(Pchar,"pistolstonebasket_G"))
			{
				weaponID7 = GetCharacterEquipByGroup(Pchar,BLADE_ITEM_TYPE);
				if(weaponID7 == "") EquipCharacterByItem(Pchar, "bladeX4");

				PlaySound("INTERFACE\cavern1.wav");
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "pistolstonebasket_G");
				return;
			}
			else LAi_QuestDelay("pistolstonebasket_G_check", 0.5);	//loops until item picked up
		break;

		case "pistolsulphur_WR_check":
			//from itemlogic box
			if(CheckCharacterItem(Pchar,"pistolsulphur_WR"))
			{
				weaponID7 = GetCharacterEquipByGroup(Pchar,BLADE_ITEM_TYPE);
				if(weaponID7 == "") EquipCharacterByItem(Pchar, "bladeX4");

				PlaySound("INTERFACE\basket.wav");
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "pistolsulphur_WR");
				return;
			}
			else LAi_QuestDelay("pistolsulphur_WR_check", 0.5);	//loops until item picked up
		break;

		case "pistolretort3_check":
			//from itemlogic box
			if(CheckCharacterItem(Pchar,"pistolretort3"))
			{
				weaponID7 = GetCharacterEquipByGroup(Pchar,BLADE_ITEM_TYPE);
				if(weaponID7 == "") EquipCharacterByItem(Pchar, "bladeX4");
				
				PlaySound("INTERFACE\button2.wav");
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "pistolretort3");
				return;
			}
			else LAi_QuestDelay("pistolretort3_check", 0.5);	//loops until item picked up
		break;

		case "pistolnitre_check":
			//from itemlogic box
			if(CheckCharacterItem(Pchar,"pistolnitre"))
			{
				weaponID7 = GetCharacterEquipByGroup(Pchar,BLADE_ITEM_TYPE);
				if(weaponID7 == "") EquipCharacterByItem(Pchar, "bladeX4");

				PlaySound("PEOPLE\clothes1.wav");
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "pistolnitre");
				return;
			}
			else LAi_QuestDelay("pistolnitre_check", 0.5);	//loops until item picked up
		break;

		case "pistolcalciumsack_check":
			//from itemlogic box
			if(CheckCharacterItem(Pchar,"pistolcalciumsack"))
			{
				weaponID7 = GetCharacterEquipByGroup(Pchar,BLADE_ITEM_TYPE);
				if(weaponID7 == "") EquipCharacterByItem(Pchar, "bladeX4");

				PlaySound("PEOPLE\clothes1.wav");
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "pistolcalciumsack");
				return;
			}
			else LAi_QuestDelay("pistolcalciumsack_check", 0.5);	//loops until item picked up
		break;

		case "pistolcharcoal_WR_check":
			//from itemlogic box
			if(CheckCharacterItem(Pchar,"pistolcharcoal_WR"))
			{
				weaponID7 = GetCharacterEquipByGroup(Pchar,BLADE_ITEM_TYPE);
				if(weaponID7 == "") EquipCharacterByItem(Pchar, "bladeX4");

				PlaySound("INTERFACE\button2.wav");
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "pistolcharcoal_WR");
				return;
			}
			else LAi_QuestDelay("pistolcharcoal_WR_check", 0.5);	//loops until item picked up
		break;

		case "pistolstonebasket_R_check":
			//from itemlogic box
			if(CheckCharacterItem(Pchar,"pistolstonebasket_R"))
			{
				weaponID7 = GetCharacterEquipByGroup(Pchar,BLADE_ITEM_TYPE);
				if(weaponID7 == "") EquipCharacterByItem(Pchar, "bladeX4");

				PlaySound("INTERFACE\cavern1.wav");
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "pistolstonebasket_R");
				return;
			}
			else LAi_QuestDelay("pistolstonebasket_R_check", 0.5);	//loops until item picked up
		break;

		case "pistolstonebasket_M_check":
			//from itemlogic box
			if(CheckCharacterItem(Pchar,"pistolstonebasket_M"))
			{
				weaponID7 = GetCharacterEquipByGroup(Pchar,BLADE_ITEM_TYPE);
				if(weaponID7 == "") EquipCharacterByItem(Pchar, "bladeX4");

				PlaySound("INTERFACE\cavern1.wav");
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "pistolstonebasket_M");
				return;
			}
			else LAi_QuestDelay("pistolstonebasket_M_check", 0.5);	//loops until item picked up
		break;

		case "pistolstonebasket_B_check":
			//from itemlogic box
			if(CheckCharacterItem(Pchar,"pistolstonebasket_B"))
			{
				weaponID7 = GetCharacterEquipByGroup(Pchar,BLADE_ITEM_TYPE);
				if(weaponID7 == "") EquipCharacterByItem(Pchar, "bladeX4");

				PlaySound("INTERFACE\cavern1.wav");
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "pistolstonebasket_B");
				return;
			}
			else LAi_QuestDelay("pistolstonebasket_B_check", 0.5);	//loops until item picked up
		break;

		case "book51_check":
			//from itemlogic box
			if(CheckCharacterItem(Pchar,"book51"))
			{
				SetQuestHeader("Alchemy_tutorial");
				AddQuestRecord("Alchemy_tutorial", "1");
				return;
			}
			else LAi_QuestDelay("champagne_bottle_check", 0.5);	//loops until item picked up
		break;

	//................................................................................................
		case "farm_running_water":
			if(CheckAttribute(Pchar,"quest.farm_water") && Pchar.quest.farm_water == "off")
			{
				return;
			}
			else
			{
				PlaySound("INTERFACE\running_water_short.wav");

				LAi_QuestDelay("farm_running_water", 1.1);
			}
		break;
	//................................................................................................
		case "farm_fill_waterbottle":
			PlaySound("AMBIENT\TAVERN\tinkle1.wav");

			LAi_QuestDelay("farm_fill_waterbottle1", 3.0);
		break;

		case "farm_fill_waterbottle1":
			Pchar.quest.farmbooty_fillbottle = "off";
			PlaySound("AMBIENT\TAVERN\open_bottle.wav");
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladebottle_CE0");
			GiveItem2Character(Pchar,"bladebottle_CW1");
			EquipCharacterByItem(Pchar, "bladebottle_CW1");
			LAi_SetPlayerType(Pchar);
		break;
	//................................................................................................
		case "farm_fill_cauldron_booty":
			PlaySound("INTERFACE\water_tap.wav");

			LAi_QuestDelay("farm_fill_cauldron_booty1", 0.5);
		break;


		case "farm_fill_cauldron_booty1":
			PlaySound("INTERFACE\running_water.wav");

			LAi_QuestDelay("farm_fill_cauldron_booty2", 3.0);
		break;

		case "farm_fill_cauldron_booty2":
			Pchar.quest.farmbooty_fillbottle = "off";
			PlaySound("INTERFACE\rum_barrel_filled.wav");
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladecauldron");
			GiveItem2Character(Pchar,"bladecauldron_w");
			EquipCharacterByItem(Pchar, "bladecauldron_w");
			LAi_SetPlayerType(Pchar);
		break;
	//................................................................................................
		case "alchemy_bars_up":
			Locations[FindLocation("wr_farm_alchemy")].image = "";

			DoQuestReloadToLocation("wr_farm_alchemy", "goto", "box2", "alchemy_bars_up1");
		break;

		case "alchemy_bars_up1":
			PlaySound("INTERFACE\rusty.wav");

			LAi_QuestDelay("alchemy_plank_sound_down", 1.5);
		break;

		case "alchemy_plank_sound_down":
			Locations[FindLocation("wr_farm_alchemy")].image = "wr_farm_alchemy.tga";
			PlaySound("PEOPLE\basket.wav");
		break;

		case "alchemy_bars_down":
			Locations[FindLocation("wr_farm_alchemy")].image = "";

			DoQuestReloadToLocation("wr_farm_alchemy", "goto", "box2", "alchemy_bars_down1");
		break;

		case "alchemy_bars_down1":
			PlaySound("INTERFACE\klonk.wav");

			LAi_QuestDelay("alchemy_plank_sound_up", 1.0);
		break;

		case "alchemy_plank_sound_up":
			Locations[FindLocation("wr_farm_alchemy")].image = "wr_farm_alchemy.tga";
			PlaySound("PEOPLE\creak2.wav");
		break;

		case "alchemy_plank_oxygen":
			LAi_SetPlayerType(Pchar);
			PlaySound("INTERFACE\oxygen.wav");

			LAi_QuestDelay("alchemy_plank_down", 1.0);
		break;

		case "alchemy_plank_down":
		//	LogIt("apparatus_cooling = " + Pchar.quest.apparatus_cooling);
		//	LogIt("apparatus_level = " + Pchar.quest.apparatus_level);
		//	LogIt("cauldron = " + Pchar.quest.cauldron);
		//	LogIt("lab_position = " + Pchar.quest.lab_position);
		//	LogIt("retort = " + Pchar.quest.retort);

			if(Locations[FindLocation(Pchar.location)].models.always.locators == "mediumhouse01_locators_JRH2")
			{
				if(CheckAttribute(Pchar, "quest.apparatus_level"))
				{
					if(Pchar.quest.apparatus_level == "start" || Pchar.quest.apparatus_level == "cauldron")
					{
						return;
					}
					else
					{
						LAi_QuestDelay("alchemy_glass_explosion", 0.01);
						return;
					}
				}
			}

			if(Locations[FindLocation(Pchar.location)].models.always.locators == "mediumhouse01_locators_JRH1")
			{
				if(CheckAttribute(Pchar,"quest.apparatus_cooling") && Pchar.quest.apparatus_cooling == "3")
				{
					Locations[FindLocation(Pchar.location)].models.always.locators = "mediumhouse01_locators_JRH2";
					Locations[FindLocation("wr_farm_alchemy")].image = "";

					DoQuestReloadToLocation("wr_farm_alchemy", "goto", "box3", "alchemy_plank_down1");
				}
				else
				{
					if(CheckAttribute(Pchar, "quest.apparatus_level"))
					{
						if(Pchar.quest.apparatus_level == "start")
						{
							Locations[FindLocation(Pchar.location)].models.always.locators = "mediumhouse01_locators_JRH2";
							Locations[FindLocation("wr_farm_alchemy")].image = "";

							DoQuestReloadToLocation("wr_farm_alchemy", "goto", "box3", "alchemy_plank_down1");
						}
						else
						{
							if(Pchar.quest.apparatus_level == "cauldron")
							{
								if(CheckAttribute(Pchar, "quest.cauldron") && Pchar.quest.cauldron == "water")
								{
									Locations[FindLocation(Pchar.location)].models.always.locators = "mediumhouse01_locators_JRH2";
									LAi_QuestDelay("alchemy_boiling_loop", 0.1);
									Locations[FindLocation("wr_farm_alchemy")].image = "";

									DoQuestReloadToLocation("wr_farm_alchemy", "goto", "box3", "alchemy_plank_down1");
								}
								else
								{
									Locations[FindLocation(Pchar.location)].models.always.locators = "mediumhouse01_locators_JRH2";
									Locations[FindLocation("wr_farm_alchemy")].image = "";

									DoQuestReloadToLocation("wr_farm_alchemy", "goto", "box3", "alchemy_plank_down1");
								}
							}
						}
						else
						{
							LAi_QuestDelay("alchemy_glass_explosion", 0.01);
							return;
						}
					}
				}
			}

			if(Locations[FindLocation(Pchar.location)].models.always.locators == "mediumhouse01_locators_JRH0")
			{
				if(CheckAttribute(Pchar,"quest.apparatus_cooling") )
				{
					if(Pchar.quest.apparatus_cooling == "2" || Pchar.quest.apparatus_cooling == "3")
					{
						Locations[FindLocation(Pchar.location)].models.always.locators = "mediumhouse01_locators_JRH1";
						Locations[FindLocation("wr_farm_alchemy")].image = "";

						DoQuestReloadToLocation("wr_farm_alchemy", "goto", "box3", "alchemy_plank_down1");
					}
					else
					{
						if(CheckAttribute(Pchar, "quest.apparatus_level"))
						{
							if(Pchar.quest.apparatus_level == "start" || Pchar.quest.apparatus_level == "cauldron")
							{
								Locations[FindLocation(Pchar.location)].models.always.locators = "mediumhouse01_locators_JRH1";
								Locations[FindLocation("wr_farm_alchemy")].image = "";

								DoQuestReloadToLocation("wr_farm_alchemy", "goto", "box3", "alchemy_plank_down1");
							}
							else
							{
								LAi_QuestDelay("alchemy_glass_explosion", 0.01);
								return;
							}
						}
					}
				}
			}


		break;

		case "alchemy_plank_down1":
			Locations[FindLocation("wr_farm_alchemy")].image = "wr_farm_alchemy.tga";

			if(Locations[FindLocation(Pchar.location)].models.always.locators == "mediumhouse01_locators_JRH1")
			{
				PlaySound("INTERFACE\fire_on.wav");

				LAi_QuestDelay("alchemy_fire_low", 1.0);
			}

			if(Locations[FindLocation("wr_farm_alchemy")].models.always.locators == "mediumhouse01_locators_JRH2")
			{
				LAi_QuestDelay("alchemy_fire_high", 0.1);


				if(CheckAttribute(Pchar, "quest.apparatus_level"))
				{
					if(Pchar.quest.apparatus_level == "empty_bottle" || Pchar.quest.apparatus_level == "glass_tube" || Pchar.quest.apparatus_level == "top" || Pchar.quest.apparatus_level == "retort")
					LAi_QuestDelay("alchemy_distill", 0.01);
				}
			}

			LAi_QuestDelay("alchemy_plank_sound_up", 1.0);
		break;

		case "alchemy_fire_low":
			if(Pchar.location == "wr_farm_alchemy")
			{
				if(Locations[FindLocation("wr_farm_alchemy")].models.always.locators == "mediumhouse01_locators_JRH1")
				{
					PlaySound3D("NATURE\fireplace2.wav", 1.4, 0.77, 0.89);
					LAi_QuestDelay("alchemy_fire_low", 5.0);
				}
				else return;
			}
			else return;
		break;

		case "alchemy_fire_high":
			if(Pchar.location == "wr_farm_alchemy")
			{
				if(Locations[FindLocation("wr_farm_alchemy")].models.always.locators == "mediumhouse01_locators_JRH2")
				{
					PlaySound3D("NATURE\fireplace3.wav", 1.4, 0.77, 0.89);
					LAi_QuestDelay("alchemy_fire_high", 4.8);
				}
				else return;
			}
			else return;
		break;

		case "alchemy_boiling_loop":
			if(Pchar.location == "wr_farm_alchemy")
			{
				if(Locations[FindLocation("wr_farm_alchemy")].models.always.locators == "mediumhouse01_locators_JRH2")
				{
					PlaySound("INTERFACE\rumble1.wav");
					LAi_QuestDelay("alchemy_boiling_loop", 5.0);
				}
				else return;
			}
			else return;
		break;

		case "alchemy_glass_explosion":
			Pchar.quest.apparatus_level = "glass_explosion";
			PauseAllSounds();
			Locations[FindLocation("wr_farm_alchemy")].models.always.l10 = "";	//retort
			Locations[FindLocation("wr_farm_alchemy")].models.always.l11 = "";	//top
			Locations[FindLocation("wr_farm_alchemy")].models.always.l12 = "";	//glass_tube
			Locations[FindLocation("wr_farm_alchemy")].models.always.l13 = "";	//empty_bottle

			if(CheckAttribute(Pchar, "quest.apparatus_liquid") && Pchar.quest.apparatus_liquid != "none")
			{
				Locations[FindLocation("wr_farm_alchemy")].models.always.locators = "mediumhouse01_locators_JRH0";
			}

			Locations[FindLocation("wr_farm_alchemy")].image = "";
			DoQuestReloadToLocation("wr_farm_alchemy", "goto", "box3", "alchemy_glass_explosion1");
		break;

		case "alchemy_glass_explosion1":
			PlaySound("INTERFACE\glass_explosion.wav");
			LAi_SetPoorType(Pchar);
			LAi_ApplyCharacterDamage(Pchar, 20);

			string weaponID5 = GetCharacterEquipByGroup(Pchar,BLADE_ITEM_TYPE);
			aref weapon5;
			Items_FindItem(weaponID5, &weapon5);

			string weaponID6 = GetCharacterEquipByGroup(Pchar,GUN_ITEM_TYPE);
			aref weapon6;
			Items_FindItem(weaponID6, &weapon6);

			if(CheckAttribute(weapon5, "id"))
			{
				if(weapon5.id == "bladebottle_CE0" || weapon5.id == "bladebottle_CW1" || weapon5.id == "bladebottle_CT1_sulf"
				|| weapon5.id == "bladebottle_CT1_nitr" || weapon5.id == "bladebottle_CT1_hydr" || weapon5.id == "bladebottle_CT1_hydrnitr"
				|| weapon5.id == "bladebottle_CT2_sulf_w" || weapon5.id == "bladebottle_CT2_sulf_c" || weapon5.id == "bladebottle_CT2_hydr"
				|| weapon5.id == "bladebottle_CT2_hydrnitr" || weapon5.id == "bladebottle_CA2" || weapon5.id == "bladebottle_CG2"
				|| weapon5.id == "bladebottle_CP2" || weapon5.id == "bladetop" || weapon5.id == "bladebottle_CT2_nitr_w"
				|| weapon5.id == "bladebottle_CB1")
				{
					RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
					TakeNItems(Pchar, weaponID5, -20);
					EquipCharacterByItem(Pchar, "bladeX4");
				}
			}

			if(CheckAttribute(weapon6, "id"))
			{
				if(weapon6.id == "pistolretort" || weapon6.id == "pistolglass_tube")
				{
					RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
					TakeNItems(Pchar, weaponID6, -20);
					EquipCharacterByItem(Pchar, "pistolhand");
				}
			}

			CreateParticleSystem("blast_dirt" , 0.97, 0.5, 0.43, 0.0, 0.0, 0.0, sti(20) );

			CreateParticleSystem("splinters", 1.43, 0.8, 0.9, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 1.43, 0.8, 0.9, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", 1.43, 0.8, 0.7, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 1.43, 0.8, 0.7, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", 1.43, 0.8, 1.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 1.43, 0.8, 1.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", 0.97, 0.5, 0.43, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 0.97, 0.5, 0.43, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", 1.1, 0.6, 1.2, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 1.1, 0.6, 1.2, 0.0, 0.0, 0.0, 0);

			CreateParticleSystem("splinters", 1.43, 0.8, 0.9, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 1.43, 0.8, 0.9, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", 1.43, 0.8, 0.7, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 1.43, 0.8, 0.7, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", 1.43, 0.8, 1.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 1.43, 0.8, 1.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", 0.97, 0.5, 0.43, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 0.97, 0.5, 0.43, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", 1.1, 0.6, 1.2, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 1.1, 0.6, 1.2, 0.0, 0.0, 0.0, 0);

			CreateParticleSystem("splinters", 1.43, 0.8, 0.9, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 1.43, 0.8, 0.9, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", 1.43, 0.8, 0.7, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 1.43, 0.8, 0.7, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", 1.43, 0.8, 1.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 1.43, 0.8, 1.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", 0.97, 0.5, 0.43, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 0.97, 0.5, 0.43, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", 1.1, 0.6, 1.2, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 1.1, 0.6, 1.2, 0.0, 0.0, 0.0, 0);

			CreateParticleSystem("splinters", 1.43, 0.8, 0.9, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 1.43, 0.8, 0.9, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", 1.43, 0.8, 0.7, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 1.43, 0.8, 0.7, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", 1.43, 0.8, 1.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 1.43, 0.8, 1.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", 0.97, 0.5, 0.43, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 0.97, 0.5, 0.43, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", 1.1, 0.6, 1.2, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 1.1, 0.6, 1.2, 0.0, 0.0, 0.0, 0);

			if(CheckAttribute(Pchar, "quest.apparatus_liquid") && Pchar.quest.apparatus_liquid != "none")
			{
				CreateParticleSystem("smoke_inv_short" , 0.7, 0.8, 0.9, 5.0, 1.5, 0.0, sti(20) );
			}

			LAi_QuestDelay("alchemy_glass_explosion2", 2.4);
		break;

		case "alchemy_glass_explosion2":
			if(CheckAttribute(Pchar, "quest.apparatus_liquid") && Pchar.quest.apparatus_liquid != "none")
			{
				CreateParticleSystem("smoke_inv_short" , 0.7, 0.8, 0.9, 5.0, 1.5, 0.0, sti(20) );
			}

			PlaySound("OBJECTS\VOICES\DEAD\male\dead7.wav");

			LAi_QuestDelay("alchemy_glass_explosion3", 5.1);
		break;

		case "alchemy_glass_explosion3":
			if(CheckAttribute(Pchar, "quest.apparatus_liquid") && Pchar.quest.apparatus_liquid != "none")
			{
				PlaySound("AMBIENT\JAIL\cough.wav");
			}
			else Pchar.quest.retort_was_empty = "yes";

			Pchar.quest.apparatus_level = "cauldron";
			Pchar.quest.apparatus_liquid = "none";

			if(CheckAttribute(Pchar, "quest.cauldron") && Pchar.quest.cauldron == "water")
			{
				Pchar.quest.apparatus_cooling = "2";
			}
			else Pchar.quest.apparatus_cooling = "1";
//no Minerva Q2
			if(CheckAttribute(Pchar,"quest.distillery_items_Q2") && Pchar.quest.distillery_items_Q2 == "open")
			{
				//it's quest 2
				LAi_SetPlayerType(Pchar);
			}
			else
			{
				LAi_SetStayType(Pchar);

				LAi_QuestDelay("alchemy_glass_explosion4", 1.0);
			}
		break;

		case "alchemy_glass_explosion4":
			PlaySound("INTERFACE\closet_open.wav");
			ChangeCharacterAddressGroup(characterFromID("Minerva"), "wr_farm_alchemy", "reload", "reload1");
			LAi_SetStayType(characterFromID("Minerva"));

			LAi_QuestDelay("alchemy_glass_explosion5", 1.0);
		break;

		case "alchemy_glass_explosion5":
			LAi_SetActorType(characterFromID("Minerva"));
			LAi_ActorDialog(characterFromID("Minerva"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Minerva"));
			Characters[GetCharacterIndex("Minerva")].dialog.CurrentNode  = "distill_explosion";
		break;

		case "after_alchemy_glass_explosion":
			//from Minerva dialog
			LAi_SetPlayerType(Pchar);

			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(characterFromID("Minerva"), "wr_farm_booty", "waitress", "barmen");
			LAi_SetWaitressType(characterFromID("Minerva"));
		break;

	//................................................................................................
		case "fill_apparatus_with_liquid":
			PlaySound("AMBIENT\TAVERN\tinkle1.wav");
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			if(CheckAttribute(Pchar, "quest.apparatus_liquid") && Pchar.quest.apparatus_liquid == "G2") TakeItemFromCharacter(Pchar, "bladebottle_CG2");
			if(CheckAttribute(Pchar, "quest.apparatus_liquid") && Pchar.quest.apparatus_liquid == "T2_sulf_c") TakeItemFromCharacter(Pchar, "bladebottle_CT2_sulf_c");
			if(CheckAttribute(Pchar, "quest.apparatus_liquid") && Pchar.quest.apparatus_liquid == "P2") TakeItemFromCharacter(Pchar, "bladebottle_CP2");
			GiveItem2Character(Pchar,"bladebottle_CE0");
			EquipCharacterByItem(Pchar, "bladebottle_CE0");

			LAi_QuestDelay("place_distillery_item", 3.0);
		break;

		case "fill_apparatus_with_liquid_big_bottle":
			PlaySound("AMBIENT\TAVERN\tinkle1.wav");
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			if(CheckAttribute(Pchar, "quest.apparatus_liquid") && Pchar.quest.apparatus_liquid == "Y2") TakeItemFromCharacter(Pchar, "bladebottle_BY2_mix7");
			GiveItem2Character(Pchar,"bladebottle_BY1_mix7");
			EquipCharacterByItem(Pchar, "bladebottle_BY1_mix7");

			LAi_QuestDelay("place_distillery_item", 3.0);
		break;

		case "fill_apparatus_with_liquid_big_bottle2":
			PlaySound("AMBIENT\TAVERN\tinkle1.wav");
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			if(CheckAttribute(Pchar, "quest.apparatus_liquid") && Pchar.quest.apparatus_liquid == "Y2") TakeItemFromCharacter(Pchar, "bladebottle_BY1_mix7");
			GiveItem2Character(Pchar,"bladebottle_BE0");
			EquipCharacterByItem(Pchar, "bladebottle_BE0");

			LAi_QuestDelay("place_distillery_item", 3.0);
		break;
	//................................................................................................
		case "alchemy_distill":
			LAi_SetStayType(Pchar);
			//delay only

			if(CheckAttribute(Pchar, "quest.apparatus_level") && Pchar.quest.apparatus_level == "glass_explosion")
			{
				return;
			}
			else
			{
				PlaySound("INTERFACE\rumble1.wav");
				LAi_QuestDelay("alchemy_distill1", 5.0);
			}
		break;
//JRH distill
		case "alchemy_distill1":
			if(CheckAttribute(Pchar, "quest.apparatus_level") )
			{
				if(Pchar.quest.apparatus_level == "glass_explosion")
				{
					return;
				}

				if(Pchar.quest.apparatus_level == "empty_bottle")
				{
					//this is the ok distill process

					PlaySound("INTERFACE\rumble1.wav");

					if(CheckAttribute(Pchar, "quest.apparatus_liquid") && Pchar.quest.apparatus_liquid == "Y2")
					{

					}
					else
					{
						PlaySound("AMBIENT\CAVE\drop7.wav");

						LAi_QuestDelay("alchemy_distill_drop", 1.0);
					}

					LAi_QuestDelay("alchemy_distill2", 5.0);
				}

				if(Pchar.quest.apparatus_level == "glass_tube")
				{
					PlaySound("INTERFACE\rumble1.wav");
					PlaySound("INTERFACE\steam1.wav");
					CreateParticleSystem("smoke_short" , 0.8, 0.8, 0.4, 5.0, 1.5, 0.0, sti(20) );

					LAi_QuestDelay("alchemy_wrong_distill", 5.0);
				}

				if(Pchar.quest.apparatus_level == "top")
				{
					PlaySound("INTERFACE\rumble1.wav");
					PlaySound("INTERFACE\steam1.wav");
					CreateParticleSystem("smoke_short" , 1.1, 1.1, 0.7, 6.0, 1.5, 0.0, sti(20) );

					LAi_QuestDelay("alchemy_wrong_distill", 5.0);
				}

				if(Pchar.quest.apparatus_level == "retort")
				{
					PlaySound("INTERFACE\rumble1.wav");
					PlaySound("INTERFACE\steam1.wav");
					CreateParticleSystem("smoke_short" , 1.2, 1.2, 0.8, 6.0, 1.5, 0.0, sti(20) );

					LAi_QuestDelay("alchemy_wrong_distill", 5.0);
				}
			}
		break;

		case "alchemy_distill2":
			if(CheckAttribute(Pchar, "quest.apparatus_level") && Pchar.quest.apparatus_level == "glass_explosion")
			{
				return;
			}
			else
			{
				PlaySound("INTERFACE\rumble1.wav");
				PlaySound("INTERFACE\bubbles2.wav");

				if(CheckAttribute(Pchar, "quest.apparatus_liquid") && Pchar.quest.apparatus_liquid == "Y2")
				{

				}
				else
				{
					PlaySound("AMBIENT\CAVE\drop7.wav");

					LAi_QuestDelay("alchemy_distill_drop", 1.0);
				}

				LAi_QuestDelay("alchemy_distill3", 5.0);
			}
		break;
//JRH distill Q2
		case "alchemy_distill3":
			if(CheckAttribute(Pchar, "quest.apparatus_level") && Pchar.quest.apparatus_level == "glass_explosion")
			{
				return;
			}
			else
			{
				if(CheckAttribute(Pchar, "quest.apparatus_liquid") && Pchar.quest.apparatus_liquid == "G2")
				{
					Locations[FindLocation("wr_farm_alchemy")].models.always.l13 = "bottle_FT1_sulf";
				}
				if(CheckAttribute(Pchar, "quest.apparatus_liquid") && Pchar.quest.apparatus_liquid == "T2_sulf_c")
				{
					Locations[FindLocation("wr_farm_alchemy")].models.always.l13 = "bottle_FT1_nitr";
				}
				if(CheckAttribute(Pchar, "quest.apparatus_liquid") && Pchar.quest.apparatus_liquid == "P2")
				{
					Locations[FindLocation("wr_farm_alchemy")].models.always.l13 = "bottle_FB1";
				}
				if(CheckAttribute(Pchar, "quest.apparatus_liquid") && Pchar.quest.apparatus_liquid == "Y2")
				{
					Locations[FindLocation("wr_farm_alchemy")].models.always.l13 = "bottle_FG2";
				}

				Locations[FindLocation("wr_farm_alchemy")].models.always.l10 = "retort_E0";
				Locations[FindLocation("wr_farm_alchemy")].models.always.locators = "mediumhouse01_locators_JRH1";

				if(CheckAttribute(Pchar, "quest.apparatus_level") && Pchar.quest.apparatus_level == "glass_explosion")
				{
					return;
				}
				else
				{
					Locations[FindLocation("wr_farm_alchemy")].image = "";
					DoQuestReloadToLocation("wr_farm_alchemy", "goto", "box3", "alchemy_distill4");
				}
			}
		break;

		case "alchemy_distill4":
			Locations[FindLocation("wr_farm_alchemy")].image = "wr_farm_alchemy.tga";

			if(CheckAttribute(Pchar, "quest.apparatus_level") && Pchar.quest.apparatus_level == "glass_explosion")
			{
				return;
			}
			else
			{
				LAi_SetPlayerType(Pchar);
				Pchar.quest.apparatus_level = "finished";
				Pchar.quest.apparatus_cooling = "2";

				if(CheckAttribute(Pchar, "quest.apparatus_liquid") && Pchar.quest.apparatus_liquid == "Y2")
				{
					PlaySound("INTERFACE\steam1.wav");

					LAi_QuestDelay("alchemy_distill_comment", 3.0);
				}
				else
				{
					PlaySound("AMBIENT\CAVE\drop8.wav");
					PlaySound("AMBIENT\TAVERN\tinkle1.wav");

					LAi_QuestDelay("alchemy_distill_drop1", 0.5);
				}
			}
		break;

		case "alchemy_distill_drop":
			if(CheckAttribute(Pchar, "quest.apparatus_level") && Pchar.quest.apparatus_level == "glass_explosion")
			{
				return;
			}
			else
			{
				PlaySound("AMBIENT\CAVE\drop8.wav");

				LAi_QuestDelay("alchemy_distill_drop1", 0.5);
			}
		break;

		case "alchemy_distill_drop1":
			if(CheckAttribute(Pchar, "quest.apparatus_level") && Pchar.quest.apparatus_level == "glass_explosion")
			{
				return;
			}
			else
			{
				PlaySound("AMBIENT\CAVE\drop9.wav");

				LAi_QuestDelay("alchemy_distill_drop2", 1.0);
			}
		break;

		case "alchemy_distill_drop2":
			if(CheckAttribute(Pchar, "quest.apparatus_level") && Pchar.quest.apparatus_level == "glass_explosion")
			{
				return;
			}
			else
			{
				PlaySound("AMBIENT\CAVE\drop10.wav");

				LAi_QuestDelay("alchemy_distill_drop3", 0.5);
			}
		break;

		case "alchemy_distill_drop3":
			if(CheckAttribute(Pchar, "quest.apparatus_level") && Pchar.quest.apparatus_level == "glass_explosion")
			{
				return;
			}
			else
			{
				PlaySound("AMBIENT\CAVE\drop8.wav");
				LAi_QuestDelay("alchemy_distill_comment", 1.0);
			}
		break;

		case "alchemy_distill_comment":
			if(Locations[FindLocation("wr_farm_alchemy")].models.always.l13 == "bottle_FB1")
			{
				Logit(LanguageConvertString(tmpLangFileID,"It smells like Pure Alcohol."));
				PlaySound("VOICE\ENGLISH\blaze_hah.wav");
			}
			if(Locations[FindLocation("wr_farm_alchemy")].models.always.l13 == "bottle_FT1_sulf")
			{
				Logit(LanguageConvertString(tmpLangFileID,"It smells like Sulfuric Acid."));
				PlaySound("VOICE\ENGLISH\blaze_hah.wav");
			}
			if(Locations[FindLocation("wr_farm_alchemy")].models.always.l13 == "bottle_FT1_nitr")
			{
				Logit(LanguageConvertString(tmpLangFileID,"It smells like Nitric Acid."));
				PlaySound("VOICE\ENGLISH\blaze_hah.wav");
			}
			if(Locations[FindLocation("wr_farm_alchemy")].models.always.l13 == "bottle_FG2")
			{
				Logit(LanguageConvertString(tmpLangFileID,"It's gas in the bottle."));
				PlaySound("VOICE\ENGLISH\blaze_hah.wav");
			}
		break;
	//................................................................................................
		case "alchemy_wrong_distill":
			Pchar.quest.apparatus_liquid = "none";
			Locations[FindLocation("wr_farm_alchemy")].models.always.l10 = "retort_E0";
			Pchar.quest.apparatus_cooling = "2";
			Locations[FindLocation("wr_farm_alchemy")].models.always.locators = "mediumhouse01_locators_JRH1";

			Locations[FindLocation("wr_farm_alchemy")].image = "";
			DoQuestReloadToLocation("wr_farm_alchemy", "goto", "box3", "alchemy_wrong_distill_1");
		break;

		case "alchemy_wrong_distill_1":
			if(CheckAttribute(Pchar, "quest.apparatus_level") && Pchar.quest.apparatus_level == "glass_tube")
				CreateParticleSystem("smoke_short" , 0.8, 0.8, 0.4, 5.0, 1.5, 0.0, sti(20) );

			if(CheckAttribute(Pchar, "quest.apparatus_level") && Pchar.quest.apparatus_level == "top")
				CreateParticleSystem("smoke_short" , 1.1, 1.1, 0.7, 6.0, 1.5, 0.0, sti(20) );

			if(CheckAttribute(Pchar, "quest.apparatus_level") && Pchar.quest.apparatus_level == "retort")
				CreateParticleSystem("smoke_short" , 1.2, 1.2, 0.8, 6.0, 1.5, 0.0, sti(20) );

			PlaySound("INTERFACE\steam1.wav");
			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("wr_farm_alchemy")].image = "wr_farm_alchemy.tga";

			LAi_QuestDelay("pchar_ooh", 5.0);
		break;
	//................................................................................................
		case "stay_at_mixtable":
			//from itemlogic wr_farm_alchemy box5
			if(!LAi_IsFightMode(Pchar))
			{
				Pchar.quest.lab_position = "elsewhere";			//reset
				ChangeCharacterAddressGroup(Pchar, "wr_farm_alchemy", "goto", "mixtable");
				LAi_LocationFightDisable(&Locations[FindLocation("wr_farm_alchemy")], true);
			}
			else LAi_QuestDelay("stay_at_mixtable", 1.0);//loops until not fightmode
		break;

		case "stay_at_mixtableL":
			//from itemlogic wr_farm_alchemy box7
			if(!LAi_IsFightMode(Pchar))
			{
				Pchar.quest.lab_position = "elsewhere";			//reset
				ChangeCharacterAddressGroup(Pchar, "wr_farm_alchemy", "goto", "mixtableL");
				LAi_LocationFightDisable(&Locations[FindLocation("wr_farm_alchemy")], true);
			}
			else LAi_QuestDelay("stay_at_mixtableL", 1.0);//loops until not fightmode
		break;

		case "place_mixtable_item":
			Locations[FindLocation("wr_farm_alchemy")].image = "";
			DoQuestReloadToLocation("wr_farm_alchemy", "goto", "mixtable", "wr_farm_loadingimage_back");
		break;

		case "place_mixtableL_item":
			Locations[FindLocation("wr_farm_alchemy")].image = "";
			DoQuestReloadToLocation("wr_farm_alchemy", "goto", "mixtableL", "wr_farm_loadingimage_back");
		break;
	//................................................................................................
		case "alchemy_acid_boiling":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead1.wav");

			PlaySound("INTERFACE\bubbles2.wav");
			CreateParticleSystem("smoke_short" , -2.1, 1.4, -2.4, 4.5, 1.5, 0.0, sti(20) );
			LAi_SetFightMode(pchar, false);
			LAi_LocationFightDisable(&Locations[FindLocation("wr_farm_alchemy")], true);
			LAi_tmpl_ani_PlayAnimation(Pchar, "afraid", 5.0);

			LAi_QuestDelay("alchemy_acid_boiling1", 5.0);
		break;

		case "alchemy_acid_boiling1":
			Locations[FindLocation("wr_farm_alchemy")].models.always.l5 = "bottle_ME0";	//mixtable, liquid boiled up
			Pchar.quest.mixtable_bottle = "ME0";
			Locations[FindLocation("wr_farm_alchemy")].image = "";
			DoQuestReloadToLocation("wr_farm_alchemy", "goto", "mixtable", "alchemy_acid_boiling2");
		break;

		case "alchemy_acid_boiling2":
			LAi_SetActorType(Pchar);
			LAi_ActorAfraid(Pchar, Pchar, false);
			LAi_SetPlayerType(Pchar);
			PlaySound("OBJECTS\VOICES\DEAD\male\dead0.wav");

			LAi_ApplyCharacterDamage(Pchar, 10);
			Locations[FindLocation("wr_farm_alchemy")].image = "wr_farm_alchemy.tga";
		break;
	//................................................................................................
		case "alchemy_acid_small_boiling":
			//one time effect - no loop
			CreateParticleSystem("smoke_short" , -2.1, 1.4, -2.4, 4.5, 1.5, 0.0, sti(20) );
			PlaySound("INTERFACE\gas_on.wav");

			LAi_QuestDelay("alchemy_acid_small_boiling1", 3.0);
			LAi_QuestDelay("alchemy_acid_small_boiling2", 5.0);	
		break;
//JRH small boil
		case "alchemy_acid_small_boiling1":
			CreateParticleSystem("smoke_short" , -2.1, 1.4, -2.4, 4.5, 1.5, 0.0, sti(20) );	
		break;

		case "alchemy_acid_small_boiling2":
			PlaySound("OBJECTS\DUEL\man_attack6.wav");
			Logit(LanguageConvertString(tmpLangFileID,"I have made Sulfur Auretum!"));
			Logit(LanguageConvertString(tmpLangFileID,"Let's keep it on the table."));
		break;
	//................................................................................................
		case "alchemy_acid_explosion":
			PauseAllSounds();
			Locations[FindLocation("wr_farm_alchemy")].models.always.l5 = "";	//mixtable
			LAi_SetFightMode(pchar, false);
			LAi_LocationFightDisable(&Locations[FindLocation("wr_farm_alchemy")], true);

			Locations[FindLocation("wr_farm_alchemy")].image = "";
			DoQuestReloadToLocation("wr_farm_alchemy", "goto", "mixtable", "alchemy_acid_explosion1");
		break;

		case "alchemy_acid_explosion1":
			PlaySound("INTERFACE\glass_explosion.wav");
			PlaySound("OBJECTS\DUEL\pistol_musket.wav");

			LAi_SetActorType(Pchar);
			LAi_ActorSetLayMode(Pchar);
			LAi_ApplyCharacterDamage(Pchar, 40);

			//all pchar glass items are also demolished:
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeNItems(Pchar, "bladebottle_CE0", -20);
			TakeNItems(Pchar, "bladebottle_CB1", -20);
			TakeNItems(Pchar, "bladebottle_CW1", -20);
			TakeNItems(Pchar, "bladebottle_CT1_sulf", -20);
			TakeNItems(Pchar, "bladebottle_CT1_nitr", -20);
			TakeNItems(Pchar, "bladebottle_CT1_hydr", -20);
			TakeNItems(Pchar, "bladebottle_CT1_hydrnitr", -20);
			TakeNItems(Pchar, "bladebottle_CT2_sulf_w", -20);
			TakeNItems(Pchar, "bladebottle_CT2_sulf_c", -20);
			TakeNItems(Pchar, "bladebottle_CT2_hydr", -20);
			TakeNItems(Pchar, "bladebottle_CT2_hydrnitr", -20);
			TakeNItems(Pchar, "bladebottle_CA2", -20);
			TakeNItems(Pchar, "bladebottle_CG2", -20);
			TakeNItems(Pchar, "bladebottle_CP2", -20);
			TakeNItems(Pchar, "cognac", -20);
			TakeNItems(Pchar, "bladetop", -20);
			EquipCharacterByItem(Pchar, "bladeX4");

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			TakeNItems(Pchar, "pistolretort", -20);
			TakeNItems(Pchar, "pistolglass_tube", -20);
			EquipCharacterByItem(Pchar, "pistolhand");

			CreateParticleSystem("blast_dirt" , -2.1, 1.4, -2.4, 0.0, 0.0, 0.0, sti(20) );

			CreateParticleSystem("splinters", -2.1, 1.4, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -2.1, 1.4, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", -2.4, 1.4, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -2.4, 1.4, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", -1.8, 1.4, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -1.8, 1.4, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", -2.1, 1.1, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -2.1, 1.1, -2.4, 0.0, 0.0, 0.0, 0);

			CreateParticleSystem("splinters", -2.1, 1.4, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -2.1, 1.4, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", -2.4, 1.4, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -2.4, 1.4, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", -1.8, 1.4, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -1.8, 1.4, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", -2.1, 1.1, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -2.1, 1.1, -2.4, 0.0, 0.0, 0.0, 0);

			CreateParticleSystem("splinters", -2.1, 1.4, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -2.1, 1.4, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", -2.4, 1.4, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -2.4, 1.4, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", -1.8, 1.4, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -1.8, 1.4, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", -2.1, 1.1, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -2.1, 1.1, -2.4, 0.0, 0.0, 0.0, 0);

			CreateParticleSystem("splinters", -2.1, 1.4, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -2.1, 1.4, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", -2.4, 1.4, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -2.4, 1.4, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", -1.8, 1.4, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -1.8, 1.4, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", -2.1, 1.1, -2.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -2.1, 1.1, -2.4, 0.0, 0.0, 0.0, 0);

			CreateParticleSystem("smoke_inv_short" , -2.1, 1.2, -2.4, 5.0, 1.5, 0.0, sti(20) );

			Locations[FindLocation("wr_farm_alchemy")].image = "wr_farm_alchemy.tga";

			LAi_QuestDelay("alchemy_acid_explosion2", 2.4);
		break;

		case "alchemy_acid_explosion2":
			LAi_SetPoorType(Pchar);
			PlaySound("OBJECTS\VOICES\DEAD\male\dead6.wav");

			LAi_QuestDelay("alchemy_acid_explosion3", 4.0);
		break;

		case "alchemy_acid_explosion3":
			Pchar.quest.mixtable_bottle = "none"
			LAi_SetPlayerType(Pchar);
			PlaySound("OBJECTS\VOICES\DEAD\male\dead7.wav");

			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("stars_short" , u, v+2.0, w, 0.0, 0.0, 0.0, sti(20) );
		break;
	//................................................................................................

		case "alchemy_acid_fog":
			if(Pchar.location == "wr_farm_alchemy")
			{
				if(CheckAttribute(Pchar, "quest.mixtable_bottle"))
				{
					GetCharacterPos(Pchar, &u, &v, &w);
					
					if(Pchar.quest.mixtable_bottle == "MT1_sulf" || Pchar.quest.mixtable_bottle == "MT1_hydr"
					|| Pchar.quest.mixtable_bottle == "MT2_hydr")
					{
						Play3DSound("gunner_cough", u, v, w);
						CreateParticleSystem("waterfog_light" , -2.1, 1.4, -2.4, 5.0, 1.5, 0.0, sti(20) );
						Pchar.chr_ai.poison =  1.0;
						LAi_QuestDelay("alchemy_acid_fog", 4.0);
					}

					if(Pchar.quest.mixtable_bottle == "MT1_nitr")
					{
						Play3DSound("gunner_cough", u, v, w);
						CreateParticleSystem("waterfog_yellow_light" , -2.1, 1.4, -2.4, 5.0, 1.5, 0.0, sti(20) );
						Pchar.chr_ai.poison =  1.0;
						LAi_QuestDelay("alchemy_acid_fog", 4.0);
					}

					if(locations[FindLocation("wr_farm_alchemy")].models.always.l16 == "bottle_LY1_gas")
					{
						Play3DSound("gunner_cough", u, v, w);
						CreateParticleSystem("waterfog_yellow_light" , -1.3, 1.1, -2.2, 5.0, 1.5, 0.0, sti(20) );
						Pchar.chr_ai.poison =  1.0;
						LAi_QuestDelay("alchemy_acid_fog", 4.0);
					}
				}
				else return;
			}
			else return;
		break;

		case "alchemy_acid_fogL":
			if(Pchar.location == "wr_farm_alchemy")
			{
				GetCharacterPos(Pchar, &u, &v, &w);
				
				if(locations[FindLocation("wr_farm_alchemy")].models.always.l16 == "bottle_LTa_sulf"
				|| locations[FindLocation("wr_farm_alchemy")].models.always.l16 == "bottle_LT1_hydr")
				{
					Play3DSound("gunner_cough", u, v, w);
					CreateParticleSystem("waterfog_light" , -1.2, 1.3, -2.2, 5.0, 1.5, 0.0, sti(20) );
					Pchar.chr_ai.poison =  1.0;	
					LAi_QuestDelay("alchemy_acid_fogL", 4.0);
				}
				else return;
			}
			else return;
		break;
	//................................................................................................
		case "copperas_check":
			if(CheckCharacterItem(Pchar,"pistolcopperas"))
			{
				PlaySound("PEOPLE\grass_noise.wav");
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "pistolcopperas");

				if(CheckAttribute(Pchar,"quest.qbook_open_copper") && Pchar.quest.qbook_open_copper == "done")
				{
					Pchar.quest.Minerva_copper = "info";
				}

				Pchar.quest.CT2_sulf_w_check.win_condition.l1 = "item";
				Pchar.quest.CT2_sulf_w_check.win_condition.l1.character = Pchar.id;
				Pchar.quest.CT2_sulf_w_check.win_condition.l1.item = "bladebottle_CT2_sulf_w";
				Pchar.quest.CT2_sulf_w_check.win_condition = "CT2_sulf_w_check";
			}
			else LAi_QuestDelay("copperas_check", 0.5);	//loops until item picked up
		break;

		case "CT2_sulf_w_check":
			Locations[FindLocation("wr_corv_deck1")].locators_radius.reload.reload4 = 0.001;
			Locations[FindLocation("wr_corv_deck1")].locators_radius.box.box1 = 1.0;
		break;

		case "acid_copper_door":
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(Pchar, true);

			LAi_QuestDelay("acid_copper_door1", 1.0);
		break;

		case "acid_copper_door1":
			PlaySound("INTERFACE\bottle_molasses.wav");
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladebottle_CT2_sulf_w");
			GiveItem2Character(Pchar,"bladebottle_CE0");
			EquipCharacterByItem(Pchar, "bladebottle_CE0");

			LAi_QuestDelay("acid_copper_door2", 3.0);
		break;

		case "acid_copper_door2":
			if(LAi_IsFightMode(Pchar))
			{
				LAi_SetFightMode(Pchar, false);
			}
			PlaySound("INTERFACE\fire_off.wav");
			CreateParticleSystem("smoke_short" , 2.7, 15.4, 11.8, 4.5, 1.5, 0.0, sti(20) );

			LAi_QuestDelay("acid_copper_door3", 4.0);
		break;

		case "acid_copper_door3":
			PlaySound("INTERFACE\closet_Open.wav");

			LAi_QuestDelay("acid_copper_door4", 1.0);
		break;

		case "acid_copper_door4":
			Locations[FindLocation("wr_corv_deck1")].reload.l4.disable = 0;
			Locations[FindLocation("wr_corv_deck1")].locators_radius.reload.reload4 = 1.0;
			Locations[FindLocation("wr_corv_deck1")].locators_radius.box.box1 = 0.001;
			Locations[FindLocation("wr_corv_deck1")].image = "";

			DoQuestReloadToLocation("wr_corv_smallcabin_R", "goto", "cabR", "acid_copper_door5");
		break;

		case "acid_copper_door5":
			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("wr_corv_deck1")].image = "wr_corv_deck1.tga";
			Locations[FindLocation("wr_corv_smallcabin_R")].id.label = "Cabin";
			locations[FindLocation(Pchar.location)].box4.items.pistolnitre = 14;
			locations[FindLocation(Pchar.location)].box4.items.bladebottle_CT1_sulf = 1;
			CloseQuestHeader("Alchemy_copper");

			LAi_QuestDelay("nitre_check", 0.1);
		break;
	//................................................................................................
		case "nitre_check":
			int nitre = GetCharacterItem(Pchar, "pistolnitre");
			int sulf_acid = GetCharacterItem(Pchar, "bladebottle_CT1_sulf");

			if(nitre == 14 && sulf_acid == 1)
			{
				PlaySound("INTERFACE\button2.wav");
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladebottle_CT1_sulf");
				PlaySound("PEOPLE\grass_noise.wav");
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "pistolnitre");

				if(CheckAttribute(Pchar,"quest.qbook_open_silver") && Pchar.quest.qbook_open_silver == "done")
				{
					Pchar.quest.Minerva_silver = "info";
				}

				Locations[FindLocation("wr_corv_smallcabin_R")].locators_radius.reload.reload8 = 0.5;
				Locations[FindLocation("wr_corv_smallcabin_R")].locators_radius.box.box2 = 0.0001;

				DoQuestReloadToLocation("wr_corv_deck1", "reload", "reload4", "CT2_nitr_w_check");
			}
			else LAi_QuestDelay("nitre_check", 0.5);	//loops until item picked up
		break;

		case "CT2_nitr_w_check":
			Pchar.quest.CT2_nitr_w_check1.win_condition.l1 = "item";
			Pchar.quest.CT2_nitr_w_check1.win_condition.l1.character = Pchar.id;
			Pchar.quest.CT2_nitr_w_check1.win_condition.l1.item = "bladebottle_CT2_nitr_w";
			Pchar.quest.CT2_nitr_w_check1.win_condition = "CT2_nitr_w_check1";
		break;

		case "CT2_nitr_w_check1":
			Locations[FindLocation("wr_gall_hold_first")].locators_radius.box.box7 = 0.0001;
			Locations[FindLocation("wr_gall_hold_first")].locators_radius.box.box3 = 1.0;
		break;

		case "acid_silver_door":
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(Pchar, true);

			LAi_QuestDelay("acid_silver_door1", 1.0);
		break;

		case "acid_silver_door1":
			PlaySound("INTERFACE\bottle_molasses.wav");
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladebottle_CT2_nitr_w");
			GiveItem2Character(Pchar,"bladebottle_CE0");
			EquipCharacterByItem(Pchar, "bladebottle_CE0");

			LAi_QuestDelay("acid_silver_door2", 3.0);
		break;

		case "acid_silver_door2":
			if(LAi_IsFightMode(Pchar))
			{
				LAi_SetFightMode(Pchar, false);
			}
			PlaySound("INTERFACE\fire_off.wav");
			CreateParticleSystem("smoke_short" , -1.1, 13.0, 11.9, 4.5, 1.5, 0.0, sti(20) );

			LAi_QuestDelay("acid_silver_door3", 4.0);
		break;

		case "acid_silver_door3":
			PlaySound("INTERFACE\closet_Open.wav");

			LAi_QuestDelay("acid_silver_door4", 1.0);
		break;

		case "acid_silver_door4":
			Locations[FindLocation("wr_gall_hold_first")].reload.l1.disable = 0;
			Locations[FindLocation("wr_gall_hold_first")].locators_radius.reload.reload1 = 1.0;
			Locations[FindLocation("wr_gall_hold_first")].locators_radius.box.box3 = 0.001;

			if(CheckCharacterItem(Pchar,"bladeirontool"))
			{
				Locations[FindLocation("wr_gall_hold_second")].reload.l2.disable = 0;
			}

			Locations[FindLocation("wr_gall_hold_second")].id.label = "Cargo hold";
			DoQuestReloadToLocation("wr_gall_hold_second", "goto", "goto2", "enter_hold_second");
		break;

		case "enter_hold_second":
			Pchar.quest.guncrew = "dialog_in_hold";
			LAi_SetStayType(Pchar);
			LAi_SetOfficerType(CharacterFromID("guncrew_1"));
			LAi_SetOfficerType(CharacterFromID("guncrew_2"));
			LAi_SetOfficerType(CharacterFromID("guncrew_3"));
			LAi_SetOfficerType(CharacterFromID("guncrew_4"));
			CloseQuestHeader("Alchemy_silver");

			LAi_QuestDelay("random_guncrew", 5.0);
		break;

		case "random_guncrew":
			int guncrew = rand(3);

			switch (guncrew)
			{
				case 0:
					LAi_QuestDelay("guncrew4_hold", 0.01);
				break;

				case 1:
					LAi_QuestDelay("guncrew1_hold", 0.01);
				break;

				case 2:
					LAi_QuestDelay("guncrew2_hold", 0.01);
				break;

				case 3:
					LAi_QuestDelay("guncrew3_hold", 0.01);
				break;
			}
		break;

		case "guncrew1_hold":
			LAi_SetActorType(characterFromID("guncrew_1"));
			LAi_ActorDialog(characterFromID("guncrew_1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("guncrew_1"));
		break;

		case "guncrew2_hold":
			LAi_SetActorType(characterFromID("guncrew_2"));
			LAi_ActorDialog(characterFromID("guncrew_2"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("guncrew_2"));
		break;

		case "guncrew3_hold":
			LAi_SetActorType(characterFromID("guncrew_3"));
			LAi_ActorDialog(characterFromID("guncrew_3"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("guncrew_3"));
		break;

		case "guncrew4_hold":
			LAi_SetActorType(characterFromID("guncrew_4"));
			LAi_ActorDialog(characterFromID("guncrew_4"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("guncrew_4"));
		break;

		case "guncrew_hold_done":
			Pchar.quest.guncrew = "free_in_hold";
			LAi_SetCitizenType(CharacterFromID("guncrew_1"));
			LAi_SetCitizenType(CharacterFromID("guncrew_2"));
			LAi_SetCitizenType(CharacterFromID("guncrew_3"));
			LAi_SetCitizenType(CharacterFromID("guncrew_4"));

			LAi_SetPlayerType(Pchar);
		break;
	//................................................................................................
		case "remove_planks_hold":
			PlaySound("PEOPLE\blade_creak.wav");

			LAi_QuestDelay("remove_planks_hold1", 1.5);
		break;

		case "remove_planks_hold1":
			Locations[FindLocation("wr_gall_hold_second")].image = "";
			DoQuestReloadToLocation("wr_gall_hold_second", "goto", "goto1", "remove_planks_hold2");
		break;
	//-----------------------------------------------------------
		case "remove_planks_hold2":
			Locations[FindLocation("wr_gall_hold_second")].image = "wr_gall_hold_second.tga";

			LAi_SetFightMode(Pchar, false);
			if(CheckCharacterItem(Pchar,"plank2_long"))
			{
				PlaySound("PEOPLE\place_planks.wav");
				TakeItemFromCharacter(Pchar, "plank2_long");

				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				GiveItem2Character(Pchar,"bladeplank2");
				EquipCharacterByItem(Pchar, "bladeplank2");

				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				GiveItem2Character(Pchar,"pistolplank2");
				EquipCharacterByItem(Pchar, "pistolplank2");

				LAi_QuestDelay("remove_planks_hold5", 1.0);
			}
			else LAi_QuestDelay("remove_planks_hold2", 0.5);	//loops until item picked up
		break;

		case "remove_planks_hold5":
			DoQuestReloadToLocation("wr_gall_cap_inner", "goto", "goto5", "remove_planks_hold6");
		break;

		case "remove_planks_hold6":
			Pchar.quest.ammodeck = "open";
			Pchar.quest.ammodeck_ball = "yes";//equips nr 2 with ball only first time

			locations[FindLocation(Pchar.location)].box2.items.bladepowderhornP = 1;//change to A later
			locations[FindLocation(Pchar.location)].box2.items.gunpowder = 72;

			Locations[FindLocation("wr_gall_hold_second")].locators_radius.reload.reload2 = 1.0;
			Locations[FindLocation("wr_gall_hold_second")].locators_radius.box.box1 = 0.0001;

			LAi_QuestDelay("powderhorn_check", 0.1);
			LAi_QuestDelay("remove_planks_hold7", 2.0);
		break;

		case "powderhorn_check":
			if(CheckCharacterItem(Pchar,"bladepowderhornP"))
			{
				PlaySound("INTERFACE\cancel.wav");
				SetModel(PChar, "Pira4M_HTUS_ph", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladepowderhornP");
				EquipCharacterByItem(Pchar, "pistol203");
			/*
				Characters[GetCharacterIndex("guncrew_1")].quest.meeting = "9";
				Characters[GetCharacterIndex("guncrew_2")].quest.meeting = "9";
				Characters[GetCharacterIndex("guncrew_3")].quest.meeting = "9";
				Characters[GetCharacterIndex("guncrew_4")].quest.meeting = "9";
			*/
			}
			else LAi_QuestDelay("powderhorn_check", 0.5);	//loops until item picked up
		break;

		case "remove_planks_hold7":
			PlaySound("PEOPLE\place_planks.wav");

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "pistolplank2");
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladeplank2");
			TakeItemFromCharacter(Pchar, "bladeirontool");

			EquipCharacterByItem(Pchar, "bladeX4");
			EquipCharacterByItem(Pchar, "pistol203");

			LAi_QuestDelay("gold_door_backoff", 0.1);
		break;
	//................................................................................................
		case "unlock_stern_left":
			Locations[FindLocation("wr_gall_deck2_stern")].locators_radius.box.box5 = 0.0001;
			Locations[FindLocation("wr_gall_deck2_stern")].locators_radius.reload.reload2 = 1.0;
			Locations[FindLocation("wr_ships")].reload.l9.disable = 0;

			DoQuestReloadToLocation("wr_ships", "reload", "reload9", "_");
		break;

		case "unlock_stern_right":
			Locations[FindLocation("wr_gall_deck2_stern")].locators_radius.box.box6 = 0.0001;
			Locations[FindLocation("wr_gall_deck2_stern")].locators_radius.reload.reload3 = 1.0;
			Locations[FindLocation("wr_ships")].reload.l8.disable = 0;

			DoQuestReloadToLocation("wr_ships", "reload", "reload8", "_");
		break;
	//................................................................................................

		case "guncrew_exit_R8_1":
			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_W1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_2"), "wr_ships", "reload", "reload8");
				LAi_SetActorType(CharacterFromID("guncrew_2"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_2"), "goto", "backoff2", "", 10.0);
			}

			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_N1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_4"), "wr_ships", "reload", "reload8");
				LAi_SetActorType(CharacterFromID("guncrew_4"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_4"), "goto", "backoff1", "", 10.0);
			}

			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_E1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_1"), "wr_ships", "reload", "reload8");
				LAi_SetActorType(CharacterFromID("guncrew_1"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_1"), "goto", "backoff4", "", 10.0);
			}

			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_S1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_3"), "wr_ships", "reload", "reload8");
				LAi_SetActorType(CharacterFromID("guncrew_3"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_3"), "goto", "backoff3", "", 10.0);
			}
		break;

		case "guncrew_exit_R8_2":
			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_W1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_4"), "wr_ships", "reload", "reload8");
				LAi_SetActorType(CharacterFromID("guncrew_4"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_4"), "goto", "backoff1", "", 12.0);
			}

			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_N1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_1"), "wr_ships", "reload", "reload8");
				LAi_SetActorType(CharacterFromID("guncrew_1"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_1"), "goto", "backoff4", "", 12.0);
			}

			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_E1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_3"), "wr_ships", "reload", "reload8");
				LAi_SetActorType(CharacterFromID("guncrew_3"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_3"), "goto", "backoff3", "", 12.0);
			}

			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_S1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_2"), "wr_ships", "reload", "reload8");
				LAi_SetActorType(CharacterFromID("guncrew_2"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_2"), "goto", "backoff2", "", 12.0);
			}
		break;

		case "guncrew_exit_R9_1":
			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_W1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_3"), "wr_ships", "reload", "reload9");
				LAi_SetActorType(CharacterFromID("guncrew_3"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_3"), "goto", "backoff3", "", 14.0);
			}

			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_N1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_2"), "wr_ships", "reload", "reload9");
				LAi_SetActorType(CharacterFromID("guncrew_2"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_2"), "goto", "backoff2", "", 14.0);
			}

			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_E1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_4"), "wr_ships", "reload", "reload9");
				LAi_SetActorType(CharacterFromID("guncrew_4"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_4"), "goto", "backoff1", "", 14.0);
			}

			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_S1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_1"), "wr_ships", "reload", "reload9");
				LAi_SetActorType(CharacterFromID("guncrew_1"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_1"), "goto", "backoff4", "", 14.0);
			}
		break;

		case "guncrew_exit_R9_2":
			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_W1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_1"), "wr_ships", "reload", "reload9");
				LAi_SetActorType(CharacterFromID("guncrew_1"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_1"), "goto", "backoff4", "guncrew_ready", 16.0);
			}

			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_N1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_3"), "wr_ships", "reload", "reload9");
				LAi_SetActorType(CharacterFromID("guncrew_3"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_3"), "goto", "backoff3", "guncrew_ready", 16.0);
			}

			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_E1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_2"), "wr_ships", "reload", "reload9");
				LAi_SetActorType(CharacterFromID("guncrew_2"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_2"), "goto", "backoff2", "guncrew_ready", 16.0);
			}

			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_S1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_4"), "wr_ships", "reload", "reload9");
				LAi_SetActorType(CharacterFromID("guncrew_4"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_4"), "goto", "backoff1", "guncrew_ready", 16.0);
			}
		break;
	//................................................................................................
		case "guncrew_exit_R11_1":
			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_W1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_2"), "wr_ships", "reload", "reload11");
				LAi_SetActorType(CharacterFromID("guncrew_2"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_2"), "goto", "backoff2", "", 14.0);
			}

			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_N1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_4"), "wr_ships", "reload", "reload11");
				LAi_SetActorType(CharacterFromID("guncrew_4"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_4"), "goto", "backoff1", "", 14.0);
			}

			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_E1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_1"), "wr_ships", "reload", "reload11");
				LAi_SetActorType(CharacterFromID("guncrew_1"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_1"), "goto", "backoff4", "", 14.0);
			}

			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_S1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_3"), "wr_ships", "reload", "reload11");
				LAi_SetActorType(CharacterFromID("guncrew_3"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_3"), "goto", "backoff3", "", 14.0);
			}
		break;

		case "guncrew_exit_R11_2":
			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_W1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_4"), "wr_ships", "reload", "reload11");
				LAi_SetActorType(CharacterFromID("guncrew_4"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_4"), "goto", "backoff1", "", 16.0);
			}

			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_N1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_1"), "wr_ships", "reload", "reload11");
				LAi_SetActorType(CharacterFromID("guncrew_1"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_1"), "goto", "backoff4", "", 16.0);
			}

			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_E1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_3"), "wr_ships", "reload", "reload11");
				LAi_SetActorType(CharacterFromID("guncrew_3"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_3"), "goto", "backoff3", "", 16.0);
			}

			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_S1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_2"), "wr_ships", "reload", "reload11");
				LAi_SetActorType(CharacterFromID("guncrew_2"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_2"), "goto", "backoff2", "", 16.0);
			}
		break;

		case "guncrew_exit_R10_1":
			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_W1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_3"), "wr_ships", "reload", "reload10");
				LAi_SetActorType(CharacterFromID("guncrew_3"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_3"), "goto", "backoff3", "", 18.0);
			}

			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_N1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_2"), "wr_ships", "reload", "reload10");
				LAi_SetActorType(CharacterFromID("guncrew_2"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_2"), "goto", "backoff2", "", 18.0);
			}

			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_E1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_4"), "wr_ships", "reload", "reload10");
				LAi_SetActorType(CharacterFromID("guncrew_4"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_4"), "goto", "backoff1", "", 18.0);
			}

			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_S1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_1"), "wr_ships", "reload", "reload10");
				LAi_SetActorType(CharacterFromID("guncrew_1"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_1"), "goto", "backoff4", "", 18.0);
			}
		break;

		case "guncrew_exit_R10_2":
			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_W1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_1"), "wr_ships", "reload", "reload10");
				LAi_SetActorType(CharacterFromID("guncrew_1"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_1"), "goto", "backoff4", "guncrew_ready", 20.0);
			}

			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_N1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_3"), "wr_ships", "reload", "reload10");
				LAi_SetActorType(CharacterFromID("guncrew_3"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_3"), "goto", "backoff3", "guncrew_ready", 20.0);
			}

			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_E1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_2"), "wr_ships", "reload", "reload10");
				LAi_SetActorType(CharacterFromID("guncrew_2"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_2"), "goto", "backoff2", "guncrew_ready", 20.0);
			}

			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_S1")
			{
				ChangeCharacterAddressGroup(CharacterFromID("guncrew_4"), "wr_ships", "reload", "reload10");
				LAi_SetActorType(CharacterFromID("guncrew_4"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_4"), "goto", "backoff1", "guncrew_ready", 20.0);
			}
		break;
	//................................................................................................
		case "guncrew_dismiss":
			LAi_SetPlayerType(Pchar);
			LAi_SetActorType(CharacterFromID("guncrew_1"));
			LAi_SetActorType(CharacterFromID("guncrew_2"));
			LAi_SetActorType(CharacterFromID("guncrew_3"));
			LAi_SetActorType(CharacterFromID("guncrew_4"));

			if(CheckAttribute(Pchar,"quest.guncrew"))
			{
				if(Pchar.quest.guncrew == "at_cannon_with_ammo")
				{
					LAi_ActorRunToLocator(CharacterFromID("guncrew_1"), "reload", "reload8", "", 5.0);
					LAi_ActorRunToLocator(CharacterFromID("guncrew_2"), "reload", "reload8", "", 5.0);
					LAi_ActorRunToLocator(CharacterFromID("guncrew_3"), "reload", "reload8", "", 5.0);
					LAi_ActorRunToLocator(CharacterFromID("guncrew_4"), "reload", "reload8", "", 5.0);

					LAi_QuestDelay("guncrew_dismiss1", 6.0);
				}

				if(Pchar.quest.guncrew == "at_cannon_without_ammo")
				{
					LAi_ActorRunToLocator(CharacterFromID("guncrew_1"), "reload", "reload11", "", 6.5);
					LAi_ActorRunToLocator(CharacterFromID("guncrew_2"), "reload", "reload11", "", 6.5);
					LAi_ActorRunToLocator(CharacterFromID("guncrew_3"), "reload", "reload11", "", 6.5);
					LAi_ActorRunToLocator(CharacterFromID("guncrew_4"), "reload", "reload11", "", 6.5);

					LAi_QuestDelay("guncrew_dismiss1", 7.5);
				}
			}
		break;

		case "guncrew_dismiss1":
			ChangeCharacterAddressGroup(characterFromID("guncrew_1"), "wr_ships", "reload", "reload11");
			ChangeCharacterAddressGroup(characterFromID("guncrew_2"), "wr_ships", "reload", "reload11");
			ChangeCharacterAddressGroup(characterFromID("guncrew_3"), "wr_ships", "reload", "reload11");
			ChangeCharacterAddressGroup(characterFromID("guncrew_4"), "wr_ships", "reload", "reload11");

			LAi_QuestDelay("guncrew_dismiss2", 0.1);
		break;

		case "guncrew_dismiss2":
			ChangeCharacterAddressGroup(characterFromID("guncrew_1"), "wr_gall_hold_second", "goto", "stay2");
			ChangeCharacterAddressGroup(characterFromID("guncrew_2"), "wr_gall_hold_second", "goto", "stay1");
			ChangeCharacterAddressGroup(characterFromID("guncrew_3"), "wr_gall_hold_second", "goto", "stay4");
			ChangeCharacterAddressGroup(characterFromID("guncrew_4"), "wr_gall_hold_second", "goto", "stay3");
			LAi_SetCitizenType(CharacterFromID("guncrew_1"));
			LAi_SetCitizenType(CharacterFromID("guncrew_2"));
			LAi_SetCitizenType(CharacterFromID("guncrew_3"));
			LAi_SetCitizenType(CharacterFromID("guncrew_4"));
			Characters[GetCharacterIndex("guncrew_1")].quest.meeting = "8";
			Characters[GetCharacterIndex("guncrew_2")].quest.meeting = "8";
			Characters[GetCharacterIndex("guncrew_3")].quest.meeting = "8";
			Characters[GetCharacterIndex("guncrew_4")].quest.meeting = "8";
			Pchar.quest.guncrew = "free_in_hold";
		break;
	//................................................................................................
		case "guncrew_ready":
			ChangeCharacterAddressGroup(CharacterFromID("guncrew_2"), "wr_ships", "goto", "backoff2");
			ChangeCharacterAddressGroup(CharacterFromID("guncrew_4"), "wr_ships", "goto", "backoff1");
			ChangeCharacterAddressGroup(CharacterFromID("guncrew_3"), "wr_ships", "goto", "backoff3");
			ChangeCharacterAddressGroup(CharacterFromID("guncrew_1"), "wr_ships", "goto", "backoff4");

			LAi_SetStayType(CharacterFromID("guncrew_1"));
			LAi_SetStayType(CharacterFromID("guncrew_2"));
			LAi_SetStayType(CharacterFromID("guncrew_3"));
			LAi_SetStayType(CharacterFromID("guncrew_4"));
		/*
			if(CheckCharacterItem(Pchar, "bladepowderhornP"))
			{
				Characters[GetCharacterIndex("guncrew_1")].quest.meeting = "9";
				Characters[GetCharacterIndex("guncrew_2")].quest.meeting = "9";
				Characters[GetCharacterIndex("guncrew_3")].quest.meeting = "9";
				Characters[GetCharacterIndex("guncrew_4")].quest.meeting = "9";
			}
			else
			{
				Characters[GetCharacterIndex("guncrew_1")].quest.meeting = "10";
				Characters[GetCharacterIndex("guncrew_2")].quest.meeting = "10";
				Characters[GetCharacterIndex("guncrew_3")].quest.meeting = "10";
				Characters[GetCharacterIndex("guncrew_4")].quest.meeting = "10";
			}
		*/

			Pchar.quest.guncrew_1_pos = "near";	//near, side, back,    front = loading
			Pchar.quest.guncrew_2_pos = "back";
			Pchar.quest.guncrew_3_pos = "near";
			Pchar.quest.guncrew_4_pos = "back";
		break;
	//................................................................................................
		case "guncrew_pchar_to_cannon":
			LAi_SetActorType(Pchar);
			LAi_ActorRunToLocator(Pchar, "goto", "fire", "guncrew_pchar_to_cannon1", 3.0);//sidestep5 is ok!
		break;

		case "guncrew_pchar_to_cannon1":
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "wr_ships", "goto", "fire");	//was sidestep5
		break;
	//................................................................................................
		case "find_powderhorn":
			if(CheckAttribute(Pchar,"quest.qbook_drill_phorn") && Pchar.quest.qbook_drill_phorn == "done")
			{

			}
			else
			{
				Pchar.quest.qbook_drill_phorn = "done";
				AddQuestRecord("Cannon_drill", "2");
			}
		break;

		case "find_handbook":
			if(CheckAttribute(Pchar,"quest.qbook_drill_book") && Pchar.quest.qbook_drill_book == "done")
			{

			}
			else
			{
				Pchar.quest.qbook_drill_book = "done";
				AddQuestRecord("Cannon_drill", "3");
			}
		break;
	//................................................................................................
		case "guncrew_hah":
			PlaySound("VOICE\ENGLISH\blaze_hah.wav");

			LAi_SetPlayerType(Pchar);//this makes pchar NOT run to 'fire' and that's OK!
		break;
	//................................................................................................
		case "guncrew_powder":
			//LogIt("cannon powder = " + Pchar.quest.cannon_powder);
			RemoveCharacterEquip(CharacterFromID("guncrew_1"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(CharacterFromID("guncrew_1"), BLADE_ITEM_TYPE);
			EquipCharacterByItem(CharacterFromID("guncrew_1"), "bladeladle");
			EquipCharacterByItem(CharacterFromID("guncrew_1"), "pistolbarrel4");

			LAi_SetActorType(CharacterFromID("guncrew_1"));

			if(Pchar.quest.guncrew_1_pos == "near")
			{
				LAi_ActorRunToLocator(CharacterFromID("guncrew_1"), "goto", "sidestep7", "guncrew_powder1", 2.5);
			}

			if(Pchar.quest.guncrew_1_pos == "back")
			{
				LAi_SetActorType(CharacterFromID("guncrew_4"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_4"), "goto", "sidestep8", "guncrew_powder_move", 1.5);

				LAi_ActorRunToLocator(CharacterFromID("guncrew_1"), "goto", "passage8", "guncrew_powder0", 1.0);
			}
		break;
	//------------------------------------
		case "guncrew_powder_move":
			LAi_ActorTurnToLocator(CharacterFromID("guncrew_4"), "goto", "backoff1");

			LAi_QuestDelay("guncrew_powder_move1", 0.5);
		break;

		case "guncrew_powder_move1":
			LAi_ActorRunToLocator(CharacterFromID("guncrew_4"), "goto", "backoff1", "guncrew_powder_move2", 2.5);
		break;

		case "guncrew_powder_move2":
			ChangeCharacterAddressGroup(CharacterFromID("guncrew_4"), "wr_ships", "goto", "backoff1");
			LAi_SetStayType(CharacterFromID("guncrew_4"));
			Pchar.quest.guncrew_4_pos = "back";
		break;
	//------------------------------------
		case "guncrew_powder0":
			LAi_ActorRunToLocator(CharacterFromID("guncrew_1"), "goto", "backoff4", "guncrew_powder00", 2.0);
		break;

		case "guncrew_powder00":
			Pchar.quest.guncrew_1_pos = "near";

			LAi_QuestDelay("guncrew_powder", 0.1);		//restarts sequence, now from "near" position
		break;
	//...................................
		case "guncrew_powder1":
			ChangeCharacterAddressGroup(CharacterFromID("guncrew_1"), "wr_ships", "goto", "sidestep7");

			LAi_QuestDelay("guncrew_powder2", 1.0);
		break;

		case "guncrew_powder2":
			LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], false);
			LAi_SetPlayerType(CharacterFromID("guncrew_1"));
			LAi_SetFightMode(CharacterFromID("guncrew_1"), true);

			LAi_QuestDelay("guncrew_powder3", 1.0);
		break;

		case "guncrew_powder3":
			PlaySound("PEOPLE\grass_noise.wav");

			switch(Pchar.quest.cannon_powder)
			{
				case "0":
					Pchar.quest.cannon_powder = "1";
					Pchar.quest.cannon_wad = "ready";
					//LogIt("cannon wad = " + Pchar.quest.cannon_wad);
				break;

				case "1":
					Pchar.quest.cannon_powder = "2";	//2 means explosion
				break;
			}
			//LogIt("cannon powder = " + Pchar.quest.cannon_powder);

			LAi_QuestDelay("guncrew_powder4", 1.0);
		break;

		case "guncrew_powder4":
			//LogIt("cannon temperature = " + Pchar.quest.cannon_temp);
			if(Pchar.quest.cannon_temp == "hot")
			{
				PauseAllSounds();
				PlaySound("OBJECTS\DUEL\pistol_musket.wav");
				PlaySound("OBJECTS\SHIPCHARGE\cannon_fire1.wav");
				PlaySound("OBJECTS\SHIPCHARGE\LG42H.wav");
				PlayStereoSound("OBJECTS\SHIPCHARGE\gunpowder_explosion.wav");
				PlaySound("PEOPLE\roof_broken2.wav");

				GetCharacterPos(Pchar, &u, &v, &w);

				CreateParticleSystem("fort_fire" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("fort_fire" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("fort_fire" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("fort_fire" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("fort_fire" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

				CreateParticleSystem("canfire" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("canfire" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("canfire" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("canfire" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("canfire" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

				CreateParticleSystem("gunfire_red" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("gunfire_red" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("gunfire_red" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("gunfire_red" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("gunfire_red" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

				CreateParticleSystem("stars_fire" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("stars_fire" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("stars_fire" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("stars_fire" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("stars_fire" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

				CreateParticleSystem("cancloud" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("cancloud" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("cancloud" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("cancloud" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("cancloud" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

				CreateParticleSystem("splinters", u, v+1.8, W, 0.0, 0.0, 0.0, 0);
				CreateParticleSystem("splinters", u-0.5, v+1.0, W, 0.0, 0.0, 0.0, 0);
				CreateParticleSystem("splinters2", u, v+1.8, w, 0.0, 0.0, 0.0, 0);
				CreateParticleSystem("splinters2", u-0.5, v+1.0, w, 0.0, 0.0, 0.0, 0);

				LAi_KillCharacter(CharacterFromID("guncrew_1"));
				LAi_KillCharacter(CharacterFromID("guncrew_2"));
				LAi_KillCharacter(CharacterFromID("guncrew_3"));
				LAi_KillCharacter(CharacterFromID("guncrew_4"));

				LAi_QuestDelay("dead_by_minebomb", 1.0);
			}
			else
			{
				LAi_SetFightMode(CharacterFromID("guncrew_1"), false);
				LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], true);

				LAi_QuestDelay("guncrew_powder5", 1.0);
			}
		break;

		case "guncrew_powder5":
			LAi_SetActorType(CharacterFromID("guncrew_1"));
			LAi_ActorRunToLocator(CharacterFromID("guncrew_1"), "goto", "backoff4", "guncrew_powder6", 2.5);
		break;

		case "guncrew_powder6":
			ChangeCharacterAddressGroup(CharacterFromID("guncrew_1"), "wr_ships", "goto", "backoff4");
			LAi_SetStayType(CharacterFromID("guncrew_1"));
			LAi_SetPlayerType(Pchar);
		break;
	//................................................................................................
		case "guncrew_wad":
			if(IsEquipCharacterByItem(CharacterFromID("guncrew_3"), "bladeboom"))
			{
				RemoveCharacterEquip(CharacterFromID("guncrew_3"), BLADE_ITEM_TYPE);
				RemoveCharacterEquip(CharacterFromID("guncrew_3"), GUN_ITEM_TYPE);
				TakeItemFromCharacter(CharacterFromID("guncrew_3"), "bladeboom");

				if(CheckCharacterItem(CharacterFromID("guncrew_3"), "pistolwad"))
				{
					TakeItemFromCharacter(CharacterFromID("guncrew_3"), "pistolwad");
					GiveItem2Character(CharacterFromID("guncrew_3"),"bladewad");
					EquipCharacterByItem(CharacterFromID("guncrew_3"), "bladewad");
				}
				else EquipCharacterByItem(CharacterFromID("guncrew_3"), "bladeX4");

				GiveItem2Character(CharacterFromID("guncrew_3"),"pistolboom");
				EquipCharacterByItem(CharacterFromID("guncrew_3"), "pistolboom");
			}

			LAi_SetActorType(CharacterFromID("guncrew_3"));

			if(Pchar.quest.guncrew_3_pos == "near")
			{
				LAi_ActorRunToLocator(CharacterFromID("guncrew_3"), "goto", "sidestep7", "guncrew_wad1", 2.5);
			}

			if(Pchar.quest.guncrew_3_pos == "back")
			{
				LAi_SetActorType(CharacterFromID("guncrew_2"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_2"), "goto", "sidestep6", "guncrew_wad_move", 1.5);

				LAi_ActorRunToLocator(CharacterFromID("guncrew_3"), "goto", "passage6", "guncrew_wad0", 1.0);

			}
		break;
	//------------------------------------
		case "guncrew_wad_move":
			LAi_ActorTurnToLocator(CharacterFromID("guncrew_2"), "goto", "backoff2");

			LAi_QuestDelay("guncrew_wad_move1", 0.5);
		break;

		case "guncrew_wad_move1":
			LAi_ActorRunToLocator(CharacterFromID("guncrew_2"), "goto", "backoff2", "guncrew_wad_move2", 2.5);
		break;

		case "guncrew_wad_move2":
			ChangeCharacterAddressGroup(CharacterFromID("guncrew_2"), "wr_ships", "goto", "backoff2");
			LAi_SetStayType(CharacterFromID("guncrew_2"));
			Pchar.quest.guncrew_2_pos = "back";
		break;
	//------------------------------------
		case "guncrew_wad0":
			LAi_ActorRunToLocator(CharacterFromID("guncrew_3"), "goto", "backoff3", "guncrew_wad00", 2.0);
		break;

		case "guncrew_wad00":
			Pchar.quest.guncrew_3_pos = "near";

			LAi_QuestDelay("guncrew_wad", 0.1);		//restarts sequence, now from "near" position
		break;
	//...................................
		case "guncrew_wad1":
			ChangeCharacterAddressGroup(CharacterFromID("guncrew_3"), "wr_ships", "goto", "sidestep7");

			LAi_QuestDelay("guncrew_wad2", 1.0);
		break;

		case "guncrew_wad2":
			LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], false);
			LAi_SetPlayerType(CharacterFromID("guncrew_3"));
			LAi_SetFightMode(CharacterFromID("guncrew_3"), true);

			LAi_QuestDelay("guncrew_wad3", 1.0);
		break;

		case "guncrew_wad3":
			PlaySound("PEOPLE\clothes1.wav");

			if(Pchar.quest.cannon_wad == "ready") Pchar.quest.cannon_wad = "1";
			//LogIt("cannon wad = " + Pchar.quest.cannon_wad);

			LAi_QuestDelay("guncrew_wad4", 1.0);
		break;

		case "guncrew_wad4":
			LAi_SetFightMode(CharacterFromID("guncrew_3"), false);
			LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], true);

			LAi_QuestDelay("guncrew_wad5", 1.0);
		break;

		case "guncrew_wad5":
			LAi_SetActorType(CharacterFromID("guncrew_3"));
			LAi_ActorRunToLocator(CharacterFromID("guncrew_3"), "goto", "backoff3", "guncrew_wad6", 2.5);
		break;

		case "guncrew_wad6":
			ChangeCharacterAddressGroup(CharacterFromID("guncrew_3"), "wr_ships", "goto", "backoff3");
			LAi_SetStayType(CharacterFromID("guncrew_3"));
			LAi_SetPlayerType(Pchar);
		break;
	//................................................................................................
		case "guncrew_ball":
			//LogIt("cannon ball = " + Pchar.quest.cannon_ball);
			if(IsEquipCharacterByItem(CharacterFromID("guncrew_2"), "bladerammer"))
			{
				RemoveCharacterEquip(CharacterFromID("guncrew_2"), BLADE_ITEM_TYPE);
				RemoveCharacterEquip(CharacterFromID("guncrew_2"), GUN_ITEM_TYPE);
				TakeItemFromCharacter(CharacterFromID("guncrew_2"), "bladerammer");

				if(CheckCharacterItem(CharacterFromID("guncrew_2"), "pistolcannon_ball"))
				{
					TakeItemFromCharacter(CharacterFromID("guncrew_2"), "pistolcannon_ball");

					if(CheckAttribute(Pchar,"quest.cannon_goodspile") && Pchar.quest.cannon_goodspile == "gone")
					{
						if(Pchar.quest.gall_captain == "open")
						{
							//now there are cannonballs available again
							GiveItem2Character(CharacterFromID("guncrew_2"),"bladecannon_ball");
							EquipCharacterByItem(CharacterFromID("guncrew_2"), "bladecannon_ball");
						}
						else EquipCharacterByItem(CharacterFromID("guncrew_2"), "bladeX4");
					}
					else
					{
						GiveItem2Character(CharacterFromID("guncrew_2"),"bladecannon_ball");
						EquipCharacterByItem(CharacterFromID("guncrew_2"), "bladecannon_ball");
					}
				}
				else EquipCharacterByItem(CharacterFromID("guncrew_2"), "bladeX4");

				GiveItem2Character(CharacterFromID("guncrew_2"),"pistolrammer");
				EquipCharacterByItem(CharacterFromID("guncrew_2"), "pistolrammer");
			}


			if(IsEquipCharacterByItem(CharacterFromID("guncrew_2"), "bladeX4"))
			{
				if(CheckAttribute(Pchar,"quest.cannon_goodspile") && Pchar.quest.cannon_goodspile == "gone")
				{
					if(Pchar.quest.gall_captain == "open")
					{
						RemoveCharacterEquip(CharacterFromID("guncrew_2"), BLADE_ITEM_TYPE);
						RemoveCharacterEquip(CharacterFromID("guncrew_2"), GUN_ITEM_TYPE);
						GiveItem2Character(CharacterFromID("guncrew_2"),"bladecannon_ball");
						EquipCharacterByItem(CharacterFromID("guncrew_2"), "bladecannon_ball");
						EquipCharacterByItem(CharacterFromID("guncrew_2"), "pistolrammer");
					}
					else
					{
						//ok!
					}
				}
				else
				{
					RemoveCharacterEquip(CharacterFromID("guncrew_2"), BLADE_ITEM_TYPE);
					RemoveCharacterEquip(CharacterFromID("guncrew_2"), GUN_ITEM_TYPE);
					GiveItem2Character(CharacterFromID("guncrew_2"),"bladecannon_ball");
					EquipCharacterByItem(CharacterFromID("guncrew_2"), "bladecannon_ball");
					EquipCharacterByItem(CharacterFromID("guncrew_2"), "pistolrammer");
				}
			}

			LAi_SetActorType(CharacterFromID("guncrew_2"));

			if(Pchar.quest.guncrew_2_pos == "near")
			{
				LAi_ActorRunToLocator(CharacterFromID("guncrew_2"), "goto", "sidestep7", "guncrew_ball1", 2.5);

			}

			if(Pchar.quest.guncrew_2_pos == "back")
			{
				LAi_SetActorType(CharacterFromID("guncrew_3"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_3"), "goto", "sidestep6", "guncrew_ball_move", 1.5);

				LAi_ActorRunToLocator(CharacterFromID("guncrew_2"), "goto", "passage6", "guncrew_ball0", 1.0);
			}
		break;
	//------------------------------------
		case "guncrew_ball_move":
			LAi_ActorTurnToLocator(CharacterFromID("guncrew_3"), "goto", "backoff2");

			LAi_QuestDelay("guncrew_ball_move1", 0.5);
		break;

		case "guncrew_ball_move1":
			LAi_ActorRunToLocator(CharacterFromID("guncrew_3"), "goto", "backoff2", "guncrew_ball_move2", 2.5);
		break;

		case "guncrew_ball_move2":
			ChangeCharacterAddressGroup(CharacterFromID("guncrew_3"), "wr_ships", "goto", "backoff2");
			LAi_SetStayType(CharacterFromID("guncrew_3"));
			Pchar.quest.guncrew_3_pos = "back";
		break;
	//------------------------------------
		case "guncrew_ball0":
			LAi_ActorRunToLocator(CharacterFromID("guncrew_2"), "goto", "backoff3", "guncrew_ball00", 2.0);
		break;

		case "guncrew_ball00":
			Pchar.quest.guncrew_2_pos = "near";

			LAi_QuestDelay("guncrew_ball", 0.1);		//restarts sequence, now from "near" position
		break;
	//...................................
		case "guncrew_ball1":
			ChangeCharacterAddressGroup(CharacterFromID("guncrew_2"), "wr_ships", "goto", "sidestep7");

			LAi_QuestDelay("guncrew_ball2", 1.0);
		break;

		case "guncrew_ball2":
			LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], false);
			LAi_SetPlayerType(CharacterFromID("guncrew_2"));
			LAi_SetFightMode(CharacterFromID("guncrew_2"), true);

			LAi_QuestDelay("guncrew_ball3", 1.0);
		break;

		case "guncrew_ball3":
			PlaySound("PEOPLE\step_iron.wav");
			PlaySound("PEOPLE\step_iron.wav");
			PlaySound("PEOPLE\step_iron.wav");

			RemoveCharacterEquip(CharacterFromID("guncrew_2"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(CharacterFromID("guncrew_2"), "bladecannon_ball");
			EquipCharacterByItem(CharacterFromID("guncrew_2"), "bladeX4");
			EquipCharacterByItem(CharacterFromID("guncrew_2"), "pistolrammer");

			switch(Pchar.quest.cannon_ball)
			{
				case "0":
					if(Pchar.quest.cannon_powder == "1")
					Pchar.quest.cannon_ball = "1";

					if(Pchar.quest.cannon_wad == "ready")
					Pchar.quest.cannon_wad = "0";			//you should have put wad in, not a ball!
					//LogIt("cannon wad = " + Pchar.quest.cannon_wad);
				break;

				case "1":
					Pchar.quest.cannon_ball = "2";	//2 are already too many
				break;
			}
			//LogIt("cannon ball = " + Pchar.quest.cannon_ball);

			LAi_QuestDelay("guncrew_ball4", 1.0);
		break;

		case "guncrew_ball4":
			LAi_SetFightMode(CharacterFromID("guncrew_2"), false);
			LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], true);

			LAi_QuestDelay("guncrew_ball5", 1.0);
		break;

		case "guncrew_ball5":
			LAi_SetActorType(CharacterFromID("guncrew_2"));
			LAi_ActorRunToLocator(CharacterFromID("guncrew_2"), "goto", "backoff3", "guncrew_ball6", 2.5);
		break;

		case "guncrew_ball6":
			ChangeCharacterAddressGroup(CharacterFromID("guncrew_2"), "wr_ships", "goto", "backoff3");
			LAi_SetStayType(CharacterFromID("guncrew_2"));

			LAi_SetPlayerType(Pchar);
		break;
	//................................................................................................
			case "guncrew_ram":
			if(IsEquipCharacterByItem(CharacterFromID("guncrew_2"), "bladecannon_ball"))
			{
				RemoveCharacterEquip(CharacterFromID("guncrew_2"), BLADE_ITEM_TYPE);
				RemoveCharacterEquip(CharacterFromID("guncrew_2"), GUN_ITEM_TYPE);
				TakeItemFromCharacter(CharacterFromID("guncrew_2"), "bladecannon_ball");
				TakeItemFromCharacter(CharacterFromID("guncrew_2"), "pistolrammer");
				GiveItem2Character(CharacterFromID("guncrew_2"),"bladerammer");
				EquipCharacterByItem(CharacterFromID("guncrew_2"), "bladerammer");
				GiveItem2Character(CharacterFromID("guncrew_2"),"pistolcannon_ball");
				EquipCharacterByItem(CharacterFromID("guncrew_2"), "pistolcannon_ball");
			}

			if(IsEquipCharacterByItem(CharacterFromID("guncrew_2"), "bladeX4"))
			{
				RemoveCharacterEquip(CharacterFromID("guncrew_2"), BLADE_ITEM_TYPE);
				GiveItem2Character(CharacterFromID("guncrew_2"),"bladerammer");
				EquipCharacterByItem(CharacterFromID("guncrew_2"), "bladerammer");

				RemoveCharacterEquip(CharacterFromID("guncrew_2"), GUN_ITEM_TYPE);
				TakeItemFromCharacter(CharacterFromID("guncrew_2"), "pistolrammer");
			}

			LAi_SetActorType(CharacterFromID("guncrew_2"));

			if(Pchar.quest.guncrew_2_pos == "near")
			{
				LAi_ActorRunToLocator(CharacterFromID("guncrew_2"), "goto", "sidestep7", "guncrew_ram1", 2.5);

			}

			if(Pchar.quest.guncrew_2_pos == "back")
			{
				LAi_SetActorType(CharacterFromID("guncrew_3"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_3"), "goto", "sidestep6", "guncrew_ram_move", 1.5);

				LAi_ActorRunToLocator(CharacterFromID("guncrew_2"), "goto", "passage6", "guncrew_ram0", 1.0);
			}
		break;
	//------------------------------------
		case "guncrew_ram_move":
			LAi_ActorTurnToLocator(CharacterFromID("guncrew_3"), "goto", "backoff2");

			LAi_QuestDelay("guncrew_ram_move1", 0.5);
		break;

		case "guncrew_ram_move1":
			LAi_ActorRunToLocator(CharacterFromID("guncrew_3"), "goto", "backoff2", "guncrew_ram_move2", 2.5);
		break;

		case "guncrew_ram_move2":
			ChangeCharacterAddressGroup(CharacterFromID("guncrew_3"), "wr_ships", "goto", "backoff2");
			LAi_SetStayType(CharacterFromID("guncrew_3"));
			Pchar.quest.guncrew_3_pos = "back";
		break;
	//------------------------------------
		case "guncrew_ram0":
			LAi_ActorRunToLocator(CharacterFromID("guncrew_2"), "goto", "backoff3", "guncrew_ram00", 2.0);
		break;

		case "guncrew_ram00":
			Pchar.quest.guncrew_2_pos = "near";

			LAi_QuestDelay("guncrew_ram", 0.1);		//restarts sequence, now from "near" position
		break;
	//...................................
		case "guncrew_ram1":
			ChangeCharacterAddressGroup(CharacterFromID("guncrew_2"), "wr_ships", "goto", "sidestep7");

			LAi_QuestDelay("guncrew_ram2", 1.0);
		break;

		case "guncrew_ram2":
			LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], false);
			LAi_SetPlayerType(CharacterFromID("guncrew_2"));
			LAi_SetFightMode(CharacterFromID("guncrew_2"), true);

			LAi_QuestDelay("guncrew_ram3", 1.0);
		break;

		case "guncrew_ram3":
			PlaySound("PEOPLE\ram.wav");

			if(Pchar.quest.cannon_ball == "1") Pchar.quest.cannon_ram = "1";
			//LogIt("cannon ram = " + Pchar.quest.cannon_ram);

			LAi_QuestDelay("guncrew_ram4", 1.0);
		break;

		case "guncrew_ram4":
			LAi_SetFightMode(CharacterFromID("guncrew_2"), false);
			LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], true);

			LAi_QuestDelay("guncrew_ram5", 1.0);
		break;

		case "guncrew_ram5":
			LAi_SetActorType(CharacterFromID("guncrew_2"));
			LAi_ActorRunToLocator(CharacterFromID("guncrew_2"), "goto", "backoff3", "guncrew_ram6", 2.5);
		break;

		case "guncrew_ram6":
			ChangeCharacterAddressGroup(CharacterFromID("guncrew_2"), "wr_ships", "goto", "backoff3");

			//always reset to 'passive' mode???
			if(IsEquipCharacterByItem(CharacterFromID("guncrew_2"), "bladerammer"))
			{
				RemoveCharacterEquip(CharacterFromID("guncrew_2"), BLADE_ITEM_TYPE);
				RemoveCharacterEquip(CharacterFromID("guncrew_2"), GUN_ITEM_TYPE);
				TakeItemFromCharacter(CharacterFromID("guncrew_2"), "bladerammer");

				if(CheckCharacterItem(CharacterFromID("guncrew_2"), "pistolcannon_ball"))
				{
					TakeItemFromCharacter(CharacterFromID("guncrew_2"), "pistolcannon_ball");
					GiveItem2Character(CharacterFromID("guncrew_2"),"bladecannon_ball");
					EquipCharacterByItem(CharacterFromID("guncrew_2"), "bladecannon_ball");
				}
				else EquipCharacterByItem(CharacterFromID("guncrew_2"), "bladeX4");

				GiveItem2Character(CharacterFromID("guncrew_2"),"pistolrammer");
				EquipCharacterByItem(CharacterFromID("guncrew_2"), "pistolrammer");
			}

			LAi_SetStayType(CharacterFromID("guncrew_2"));
			LAi_SetPlayerType(Pchar);
		break;
	//................................................................................................
		case "guncrew_sponge":
			if(IsEquipCharacterByItem(CharacterFromID("guncrew_4"), "bladebucket"))
			{
				RemoveCharacterEquip(CharacterFromID("guncrew_4"), BLADE_ITEM_TYPE);
				RemoveCharacterEquip(CharacterFromID("guncrew_4"), GUN_ITEM_TYPE);
				TakeItemFromCharacter(CharacterFromID("guncrew_4"), "bladebucket");
				TakeItemFromCharacter(CharacterFromID("guncrew_4"), "pistolsponge");
				GiveItem2Character(CharacterFromID("guncrew_4"),"bladesponge");
				EquipCharacterByItem(CharacterFromID("guncrew_4"), "bladesponge");
				GiveItem2Character(CharacterFromID("guncrew_4"),"pistolbucket");
				EquipCharacterByItem(CharacterFromID("guncrew_4"), "pistolbucket");
			}

			LAi_SetActorType(CharacterFromID("guncrew_4"));

			if(Pchar.quest.guncrew_4_pos == "near")
			{
				LAi_ActorRunToLocator(CharacterFromID("guncrew_4"), "goto", "sidestep7", "guncrew_sponge1", 2.5);

			}

			if(Pchar.quest.guncrew_4_pos == "back")
			{
				LAi_SetActorType(CharacterFromID("guncrew_1"));
				LAi_ActorRunToLocator(CharacterFromID("guncrew_1"), "goto", "sidestep8", "guncrew_sponge_move", 1.5);

				LAi_ActorRunToLocator(CharacterFromID("guncrew_4"), "goto", "passage8", "guncrew_sponge0", 1.0);
			}
		break;
	//------------------------------------
		case "guncrew_sponge_move":
			LAi_ActorTurnToLocator(CharacterFromID("guncrew_1"), "goto", "backoff1");

			LAi_QuestDelay("guncrew_sponge_move1", 0.5);
		break;

		case "guncrew_sponge_move1":
			LAi_ActorRunToLocator(CharacterFromID("guncrew_1"), "goto", "backoff1", "guncrew_sponge_move2", 2.5);
		break;

		case "guncrew_sponge_move2":
			ChangeCharacterAddressGroup(CharacterFromID("guncrew_1"), "wr_ships", "goto", "backoff1");
			LAi_SetStayType(CharacterFromID("guncrew_1"));
			Pchar.quest.guncrew_1_pos = "back";
		break;
	//------------------------------------
		case "guncrew_sponge0":
			LAi_ActorRunToLocator(CharacterFromID("guncrew_4"), "goto", "backoff4", "guncrew_sponge00", 2.0);
		break;

		case "guncrew_sponge00":
			Pchar.quest.guncrew_4_pos = "near";

			LAi_QuestDelay("guncrew_sponge", 0.1);		//restarts sequence, now from "near" position
		break;
	//...................................
		case "guncrew_sponge1":
			ChangeCharacterAddressGroup(CharacterFromID("guncrew_4"), "wr_ships", "goto", "sidestep7");

			LAi_QuestDelay("guncrew_sponge2", 1.0);
		break;

		case "guncrew_sponge2":
			LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], false);
			LAi_SetPlayerType(CharacterFromID("guncrew_4"));
			LAi_SetFightMode(CharacterFromID("guncrew_4"), true);

			LAi_QuestDelay("guncrew_sponge3", 1.0);
		break;

		case "guncrew_sponge3":
			PlaySound("PEOPLE\sponge.wav");
			Pchar.quest.cannon_temp = "cold";
			//LogIt("cannon temperature = " + Pchar.quest.cannon_temp);

			LAi_QuestDelay("guncrew_sponge4", 1.0);
		break;

		case "guncrew_sponge4":
			LAi_SetFightMode(CharacterFromID("guncrew_4"), false);
			LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], true);

			LAi_QuestDelay("guncrew_sponge5", 1.0);
		break;

		case "guncrew_sponge5":
			LAi_SetActorType(CharacterFromID("guncrew_4"));
			LAi_ActorRunToLocator(CharacterFromID("guncrew_4"), "goto", "backoff4", "guncrew_sponge6", 2.5);
		break;

		case "guncrew_sponge6":
			ChangeCharacterAddressGroup(CharacterFromID("guncrew_4"), "wr_ships", "goto", "backoff4");

			//always reset to 'passive' mode
			if(IsEquipCharacterByItem(CharacterFromID("guncrew_4"), "bladesponge"))
			{
				RemoveCharacterEquip(CharacterFromID("guncrew_4"), BLADE_ITEM_TYPE);
				RemoveCharacterEquip(CharacterFromID("guncrew_4"), GUN_ITEM_TYPE);
				TakeItemFromCharacter(CharacterFromID("guncrew_4"), "bladesponge");
				TakeItemFromCharacter(CharacterFromID("guncrew_4"), "pistolbucket");
				GiveItem2Character(CharacterFromID("guncrew_4"),"bladebucket");
				EquipCharacterByItem(CharacterFromID("guncrew_4"), "bladebucket");
				GiveItem2Character(CharacterFromID("guncrew_4"),"pistolsponge");
				EquipCharacterByItem(CharacterFromID("guncrew_4"), "pistolsponge");
			}

			LAi_SetStayType(CharacterFromID("guncrew_4"));
			LAi_SetPlayerType(Pchar);
		break;
	//................................................................................................
		case "guncrew_turn":
			LAi_SetPlayerType(Pchar);//this makes pchar NOT run to 'fire' and that's OK!
			if(IsEquipCharacterByItem(CharacterFromID("guncrew_3"), "bladewad"))
			{
				RemoveCharacterEquip(CharacterFromID("guncrew_3"), BLADE_ITEM_TYPE);
				RemoveCharacterEquip(CharacterFromID("guncrew_3"), GUN_ITEM_TYPE);
				TakeItemFromCharacter(CharacterFromID("guncrew_3"), "bladewad");
				TakeItemFromCharacter(CharacterFromID("guncrew_3"), "pistolboom");
				GiveItem2Character(CharacterFromID("guncrew_3"),"bladeboom");
				EquipCharacterByItem(CharacterFromID("guncrew_3"), "bladeboom");
				GiveItem2Character(CharacterFromID("guncrew_3"),"pistolwad");
				EquipCharacterByItem(CharacterFromID("guncrew_3"), "pistolwad");
			}

			LAi_SetActorType(CharacterFromID("guncrew_3"));
			LAi_ActorTurnToLocator(CharacterFromID("guncrew_3"), "box", "box4");

			LAi_QuestDelay("guncrew_turn1", 1.0);
		break;

		case "guncrew_turn1":
			LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], false);
			LAi_SetPlayerType(CharacterFromID("guncrew_3"));
			LAi_SetFightMode(CharacterFromID("guncrew_3"), true);

			LAi_QuestDelay("guncrew_turn2", 1.0);
		break;


		case "guncrew_turn2":
			PlaySound("PEOPLE\wood1.wav");

			if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_W1")
			{
				//Log_SetStringToLog("udeck_l_JRH_W1");
				Locations[FindLocation("wr_ships")].models.always.locators = "udeck_l_JRH_N1";

				if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_W2")
				Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_N2";
			}
			else
			{
				if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_N1")
				{
					Locations[FindLocation("wr_ships")].models.always.locators = "udeck_l_JRH_E1";

					if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_N2")
					Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_E2";
				}
			}
			else
			{
				if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_E1")
				{
					Locations[FindLocation("wr_ships")].models.always.locators = "udeck_l_JRH_S1";

					if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_E2")
					Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_S2";

					if(CheckAttribute(Pchar,"quest.corvette_guards") && Pchar.quest.corvette_guards == "gone")
					{

					}
					else Pchar.quest.corvette_guards = "scared";
				}
			}
			else
			{
				if(Locations[FindLocation("wr_ships")].models.always.locators == "udeck_l_JRH_S1")
				{
					Locations[FindLocation("wr_ships")].models.always.locators = "udeck_l_JRH_E1";

					if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_S2")
					Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_E2";
				}
			}

			LAi_QuestDelay("guncrew_turn3", 0.5);
		break;

		case "guncrew_turn3":
			Locations[FindLocation("wr_ships")].image = "";
			DoQuestReloadToLocation("wr_ships", "goto", "fire", "guncrew_turn4");
		break;

		case "guncrew_turn4":
			Locations[FindLocation("wr_ships")].image = "wr_ships.tga";
			PlaySound("PEOPLE\creak.wav");
			LAi_SetFightMode(CharacterFromID("guncrew_3"), false);
			LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], true);

			LAi_SetStayType(CharacterFromID("guncrew_3"));
			LAi_SetPlayerType(Pchar);

			if(CheckAttribute(Pchar,"quest.corvette_guards") && Pchar.quest.corvette_guards == "scared")
			{
				Pchar.quest.corvette_guards = "gone";		//so it happens only first time

				PlaySound("VOICE\ENGLISH\Eng_m_c_039.wav");
				LAi_SetActorType(CharacterFromID("wr_wll3"));
				LAi_SetActorType(CharacterFromID("wr_sail7"));
				LAi_ActorRunToLocator(CharacterFromID("wr_wll3"), "box", "box20", "", 4.0);
				LAi_ActorRunToLocator(CharacterFromID("wr_sail7"), "box", "box20", "guncrew_turn5", 4.0);
			}
		break;

		case "guncrew_turn5":
			ChangeCharacterAddressGroup(CharacterFromID("wr_wll3"), "wr_ships", "reload", "reload3");
			LAi_QuestDelay("guncrew_turn6", 1.0);
		break;

		case "guncrew_turn6":
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash1.wav");
			ChangeCharacterAddressGroup(CharacterFromID("wr_wll3"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_sail7"), "wr_ships", "reload", "reload3");

			LAi_QuestDelay("guncrew_turn7", 1.0);
		break;

		case "guncrew_turn7":
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash1.wav");
			ChangeCharacterAddressGroup(CharacterFromID("wr_sail7"), "none", "", "");
			Pchar.quest.corvette_guards = "gone";
		break;
	//................................................................................................
		case "guncrew_move":
			LAi_SetPlayerType(Pchar);//this makes pchar NOT run to 'fire' and that's OK!
			if(IsEquipCharacterByItem(CharacterFromID("guncrew_4"), "bladebucket"))
			{
				RemoveCharacterEquip(CharacterFromID("guncrew_4"), BLADE_ITEM_TYPE);
				RemoveCharacterEquip(CharacterFromID("guncrew_4"), GUN_ITEM_TYPE);
				TakeItemFromCharacter(CharacterFromID("guncrew_4"), "bladebucket");
				TakeItemFromCharacter(CharacterFromID("guncrew_4"), "pistolsponge");
				GiveItem2Character(CharacterFromID("guncrew_4"),"bladesponge");
				EquipCharacterByItem(CharacterFromID("guncrew_4"), "bladesponge");
				GiveItem2Character(CharacterFromID("guncrew_4"),"pistolbucket");
				EquipCharacterByItem(CharacterFromID("guncrew_4"), "pistolbucket");
			}

			LAi_SetActorType(CharacterFromID("guncrew_4"));
			LAi_ActorTurnToLocator(CharacterFromID("guncrew_4"), "box", "box4");

			LAi_QuestDelay("guncrew_move1", 1.0);
		break;

		case "guncrew_move1":
			LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], false);
			LAi_SetPlayerType(CharacterFromID("guncrew_4"));
			LAi_SetFightMode(CharacterFromID("guncrew_4"), true);

			LAi_QuestDelay("guncrew_move2", 1.0);
		break;

		case "guncrew_move2":
			PlaySound("PEOPLE\wood1.wav");

			Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_S1X";

			LAi_QuestDelay("guncrew_move3", 0.5);
		break;

		case "guncrew_move3":
			Locations[FindLocation("wr_ships")].image = "";
			DoQuestReloadToLocation("wr_ships", "goto", "fire", "guncrew_move4");
		break;

		case "guncrew_move4":
			Locations[FindLocation("wr_ships")].image = "wr_ships.tga";
			PlaySound("PEOPLE\creak.wav");
			LAi_SetFightMode(CharacterFromID("guncrew_4"), false);
			LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], true);

			LAi_SetStayType(CharacterFromID("guncrew_4"));
			LAi_SetPlayerType(Pchar);
		break;
	//................................................................................................
		case "guncrew_move_back":
			LAi_SetPlayerType(Pchar);//this makes pchar NOT run to 'fire' and that's OK!
			if(IsEquipCharacterByItem(CharacterFromID("guncrew_3"), "bladewad"))
			{
				RemoveCharacterEquip(CharacterFromID("guncrew_3"), BLADE_ITEM_TYPE);
				RemoveCharacterEquip(CharacterFromID("guncrew_3"), GUN_ITEM_TYPE);
				TakeItemFromCharacter(CharacterFromID("guncrew_3"), "bladewad");
				TakeItemFromCharacter(CharacterFromID("guncrew_3"), "pistolboom");
				GiveItem2Character(CharacterFromID("guncrew_3"),"bladeboom");
				EquipCharacterByItem(CharacterFromID("guncrew_3"), "bladeboom");
				GiveItem2Character(CharacterFromID("guncrew_3"),"pistolwad");
				EquipCharacterByItem(CharacterFromID("guncrew_3"), "pistolwad");
			}

			LAi_SetActorType(CharacterFromID("guncrew_3"));
			LAi_ActorTurnToLocator(CharacterFromID("guncrew_3"), "box", "box4");

			LAi_QuestDelay("guncrew_move_back1", 1.0);
		break;

		case "guncrew_move_back1":
			LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], false);
			LAi_SetPlayerType(CharacterFromID("guncrew_3"));
			LAi_SetFightMode(CharacterFromID("guncrew_3"), true);

			LAi_QuestDelay("guncrew_move_back2", 1.0);
		break;

		case "guncrew_move_back2":
			PlaySound("PEOPLE\wood1.wav");

			Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_S1";

			LAi_QuestDelay("guncrew_move_back3", 0.5);
		break;

		case "guncrew_move_back3":
			Locations[FindLocation("wr_ships")].image = "";
			DoQuestReloadToLocation("wr_ships", "goto", "fire", "guncrew_move_back4");
		break;

		case "guncrew_move_back4":
			Locations[FindLocation("wr_ships")].image = "wr_ships.tga";
			PlaySound("PEOPLE\creak.wav");
			LAi_SetFightMode(CharacterFromID("guncrew_3"), false);
			LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], true);

			LAi_SetStayType(CharacterFromID("guncrew_3"));
			LAi_SetPlayerType(Pchar);
		break;
	//................................................................................................
		case "guncrew_fire":
			Pchar.quest.deck_position = "cannon";
			LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], false);
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(Pchar, true);
			ChangeCharacterAddressGroup(Pchar, "wr_ships", "goto", "fire");	//turns Pchar right

			if(CheckCharacterItem(Pchar, "bladepowderhornP"))		//equipped or not
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "bladepowderhornP");
				GiveItem2Character(Pchar,"bladepowderhornA");
				EquipCharacterByItem(Pchar, "bladepowderhornA");
				EquipCharacterByItem(Pchar, "pistol203");

				LAi_QuestDelay("guncrew_priming_powder", 0.5);
			}

			LAi_QuestDelay("guncrew_fire1", 3.0);
		break;
	//----------------------------------------------------------------------------------------
		case "guncrew_priming_powder":
			if(Pchar.quest.cannon_priming == "no")
			{
				int priming = GetCharacterItem(Pchar, "gunpowder");
				if(priming >= 2)
				{
					PlaySound("PEOPLE\powderhorn.wav");
					TakeNItems(Pchar,"gunpowder", -2);
					Pchar.quest.cannon_priming = "yes";
					//LogIt("cannon priming = " + Pchar.quest.cannon_priming);

					LAi_QuestDelay("guncrew_priming_powder1", 1.0);
				}
				else Logit(LanguageConvertString(tmpLangFileID,"There is no Gunpowder left"));
			}
			else return;
		break;

		case "guncrew_priming_powder1":
			//LogIt("cannon temperature = " + Pchar.quest.cannon_temp);
			if(Pchar.quest.cannon_temp == "hot")
			{
				LAi_SetPlayerType(Pchar);
				LAi_SetFightMode(Pchar, false);
				LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], true);

				PauseAllSounds();
				PlaySound("OBJECTS\DUEL\pistol_bbus.wav");

				GetCharacterPos(Pchar, &u, &v, &w);
				CreateParticleSystem("gunfire_red" , u, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );

				LAi_SetPoorType(Pchar);
				LAi_ApplyCharacterDamage(Pchar, 20);

				LAi_QuestDelay("guncrew_priming_powder2", 2.0);
			}
			else return;
		break;

		case "guncrew_priming_powder2":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead6.wav");

			if(IsEquipCharacterByItem(Pchar, "bladepowderhornA"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "bladepowderhornA");
				GiveItem2Character(Pchar,"bladepowderhornP");
				EquipCharacterByItem(Pchar, "bladepowderhornP");
			}

			LAi_QuestDelay("guncrew_priming_powder3", 4.0);
		break;

		case "guncrew_priming_powder3":
			LAi_SetPlayerType(Pchar);
			PlaySound("OBJECTS\VOICES\DEAD\male\dead7.wav");

			TakeNItems(Pchar,"gunpowder", -100);

			Pchar.quest.cannon_temp = "hot";
			//LogIt("cannon temperature = " + Pchar.quest.cannon_temp);
			Pchar.quest.cannon_priming = "no";
			//LogIt("cannon priming = " + Pchar.quest.cannon_priming);
		break;
	//----------------------------------------------------------------------------------------
		case "guncrew_fire1":
			if(LAi_IsFightMode(Pchar))
			{
				LAi_SetPlayerType(Pchar);
				LAi_SetFightMode(Pchar, false);
				LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], true);

				if(IsEquipCharacterByItem(Pchar, "bladepowderhornA"))
				{
					RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
					TakeItemFromCharacter(Pchar, "bladepowderhornA");
					GiveItem2Character(Pchar,"bladepowderhornP");
					EquipCharacterByItem(Pchar, "bladepowderhornP");
				}

				LAi_QuestDelay("guncrew_fire1A", 1.0);
			}
			else return;
		break;

		case "guncrew_fire1A":
			Pchar.quest.deck_position = "elsewhere";
		break;

		case "guncrew_fire2":
			//direct from LAi_events (fire gun)
			//Log_SetStringToLog("0000000000000");
			Pchar.quest.deck_position = "elsewhere";

			LAi_SetFightMode(Pchar, false);
			LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], true);

			switch(Pchar.quest.cannon_powder)
			{
				case "0":
					//CLICK SHOT

					//Log_SetStringToLog("AAAAAAAAAAAAAAAA");

					LAi_QuestDelay("guncrew_pchar_player", 2.0);
					return;
				break;

				case "1":
					//BLIND,FULL or BAD SHOT

					//Log_SetStringToLog("111111111111111");
					if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_W1")
					{
						CreateParticleSystem("smoke_short" , -1.4, 4.2, -4.1, 4.5, 1.5, 0.0, sti(20) );
						CreateParticleSystem("smoke_short" , -1.4, 4.2, -4.1, 4.5, 1.5, 0.0, sti(20) );

						CreateParticleSystem("gunfire_red" , -1.8, 4.2, -4.1, 0.0, 4.5, 0.0, sti(20) );//to W
						CreateParticleSystem("gunfire_red" , -2.0, 4.2, -4.1, 0.0, 4.5, 0.0, sti(20) );
						CreateParticleSystem("gunfire_red" , -2.2, 4.2, -4.1, 0.0, 4.5, 0.0, sti(20) );

						CreateParticleSystem("gunfire" , -2.0, 4.2, -4.1, 0.0, 4.5, 0.0, sti(20) );
						CreateParticleSystem("gunfire" , -2.2, 4.2, -4.1, 0.0, 4.5, 0.0, sti(20) );
					}

					if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_N1")
					{
						CreateParticleSystem("smoke_short" , -0.4, 4.2, -3.0, 4.5, 1.5, 0.0, sti(20) );
						CreateParticleSystem("smoke_short" , -0.4, 4.2, -3.0, 4.5, 1.5, 0.0, sti(20) );

						CreateParticleSystem("gunfire_red" , -0.4, 4.2, -2.6, 0.0, 6.0, 0.0, sti(20) );
						CreateParticleSystem("gunfire_red" , -0.4, 4.2, -2.4, 0.0, 6.0, 0.0, sti(20) );
						CreateParticleSystem("gunfire_red" , -0.4, 4.2, -2.2, 0.0, 6.0, 0.0, sti(20) );

						CreateParticleSystem("gunfire" , -0.4, 4.2, -2.4, 0.0, 6.0, 0.0, sti(20) );
						CreateParticleSystem("gunfire" , -0.4, 4.2, -2.2, 0.0, 6.0, 0.0, sti(20) );
					}

					if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_E1")
					{
						CreateParticleSystem("smoke_short" , 0.7, 4.2, -4.1, 4.5, 1.5, 0.0, sti(20) );
						CreateParticleSystem("smoke_short" , 0.7, 4.2, -4.1, 4.5, 1.5, 0.0, sti(20) );

						CreateParticleSystem("gunfire_red" , 1.1, 4.2, -4.1, 0.0, 1.5, 0.0, sti(20) );//to E
						CreateParticleSystem("gunfire_red" , 1.3, 4.2, -4.1, 0.0, 1.5, 0.0, sti(20) );
						CreateParticleSystem("gunfire_red" , 1.5, 4.2, -4.1, 0.0, 1.5, 0.0, sti(20) );

						CreateParticleSystem("gunfire" , 1.3, 4.2, -4.1, 0.0, 1.5, 0.0, sti(20) );
						CreateParticleSystem("gunfire" , 1.5, 4.2, -4.1, 0.0, 1.5, 0.0, sti(20) );
					}

					if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_S1")
					{
						CreateParticleSystem("smoke_short" , -0.4, 4.2, -5.2, 4.5, 1.5, 0.0, sti(20) );
						CreateParticleSystem("smoke_short" , -0.4, 4.2, -5.2, 4.5, 1.5, 0.0, sti(20) );

						CreateParticleSystem("gunfire_red" , -0.4, 4.2, -5.6, 0.0, 3.0, 0.0, sti(20) );
						CreateParticleSystem("gunfire_red" , -0.4, 4.2, -5.8, 0.0, 3.0, 0.0, sti(20) );
						CreateParticleSystem("gunfire_red" , -0.4, 4.2, -6.0, 0.0, 3.0, 0.0, sti(20) );

						CreateParticleSystem("gunfire" , -0.4, 4.2, -5.8, 0.0, 3.0, 0.0, sti(20) );
						CreateParticleSystem("gunfire" , -0.4, 4.2, -6.0, 0.0, 3.0, 0.0, sti(20) );
					}

					if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_S1X")
					{
						CreateParticleSystem("smoke_short" , 0.0, 4.2, -5.2, 4.5, 1.5, 0.0, sti(20) );
						CreateParticleSystem("smoke_short" , 0.0, 4.2, -5.2, 4.5, 1.5, 0.0, sti(20) );

						CreateParticleSystem("gunfire_red" , 0.0, 4.2, -5.6, 0.0, 3.0, 0.0, sti(20) );
						CreateParticleSystem("gunfire_red" , 0.0, 4.2, -5.8, 0.0, 3.0, 0.0, sti(20) );
						CreateParticleSystem("gunfire_red" , 0.0, 4.2, -6.0, 0.0, 3.0, 0.0, sti(20) );

						CreateParticleSystem("gunfire" , 0.0, 4.2, -5.8, 0.0, 3.0, 0.0, sti(20) );
						CreateParticleSystem("gunfire" , 0.0, 4.2, -6.0, 0.0, 3.0, 0.0, sti(20) );
					}

					if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_S0")
					{
						CreateParticleSystem("smoke_short" , -0.4, 3.3, -5.2, 4.5, 1.5, 0.0, sti(20) );
						CreateParticleSystem("smoke_short" , -0.4, 3.3, -5.2, 4.5, 1.5, 0.0, sti(20) );

						CreateParticleSystem("gunfire_red" , -0.4, 3.3, -5.6, 0.0, 3.0, 0.0, sti(20) );
						CreateParticleSystem("gunfire_red" , -0.4, 3.3, -5.8, 0.0, 3.0, 0.0, sti(20) );
						CreateParticleSystem("gunfire_red" , -0.4, 3.3, -6.0, 0.0, 3.0, 0.0, sti(20) );

						CreateParticleSystem("gunfire" , -0.4, 3.3, -5.8, 0.0, 3.0, 0.0, sti(20) );
						CreateParticleSystem("gunfire" , -0.4, 3.3, -6.0, 0.0, 3.0, 0.0, sti(20) );
					}

					if(Pchar.quest.cannon_wad == 1 && Pchar.quest.cannon_ball == 1 && Pchar.quest.cannon_ram == 1)
					{
						//FULL SHOT

						if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_W1")
						{
							PlaySound("OBJECTS\SHIPCHARGE\LG18J.wav");
							PlaySound("OBJECTS\SHIPCHARGE\LG18J.wav");

							LAi_QuestDelay("guncrew_W1_long", 0.25);
						}

						if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_N1")
						{
							PlaySound("OBJECTS\DUEL\pistol_musket.wav");
							PlaySound("OBJECTS\DUEL\pistol_musket.wav");

							LAi_QuestDelay("guncrew_N1_long", 0.25);
						}

						if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_E1")
						{
							PlaySound("OBJECTS\SHIPCHARGE\LG18J.wav");
							PlaySound("OBJECTS\SHIPCHARGE\LG18J.wav");

							LAi_QuestDelay("guncrew_E1_long", 3.5);
						}

						if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_S1")
						{
							PlaySound("OBJECTS\SHIPCHARGE\LG18J.wav");
							PlaySound("OBJECTS\SHIPCHARGE\LG18J.wav");

							LAi_QuestDelay("guncrew_S1_long", 0.5);
						}

						if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_S1X")
						{
							PlaySound("OBJECTS\SHIPCHARGE\LG18J.wav");
							PlaySound("OBJECTS\SHIPCHARGE\LG18J.wav");

							LAi_QuestDelay("guncrew_S1X_long", 0.5);
						}

						if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_S0")
						{
							PlaySound("OBJECTS\DUEL\pistol_musket.wav");
							PlaySound("OBJECTS\DUEL\pistol_musket.wav");

							LAi_QuestDelay("guncrew_S0_long", 0.5);
						}
					}
					else
					{
						if(Pchar.quest.cannon_ball == 0)
						{
							//BLIND SHOT

							PlaySound("OBJECTS\DUEL\pistol_musket.wav");
							PlaySound("OBJECTS\DUEL\pistol_musket.wav");

							//Log_SetStringToLog("2222222222222222222");
							LAi_QuestDelay("guncrew_pchar_player", 2.0);
						}
					}
					else
					{
						//BAD SHOT

							PlaySound("OBJECTS\DUEL\pistol_musket.wav");
							PlaySound("OBJECTS\DUEL\pistol_musket.wav");

							if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_W1")
								LAi_QuestDelay("guncrew_W1_short", 0.25);

							if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_N1")
								LAi_QuestDelay("guncrew_N1_short", 0.25);

							if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_E1")
								LAi_QuestDelay("guncrew_E1_short", 1.0);

							if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_S1")
								LAi_QuestDelay("guncrew_S1_short", 0.5);

							if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_S1X")
								LAi_QuestDelay("guncrew_S1X_short", 0.5);

							if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_S0")
								LAi_QuestDelay("guncrew_S0_short", 0.5);

							LAi_QuestDelay("guncrew_pchar_player", 2.0);
					}

					Pchar.quest.cannon_powder = "0";
					Pchar.quest.cannon_wad = "0";
					Pchar.quest.cannon_ball = "0";
					Pchar.quest.cannon_ram = "0";
					Pchar.quest.cannon_temp = "hot";

					//LogIt("cannon powder = " + Pchar.quest.cannon_powder);
					//LogIt("cannon wad = " + Pchar.quest.cannon_wad);
					//LogIt("cannon temperature = " + Pchar.quest.cannon_temp);

					LAi_QuestDelay("guncrew_shot_pchar_turn", 1.0);//he has not the time for that, but it makes him sheath the powderhorn
					LAi_QuestDelay("guncrew_longer_smoke", 5.0);	//white smoke
				break;

				case "2":
					//EXPLOSION SHOT

					PauseAllSounds();
					PlaySound("OBJECTS\DUEL\pistol_musket.wav");
					PlaySound("OBJECTS\SHIPCHARGE\cannon_fire1.wav");
					PlaySound("OBJECTS\SHIPCHARGE\LG42H.wav");
					PlayStereoSound("OBJECTS\SHIPCHARGE\gunpowder_explosion.wav");
					PlaySound("PEOPLE\roof_broken2.wav");

					GetCharacterPos(Pchar, &u, &v, &w);

					CreateParticleSystem("fort_fire" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
					CreateParticleSystem("fort_fire" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
					CreateParticleSystem("fort_fire" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
					CreateParticleSystem("fort_fire" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
					CreateParticleSystem("fort_fire" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

					CreateParticleSystem("canfire" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
					CreateParticleSystem("canfire" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
					CreateParticleSystem("canfire" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
					CreateParticleSystem("canfire" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
					CreateParticleSystem("canfire" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

					CreateParticleSystem("gunfire_red" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
					CreateParticleSystem("gunfire_red" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
					CreateParticleSystem("gunfire_red" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
					CreateParticleSystem("gunfire_red" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
					CreateParticleSystem("gunfire_red" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

					CreateParticleSystem("stars_fire" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
					CreateParticleSystem("stars_fire" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
					CreateParticleSystem("stars_fire" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
					CreateParticleSystem("stars_fire" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
					CreateParticleSystem("stars_fire" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

					CreateParticleSystem("cancloud" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
					CreateParticleSystem("cancloud" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
					CreateParticleSystem("cancloud" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
					CreateParticleSystem("cancloud" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
					CreateParticleSystem("cancloud" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

					CreateParticleSystem("splinters", u, v+1.8, W, 0.0, 0.0, 0.0, 0);
					CreateParticleSystem("splinters", u-0.5, v+1.0, W, 0.0, 0.0, 0.0, 0);
					CreateParticleSystem("splinters2", u, v+1.8, w, 0.0, 0.0, 0.0, 0);
					CreateParticleSystem("splinters2", u-0.5, v+1.0, w, 0.0, 0.0, 0.0, 0);

					LAi_KillCharacter(CharacterFromID("guncrew_1"));
					LAi_KillCharacter(CharacterFromID("guncrew_2"));
					LAi_KillCharacter(CharacterFromID("guncrew_3"));
					LAi_KillCharacter(CharacterFromID("guncrew_4"));

					LAi_QuestDelay("dead_by_minebomb", 1.0);
				break;
			}
		break;
	//----------------------------------------------------------------------------------------
		case "guncrew_longer_smoke":
			//Log_SetStringToLog("44444444444444444");
			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_W1")
			{
				CreateParticleSystem("smoke_short" , -1.4, 4.2, -4.1, 4.5, 1.5, 0.0, sti(20) );
				CreateParticleSystem("smoke_short" , -1.4, 4.2, -4.1, 4.5, 1.5, 0.0, sti(20) );
			}

			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_N1")
			{
				CreateParticleSystem("smoke_short" , -0.4, 4.2, -3.0, 4.5, 1.5, 0.0, sti(20) );
				CreateParticleSystem("smoke_short" , -0.4, 4.2, -3.0, 4.5, 1.5, 0.0, sti(20) );
			}

			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_E1")
			{
				CreateParticleSystem("smoke_short" , 0.7, 4.2, -4.1, 4.5, 1.5, 0.0, sti(20) );
				CreateParticleSystem("smoke_short" , 0.7, 4.2, -4.1, 4.5, 1.5, 0.0, sti(20) );
			}

			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_S1")
			{
				CreateParticleSystem("smoke_short" , -0.4, 4.2, -5.2, 4.5, 1.5, 0.0, sti(20) );
				CreateParticleSystem("smoke_short" , -0.4, 4.2, -5.2, 4.5, 1.5, 0.0, sti(20) );
			}

			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_S1X")
			{
				CreateParticleSystem("smoke_short" , 0.0, 4.2, -5.2, 4.5, 1.5, 0.0, sti(20) );
				CreateParticleSystem("smoke_short" , 0.0, 4.2, -5.2, 4.5, 1.5, 0.0, sti(20) );
			}

			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_S0")
			{
				CreateParticleSystem("smoke_short" , -0.4, 3.3, -5.2, 4.5, 1.5, 0.0, sti(20) );
				CreateParticleSystem("smoke_short" , -0.4, 3.3, -5.2, 4.5, 1.5, 0.0, sti(20) );
			}

			LAi_QuestDelay("guncrew_longer_smoke1", 5.0);	//white smoke
		break;

		case "guncrew_longer_smoke1":
			//Log_SetStringToLog("55555555555555555");
			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_W1")
				CreateParticleSystem("smoke_short" , -1.4, 4.2, -4.1, 4.5, 1.5, 0.0, sti(20) );

			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_N1")
				CreateParticleSystem("smoke_short" , -0.4, 4.2, -3.0, 4.5, 1.5, 0.0, sti(20) );

			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_E1")
				CreateParticleSystem("smoke_short" , 0.7, 4.2, -4.1, 4.5, 1.5, 0.0, sti(20) );

			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_S1")
				CreateParticleSystem("smoke_short" , -0.4, 4.2, -5.2, 4.5, 1.5, 0.0, sti(20) );

			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_S1X")
				CreateParticleSystem("smoke_short" , 0.0, 4.2, -5.2, 4.5, 1.5, 0.0, sti(20) );

			if(Locations[FindLocation("wr_ships")].models.always.l4 == "cannon_S0")
				CreateParticleSystem("smoke_short" , -0.4, 3.3, -5.2, 4.5, 1.5, 0.0, sti(20) );

			LAi_QuestDelay("guncrew_longer_hot", 50.0); //hot in total 60 sec
		break;

		case "guncrew_longer_hot":
			if(Pchar.quest.cannon_temp == "hot") Pchar.quest.cannon_temp = "cold";
			//LogIt("cannon temperature = " + Pchar.quest.cannon_temp);
		break;
	//----------------------------------------------------------------------------------------
		case "guncrew_shot_pchar_turn":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "sidestep7");
		break;
	//----------------------------------------------------------------------------------------
		case "guncrew_pchar_player":
			LAi_SetPlayerType(Pchar);

			if(LAi_IsFightMode(Pchar))
			{
				//Log_SetStringToLog("BBBBBBBBBBBBBBBBBB");
				LAi_SetFightMode(Pchar, false);			//needed sometimes!
			}

			if(IsEquipCharacterByItem(Pchar, "bladepowderhornA"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);		//may be needed - it has occured that wrong phorn (A) is equiped
				TakeItemFromCharacter(Pchar, "bladepowderhornA");
				GiveItem2Character(Pchar,"bladepowderhornP");
				EquipCharacterByItem(Pchar, "bladepowderhornP");
			}
		break;
	//----------------------------------------------------------------------------------------
		case "guncrew_E1_long":
			CreateParticleSystemX("ball_splash", 66.0, 0.0, -4.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", 66.0, 1.0, -4.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", 66.0, 2.0, -4.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", 66.0, 3.0, -4.1, 0.0, 0.0, 0.0, 0);

			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");

			LAi_SetPlayerType(Pchar);
		break;
	//-----------------------------------------------------------
		case "guncrew_E1_short":
			//Log_SetStringToLog("E short E short E short");
			CreateParticleSystemX("ball_splash", 33.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", 33.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", 33.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", 33.0, 3.0, 0.0, 0.0, 0.0, 0.0, 0);

			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");

			LAi_SetPlayerType(Pchar);
		break;
	//----------------------------------------------------------------------------------------
		case "guncrew_W1_long":
			PlaySound("PEOPLE\place_planks.wav");
			PlaySound("PEOPLE\wood2.wav");
			PlaySound("PEOPLE\wood3.wav");
			PlaySound("PEOPLE\roof_broken1.wav");

			CreateParticleSystem("splinters", -4.1, 4.3, -4.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -4.1, 4.3, -4.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", -4.1, 4.4, -4.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -4.1, 4.4, -4.1, 0.0, 0.0, 0.0, 0);

			CreateParticleSystem("canfire" , -4.1, 4.3, -4.1, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , -4.1, 4.3, -4.1, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("smoke_inv_short" , -4.1, 4.3, -4.1, 4.5, 1.5, 0.0, sti(20) );

			LAi_QuestDelay("guncrew_W1_long1", 3.25);
		break;

		case "guncrew_W1_long1":
			CreateParticleSystemX("ball_splash", -66.8, 0.0, -4.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", -66.8, 1.0, -4.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", -66.8, 2.0, -4.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", -66.8, 3.0, -4.1, 0.0, 0.0, 0.0, 0);

			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("guncrew_W_extra_blacksmoke", 1.5);
		break;

		case "guncrew_W_extra_blacksmoke":
			CreateParticleSystem("smoke_inv_short" , -4.1, 4.3, -4.1, 4.5, 1.5, 0.0, sti(20) );
		break;
	//-----------------------------------------------------------
		case "guncrew_W1_short":
			PlaySound("PEOPLE\place_planks.wav");
			PlaySound("PEOPLE\wood2.wav");
			PlaySound("PEOPLE\wood3.wav");

			CreateParticleSystem("splinters", -4.1, 4.3, -4.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -4.1, 4.3, -4.1, 0.0, 0.0, 0.0, 0);

			CreateParticleSystem("canfire" , -4.1, 4.3, -4.1, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , -4.1, 4.3, -4.1, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("smoke_inv_short" , -4.1, 4.3, -4.1, 4.5, 1.5, 0.0, sti(20) );

			LAi_QuestDelay("guncrew_W1_short1", 0.75);
		break;

		case "guncrew_W1_short1":
			CreateParticleSystemX("ball_splash", -33.8, 0.0, -8.2, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", -33.8, 1.0, -8.2, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", -33.8, 2.0, -8.2, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", -33.8, 3.0, -8.2, 0.0, 0.0, 0.0, 0);

			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");

			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("guncrew_W_extra_blacksmoke", 4.0);
		break;
	//----------------------------------------------------------------------------------------
		case "guncrew_N1_long":
			PlaySound("PEOPLE\place_planks.wav");
			PlaySound("PEOPLE\wood2.wav");
			PlaySound("PEOPLE\wood3.wav");
			PlaySound("PEOPLE\roof_broken1.wav");

			CreateParticleSystem("splinters", -0.4, 4.2, -1.6, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -0.4, 4.2, -1.6, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", -0.4, 4.2, -1.6, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -0.4, 4.2, -1.6, 0.0, 0.0, 0.0, 0);

			CreateParticleSystem("canfire" , -0.4, 4.2, -1.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , -0.4, 4.2, -1.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("smoke_inv_short" , -0.4, 4.2, -1.6, 4.5, 1.5, 0.0, sti(20) );

			LAi_QuestDelay("guncrew_N1_long1A", 1.0);
			LAi_QuestDelay("guncrew_N1_long1B", 4.0);
		break;

		case "guncrew_N1_long1A":
			PlaySound("OBJECTS\SHIPCHARGE\mast_fall3.wav");
		break;

		case "guncrew_N1_long1B":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead1.wav");

			LAi_tmpl_ani_PlayAnimation(Pchar, "afraid", 3.0);
			PlaySound("PEOPLE\roof_creak.wav");

			LAi_QuestDelay("guncrew_N1_long2", 4.0);
		break;

		case "guncrew_N1_long2":
			Locations[FindLocation("wr_ships")].models.always.l16 = "Flotsam12";
			DoQuestReloadToLocation("wr_ships", "goto", "fire", "guncrew_N1_long3");
		break;

		case "guncrew_N1_long3":
			CreateParticleSystem("splinters", -0.4, 3.6, -4.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -0.4, 3.6, -4.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("blast_dirt", -0.4, 3.6, -4.1, -0.4, 3.6, -4.1, 10);
			CreateParticleSystemX("blast_dirt", -0.4, 3.6, -4.1, -0.4, 3.6, -4.1, 10);
			CreateParticleSystemX("blast_dirt", -0.4, 3.6, -4.1, -0.4, 3.6, -4.1, 10);
			CreateParticleSystemX("blast_dirt", -0.4, 3.6, -4.1, -0.4, 3.6, -4.1, 10);
			PlaySound("OBJECTS\SHIPCHARGE\gunpowder_explosion.wav");
			PlaySound("PEOPLE\wood3.wav");

			LAi_KillCharacter(CharacterFromID("guncrew_1"));
			LAi_KillCharacter(CharacterFromID("guncrew_2"));
			LAi_KillCharacter(CharacterFromID("guncrew_3"));
			LAi_KillCharacter(CharacterFromID("guncrew_4"));

			LAi_QuestDelay("dead_by_minebomb", 0.01);
		break;
	//-----------------------------------------------------------
		case "guncrew_N1_short":
			PlaySound("PEOPLE\wood2.wav");
			PlaySound("PEOPLE\wood3.wav");
			PlaySound("PEOPLE\wood3.wav");

			CreateParticleSystem("splinters", -0.4, 4.2, -1.6, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -0.4, 4.2, -1.6, 0.0, 0.0, 0.0, 0);

			CreateParticleSystem("canfire" , -0.4, 4.2, -1.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , -0.4, 4.2, -1.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("smoke_inv_short" , -0.4, 4.2, -1.6, 4.5, 1.5, 0.0, sti(20) );

			LAi_QuestDelay("guncrew_N1_short1", 0.75);
		break;

		case "guncrew_N1_short1":
			PlaySound("PEOPLE\creak.wav");

			LAi_QuestDelay("guncrew_N1_short2", 0.75);
		break;

		case "guncrew_N1_short2":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead1.wav");

			LAi_SetPlayerType(Pchar);
		break;
	//----------------------------------------------------------------------------------------
		case "guncrew_S1_long":
			if(CheckAttribute(Pchar, "quest.deck_bell") && Pchar.quest.deck_bell == "broken")
			{
				PlaySound("INTERFACE\bell_broken.wav");
			}
			else
			{
				PlaySound("INTERFACE\bell2.wav");
				LAi_QuestDelay("Long_runs_away", 0.1);
			}
			PlaySound("PEOPLE\wood2.wav");

			CreateParticleSystem("splinters", -0.3, 6.2, -11.7, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -0.3, 6.2, -11.7, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", -0.3, 6.2, -11.7, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -0.3, 6.2, -11.7, 0.0, 0.0, 0.0, 0);

			CreateParticleSystem("canfire" , -0.3, 6.2, -11.7, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , -0.3, 6.2, -11.7, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("guncrew_longer_bell", 0.5);
			LAi_QuestDelay("guncrew_S1_long1", 3.0);
		break;

		case "guncrew_longer_bell":
			if(CheckAttribute(Pchar, "quest.deck_bell") && Pchar.quest.deck_bell == "broken")
			{
				PlaySound("INTERFACE\bell_broken.wav");
			}
			else PlaySound("INTERFACE\bell2.wav");

			LAi_QuestDelay("guncrew_longer_bell1", 0.75);
		break;

		case "guncrew_longer_bell1":
			if(CheckAttribute(Pchar, "quest.deck_bell") && Pchar.quest.deck_bell == "broken")
			{
				PlaySound("INTERFACE\bell_broken.wav");
			}
			else PlaySound("INTERFACE\bell2.wav");

			LAi_QuestDelay("guncrew_longer_bell2", 1.25);
		break;

		case "guncrew_longer_bell2":
			if(CheckAttribute(Pchar, "quest.deck_bell") && Pchar.quest.deck_bell == "broken")
			{
				PlaySound("INTERFACE\bell_broken.wav");
			}
			else PlaySound("INTERFACE\bell2.wav");
		break;

		case "guncrew_S1_long1":
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");

			LAi_SetPlayerType(Pchar);
			Pchar.quest.cannon_enable_move = "yes";
			Pchar.quest.deck_bell = "broken";
		break;
	//-----------------------------------------------------------
		case "guncrew_S1_short":
			if(CheckAttribute(Pchar, "quest.deck_bell") && Pchar.quest.deck_bell == "broken")
			{
				PlaySound("INTERFACE\bell_broken.wav");
			}
			else
			{
				PlaySound("INTERFACE\bell2.wav");
				LAi_QuestDelay("Long_runs_away", 0.1);
			}
			PlaySound("PEOPLE\wood2.wav");

			CreateParticleSystem("splinters", -0.3, 6.2, -11.7, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -0.3, 6.2, -11.7, 0.0, 0.0, 0.0, 0);

			CreateParticleSystem("canfire" , -0.3, 6.2, -11.7, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , -0.3, 6.2, -11.7, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("guncrew_S1_short1", 1.0);
		break;

		case "guncrew_S1_short1":
			LAi_SetPlayerType(Pchar);
			Pchar.quest.cannon_enable_move = "yes";
			Pchar.quest.deck_bell = "broken";

			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
		break;
	//----------------------------------------------------------------------------------------
		case "Long_runs_away":
			PlaySound("VOICE\ENGLISH\Eng_m_c_071.wav");
			LAi_SetActorType(CharacterFromID("wr_aub"));
			LAi_ActorRunToLocator(CharacterFromID("wr_aub"), "reload", "reload5", "Long_runs_away1", 3.0);
		break;

		case "Long_runs_away1":
			PlaySound("INTERFACE\closed_locked_door.wav");
			ChangeCharacterAddressGroup(CharacterFromID("wr_aub"), "none", "", "");

			LAi_SetSitType(CharacterFromID("wr_aub"));
			ChangeCharacterAddressGroup(CharacterFromID("wr_aub"), "wr_corv_capmd", "sit", "sit0");
		break;

		case "guncrew_S1X_long":
			PlaySound("PEOPLE\roof_broken1.wav");
			PlaySound("PEOPLE\roof_broken1.wav");
			PlaySound("PEOPLE\wood2.wav");
			PlaySound("PEOPLE\wood3.wav");
			PlaySound("INTERFACE\barrel_roll.wav");

			CreateParticleSystem("smoke_short" , 0.0, 4.2, -5.2, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 0.0, 4.2, -5.2, 4.5, 1.5, 0.0, sti(20) );

			CreateParticleSystem("splinters", 0.4, 6.7, -13.3, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 0.4, 6.7, -13.3, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", 0.4, 6.7, -13.3, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 0.4, 6.7, -13.3, 0.0, 0.0, 0.0, 0);

			CreateParticleSystem("canfire" , 0.4, 6.7, -13.3, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 0.5, 4.7, -13.4, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 0.5, 4.9, -13.4, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 0.4, 4.8, -13.4, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 0.6, 4.8, -13.4, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("guncrew_S1X_long1", 2.0);
		break;

		case "guncrew_S1X_long1":
			Locations[FindLocation("wr_ships")].models.always.l3 = "";

			Locations[FindLocation("wr_ships")].image = "";
			DoQuestReloadToLocation("wr_ships", "goto", "fire", "guncrew_S1X_long2");
		break;

		case "guncrew_S1X_long2":
			Locations[FindLocation("wr_ships")].image = "wr_ships.tga";

			CreateParticleSystem("smoke_short" , 0.0, 4.2, -5.2, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 0.0, 4.2, -5.2, 4.5, 1.5, 0.0, sti(20) );

			CreateParticleSystem("blast_dirt" , 0.5, 4.7, -13.4, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 0.5, 4.9, -13.4, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 0.4, 4.8, -13.4, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 0.6, 4.8, -13.4, 0.0, 0.0, 0.0, sti(20) );
			LAi_SetPlayerType(Pchar);
			Pchar.quest.cannon_goodspile = "gone";

			LAi_QuestDelay("guncrew_S1X_long3", 1.5);
		break;

		case "guncrew_S1X_long3":
			CreateParticleSystem("blast_dirt" , 0.5, 4.7, -13.4, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 0.5, 4.9, -13.4, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 0.4, 4.8, -13.4, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 0.6, 4.8, -13.4, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("guncrew_S1X_long4", 1.5);
		break;

		case "guncrew_S1X_long4":
			CreateParticleSystem("blast_dirt" , 0.5, 4.7, -13.4, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 0.5, 4.9, -13.4, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 0.4, 4.8, -13.4, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 0.6, 4.8, -13.4, 0.0, 0.0, 0.0, sti(20) );
		break;
	//-----------------------------------------------------------
		case "guncrew_S1X_short":
			PlaySound("PEOPLE\wood2.wav");
			PlaySound("PEOPLE\wood3.wav");
			PlaySound("PEOPLE\wood3.wav");

			CreateParticleSystem("splinters", 0.3, 4.6, -10.9, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 0.3, 4.6, -10.9, 0.0, 0.0, 0.0, 0);

			CreateParticleSystem("canfire" , 0.3, 4.6, -10.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 0.3, 4.6, -10.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("smoke_inv_short" , 0.3, 4.6, -10.9, 4.5, 1.5, 0.0, sti(20) );

			LAi_QuestDelay("guncrew_S1X_short1", 1.0);
		break;

		case "guncrew_S1X_short1":
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("guncrew_S1X_short2", 3.5);
		break;

		case "guncrew_S1X_short2":
			CreateParticleSystem("smoke_inv_short" , 0.3, 4.6, -10.9, 4.5, 1.5, 0.0, sti(20) );
		break;
	//----------------------------------------------------------------------------------------
		case "corv_crew_entre":
			locations[FindLocation(Pchar.location)].box1.items.bladebottle_CT1_sulf = 1;
			locations[FindLocation(Pchar.location)].box1.items.bladebottle_CT1_nitr = 1;
			locations[FindLocation(Pchar.location)].box1.items.pistolsalt = 12;
			//locations[FindLocation(Pchar.location)].box1.items.book44 = 1;

			LAi_QuestDelay("H2SO4_check", 0.1);
			LAi_QuestDelay("salt_check", 0.1);

			pchar.quest.see_belt_from_crew.win_condition.l1 = "locator";
			pchar.quest.see_belt_from_crew.win_condition.l1.location = "wr_corv_crew";
			pchar.quest.see_belt_from_crew.win_condition.l1.locator_group = "goto";
			pchar.quest.see_belt_from_crew.win_condition.l1.locator = "see_belt";
			pchar.quest.see_belt_from_crew.win_condition = "see_belt_from_crew";
		break;

		case "H2SO4_check":
			if(CheckCharacterItem(Pchar,"bladebottle_CT1_sulf"))
			{
				PlaySound("INTERFACE\button2.wav");
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladebottle_CT1_sulf");
			}
			else LAi_QuestDelay("H2SO4_check", 0.5);	//loops until item picked up
		break;

		case "salt_check":
			int salt = GetCharacterItem(Pchar, "pistolsalt");

			if(salt == 12)
			{
				PlaySound("PEOPLE\grass_noise.wav");
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "pistolsalt");

				if(CheckAttribute(Pchar,"quest.qbook_open_gold") && Pchar.quest.qbook_open_gold == "done")
				{
					Pchar.quest.Minerva_gold ="info";
				}

				LAi_QuestDelay("CA2_check", 0.1);
			}
			else LAi_QuestDelay("salt_check", 0.5);	//loops until item picked up
		break;

		case "see_belt_from_crew":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "turn_to_belt");

			LAi_QuestDelay("see_belt_from_crew1", 0.5);
		break;

		case "see_belt_from_crew1":
			LAi_SetStayType(Pchar);

			if(CheckAttribute(Pchar,"quest.qbook_belt_from_crew") && Pchar.quest.qbook_belt_from_crew == "done")
			{

			}
			else
			{
				PlaySound("VOICE\ENGLISH\blaze_hah.wav");
				Logit(LanguageConvertString(tmpLangFileID,"There is that Belt again!"));
				Pchar.quest.qbook_belt_from_crew = "done";
				AddQuestRecord("Woodes_Rogers_reward_7", "3");
			}

			LAi_QuestDelay("Pchar_playertype", 2.0);
		break;
	//----------------------------------------------------------------------------------------
		case "bad_drink_sound":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead7.wav");
		break;
	//----------------------------------------------------------------------------------------
		case "gold_door_backoff":
			//from "remove_planks_hold7"
			pchar.quest.gold_door_backoff1.win_condition.l1 = "locator";
			pchar.quest.gold_door_backoff1.win_condition.l1.location = "wr_gall_deck2_stern";
			pchar.quest.gold_door_backoff1.win_condition.l1.locator_group = "reload";
			pchar.quest.gold_door_backoff1.win_condition.l1.locator = "reload5";
			pchar.quest.gold_door_backoff1.win_condition = "gold_door_backoff1";
		break;

		case "gold_door_backoff1":
			//Pchar.quest.Minerva_gold ="info";			//moved to p.u. salt
			//LogIt("Minerva_gold = " + Pchar.quest.Minerva_gold);

			if(CheckCharacterItem(Pchar,"bladebottle_CA2"))
			{
				return;			//ends this loop
			}
			else LAi_QuestDelay("gold_door_backoff2", 2.0);
		break;

		case "gold_door_backoff2":
			ChangeCharacterAddressGroup(Pchar, "wr_gall_deck2_stern", "reload", "reload4");
			PlaySound("PEOPLE\jump.wav");

			LAi_QuestDelay("gold_door_backoff", 0.1);
		break;

	//----------------------------------------------------------------------------------------
		case "CA2_check":
			Pchar.quest.CA2_check1.win_condition.l1 = "item";
			Pchar.quest.CA2_check1.win_condition.l1.character = Pchar.id;
			Pchar.quest.CA2_check1.win_condition.l1.item = "bladebottle_CA2";
			Pchar.quest.CA2_check1.win_condition = "CA2_check1";
		break;

		case "CA2_check1":
				//Locations[FindLocation("wr_gall_deck2_stern")].reload.l4.emerge = "goto3";	//temp while unlocking
			//Locations[FindLocation("wr_gall_deck2_stern")].locators_radius.reload.reload5 = 0.001;
			//Locations[FindLocation("wr_gall_deck2_stern")].locators_radius.box.box11 = 1.0;
		break;

		case "acid_gold_door":
			PlaySound("INTERFACE\bottle_molasses.wav");
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladebottle_CA2");
			GiveItem2Character(Pchar,"bladebottle_CE0");
			EquipCharacterByItem(Pchar, "bladebottle_CE0");

			LAi_QuestDelay("acid_gold_door1", 3.0);
		break;

		case "acid_gold_door1":
			if(LAi_IsFightMode(Pchar))
			{
				LAi_SetFightMode(Pchar, false);
			}
			PlaySound("INTERFACE\fire_off.wav");
			CreateParticleSystem("smoke_short" , 0.0, 17.4, -6.3, 0.0, 1.5, 0.0, sti(20) );

			LAi_QuestDelay("acid_gold_door2", 4.0);
		break;

		case "acid_gold_door2":
			PlaySound("INTERFACE\closet_Open.wav");

			LAi_QuestDelay("acid_gold_door3", 1.0);
		break;

		case "acid_gold_door3":
			DoQuestReloadToLocation("wr_gall_cap_outer", "goto", "goto4", "enter_gall_cap_outer");
		break;

		case "enter_gall_cap_outer":
			LAi_SetStayType(Pchar);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			CloseQuestHeader("Alchemy_gold");

			LAi_QuestDelay("enter_gall_cap_outer1", 0.5);
		break;

		case "enter_gall_cap_outer1":
			//remove all alchemy stuff
			Logit(LanguageConvertString(tmpLangFileID,"I don't bother to carry these bottles any more!!!"));
			PlaySound("AMBIENT\TAVERN\tinkle4.wav");
			PlaySound("AMBIENT\TAVERN\drop4.wav");

			TakeNItems(Pchar, "bladebottle_CE0", -20); TakeNItems(Pchar, "bladebottle_CW1", -20); TakeNItems(Pchar, "bladebottle_CT1_sulf", -20);
			TakeNItems(Pchar, "bladebottle_CT1_nitr", -20); TakeNItems(Pchar, "bladebottle_CT1_hydr", -20); TakeNItems(Pchar, "bladebottle_CT1_hydrnitr", -20);
			TakeNItems(Pchar, "bladebottle_CT2_sulf_w", -20); TakeNItems(Pchar, "bladebottle_CT2_sulf_c", -20); TakeNItems(Pchar, "bladebottle_CT2_hydr", -20);
			TakeNItems(Pchar, "bladebottle_CT2_hydrnitr", -20); TakeNItems(Pchar, "bladebottle_CA2", -20); TakeNItems(Pchar, "bladebottle_CG2", -20);
			TakeNItems(Pchar, "bladebottle_CP2", -20); TakeNItems(Pchar, "bladetop", -20); TakeNItems(Pchar, "bladebottle_CT2_nitr_w", -20)
			TakeNItems(Pchar, "bladebottle_CB1", -20);;

			TakeNItems(Pchar, "pistolretort", -20); TakeNItems(Pchar, "pistolglass_tube", -20); TakeNItems(Pchar, "pistolcopperas", -20);
			TakeNItems(Pchar, "pistolnitre", -20); TakeNItems(Pchar, "pistolsalt", -20);

			EquipCharacterByItem(Pchar, "bladepowderhornP");
			EquipCharacterByItem(Pchar, "pistol203");

			Pchar.quest.gold_door = "open";
			Locations[FindLocation("wr_gall_deck2_stern")].locators_radius.reload.reload5 = 0.001;
			Locations[FindLocation("wr_gall_deck2_stern")].locators_radius.box.box11 = 0.0001;
			Locations[FindLocation("wr_gall_deck2_stern")].locators_radius.reload.reload4 = 1.0;
			Locations[FindLocation("wr_gall_deck2_stern")].locators_radius.box.box12 = 0.0001;
			Locations[FindLocation("wr_gall_cap_outer")].id.label = "Captain's deck";

			LAi_QuestDelay("enter_gall_cap_outer2", 1.0);

			pchar.quest.cap_outer_backloop_A.win_condition.l1 = "locator";
			pchar.quest.cap_outer_backloop_A.win_condition.l1.location = "wr_gall_cap_outer";
			pchar.quest.cap_outer_backloop_A.win_condition.l1.locator_group = "goto";
			pchar.quest.cap_outer_backloop_A.win_condition.l1.locator = "goto7";
			pchar.quest.cap_outer_backloop_A.win_condition = "cap_outer_backloop_A";
		break;

		case "enter_gall_cap_outer2":
			LAi_SetPlayerType(Pchar);
			PlaySound("VOICE\ENGLISH\guncrew_2.wav");
			ChangeCharacterAddressGroup(characterFromID("guncrew_2"), "wr_gall_cap_outer", "goto", "vane14");
		break;
//.....................................................................................................................
		case "cap_outer_backloop":
			pchar.quest.cap_outer_backloop_A.win_condition.l1 = "locator";
			pchar.quest.cap_outer_backloop_A.win_condition.l1.location = "wr_gall_cap_outer";
			pchar.quest.cap_outer_backloop_A.win_condition.l1.locator_group = "goto";
			pchar.quest.cap_outer_backloop_A.win_condition.l1.locator = "goto7";
			pchar.quest.cap_outer_backloop_A.win_condition = "cap_outer_backloop_A";
		break;

		case "cap_outer_backloop_A":
			ChangeCharacterAddressGroup(Pchar, "wr_gall_cap_outer", "goto", "goto2");

			LAi_QuestDelay("cap_outer_backloop", 0.1);
		break;
//.....................................................................................................................
		case "cannonballs_again":
			//from itemlogic box...
			Pchar.quest.gall_captain = "open";	//means gunner has cannonballs again
			Logit(LanguageConvertString(tmpLangFileID,"Cannonball storage"));
			PlaySound("PEOPLE\step_iron.wav");
			PlaySound("PEOPLE\step_iron.wav");
			PlaySound("PEOPLE\step_iron.wav");

			LAi_SetFightMode(Pchar, false);

			LAi_QuestDelay("cannonballs_again1", 1.0);
		break;

		case "cannonballs_again1":
			PlaySound("OBJECTS\DUEL\man_attack6.wav");

			LAi_QuestDelay("cannonballs_again2", 1.0);
		break;

		case "cannonballs_again2":
			PlaySound("VOICE\ENGLISH\guncrew_2.wav");
			ChangeCharacterAddressGroup(characterFromID("guncrew_2"), "wr_gall_captain", "reload", "reload1");
			Pchar.quest.gunner2 = "upper_decks";

			LAi_QuestDelay("cannonballs_again3", 1.0);
		break;

		case "cannonballs_again3":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload1");

			LAi_QuestDelay("cannonballs_again3A", 1.0);

			ChangeCharacterAddressGroup(characterFromID("guncrew_2"), "wr_gall_captain", "reload", "reload1");

			LAi_SetActorType(characterFromID("guncrew_2"));
			LAi_ActorGoToLocator(CharacterFromID("guncrew_2"), "goto", "vane4A", "cannonballs_again4", 3.0);
		break;

		case "cannonballs_again3A":
			ChangeCharacterAddressGroup(Pchar, "wr_gall_captain", "goto", "stay9");
		break;

		case "cannonballs_again4":
			LAi_SetActorType(characterFromID("guncrew_2"));
			LAi_ActorGoToLocator(CharacterFromID("guncrew_2"), "goto", "guncrew", "cannonballs_again5", 1.0);
		break;

		case "cannonballs_again5":
			PlaySound("PEOPLE\step_iron.wav");
			PlaySound("PEOPLE\step_iron.wav");
			PlaySound("PEOPLE\step_iron.wav");
			//equip with cannonballs here

			GiveItem2Character(CharacterFromID("guncrew_2"),"bladecannon_ball");
			EquipCharacterByItem(CharacterFromID("guncrew_2"), "bladecannon_ball");
			EquipCharacterByItem(CharacterFromID("guncrew_2"), "pistolrammer");

			LAi_QuestDelay("cannonballs_again6", 1.0);
		break;

		case "cannonballs_again6":
			LAi_SetStayType(Pchar);
			LAi_SetActorType(characterFromID("guncrew_2"));
			LAi_ActorGoToLocator(CharacterFromID("guncrew_2"), "reload", "reload1", "cannonballs_again8", 4.0);//was 3.0

			LAi_QuestDelay("cannonballs_again7", 1.0);
		break;

		case "cannonballs_again7":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload1");
		break;

		case "cannonballs_again8":
			ChangeCharacterAddressGroup(characterFromID("guncrew_2"), "wr_gall_cap_outer", "goto", "goto2");
			LAi_SetPlayerType(Pchar);
			EquipCharacterByItem(Pchar, "bladepowderhornP");
			EquipCharacterByItem(Pchar, "pistol203");
		break;
	//----------------------------------------------------------------------------------------
		case "open_captains_door":
			PlaySound("INTERFACE\klonk.wav");

			Locations[FindLocation("wr_gall_cap_outer")].reload.l2.disable = 0;
			Pchar.quest.captains_door = "open";

			Locations[FindLocation("wr_gall_cap_outer")].reload.l5.disable = 1;
			Locations[FindLocation("wr_gall_cap_outer")].locators_radius.reload.reload1 = 0.00001;
			Locations[FindLocation("wr_gall_cap_outer")].locators_radius.goto.goto7 = 1.5;

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload14");

			LAi_QuestDelay("captains_door1", 1.5);
		break;

		case "captains_door1":
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "wr_ships", "reload", "reload14");
			PlaySound("PEOPLE\Run_wood.wav");
		break;

		case "close_captains_door":
			PlaySound("INTERFACE\rusty.wav");

			Locations[FindLocation("wr_gall_cap_outer")].reload.l2.disable = 1;
			Pchar.quest.captains_door = "closed";

			Locations[FindLocation("wr_gall_cap_outer")].reload.l5.disable = 0;
			Locations[FindLocation("wr_gall_cap_outer")].locators_radius.reload.reload1 = 1.5;
			Locations[FindLocation("wr_gall_cap_outer")].locators_radius.goto.goto7 = 0.00001;

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload14");

			if(CheckAttribute(Pchar,"quest.gunner2") && Pchar.quest.gunner2 == "upper_decks")
			{
				ChangeCharacterAddressGroup(characterFromID("guncrew_1"), "wr_gall_hold_second", "goto", "stay2");
				ChangeCharacterAddressGroup(characterFromID("guncrew_2"), "wr_gall_hold_second", "goto", "stay1");
				ChangeCharacterAddressGroup(characterFromID("guncrew_3"), "wr_gall_hold_second", "goto", "stay4");
				ChangeCharacterAddressGroup(characterFromID("guncrew_4"), "wr_gall_hold_second", "goto", "stay3");
				LAi_SetCitizenType(CharacterFromID("guncrew_1"));
				LAi_SetCitizenType(CharacterFromID("guncrew_2"));
				LAi_SetCitizenType(CharacterFromID("guncrew_3"));
				LAi_SetCitizenType(CharacterFromID("guncrew_4"));
				Characters[GetCharacterIndex("guncrew_1")].quest.meeting = "8";
				Characters[GetCharacterIndex("guncrew_2")].quest.meeting = "8";
				Characters[GetCharacterIndex("guncrew_3")].quest.meeting = "8";
				Characters[GetCharacterIndex("guncrew_4")].quest.meeting = "8";
				Pchar.quest.guncrew = "free_in_hold";
				Pchar.quest.gunner2 = "in_hold";
			}

			LAi_QuestDelay("captains_door1", 1.5);
		break;

		case "captains_door1":
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "wr_ships", "reload", "reload14");
		break;
	//----------------------------------------------------------------------------------------
		case "guncrew_S0_long":
			PlaySound("PEOPLE\roof_broken1.wav");
			PlaySound("PEOPLE\roof_broken1.wav");
			PlaySound("PEOPLE\wood2.wav");
			PlaySound("PEOPLE\wood3.wav");
			PlaySound("PEOPLE\roof_creak.wav");

			CreateParticleSystem("smoke_short" , -0.4, 3.3, -5.2, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , -0.4, 3.3, -5.2, 4.5, 1.5, 0.0, sti(20) );

			CreateParticleSystem("splinters", 0.0, 3.4, -10.8, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 0.0, 3.4, -10.8, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", 0.0, 3.4, -10.8, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 0.0, 3.4, -10.8, 0.0, 0.0, 0.0, 0);

			CreateParticleSystem("canfire" , -0.3, 3.3, -11.7, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 0.0, 3.4, -10.8, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 0.0, 3.4, -10.8, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("smoke_inv_short" , -0.3, 4.0, -10.8, 4.5, 1.5, 0.0, sti(20) );

			LAi_QuestDelay("guncrew_S0_long1", 2.0);
			LAi_QuestDelay("guncrew_S0_extra_blacksmoke", 4.5);
		break;

		case "guncrew_S0_long1":
			Locations[FindLocation("wr_ships")].models.always.l18 = "door_broken";

			Locations[FindLocation("wr_ships")].image = "";
			DoQuestReloadToLocation("wr_ships", "goto", "fire", "guncrew_S0_long2");
		break;

		case "guncrew_S0_long2":
			Locations[FindLocation("wr_ships")].image = "wr_ships.tga";
			Locations[FindLocation("wr_ships")].reload.l5.disable = 0;			//open to capmd
			CloseQuestHeader("Cannon_drill");

			PlaySound("PEOPLE\wood2.wav");

			CreateParticleSystem("smoke_short" , -0.4, 3.3, -5.2, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , -0.4, 3.3, -5.2, 4.5, 1.5, 0.0, sti(20) );

			CreateParticleSystem("blast_dirt" , 0.0, 3.4, -10.8, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 0.0, 3.4, -10.8, 0.0, 0.0, 0.0, sti(20) );

			LAi_SetPlayerType(Pchar);
		break;

		case "guncrew_S0_extra_blacksmoke":
			CreateParticleSystem("smoke_inv_short" , -0.3, 4.0, -10.8, 4.5, 1.5, 0.0, sti(20) );

			LAi_QuestDelay("guncrew_S0_extra_blacksmoke1", 4.5);
		break;

		case "guncrew_S0_extra_blacksmoke1":
			CreateParticleSystem("smoke_inv_short" , -0.3, 4.0, -10.8, 4.5, 1.5, 0.0, sti(20) );

			LAi_QuestDelay("guncrew_S0_extra_blacksmoke2", 4.5);
		break;

		case "guncrew_S0_extra_blacksmoke2":
			CreateParticleSystem("smoke_inv_short" , -0.3, 4.0, -10.8, 4.5, 1.5, 0.0, sti(20) );
		break;
	//----------------------------------------------------------------------------------------
		case "guncrew_S0_short":
			PlaySound("PEOPLE\wood2.wav");
			PlaySound("PEOPLE\wood3.wav");
			PlaySound("PEOPLE\wood3.wav");

			CreateParticleSystem("splinters", -0.3, 6.2, -11.7, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -0.3, 6.2, -11.7, 0.0, 0.0, 0.0, 0);

			CreateParticleSystem("canfire" , -0.3, 3.3, -11.7, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , -0.3, 3.3, -11.7, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("smoke_inv_short" , -0.4, 2.9, -10.7, 4.5, 1.5, 0.0, sti(20) );

			LAi_QuestDelay("guncrew_S0_short1", 1.0);
		break;

		case "guncrew_S0_short1":
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("guncrew_S0_short2", 3.5);
		break;

		case "guncrew_S0_short2":
			CreateParticleSystem("smoke_inv_short" , -0.4, 2.9, -10.7, 4.5, 1.5, 0.0, sti(20) );
		break;
	//----------------------------------------------------------------------------------------
	//----------------------------------------------------------------------------------------
		case "ship_wc":
			Pchar.quest.ship_wc = "start";
			DoQuestReloadToLocation("wr_corv_capsm", "goto", "goto1", "ship_wc1");
		break;

		case "ship_wc1":
			Pchar.quest.seadogs_ammo = "yes";
			Pchar.quest.crew_to_ships = "closed";
			CreateParticleSystemX("ball_splash", 0.9, 3.0, 0.6, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", 0.9, 3.5, 0.6, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", 0.9, 4.0, 0.6, 0.0, 0.0, 0.0, 0);

			LAi_QuestDelay("ship_wc2", 0.5);
			LAi_QuestDelay("compasses_check", 0.1);
			LAi_QuestDelay("tablemap_check", 0.1);

			pchar.quest.take_ammo_seadogs.win_condition.l1 = "location";
			pchar.quest.take_ammo_seadogs.win_condition.l1.location = "wr_corv_crew";
			pchar.quest.take_ammo_seadogs.win_condition = "take_ammo_seadogs";
		break;
	//........................................................................................
		case "take_ammo_seadogs":
			gp = GetCharacterItem(Pchar, "gunpowder");
			pb = GetCharacterItem(Pchar, "pistolbullets");
			if(gp == 0)
			{
				TakenItems(Pchar, "gunpowder", 1);
				Pchar.quest.temp_gunpowder = "yes";
			    	//LogIt("temp_gunpowder = " + Pchar.quest.temp_gunpowder);
			    	//gp = GetCharacterItem(Pchar, "gunpowder");
			    	//LogIt("gp = " + gp);
			}
			if(pb == 0)
			{
				TakenItems(Pchar, "pistolbullets", 1);
				Pchar.quest.temp_pistolbullets = "yes";
			    	//LogIt("temp_pistolbullets = " + Pchar.quest.temp_pistolbullets);
			    	//pb = GetCharacterItem(Pchar, "pistolbullets");
			    	//LogIt("pb = " + pb);
			}

			pchar.quest.give_ammo_seadogs.win_condition.l1 = "location";
			pchar.quest.give_ammo_seadogs.win_condition.l1.location = "wr_corv_deck1";
			pchar.quest.give_ammo_seadogs.win_condition = "give_ammo_seadogs";
		break;

		case "give_ammo_seadogs":
			if(CheckAttribute(Pchar,"quest.temp_gunpowder") && Pchar.quest.temp_gunpowder == "yes")
			{
				TakenItems(Pchar, "gunpowder", -1);
			    	//gp = GetCharacterItem(Pchar, "gunpowder");
			    	//LogIt("gp = " + gp);
				Pchar.quest.temp_gunpowder = "no";
			}
			if(CheckAttribute(Pchar,"quest.temp_pistolbullets") && Pchar.quest.temp_pistolbullets == "yes")
			{
				TakenItems(Pchar, "pistolbullets", -1);
			    	//pb = GetCharacterItem(Pchar, "pistolbullets");
			    	//LogIt("pb = " + pb);
				Pchar.quest.temp_pistolbullets = "no";
			}
		break;
	//........................................................................................
		case "compasses_check":
			if(CheckCharacterItem(Pchar,"bladecompasses"))
			{
				Pchar.quest.cap_inner_gp_box = "locked";

				PlaySound("INTERFACE\button3.wav");
				PlaySound("INTERFACE\button3.wav");
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladecompasses");
				TakeItemFromCharacter(Pchar, "bladepowderhornP");

				if(IsEquipCharacterByItem(Pchar, "powderflask"))
				{
					if(priming >= 12)
					{
						TakeNItems(Pchar,"gunpowder", -100);
						TakeNItems(Pchar,"gunpowder", 12);
					}
				}
				else
				{
					if(priming >= 6)
					{
						TakeNItems(Pchar,"gunpowder", -100);
						TakeNItems(Pchar,"gunpowder", 6);
					}
				}

				SetModel(PChar, "Pira4M_HTUS", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

				Locations[FindLocation("wr_corv_crew")].locators_radius.box.box3 = 1.0;
				Locations[FindLocation("wr_corv_crew")].locators_radius.reload.reload1 = 0.00001;

				LAi_QuestDelay("compasses_and_map", 0.5);
			}
			else LAi_QuestDelay("compasses_check", 0.5);	//loops until item picked up
		break;

		case "tablemap_check":
			if(CheckCharacterItem(Pchar,"chestmap1"))
			{
				PlaySound("INTERFACE\paper.wav");
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "chestmap1");
				GiveItem2Character(Pchar,"pistolmap1");
				EquipCharacterByItem(Pchar, "pistolmap1");

				Locations[FindLocation("wr_corv_crew")].locators_radius.box.box3 = 1.0;
				Locations[FindLocation("wr_corv_crew")].locators_radius.reload.reload1 = 0.00001;

				LAi_QuestDelay("compasses_and_map", 0.5);
			}
			else LAi_QuestDelay("tablemap_check", 0.5);	//loops until item picked up
		break;

		case "compasses_and_map":
			if(CheckCharacterItem(Pchar,"bladecompasses") && CheckCharacterItem(Pchar,"pistolmap1"))
			{
				LAi_SetActorType(pchar);	
				characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "compasses_and_map";
				LAi_ActorSelfDialog(pchar, "");
			}
		break;

		case "compasses_and_map_done":
			AddQuestRecord("Woodes_Rogers_reward_7", "7");
		break;

		case "ship_wc2":
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			PlaySound("PEOPLE\jump.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorSetLayMode(Pchar);

			LAi_QuestDelay("ship_wc3", 2.0);
		break;

		case "ship_wc3":
			LAi_SetSitType(Pchar);

			LAi_QuestDelay("ship_wc4", 1.0);
		break;

		case "ship_wc4":
			LAi_SetPlayerType(Pchar);
		break;

		case "unlock_capsm_crew":
			Locations[FindLocation("wr_corv_capsm")].models.always.l2 = "stopboom_R";
			Locations[FindLocation("wr_corv_capsm")].image = "";
			Locations[FindLocation("wr_corv_capsm")].reload.l1.disable = 0;
			Locations[FindLocation("wr_corv_crew")].reload.l2.disable = 0;

			DoQuestReloadToLocation("wr_corv_capsm", "goto", "stopboom", "stopboom_done");
		break;

		case "lock_capsm_crew":
			Locations[FindLocation("wr_corv_capsm")].models.always.l2 = "stopboom_L";
			Locations[FindLocation("wr_corv_capsm")].image = "";
			Locations[FindLocation("wr_corv_capsm")].reload.l1.disable = 1;
			Locations[FindLocation("wr_corv_crew")].reload.l2.disable = 1;

			DoQuestReloadToLocation("wr_corv_capsm", "goto", "stopboom", "stopboom_done");
		break;

		case "stopboom_done":
			PlaySound("PEOPLE\wood1.wav");

			Locations[FindLocation("wr_corv_capsm")].image = "Deck_Capsm.tga";
		break;
	//----------------------------------------------------------------------------------------
		case "stay_at_belt_door":
			LAi_SetPlayerType(Pchar);
			LAi_LocationFightDisable(&Locations[FindLocation("wr_corv_crew")], false);
			LAi_SetFightMode(Pchar, true);

			LAi_QuestDelay("stay_at_belt_door1", 0.1);
		break;

		case "stay_at_belt_door1":
			//from itemlogic wr_corv_crew box3
			if(!LAi_IsFightMode(Pchar))
			{
				ChangeCharacterAddressGroup(Pchar, "wr_corv_crew", "goto", "goto11");
				LAi_LocationFightDisable(&Locations[FindLocation("wr_corv_crew")], true);
				LAi_SetPlayerType(Pchar);
			}
			else LAi_QuestDelay("stay_at_belt_door1", 1.0);//loops until not fightmode
		break;

		case "use_bladeitem_at_belt_door":
			LAi_SetFightMode(Pchar, false);
			LAi_LocationFightDisable(&Locations[FindLocation("wr_corv_crew")], true);
			LAi_SetPlayerType(Pchar);
		break;

		case "use_gunitem_at_belt_door":
			Locations[FindLocation("wr_corv_crew")].image = "";
			DoQuestReloadToLocation("wr_corv_crew", "goto", "goto11", "wr_corv_crew_loadingimage_back");
		break;

		case "wr_corv_crew_loadingimage_back":
			LAi_SetFightMode(pchar, false);
			LAi_LocationFightDisable(&Locations[FindLocation("wr_corv_crew")], true);
			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("wr_corv_crew")].image = "Deck_seadogs.tga";
		break;

		case "unlock_crew_deck1":
			LAi_SetFightMode(Pchar, false);
			LAi_LocationFightDisable(&Locations[FindLocation("wr_corv_crew")], true);

			LAi_QuestDelay("unlock_crew_deck1_A", 1.0);
		break;

		case "unlock_crew_deck1_A":
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladekeysimple");
			if(CheckCharacterItem(Pchar,"bladeA11"))
			{
				EquipCharacterByItem(Pchar, "bladeA11");
			}
			else EquipCharacterByItem(Pchar, "bladeX4");

			Locations[FindLocation("wr_corv_crew")].locators_radius.box.box3 = 0.0001;
			Locations[FindLocation("wr_corv_crew")].locators_radius.reload.reload1 = 1.0;

			DoQuestReloadToLocation("wr_corv_deck1", "goto", "box4", "unlock_crew_deck1_B");
		break;

		case "unlock_crew_deck1_B":
			Locations[FindLocation("wr_corv_crew")].image = "Deck_seadogs.tga";

			pchar.quest.unlock_crew_deck1_C.win_condition.l1 = "locator";
			pchar.quest.unlock_crew_deck1_C.win_condition.l1.location = "wr_corv_deck1";
			pchar.quest.unlock_crew_deck1_C.win_condition.l1.locator_group = "goto";
			pchar.quest.unlock_crew_deck1_C.win_condition.l1.locator = "stair";
			pchar.quest.unlock_crew_deck1_C.win_condition = "unlock_crew_deck1_C";
		break;

		case "unlock_crew_deck1_C":

			LAi_QuestDelay("unlock_crew_deck1_D", 2.0);
		break;

		case "unlock_crew_deck1_D":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto1");

			LAi_QuestDelay("unlock_crew_deck1_E", 1.0);
		break;

		case "unlock_crew_deck1_E":
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "wr_corv_deck1", "goto", "goto1");

			LAi_QuestDelay("dummy_belt_check", 0.1);
		break;
//ĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪĪ
		case "dummy_belt_check":
			if(CheckCharacterItem(Pchar,"dummy_belt"))
			{
				PlaySound("INTERFACE\Important_item.wav");
				TakeItemFromCharacter(Pchar, "dummy_belt");
				GiveItem2Character(Pchar, "pistolbelt");

				LAi_QuestDelay("leave_with_belt", 1.0);
			}
			else LAi_QuestDelay("dummy_belt_check", 0.5);
		break;

		case "leave_with_belt":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload3");

			LAi_QuestDelay("leave_with_belt1", 1.5);
			LAi_QuestDelay("prepare_leave_with_belt", 0.1);
		break;

		case "leave_with_belt1":
			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("wr_corv_crew")].models.always.locators = "camp_deck_l_JRH1B";//dummy without belt
			DoQuestReloadToLocation("wr_corv_crew", "reload", "reload1", "pistolbelt_equip_check");
		break;

		case "pistolbelt_equip_check":
			if(IsEquipCharacterByItem(Pchar, "pistolbelt"))
			{
				LAi_QuestDelay("BB6_0", 0.1);
			}
			else LAi_QuestDelay("pistolbelt_equip_check", 0.5);		//loops until equiped
		break;

		case "BB6_0":
			if(CheckCharacterItem(Pchar,"pistol201") && CheckCharacterItem(Pchar,"pistol202") && CheckCharacterItem(Pchar,"pistol203")
		        && CheckCharacterItem(Pchar,"pistol204") && CheckCharacterItem(Pchar,"pistol205") && CheckCharacterItem(Pchar,"pistol206"))
			{
				LAi_SetstayType(Pchar);

				LAi_QuestDelay("BB6_1", 0.5);	//was 1.5, start with 0 charges
			}
			else
			{
				LAi_QuestDelay("BB6_0", 0.5);	//loops until all 6 are found again (if you have left them somewhere?)
			}
		break;

		case "BB6_1":
			LAi_QuestDelay("BB6_2A", 1.5);
		break;

		case "BB6_2A":
			PlaySound("OBJECTS\DUEL\reload1.wav");

			LAi_QuestDelay("BB6_2", 0.5);
		break;

		case "BB6_2":
			Pchar.quest.BB6 = "found";

			EquipCharacterByItem(Pchar, "pistol206");
			PlaySound("OBJECTS\DUEL\sword_out.wav");

			LAi_QuestDelay("BB6_3A", 1.5);
		break;

		case "BB6_3A":
			PlaySound("OBJECTS\DUEL\reload1.wav");

			LAi_QuestDelay("BB6_3", 0.5);
		break;

		case "BB6_3":
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "pistol206");
			EquipCharacterByItem(Pchar, "pistol205");

			string weaponID = GetCharacterEquipByGroup(Pchar,GUN_ITEM_TYPE);
			aref weapon;
			Items_FindItem(weaponID, &weapon);

			if(CheckAttribute(weapon,"chargeQ"))
			LAi_GunSetChargeQuant(Pchar, "2");

			PlaySound("OBJECTS\DUEL\sword_out.wav");

			LAi_QuestDelay("BB6_4A", 1.5);
		break;

		case "BB6_4A":
			PlaySound("OBJECTS\DUEL\reload1.wav");

			LAi_QuestDelay("BB6_4", 0.5);
		break;

		case "BB6_4":
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "pistol205");
			EquipCharacterByItem(Pchar, "pistol204");

			string weaponID2 = GetCharacterEquipByGroup(Pchar,GUN_ITEM_TYPE);
			aref weapon2;
			Items_FindItem(weaponID2, &weapon2);

			if(CheckAttribute(weapon2,"chargeQ"))
			LAi_GunSetChargeQuant(Pchar, "3");

			PlaySound("OBJECTS\DUEL\sword_out.wav");

			LAi_QuestDelay("BB6_5A", 1.5);
		break;

		case "BB6_5A":
			PlaySound("OBJECTS\DUEL\reload1.wav");

			LAi_QuestDelay("BB6_5", 0.5);
		break;

		case "BB6_5":
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "pistol204");
			EquipCharacterByItem(Pchar, "pistol203");

			string weaponID3 = GetCharacterEquipByGroup(Pchar,GUN_ITEM_TYPE);
			aref weapon3;
			Items_FindItem(weaponID3, &weapon3);

			if(CheckAttribute(weapon3,"chargeQ"))
			LAi_GunSetChargeQuant(Pchar, "4");

			PlaySound("OBJECTS\DUEL\sword_out.wav");

			LAi_QuestDelay("BB6_6A", 1.5);
		break;

		case "BB6_6A":
			PlaySound("OBJECTS\DUEL\reload1.wav");

			LAi_QuestDelay("BB6_6", 0.5);
		break;

		case "BB6_6":
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "pistol203");
			EquipCharacterByItem(Pchar, "pistol202");

			string weaponID4 = GetCharacterEquipByGroup(Pchar,GUN_ITEM_TYPE);
			aref weapon4;
			Items_FindItem(weaponID4, &weapon4);

			if(CheckAttribute(weapon4,"chargeQ"))
			LAi_GunSetChargeQuant(Pchar, "5");

			PlaySound("OBJECTS\DUEL\sword_out.wav");

			LAi_QuestDelay("BB6_7A", 1.5);
		break;

		case "BB6_7A":
			PlaySound("OBJECTS\DUEL\reload1.wav");

			LAi_QuestDelay("BB6_7", 0.5);
		break;

		case "BB6_7":
			RemoveCharacterEquip(Pchar, BELT_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "pistol202");
			TakeItemFromCharacter(Pchar, "pistol201");
			TakeItemFromCharacter(Pchar, "pistolbelt");

			GiveItem2Character(Pchar, "pistol20");
			EquipCharacterByItem(Pchar, "pistol20");

			PlaySound("OBJECTS\DUEL\sword_out.wav");

			LAi_QuestDelay("BB6_8", 1.0);
		break;

		case "BB6_8":
			curExp = sti(Pchar.Experience);
			nextExp = CalculateExperienceFromRank(sti(Pchar.rank)+1);
			addExp = nextExp-curExp;
			AddCharacterExpNS(Pchar, addExp);
			int ACC = CalcCharacterSkill(Pchar, "Accuracy");
			Pchar.skill.Accuracy = ACC + 1;

			AddQuestRecord("Woodes_Rogers_reward_7", "4");
			DeleteQuestHeader("Alchemy_apparatus"); DeleteQuestHeader("Alchemy_tutorial");
			DeleteQuestHeader("Alchemy_copper"); DeleteQuestHeader("Alchemy_silver"); DeleteQuestHeader("Alchemy_gold");
			DeleteQuestHeader("Open_the_galley"); DeleteQuestHeader("Cannon_drill"); DeleteQuestHeader("Repair_the_anchor");
			LAi_SetPlayerType(Pchar);
			PlaySound("OBJECTS\DUEL\man_attack6.wav");

			Pchar.quest.BB6 = "normal";
		break;
	//----------------------------------------------------------------------------------------
	//[12] from here
		case "ready_for_leave_with_belt":
			DoQuestReloadToLocation("wr_corv_crew", "reload", "reload1", "prepare_leave_with_belt");
		break;

		case "prepare_leave_with_belt":
			LAi_SetPlayerType(Pchar);

			Pchar.quest.crew_to_ships = "open";
			Locations[FindLocation("wr_corv_crew")].reload.l1.disable = 0;
			Locations[FindLocation("wr_corv_crew")].reload.l2.disable = 0;

			Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_S2";
			Locations[FindLocation("wr_ships")].reload.l6.disable = 0;
			Locations[FindLocation("wr_ships")].locators_radius.box.box5 = 0.0001;
			Locations[FindLocation("wr_ships")].locators_radius.box.box6 = 0.7;

			ChangeCharacterAddressGroup(characterFromID("Woodes Rogers"), "none", "", "");

			LAi_SetStayType(CharacterFromID("wr_aub"));
			ChangeCharacterAddressGroup(CharacterFromID("wr_aub"), "wr_ships", "goto", "sidestep5");
			ChangeCharacterAddressGroup(CharacterFromID("wr_wll3"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_sail7"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_cor1"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_fsh1"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_kor1"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_man5_1"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_ltnorr"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_man4"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_evl2"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_pir9"), "none", "", "");

			ChangeCharacterAddressGroup(CharacterFromID("guncrew_1"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("guncrew_2"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("guncrew_3"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("guncrew_4"), "none", "", "");

			Locations[FindLocation("wr_port")].reload.l2.disable = 1;			//to farm
			ChangeCharacterAddressGroup(CharacterFromID("wr_pir5"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_hubport"), "none", "", "");

			SetModel(characterFromID("Dave Edna"), "Dave_clerk", "man", "man", 1.8, true);

			Locations[FindLocation("Redmond_shipyard")].reload.l2.disable = 1;		//to shipyard stairs
			Locations[FindLocation("wr_shop")].reload.l3.disable = 1;			//to shop_stairs

		//6 attackers in wr_port
		//...........................................................................
			RemoveCharacterEquip(characterFromID("wr_raoul"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_raoul"), "blade4");
			GiveItem2Character(characterFromID("wr_raoul"), "bladeX4");
			EquipCharacterbyItem(characterFromID("wr_raoul"), "bladeX4");
			EquipCharacterbyItem(characterFromID("wr_raoul"), "pistol1");
			LAi_NoRebirthEnable(characterFromID("wr_raoul"));

			RemoveCharacterEquip(characterFromID("wr_omat1"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_omat1"), "blade4");
			GiveItem2Character(characterFromID("wr_omat1"), "bladeX4");
			EquipCharacterbyItem(characterFromID("wr_omat1"), "bladeX4");
			EquipCharacterbyItem(characterFromID("wr_omat1"), "pistol1");
			GiveItem2Character(characterFromID("wr_omat1"), "cognac");
			LAi_NoRebirthEnable(characterFromID("wr_omat1"));

			RemoveCharacterEquip(characterFromID("wr_prt7"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_prt7"), "blade4");
			GiveItem2Character(characterFromID("wr_prt7"), "bladeX4");
			EquipCharacterbyItem(characterFromID("wr_prt7"), "bladeX4");
			EquipCharacterbyItem(characterFromID("wr_prt7"), "pistol1");
			LAi_NoRebirthEnable(characterFromID("wr_prt7"));

			RemoveCharacterEquip(characterFromID("wr_rabbl"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_rabbl"), "blade4");
			GiveItem2Character(characterFromID("wr_rabbl"), "bladeX4");
			EquipCharacterbyItem(characterFromID("wr_rabbl"), "bladeX4");
			EquipCharacterbyItem(characterFromID("wr_rabbl"), "pistol1");
			LAi_NoRebirthEnable(characterFromID("wr_rabbl"));

			RemoveCharacterEquip(characterFromID("wr_blcor"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_blcor"), "blade4");
			GiveItem2Character(characterFromID("wr_blcor"), "bladeX4");
			EquipCharacterbyItem(characterFromID("wr_blcor"), "bladeX4");
			EquipCharacterbyItem(characterFromID("wr_blcor"), "pistol1");
			GiveItem2Character(characterFromID("wr_blcor"), "cognac");
			LAi_NoRebirthEnable(characterFromID("wr_blcor"));

			RemoveCharacterEquip(characterFromID("wr_sail4"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_sail4"), "blade4");
			GiveItem2Character(characterFromID("wr_sail4"), "bladeX4");
			EquipCharacterbyItem(characterFromID("wr_sail4"), "bladeX4");
			EquipCharacterbyItem(characterFromID("wr_sail4"), "pistol1");
			LAi_NoRebirthEnable(characterFromID("wr_sail4"));

			LAi_NoRebirthEnable(characterFromID("wr_aub"));

		//8 attackers + carpenter in shipyard
		//...........................................................................
			RemoveCharacterEquip(characterFromID("wr_sail7"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_sail7"), "blade4");
			GiveItem2Character(characterFromID("wr_sail7"), "blade5");
			EquipCharacterbyItem(characterFromID("wr_sail7"), "blade5");
			RemoveCharacterEquip(characterFromID("wr_sail7"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_sail7"), "pistol1");
			LAi_NoRebirthEnable(characterFromID("wr_sail7"));

			RemoveCharacterEquip(characterFromID("wr_snav"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_snav"), "blade4");
			GiveItem2Character(characterFromID("wr_snav"), "blade5");
			EquipCharacterbyItem(characterFromID("wr_snav"), "blade5");
			RemoveCharacterEquip(characterFromID("wr_snav"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_snav"), "pistol1");
			LAi_NoRebirthEnable(characterFromID("wr_snav"));

			RemoveCharacterEquip(characterFromID("wr_fsh"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_fsh"), "blade4");
			GiveItem2Character(characterFromID("wr_fsh"), "blade5");
			EquipCharacterbyItem(characterFromID("wr_fsh"), "blade5");
			RemoveCharacterEquip(characterFromID("wr_fsh"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_fsh"), "pistol1");
			LAi_NoRebirthEnable(characterFromID("wr_fsh"));

			RemoveCharacterEquip(characterFromID("wr_kor"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_kor"), "blade4");
			GiveItem2Character(characterFromID("wr_kor"), "blade5");
			EquipCharacterbyItem(characterFromID("wr_kor"), "blade5");
			RemoveCharacterEquip(characterFromID("wr_kor"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_kor"), "pistol1");
			LAi_NoRebirthEnable(characterFromID("wr_kor"));

			RemoveCharacterEquip(characterFromID("wr_boc4"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_boc4"), "blade4");
			GiveItem2Character(characterFromID("wr_boc4"), "blade5");
			EquipCharacterbyItem(characterFromID("wr_boc4"), "blade5");
			RemoveCharacterEquip(characterFromID("wr_boc4"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_boc4"), "pistol1");
			LAi_NoRebirthEnable(characterFromID("wr_boc4"));

			RemoveCharacterEquip(characterFromID("wr_cha"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_cha"), "blade4");
			GiveItem2Character(characterFromID("wr_cha"), "blade5");
			EquipCharacterbyItem(characterFromID("wr_cha"), "blade5");
			RemoveCharacterEquip(characterFromID("wr_cha"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_cha"), "pistol1");
			LAi_NoRebirthEnable(characterFromID("wr_cha"));

			RemoveCharacterEquip(characterFromID("wr_cor1"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_cor1"), "blade4");
			GiveItem2Character(characterFromID("wr_cor1"), "blade5");
			EquipCharacterbyItem(characterFromID("wr_cor1"), "blade5");
			RemoveCharacterEquip(characterFromID("wr_cor1"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_cor1"), "pistol1");
			LAi_NoRebirthEnable(characterFromID("wr_cor1"));

			RemoveCharacterEquip(characterFromID("wr_cor3"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_cor3"), "blade4");
			GiveItem2Character(characterFromID("wr_cor3"), "blade5");
			EquipCharacterbyItem(characterFromID("wr_cor3"), "blade5");
			RemoveCharacterEquip(characterFromID("wr_cor3"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_cor3"), "pistol1");
			LAi_NoRebirthEnable(characterFromID("wr_cor3"));

			RemoveCharacterEquip(characterFromID("wr_bochat"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_bochat"), "blade4");
			GiveItem2Character(characterFromID("wr_bochat"), "bladeplank");
			EquipCharacterbyItem(characterFromID("wr_bochat"), "bladeplank");
			RemoveCharacterEquip(characterFromID("wr_bochat"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_bochat"), "pistol1");
			LAi_NoRebirthEnable(characterFromID("wr_bochat"));
		//...........................................................................
			Locations[FindLocation("Redmond_shore_03")].models.always.locators = "shore10_l_JRH1";//no smuggler goods
			ChangeCharacterAddressGroup(CharacterFromID("wr_fwn"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_sol6f77"), "none", "", "");

			Locations[FindLocation("Redmond_shore_ship")].models.always.locators = "ShoreShip_l_JRH2";//no smg goods

			Locations[FindLocation("Shipyard_shore")].models.always.locators = "FFport02_l_JRH_out2";//no smg goods
			Locations[FindLocation("Shipyard_shore")].reload.l30.disable = 1;		//shipyard stairs, opened after defoe cabin visit
			Locations[FindLocation("Shipyard_shore")].reload.l1.disable = 1;		//docks
			Locations[FindLocation("Shipyard_shore")].reload.l2.disable = 1;		//docks

			ChangeCharacterAddressGroup(CharacterFromID("Roger Murray"), "none", "", "");	//shipyard owner
			Locations[FindLocation("Redmond_shipyard")].reload.l1.disable = 1;
			Locations[FindLocation("Redmond_shipyard")].models.always.locators = "Sh01_l_JRH_back";
			Locations[FindLocation("Redmond_shipyard")].locators_radius.officers.reload2_1 = 0.5;

			Pchar.quest.bridge_check = "visible";
			Locations[FindLocation("Redmond_town_01")].models.always.locators = "Red01_l_JRH_back_bridge";
			Locations[FindLocation("Redmond_town_01")].locators_radius.box.box3 = 0.0001;

			Locations[FindLocation("wr_shop_office")].models.always.locators = "Sh03_l_JRH2";
			Locations[FindLocation("wr_shop_office")].reload.l1.disable = 0;		//to shop
			Locations[FindLocation("wr_shop_office")].reload.l2.disable = 1;		//to mother stairs
			ChangeCharacterAddressGroup(CharacterFromID("wr_hubspa"), "none", "", "");	//in office
			Pchar.quest.chest_hint = "dave";						//opens (empty) box in office

			Pchar.quest.wr_elevator = "down";
			Locations[FindLocation("wr_shop")].models.always.locators = "residence05_locators_JRH_Ldown";
			Locations[FindLocation("wr_shop")].reload.l6.disable = 1;			//to loanshark
			Locations[FindLocation("wr_shop")].reload.l2.disable = 0;			//back to shop office

			Pchar.quest.mine_enabled = "yes";	//gates are open food_supply

			pchar.quest.Long_final_threat.win_condition.l1 = "location";
			pchar.quest.Long_final_threat.win_condition.l1.location = "wr_ships";
			pchar.quest.Long_final_threat.win_condition = "Long_final_threat";
		break;
	//..................................................................................................
		case "Long_final_threat":
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("Long_final_threat1", 1.0);
		break;

		case "Long_final_threat1":
			LAi_SetActorType(characterFromID("wr_aub"));
			LAi_ActorDialog(characterFromID("wr_aub"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wr_aub"));
			Characters[GetCharacterIndex("wr_aub")].dialog.CurrentNode  = "final_threat";
		break;

		case "Long_final_threat2":
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);

			int items_with_blades = GetChrItemQuantity(Pchar);

			for(int j = 1; j < 100; j++)
			{
				TakeNItems(PChar, "blade"+j+"-2", -100); TakeNItems(PChar, "blade"+j+"-1", -100); TakeNItems(PChar, "blade"+j, -100);
				TakeNItems(PChar, "blade"+j+"+1", -100); TakeNItems(PChar, "blade"+j+"+2", -100); TakeNItems(PChar, "blade"+j+"+3", -100);

				TakeNItems(PChar, "bladeC"+j+"-2", -100); TakeNItems(PChar, "bladeC"+j+"-1", -100); TakeNItems(PChar, "bladeC"+j, -100);
				TakeNItems(PChar, "bladeC"+j+"+1", -100); TakeNItems(PChar, "bladeC"+j+"+2", -100); TakeNItems(PChar, "bladeC"+j+"+3", -100);
			}

			TakeNItems(PChar, "Barmansknife"+"-2", -100); TakeNItems(PChar, "Barmansknife"+"-1", -100); TakeNItems(PChar, "Barmansknife", -100);
			TakeNItems(PChar, "Barmansknife"+"+1", -100); TakeNItems(PChar, "Barmansknife"+"+2", -100); TakeNItems(PChar, "Barmansknife"+"+3", -100);

			TakeNItems(PChar, "Guestsknife"+"-2", -100); TakeNItems(PChar, "Guestsknife"+"-1", -100); TakeNItems(PChar, "Guestsknife", -100);
			TakeNItems(PChar, "Guestsknife"+"+1", -100); TakeNItems(PChar, "Guestsknife"+"+2", -100); TakeNItems(PChar, "Guestsknife"+"+3", -100);

			TakeNItems(PChar, "MerchantsBlade"+"-2", -100); TakeNItems(PChar, "MerchantsBlade"+"-1", -100); TakeNItems(PChar, "MerchantsBlade", -100);
			TakeNItems(PChar, "MerchantsBlade"+"+1", -100); TakeNItems(PChar, "MerchantsBlade"+"+2", -100); TakeNItems(PChar, "MerchantsBlade"+"+3", -100);

			TakeNItems(PChar, "Merchantsdagger"+"-2", -100); TakeNItems(PChar, "Merchantsdagger"+"-1", -100); TakeNItems(PChar, "Merchantsdagger", -100);
			TakeNItems(PChar, "Merchantsdagger"+"+1", -100); TakeNItems(PChar, "Merchantsdagger"+"+2", -100); TakeNItems(PChar, "Merchantsdagger"+"+3", -100);

			TakeNItems(PChar, "Minersaxe"+"-2", -100); TakeNItems(PChar, "Minersaxe"+"-1", -100); TakeNItems(PChar, "Minersaxe", -100);
			TakeNItems(PChar, "Minersaxe"+"+1", -100); TakeNItems(PChar, "Minersaxe"+"+2", -100); TakeNItems(PChar, "Minersaxe"+"+3", -100);

			TakeNItems(PChar, "Minerscrow"+"-2", -100); TakeNItems(PChar, "Minerscrow"+"-1", -100); TakeNItems(PChar, "Minerscrow", -100);
			TakeNItems(PChar, "Minerscrow"+"+1", -100); TakeNItems(PChar, "Minerscrow"+"+2", -100); TakeNItems(PChar, "Minerscrow"+"+3", -100);

			TakeNItems(PChar, "Minerspick"+"-2", -100); TakeNItems(PChar, "Minerspick"+"-1", -100); TakeNItems(PChar, "Minerspick", -100);
			TakeNItems(PChar, "Minerspick"+"+1", -100); TakeNItems(PChar, "Minerspick"+"+2", -100); TakeNItems(PChar, "Minerspick"+"+3", -100);

			TakeNItems(PChar, "Minersspade"+"-2", -100); TakeNItems(PChar, "Minersspade"+"-1", -100); TakeNItems(PChar, "Minersspade", -100);
			TakeNItems(PChar, "Minersspade"+"+1", -100); TakeNItems(PChar, "Minersspade"+"+2", -100); TakeNItems(PChar, "Minersspade"+"+3", -100);

			TakeNItems(PChar, "Piratesdagger"+"-2", -100); TakeNItems(PChar, "Piratesdagger"+"-1", -100); TakeNItems(PChar, "Piratesdagger", -100);
			TakeNItems(PChar, "Piratesdagger"+"+1", -100); TakeNItems(PChar, "Piratesdagger"+"+2", -100); TakeNItems(PChar, "Piratesdagger"+"+3", -100);

			for(int jj = 1; jj < 4; jj++)
			{
				TakeNItems(PChar, "bladeX"+jj, -100); TakeNItems(PChar, "bladeaxe"+jj, -100); TakeNItems(PChar, "topor"+jj, -100);
			}

			TakeNItems(PChar, "bladeFD", -100); TakeNItems(PChar, "bladeSC", -100); TakeNItems(PChar, "bladeBP", -100);
			TakeNItems(PChar, "bladelead", -100); TakeNItems(PChar, "bladeclub", -100);

			EquipCharacterbyItem(Pchar, "bladeX4");

			int items_without_blades = GetChrItemQuantity(Pchar);

			if(items_with_blades - items_without_blades == 1)
			{
				PlaySound("OBJECTS\DUEL\sword_slide3.wav");
				Logit(LanguageConvertString(tmpLangFileID,"Hah, I took your Blade!"));
			}
			if(items_with_blades - items_without_blades > 1)
			{
				PlaySound("OBJECTS\DUEL\sword_fallen.wav");
				Logit(LanguageConvertString(tmpLangFileID,"Hah, I took all your Blades!"));
			}

		//---------------------------------------------------------------------------------------
			SetQuestHeader("Woodes_Rogers_crew");
			AddQuestRecord("Woodes_Rogers_crew", "1");

			ChangeCharacterAddressGroup(CharacterFromID("wr_bucc1"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_boc16"), "none", "", "");

			PlaySound("VOICE\ENGLISH\Eng_m_c_059.wav");
			LAi_SetCitizenType(characterFromID("wr_aub"));
			LAi_SetPlayerType(Pchar);

			ChangeCharacterAddressGroup(characterFromID("wr_omat1"), "wr_port", "goto", "goto14");
			LAi_SetStayType(characterFromID("wr_omat1"));

			pchar.quest.port_ambush_A1.win_condition.l1 = "locator";
			pchar.quest.port_ambush_A1.win_condition.l1.location = "wr_port";
			pchar.quest.port_ambush_A1.win_condition.l1.locator_group = "goto";
			pchar.quest.port_ambush_A1.win_condition.l1.locator = "goto11";
			pchar.quest.port_ambush_A1.win_condition = "port_ambush_A1";
		break;
	//..................................................................................................
		case "port_ambush_A1":
			SetCurrentTime(11.00, 0);
			SetNextWeather("Clear");

			ChangeCharacterAddressGroup(CharacterFromID("wr_aub"), "none", "", "");

			LAi_SetActorType(characterFromID("wr_omat1"));
			LAi_ActorAttack(CharacterFromID("wr_omat1"), Pchar, "");

			ChangeCharacterAddressGroup(characterFromID("wr_sail4"), "wr_port", "goto", "goto17");
			ChangeCharacterAddressGroup(characterFromID("wr_raoul"), "wr_port", "goto", "goto18");
			ChangeCharacterAddressGroup(characterFromID("wr_rabbl"), "wr_port", "goto", "goto19");
			LAi_SetActorType(characterFromID("wr_sail4"));
			LAi_SetActorType(characterFromID("wr_raoul"));
			LAi_SetActorType(characterFromID("wr_rabbl"));
			LAi_ActorTurnToCharacter(characterFromID("wr_sail4"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("wr_raoul"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("wr_rabbl"), Pchar);

			LAi_QuestDelay("port_ambush_no_reinc", 0.1);

			pchar.quest.port_ambush_A2.win_condition.l1 = "locator";
			pchar.quest.port_ambush_A2.win_condition.l1.location = "wr_port";
			pchar.quest.port_ambush_A2.win_condition.l1.locator_group = "goto";
			pchar.quest.port_ambush_A2.win_condition.l1.locator = "goto15";
			pchar.quest.port_ambush_A2.win_condition = "port_ambush_A2";
		break;

		case "port_ambush_A2":
			LAi_SetActorType(characterFromID("wr_sail4"));
			LAi_ActorAttack(CharacterFromID("wr_sail4"), Pchar, "");
			LAi_SetActorType(characterFromID("wr_raoul"));
			LAi_ActorAttack(CharacterFromID("wr_raoul"), Pchar, "");
			LAi_SetActorType(characterFromID("wr_rabbl"));
			LAi_ActorAttack(CharacterFromID("wr_rabbl"), Pchar, "");

			LAi_QuestDelay("port_ambush_A3", 6.0);
		break;

		case "port_ambush_A3":
			PlaySound("VOICE\ENGLISH\alarm1.wav");
			ChangeCharacterAddressGroup(characterFromID("wr_prt7"), "wr_port", "goto", "goto23");
			ChangeCharacterAddressGroup(characterFromID("wr_blcor"), "wr_port", "goto", "goto13");
			LAi_SetActorType(characterFromID("wr_prt7"));
			LAi_ActorAttack(CharacterFromID("wr_prt7"), Pchar, "");
			LAi_SetActorType(characterFromID("wr_blcor"));
			LAi_ActorAttack(CharacterFromID("wr_blcor"), Pchar, "");
		break;

		case "port_ambush_no_reinc":
			if (pchar.location == "wr_port")
			{
				if(LAi_IsDead(Pchar))
				{
					LAi_QuestDelay("delay_no_reinc", 3.0);
				}
				else LAi_QuestDelay("port_ambush_no_reinc", 1.0);
			}
			else
			{
				ChangeCharacterAddressGroup(characterFromID("Claire Voyant"), "Shipyard_shore", "reload", "reload2");

				SetCurrentTime(17.00, 0);
				//SetNextWeather("Evening After Rain");

				pchar.quest.claire_and_defoe.win_condition.l1 = "locator";
				pchar.quest.claire_and_defoe.win_condition.l1.location = "Shipyard_shore";
				pchar.quest.claire_and_defoe.win_condition.l1.locator_group = "goto";
				pchar.quest.claire_and_defoe.win_condition.l1.locator = "claire";
				pchar.quest.claire_and_defoe.win_condition = "claire_and_defoe";
			}
		break;
	//..................................................................................................
		case "claire_and_defoe":
			Pchar.quest.JRH_rain = "Clear";
			Locations[FindLocation("defoes_cabin")].reload.l2.disable = 1;	//to shore

			LAi_SetActorType(characterFromID("Claire Voyant"));
			LAi_ActorDialog(characterFromID("Claire Voyant"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Claire Voyant"));
			Characters[GetCharacterIndex("Claire Voyant")].dialog.CurrentNode  = "psst";
		break;

		case "claire_and_defoe1":
			//from claire dialog

			Locations[FindLocation("Shipyard_shore")].reload.l2.disable = 0;		//docks
			ChangeCharacterAddressGroup(characterFromID("Claire Voyant"), "Defoes_cabin", "reload", "reload2");
			LAi_SetSitType(characterFromID("Defoe"));
			ChangeCharacterAddressGroup(characterFromID("Defoe"), "Defoes_cabin", "sit", "sit1");

			pchar.quest.claire_and_defoe2.win_condition.l1 = "locator";
			pchar.quest.claire_and_defoe2.win_condition.l1.location = "Defoes_cabin";
			pchar.quest.claire_and_defoe2.win_condition.l1.locator_group = "goto";
			pchar.quest.claire_and_defoe2.win_condition.l1.locator = "goto1";
			pchar.quest.claire_and_defoe2.win_condition = "claire_and_defoe2";
		break;

		case "claire_and_defoe2":
			LAi_SetActorType(CharacterFromID("Defoe"));
			LAi_ActorDialog(characterFromID("Defoe"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Defoe"));
			Characters[GetCharacterIndex("Defoe")].dialog.CurrentNode  = "visit_before";
		break;

		case "claire_and_defoe3":
			//from defoe dialog
			LAi_SetActorType(characterFromID("Claire Voyant"));
			LAi_ActorDialog(characterFromID("Claire Voyant"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Claire Voyant"));
			Characters[GetCharacterIndex("Claire Voyant")].dialog.CurrentNode  = "mind_reading";
		break;

		case "claire_and_defoe4":
			//from claire dialog
			LAi_SetActorType(CharacterFromID("Defoe"));
			LAi_ActorDialog(characterFromID("Defoe"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Defoe"));
			Characters[GetCharacterIndex("Defoe")].dialog.CurrentNode  = "book_thief";
		break;

		case "claire_and_defoe5":
			//from defoe dialog
			LAi_SetActorType(characterFromID("Claire Voyant"));
			LAi_ActorDialog(characterFromID("Claire Voyant"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Claire Voyant"));
			Characters[GetCharacterIndex("Claire Voyant")].dialog.CurrentNode  = "more_documents";
		break;

		case "claire_and_defoe6":
			//from claire dialog
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "sit", "sit1");

			LAi_QuestDelay("claire_and_defoe7", 1.0);
		break;

		case "claire_and_defoe7":
			LAi_SetPlayerType(Pchar);
			TakeItemFromCharacter(Pchar, "book41");
			TakeItemFromCharacter(Pchar, "book42");
			TakeItemFromCharacter(Pchar, "book43");
			TakeItemFromCharacter(Pchar, "book44");
			TakeItemFromCharacter(Pchar, "book45");
			TakeItemFromCharacter(Pchar, "book46");
			TakeItemFromCharacter(Pchar, "book47");
			TakeItemFromCharacter(Pchar, "book48");
			TakeItemFromCharacter(Pchar, "book49");
			TakeItemFromCharacter(Pchar, "book50");
			TakeItemFromCharacter(Pchar, "book51");

			LAi_QuestDelay("claire_and_defoe8", 1.0);
		break;

		case "claire_and_defoe8":
			//from defoe dialog
			LAi_SetActorType(characterFromID("Claire Voyant"));
			LAi_ActorDialog(characterFromID("Claire Voyant"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Claire Voyant"));
			Characters[GetCharacterIndex("Claire Voyant")].dialog.CurrentNode  = "more_documents1";
		break;

		case "claire_and_defoe9":
			//from claire dialog
			LAi_SetActorType(CharacterFromID("Defoe"));
			LAi_ActorDialog(characterFromID("Defoe"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Defoe"));
			Characters[GetCharacterIndex("Defoe")].dialog.CurrentNode  = "woodes_rogers";
		break;

		case "claire_and_defoe10":
			//from defoe dialog
			PlaySound("VOICE\ENGLISH\defoe_hero.wav");
			TakeItemFromCharacter(Pchar, "amnesty_doc");
			if(!IsEquipCharacterByItem(Pchar, "pistol20"))
			{
				SetModel(PChar, "Pira4M_HTUS_b", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterbyItem(Pchar, "pistol20");
			}

			GiveItem2Character(Pchar, "ammobag2");
			RemoveCharacterEquip(Pchar, POUCH_ITEM_TYPE);
			EquipCharacterbyItem(Pchar, "ammobag2");
			SetModel(PChar, "Pira4M_HTUS_a", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);
			PlaySound("INTERFACE\button1.wav");

			RemoveCharacterEquip(Pchar, FLASK_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "ammopouch");
			TakeItemFromCharacter(Pchar, "powderflask");

			gp = GetCharacterItem(Pchar, "gunpowder");
			if(gp < 6)
			{
				TakeNItems(Pchar,"gunpowder", -100);
				TakeNItems(Pchar,"gunpowder", 6);
			}

			pb = GetCharacterItem(Pchar, "pistolbullets");
			if(pb < 6)
			{
				TakeNItems(Pchar,"pistolbullets", -100);
				TakeNItems(Pchar,"pistolbullets", 6);
			}

			if(CheckCharacterItem(Pchar,"pistol1"))
			{
				LAi_QuestDelay("claire_and_defoe11", 4.5);
			}
			else LAi_QuestDelay("claire_and_defoe12", 4.5);
		break;

		case "claire_and_defoe11":
			LAi_SetActorType(characterFromID("Claire Voyant"));
			LAi_ActorDialog(characterFromID("Claire Voyant"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Claire Voyant"));
			Characters[GetCharacterIndex("Claire Voyant")].dialog.CurrentNode  = "pistols";
		break;

		case "claire_and_defoe12":
			//from claire dialog
			TakeNItems(Pchar,"pistol1", -6);
			LAi_SetActorType(CharacterFromID("Defoe"));
			LAi_ActorDialog(characterFromID("Defoe"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Defoe"));
			Characters[GetCharacterIndex("Defoe")].dialog.CurrentNode  = "warning";
		break;

		case "claire_and_defoe13":
			//from defoe dialog
			ChangeCharacterAddressGroup(characterFromID("Defoe"), "Defoes_cabin", "sit", "sit1");
			LAi_SetSitType(characterFromID("Defoe"));
			LAi_SetActorType(characterFromID("Claire Voyant"));
			LAi_ActorDialog(characterFromID("Claire Voyant"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Claire Voyant"));
			Characters[GetCharacterIndex("Claire Voyant")].dialog.CurrentNode  = "see_future";
		break;

		case "claire_and_defoe14":
			//from claire dialog
			Pchar.quest.JRH_rain = "";
			Pchar.quest.med_Claire = "acetum";
			Pchar.quest.defoes_cabin = "talk_over";

			AddQuestRecord("Woodes_Rogers_reward_7", "5");
			CloseQuestHeader("Woodes_Rogers_reward_7");

			PlaySound("VOICE\ENGLISH\claire_fortune.wav");
			LAi_SetCitizenType(characterFromID("Claire Voyant"));
			Locations[FindLocation("Shipyard_shore")].reload.l30.disable = 0;	//shipyard stairs
			locations[FindLocation("shipyard_stairs")].reload.l1.disable = 0;//back to shya
			Locations[FindLocation("Shipyard_shore")].reload.l1.disable = 0;	//docks
			Locations[FindLocation("Shipyard_shore")].reload.l2.disable = 0;	//docks

			ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "none", "", "");

			DoQuickSave();			//before shipyard fight

			LAi_QuestDelay("claire_and_defoe15", 2.0);
			
			pchar.quest.shipyard_ambush.win_condition.l1 = "location";
			pchar.quest.shipyard_ambush.win_condition.l1.location = "Redmond_shipyard";
			pchar.quest.shipyard_ambush.win_condition = "shipyard_ambush";
		break;

		case "claire_and_defoe15":
			PlaySound("INTERFACE\key_unlock2.wav");
			Locations[FindLocation("defoes_cabin")].reload.l2.disable = 0;	//to shore
		break;
	//..................................................................................................
		case "shipyard_ambush":
			PlaySound("INTERFACE\closed_locked_door.wav");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("shipyard_ambush1", 2.0);
		break;

		case "shipyard_ambush1":
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "dialog", "shipyard_ambush2", 1.0);
		break;

		case "shipyard_ambush2":
			PlaySound("VOICE\ENGLISH\gr_wench3_aye.wav");
			GiveItem2Character(characterFromID("wench3"), "bladep0");
			EquipCharacterbyItem(characterFromID("wench3"), "bladep0");
			GiveItem2Character(characterFromID("wench3"), "pistol0");
			EquipCharacterbyItem(characterFromID("wench3"), "pistol0");
			TakenItems(characterFromID("wench3"), "gunpowder", 6);
			TakenItems(characterFromID("wench3"), "pistolbullets", 6);
			ChangeCharacterAddressGroup(characterFromID("wench3"), "Redmond_shipyard", "reload", "reload1");
			LAi_SetActorType(characterFromID("wench3"));
			LAi_ActorRunToLocator(CharacterFromID("wench3"), "goto", "goto18", "shipyard_ambush3", 5.0);
		break;

		case "shipyard_ambush3":
			LAi_SetActorType(CharacterFromID("wench3"));
			LAi_ActorDialog(characterFromID("wench3"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wench3"));
			Characters[GetCharacterIndex("wench3")].dialog.CurrentNode  = "father_is_killed";
		break;

		case "shipyard_ambush4":
			//from Car K dialog
			Logit(LanguageConvertString(tmpLangFileID,"I can use a heavy pistol as a Club!"));

			Pchar.quest.pistolclub = "know_how";
			Lai_SetImmortal(CharacterFromID("wench3"), true);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			GiveItem2Character(Pchar, "bladepclub203");
			EquipCharacterbyItem(Pchar, "bladepclub203");
			EquipCharacterbyItem(Pchar, "pistol20");
	//		TakeItemFromCharacter(Pchar, "bladeX4");	//fists
	//why taken from pchar?

			LAi_LocationFightDisable(&Locations[FindLocation("Redmond_shipyard")], false);
			LAi_SetPlayerType(Pchar);
			PlaySound("OBJECTS\ABORDAGE\abordage.wav");
			ChangeCharacterAddressGroup(characterFromID("wr_sail7"), "Redmond_shipyard", "reload", "reload1");
			LAi_SetActorType(characterFromID("wr_sail7"));
			LAi_ActorAttack(CharacterFromID("wr_sail7"), Pchar, "");

			PlaySound("VOICE\ENGLISH\gr_wench3_oh.wav");

			LAi_group_MoveCharacter(characterFromID("Wench3"), LAI_GROUP_PLAYER);

			LAi_group_Register("WR_GUARDS_1");
			LAi_group_MoveCharacter(characterFromID("wr_sail7"), "WR_GUARDS_1");
			LAi_group_MoveCharacter(characterFromID("wench3"), LAI_GROUP_PLAYER);
			LAi_group_SetRelation(LAI_GROUP_PLAYER, "WR_GUARDS_1", LAI_GROUP_ENEMY);
			LAi_group_FightGroups(LAI_GROUP_PLAYER, "WR_GUARDS_1", true);

			LAi_QuestDelay("Caroline_bladep0_check", 0.1);
			LAi_QuestDelay("shipyard_ambush_no_reinc", 0.1);
			LAi_QuestDelay("shya_guards_defeated_check", 0.1);
			LAi_QuestDelay("shipyard_ambush_ready_to_fight", 1.0);
			LAi_QuestDelay("shipyard_ambush5", 2.0);
		break;
	//--------------------------------------------------------------------------------------------
		case "Caroline_bladep0_check":
			//if(pchar.location == "Redmond_shipyard")
			if(CheckAttribute(Pchar,"quest.wr_shyafight") && Pchar.quest.wr_shyafight == "over")
			{
				return;
			}
			else
			{
				if(!IsEquipCharacterByItem(CharacterFromID("wench3"), "bladep0"))
				{
					//just to be sure he's got the stool
					if(!CheckCharacterItem(CharacterFromID("wench3"),"bladep0"))
					{
						GiveItem2Character(CharacterFromID("wench3"), "bladep0");
					}

					RemoveCharacterEquip(CharacterFromID("wench3"), BLADE_ITEM_TYPE);
					EquipCharacterbyItem(CharacterFromID("wench3"), "bladestool");
				}

				LAi_QuestDelay("Caroline_bladep0_check", 0.5);
			}
		break;
	//--------------------------------------------------------------------------------------------
		case "shipyard_ambush_no_reinc":
			if (pchar.location == "Redmond_shipyard")
			{
				if(LAi_IsDead(Pchar))
				{
					LAi_QuestDelay("delay_no_reinc", 3.0);
				}
				else LAi_QuestDelay("shipyard_ambush_no_reinc", 1.0);
			}
			else return;
		break;

		case "shipyard_ambush_ready_to_fight":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload1");

			LAi_QuestDelay("shipyard_ambush_ready_to_fight1", 0.5);
		break;

		case "shipyard_ambush_ready_to_fight1":
			LAi_SetPlayerType(Pchar);
		break;

		case "shipyard_ambush5":
			PlaySound("OBJECTS\ABORDAGE\abordage1.wav");
			ChangeCharacterAddressGroup(characterFromID("wr_snav"), "Redmond_shipyard", "reload", "reload1");
			LAi_SetActorType(characterFromID("wr_snav"));
			LAi_ActorAttack(CharacterFromID("wr_snav"), Pchar, "");
			LAi_group_MoveCharacter(characterFromID("wr_snav"), "WR_GUARDS_1");

			LAi_QuestDelay("shipyard_ambush6", 1.5);
		break;

		case "shipyard_ambush6":
			ChangeCharacterAddressGroup(characterFromID("wr_fsh"), "Redmond_shipyard", "reload", "reload1");
			LAi_SetActorType(characterFromID("wr_fsh"));
			LAi_ActorAttack(CharacterFromID("wr_fsh"), Pchar, "");
			LAi_group_MoveCharacter(characterFromID("wr_fsh"), "WR_GUARDS_1");

			LAi_QuestDelay("shipyard_ambush7", 1.0);
		break;

		case "shipyard_ambush7":
			ChangeCharacterAddressGroup(characterFromID("wr_kor"), "Redmond_shipyard", "reload", "reload1");
			LAi_SetActorType(characterFromID("wr_kor"));
			LAi_ActorAttack(CharacterFromID("wr_kor"), Pchar, "");
			LAi_group_MoveCharacter(characterFromID("wr_kor"), "WR_GUARDS_1");

			LAi_QuestDelay("shipyard_ambush8", 0.5);
		break;

		case "shipyard_ambush8":
			ChangeCharacterAddressGroup(characterFromID("wr_boc4"), "Redmond_shipyard", "reload", "reload1");
			LAi_SetActorType(characterFromID("wr_boc4"));
			LAi_ActorAttack(CharacterFromID("wr_boc4"), Pchar, "");
			LAi_group_MoveCharacter(characterFromID("wr_boc4"), "WR_GUARDS_1");

			ChangeCharacterAddressGroup(characterFromID("wr_cha"), "Redmond_shipyard", "reload", "reload1");
			LAi_SetActorType(characterFromID("wr_cha"));
			LAi_ActorAttack(CharacterFromID("wr_cha"), Pchar, "");
			LAi_group_MoveCharacter(characterFromID("wr_cha"), "WR_GUARDS_1");

			LAi_QuestDelay("shipyard_ambush9", 4.0);		//new 9
		break;

		case "shipyard_ambush9":
			PlaySound("OBJECTS\ABORDAGE\abordage.wav");
			ChangeCharacterAddressGroup(characterFromID("wr_cor1"), "Redmond_shipyard", "reload", "reload1");
			LAi_SetActorType(characterFromID("wr_cor1"));
			LAi_ActorAttack(CharacterFromID("wr_cor1"), Pchar, "");
			LAi_group_MoveCharacter(characterFromID("wr_cor1"), "WR_GUARDS_1");

			ChangeCharacterAddressGroup(characterFromID("wr_cor3"), "Redmond_shipyard", "reload", "reload1");
			LAi_SetActorType(characterFromID("wr_cor3"));
			LAi_ActorAttack(CharacterFromID("wr_cor3"), Pchar, "");
			LAi_group_MoveCharacter(characterFromID("wr_cor3"), "WR_GUARDS_1");
		break;

		case "shya_guards_defeated_check":
			Pchar.quest.shya_guards_defeated_check1.win_condition.l1 = "NPC_Death";
			Pchar.quest.shya_guards_defeated_check1.win_condition.l1.character = "wr_sail7";
			Pchar.quest.shya_guards_defeated_check1.win_condition.l2 = "NPC_Death";
			Pchar.quest.shya_guards_defeated_check1.win_condition.l2.character = "wr_snav";
			Pchar.quest.shya_guards_defeated_check1.win_condition.l3 = "NPC_Death";
			Pchar.quest.shya_guards_defeated_check1.win_condition.l3.character = "wr_fsh";
			Pchar.quest.shya_guards_defeated_check1.win_condition.l4 = "NPC_Death";
			Pchar.quest.shya_guards_defeated_check1.win_condition.l4.character = "wr_kor";
			Pchar.quest.shya_guards_defeated_check1.win_condition.l5 = "NPC_Death";
			Pchar.quest.shya_guards_defeated_check1.win_condition.l5.character = "wr_boc4";
			Pchar.quest.shya_guards_defeated_check1.win_condition.l6 = "NPC_Death";
			Pchar.quest.shya_guards_defeated_check1.win_condition.l6.character = "wr_cha";
			Pchar.quest.shya_guards_defeated_check1.win_condition.l7 = "NPC_Death";
			Pchar.quest.shya_guards_defeated_check1.win_condition.l7.character = "wr_cor1";
			Pchar.quest.shya_guards_defeated_check1.win_condition.l8 = "NPC_Death";
			Pchar.quest.shya_guards_defeated_check1.win_condition.l8.character = "wr_cor3";
			Pchar.quest.shya_guards_defeated_check1.win_condition = "shya_guards_defeated_check1";
		break;

		case "shya_guards_defeated_check1":
			Pchar.quest.wr_shyafight = "over";

			LAi_SetActorType(CharacterFromID("wench3"));
			LAi_ActorDialog(characterFromID("wench3"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wench3"));
			Characters[GetCharacterIndex("wench3")].dialog.CurrentNode  = "lets_leave_the_shipyard";
		break;

		case "lets_leave_the_shipyard":
			if(!IsEquipCharacterByItem(Pchar, "bladepclub203"))
			{
				//just to be sure he's using the pistolclub
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				GiveItem2Character(Pchar, "bladepclub203");
				EquipCharacterbyItem(Pchar, "bladepclub203");
				EquipCharacterbyItem(Pchar, "pistol20");
			}

			PlaySound("VOICE\ENGLISH\blaze_lead_way_out.wav");
			AddQuestRecord("Woodes_Rogers_crew", "2");

			LAi_SetActorType(characterFromID("wench3"));
			LAi_ActorRunToLocator(CharacterFromID("wench3"), "reload", "reload1", "lets_leave_the_shipyard1", 5.0);
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("lets_leave_the_shipyard0", 2.0);
		break;

		case "lets_leave_the_shipyard0":
			LAi_SetPlayerType(Pchar);
		break;

		case "lets_leave_the_shipyard1":
			ChangeCharacterAddressGroup(characterFromID("wench3"), "none", "", "");
			RemoveOfficersIndex(pchar, GetCharacterIndex("Wench3"));
			RemovePassenger(pchar, characterFromID("Wench3"));

			LAi_QuestDelay("lets_leave_the_shipyard2", 1.0);
		break;

		case "lets_leave_the_shipyard2":
			bDisableFastReload = 1;
			Lai_SetImmortal(CharacterFromID("wr_bochat"), false);
			ChangeCharacterAddressGroup(characterFromID("wr_bochat"), "Redmond_shipyard", "reload", "reload1");
			PlaySound("INTERFACE\closed_locked_door.wav");

			LAi_QuestDelay("lets_leave_the_shipyard3", 1.0);
		break;

		case "lets_leave_the_shipyard3":
			PlaySound("VOICE\ENGLISH\Por_m_b_047.wav");
			LAi_SetActorType(characterFromID("wr_bochat"));
			LAi_ActorAttack(CharacterFromID("wr_bochat"), Pchar, "");

			LAi_QuestDelay("carpenter_bladeplank", 0.5);

			Pchar.quest.lets_leave_the_shipyard4.win_condition.l1 = "NPC_Death";
			Pchar.quest.lets_leave_the_shipyard4.win_condition.l1.character = "wr_bochat";
			Pchar.quest.lets_leave_the_shipyard4.win_condition = "lets_leave_the_shipyard4";
		break;

		case "carpenter_bladeplank":
			if(!IsEquipCharacterByItem(CharacterFromID("wr_bochat"), "bladeplank"))
			{
				//just to be sure he's got the plank
				if(!CheckCharacterItem(CharacterFromID("wr_bochat"),"bladeplank"))
				{
					GiveItem2Character(CharacterFromID("wr_bochat"), "bladeplank");
				}

				RemoveCharacterEquip(CharacterFromID("wr_bochat"), BLADE_ITEM_TYPE);
				EquipCharacterbyItem(CharacterFromID("wr_bochat"), "bladeplank");
			}

			if(LAi_IsDead(CharacterFromID("wr_bochat")))
			{
					return;
			}
			else
			{
				LAi_QuestDelay("carpenter_bladeplank", 0.5);
			}
		break;

		case "lets_leave_the_shipyard4":
			if(!CheckCharacterItem(characterFromID("wr_bochat"),"bladeplank"))
			{
				GiveItem2Character(characterFromID("wr_bochat"),"bladeplank"));
			}

			LAi_QuestDelay("lets_leave_the_shipyard5", 0.1);
			LAi_QuestDelay("shipyard_back", 0.1);
		break;

		case "lets_leave_the_shipyard5":
			if (pchar.location == "Redmond_shipyard")
			{
				if(CheckCharacterItem(Pchar,"bladeplank"))
				{
					RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
					EquipCharacterbyItem(Pchar, "bladeplank");
					EquipCharacterbyItem(Pchar, "pistol20");		
				}
				else LAi_QuestDelay("lets_leave_the_shipyard5", 0.5);
			}
			else return;
		break;
	//..................................................................................................
		case "shipyard_back":
			//Log_SetStringToLog("ladder is activated");
			pchar.quest.shipyard_back0.win_condition.l1 = "locator";
			pchar.quest.shipyard_back0.win_condition.l1.location = "Redmond_shipyard";
			pchar.quest.shipyard_back0.win_condition.l1.locator_group = "goto";
			pchar.quest.shipyard_back0.win_condition.l1.locator = "back1";
			pchar.quest.shipyard_back0.win_condition = "shipyard_back0";
		break;

		case "shipyard_back0":
			SetCurrentTime(3.00, 0);
			SetNextWeather("Moon Night");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("shipyard_back00", 0.5);
		break;

		case "shipyard_back00":
			PlaySound("AMBIENT\CHURCH\bench1.wav");
			ChangeCharacterAddressGroup(Pchar, "Redmond_shipyard", "goto", "back1A");

			LAi_QuestDelay("shipyard_back1", 1.0);
		break;

		case "shipyard_back1":
			PlaySound("AMBIENT\CHURCH\bench1.wav");
			ChangeCharacterAddressGroup(Pchar, "Redmond_shipyard", "goto", "back1B");

			LAi_QuestDelay("shipyard_back2", 1.0);
		break;

		case "shipyard_back2":
			PlaySound("AMBIENT\CHURCH\bench1.wav");
			ChangeCharacterAddressGroup(Pchar, "Redmond_shipyard", "goto", "back1C");

			LAi_QuestDelay("shipyard_back3", 1.0);
		break;

		case "shipyard_back3":
			PlaySound("AMBIENT\CHURCH\bench1.wav");
			ChangeCharacterAddressGroup(Pchar, "Redmond_shipyard", "goto", "back1D");

			LAi_QuestDelay("shipyard_back4", 1.0);
		break;

		case "shipyard_back4":
			PlaySound("PEOPLE\step_stairway.wav");
			ChangeCharacterAddressGroup(Pchar, "Redmond_shipyard", "goto", "back2");

			LAi_QuestDelay("shipyard_back5", 1.0);
		break;

		case "shipyard_back5":
			PlaySound("AMBIENT\SHOP\sigh1.wav");

			LAi_QuestDelay("shipyard_back6", 1.0);
		break;

		case "shipyard_back6":
			PlaySound("PEOPLE\run_wood.wav");
			ChangeCharacterAddressGroup(Pchar, "Redmond_shipyard", "reload", "reload3");
			Locations[FindLocation("Redmond_shipyard")].reload.l1.disable = 0;		//reset to normal

			pchar.quest.bridge_run_back1.win_condition.l1 = "location";
			pchar.quest.bridge_run_back1.win_condition.l1.location = "Redmond_Town_01";
			pchar.quest.bridge_run_back1.win_condition = "bridge_run_back1";
		break;

		case "bridge_run_back1":
			PlaySound("PEOPLE\counter_close.wav");
			ChangeCharacterAddressGroup(CharacterFromID("Roger Murray"), "Redmond_shipyard", "sit", "sit_1");	//shipyard owner
			LAi_SetHuberType(characterFromID("Roger Murray"));

			LAi_QuestDelay("bridge_run_back2", 2.0);
		break;

		case "bridge_run_back2":
			PlaySound("PEOPLE\Run_wood.wav");
			ChangeCharacterAddressGroup(Pchar, "Redmond_town_01", "goto", "back2");

			LAi_QuestDelay("bridge_run_back3", 2.0);
		break;

		case "bridge_run_back3":
			LAi_SetSitType(Pchar);
			PlaySound("OBJECTS\DUEL\man_attack1.wav");

			LAi_QuestDelay("bridge_run_back4", 0.5);
		break;

		case "bridge_run_back4":
			PlaySound("PEOPLE\step_stairway.wav");
			ChangeCharacterAddressGroup(Pchar, "Redmond_town_01", "goto", "back3_side");	//was back3
			ChangeCharacterAddressGroup(CharacterFromID("wr_aub"), "Redmond_town_01", "reload", "reload13");
			LAi_SetActorType(CharacterFromID("wr_aub"));
			LAi_ActorTurnToLocator(CharacterFromID("wr_aub"), "goto", "back3");

			LAi_QuestDelay("bridge_run_back4A", 0.5);
			LAi_QuestDelay("bridge_run_back5", 1.0);
		break;

		case "bridge_run_back4A":
			LAi_SetPlayerType(Pchar);
		break;

		case "bridge_run_back5":
			PlaySound("PEOPLE\counter_close.wav");

			LAi_QuestDelay("bridge_run_back6", 1.0);
		break;

		case "bridge_run_back6":
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");

			ChangeCharacterAddressGroup(Pchar, "Redmond_town_01", "goto", "back3");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "back1");

			LAi_QuestDelay("bridge_run_back7", 1.0);
		break;

		case "bridge_run_back7":
			PlaySound("VOICE\ENGLISH\Eng_m_c_056.wav");

			LAi_SetPlayerType(Pchar);
			LAi_SetActorType(CharacterFromID("wr_aub"));
			LAi_ActorAttack(CharacterFromID("wr_aub"), Pchar, "");

			LAi_QuestDelay("bridge_run_back8", 3.0);
		break;

		case "bridge_run_back8":
			if(CheckAttribute(Pchar,"quest.bridge_check") && Pchar.quest.bridge_check == "visible")
			{
				LAi_CharacterFireExecute(CharacterFromID("wr_aub"), Pchar, 10.0, 1);
				GetCharacterPos(CharacterFromID("wr_aub"), &u, &v, &w);
				CreateParticleSystem("gunfire" , u-0.4, v+1.2, w, 0.0, 0.0, 0.0, sti(20) );

				LAi_QuestDelay("bridge_run_back9", 2.0);
			}
			else return;
		break;

		case "bridge_run_back9":
			if(CheckAttribute(Pchar,"quest.bridge_check") && Pchar.quest.bridge_check == "visible")
			{
				LAi_CharacterFireExecute(CharacterFromID("wr_aub"), Pchar, 10.0, 1);
				GetCharacterPos(CharacterFromID("wr_aub"), &u, &v, &w);
				CreateParticleSystem("gunfire" , u-0.4, v+1.2, w, 0.0, 0.0, 0.0, sti(20) );
				LAi_KillCharacter(Pchar);
			}
			else return;
		break;

		case "bridge_invisible":
			//from itemlogic redmond_town_01, box2
			PlaySound("INTERFACE\shelf_cogs.wav");

			LAi_QuestDelay("bridge_invisible1", 1.0);
		break;

		case "bridge_invisible1":
			Locations[FindLocation("Redmond_Town_01")].image = "";
			DoQuestReloadToLocation("Redmond_Town_01", "goto", "back4", "bridge_invisible2");
		break;

		case "bridge_invisible2":
			Locations[FindLocation("Redmond_Town_01")].image = "Redmond_Town_01.tga";//after merge
			PlaySound("PEOPLE\wood3.wav");

			//enemies fall down in here.....

			LAi_QuestDelay("quartermaster_falls_down", 1.0);
		break;

		case "quartermaster_falls_down":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead6.wav");
			ChangeCharacterAddressGroup(CharacterFromID("wr_aub"), "Redmond_town_01", "goto", "quartermaster");

			LAi_QuestDelay("quartermaster_falls_down1", 1.0);
		break;

		case "quartermaster_falls_down1":
			PlaySound("PEOPLE\jump.wav");
			LAi_ApplyCharacterDamage(CharacterFromID("wr_aub"), 100);
			LAi_SetImmortal(CharacterFromID("wr_aub"), false);
			LAi_KillCharacter(CharacterFromID("wr_aub"));
			ChangeCharacterAddressGroup(CharacterFromID("wr_aub"), "none", "", "");//to prevent any longdistance looting

			LAi_QuestDelay("bridge_invisible3", 2.0);
		break;
	//---------------------------------------------------------------------------------
		case "bridge_invisible3":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload12");

			LAi_QuestDelay("bridge_invisible4", 2.0);
		break;

		case "bridge_invisible4":
			SetCurrentTime(11.00, 0);		//for later in both wine cellars (+ mine)
			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Mine Fog 1";
			LAi_SetPlayerType(Pchar);
			PlaySound("PEOPLE\run_roof.wav");
			ChangeCharacterAddressGroup(Pchar, "Redmond_town_01", "reload", "reload12");

			pchar.quest.office_back.win_condition.l1 = "location";
			pchar.quest.office_back.win_condition.l1.location = "wr_shop_office";
			pchar.quest.office_back.win_condition = "office_back";
		break;

		case "office_back":
			PlaySound("AMBIENT\CHURCH\bench1.wav");

			LAi_QuestDelay("office_back1", 1.0);
		break;

		case "office_back1":
			PlaySound("AMBIENT\CHURCH\bench1.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_shop_office", "goto", "goto6");

			LAi_QuestDelay("office_back2", 1.0);
		break;

		case "office_back2":
			PlaySound("PEOPLE\jump.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_shop_office", "goto", "goto8");

			ChangeCharacterAddressGroup(characterFromID("grandma"), "wr_shop_office", "reload", "reload2");
			LAi_SetStayType(CharacterFromID("grandma"));

			LAi_QuestDelay("office_back3", 1.0);
		break;
	//---------------------------------------------------------------------------------
		case "office_back3":
			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_ActorDialog(characterFromID("grandma"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("grandma"));
			Characters[GetCharacterIndex("grandma")].dialog.CurrentNode  = "throw_pistols";
		break;

		case "throw_pistols_done":
			//from grandma dialog
			Logit(LanguageConvertString(tmpLangFileID,"I can throw my Pistols on the enemies!"));

			TakeNItems(Pchar,"gunpowder", -100);
			TakeNItems(Pchar,"pistolbullets", -100);
			TakeNItems(Pchar,"pistolgrapes", -100);
			TakeNItems(Pchar,"musketbullets", -100);

			Pchar.quest.pistolthrow = "know_how";
			Pchar.quest.shop_elevator = "temp_off";

			Pchar.quest.medicine_quest = "neutral";
			Pchar.quest.med_grandma = "neutral";

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "pistol20");
			GiveItem2Character(Pchar, "pistolthrow5");
			EquipCharacterByItem(Pchar, "pistolthrow5");

			LAi_QuestDelay("throw_pistols_done1", 1.0);
		break;

		case "throw_pistols_done1":
			PlaySound("VOICE\ENGLISH\grandma_5.wav");
			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_ActorTurnToLocator(CharacterFromID("grandma"), "goto", "turnaround");

			LAi_QuestDelay("throw_pistols_done2", 1.0);
		break;

		case "throw_pistols_done2":
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(characterFromID("grandma"), "none", "", "");
			
			DoQuickSave();  	//before shop fight

			pchar.quest.shop_fight.win_condition.l1 = "locator";
			pchar.quest.shop_fight.win_condition.l1.location = "wr_shop";
			pchar.quest.shop_fight.win_condition.l1.locator_group = "reload";
			pchar.quest.shop_fight.win_condition.l1.locator = "reload6";
			pchar.quest.shop_fight.win_condition = "shop_fight";
		break;
	//---------------------------------------------------------------------------------
		case "shop_fight":
			ChangeCharacterAddressGroup(characterFromID("grandma"), "wr_shop", "goto", "grandma_standby");
			ChangeCharacterAddressGroup(characterFromID("Dave Edna"), "wr_shop", "goto", "dave_standby");
			LAi_group_MoveCharacter(characterFromID("grandma"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("Dave Edna"), LAI_GROUP_PLAYER);

			RemoveCharacterEquip(characterFromID("wr_oman1X"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_oman1X"), "blade4");
			TakeItemFromCharacter(characterFromID("wr_oman1X"), "bladep2");
			GiveItem2Character(characterFromID("wr_oman1X"), "bladeboom");
			EquipCharacterbyItem(characterFromID("wr_oman1X"), "bladeboom");
			RemoveCharacterEquip(characterFromID("wr_oman1X"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_oman1X"), "pistol1");
			TakeItemFromCharacter(characterFromID("wr_oman1X"), "book29");
			LAi_SetStayType(CharacterFromID("wr_oman1X"));
			ChangeCharacterAddressGroup(characterFromID("wr_oman1X"), "wr_shop", "sit", "sit1");
			LAi_NoRebirthEnable(characterFromID("wr_oman1X"));

			LAi_QuestDelay("shop_fight1", 1.0);
		break;

		case "shop_fight1":
			PlaySound("OBJECTS\SHIPCHARGE\gunner_fire.wav");
			LAi_SetStayType(Pchar);

			LAi_LocationFightDisable(&Locations[FindLocation("wr_shop")], false);
			LAi_group_Register("WR_GUARDS_2");
			LAi_group_SetRelation(LAI_GROUP_PLAYER, "WR_GUARDS_2", LAI_GROUP_ENEMY);
			LAi_group_FightGroups(LAI_GROUP_PLAYER, "WR_GUARDS_2", true);

			LAi_QuestDelay("shop_ambush_no_reinc", 0.1);
			LAi_QuestDelay("shop_guards_defeated_check", 0.1);
			LAi_QuestDelay("shop_fight1A", 1.0);
		break;

		case "shop_fight1A":
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");

			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "throw", "shop_fight2", 2.0);
		break;

		case "shop_fight2":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");

			LAi_QuestDelay("shop_fight3", 1.0);
		break;

		case "shop_fight3":
			LAi_QuestDelay("shop_fight4", 1.0);
			LAi_QuestDelay("shop_fight5", 4.0);		//was 3.0
			LAi_QuestDelay("shop_fight6", 7.0);		//was 5.0
			LAi_QuestDelay("shop_fight7", 9.0);		//was 7.0
			LAi_QuestDelay("shop_fight8", 10.0);		//was 8.0
			LAi_QuestDelay("elevator_fire", 12.0);		// was 10.0
		break;

		case "shop_fight4":
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(Pchar, true);

			ChangeCharacterAddressGroup(characterFromID("wr_boc1"), "wr_shop", "reload", "reload2");
			LAi_NoRebirthEnable(characterFromID("wr_boc1"));
			RemoveCharacterEquip(characterFromID("wr_boc1"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_boc1"), "pistol1");
			LAi_SetActorType(characterFromID("wr_boc1"));
			LAi_ActorAttack(CharacterFromID("wr_boc1"), Pchar, "");					//nr 1
			LAi_group_MoveCharacter(characterFromID("wr_boc1"), "WR_GUARDS_2");
		break;

		case "shop_fight5":
			ChangeCharacterAddressGroup(characterFromID("wr_pir2"), "wr_shop", "reload", "reload2");
			LAi_NoRebirthEnable(characterFromID("wr_pir2"));
			RemoveCharacterEquip(characterFromID("wr_pir2"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_pir2"), "pistol1");
			LAi_SetActorType(characterFromID("wr_pir2"));
			LAi_ActorAttack(CharacterFromID("wr_pir2"), Pchar, "");					//nr 2
			LAi_group_MoveCharacter(characterFromID("wr_pir2"), "WR_GUARDS_2");
		break;

		case "shop_fight6":
			ChangeCharacterAddressGroup(characterFromID("wr_hubspa"), "wr_shop", "reload", "reload2");
			LAi_NoRebirthEnable(characterFromID("wr_hubspa"));
			RemoveCharacterEquip(characterFromID("wr_hubspa"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_hubspa"), "pistol1");
			LAi_SetActorType(characterFromID("wr_hubspa"));
			LAi_ActorAttack(CharacterFromID("wr_hubspa"), Pchar, "");				//nr 3
			LAi_group_MoveCharacter(characterFromID("wr_hubspa"), "WR_GUARDS_2");
		break;

		case "shop_fight7":
			ChangeCharacterAddressGroup(characterFromID("wr_fralut"), "wr_shop", "reload", "reload2");
			LAi_NoRebirthEnable(characterFromID("wr_fralut"));
			RemoveCharacterEquip(characterFromID("wr_fralut"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_fralut"), "pistol1");
			RemoveCharacterEquip(characterFromID("wr_fralut"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_fralut"), "blade3carpets");
			EquipCharacterbyItem(characterFromID("wr_fralut"), "blade4");
			LAi_SetActorType(characterFromID("wr_fralut"));
			LAi_ActorAttack(CharacterFromID("wr_fralut"), Pchar, "");				//nr 4
			LAi_group_MoveCharacter(characterFromID("wr_fralut"), "WR_GUARDS_2");
		break;

		case "shop_fight8":
			ChangeCharacterAddressGroup(characterFromID("wr_mong"), "wr_shop", "reload", "reload2");
			LAi_NoRebirthEnable(characterFromID("wr_mong"));
			RemoveCharacterEquip(characterFromID("wr_mong"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_mong"), "pistolbarrel");
			TakeItemFromCharacter(characterFromID("wr_mong"), "pistol1");
			RemoveCharacterEquip(characterFromID("wr_mong"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_mong"), "bladebarrel");
			EquipCharacterbyItem(characterFromID("wr_mong"), "blade4");
			LAi_SetActorType(characterFromID("wr_mong"));
			LAi_ActorAttack(CharacterFromID("wr_mong"), Pchar, "");					//nr 5
			LAi_group_MoveCharacter(characterFromID("wr_mong"), "WR_GUARDS_2");
		break;
	//------------------------------------------------------------------------------------------------------------------
		case "elevator_fire":
			PlaySound("INTERFACE\elevator_1.wav");

			LAi_QuestDelay("elevator_fire1", 3.0);
		break;

		case "elevator_fire1":
			LAi_SetFightMode(characterFromID("Dave Edna"), true);
			ChangeCharacterAddressGroup(characterFromID("Dave Edna"), "wr_shop", "goto", "elevator");

			PlaySound("OBJECTS\DUEL\pistol_bbus.wav");
			GetCharacterPos(CharacterFromID("Dave Edna"), &u, &v, &w);
			CreateParticleSystem("gunfire" , u+0.4, v+1.2, w-0.1, 0.0, 0.0, 0.0, sti(20) );
			LAi_KillCharacter(CharacterFromID("wr_fralut"));

			LAi_QuestDelay("elevator_fire2", 1.0);
			LAi_QuestDelay("shop_fight_gunner", 1.0);
		break;

		case "elevator_fire2":
			LAi_SetFightMode(characterFromID("Dave Edna"), false);
			ChangeCharacterAddressGroup(characterFromID("Dave Edna"), "wr_shop", "goto", "elevator1");

			LAi_QuestDelay("elevator_fire3", 1.0);
		break;

		case "elevator_fire3":
			ChangeCharacterAddressGroup(characterFromID("Dave Edna"), "wr_shop", "goto", "elevator2");

			LAi_QuestDelay("elevator_fire4", 1.0);
		break;

		case "elevator_fire4":
			ChangeCharacterAddressGroup(characterFromID("Dave Edna"), "wr_shop", "goto", "elevator3");

			LAi_QuestDelay("elevator_fire5", 1.0);
		break;

		case "elevator_fire5":
			ChangeCharacterAddressGroup(characterFromID("Dave Edna"), "wr_shop", "goto", "elevator4");

			LAi_QuestDelay("elevator_fire6", 1.0);
		break;

		case "elevator_fire6":
			ChangeCharacterAddressGroup(characterFromID("Dave Edna"), "wr_shop", "goto", "dave_standby");
		break;
	//------------------------------------------------------------------------------------------------------------------
		case "shop_fight_gunner":
			LAi_SetImmortal(CharacterFromID("wr_oman1X"), false);
			ChangeCharacterAddressGroup(characterFromID("wr_oman1X"), "wr_shop", "goto", "goto6");
			LAi_SetActorType(characterFromID("wr_oman1X"));
			LAi_ActorAttack(CharacterFromID("wr_oman1X"), Pchar, "");					//nr 6
			LAi_group_MoveCharacter(characterFromID("wr_oman1X"), "WR_GUARDS_2");
			PlaySound("VOICE\ENGLISH\Eng_m_b_059.wav");

			LAi_QuestDelay("gunner_bladeboom", 0.1);
			LAi_QuestDelay("shop_fight9", 1.0);
			LAi_QuestDelay("shop_fight10", 2.0);
			LAi_QuestDelay("shop_fight11", 2.0);
			LAi_QuestDelay("shop_fight12", 3.0);
			LAi_QuestDelay("dave_grandma_fire", 11.0);
		break;

		case "gunner_bladeboom":
			if(!IsEquipCharacterByItem(CharacterFromID("wr_oman1X"), "bladeboom"))
			{
				//just to be sure he's got the boom
				if(!CheckCharacterItem(CharacterFromID("wr_oman1X"),"bladeboom"))
				{
					GiveItem2Character(CharacterFromID("wr_oman1X"), "bladeboom");
				}

				RemoveCharacterEquip(CharacterFromID("wr_oman1X"), BLADE_ITEM_TYPE);
				EquipCharacterbyItem(CharacterFromID("wr_oman1X"), "bladeboom");
			}

			if(LAi_IsDead(CharacterFromID("wr_oman1X")))
			{
		
				//just to be sure he's got the boom
				if(!CheckCharacterItem(CharacterFromID("wr_oman1X"),"bladeboom"))
				{
					GiveItem2Character(CharacterFromID("wr_oman1X"), "bladeboom");
				}
		
				return;
			}
			else
			{
				LAi_QuestDelay("gunner_bladeboom", 0.5);
			}
		break;

		case "shop_fight9":
			ChangeCharacterAddressGroup(characterFromID("wr_grey"), "wr_shop", "reload", "reload2");
			LAi_NoRebirthEnable(characterFromID("wr_grey"));
			RemoveCharacterEquip(characterFromID("wr_grey"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_grey"), "pistol1");
			LAi_SetActorType(characterFromID("wr_grey"));
			LAi_ActorAttack(CharacterFromID("wr_grey"), Pchar, "");					//nr 7
			LAi_group_MoveCharacter(characterFromID("wr_grey"), "WR_GUARDS_2");
		break;

		case "shop_fight10":
			ChangeCharacterAddressGroup(characterFromID("wr_fat2"), "wr_shop", "reload", "reload3");
			LAi_NoRebirthEnable(characterFromID("wr_fat2"));
			RemoveCharacterEquip(characterFromID("wr_fat2"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_fat2"), "pistol1");
			LAi_SetActorType(characterFromID("wr_fat2"));
			LAi_ActorAttack(CharacterFromID("wr_fat2"), Pchar, "");					//nr 8
			LAi_group_MoveCharacter(characterFromID("wr_fat2"), "WR_GUARDS_2");
		break;

		case "shop_fight11":
			ChangeCharacterAddressGroup(characterFromID("wr_nap"), "wr_shop", "reload", "reload2");
			LAi_NoRebirthEnable(characterFromID("wr_nap"));
			RemoveCharacterEquip(characterFromID("wr_nap"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_nap"), "pistol1");
			LAi_SetActorType(characterFromID("wr_nap"));
			LAi_ActorAttack(CharacterFromID("wr_nap"), Pchar, "");					//nr 9
			LAi_group_MoveCharacter(characterFromID("wr_nap"), "WR_GUARDS_2");
		break;

		case "shop_fight12":
			ChangeCharacterAddressGroup(characterFromID("wr_pir4"), "wr_shop", "reload", "reload3");
			LAi_NoRebirthEnable(characterFromID("wr_pir4"));
			RemoveCharacterEquip(characterFromID("wr_pir4"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_pir4"), "pistol1");
			RemoveCharacterEquip(characterFromID("wr_pir4"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_pir4"), "bladeglobe");
			EquipCharacterbyItem(characterFromID("wr_pir4"), "blade4");
			LAi_SetActorType(characterFromID("wr_pir4"));
			LAi_ActorAttack(CharacterFromID("wr_pir4"), Pchar, "");					//nr 10
			LAi_group_MoveCharacter(characterFromID("wr_pir4"), "WR_GUARDS_2");
		break;
	//------------------------------------------------------------------------------------------------------------------
		case "dave_grandma_fire":
			Pchar.quest.shop_fight = "started";
			RemoveCharacterEquip(characterFromID("Dave Edna"), BLADE_ITEM_TYPE);
			GiveItem2Character(characterFromID("Dave Edna"), "bladestool");
			EquipCharacterbyItem(characterFromID("Dave Edna"), "bladestool");
			GiveItem2Character(characterFromID("Dave Edna"), "pistolbbuss");
			EquipCharacterbyItem(characterFromID("Dave Edna"), "pistolbbuss");
			TakeNItems(characterFromID("Dave Edna"),"gunpowder", 6);
			TakeNItems(characterFromID("Dave Edna"),"pistolgrapes", 6);

			RemoveCharacterEquip(characterFromID("grandma"), BLADE_ITEM_TYPE);
			GiveItem2Character(characterFromID("grandma"), "bladebroom");
			EquipCharacterbyItem(characterFromID("grandma"), "bladebroom");
			GiveItem2Character(characterFromID("grandma"), "pistolgrenade");
			EquipCharacterbyItem(characterFromID("grandma"), "pistolgrenade");

			ChangeCharacterAddressGroup(characterFromID("Dave Edna"), "wr_shop", "reload", "reload2");

			LAi_QuestDelay("dave_grandma_fire1", 1.0);
		break;

		case "dave_grandma_fire1":
			Locations[FindLocation("wr_shop")].reload.l2.disable = 1;			//back to shop office
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(characterFromID("grandma"), "wr_shop", "reload", "reload2");

			LAi_QuestDelay("dave_bladestool", 0.5);
			LAi_QuestDelay("grandma_bladebroom", 0.5);

			LAi_QuestDelay("dave_grandma_fire2", 1.5);
		break;

		case "dave_grandma_fire2":
			PlaySound("VOICE\ENGLISH\grandma_yell.wav");

			LAi_QuestDelay("dave_grandma_fire3", 0.5);
		break;

		case "dave_grandma_fire3":
			GetCharacterPos(CharacterFromID("wr_pir4"), &u, &v, &w);
			CreateParticleSystemX("blast" , u, v, w, 0.0, 0.0, 0.0, 5 );
			CreateParticleSystemX("fort_fire" , u, v, w, 0.0, 0.0, 0.0, 5 );
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire3.wav");
			LAi_KillCharacter(CharacterFromID("wr_pir4"));
		break;
	//-------------------------------------------------------------------------------------------------------------------------
		case "dave_bladestool":
			if(CheckAttribute(Pchar,"quest.shop_fight") && Pchar.quest.shop_fight == "started")
			{
				if(!IsEquipCharacterByItem(CharacterFromID("Dave Edna"), "bladestool"))
				{
					//just to be sure he's got the stool
					if(!CheckCharacterItem(CharacterFromID("Dave Edna"),"bladestool"))
					{
						GiveItem2Character(CharacterFromID("Dave Edna"), "bladestool");
					}

					RemoveCharacterEquip(CharacterFromID("Dave Edna"), BLADE_ITEM_TYPE);
					EquipCharacterbyItem(CharacterFromID("Dave Edna"), "bladestool");
				}

				LAi_QuestDelay("dave_bladestool", 0.5);
			}
			else return;
		break;

		case "grandma_bladebroom":
			if(CheckAttribute(Pchar,"quest.shop_fight") && Pchar.quest.shop_fight == "started")
			{
				if(!IsEquipCharacterByItem(CharacterFromID("grandma"), "bladebroom"))
				{
					//just to be sure she's got the broom
					if(!CheckCharacterItem(CharacterFromID("grandma"),"bladebroom"))
					{
						GiveItem2Character(CharacterFromID("grandma"), "bladebroom");
					}

					RemoveCharacterEquip(CharacterFromID("grandma"), BLADE_ITEM_TYPE);
					EquipCharacterbyItem(CharacterFromID("grandma"), "bladebroom");
				}

				LAi_QuestDelay("grandma_bladebroom", 0.5);
			}
			else return;
		break;
	//------------------------------------------------------------------------------------------------------------------
		case "shop_ambush_no_reinc":
			if(pchar.location == "wr_shop")
			{
				if(LAi_IsDead(Pchar))
				{
					LAi_QuestDelay("delay_no_reinc", 3.0);
				}
				else LAi_QuestDelay("shop_ambush_no_reinc", 1.0);
			}
			else return;
		break;

		case "shop_guards_defeated_check":
			Pchar.quest.shop_guards_defeated_check1.win_condition.l1 = "NPC_Death";
			Pchar.quest.shop_guards_defeated_check1.win_condition.l1.character = "wr_boc1";
			Pchar.quest.shop_guards_defeated_check1.win_condition.l2 = "NPC_Death";
			Pchar.quest.shop_guards_defeated_check1.win_condition.l2.character = "wr_pir2";
			Pchar.quest.shop_guards_defeated_check1.win_condition.l3 = "NPC_Death";
			Pchar.quest.shop_guards_defeated_check1.win_condition.l3.character = "wr_hubspa";
			Pchar.quest.shop_guards_defeated_check1.win_condition.l4 = "NPC_Death";
			Pchar.quest.shop_guards_defeated_check1.win_condition.l4.character = "wr_fralut";
			Pchar.quest.shop_guards_defeated_check1.win_condition.l5 = "NPC_Death";
			Pchar.quest.shop_guards_defeated_check1.win_condition.l5.character = "wr_mong";
			Pchar.quest.shop_guards_defeated_check1.win_condition.l6 = "NPC_Death";
			Pchar.quest.shop_guards_defeated_check1.win_condition.l6.character = "wr_oman1X";
			Pchar.quest.shop_guards_defeated_check1.win_condition.l7 = "NPC_Death";
			Pchar.quest.shop_guards_defeated_check1.win_condition.l7.character = "wr_grey";
			Pchar.quest.shop_guards_defeated_check1.win_condition.l8 = "NPC_Death";
			Pchar.quest.shop_guards_defeated_check1.win_condition.l8.character = "wr_fat2";
			Pchar.quest.shop_guards_defeated_check1.win_condition.l9 = "NPC_Death";
			Pchar.quest.shop_guards_defeated_check1.win_condition.l9.character = "wr_nap";
			Pchar.quest.shop_guards_defeated_check1.win_condition.l10 = "NPC_Death";
			Pchar.quest.shop_guards_defeated_check1.win_condition.l10.character = "wr_pir4";
			Pchar.quest.shop_guards_defeated_check1.win_condition = "shop_guards_defeated_check1";
		break;

		case "shop_guards_defeated_check1":
			Pchar.quest.shop_fight = "over";

			if(!IsEquipCharacterByItem(CharacterFromID("Dave Edna"), "bladestool"))
			{
				//just to be sure he's got the stool
				if(!CheckCharacterItem(CharacterFromID("Dave Edna"),"bladestool"))
				{
					GiveItem2Character(CharacterFromID("Dave Edna"), "bladestool");
				}

				RemoveCharacterEquip(CharacterFromID("Dave Edna"), BLADE_ITEM_TYPE);
				EquipCharacterbyItem(CharacterFromID("Dave Edna"), "bladestool");
			}

			if(!IsEquipCharacterByItem(CharacterFromID("grandma"), "bladebroom"))
			{
				//just to be sure she's got the broom
				if(!CheckCharacterItem(CharacterFromID("grandma"),"bladebroom"))
				{
					GiveItem2Character(CharacterFromID("grandma"), "bladebroom");
				}

				RemoveCharacterEquip(CharacterFromID("grandma"), BLADE_ITEM_TYPE);
				EquipCharacterbyItem(CharacterFromID("grandma"), "bladebroom");
			}

			LAi_SetFightMode(characterFromID("Dave Edna"), false);			//just in case
			LAi_SetFightMode(characterFromID("grandma"), false);

			LAi_SetStayType(characterFromID("Dave Edna"));
			LAi_SetStayType(characterFromID("grandma"));

			LAi_QuestDelay("Pchar_bladeboom_check", 0.1);
			LAi_QuestDelay("shop_pistol20_dave", 92.0);

		//3 ways to start grandma dialog
			LAi_QuestDelay("pistol20_check", 0.5);
			LAi_QuestDelay("5_pistols_check", 0.5);
			LAi_QuestDelay("pistolthrow5_check", 0.5);
		break;

		case "pistol20_check":
			if(pchar.location == "wr_shop")
			{
				if(CheckCharacterItem(Pchar,"pistol20"))
				{
			//logit("P20");
					if(CheckAttribute(Pchar,"shop_fight_end") && Pchar.shop_fight_end == "on")
					{
						return;
					}
					else LAi_QuestDelay("shop_fight_end", 0.1);
				}
				else LAi_QuestDelay("pistol20_check", 0.5);	//loops until item picked up
			}
		break;

		case "5_pistols_check":
			if(pchar.location == "wr_shop")
			{
				if(CheckCharacterItem(Pchar,"pistol201") && CheckCharacterItem(Pchar,"pistol202") && CheckCharacterItem(Pchar,"pistol204")
				&& CheckCharacterItem(Pchar,"pistol205") && CheckCharacterItem(Pchar,"pistol206"))
				{
			//logit("5_P");
					if(CheckAttribute(Pchar,"shop_fight_end") && Pchar.shop_fight_end == "on")
					{
						return;
					}
					else LAi_QuestDelay("shop_fight_end", 0.1);
				}
				else LAi_QuestDelay("5_pistols_check", 0.5);	//loops until item picked up
			}
		break;

		case "pistolthrow5_check":
			if(pchar.location == "wr_shop")
			{
				if(CheckCharacterItem(Pchar,"pistolthrow5"))
				{
			//logit("PTR5");
					if(CheckAttribute(Pchar,"shop_fight_end") && Pchar.shop_fight_end == "on")
					{
						return;
					}
					else LAi_QuestDelay("shop_fight_end", 0.1);
				}
				else LAi_QuestDelay("pistolthrow5_check", 0.5);	//loops until item picked up
			}
		break;

		case "Pchar_bladeboom_check":
			if(pchar.location == "wr_shop")
			{
				if(CheckCharacterItem(Pchar,"bladeboom"))
				{
					RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
					if(CheckCharacterItem(Pchar,"bladeplank"))
					{
						TakeItemFromCharacter(Pchar, "bladeplank");
					}
					EquipCharacterbyItem(Pchar, "bladeboom");
				}
				else LAi_QuestDelay("Pchar_bladeboom_check", 0.5);
			}
			else return;
		break;

		case "shop_fight_end":
			Pchar.shop_fight_end = "on";

			if(CheckCharacterItem(Pchar,"pistol20"))
			{
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "pistol20");		//if not 2 x pistol20
			}

			RemoveCharacterEquip(Pchar, BELT_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "pistolbelt");

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "pistolthrow5"); TakeItemFromCharacter(Pchar, "pistolthrow4"); TakeItemFromCharacter(Pchar, "pistolthrow3");
			TakeItemFromCharacter(Pchar, "pistolthrow2"); TakeItemFromCharacter(Pchar, "pistolthrow1");
			TakeItemFromCharacter(Pchar, "pistol201"); TakeItemFromCharacter(Pchar, "pistol202"); TakeItemFromCharacter(Pchar, "pistol203");
			TakeItemFromCharacter(Pchar, "pistol204"); TakeItemFromCharacter(Pchar, "pistol205"); TakeItemFromCharacter(Pchar, "pistol206");
			GiveItem2Character(Pchar, "pistol20");
			EquipCharacterbyItem(Pchar, "pistol20");

			if(!IsEquipCharacterByItem(Pchar, "ammobag2"))
			{
				if(!CheckCharacterItem(Pchar,"ammobag2")) GiveItem2Character(Pchar, "ammobag2");
				EquipCharacterByItem(Pchar, "ammobag2");
				TakeItemFromCharacter(Pchar, "ammobag1");
			}

			LAi_QuestDelay("shop_fight_end1", 0.5);			//direct to dialog without checking for boom
		break;
	
		case "shop_fight_end1":
			if(CheckAttribute(Pchar,"quest.p20andboom") && Pchar.quest.p20andboom == "ok")
			{
				return;
			}
			else
			{
				Pchar.quest.p20andboom = "ok";

				LAi_SetActorType(CharacterFromID("grandma"));
				LAi_ActorDialog(characterFromID("grandma"), pchar, "", 0.0, 0.0);
				LAi_ActorWaitDialog(Pchar, characterFromID("grandma"));
				Characters[GetCharacterIndex("grandma")].dialog.CurrentNode  = "shop_fight";
			}
		break;
	
		case "shop_fight_done":
			//from grandma dialog
			LAi_SetActorType(characterFromID("Dave Edna"));
			LAi_ActorDialog(characterFromID("Dave Edna"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Dave Edna"));
			Characters[GetCharacterIndex("Dave Edna")].dialog.CurrentNode  = "sell_blades";
		break;

		case "sell_blades_done":
			//from Dave dialog
			TakeNItems(Pchar,"blade5", -20);
			TakeNItems(Pchar,"blade5-1", -20);
			TakeNItems(Pchar,"blade4", -20);
			TakeNItems(Pchar,"blade4-1", -20);

			DeleteAttribute(CharacterFromID("wr_boc1"), "items");
			DeleteAttribute(CharacterFromID("wr_pir2"), "items");
			DeleteAttribute(CharacterFromID("wr_hubspa"), "items");
			DeleteAttribute(CharacterFromID("wr_fralut"), "items");
			DeleteAttribute(CharacterFromID("wr_mong"), "items");
			DeleteAttribute(CharacterFromID("wr_oman1X"), "items");
			DeleteAttribute(CharacterFromID("wr_grey"), "items");
			DeleteAttribute(CharacterFromID("wr_fat2"), "items");
			DeleteAttribute(CharacterFromID("wr_nap"), "items");
			DeleteAttribute(CharacterFromID("wr_pir4"), "items");

			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_ActorDialog(characterFromID("grandma"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("grandma"));
			Characters[GetCharacterIndex("grandma")].dialog.CurrentNode  = "stay_in_shop";
		break;

		case "stay_in_shop_done":
			//from grandma dialog
			Pchar.quest.med_grandma = "over";
			Pchar.quest.medicine_quest = "over";

			LAi_SetActorType(characterFromID("Dave Edna"));
			LAi_ActorDialog(characterFromID("Dave Edna"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Dave Edna"));
			Characters[GetCharacterIndex("Dave Edna")].dialog.CurrentNode  = "bad_officers";
		break;

		case "bad_officers_done":
			//from Dave dialog
			AddQuestRecord("Woodes_Rogers_crew", "3");

			LAi_SetActorType(characterFromID("Dave Edna"));
			LAi_ActorGoToLocator(characterFromID("Dave Edna"), "reload", "reload6", "bad_officers_done1", 4.0);
		break;

		case "bad_officers_done1":
			PlaySound("INTERFACE\key_unlock.wav");
			Locations[FindLocation("wr_shop")].reload.l6.disable = 0;			//to loanshark

			LAi_QuestDelay("bad_officers_done2", 1.0);
		break;

		case "bad_officers_done2":
			LAi_ActorGoToLocator(characterFromID("Dave Edna"), "goto", "goto13", "bad_officers_done3", 2.0);

			ChangeCharacterAddressGroup(CharacterFromID("Redmond Usurer"), "none", "", ""); //temp gone
			locations[FindLocation("Redmond_UsurerHouse")].type = "Rogers_neutral";		//temp, was "shop"
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l3.disable = 1;		//to library
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l2.disable = 1;		//to shop
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l1.disable = 1;		//to town
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l6.disable = 0;		//to cellar
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l7.disable = 1;		//back door to town
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l4.disable = 0;		//to behind counter

			Locations[FindLocation("Loanshark_cellar")].reload.l1.disable = 0;		//to mine
			Locations[FindLocation("Loanshark_cellar")].reload.l2.disable = 1;		//to LS

			locations[FindLocation("wr_mine")].id.label = "Port Royal old mine";
			Locations[FindLocation("wr_mine")].reload.l3.disable = 1;			//to prison guard room
			Locations[FindLocation("wr_mine")].reload.l2.disable = 0;			//back to LS cellar
			Locations[FindLocation("wr_mine")].reload.l1.disable = 0;			//to food_supply
			Locations[FindLocation("wr_mine")].models.always.locators = "mine_l_JRH1";	//mine lights = on

			ChangeCharacterAddressGroup(CharacterFromID("wr_boc5"), "none", "", "");	//bsw from food_supply
			locations[FindLocation("wr_food_supply")].id.label = "Woodes Rogers' food cellar";
			Locations[FindLocation("wr_food_supply")].reload.l4.disable = 0;		//gate open
			Locations[FindLocation("wr_food_supply")].reload.l5.disable = 1;		//wine_cellar still locked

			Locations[FindLocation("wr_kitchen")].models.always.locators = "FlamHouse_locators_JRH2";
			Pchar.quest.wr_kitchendoor = "stuck";
			Locations[FindLocation("wr_kitchen")].reload.l1.disable = 1;			//to town
			Locations[FindLocation("wr_kitchen")].reload.l2.disable = 1;			//to wr bedroom
			Locations[FindLocation("wr_kitchen")].reload.l3.disable = 0;			//to food_supply
			Locations[FindLocation("wr_kitchen")].reload.l5.disable = 1;			//to ck bedroom
			Locations[FindLocation("wr_kitchen")].reload.l6.disable = 1;			//to crew
			ChangeCharacterAddressGroup(CharacterFromID("wr_prt7"), "none", "", "");	//in kitchen
			ChangeCharacterAddressGroup(CharacterFromID("wr_cor1_3"), "none", "", "");	//in kitchen

			Pchar.quest.Friday_room = "open";						//to Friday

			locations[FindLocation("wr_wine_cellar")].id.label = "";
			locations[FindLocation("church_wine_cellar")].id.label = "Church wine cellar";
			Pchar.quest.church_barrel = "filled";						//start = filled

			locations[FindLocation("Redmond_church")].reload.l2.disable = 0;
			SetCharacterShipLocation(characterFromID("pir_cap28"), "none");			//barrel3_roll
			locations[FindLocation("wr_crypt")].id.label = "Port Royal catacombs";

			Locations[FindLocation("wr_animists_stairs")].reload.l2.disable = 0;		//to chapel
			Locations[FindLocation("wr_chapel")].reload.l2.disable = 0;			//to animists_stairs

			locations[FindLocation("wr_church_inside")].type = "Vane_church";			//not tavern if no pirates
			Locations[FindLocation("wr_church_inside")].reload.l8.disable = 0;		//to chapel_stairs


			pchar.quest.foggy_cellar.win_condition.l1 = "location";
			pchar.quest.foggy_cellar.win_condition.l1.location = "Redmond_UsurerHouse";
			pchar.quest.foggy_cellar.win_condition = "foggy_cellar";
		break;

		case "bad_officers_done3":
			LAi_ActorTurnToLocator(characterFromID("Dave Edna"), "reload", "reload6");

			LAi_QuestDelay("bad_officers_done4", 1.0);
		break;

		case "bad_officers_done4":
			LAi_SetStayType(characterFromID("Dave Edna"));
			LAi_SetStayType(characterFromID("grandma"));
		break;
//---------------------------------------------------------------------------------------------------------------------------------
		case "shop_pistol20_dave":
			//just in case pchar has not picked up all pistols (and corpses have disappeared)
			//Log_SetStringToLog("92 seconds now");

			if(pchar.location == "wr_shop" && !CheckCharacterItem(Pchar,"pistol20"))
			{
				Pchar.quest.p20andboom = "ok";

				LAi_SetActorType(CharacterFromID("grandma"));
				LAi_ActorDialog(characterFromID("grandma"), pchar, "", 0.0, 0.0);
				LAi_ActorWaitDialog(Pchar, characterFromID("grandma"));
				Characters[GetCharacterIndex("grandma")].dialog.CurrentNode  = "shop_fight";
			}
		break;
	
		case "shop_pistol20_given":
			//from Dave dialog
			//from grandma dialog

			ChangeCharacterAddressGroup(CharacterFromID("wr_boc1"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_pir2"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_hubspa"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_fralut"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_mong"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_oman1X"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_grey"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_fat2"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_nap"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_pir4"), "none", "", "");
		
			RemoveCharacterEquip(Pchar, BELT_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "pistolbelt");

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "pistolthrow5"); TakeItemFromCharacter(Pchar, "pistolthrow4"); TakeItemFromCharacter(Pchar, "pistolthrow3");
			TakeItemFromCharacter(Pchar, "pistolthrow2"); TakeItemFromCharacter(Pchar, "pistolthrow1");
			TakeItemFromCharacter(Pchar, "pistol201"); TakeItemFromCharacter(Pchar, "pistol202"); TakeItemFromCharacter(Pchar, "pistol203");
			TakeItemFromCharacter(Pchar, "pistol204"); TakeItemFromCharacter(Pchar, "pistol205"); TakeItemFromCharacter(Pchar, "pistol206");
			GiveItem2Character(Pchar, "pistol20");
			EquipCharacterbyItem(Pchar, "pistol20");

			if(!IsEquipCharacterByItem(Pchar, "ammobag2"))
			{
				if(!CheckCharacterItem(Pchar,"ammobag2")) GiveItem2Character(Pchar, "ammobag2");
				EquipCharacterByItem(Pchar, "ammobag2");
				TakeItemFromCharacter(Pchar, "ammobag1");
			}
		break;
//---------------------------------------------------------------------------------------------------------------------------------
	//[13] from here, only used direct from [13]
		case "ready_for_foggy_cellar":
			LAi_SetPlayerType(Pchar);

			ChangeCharacterAddressGroup(CharacterFromID("Redmond Usurer"), "none", "", ""); //temp gone
			locations[FindLocation("Redmond_UsurerHouse")].type = "Rogers_neutral";		//temp, was "shop"
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l3.disable = 1;		//to library
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l2.disable = 1;		//to shop
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l1.disable = 1;		//to town
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l6.disable = 0;		//to cellar
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l7.disable = 1;		//back door to town
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l4.disable = 0;		//to behind counter

			Locations[FindLocation("Loanshark_cellar")].reload.l1.disable = 0;		//to mine
			Locations[FindLocation("Loanshark_cellar")].reload.l2.disable = 1;		//to LS

			locations[FindLocation("wr_mine")].id.label = "Port Royal old mine";
			Locations[FindLocation("wr_mine")].reload.l3.disable = 1;			//to prison guard room
			Locations[FindLocation("wr_mine")].reload.l2.disable = 0;			//back to LS cellar
			Locations[FindLocation("wr_mine")].models.always.locators = "mine_l_JRH1";	//mine lights = on

			ChangeCharacterAddressGroup(CharacterFromID("wr_boc5"), "none", "", "");	//bsw from food_supply
			locations[FindLocation("wr_food_supply")].id.label = "Woodes Rogers' food cellar";
			Locations[FindLocation("wr_food_supply")].reload.l5.disable = 1;		//wine_cellar still locked

			Locations[FindLocation("wr_kitchen")].reload.l3.disable = 0;			//to food_supply
			ChangeCharacterAddressGroup(CharacterFromID("wr_prt7"), "none", "", "");	//in kitchen
			ChangeCharacterAddressGroup(CharacterFromID("wr_cor1_3"), "none", "", "");	//in kitchen
			Pchar.quest.wr_kitchendoor = "stuck";

			Pchar.quest.Friday_room = "open";						//to Friday

			locations[FindLocation("wr_wine_cellar")].id.label = "";
			locations[FindLocation("church_wine_cellar")].id.label = "Church wine cellar";
			Pchar.quest.church_barrel = "filled";						//start = filled

			locations[FindLocation("Redmond_church")].reload.l2.disable = 0;
			SetCharacterShipLocation(characterFromID("pir_cap28"), "none");			//barrel3_roll

			LAi_QuestDelay("foggy_cellar", 0.1);
		break;
	//---------------------------------------------------------------------------------
		case "foggy_cellar":
			//story continues...

			Pchar.quest.shop_elevator = "on_again";
			Pchar.quest.wine_cellar_enemies = "not_yet";
			Pchar.quest.church_wine = "off";
			Pchar.quest.churchcellar_fillbottle = "off";

		//extra check when leaving wr_shop
			if(CheckCharacterItem(Pchar,"bladeboom"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterbyItem(Pchar, "bladeboom");				//plank could be visibly equipped without having it
				TakeItemFromCharacter(Pchar, "bladeplank");
			}

			if(!CheckCharacterItem(Pchar,"pistol20"))
			{
				LAi_QuestDelay("shop_pistol20_given", 0.1);
			}

			ChangeCharacterAddressGroup(CharacterFromID("wr_boc1"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_pir2"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_hubspa"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_fralut"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_mong"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_grey"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_fat2"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_nap"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_pir4"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_oman1X"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("Dave Edna"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("grandma"), "none", "", "");

			PlaySound("INTERFACE\closed_locked_door.wav");

			locations[FindLocation("wr_mine")].id.label = "Port Royal old mine";
			locations[FindLocation("wr_kitchen")].id.label = "Woodes Rogers' kitchen";
			locations[FindLocation("wr_crew")].id.label = "Crew's quarter";
			locations[FindLocation("ck_bedroom")].id.label = "Caroline K's bedroom";
			locations[FindLocation("wr_friday")].id.label = "Friday's room";
			locations[FindLocation("church_wine_cellar")].id.label = "Church wine cellar";

			locations[FindLocation("wr_kitchen")].id.label = "Woodes Rogers' kitchen";
			locations[FindLocation("wr_mine")].id.label = "Redmond old mine";
			locations[FindLocation("wr_kitchen")].id.label = "Woodes Rogers' kitchen";

			Locations[FindLocation("Loanshark_cellar")].environment.weather = "true";
			//SetNextWeather("Medium Foggy Mine");

			pchar.quest.foggy_cellar1.win_condition.l1 = "location";
			pchar.quest.foggy_cellar1.win_condition.l1.location = "Loanshark_cellar";
			pchar.quest.foggy_cellar1.win_condition = "foggy_cellar1";
		break;

		case "foggy_cellar1":
			//resest loanshark:
			ChangeCharacterAddressGroup(CharacterFromID("Redmond Usurer"), "Redmond_UsurerHouse", "sit", "sit1");
			LAi_SetSitType(CharacterFromID("Redmond Usurer"));

			locations[FindLocation("Redmond_UsurerHouse")].type = "Rogers_neutral";
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l2.disable = 1;		//to shop
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l1.disable = 0;		//to town
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l6.disable = 1;		//to cellar
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l7.disable = 0;		//back door to town
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l4.disable = 1;		//to behind counter

			PlaySound("INTERFACE\closed_locked_door.wav");

			LAi_QuestDelay("friday_room", 0.1);
			LAi_QuestDelay("flooded_mine", 0.1);
			LAi_QuestDelay("flooded_wine_cellars", 0.1);
		break;
	//................................................................................................
		case "flooded_mine":
			//Log_SetStringToLog("AAAAAAAAAAAAAAAAAAA");
			Locations[FindLocation("wr_mine")].environment.weather = "true";
			Locations[FindLocation("wr_mine")].environment.sea = "true";
			//SetNextWeather("Flooded Mine");

			pchar.quest.flooded_mine1.win_condition.l1 = "location";
			pchar.quest.flooded_mine1.win_condition.l1.location = "wr_mine";
			pchar.quest.flooded_mine1.win_condition = "flooded_mine1";
		break;

		case "flooded_mine1":
			//Log_SetStringToLog("BBBBBBBBBBBBBBBBBB");
			Locations[FindLocation("Loanshark_cellar")].environment.weather = "true";
			//SetNextWeather("Medium Foggy Mine");					//if pchar returns to LS cellar

			Pchar.quest.flooded_mine.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.flooded_mine.win_condition.l1.location = "wr_mine";
			Pchar.quest.flooded_mine.win_condition = "flooded_mine";
		break;
	//................................................................................................
		case "flooded_wine_cellars":
			pchar.quest.flooded_wine_cellars1.win_condition.l1 = "locator";
			pchar.quest.flooded_wine_cellars1.win_condition.l1.location = "wr_food_supply";
			pchar.quest.flooded_wine_cellars1.win_condition.l1.locator_group = "reload";
			pchar.quest.flooded_wine_cellars1.win_condition.l1.locator = "reload5";
			pchar.quest.flooded_wine_cellars1.win_condition = "flooded_wine_cellars1";
		break;

		case "flooded_wine_cellars1":
			//SetNextWeather("Flooded Mine");

			pchar.quest.flooded_wine_cellars2.win_condition.l1 = "location";
			pchar.quest.flooded_wine_cellars2.win_condition.l1.location = "wr_wine_cellar";
			pchar.quest.flooded_wine_cellars2.win_condition = "flooded_wine_cellars2";
		break;

		case "flooded_wine_cellars2":
			//SetNextWeather("Flooded Mine");
			//SetNextWeather("Evening After Rain");

			Locations[FindLocation("wr_food_supply")].reload.l5.disable = 1;
			Locations[FindLocation("wr_wine_cellar")].reload.l1.disable = 1;	//back to food_supply
			PlaySound("INTERFACE\key_lock.wav");
			Locations[FindLocation("wr_wine_cellar")].image = "";

			LAi_QuestDelay("switch_weather_wine_cellars", 0.1);	//starts image & weather loop
		break;
	//......................................................................................................
		case "friday_room":
			//story continues...

			ChangeCharacterAddressGroup(CharacterFromID("Friday"), "wr_friday", "sit", "sit3");
			LAi_SetSitType(CharacterFromID("Friday"));
			ChangeCharacterAddressGroup(CharacterFromID("Selkirk"), "wr_friday", "sit", "sit2");
			LAi_SetSitType(CharacterFromID("Selkirk"));
			ChangeCharacterAddressGroup(CharacterFromID("wench3"), "wr_booty", "reload", "reload4");
			LAi_SetStayType(CharacterFromID("wench3"));

			pchar.quest.friday_room1.win_condition.l1 = "locator";
			pchar.quest.friday_room1.win_condition.l1.location = "wr_booty";
			pchar.quest.friday_room1.win_condition.l1.locator_group = "goto";
			pchar.quest.friday_room1.win_condition.l1.locator = "goto16";
			pchar.quest.friday_room1.win_condition = "friday_room1";
		break;

		case "friday_room1":
			PlaySound("OBJECTS\DUEL\reload1.wav");

			LAi_QuestDelay("friday_room2", 0.5);
		break;

		case "friday_room2":
			PlaySound("VOICE\ENGLISH\gr_wench3_aye.wav");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("friday_room3", 1.0);
		break;

		case "friday_room3":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload4");
			LAi_SetActorType(characterFromID("wench3"));
			LAi_ActorTurnToLocator(characterFromID("wench3"), "goto", "goto16");

			LAi_QuestDelay("friday_room4", 1.0);
		break;

		case "friday_room4":
			LAi_SetPlayerType(Pchar);
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");

			LAi_QuestDelay("friday_room5", 2.0);
		break;

		case "friday_room5":
			ChangeCharacterAddressGroup(CharacterFromID("wench3"), "wr_friday", "goto", "goto1");
			PlaySound("PEOPLE\counter_openclose.wav");

			pchar.quest.friday_room6.win_condition.l1 = "locator";
			pchar.quest.friday_room6.win_condition.l1.location = "wr_friday";
			pchar.quest.friday_room6.win_condition.l1.locator_group = "goto";
			pchar.quest.friday_room6.win_condition.l1.locator = "dialog";
			pchar.quest.friday_room6.win_condition = "friday_room6";
		break;

		case "friday_room6":
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorDialog(characterFromID("Selkirk"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Selkirk"));
			Characters[GetCharacterIndex("Selkirk")].dialog.CurrentNode  = "safe_room";
		break;

		case "friday_room7":
			LAi_SetActorType(CharacterFromID("wench3"));
			LAi_ActorDialog(characterFromID("wench3"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wench3"));
			Characters[GetCharacterIndex("wench3")].dialog.CurrentNode  = "get_help";
		break;

		case "friday_room8":
			PlaySound("VOICE\ENGLISH\Eng_m_c_073.wav");

			LAi_QuestDelay("friday_room9", 3.0);
		break;

		case "friday_room9":
			PlaySound("OBJECTS\DUEL\woman_hit3.wav");

			LAi_QuestDelay("friday_room10", 0.5);
		break;

		case "friday_room10":
			LAi_SetActorType(CharacterFromID("wench3"));
			LAi_ActorDialog(characterFromID("wench3"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wench3"));
			Characters[GetCharacterIndex("wench3")].dialog.CurrentNode  = "not_pirates";
		break;

		case "friday_room11":
			LAi_SetStayType(CharacterFromID("Friday"));
			LAi_SetActorType(CharacterFromID("Friday"));

			LAi_QuestDelay("friday_room12", 0.5);
		break;

		case "friday_room12":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "sit", "sit3");
			LAi_ActorTurnToLocator(CharacterFromID("Friday"), "goto", "dialog");
			PlaySound("VOICE\ENGLISH\gr_friday4.wav");

			LAi_QuestDelay("friday_room13", 2.5);
		break;

		case "friday_room13":
			ChangeCharacterAddressGroup(CharacterFromID("Friday"), "wr_friday", "sit", "sit3");
			LAi_SetSitType(CharacterFromID("Friday"));
			LAi_SetPlayerType(Pchar);

			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorDialog(characterFromID("Selkirk"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Selkirk"));
			Characters[GetCharacterIndex("Selkirk")].dialog.CurrentNode  = "swim_captain";
		break;

		case "friday_room14":
			LAi_SetActorType(CharacterFromID("wench3"));
			LAi_ActorDialog(characterFromID("wench3"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("wench3"));
			Characters[GetCharacterIndex("wench3")].dialog.CurrentNode  = "wine_cellars";
		break;

		case "friday_room15":
			//from Caroline dialog
			AddQuestRecord("Woodes_Rogers_crew", "4");
			SetQuestHeader("Wine_cellars");
			AddQuestRecord("Wine_cellars", "1");
			DeleteQuestHeader("Woodes_Rogers_reward_7");

			LAi_SetStayType(CharacterFromID("wench3"));
			ChangeCharacterAddressGroup(CharacterFromID("Selkirk"), "wr_friday", "goto", "goto2");
			LAi_SetSitType(CharacterFromID("Selkirk"));
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "goto4", "friday_room16", 2.0);
		break;

		case "friday_room16":
			PlaySound("VOICE\ENGLISH\Eng_m_c_076.wav");
			LAi_ActorTurnToLocator(Pchar, "reload", "reload1");
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorGoToLocator(CharacterFromID("Selkirk"), "reload", "reload1", "friday_room17", 4.0);
		break;

		case "friday_room17":
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(CharacterFromID("Selkirk"), "wr_booty", "goto", "goto14");
			locations[FindLocation("wr_wine_cellar")].id.label = "Roger's wine cellar";
			Locations[FindLocation("wr_food_supply")].reload.l5.disable = 0;		//finally open
			LAi_SetPlayerType(Pchar);

			pchar.quest.friday_room18.win_condition.l1 = "locator";
			pchar.quest.friday_room18.win_condition.l1.location = "wr_booty";
			pchar.quest.friday_room18.win_condition.l1.locator_group = "goto";
			pchar.quest.friday_room18.win_condition.l1.locator = "reload2";
			pchar.quest.friday_room18.win_condition = "friday_room18";
		break;

		case "friday_room18":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto14");

			LAi_QuestDelay("friday_room18A", 1.0);

			LAi_ActorGoToLocator(CharacterFromID("Selkirk"), "reload", "reload1", "friday_room19", 4.0);
		break;

		case "friday_room18A":
			LAi_SetPlayerType(Pchar);

			pchar.quest.friday_room20.win_condition.l1 = "locator";
			pchar.quest.friday_room20.win_condition.l1.location = "wr_kitchen";
			pchar.quest.friday_room20.win_condition.l1.locator_group = "reload";
			pchar.quest.friday_room20.win_condition.l1.locator = "reload6";
			pchar.quest.friday_room20.win_condition = "friday_room20";
		break;

		case "friday_room19":
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(CharacterFromID("Selkirk"), "wr_food_supply", "reload", "reload5");
		break;

		case "friday_room20":
			PlaySound("INTERFACE\closed_door.wav");

			pchar.quest.friday_room21.win_condition.l1 = "locator";
			pchar.quest.friday_room21.win_condition.l1.location = "wr_food_supply";
			pchar.quest.friday_room21.win_condition.l1.locator_group = "goto";
			pchar.quest.friday_room21.win_condition.l1.locator = "bible";
			pchar.quest.friday_room21.win_condition = "friday_room21";
		break;

		case "friday_room21":
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorDialog(characterFromID("Selkirk"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Selkirk"));
			Characters[GetCharacterIndex("Selkirk")].dialog.CurrentNode  = "bible";

			pchar.quest.friday_room22.win_condition.l1 = "location";
			pchar.quest.friday_room22.win_condition.l1.location = "wr_wine_cellar";
			pchar.quest.friday_room22.win_condition = "friday_room22";
		break;

		case "bible_given":
			//from Selkirk dialog
			LAi_SetStayType(CharacterFromID("Selkirk"));
		break;

		case "friday_room22":
			Pchar.quest.wet_gp = "yes";

			if(!IsEquipCharacterByItem(Pchar, "pistol20")) EquipCharacterbyItem(Pchar, "pistol20");
			SetModel(PChar, "Pira4M_HTUS_a", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			string weaponID10 = GetCharacterEquipByGroup(Pchar,GUN_ITEM_TYPE);
			aref weapon10;
			Items_FindItem(weaponID10, &weapon10);

			weapon10.model = "pistol201_w";
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE );
			EquipCharacterByItem(Pchar, "pistol20");
			EquipCharacterbyItem(Pchar, "ammobag2");

			pchar.quest.wine_cellar_fight.win_condition.l1 = "locator";
			pchar.quest.wine_cellar_fight.win_condition.l1.location = "wr_wine_cellar";
			pchar.quest.wine_cellar_fight.win_condition.l1.locator_group = "goto";
			pchar.quest.wine_cellar_fight.win_condition.l1.locator = "goto1";
			pchar.quest.wine_cellar_fight.win_condition = "wine_cellar_fight";

			pchar.quest.wr_wineA_backoff1.win_condition.l1 = "locator";
			pchar.quest.wr_wineA_backoff1.win_condition.l1.location = "wr_wine_cellar";
			pchar.quest.wr_wineA_backoff1.win_condition.l1.locator_group = "reload";
			pchar.quest.wr_wineA_backoff1.win_condition.l1.locator = "reload3";
			pchar.quest.wr_wineA_backoff1.win_condition = "wr_wineA_backoff1";

			pchar.quest.wr_wineB_backoff1.win_condition.l1 = "locator";
			pchar.quest.wr_wineB_backoff1.win_condition.l1.location = "wr_wine_cellar";
			pchar.quest.wr_wineB_backoff1.win_condition.l1.locator_group = "reload";
			pchar.quest.wr_wineB_backoff1.win_condition.l1.locator = "reload4";
			pchar.quest.wr_wineB_backoff1.win_condition = "wr_wineB_backoff1";

			pchar.quest.church_wineA_backoff1.win_condition.l1 = "locator";
			pchar.quest.church_wineA_backoff1.win_condition.l1.location = "church_wine_cellar";
			pchar.quest.church_wineA_backoff1.win_condition.l1.locator_group = "reload";
			pchar.quest.church_wineA_backoff1.win_condition.l1.locator = "reload3";
			pchar.quest.church_wineA_backoff1.win_condition = "church_wineA_backoff1";

			pchar.quest.church_wineB_backoff1.win_condition.l1 = "locator";
			pchar.quest.church_wineB_backoff1.win_condition.l1.location = "church_wine_cellar";
			pchar.quest.church_wineB_backoff1.win_condition.l1.locator_group = "reload";
			pchar.quest.church_wineB_backoff1.win_condition.l1.locator = "reload4";
			pchar.quest.church_wineB_backoff1.win_condition = "church_wineB_backoff1";

			pchar.quest.church_wineC_backoff1.win_condition.l1 = "locator";
			pchar.quest.church_wineC_backoff1.win_condition.l1.location = "church_wine_cellar";
			pchar.quest.church_wineC_backoff1.win_condition.l1.locator_group = "reload";
			pchar.quest.church_wineC_backoff1.win_condition.l1.locator = "reload5";
			pchar.quest.church_wineC_backoff1.win_condition = "church_wineC_backoff1";

			pchar.quest.church_wineD_backoff1.win_condition.l1 = "locator";
			pchar.quest.church_wineD_backoff1.win_condition.l1.location = "church_wine_cellar";
			pchar.quest.church_wineD_backoff1.win_condition.l1.locator_group = "reload";
			pchar.quest.church_wineD_backoff1.win_condition.l1.locator = "reload6";
			pchar.quest.church_wineD_backoff1.win_condition = "church_wineD_backoff1";
		break;
	//......................................................................................................
		case "wr_wineA_backoff":
			pchar.quest.wr_wineA_backoff1.win_condition.l1 = "locator";
			pchar.quest.wr_wineA_backoff1.win_condition.l1.location = "wr_wine_cellar";
			pchar.quest.wr_wineA_backoff1.win_condition.l1.locator_group = "reload";
			pchar.quest.wr_wineA_backoff1.win_condition.l1.locator = "reload3";
			pchar.quest.wr_wineA_backoff1.win_condition = "wr_wineA_backoff1";
		break;

		case "wr_wineA_backoff1":
			ChangeCharacterAddressGroup(Pchar, "wr_wine_cellar", "goto", "goto5");

			LAi_QuestDelay("wr_wineA_backoff", 0.1);
		break;


		case "wr_wineB_backoff":
			pchar.quest.wr_wineB_backoff1.win_condition.l1 = "locator";
			pchar.quest.wr_wineB_backoff1.win_condition.l1.location = "wr_wine_cellar";
			pchar.quest.wr_wineB_backoff1.win_condition.l1.locator_group = "reload";
			pchar.quest.wr_wineB_backoff1.win_condition.l1.locator = "reload4";
			pchar.quest.wr_wineB_backoff1.win_condition = "wr_wineB_backoff1";
		break;

		case "wr_wineB_backoff1":
			ChangeCharacterAddressGroup(Pchar, "wr_wine_cellar", "goto", "goto7");

			LAi_QuestDelay("wr_wineB_backoff", 0.1);
		break;


		case "church_wineA_backoff":
			pchar.quest.church_wineA_backoff1.win_condition.l1 = "locator";
			pchar.quest.church_wineA_backoff1.win_condition.l1.location = "church_wine_cellar";
			pchar.quest.church_wineA_backoff1.win_condition.l1.locator_group = "reload";
			pchar.quest.church_wineA_backoff1.win_condition.l1.locator = "reload3";
			pchar.quest.church_wineA_backoff1.win_condition = "church_wineA_backoff1";
		break;

		case "church_wineA_backoff1":
			ChangeCharacterAddressGroup(Pchar, "church_wine_cellar", "goto", "goto13");

			LAi_QuestDelay("church_wineA_backoff", 0.1);
		break;


		case "church_wineB_backoff":
			pchar.quest.church_wineB_backoff1.win_condition.l1 = "locator";
			pchar.quest.church_wineB_backoff1.win_condition.l1.location = "church_wine_cellar";
			pchar.quest.church_wineB_backoff1.win_condition.l1.locator_group = "reload";
			pchar.quest.church_wineB_backoff1.win_condition.l1.locator = "reload4";
			pchar.quest.church_wineB_backoff1.win_condition = "church_wineB_backoff1";
		break;

		case "church_wineB_backoff1":
			ChangeCharacterAddressGroup(Pchar, "church_wine_cellar", "goto", "goto14");

			LAi_QuestDelay("church_wineB_backoff", 0.1);
		break;


		case "church_wineC_backoff":
			pchar.quest.church_wineC_backoff1.win_condition.l1 = "locator";
			pchar.quest.church_wineC_backoff1.win_condition.l1.location = "church_wine_cellar";
			pchar.quest.church_wineC_backoff1.win_condition.l1.locator_group = "reload";
			pchar.quest.church_wineC_backoff1.win_condition.l1.locator = "reload5";
			pchar.quest.church_wineC_backoff1.win_condition = "church_wineC_backoff1";
		break;

		case "church_wineC_backoff1":
			ChangeCharacterAddressGroup(Pchar, "church_wine_cellar", "goto", "goto15");

			LAi_QuestDelay("church_wineC_backoff", 0.1);
		break;


		case "church_wineD_backoff":
			pchar.quest.church_wineD_backoff1.win_condition.l1 = "locator";
			pchar.quest.church_wineD_backoff1.win_condition.l1.location = "church_wine_cellar";
			pchar.quest.church_wineD_backoff1.win_condition.l1.locator_group = "reload";
			pchar.quest.church_wineD_backoff1.win_condition.l1.locator = "reload6";
			pchar.quest.church_wineD_backoff1.win_condition = "church_wineD_backoff1";
		break;

		case "church_wineD_backoff1":
			ChangeCharacterAddressGroup(Pchar, "church_wine_cellar", "goto", "goto16");

			LAi_QuestDelay("church_wineD_backoff", 0.1);
		break;
	//......................................................................................................
		case "wine_cellar_fight":
			Pchar.quest.wine_cellar_enemies = "started";
			Pchar.quest.drowning_enemies = "not_yet";
			Pchar.quest.bsw_dead = "no";

			LAi_group_Register("WR_GUARDS_3");
			LAi_group_SetRelation(LAI_GROUP_PLAYER, "WR_GUARDS_3", LAI_GROUP_ENEMY);
			LAi_group_FightGroups(LAI_GROUP_PLAYER, "WR_GUARDS_3", true);

			ChangeCharacterAddressGroup(characterFromID("wr_fatj"), "wr_wine_cellar", "goto", "crew_left1");
			LAi_SetImmortal(CharacterFromID("wr_fatj"), true);
			RemoveCharacterEquip(characterFromID("wr_fatj"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_fatj"), "bladebasket");
			TakeItemFromCharacter(characterFromID("wr_fatj"), "blade4");
			GiveItem2Character(characterFromID("wr_fatj"), "blade1-2");
			EquipCharacterbyItem(characterFromID("wr_fatj"), "blade1-2");
			RemoveCharacterEquip(characterFromID("wr_fatj"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_fatj"), "pistol1");
			GiveItem2Character(characterFromID("wr_fatj"), "pistol2");
			EquipCharacterbyItem(characterFromID("wr_fatj"), "pistol2");
			LAi_SetActorType(characterFromID("wr_fatj"));
			LAi_ActorAttack(CharacterFromID("wr_fatj"), Pchar, "");					//left 1
			LAi_group_MoveCharacter(characterFromID("wr_fatj"), "WR_GUARDS_3");

			ChangeCharacterAddressGroup(characterFromID("wr_oman1"), "wr_wine_cellar", "goto", "crew_left2");
			LAi_SetImmortal(CharacterFromID("wr_oman1"), true);
			LAi_SetActorType(characterFromID("wr_oman1"));
			LAi_ActorAttack(CharacterFromID("wr_oman1"), Pchar, "");				//left 2
			LAi_group_MoveCharacter(characterFromID("wr_oman1"), "WR_GUARDS_3");

			ChangeCharacterAddressGroup(characterFromID("wr_wll3"), "wr_wine_cellar", "goto", "crew_left3");
			LAi_SetImmortal(CharacterFromID("wr_wll3"), true);
			LAi_SetActorType(characterFromID("wr_wll3"));
			LAi_ActorAttack(CharacterFromID("wr_wll3"), Pchar, "");					//left 3
			LAi_group_MoveCharacter(characterFromID("wr_wll3"), "WR_GUARDS_3");

			ChangeCharacterAddressGroup(characterFromID("wr_cor1_1"), "wr_wine_cellar", "goto", "crew_left4");
			LAi_SetImmortal(CharacterFromID("wr_cor1_1"), true);
			LAi_SetActorType(characterFromID("wr_cor1_1"));
			LAi_ActorAttack(CharacterFromID("wr_cor1_1"), Pchar, "");				//left 4
			LAi_group_MoveCharacter(characterFromID("wr_cor1_1"), "WR_GUARDS_3");

			ChangeCharacterAddressGroup(characterFromID("wr_cor1_3"), "wr_wine_cellar", "goto", "crew_right1");
			LAi_SetImmortal(CharacterFromID("wr_cor1_3"), true);
			LAi_SetActorType(characterFromID("wr_cor1_3"));
			LAi_ActorAttack(CharacterFromID("wr_cor1_3"), Pchar, "");				//right 1
			LAi_group_MoveCharacter(characterFromID("wr_cor1_3"), "WR_GUARDS_3");

			ChangeCharacterAddressGroup(characterFromID("wr_boc3"), "wr_wine_cellar", "goto", "crew_right2");
			LAi_SetImmortal(CharacterFromID("wr_boc3"), true);
			LAi_SetActorType(characterFromID("wr_boc3"));
			LAi_ActorAttack(CharacterFromID("wr_boc3"), Pchar, "");					//right 2
			LAi_group_MoveCharacter(characterFromID("wr_boc3"), "WR_GUARDS_3");

			ChangeCharacterAddressGroup(characterFromID("wr_bry1"), "wr_wine_cellar", "goto", "crew_right3");
			LAi_SetImmortal(CharacterFromID("wr_bry1"), true);
			LAi_SetActorType(characterFromID("wr_bry1"));
			LAi_ActorAttack(CharacterFromID("wr_bry1"), Pchar, "");					//right 3
			LAi_group_MoveCharacter(characterFromID("wr_bry1"), "WR_GUARDS_3");

			ChangeCharacterAddressGroup(characterFromID("wr_chv1"), "wr_wine_cellar", "goto", "crew_right4");
			LAi_SetImmortal(CharacterFromID("wr_chv1"), true);
			LAi_SetActorType(characterFromID("wr_chv1"));
			LAi_ActorAttack(CharacterFromID("wr_chv1"), Pchar, "");					//right 4
			LAi_group_MoveCharacter(characterFromID("wr_chv1"), "WR_GUARDS_3");

			LAi_QuestDelay("wr_wine_cellar_no_reinc", 0.1);
			LAi_QuestDelay("wine_cellar_remove_corpses", 0.1);
		break;

		case "wr_wine_cellar_no_reinc":
			if(pchar.location == "wr_wine_cellar")
			{
				if(LAi_IsDead(Pchar))
				{
					LAi_QuestDelay("delay_no_reinc", 3.0);
				}
				else LAi_QuestDelay("wr_wine_cellar_no_reinc", 1.0);
			}
			else return;
		break;

		case "wine_cellar_remove_corpses":
			Pchar.quest.wine_cellar_remove_corpses1.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.wine_cellar_remove_corpses1.win_condition.l1.location = "wr_wine_cellar";
			Pchar.quest.wine_cellar_remove_corpses1.win_condition = "wine_cellar_remove_corpses1";
		break;

		case "wine_cellar_remove_corpses1":
			ChangeCharacterAddressGroup(characterFromID("wr_fatj"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("wr_oman1"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("wr_wll3"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("wr_cor1_1"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("wr_cor1_3"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("wr_boc3"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("wr_bry1"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("wr_chv1"), "none", "", "");
		break;
	//......................................................................................................
		case "wr_wine_cellar_water_out":
			//from itemlogic
			DoQuestReloadToLocation("wr_wine_cellar", "goto", "goto3", "wr_wine_cellar_water_out1");
		break;

		case "wr_wine_cellar_water_out1":
			PlaySound("NATURE\water_out.wav");

			if(CheckAttribute(Pchar, "quest.drowning_enemies") && Pchar.quest.drowning_enemies == "not_yet")
			{
				LAi_QuestDelay("flood_and_drowned", 0.1);	//the right place!
			}
		break;
	//......................................................................................................
		case "wr_wine_cellar_water_in":
			//from itemlogic
			DoQuestReloadToLocation("wr_wine_cellar", "goto", "goto3", "wr_wine_cellar_water_in1");
		break;

		case "wr_wine_cellar_water_in1":
			PlaySound("NATURE\water_in.wav");

			if(CheckAttribute(Pchar, "quest.drowning_enemies") && Pchar.quest.drowning_enemies == "not_yet")
			{
				PlaySound("AMBIENT\UnHappy-002.wav");

				LAi_QuestDelay("drowning_crew", 3.0);
			}

			if(CheckAttribute(Pchar, "quest.drowning_enemies") && Pchar.quest.drowning_enemies == "done")
			{
				ChangeCharacterAddressGroup(characterFromID("wr_fatj"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("wr_oman1"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("wr_wll3"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("wr_cor1_1"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("wr_cor1_3"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("wr_boc3"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("wr_bry1"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("wr_chv1"), "none", "", "");
			}
		break;

		case "drowning_crew":
			PlaySound("PEOPLE\drowning_crew.wav");
		break;
	//......................................................................................................
		case "flood_and_drowned":
			Pchar.quest.drowning_enemies = "done";

			LAi_SetImmortal(CharacterFromID("wr_fatj"), false);
			LAi_SetImmortal(CharacterFromID("wr_oman1"), false);
			LAi_SetImmortal(CharacterFromID("wr_wll3"), false);
			LAi_SetImmortal(CharacterFromID("wr_cor1_1"), false);
			LAi_SetImmortal(CharacterFromID("wr_cor1_3"), false);
			LAi_SetImmortal(CharacterFromID("wr_boc3"), false);
			LAi_SetImmortal(CharacterFromID("wr_bry1"), false);
			LAi_SetImmortal(CharacterFromID("wr_chv1"), false);

			if(!LAi_IsDead(CharacterFromID("wr_fatj")) ) LAi_KillCharacter(CharacterFromID("wr_fatj"));
			if(!LAi_IsDead(CharacterFromID("wr_cor1_3")) ) LAi_KillCharacter(CharacterFromID("wr_cor1_3"));
			if(!LAi_IsDead(CharacterFromID("wr_oman1")) ) LAi_KillCharacter(CharacterFromID("wr_oman1"));
			if(!LAi_IsDead(CharacterFromID("wr_boc3")) ) LAi_KillCharacter(CharacterFromID("wr_boc3"));
			if(!LAi_IsDead(CharacterFromID("wr_wll3")) ) LAi_KillCharacter(CharacterFromID("wr_wll3"));
			if(!LAi_IsDead(CharacterFromID("wr_bry1")) ) LAi_KillCharacter(CharacterFromID("wr_bry1"));
			if(!LAi_IsDead(CharacterFromID("wr_cor1_1")) ) LAi_KillCharacter(CharacterFromID("wr_cor1_1"));
			if(!LAi_IsDead(CharacterFromID("wr_chv1")) ) LAi_KillCharacter(CharacterFromID("wr_chv1"));

			pchar.quest.flood_and_drowned1.win_condition.l1 = "locator";
			pchar.quest.flood_and_drowned1.win_condition.l1.location = "church_wine_cellar";
			pchar.quest.flood_and_drowned1.win_condition.l1.locator_group = "goto";
			pchar.quest.flood_and_drowned1.win_condition.l1.locator = "flood";
			pchar.quest.flood_and_drowned1.win_condition = "flood_and_drowned1";
		break;

		case "flood_and_drowned1":
			locations[FindLocation(Pchar.location)].box8.items.bladebottle_CE0 = 1;
			locations[FindLocation(Pchar.location)].box9.items.bladebottle_CE0 = 1;

			Locations[FindLocation("wr_wine_cellar")].models.always.locators = "Cellar_downstairs_locators_JRH_flood2";
			locations[FindLocation("wr_wine_cellar")].environment.sea = "true";

			locations[FindLocation("church_wine_cellar")].environment.sea = "true";
			DoQuestReloadToLocation("church_wine_cellar", "goto", "flood", "flood_and_drowned2");
		break;

		case "flood_and_drowned2":
			PlaySound("NATURE\water_in.wav");

			pchar.quest.steplock_churchcellar1.win_condition.l1 = "locator";
			pchar.quest.steplock_churchcellar1.win_condition.l1.location = "church_wine_cellar";
			pchar.quest.steplock_churchcellar1.win_condition.l1.locator_group = "goto";
			pchar.quest.steplock_churchcellar1.win_condition.l1.locator = "steplock";
			pchar.quest.steplock_churchcellar1.win_condition = "steplock_churchcellar1";//starts loop

			pchar.quest.elevator_churchcellar.win_condition.l1 = "locator";
			pchar.quest.elevator_churchcellar.win_condition.l1.location = "church_wine_cellar";
			pchar.quest.elevator_churchcellar.win_condition.l1.locator_group = "goto";
			pchar.quest.elevator_churchcellar.win_condition.l1.locator = "goto16";
			pchar.quest.elevator_churchcellar.win_condition = "elevator_churchcellar";//q-book

			pchar.quest.church_choir.win_condition.l1 = "locator";
			pchar.quest.church_choir.win_condition.l1.location = "church_wine_cellar";
			pchar.quest.church_choir.win_condition.l1.locator_group = "reload";
			pchar.quest.church_choir.win_condition.l1.locator = "reload1";
			pchar.quest.church_choir.win_condition = "church_choir";//q-book

			pchar.quest.steplock_under_elevator.win_condition.l1 = "locator";
			pchar.quest.steplock_under_elevator.win_condition.l1.location = "church_wine_cellar";
			pchar.quest.steplock_under_elevator.win_condition.l1.locator_group = "goto";
			pchar.quest.steplock_under_elevator.win_condition.l1.locator = "goto15";
			pchar.quest.steplock_under_elevator.win_condition = "steplock_under_elevator";//q-book
		break;
	//---------------------------------------------------------------------------------------------------
		case "return_from_box8_churchcellar":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "reload8");

			LAi_QuestDelay("return_from_box8_churchcellar1", 1.0);
		break;

		case "return_from_box8_churchcellar1":
			ChangeCharacterAddressGroup(Pchar, "church_wine_cellar", "goto", "reload8");
			LAi_SetPlayerType(Pchar);
		break;

		case "return_from_box9_churchcellar":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "reload10");

			LAi_QuestDelay("return_from_box9_churchcellar1", 1.0);
		break;

		case "return_from_box9_churchcellar1":
			ChangeCharacterAddressGroup(Pchar, "church_wine_cellar", "goto", "reload10");
			LAi_SetPlayerType(Pchar);
		break;
	//---------------------------------------------------------------------------------------------------
		case "steplock_churchcellar":
			pchar.quest.steplock_churchcellar1.win_condition.l1 = "locator";
			pchar.quest.steplock_churchcellar1.win_condition.l1.location = "church_wine_cellar";
			pchar.quest.steplock_churchcellar1.win_condition.l1.locator_group = "goto";
			pchar.quest.steplock_churchcellar1.win_condition.l1.locator = "steplock";
			pchar.quest.steplock_churchcellar1.win_condition = "steplock_churchcellar1";
		break;

		case "steplock_churchcellar1":
			PlaySound("INTERFACE\step_open.wav");
			Locations[FindLocation("church_wine_cellar")].reload.l1.disable = 0;
			//locations[FindLocation("church_choir")].id.label = "Port Royal Church Choir";
			Locations[FindLocation("church_choir")].reload.l4.disable = 0;

			LAi_QuestDelay("steplock_churchcellar2", 35.0);
		break;

		case "steplock_churchcellar2":
			PlaySound("INTERFACE\key_lock.wav");
			Locations[FindLocation("church_wine_cellar")].reload.l1.disable = 1;

			Locations[FindLocation("church_choir")].reload.l4.disable = 1;

			LAi_QuestDelay("steplock_churchcellar", 0.1);	//loop
		break;
	//---------------------------------------------------------------------------------------------------
		case "elevator_churchcellar":
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");
			Logit(LanguageConvertString(tmpLangFileID,"A Barrel on an Elevator - what am I supposed to do?"));
			AddQuestRecord("Wine_cellars", "2");
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "goto", "goto16", 0.5);
			Locations[FindLocation("church_wine_cellar")].locators_radius.goto.goto16 = 0.5;
		break;
	//---------------------------------------------------------------------------------------------------
		case "church_choir":
			if(CheckAttribute(Locations[FindLocation("church_wine_cellar")],"reload.l1.disable") && Locations[FindLocation("church_wine_cellar")].reload.l1.disable == 1)
			{
				PlaySound("VOICE\ENGLISH\blaze_mhm.wav");
				Logit(LanguageConvertString(tmpLangFileID,"Guess this is the way out from here."));
				AddQuestRecord("Wine_cellars", "4");
			}
		break;
	//......................................................................................................
		case "church_wine_cellar_water_out":
			//from itemlogic
			DoQuestReloadToLocation("church_wine_cellar", "goto", "lever", "church_wine_cellar_water_out1");
		break;

		case "church_wine_cellar_water_out1":
			PlaySound("NATURE\water_out.wav");

			if(Locations[FindLocation(Pchar.location)].models.always.locators == "cwc_dry_final")
			{
				LAi_QuestDelay("church_wine_cellar_water_out2", 3.0);

				if(CheckAttribute(Pchar, "quest.bsw_dead") && Pchar.quest.bsw_dead == "yes")
				{
					ChangeCharacterAddressGroup(characterFromID("wr_boc5"), "none", "", "");
				}
				else
				{
					pchar.quest.boatswain_anchor_attack.win_condition.l1 = "locator";
					pchar.quest.boatswain_anchor_attack.win_condition.l1.location = "church_wine_cellar";
					pchar.quest.boatswain_anchor_attack.win_condition.l1.locator_group = "goto";
					pchar.quest.boatswain_anchor_attack.win_condition.l1.locator = "boatswain";
					pchar.quest.boatswain_anchor_attack.win_condition = "boatswain_anchor_attack";
				}
			}
		break;

		case "steplock_under_elevator":
			PlaySound("VOICE\ENGLISH\blaze_hah.wav");
			Logit(LanguageConvertString(tmpLangFileID,"Aha, there's a Steplock under the Elevator!"));
			AddQuestRecord("Wine_cellars", "3");
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "goto", "goto15", 0.5);
			Locations[FindLocation("church_wine_cellar")].locators_radius.goto.goto15 = 0.5;
		break;

		case "church_wine_cellar_water_out2":
			PlaySound("INTERFACE\step_path.wav");

			if(CheckAttribute(Pchar, "quest.bsw_dead") && Pchar.quest.bsw_dead == "no")
			{
				//bsw in here
				ChangeCharacterAddressGroup(characterFromID("wr_boc5"), "church_wine_cellar", "reload", "reload1");
				LAi_SetStayType(characterFromID("wr_boc5"));
				LAi_SetImmortal(characterFromID("wr_boc5"), false);
				RemoveCharacterEquip(characterFromID("wr_boc5"), BLADE_ITEM_TYPE);
				TakeItemFromCharacter(characterFromID("wr_boc5"), "blade4");
				GiveItem2Character(characterFromID("wr_boc5"), "bladeanchor");
				EquipCharacterbyItem(characterFromID("wr_boc5"), "bladeanchor");

				locations[FindLocation("church_choir")].id.label = "Port Royal Church Choir";
			}

			LAi_QuestDelay("church_wine_cellar_water_out3", 1.0);
			LAi_QuestDelay("church_wine_cellar_water_out3", 2.0);
			LAi_QuestDelay("church_wine_cellar_water_out3", 2.5);
			LAi_QuestDelay("church_wine_cellar_water_out4", 4.0);
		break;

		case "church_wine_cellar_water_out3":
			PlaySound("INTERFACE\rusty.wav");
		break;

		case "church_wine_cellar_water_out4":
			AddQuestRecord("Wine_cellars", "5");
			Logit(LanguageConvertString(tmpLangFileID,"By the sound three gates opened."));
			PlaySound("VOICE\ENGLISH\blaze_lets_go.wav");
		break;
	//......................................................................................................
		case "church_wine_cellar_water_in":
			//from itemlogic
			DoQuestReloadToLocation("church_wine_cellar", "goto", "lever", "church_wine_cellar_water_in1");
		break;

		case "church_wine_cellar_water_in1":
			PlaySound("NATURE\water_in.wav");

			if(Locations[FindLocation(Pchar.location)].models.always.locators == "cwc_flood_final")
			{
				if(CheckAttribute(Pchar, "quest.bsw_dead") && Pchar.quest.bsw_dead == "yes")
				{
					ChangeCharacterAddressGroup(characterFromID("wr_boc5"), "none", "", "");
				}

				LAi_QuestDelay("church_wine_cellar_water_in2", 3.0);
			}
		break;

		case "church_wine_cellar_water_in2":
			PlaySound("INTERFACE\step_path.wav");

			LAi_QuestDelay("church_wine_cellar_water_in3", 1.0);
			LAi_QuestDelay("church_wine_cellar_water_in3", 1.5);
			LAi_QuestDelay("church_wine_cellar_water_in3", 3.0);
		break;

		case "church_wine_cellar_water_in3":
			PlaySound("INTERFACE\klonk.wav");
		break;
	//......................................................................................................
		case "switch_weather_wine_cellars":
			Locations[FindLocation("wr_wine_cellar")].image = "";
			locations[FindLocation("wr_wine_cellar")].id.label = "";

			pchar.quest.switch_weather_wine_cellars1.win_condition.l1 = "locator";
			pchar.quest.switch_weather_wine_cellars1.win_condition.l1.location = "wr_wine_cellar";
			pchar.quest.switch_weather_wine_cellars1.win_condition.l1.locator_group = "reload";
			pchar.quest.switch_weather_wine_cellars1.win_condition.l1.locator = "reload2";
			pchar.quest.switch_weather_wine_cellars1.win_condition = "switch_weather_wine_cellars1";
		break;

		case "switch_weather_wine_cellars1":
			Locations[FindLocation("wr_wine_cellar")].image = "wr_wine_cellar.tga";
			locations[FindLocation("wr_wine_cellar")].id.label = "Roger's wine cellar";

			if(locations[FindLocation("church_wine_cellar")].environment.sea == "true")
			{
				//SetNextWeather("Flooded Mine");
			}
			else //SetNextWeather("Medium Foggy Mine");

			pchar.quest.switch_weather_wine_cellars2.win_condition.l1 = "location";
			pchar.quest.switch_weather_wine_cellars2.win_condition.l1.location = "church_wine_cellar";
			pchar.quest.switch_weather_wine_cellars2.win_condition = "switch_weather_wine_cellars2";
		break;

		case "switch_weather_wine_cellars2":
			Locations[FindLocation("church_wine_cellar")].image = "";
			locations[FindLocation("church_wine_cellar")].id.label = "";

			pchar.quest.switch_weather_wine_cellars3.win_condition.l1 = "locator";
			pchar.quest.switch_weather_wine_cellars3.win_condition.l1.location = "church_wine_cellar";
			pchar.quest.switch_weather_wine_cellars3.win_condition.l1.locator_group = "reload";
			pchar.quest.switch_weather_wine_cellars3.win_condition.l1.locator = "reload2_back";
			pchar.quest.switch_weather_wine_cellars3.win_condition = "switch_weather_wine_cellars3";
		break;

		case "switch_weather_wine_cellars3":
			//SetNextWeather("Medium Foggy Mine");
			Locations[FindLocation("church_wine_cellar")].image = "church_wine_cellar.tga";
			locations[FindLocation("church_wine_cellar")].id.label = "Church wine cellar";

			pchar.quest.switch_weather_wine_cellars.win_condition.l1 = "location";
			pchar.quest.switch_weather_wine_cellars.win_condition.l1.location = "wr_wine_cellar";
			pchar.quest.switch_weather_wine_cellars.win_condition = "switch_weather_wine_cellars";	//loop restarts
		break;
	//......................................................................................................
		case "church_wine_cellar_rope_wall":
			//from itemlogic
			DoQuestReloadToLocation("church_wine_cellar", "goto", "hub", "church_wine_cellar_rope_wall1");
		break;

		case "church_wine_cellar_rope_wall1":
			PlaySound("PEOPLE\creak.wav");
		break;
	//......................................................................................................
		case "church_wine_cellar_rope_free":
			//from itemlogic
			DoQuestReloadToLocation("church_wine_cellar", "goto", "goto15", "church_wine_cellar_rope_free1");
		break;

		case "church_wine_cellar_rope_free1":
			PlaySound("PEOPLE\creak.wav");
		break;
	//......................................................................................................
		case "empty_church_barrel":
			if(CheckAttribute(Pchar, "quest.church_barrel") && Pchar.quest.church_barrel == "empty")
			{
				PlaySound("INTERFACE\rum_barrel_drip.wav");
			}
			else
			{
				PlaySound("INTERFACE\running_water.wav");
				PlaySound("INTERFACE\running_water.wav");
				Pchar.quest.church_barrel = "empty";
			}
		break;
	//......................................................................................................
		case "push_church_barrel_off_elevator":
			DoQuestReloadToLocation("church_wine_cellar", "goto", "goto20", "push_church_barrel_off_elevator1");
		break;

		case "push_church_barrel_off_elevator1":
			PlaySound("INTERFACE\barrel_roll.wav");
			Pchar.quest.church_barrel = "floor";
		break;
	//......................................................................................................
		case "push_church_barrel_on_elevator":
			DoQuestReloadToLocation("church_wine_cellar", "goto", "goto16", "push_church_barrel_on_elevator1");
		break;

		case "push_church_barrel_on_elevator1":
			PlaySound("INTERFACE\barrel_roll.wav");
			Pchar.quest.church_barrel = "empty";
		break;
	//......................................................................................................
		case "push_church_barrel_under_elevator":
			DoQuestReloadToLocation("church_wine_cellar", "goto", "goto15", "push_church_barrel_under_elevator1");
		break;

		case "push_church_barrel_under_elevator1":
			PlaySound("INTERFACE\barrel_roll.wav");
			Pchar.quest.church_barrel = "final";
		break;
	//......................................................................................................
		case "boatswain_anchor_attack":
			PlaySound("VOICE\ENGLISH\Spa_m_a_054.wav");
			LAi_SetActorType(characterFromID("wr_boc5"));
			LAi_ActorAttack(CharacterFromID("wr_boc5"), Pchar, "");

			if(CheckCharacterItem(Pchar,"bladeboom"))
			{
				PlaySound("OBJECTS\DUEL\boom.wav");
				EquipCharacterByItem(Pchar, "bladeboom");
			}
			else
			{
				if(CheckCharacterItem(Pchar,"blade1-2"))
				{
					PlaySound("OBJECTS\DUEL\sword_sh.wav");
					EquipCharacterByItem(Pchar, "blade1-2");
				}
				else
				{
					if(CheckCharacterItem(Pchar,"bladeplank"))
					{
						PlaySound("OBJECTS\DUEL\plank.wav");
						EquipCharacterByItem(Pchar, "bladeplank");
					}
					else
					{
						if(CheckCharacterItem(Pchar,"bladepclub203"))
						{
							PlaySound("OBJECTS\DUEL\pistol_out1original.wav");
							EquipCharacterByItem(Pchar, "bladepclub203");
						}
					}
				}
			}

			EquipCharacterByItem(Pchar, "pistol20");

			LAi_QuestDelay("boatswain_bladeanchor", 0.1);
			LAi_QuestDelay("church_wine_cellar_no_reinc", 0.1);
			LAi_QuestDelay("looting_boatswain", 0.1);

			pchar.quest.entre_church_choir.win_condition.l1 = "location";
			pchar.quest.entre_church_choir.win_condition.l1.location = "church_choir";
			pchar.quest.entre_church_choir.win_condition = "entre_church_choir";
		break;

		case "church_wine_cellar_no_reinc":
			if(pchar.location == "church_wine_cellar")
			{
				if(LAi_IsDead(Pchar))
				{
					LAi_QuestDelay("delay_no_reinc", 3.0);
				}
				else LAi_QuestDelay("church_wine_cellar_no_reinc", 1.0);
			}
			else return;
		break;

		case "looting_boatswain":
			if (pchar.location == "church_wine_cellar")
			{
				if(CheckCharacterItem(Pchar,"bladeanchor"))
				{
					RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
					TakeItemFromCharacter(Pchar, "bladeboom");
				TakeItemFromCharacter(Pchar, "bladeplank");
					EquipCharacterbyItem(Pchar, "bladeanchor");

					Pchar.quest.bsw_dead = "yes";
				}
				else LAi_QuestDelay("looting_boatswain", 0.5);
			}
		break;
	//......................................................................................................
		case "boatswain_bladeanchor":
			if(!IsEquipCharacterByItem(CharacterFromID("wr_boc5"), "bladeanchor"))
			{
				//just to be sure he's got the anchor
				if(!CheckCharacterItem(CharacterFromID("wr_boc5"),"bladeanchor"))
				{
					GiveItem2Character(CharacterFromID("wr_boc5"), "bladeanchor");
				}

				RemoveCharacterEquip(CharacterFromID("wr_boc5"), BLADE_ITEM_TYPE);
				EquipCharacterbyItem(CharacterFromID("wr_boc5"), "bladeanchor");
			}

			if(LAi_IsDead(CharacterFromID("wr_boc5")))
			{
					RemoveCharacterEquip(CharacterFromID("wr_boc5"), BLADE_ITEM_TYPE);
					TakeNItems(CharacterFromID("wr_boc5"),"bladeanchor", -2);
					GiveItem2Character(CharacterFromID("wr_boc5"), "bladeanchor");
					return;
			}
			else
			{
				LAi_QuestDelay("boatswain_bladeanchor", 0.5);
			}
		break;

		case "entre_church_choir":
			CloseQuestHeader("Wine_cellars");

			if(!CheckCharacterItem(Pchar,"bladeanchor"))
			{
				Logit(LanguageConvertString(tmpLangFileID,"Now, how did THAT happened??"));
				PlaySound("VOICE\ENGLISH\blaze_huh.wav");

				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "bladeboom");
				GiveItem2Character(Pchar, "bladeanchor");
				EquipCharacterbyItem(Pchar, "bladeanchor");
			}

			if(LAi_IsDead(CharacterFromID("wr_boc5")))
			{
				ChangeCharacterAddressGroup(characterFromID("wr_boc5"), "none", "", "");
			}

			Pchar.quest.bsw_dead = "yes";
			Pchar.quest.choir_lockpick = "not_found";
			Pchar.quest.choir_clock = "neutral";
			Pchar.quest.choir_ladder = "not_found";

			ChangeCharacterAddressGroup(CharacterFromID("Father Bernard"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("fake_father_Bernard"), "Redmond_church", "goto", "goto11");
			LAi_SetPriestType(CharacterFromID("fake_father_Bernard"));

			locations[FindLocation("church_wine_cellar")].id.label = "Church wine cellar";
			locations[FindLocation("church_choir")].id.label = "Port Royal Church Choir";
			Locations[FindLocation("church_choir")].reload.l4.disable = 1;			//to wine cellar

			Locations[FindLocation("Redmond_church")].reload.l1.disable = 1;		//to town
			Locations[FindLocation("Redmond_church")].reload.l3.disable = 1;		//to crypt
			Locations[FindLocation("Redmond_church")].models.always.locators = "Church_l_JRH";
			locations[FindLocation("wr_crypt")].id.label = "Port Royal catacombs";
			Locations[FindLocation("wr_crypt")].models.always.locators = "d01_l_JRH2";	//mummies

			Locations[FindLocation("wr_animists")].models.always.locators = "scave_l_JRH_ON5";
			Pchar.quest.mandala_position = "5";
			Locations[FindLocation("wr_animists")].filespath.textures = "locations\inside\ANIMISTS_Cave\mandala5";

			Locations[FindLocation("wr_animists")].reload.l1.disable = 0;		//to crypt open????
			locations[FindLocation("wr_crypt")].id.label = "Port Royal catacombs";
			Locations[FindLocation("wr_animists")].reload.l2.disable = 1;		//to animists_stairs

			locations[FindLocation("wr_animists_stairs")].id.label = "Temple stairs";
			locations[FindLocation("wr_chapel_stairs")].id.label = "Chapel stairs";
			locations[FindLocation("wr_sacristy")].id.label = "Sacristy";

			ChangeCharacterAddressGroup(CharacterFromID("prisoner_Silehard"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("prisoner_Laurence_Wellman"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("prisoner_Sarah_Fitter"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("prisoner_Defoe_incognito"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("prisoner_wr_bri"), "none", "", "");

			ChangeCharacterAddressGroup(CharacterFromID("fake_Silehard"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("fake_Laurence_Wellman"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("fake_Sarah_Fitter"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_bri"), "none", "", "");

			Locations[FindLocation("wr_animists_stairs")].reload.l2.disable = 0;		//to chapel
			Locations[FindLocation("wr_chapel")].reload.l2.disable = 0;			//to animists_stairs

			pchar.quest.bernard_music.win_condition.l1 = "locator";
			pchar.quest.bernard_music.win_condition.l1.location = "Redmond_church";
			pchar.quest.bernard_music.win_condition.l1.locator_group = "goto";
			pchar.quest.bernard_music.win_condition.l1.locator = "goto13";
			pchar.quest.bernard_music.win_condition = "bernard_music";

			Pchar.quest.remove_bsw.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.remove_bsw.win_condition.l1.location = "church_wine_cellar";
			Pchar.quest.remove_bsw.win_condition = "remove_bsw";
		break;
	//................................................................................................
		case "church_running_wine":
			if(CheckAttribute(Pchar,"quest.church_wine") && Pchar.quest.church_wine == "off")
			{
				return;
			}
			else
			{
				PlaySound("INTERFACE\running_water_short.wav");

				LAi_QuestDelay("church_running_wine", 1.1);
			}
		break;

		case "church_its_wine":
			PlaySound("VOICE\ENGLISH\blaze_hah.wav");

			Logit(LanguageConvertString(tmpLangFileID,"It's wine!"));
		break;
	//................................................................................................
		case "church_fill_winebottle":
			PlaySound("AMBIENT\TAVERN\tinkle1.wav");

			LAi_QuestDelay("church_fill_winebottle1", 3.0);
		break;

		case "church_fill_winebottle1":
			Pchar.quest.churchcellar_fillbottle = "off";
			PlaySound("AMBIENT\TAVERN\open_bottle.wav");
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladebottle_CE0");
			GiveItem2Character(Pchar,"bladebottle_CR2");
			EquipCharacterByItem(Pchar, "bladebottle_CR2");

			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("church_fill_winebottle2", 5.0);
		break;

		case "church_fill_winebottle2":
			Logit(LanguageConvertString(tmpLangFileID,"I put away the Wine now - Maybe I'll need it further on."));
			PlaySound("INTERFACE\button2.wav");

			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladebottle_CR2");
			GiveItem2Character(Pchar,"potionwine2");

			if(CheckCharacterItem(Pchar,"bladebottle_CE0"))
			{
				EquipCharacterByItem(Pchar, "bladebottle_CE0");
			}
			else EquipCharacterByItem(Pchar, "bladeX4");
		break;
//-----------------------------------------------------------------------------------------------------------
	//[14] from here,

//------------------------------------------------------------------------------------------------------------
		case "remove_bsw":
			if(CheckAttribute(Pchar, "quest.bsw_dead") && Pchar.quest.bsw_dead == "yes")
			{
				ChangeCharacterAddressGroup(characterFromID("wr_boc5"), "none", "", "");
			}
		break;
//------------------------------------------------------------------------------------------------------------
		case "bernard_music":
			LAi_SetActorType(CharacterFromID("fake_father_Bernard"));
			LAi_ActorDialog(characterFromID("fake_father_Bernard"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("fake_father_Bernard"));
			Characters[GetCharacterIndex("fake_father_Bernard")].dialog.CurrentNode  = "music";
		break;

		case "choir_search_violin":
			//from prisoner_bernard dialog
			AddQuestRecord("Charles_Vanes_quest", "9");
			DeleteQuestHeader("Wine_cellars");

			LAi_SetStayType(CharacterFromID("fake_father_Bernard"));
			Locations[FindLocation("church_choir")].models.always.locators = "Bank_locators_JRH2";//enable both violin sofas

			LAi_QuestDelay("choir_lockpick_check", 0.1);
		break;

		case "choir_lockpick_check":
			if(CheckCharacterItem(Pchar,"lockpick_JRH"))
			{
				TakeItemFromCharacter(Pchar, "lockpick_JRH");
				GiveItem2Character(Pchar, "bladelockpick");
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterbyItem(Pchar, "bladelockpick");

				locations[FindLocation(Pchar.location)].box1.items.many_red_animists = 1;
				locations[FindLocation(Pchar.location)].box1.items.bladechurchsilver = 1;
				locations[FindLocation(Pchar.location)].box2.items.bladekeygrand = 1;
				locations[FindLocation(Pchar.location)].box2.items.fake_chalice = 1;
				locations[FindLocation(Pchar.location)].box2.items.fake_censer = 1;
				locations[FindLocation(Pchar.location)].box2.items.jewelcross = 1;
				locations[FindLocation(Pchar.location)].box2.items.fake_reliquary = 1;
				locations[FindLocation(Pchar.location)].box2.items.fake_candelabre = 1;
				locations[FindLocation(Pchar.location)].box3.items.bladeoilbottle = 1;
				locations[FindLocation(Pchar.location)].box3.items.mdchest_rope = 1;
				locations[FindLocation(Pchar.location)].box4.items.bladehandle = 1;
				locations[FindLocation(Pchar.location)].box5.items.bladeladder = 1;
				locations[FindLocation(Pchar.location)].box10.items.PiratesDagger = 1;
			}
			else LAi_QuestDelay("choir_lockpick_check", 0.5);
		break;
	//......................................................................................................
		
		case "choir_box2A_off":
			Pchar.quest.choir_box2A = "off";
		break;

		case "choir_box2B_off":
			Pchar.quest.choir_box2B = "off";
		break;

		case "choir_box2C_off":
			Pchar.quest.choir_box2C = "off";
		break;

		case "choir_box2D_off":
			Pchar.quest.choir_box2D = "off";
		break;

		case "choir_box2E_off":
			Pchar.quest.choir_box2E = "off";
		break;

		case "choir_box2F_off":
			Pchar.quest.choir_box2F = "off";
		break;

		case "stay_at_choir_box2":
			//from itemlogic church_choir box2
			
			if(!LAi_IsFightMode(Pchar))
			{
				ChangeCharacterAddressGroup(Pchar, "church_choir", "goto", "free2");
				LAi_LocationFightDisable(&Locations[FindLocation("church_choir")], true);
			}
			else LAi_QuestDelay("stay_at_choir_box2", 1.0);//loops until not fightmode
		break;

		case "place_ladder_choir_box2":
			Locations[FindLocation("church_choir")].models.always.locators = "Bank_locators_JRH5";//ladder

			Locations[FindLocation("church_choir")].image = "";
			DoQuestReloadToLocation("church_choir", "goto", "free2", "place_ladder_choir_box2_1");
		break;

		case "place_ladder_choir_box2_1":
			Locations[FindLocation("church_choir")].image = "church_choir.tga";

			Pchar.quest.choir_ladder = "placed";
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladeladder");
			EquipCharacterbyItem(Pchar, "bladeX4");

			PlaySound("PEOPLE\wood1.wav");
			LAi_SetFightMode(pchar, false);
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("choir_knife_check", 0.1);
		break;

		case "oilbottle_choir_box2":
			ChangeCharacterAddressGroup(Pchar, "church_choir", "goto", "free2");

			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			EquipCharacterbyItem(Pchar, "bladeX4");

			LAi_SetFightMode(pchar, false);
			LAi_SetPlayerType(Pchar);
			Pchar.quest.choir_ladder = "blocking";

			LAi_QuestDelay("skip_oilbottle", 1.0);
		break;

		case "skip_oilbottle":
			PlaySound("AMBIENT\TAVERN\tinkle4.wav");
			TakeItemFromCharacter(Pchar, "bladeoilbottle");
		break;

		case "remove_ladder_choir_box2":
			Locations[FindLocation("church_choir")].models.always.locators = "Bank_locators_JRH4_PD";//without ladder

			Locations[FindLocation("church_choir")].image = "";
			DoQuestReloadToLocation("church_choir", "goto", "free2", "remove_ladder_choir_box2_1");
		break;

		case "remove_ladder_choir_box2_1":
			Locations[FindLocation("church_choir")].image = "church_choir.tga";

			LAi_QuestDelay("remove_ladder_choir_box2_2", 1.0);
		break;

		case "remove_ladder_choir_box2_2":
			LAi_SetFightMode(pchar, false);

			LAi_QuestDelay("remove_ladder_choir_box2_3", 1.0);
		break;

		case "remove_ladder_choir_box2_3":
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladeladder");
			EquipCharacterbyItem(Pchar, "bladeX4");
			PlaySound("PEOPLE\wood2.wav");

			LAi_SetPlayerType(Pchar);
			Pchar.quest.choir_ladder = "open_chest";

			LAi_QuestDelay("choir_clockkey_check", 0.1);
		break;
	//......................................................................................................
		
		case "choir_box3_off":
			Pchar.quest.choir_box3 = "off";
		break;

		case "stay_at_choir_box3":
			//from itemlogic church_choir box3
			if(!LAi_IsFightMode(Pchar))
			{
				ChangeCharacterAddressGroup(Pchar, "church_choir", "goto", "free3");
				LAi_LocationFightDisable(&Locations[FindLocation("church_choir")], true);
			}
			else LAi_QuestDelay("stay_at_choir_box3", 1.0);//loops until not fightmode
		break;

		case "knifeuse_choir_box3":
			Pchar.quest.choir_box3 = "open";

			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "PiratesDagger");
			EquipCharacterbyItem(Pchar, "bladeX4");

			LAi_QuestDelay("exit_choir_box3", 0.1);
			LAi_QuestDelay("choir_oil_check", 0.1);
		break;

		case "exit_choir_box3":
			Locations[FindLocation("church_choir")].models.always.locators = "Bank_locators_JRH5_PD";

			Locations[FindLocation("church_choir")].image = "";
			DoQuestReloadToLocation("church_choir", "goto", "free3", "exit_choir_box3_1");
		break;

		case "exit_choir_box3_1":
			Locations[FindLocation("church_choir")].image = "church_choir.tga";

			LAi_SetFightMode(pchar, false);
			LAi_SetPlayerType(Pchar);
		break;
	//......................................................................................................
		
		case "choir_box4_off":
			Pchar.quest.choir_box4 = "off";
		break;

		case "stay_at_choir_box4":
			//from itemlogic church_choir box4
			if(!LAi_IsFightMode(Pchar))
			{
				ChangeCharacterAddressGroup(Pchar, "church_choir", "goto", "free4");
				LAi_LocationFightDisable(&Locations[FindLocation("church_choir")], true);
			}
			else LAi_QuestDelay("stay_at_choir_box4", 1.0);//loops until not fightmode
		break;

		case "lockpick_choir_box4":
			Pchar.quest.choir_box4 = "open";
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladelockpick");
			GiveItem2Character(Pchar, "bladeX4");
			EquipCharacterbyItem(Pchar, "bladeX4");

			LAi_QuestDelay("exit_choir_box4", 0.1);
			LAi_QuestDelay("choir_handle_check", 0.1);
		break;

		case "exit_choir_box4":
			Locations[FindLocation("church_choir")].models.always.locators = "Bank_locators_JRH3_LP";//lockpick in chest

			Locations[FindLocation("church_choir")].image = "";
			DoQuestReloadToLocation("church_choir", "goto", "free4", "exit_choir_box4_1");
		break;

		case "exit_choir_box4_1":
			Locations[FindLocation("church_choir")].image = "church_choir.tga";

			LAi_SetFightMode(pchar, false);
			LAi_SetPlayerType(Pchar);
		break;
	//......................................................................................................
		
		case "choir_box5_off":
			Pchar.quest.choir_box5 = "off";
		break;

		case "stay_at_choir_box5":
			//from itemlogic church_choir box5
			if(!LAi_IsFightMode(Pchar))
			{
				ChangeCharacterAddressGroup(Pchar, "church_choir", "goto", "free5");
				LAi_LocationFightDisable(&Locations[FindLocation("church_choir")], true);
			}
			else LAi_QuestDelay("stay_at_choir_box5", 1.0);//loops until not fightmode
		break;

		case "handle_choir_box5":
			Pchar.quest.choir_box5 = "open";
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladehandle");
			EquipCharacterbyItem(Pchar, "bladeX4");

			LAi_QuestDelay("exit_choir_box5", 0.1);
			LAi_QuestDelay("choir_ladder_check", 1.0);		//was 0.1, 1.0 delay fixes freeze stop
		break;

		case "exit_choir_box5":
			Locations[FindLocation("church_choir")].models.always.locators = "Bank_locators_JRH4";

			Locations[FindLocation("church_choir")].image = "";
			DoQuestReloadToLocation("church_choir", "goto", "free5", "exit_choir_box5_1");
		break;

		case "exit_choir_box5_1":
			Locations[FindLocation("church_choir")].image = "church_choir.tga";

			LAi_SetFightMode(pchar, false);
			LAi_SetPlayerType(Pchar);
		break;

	//......................................................................................................

		case "choir_box17_off":
			Pchar.quest.choir_box17 = "off";
		break;

		case "place_choir_clockkey":
			Pchar.quest.choir_clock = "key_placed";
			Locations[FindLocation("church_choir")].models.always.locators = "Bank_locators_JRH6";//visible clockkey

			Locations[FindLocation("church_choir")].image = "";
			DoQuestReloadToLocation("church_choir", "goto", "stuck6", "place_choir_clockkey1");
		break;

		case "place_choir_clockkey1":
			Locations[FindLocation("church_choir")].image = "church_choir.tga";

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "look");
		break;
	//......................................................................................................

		case "choir_wind_up_clock":
			PlaySound("INTERFACE\clock_wind_up.wav");

			LAi_QuestDelay("choir_clock_ticking", 2.2);
		break;

		case "choir_clock_ticking":
			PlaySound("INTERFACE\clock_ticking.wav");

			LAi_QuestDelay("choir_clock_down", 3.5);
			LAi_QuestDelay("choir_clock_striking", 5.5);
		break;
	//......................................................................................................
		case "choir_clock_striking":
			PlaySound("INTERFACE\clock_striking.wav");

			LAi_QuestDelay("choir_clock_striking1", 1.0);
		break;

		case "choir_clock_striking1":
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("choir_clock_striking2", 4.0);
		break;

		case "choir_clock_striking2":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "center");

			LAi_QuestDelay("choir_clock_striking3", 1.0);
		break;

		case "choir_clock_striking3":
			LAi_SetPlayerType(Pchar);
			Pchar.quest.choir_box1 = "open";

			LAi_QuestDelay("choir_clock_striking4", 0.5);
		break;

		case "choir_clock_striking4":
			PlaySound("OBJECTS\DUEL\man_attack6.wav");
		break;
	//......................................................................................................
		case "reset_choir_boxes":
			LAi_SetFightMode(pchar, false);
			LAi_SetPlayerType(Pchar);
		break;
	//......................................................................................................
		case "choir_ladder_up":
			PlaySound("AMBIENT\CHURCH\bench1.wav");
			ChangeCharacterAddressGroup(Pchar, "church_choir", "goto", "ladder2");

			LAi_QuestDelay("choir_ladder_up1", 1.0);
		break;

		case "choir_ladder_up1":
			PlaySound("AMBIENT\CHURCH\bench1.wav");
			ChangeCharacterAddressGroup(Pchar, "church_choir", "goto", "ladder3");
		break;
	//......................................................................................................

		case "choir_box10_off":
			Pchar.quest.choir_box10 = "off";
		break;

		case "choir_ladder_down":
			PlaySound("AMBIENT\CHURCH\bench1.wav");
			ChangeCharacterAddressGroup(Pchar, "church_choir", "goto", "ladder2");

			LAi_QuestDelay("choir_ladder_down1", 1.0);
		break;

		case "choir_ladder_down1":
			PlaySound("PEOPLE\step_stairway.wav");
			ChangeCharacterAddressGroup(Pchar, "church_choir", "goto", "ladder1");

			LAi_QuestDelay("choir_ladder_down2", 1.0);
		break;

		case "choir_ladder_down2":
			PlaySound("PEOPLE\step_echo.wav");
			ChangeCharacterAddressGroup(Pchar, "church_choir", "goto", "free2");
		break;
	//......................................................................................................

		case "choir_box6_off":
			Pchar.quest.choir_box6 = "off";
		break;

		case "choir_clock_up":
			PlaySound("PEOPLE\step_stairway.wav");
			ChangeCharacterAddressGroup(Pchar, "church_choir", "goto", "stuck6");

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "look");

			LAi_QuestDelay("choir_clock_up1", 0.5);
		break;

		case "choir_clock_up1":
			if(CheckAttribute(Pchar, "quest.choir_clock") && Pchar.quest.choir_clock == "clock_started")
			{
				PlaySound("INTERFACE\clock_ticking.wav");

				LAi_QuestDelay("choir_clock_down", 3.5);
			}

			LAi_SetPlayerType(Pchar);
		break;

		case "choir_clock_down":
			LAi_SetPlayerType(Pchar);
			PlaySound("PEOPLE\step_echo.wav");
			ChangeCharacterAddressGroup(Pchar, "church_choir", "goto", "free6");
		break;
	//......................................................................................................
		
		case "choir_box12_off":
			Pchar.quest.choir_box12 = "off";
		break;

		case "choir_box14_off":
			Pchar.quest.choir_box14 = "off";
		break;

		case "choir_violin_right_up":
			PlaySound("PEOPLE\step_stairway.wav");
			ChangeCharacterAddressGroup(Pchar, "church_choir", "goto", "sofa_right");
		break;

		case "choir_box13_off":
			Pchar.quest.choir_box13 = "off";
		break;

		case "choir_violin_right_down":
			PlaySound("PEOPLE\step_echo.wav");
			ChangeCharacterAddressGroup(Pchar, "church_choir", "goto", "free14");
		break;
	//......................................................................................................

		case "choir_box15_off":
			Pchar.quest.choir_box15 = "off";
		break;

		case "choir_violin_left_up":
			PlaySound("PEOPLE\step_stairway.wav");
			ChangeCharacterAddressGroup(Pchar, "church_choir", "goto", "sofa_left");
		break;

		case "choir_box16_off":
			Pchar.quest.choir_box16 = "off";
		break;

		case "choir_violin_left_down":
			PlaySound("PEOPLE\step_echo.wav");
			ChangeCharacterAddressGroup(Pchar, "church_choir", "goto", "free15");
		break;
	//......................................................................................................
		case "choir_lockpick":
			PlaySound("PEOPLE\beltkey_drop.wav");

			LAi_QuestDelay("choir_lockpick1", 1.6);
		break;

		case "choir_lockpick1":
			PlaySound("VOICe\ENGLISH\blaze_what_was_that.wav");

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box9");

			LAi_QuestDelay("choir_lockpick2", 1.6);
		break;

		case "choir_lockpick2":
			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("church_choir")].models.always.locators = "Bank_locators_JRH3";//visible lockpick tools

			Locations[FindLocation("church_choir")].image = "";
			DoQuestReloadToLocation("church_choir", "goto", "lockpick", "choir_lockpick3");
		break;

		case "choir_lockpick3":
			Locations[FindLocation("church_choir")].image = "church_choir.tga";

			PlaySound("PEOPLE\step_echo.wav");
			Pchar.quest.choir_lockpick = "found";

		break;
	//......................................................................................................
//story continues...
		case "choir_handle_check":
			if(CheckCharacterItem(Pchar,"bladehandle"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterbyItem(Pchar, "bladehandle");
			}
			else LAi_QuestDelay("choir_handle_check", 0.5);
		break;

		case "choir_ladder_check":
			if(CheckCharacterItem(Pchar,"bladeladder"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterbyItem(Pchar, "bladeladder");
				Pchar.quest.choir_ladder = "found";
			}
			else LAi_QuestDelay("choir_ladder_check", 0.5);
		break;

		case "choir_knife_check":
			if(CheckCharacterItem(Pchar,"PiratesDagger"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterbyItem(Pchar, "PiratesDagger");
			}
			else LAi_QuestDelay("choir_knife_check", 0.5);
		break;

		case "choir_oil_check":
			if(CheckCharacterItem(Pchar,"bladeoilbottle"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterbyItem(Pchar, "bladeoilbottle");
				Pchar.quest.choir_ladder = "oilbottle";
			}
			else LAi_QuestDelay("choir_oil_check", 0.5);
		break;

		case "choir_clockkey_check":
			if(CheckCharacterItem(Pchar,"bladekeygrand"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterbyItem(Pchar, "bladekeygrand");
			}
			else LAi_QuestDelay("choir_clockkey_check", 0.5);
		break;

		case "choir_churchsilver_check":
			//Log_SetStringToLog("churchsilver check");
			if(CheckCharacterItem(Pchar,"fake_chalice") || CheckCharacterItem(Pchar,"fake_censer")
			   || CheckCharacterItem(Pchar,"jewelcross") || CheckCharacterItem(Pchar,"fake_reliquary")
			   || CheckCharacterItem(Pchar,"fake_candelabre"))
			{
				if(CheckCharacterItem(Pchar,"bladechurchsilver"))
				{
					if(!IsEquipCharacterByItem(Pchar, "bladechurchsilver"))
					{
						RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
						EquipCharacterbyItem(Pchar, "bladechurchsilver");
						PlaySound("PEOPLE\clothes1.wav");
					}
					TakeItemFromCharacter(Pchar, "bladepclub203"); TakeItemFromCharacter(Pchar, "bladeanchor");
					GiveItem2Character(Pchar, "fake_pclub"); GiveItem2Character(Pchar, "fake_anchor");
				}
				else
				{
					TakeItemFromCharacter(Pchar, "fake_chalice"); TakeItemFromCharacter(Pchar, "fake_censer");
					TakeItemFromCharacter(Pchar, "jewelcross"); TakeItemFromCharacter(Pchar, "fake_reliquary");
					TakeItemFromCharacter(Pchar, "fake_candelabre");

					locations[FindLocation(Pchar.location)].box2.items.fake_candelabre = 1;
					locations[FindLocation(Pchar.location)].box2.items.fake_chalice = 1;
					locations[FindLocation(Pchar.location)].box2.items.fake_censer = 1;
					locations[FindLocation(Pchar.location)].box2.items.jewelcross = 1;
					locations[FindLocation(Pchar.location)].box2.items.fake_reliquary = 1;
					Logit(LanguageConvertString(tmpLangFileID,"I need something to put up all these things in!"));

					PlaySound("OBJECTS\DUEL\sword_fallen.wav");

					LAi_QuestDelay("choir_churchsilver_check1", 2.0);
				}
			}
		break;

		case "choir_churchsilver_check1":
			PlaySound("VOICE\ENGLISH\blaze_hah.wav");
		break;

		case "choir_many_animists_check":
			//Log_SetStringToLog("many animists check");
			if(CheckCharacterItem(Pchar,"many_red_animists"))
			{
				if(CheckCharacterItem(Pchar,"mdchest_rope"))
				{
					AddQuestRecord("Charles_Vanes_quest", "6");
					SetModel(PChar, "PriestRedM_cloth", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);
					PlaySound("OBJECTS\DUEL\man_attack1.wav");

					TakeItemFromCharacter(Pchar, "mdchest_rope");
					TakeItemFromCharacter(Pchar, "many_red_animists");
					GiveItem2Character(Pchar, "pack_of_red_cloth");

					LAi_QuestDelay("choir_many_animists_check1", 1.5);
				}
				else
				{
					TakeItemFromCharacter(Pchar, "many_red_animists");
					locations[FindLocation(Pchar.location)].box1.items.many_red_animists = 1;
					Logit(LanguageConvertString(tmpLangFileID,"I need something to make ONE pack of all these clothes!"));
					PlaySound("VOICE\ENGLISH\blaze_hah.wav");
				}
			}
		break;

		case "choir_many_animists_check1":
			TakeItemFromCharacter(Pchar, "bladeX4");

			pchar.quest.buy_clothes.win_condition.l1 = "locator";
			pchar.quest.buy_clothes.win_condition.l1.location = "Redmond_church";
			pchar.quest.buy_clothes.win_condition.l1.locator_group = "goto";
			pchar.quest.buy_clothes.win_condition.l1.locator = "goto13";
			pchar.quest.buy_clothes.win_condition = "buy_clothes";
		break;

		case "buy_clothes":
			LAi_SetActorType(CharacterFromID("fake_father_Bernard"));
			LAi_ActorDialog(characterFromID("fake_father_Bernard"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("fake_father_Bernard"));
			Characters[GetCharacterIndex("fake_father_Bernard")].dialog.CurrentNode  = "crypt";
		break;

		case "ready_for_crypt":
			//story may continue
			//from prisoner Bernard dialog

			Characters[GetCharacterIndex("fake_father_Bernard")].dialog.CurrentNode  = "first time";
			LAi_SetStayType(CharacterFromID("fake_father_Bernard"));

			PlaySound("VOICE\ENGLISH\Eng_m_a_073.wav");
			locations[FindLocation("Redmond_church")].reload.l3.disable = 0;	//to crypt: 1 treasure item needed for this to happen, robes don't matter

			LAi_QuestDelay("ready_for_crypt_1", 2.5);

			Pchar.quest.fake_Bernard_out1.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.fake_Bernard_out1.win_condition.l1.location = "Redmond_church";
			Pchar.quest.fake_Bernard_out1.win_condition = "fake_Bernard_out1";
		break;

		case "fake_Bernard_out1":
			ChangeCharacterAddressGroup(CharacterFromID("prisoner_Defoe"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("fake_father_Bernard"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("Father Bernard"), "Redmond_church", "goto", "goto11");
			LAi_SetPriestType(CharacterFromID("Father Bernard"));
			LAi_group_MoveCharacter(CharacterFromID("Father Bernard"), "ENGLAND_CITIZENS");

			pchar.quest.mummy_attack1.win_condition.l1 = "locator";
			pchar.quest.mummy_attack1.win_condition.l1.location = "wr_crypt";
			pchar.quest.mummy_attack1.win_condition.l1.locator_group = "goto";
			pchar.quest.mummy_attack1.win_condition.l1.locator = "goto11";
			pchar.quest.mummy_attack1.win_condition = "mummy_attack1";

			pchar.quest.mummy_attack2.win_condition.l1 = "locator";
			pchar.quest.mummy_attack2.win_condition.l1.location = "wr_crypt";
			pchar.quest.mummy_attack2.win_condition.l1.locator_group = "goto";
			pchar.quest.mummy_attack2.win_condition.l1.locator = "goto14";
			pchar.quest.mummy_attack2.win_condition = "mummy_attack2";

			pchar.quest.mummy_attack3.win_condition.l1 = "locator";
			pchar.quest.mummy_attack3.win_condition.l1.location = "wr_crypt";
			pchar.quest.mummy_attack3.win_condition.l1.locator_group = "goto";
			pchar.quest.mummy_attack3.win_condition.l1.locator = "goto15";
			pchar.quest.mummy_attack3.win_condition = "mummy_attack3";

			pchar.quest.mummy_attack4.win_condition.l1 = "locator";
			pchar.quest.mummy_attack4.win_condition.l1.location = "wr_crypt";
			pchar.quest.mummy_attack4.win_condition.l1.locator_group = "goto";
			pchar.quest.mummy_attack4.win_condition.l1.locator = "goto19";
			pchar.quest.mummy_attack4.win_condition = "mummy_attack4";

			pchar.quest.mummy_attack5.win_condition.l1 = "locator";
			pchar.quest.mummy_attack5.win_condition.l1.location = "wr_crypt";
			pchar.quest.mummy_attack5.win_condition.l1.locator_group = "goto";
			pchar.quest.mummy_attack5.win_condition.l1.locator = "goto8";
			pchar.quest.mummy_attack5.win_condition = "mummy_attack5";

			pchar.quest.mummy_attack6.win_condition.l1 = "locator";
			pchar.quest.mummy_attack6.win_condition.l1.location = "wr_crypt";
			pchar.quest.mummy_attack6.win_condition.l1.locator_group = "goto";
			pchar.quest.mummy_attack6.win_condition.l1.locator = "goto17";
			pchar.quest.mummy_attack6.win_condition = "mummy_attack6";

			pchar.quest.mummy_attack7.win_condition.l1 = "locator";
			pchar.quest.mummy_attack7.win_condition.l1.location = "wr_crypt";
			pchar.quest.mummy_attack7.win_condition.l1.locator_group = "goto";
			pchar.quest.mummy_attack7.win_condition.l1.locator = "goto18";
			pchar.quest.mummy_attack7.win_condition = "mummy_attack7";
		break;

		case "ready_for_crypt_1":
			PlaySound("VOICE\ENGLISH\Blaze_sigh.wav");

			SetCurrentTime(8.00, 0);
			SetNextWeather("Morning");

			LAi_QuestDelay("ready_for_last_Vane1", 0.1);
		break;
	//...................................................................................................
		case "mummy_attack1":
			LAi_SetActorType(characterFromID("wr_mummy6"));
			LAi_ActorAttack(CharacterFromID("wr_mummy6"), Pchar, "");
			LAi_SetActorType(characterFromID("wr_mummy8"));
			LAi_ActorAttack(CharacterFromID("wr_mummy8"), Pchar, "");
		break;

		case "mummy_attack2":
			LAi_SetActorType(characterFromID("wr_mummy7"));
			LAi_ActorAttack(CharacterFromID("wr_mummy7"), Pchar, "");
		break;

		case "mummy_attack3":
			LAi_SetActorType(characterFromID("wr_mummy1"));
			LAi_ActorAttack(CharacterFromID("wr_mummy1"), Pchar, "");
		break;

		case "mummy_attack4":
			LAi_SetActorType(characterFromID("wr_mummy5"));
			LAi_ActorAttack(CharacterFromID("wr_mummy5"), Pchar, "");
			LAi_SetActorType(characterFromID("wr_mummy9"));
			LAi_ActorAttack(CharacterFromID("wr_mummy9"), Pchar, "");
		break;

		case "mummy_attack5":
			LAi_SetActorType(characterFromID("wr_mummy4"));
			LAi_ActorAttack(CharacterFromID("wr_mummy4"), Pchar, "");
		break;

		case "mummy_attack6":
			LAi_SetActorType(characterFromID("wr_mummy2"));
			LAi_ActorAttack(CharacterFromID("wr_mummy2"), Pchar, "");
		break;

		case "mummy_attack7":
			LAi_SetActorType(characterFromID("wr_mummy3"));
			LAi_ActorAttack(CharacterFromID("wr_mummy3"), Pchar, "");

			pchar.quest.escape_mummies.win_condition.l1 = "location";
			pchar.quest.escape_mummies.win_condition.l1.location = "wr_animists";
			pchar.quest.escape_mummies.win_condition = "escape_mummies";
		break;

		case "escape_mummies":
			PlaySound("INTERFACE\closed_locked_door.wav");
			Locations[FindLocation("wr_animists")].reload.l1.disable = 1;
		break;
	//...................................................................................................
		case "not_ready_for_crypt_yet":
			//Log_SetStringToLog("not ready yet");
			PlaySound("INTERFACE\coins8.wav");
			gold = GetCharacterMoney(Pchar);
			AddMoneyToCharacter(Pchar,-gold);

			pchar.quest.not_ready_for_crypt_yet1.win_condition.l1 = "locator";
			pchar.quest.not_ready_for_crypt_yet1.win_condition.l1.location = "church_choir";
			pchar.quest.not_ready_for_crypt_yet1.win_condition.l1.locator_group = "goto";
			pchar.quest.not_ready_for_crypt_yet1.win_condition.l1.locator = "free2";
			pchar.quest.not_ready_for_crypt_yet1.win_condition = "not_ready_for_crypt_yet1";
		break;

		case "not_ready_for_crypt_yet1":
			//Log_SetStringToLog("not ready yet1");
			if(CheckCharacterItem(Pchar,"fake_chalice") || CheckCharacterItem(Pchar,"fake_censer")
			|| CheckCharacterItem(Pchar,"jewelcross") || CheckCharacterItem(Pchar,"fake_reliquary")
			|| CheckCharacterItem(Pchar,"fake_candelabre"))
			{
				LAi_QuestDelay("choir_churchsilver_check", 0.1);

				pchar.quest.not_ready_for_crypt_yet2.win_condition.l1 = "locator";
				pchar.quest.not_ready_for_crypt_yet2.win_condition.l1.location = "Redmond_church";
				pchar.quest.not_ready_for_crypt_yet2.win_condition.l1.locator_group = "goto";
				pchar.quest.not_ready_for_crypt_yet2.win_condition.l1.locator = "goto13";
				pchar.quest.not_ready_for_crypt_yet2.win_condition = "not_ready_for_crypt_yet2";
			}
			else
			{
				LAi_QuestDelay("not_ready_for_crypt_yet1", 0.5);
			}
		break;

		case "not_ready_for_crypt_yet2":
			//Log_SetStringToLog("not ready yet2");
			LAi_SetActorType(CharacterFromID("fake_father_Bernard"));
			LAi_ActorDialog(characterFromID("fake_father_Bernard"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("fake_father_Bernard"));
			Characters[GetCharacterIndex("fake_father_Bernard")].dialog.CurrentNode  = "crypt1";
		break;
//-----------------------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------------------
	//[15] from here
		case "ready_for_last_Vane":
			LAi_SetPlayerType(Pchar);

			DoQuestReloadToLocation("wr_chapel_stairs", "reload", "reload4", "ready_for_last_Vane1");
		break;

		case "ready_for_last_Vane1":
			//story continues
			LAi_SetPlayerType(Pchar);

			Pchar.quest.collect_coins = 0;
			Pchar.quest.collect_right_coins = 0;
			Pchar.quest.votiv_lever = "B";
			Pchar.quest.cavern_chestkey = "yes";
			Pchar.quest.pircaps_status = "drunk";		//use maybe for doctor dialog
			Pchar.quest.pircap_perks = "coins_instead";	//perks = coins? yes that makes pircaps dialogs read from 1 place when in 'coin mode'
			Pchar.quest.Rackham_candelabre = "no";
			Pchar.quest.Taylor_chalice = "no";
			Pchar.quest.Roberts_censer = "no";
			Pchar.quest.LaBouche_reliquary = "no";
			Pchar.quest.Vane_cross = "no";
			Pchar.quest.cavern_chestkey = "yes";

			int coin_hints = 0;
			Pchar.quest.coin_hints = coin_hints;

			//LogIt("coin_hints = " + Pchar.quest.coin_hints);
			//LogIt("pircap_perks = " + Pchar.quest.pircap_perks);

 			locations[FindLocation("wr_church_inside")].type = "Vane_church";			//not tavern if no pirates
			Locations[FindLocation("wr_church_inside")].reload.l8.disable = 0;		//to chapel_stairs
			Locations[FindLocation("wr_church_inside")].reload.l2.disable = 1;		//to sacristy
			Locations[FindLocation("wr_church_outside")].models.always.locators = "Pirl_l_JRH_outside_rum";
			Locations[FindLocation("wr_church_outside")].reload.l1.disable = 1;		//to blue
			Locations[FindLocation("wr_church_outside")].type = "silent_jungle";
			Locations[FindLocation("wr_church_attic_stairs")].reload.l2.disable = 0;		//to attic
			Locations[FindLocation("wr_church_attic_stairs")].reload.l2.emerge = "goto3";	//walk around attic

			Locations[FindLocation("wr_church_attic")].type = "silent_jungle";
			Locations[FindLocation("wr_church_attic")].models.always.locators = "Pirl_l_JRH_attic_rum";

			Pchar.quest.mandala_position = "1";
			Locations[FindLocation("wr_animists")].filespath.textures = "locations\inside\ANIMISTS_Cave\mandala1";

			Locations[FindLocation("wr_animists")].reload.l1.disable = 1;		//to crypt open
			Locations[FindLocation("wr_animists")].reload.l2.disable = 0;		//to animists_stairs

			locations[FindLocation("wr_animists_stairs")].id.label = "Temple stairs";
			locations[FindLocation("wr_chapel_stairs")].id.label = "Chapel stairs";
			locations[FindLocation("wr_sacristy")].id.label = "Sacristy";

			locations[FindLocation("church_wine_cellar")].id.label = "Church wine cellar";
			locations[FindLocation("church_choir")].id.label = "Port Royal Church Choir";
			Locations[FindLocation("church_choir")].reload.l4.disable = 1;			//to wine cellar

			Locations[FindLocation("Redmond_church")].reload.l1.disable = 1;		//to town
			Locations[FindLocation("Redmond_church")].reload.l2.disable = 0;		//to choir
			Locations[FindLocation("Redmond_church")].reload.l3.disable = 0;		//to crypt

			Locations[FindLocation("Redmond_church")].models.always.locators = "Church_l_JRH";
			locations[FindLocation("wr_crypt")].id.label = "Port Royal catacombs";

			ChangeCharacterAddressGroup(CharacterFromID("prisoner_Silehard"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("prisoner_Laurence_Wellman"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("prisoner_Sarah_Fitter"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("prisoner_Defoe_incognito"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("prisoner_wr_bri"), "none", "", "");

			ChangeCharacterAddressGroup(CharacterFromID("fake_Silehard"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("fake_Laurence_Wellman"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("fake_Sarah_Fitter"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_bri"), "none", "", "");

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap1"), "none", "", "");	//5 bosses
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap8"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap16"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap18"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap23"), "none", "", "");

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap12"), "none", "", "");	//4 crew
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap13"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap19"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap25"), "none", "", "");

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap6"), "none", "", "");	//6 standby for cave_shore
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap10"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap11"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap17"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap21"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap24"), "none", "", "");

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap2"), "wr_church_outside", "goto", "citizen02");	//17 outside
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap3"), "wr_church_outside", "goto", "citizen03");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap4"), "wr_church_outside", "goto", "citizen04");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap5"), "wr_church_outside", "goto", "citizen05");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap7"), "wr_church_outside", "goto", "citizen07");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap9"), "wr_church_outside", "goto", "locator4");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap14"), "wr_church_outside", "goto", "locator9");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap15"), "wr_church_outside", "goto", "locator10");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap20"), "wr_church_outside", "officers", "reload1_1");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap22"), "wr_church_outside", "officers", "reload1_3");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap26"), "wr_church_outside", "goto", "goto9");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap27"), "wr_church_outside", "goto", "goto16");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap28"), "wr_church_outside", "goto", "goto17");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap29"), "wr_church_outside", "goto", "goto12");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap30"), "wr_church_outside", "goto", "goto13");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap31"), "wr_church_outside", "goto", "goto14");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap32"), "wr_church_outside", "goto", "goto15");

			LAi_SetActorType(CharacterFromID("pir_cap2"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap2"));
			LAi_SetActorType(CharacterFromID("pir_cap3"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap3"));
			LAi_SetActorType(CharacterFromID("pir_cap4"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap4"));
			LAi_SetActorType(CharacterFromID("pir_cap5"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap5"));
		//	LAi_SetActorType(CharacterFromID("pir_cap6"));
		//	LAi_ActorSetLayMode(CharacterFromID("pir_cap6"));
			LAi_SetActorType(CharacterFromID("pir_cap7"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap7"));
			LAi_SetActorType(CharacterFromID("pir_cap9"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap9"));
		//	LAi_SetActorType(CharacterFromID("pir_cap10"));
		//	LAi_ActorSetLayMode(CharacterFromID("pir_cap10"));
		//	LAi_SetActorType(CharacterFromID("pir_cap11"));
		//	LAi_ActorSetLayMode(CharacterFromID("pir_cap11"));
			LAi_SetActorType(CharacterFromID("pir_cap14"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap14"));
			LAi_SetActorType(CharacterFromID("pir_cap15"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap15"));
		//	LAi_SetActorType(CharacterFromID("pir_cap17"));
		//	LAi_ActorSetLayMode(CharacterFromID("pir_cap17"));
			LAi_SetActorType(CharacterFromID("pir_cap20"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap20"));
		//	LAi_SetActorType(CharacterFromID("pir_cap21"));
		//	LAi_ActorSetLayMode(CharacterFromID("pir_cap21"));
			LAi_SetActorType(CharacterFromID("pir_cap22"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap22"));
		//	LAi_SetActorType(CharacterFromID("pir_cap24"));
		//	LAi_ActorSetLayMode(CharacterFromID("pir_cap24"));
			LAi_SetActorType(CharacterFromID("pir_cap26"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap26"));
			LAi_SetActorType(CharacterFromID("pir_cap27"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap27"));
			LAi_SetActorType(CharacterFromID("pir_cap28"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap28"));
			LAi_SetActorType(CharacterFromID("pir_cap29"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap29"));
			LAi_SetActorType(CharacterFromID("pir_cap30"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap30"));
			LAi_SetActorType(CharacterFromID("pir_cap31"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap31"));
			LAi_SetCitizenType(CharacterFromID("pir_cap32"));

			GiveItem2Character(CharacterFromID("pir_cap29"), "coin1");//Moody swedish silver
			GiveItem2Character(CharacterFromID("pir_cap29"), "coin2");//Moody swedish copper
			GiveItem2Character(CharacterFromID("pir_cap28"), "coin3");//Wynn spanish gold
			GiveItem2Character(CharacterFromID("pir_cap28"), "coin4");//Wynn spanish silver
			GiveItem2Character(CharacterFromID("pir_cap26"), "coin5");//Read english gold
			GiveItem2Character(CharacterFromID("pir_cap26"), "coin6");//Read english silver
			GiveItem2Character(CharacterFromID("pir_cap27"), "coin7");//Quelch chinese brass
			GiveItem2Character(CharacterFromID("pir_cap27"), "coin8");//Quelch chinese copper
			GiveItem2Character(CharacterFromID("pir_cap32"), "coin9");//Exquemelin arabic gold
			GiveItem2Character(CharacterFromID("pir_cap32"), "coin10");//Exquemelin arabic silver
			GiveItem2Character(CharacterFromID("pir_cap32"), "coin11");//Exquemelin arabic small silver
			GiveItem2Character(CharacterFromID("pir_cap31"), "coin12");//Dulaien french gold
			GiveItem2Character(CharacterFromID("pir_cap30"), "coin13");//Worley dutch gold
			GiveItem2Character(CharacterFromID("pir_cap30"), "coin14");//Worley dutch square silver
			GiveItem2Character(CharacterFromID("pir_cap30"), "coin15");//Worley dutch round silver
			GiveItem2Character(CharacterFromID("pir_cap31"), "coin16");//Dulaien portuguese gold

			pchar.quest.move_pircaps_up.win_condition.l1 = "location";
			pchar.quest.move_pircaps_up.win_condition.l1.location = "wr_church_attic";
			pchar.quest.move_pircaps_up.win_condition = "move_pircaps_up";
		break;

		case "move_pircaps_up":
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap2"), "wr_church_attic", "goto", "citizen02");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap3"), "wr_church_attic", "goto", "citizen03");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap4"), "wr_church_attic", "goto", "citizen04");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap5"), "wr_church_attic", "goto", "citizen05");
		//	ChangeCharacterAddressGroup(CharacterFromID("pir_cap6"), "wr_church_attic", "goto", "citizen06");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap7"), "wr_church_attic", "goto", "citizen07");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap9"), "wr_church_attic", "goto", "locator4");
		//	ChangeCharacterAddressGroup(CharacterFromID("pir_cap10"), "wr_church_attic", "goto", "locator5");
		//	ChangeCharacterAddressGroup(CharacterFromID("pir_cap11"), "wr_church_attic", "goto", "locator6");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap14"), "wr_church_attic", "goto", "locator9");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap15"), "wr_church_attic", "goto", "locator10");
		//	ChangeCharacterAddressGroup(CharacterFromID("pir_cap17"), "wr_church_attic", "goto", "locator12");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap20"), "wr_church_attic", "officers", "reload1_1");
		//	ChangeCharacterAddressGroup(CharacterFromID("pir_cap21"), "wr_church_attic", "officers", "reload1_2");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap22"), "wr_church_attic", "officers", "reload1_3");
		//	ChangeCharacterAddressGroup(CharacterFromID("pir_cap24"), "wr_church_attic", "goto", "locator8");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap26"), "wr_church_attic", "goto", "goto9");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap27"), "wr_church_attic", "goto", "goto16");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap28"), "wr_church_attic", "goto", "goto17");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap29"), "wr_church_attic", "goto", "goto12");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap30"), "wr_church_attic", "goto", "goto13");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap31"), "wr_church_attic", "goto", "goto14");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap32"), "wr_church_attic", "goto", "goto15");

			pchar.quest.lay_pircaps_down.win_condition.l1 = "locator";
			pchar.quest.lay_pircaps_down.win_condition.l1.location = "wr_church_attic";
			pchar.quest.lay_pircaps_down.win_condition.l1.locator_group = "goto";
			pchar.quest.lay_pircaps_down.win_condition.l1.locator = "window";
			pchar.quest.lay_pircaps_down.win_condition = "lay_pircaps_down";
		break;

		case "lay_pircaps_down":
			LAi_SetActorType(CharacterFromID("pir_cap2"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap2"));
			LAi_SetActorType(CharacterFromID("pir_cap3"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap3"));
			LAi_SetActorType(CharacterFromID("pir_cap4"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap4"));
			LAi_SetActorType(CharacterFromID("pir_cap5"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap5"));
		//	LAi_SetActorType(CharacterFromID("pir_cap6"));
		//	LAi_ActorSetLayMode(CharacterFromID("pir_cap6"));
			LAi_SetActorType(CharacterFromID("pir_cap7"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap7"));
			LAi_SetActorType(CharacterFromID("pir_cap9"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap9"));
		//	LAi_SetActorType(CharacterFromID("pir_cap10"));
		//	LAi_ActorSetLayMode(CharacterFromID("pir_cap10"));
		//	LAi_SetActorType(CharacterFromID("pir_cap11"));
		//	LAi_ActorSetLayMode(CharacterFromID("pir_cap11"));
			LAi_SetActorType(CharacterFromID("pir_cap14"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap14"));
			LAi_SetActorType(CharacterFromID("pir_cap15"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap15"));
		//	LAi_SetActorType(CharacterFromID("pir_cap17"));
		//	LAi_ActorSetLayMode(CharacterFromID("pir_cap17"));
			LAi_SetActorType(CharacterFromID("pir_cap20"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap20"));
		//	LAi_SetActorType(CharacterFromID("pir_cap21"));
		//	LAi_ActorSetLayMode(CharacterFromID("pir_cap21"));
			LAi_SetActorType(CharacterFromID("pir_cap22"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap22"));
		//	LAi_SetActorType(CharacterFromID("pir_cap24"));
		//	LAi_ActorSetLayMode(CharacterFromID("pir_cap24"));
			LAi_SetActorType(CharacterFromID("pir_cap26"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap26"));
			LAi_SetActorType(CharacterFromID("pir_cap27"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap27"));
			LAi_SetActorType(CharacterFromID("pir_cap28"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap28"));
			LAi_SetActorType(CharacterFromID("pir_cap29"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap29"));
			LAi_SetActorType(CharacterFromID("pir_cap30"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap30"));
			LAi_SetActorType(CharacterFromID("pir_cap31"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap31"));
			LAi_SetCitizenType(CharacterFromID("pir_cap32"));
		break;

		case "Vane_returns_to_attic":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "locator8");

			LAi_QuestDelay("Vane_returns_to_attic0", 1.0);
			LAi_QuestDelay("Vane_returns_to_attic1", 2.0);
		break;

		case "Vane_returns_to_attic0":
			PlaySound("PEOPLE\Run_roof.wav");
		break;

		case "Vane_returns_to_attic1":
			Locations[FindLocation("wr_church_inside")].reload.l2.disable = 0;		//to sacristy
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap1"), "wr_church_attic", "goto", "goto11");
			Locations[FindLocation("wr_church_attic_stairs")].reload.l2.emerge = "reload4";	//reset

			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "red_outfits";
		break;

		case "red_rolls_exchange":
			//from Vane dialog
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("red_rolls_exchange1", 0.5);
		break;

		case "red_rolls_exchange1":
			PlaySound("PEOPLE\recoil.wav"); PlaySound("PEOPLE\recoil.wav");
			TakeItemFromCharacter(Pchar, "pack_of_red_cloth");
			SetModel(PChar, "PriestRedM_a", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			LAi_QuestDelay("red_rolls_exchange2", 1.0);
		break;

		case "red_rolls_exchange2":
			AddQuestRecord("Charles_Vanes_quest", "7");
			CloseQuestHeader("Charles_Vanes_quest");

			PlaySound("PEOPLE\clothes1.wav");

			SetModel(characterFromID("pir_cap1"), "pir_cap1_cloth", "man", "man", 1.8, false);

			LAi_QuestDelay("red_rolls_exchange3", 1.0);
		break;

		case "red_rolls_exchange3":
			PlaySound("VOICE\ENGLISH\pir_capR3.wav");

			LAi_QuestDelay("Vane_fires_cannon", 2.0);
		break;

		case "Vane_fires_cannon":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "fire_cannon";
		break;

		case "Vane_fires_cannon2":
			//from Vane dialog
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "locator8");

			LAi_QuestDelay("Vane_fires_cannon3", 1.0);
		break;

		case "Vane_fires_cannon3":
			PlaySound("PEOPLE\Run_roof.wav");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap1"), "wr_church_attic", "reload", "reload3");

			LAi_QuestDelay("Vane_fires_cannon4", 1.0);
		break;

		case "Vane_fires_cannon4":
			PlaySound("VOICE\ENGLISH\pir_capR8.wav");

			LAi_QuestDelay("Vane_fires_cannon5", 4.0);
		break;

		case "Vane_fires_cannon5":
			LAi_SetSitType(CharacterFromID("pir_cap1"));

			LAi_QuestDelay("Vane_fires_cannon6", 0.5);
		break;

		case "Vane_fires_cannon6":
			CreateParticleSystem("gunfire_red" , 22, 6.7, -11.5, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("stars_fire" , 22, 6.7, -11.5, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("OBJECTS\duel\GI_ValidClick.wav");

			LAi_QuestDelay("Vane_fires_cannon7", 0.5);
		break;

		case "Vane_fires_cannon7":
			Pchar.quest.pircaps_status = "sober";			//for Exquemelin dialog only

			LAi_SetStayType(CharacterFromID("pir_cap1"));
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire_01.wav");
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire_01.wav");
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire_01.wav");
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire_01.wav");
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire_01.wav");
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire_01.wav");

			CreateParticleSystem("smoke_short" , 22, 6.6, -9.5, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 22, 6.6, -9.5, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 22, 6.6, -9.5, 4.5, 1.5, 0.0, sti(20) );

			CreateParticleSystem("gunfire_red" , 22, 6.6, -9.5, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire_red" , 22, 6.6, -9.5, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire_red" , 22, 6.6, -9.5, 0.0, 4.5, 0.0, sti(20) );

			CreateParticleSystem("gunfire" , 22, 6.6, -9.5, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 22, 6.6, -9.5, 0.0, 4.5, 0.0, sti(20) );

			LAi_QuestDelay("Vane_fires_cannon8", 1.0);
			LAi_QuestDelay("Vane_cannon_smoke", 5.0);
		break;

		case "Vane_cannon_smoke":
			CreateParticleSystem("smoke_short" , 22, 6.6, -9.5, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 22, 6.6, -9.5, 4.5, 1.5, 0.0, sti(20) );

			LAi_QuestDelay("Vane_cannon_smoke1", 5.0);
		break;

		case "Vane_cannon_smoke1":
			CreateParticleSystem("smoke_short" , 22, 6.6, -9.5, 4.5, 1.5, 0.0, sti(20) );
		break;

		case "Vane_fires_cannon8":
			PlaySound("OBJECTS\ABORDAGE\abordage_loosing.wav");
			LAi_LocationFightDisable(&Locations[FindLocation("wr_church_attic")], false);

			LAi_SetPlayerType(CharacterFromID("pir_cap2"));
			LAi_SetPlayerType(CharacterFromID("pir_cap3"));
			LAi_SetPlayerType(CharacterFromID("pir_cap4"));
			LAi_SetPlayerType(CharacterFromID("pir_cap5"));
			LAi_SetPlayerType(CharacterFromID("pir_cap7"));
			LAi_SetPlayerType(CharacterFromID("pir_cap9"));
			LAi_SetPlayerType(CharacterFromID("pir_cap14"));
			LAi_SetPlayerType(CharacterFromID("pir_cap15"));
			LAi_SetPlayerType(CharacterFromID("pir_cap20"));
			LAi_SetPlayerType(CharacterFromID("pir_cap22"));
			LAi_SetPlayerType(CharacterFromID("pir_cap26"));
			LAi_SetPlayerType(CharacterFromID("pir_cap27"));
			LAi_SetPlayerType(CharacterFromID("pir_cap28"));
			LAi_SetPlayerType(CharacterFromID("pir_cap29"));
			LAi_SetPlayerType(CharacterFromID("pir_cap30"));
			LAi_SetPlayerType(CharacterFromID("pir_cap31"));
			LAi_SetPlayerType(CharacterFromID("pir_cap32"));

			LAi_SetFightMode(CharacterFromID("pir_cap2"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap3"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap4"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap5"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap7"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap9"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap14"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap15"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap20"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap22"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap26"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap27"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap28"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap29"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap30"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap31"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap32"), true);

			LAi_QuestDelay("Vane_fires_cannon9", 2.0);
		break;

		case "Vane_fires_cannon9":
			LAi_SetCitizenType(CharacterFromID("pir_cap2"));
			LAi_SetCitizenType(CharacterFromID("pir_cap3"));
			LAi_SetCitizenType(CharacterFromID("pir_cap4"));
			LAi_SetCitizenType(CharacterFromID("pir_cap5"));
			LAi_SetCitizenType(CharacterFromID("pir_cap7"));
			LAi_SetCitizenType(CharacterFromID("pir_cap9"));
			LAi_SetCitizenType(CharacterFromID("pir_cap14"));
			LAi_SetCitizenType(CharacterFromID("pir_cap15"));
			LAi_SetCitizenType(CharacterFromID("pir_cap20"));
			LAi_SetCitizenType(CharacterFromID("pir_cap22"));
			LAi_SetCitizenType(CharacterFromID("pir_cap26"));
			LAi_SetCitizenType(CharacterFromID("pir_cap27"));
			LAi_SetCitizenType(CharacterFromID("pir_cap28"));
			LAi_SetCitizenType(CharacterFromID("pir_cap29"));
			LAi_SetCitizenType(CharacterFromID("pir_cap30"));
			LAi_SetCitizenType(CharacterFromID("pir_cap31"));
			LAi_SetCitizenType(CharacterFromID("pir_cap32"));

			LAi_SetPlayerType(Pchar);
			PlaySound("VOICE\ENGLISH\pir_capR3.wav");

			LAi_QuestDelay("Vane_fires_cannon10", 2.0);
		break;

		case "Vane_fires_cannon10":
			PlaySound("VOICE\ENGLISH\pir_capR4.wav");

			LAi_QuestDelay("Vane_cave_door_talk", 3.0);
		break;

		case "Vane_cave_door_talk":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "cave_door";
		break;

		case "cave_door_done":
			LAi_SetPlayerType(Pchar);
			PlaySound("PEOPLE\counter_openclose.wav");

			LAi_QuestDelay("cave_door_done1", 1.0);
		break;

		case "cave_door_done1":
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap1"), "wr_church_inside", "barmen", "stay");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap18"), "wr_church_inside", "goto", "rackham");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap23"), "wr_church_inside", "goto", "stay_s11");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap8"), "wr_church_inside", "goto", "labouche");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap16"), "wr_church_inside", "goto", "roberts");

			LAi_QuestDelay("cave_door_done2", 1.0);
		break;

		case "cave_door_done2":
			Locations[FindLocation("wr_church_attic")].type = "Vane_jungle";
			Locations[FindLocation("wr_church_outside")].type = "Vane_jungle";

			PlaySound("PEOPLE\Run_roof.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_church_attic", "reload", "reload3");

			pchar.quest.move_pircaps_down.win_condition.l1 = "location";
			pchar.quest.move_pircaps_down.win_condition.l1.location = "wr_church_outside";
			pchar.quest.move_pircaps_down.win_condition = "move_pircaps_down";
		break;

		case "move_pircaps_down":
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap2"), "wr_church_outside", "goto", "citizen02");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap3"), "wr_church_outside", "goto", "citizen03");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap4"), "wr_church_outside", "goto", "citizen04");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap5"), "wr_church_outside", "goto", "citizen05");
		//	ChangeCharacterAddressGroup(CharacterFromID("pir_cap6"), "wr_church_outside", "goto", "citizen06");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap7"), "wr_church_outside", "goto", "citizen07");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap9"), "wr_church_outside", "goto", "locator4");
		//	ChangeCharacterAddressGroup(CharacterFromID("pir_cap10"), "wr_church_outside", "goto", "locator5");
		//	ChangeCharacterAddressGroup(CharacterFromID("pir_cap11"), "wr_church_outside", "goto", "locator6");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap14"), "wr_church_outside", "goto", "locator9");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap15"), "wr_church_outside", "goto", "locator10");
		//	ChangeCharacterAddressGroup(CharacterFromID("pir_cap17"), "wr_church_outside", "goto", "locator12");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap20"), "wr_church_outside", "officers", "reload1_1");
		//	ChangeCharacterAddressGroup(CharacterFromID("pir_cap21"), "wr_church_outside", "officers", "reload1_2");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap22"), "wr_church_outside", "officers", "reload1_3");
		//	ChangeCharacterAddressGroup(CharacterFromID("pir_cap24"), "wr_church_outside", "goto", "locator8");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap26"), "wr_church_outside", "goto", "goto9");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap27"), "wr_church_outside", "goto", "goto16");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap28"), "wr_church_outside", "goto", "goto17");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap29"), "wr_church_outside", "goto", "goto12");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap30"), "wr_church_outside", "goto", "goto13");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap31"), "wr_church_outside", "goto", "goto14");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap32"), "wr_church_outside", "goto", "goto15");

			LAi_QuestDelay("move_pircaps_down2", 1.0);
		break;

		case "move_pircaps_down2":
			LAi_SetSitType(Pchar);
			PlaySound("PEOPLE\jump.wav");

			LAi_QuestDelay("move_pircaps_down3", 0.5);
		break;

		case "move_pircaps_down3":
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("move_pircaps_down4", 1.0);
		break;

		case "move_pircaps_down4":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");

			pchar.quest.move_pircaps_down5.win_condition.l1 = "location";
			pchar.quest.move_pircaps_down5.win_condition.l1.location = "wr_church_inside";
			pchar.quest.move_pircaps_down5.win_condition = "move_pircaps_down5";
		break;
	//................................................................................................
		case "move_pircaps_down5":
			LAi_SetPlayerType(Pchar);

			LAi_SetStayType(CharacterFromID("pir_cap1"));
		//	LAi_SetStayType(CharacterFromID("pir_cap8"));
			LAi_SetStayType(CharacterFromID("pir_cap16"));
			LAi_SetStayType(CharacterFromID("pir_cap18"));
			LAi_SetStayType(CharacterFromID("pir_cap23"));

			LAi_SetActorType(CharacterFromID("pir_cap8"));
			LAi_tmpl_ani_PlayAnimation(characterFromID("pir_cap8"), "afraid", 60.0);

			pchar.quest.who_took_the_coins.win_condition.l1 = "locator";
			pchar.quest.who_took_the_coins.win_condition.l1.location = "wr_church_inside";
			pchar.quest.who_took_the_coins.win_condition.l1.locator_group = "goto";
			pchar.quest.who_took_the_coins.win_condition.l1.locator = "coins";
			pchar.quest.who_took_the_coins.win_condition = "who_took_the_coins";
		break;

		case "who_took_the_coins":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "who_took_the_coins";
		break;

	//LA BUZE
		case "who_took_the_coins1":
			LAi_SetActorType(CharacterFromID("pir_cap8"));
			LAi_ActorDialog(characterFromID("pir_cap8"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap8"));
			Characters[GetCharacterIndex("pir_cap8")].dialog.CurrentNode  = "who_took_the_coins";
		break;

		case "who_took_the_coins2":
			//from La Bouche dialog
			PlaySound("PEOPLE\yawn.wav");
			LAi_SetActorType(CharacterFromID("pir_cap8"));
			LAi_ActorAfraid(CharacterFromID("pir_cap8"), CharacterFromID("pir_cap8"), false);
			LAi_SetActorType(CharacterFromID("pir_cap8"));
			LAi_ActorGoToLocator(CharacterFromID("pir_cap8"), "reload", "reload8", "who_took_the_coins3", 10.0);

			LAi_QuestDelay("who_took_the_coins4", 3.0);
		break;

		case "who_took_the_coins3":
			//move La Bouche to under chapel stair
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap8"), "wr_chapel_stairs", "goto", "sleeping");
			LAi_SetActorType(CharacterFromID("pir_cap8"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap8"));
			PlaySound("PEOPLE\counter_close.wav");

			LAi_QuestDelay("activate_LaBouche", 0.1);
		break;

	//ROBERTS
		case "who_took_the_coins4":
			//from Vane dialog
			LAi_SetActorType(CharacterFromID("pir_cap16"));
			LAi_ActorDialog(characterFromID("pir_cap16"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap16"));
			Characters[GetCharacterIndex("pir_cap16")].dialog.CurrentNode  = "who_took_the_coins";
		break;

		case "who_took_the_coins5":
			//from Roberts dialog
			LAi_SetActorType(CharacterFromID("pir_cap16"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap16"));
			PlaySound("INTERFACE\rum_barrel_empty.wav");

			LAi_QuestDelay("who_took_the_coins7", 1.0);
		break;

		case "who_took_the_coins7":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "who_took_the_coins1";
		break;

		case "who_took_the_coins8":
			//from Vane dialog
			LAi_SetActorType(CharacterFromID("pir_cap18"));
			LAi_ActorDialog(characterFromID("pir_cap18"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap18"));
			Characters[GetCharacterIndex("pir_cap18")].dialog.CurrentNode  = "who_took_the_coins";
		break;

		case "who_took_the_coins9":
			//from Rackham dialog
			PlaySound("OBJECTS\VOICES\DEAD\male\dead4.wav");
			LAi_SetPoorType(CharacterFromID("pir_cap18"));
			GetCharacterPos(CharacterFromID("pir_cap18"), &u, &v, &w);
			CreateParticleSystem("stars_short" , u, v+1, w, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("who_took_the_coins10", 1.0);
		break;

		case "who_took_the_coins10":
			PlaySound("OBJECTS\DUEL\man_attack5.wav");

			LAi_QuestDelay("who_took_the_coins11", 1.0);
		break;

		case "who_took_the_coins11":
			LAi_SetActorType(CharacterFromID("pir_cap23"));
			LAi_ActorDialog(characterFromID("pir_cap23"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap23"));
			Characters[GetCharacterIndex("pir_cap23")].dialog.CurrentNode  = "who_took_the_coins";
		break;

		case "who_took_the_coins12":
			//from Taylor dialog
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "who_took_the_coins2";
		break;

		case "who_took_the_coins13":
			//from Vane dialog
			LAi_SetActorType(CharacterFromID("pir_cap23"));
			LAi_ActorTurnToLocator(CharacterFromID("pir_cap23"), "goto", "goto8");

			LAi_QuestDelay("who_took_the_coins14", 1.0);
		break;

		case "who_took_the_coins14":
			PlaySound("OBJECTS\DUEL\man_attack2.wav");

			LAi_QuestDelay("who_took_the_coins15", 1.0);
		break;

		case "who_took_the_coins15":
			LAi_SetSitType(CharacterFromID("pir_cap23"));
			PlaySound("PEOPLE\sponge.wav");

			LAi_QuestDelay("who_took_the_coins16", 2.0);
		break;

		case "who_took_the_coins16":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead7.wav");
			LAi_SetActorType(CharacterFromID("pir_cap23"));
			LAi_ActorGoToLocator(CharacterFromID("pir_cap23"), "reload", "reload1", "who_took_the_coins17", 10.0);
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto8");

			LAi_QuestDelay("who_took_the_coins18", 3.0);
		break;

		case "who_took_the_coins17":
			//move Taylor to outside main entrance
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap23"), "wr_church_outside", "goto", "taylor");
			LAi_SetPoorType(CharacterFromID("pir_cap23"));
			PlaySound("PEOPLE\counter_close.wav");

			Locations[FindLocation("wr_church_inside")].reload.l1.emerge = "chalice";

			LAi_QuestDelay("activate_Taylor", 0.1);
		break;

		case "who_took_the_coins18":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "who_took_the_coins3";
		break;

		case "who_took_the_coins19":
			SetQuestHeader("Collection_box");
			AddQuestRecord("Collection_box", "1");
			AddQuestRecord("Collection_box", "7");
			DeleteQuestHeader("Charles_Vanes_quest");

			Pchar.quest.coin_hints = makeint(Pchar.quest.coin_hints)+1;
			//LogIt("coin_hints = " + Pchar.quest.coin_hints);

			if(CheckAttribute(Pchar,"quest.coin_hints") && Pchar.quest.coin_hints == 6)
			{
				CloseQuestHeader("Collection_box");
			}

			GiveItem2Character(Pchar, "excel_document");

			PlaySound("VOICE\ENGLISH\pir_capR2.wav");
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorGoToLocator(CharacterFromID("pir_cap1"), "reload", "reload2", "who_took_the_coins20", 4.0);

			LAi_QuestDelay("who_took_the_coins21", 0.1);
		break;

		case "who_took_the_coins20":
			//move Vane to sacristy
			Locations[FindLocation("wr_sacristy")].models.always.locators = "sh03_l_JRH1_cloth";
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap1"), "wr_sacristy", "goto", "goto3");
			SetModel(characterFromID("pir_cap1"), "pir_cap1_red", "man", "man", 1.8, false);
			PlaySound("PEOPLE\counter_close.wav");
			LAi_SetStayType(CharacterFromID("pir_cap1"));

			Pchar.quest.pircap_perks = "coins_instead";
			//LogIt("pircap_perks = " + Pchar.quest.pircap_perks);
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode = "first time";
		break;

		case "who_took_the_coins21":
			LAi_SetPlayerType(Pchar);

			SetCurrentTime(11.00, 0);
			SetNextWeather("Clear");

			LAi_QuestDelay("between_turn_around", 0.1);
			LAi_QuestDelay("move_2pircaps", 0.1);
		break;
	//................................................................................................
		case "coins_collection_check":
			int swe_coins = 0;
			int spa_coins = 0;
			int eng_coins = 0;
			int chi_coins = 0;
			int arb_coins = 0;
			int frpo_coins = 0;
			int dut_coins = 0;

			int coin_collection;

			if(CheckCharacterItem(CharacterFromID("pir_cap29"),"coin1") || CheckCharacterItem(CharacterFromID("pir_cap29"),"coin2"))
			{ } else swe_coins = 1;

			if(CheckCharacterItem(CharacterFromID("pir_cap28"),"coin3") || CheckCharacterItem(CharacterFromID("pir_cap28"),"coin4"))
			{ } else spa_coins = 1;

			if(CheckCharacterItem(CharacterFromID("pir_cap26"),"coin5") || CheckCharacterItem(CharacterFromID("pir_cap26"),"coin6"))
			{ } else eng_coins = 1;

			if(CheckCharacterItem(CharacterFromID("pir_cap27"),"coin7") || CheckCharacterItem(CharacterFromID("pir_cap27"),"coin8"))
			{ } else chi_coins = 1;

			if(CheckCharacterItem(CharacterFromID("pir_cap32"),"coin9") || CheckCharacterItem(CharacterFromID("pir_cap32"),"coin10") || CheckCharacterItem(CharacterFromID("pir_cap32"),"coin11"))
			{ } else arb_coins = 1;

			if(CheckCharacterItem(CharacterFromID("pir_cap31"),"coin12") || CheckCharacterItem(CharacterFromID("pir_cap31"),"coin16"))
			{ } else frpo_coins = 1;

			if(CheckCharacterItem(CharacterFromID("pir_cap30"),"coin13") || CheckCharacterItem(CharacterFromID("pir_cap30"),"coin14") || CheckCharacterItem(CharacterFromID("pir_cap30"),"coin15"))
			{ } else dut_coins = 1;

			coin_collection = swe_coins + spa_coins + eng_coins + chi_coins + arb_coins + frpo_coins + dut_coins;

			Pchar.quest.coin_collection = coin_collection;
			//LogIt("coin_collection = " + Pchar.quest.coin_collection);

		break;
	//................................................................................................
		case "move_2pircaps":
			Pchar.quest.move_2pircaps1.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.move_2pircaps1.win_condition.l1.location = "wr_church_inside";
			Pchar.quest.move_2pircaps1.win_condition = "move_2pircaps1";
		break;

		case "move_2pircaps1":
			if (pchar.location == "wr_church_attic_stairs")
			{
				//restarts this loop
				pchar.quest.move_2pircaps.win_condition.l1 = "location";
				pchar.quest.move_2pircaps.win_condition.l1.location = "wr_church_inside";
				pchar.quest.move_2pircaps.win_condition = "move_2pircaps";
			}
			else
			{
				ChangeCharacterAddressGroup(CharacterFromID("pir_cap16"), "wr_church_attic", "sit", "sit13");
				LAi_SetSitType(CharacterFromID("pir_cap16"));
				Locations[FindLocation("wr_church_attic_stairs")].reload.l2.emerge = "censer";
				ChangeCharacterAddressGroup(CharacterFromID("pir_cap18"), "wr_church_attic_stairs", "goto", "rackham");
				LAi_SetStayType(CharacterFromID("pir_cap18"));

				LAi_QuestDelay("activate_Roberts", 0.1);
			}
		break;
	//................................................................................................
		case "Vane_cross_check":
			if(CheckAttribute(Pchar, "quest.Vane_cross") && Pchar.quest.Vane_cross == "yes")
			{
				return;
			}
			else
			{
				if(CheckCharacterItem(CharacterFromID("pir_cap1"),"jewelcross"))
				{
					LAi_SetStayType(Pchar);
					LAi_SetStayType(CharacterFromID("pir_cap1"));	//while changing outfit
					SetModel(characterFromID("pir_cap1"), "pir_cap1_redC", "man", "man", 1.8, false);
					Pchar.quest.Vane_cross = "yes";
					PlaySound("INTERFACE\took_item.wav");
					PlaySound("VOICE\ENGLISH\pir_capR3.wav");

					LAi_QuestDelay("pchar_churchsilver_check", 1.0);
					LAi_QuestDelay("Vane_scales", 2.0);
				}
				else LAi_QuestDelay("Vane_cross_check", 0.5);
			}
		break;

		case "Vane_scales":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorGoToLocator(CharacterFromID("pir_cap1"), "box", "box1", "Vane_scales1", 3.0);
		break;

		case "Vane_scales1":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "scales";
		break;

		case "Vane_scales2":
			LAi_QuestDelay("Vane_scales3", 1.0);
		break;

		case "Vane_scales3":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorTurnToLocator(CharacterFromID("pir_cap1"), "goto", "vane_turn");

			LAi_QuestDelay("Vane_scales4", 1.0);
		break;

		case "Vane_scales4":
			PlaySound("INTERFACE\pinion_take.wav");

			LAi_QuestDelay("Vane_scales5", 1.0);
		break;

		case "Vane_scales5":
			Locations[FindLocation("wr_sacristy")].models.always.l2 = "scales1";
			Locations[FindLocation("wr_sacristy")].locators_radius.box.box1 = 0.5;

			Locations[FindLocation("wr_sacristy")].image = "";
			DoQuestReloadToLocation("wr_sacristy", "goto", "scales_look", "Vane_scales6");
		break;

		case "Vane_scales6":
			Locations[FindLocation("wr_sacristy")].image = "wr_sacristy.tga";

			LAi_SetPlayerType(Pchar);
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorGoToLocator(CharacterFromID("pir_cap1"), "goto", "goto2", "Vane_scales7", 4.0);
		break;

		case "Vane_scales7":
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap1"), "wr_sacristy", "sit", "sit1");
			LAi_SetSitType(CharacterFromID("pir_cap1"));
			PlaySound("VOICE\ENGLISH\Blaze_sigh.wav");

			pchar.quest.cave_shore_storm.win_condition.l1 = "locator";
			pchar.quest.cave_shore_storm.win_condition.l1.location = "wr_sacristy";
			pchar.quest.cave_shore_storm.win_condition.l1.locator_group = "reload";
			pchar.quest.cave_shore_storm.win_condition.l1.locator = "reload4";
			pchar.quest.cave_shore_storm.win_condition = "cave_shore_storm";
		break;
	//................................................................................................
		case "sacristy_scales_coin4":
			Logit(LanguageConvertString(tmpLangFileID,"The pieces-of-eight vary too much in weight to be of any use!"));
			PlaySound("VOICE\ENGLISH\blaze_hah.wav");

			TakeItemFromCharacter(Pchar, "coin4");
			GiveItem2Character(Pchar, "coin4_bad");
		break;

		case "sacristy_scales_other_coin":
			Logit(LanguageConvertString(tmpLangFileID,"Allright, I can weigh all the coins - and then what?"));
			PlaySound("VOICE\ENGLISH\blaze_puh.wav");
		break;
	//................................................................................................
		case "activate_Taylor":
			pchar.quest.activate_Taylor0.win_condition.l1 = "locator";
			pchar.quest.activate_Taylor0.win_condition.l1.location = "wr_church_outside";
			pchar.quest.activate_Taylor0.win_condition.l1.locator_group = "goto";
			pchar.quest.activate_Taylor0.win_condition.l1.locator = "chalice";
			pchar.quest.activate_Taylor0.win_condition = "activate_Taylor0";
		break;

		case "activate_Taylor0":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "taylor");

			LAi_QuestDelay("activate_Taylor1", 1.5);
		break;

		case "activate_Taylor1":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead7.wav");
			LAi_SetStayType(CharacterFromID("pir_cap23"));

			LAi_QuestDelay("activate_Taylor2", 1.0);
		break;

		case "activate_Taylor2":
			LAi_SetActorType(CharacterFromID("pir_cap23"));
			LAi_ActorTurnToLocator(CharacterFromID("pir_cap23"), "goto", "chalice");

			LAi_QuestDelay("activate_Taylor3", 0.5);
		break;

		case "activate_Taylor3":
			LAi_SetStayType(CharacterFromID("pir_cap23"));
			LAi_SetPlayerType(Pchar);
		break;

		case "Taylor_chalice_check":
			if(CheckAttribute(Pchar, "quest.Taylor_chalice") && Pchar.quest.Taylor_chalice == "yes")
			{
				return;
			}
			else
			{
				if(CheckCharacterItem(CharacterFromID("pir_cap23"),"fake_chalice"))
				{
					Pchar.quest.Taylor_chalice = "yes";
					TakeItemFromCharacter(CharacterFromID("pir_cap23"), "fake_chalice");
					GiveItem2Character(CharacterFromID("pir_cap23"), "bladechalice");
					RemoveCharacterEquip(CharacterFromID("pir_cap23"), BLADE_ITEM_TYPE);
					EquipCharacterbyItem(CharacterFromID("pir_cap23"), "bladechalice");
					PlaySound("OBJECTS\DUEL\chalice.wav");

					LAi_QuestDelay("pchar_churchsilver_check", 1.0);
					LAi_QuestDelay("taylor_dialog_move", 1.5);
				}
				else LAi_QuestDelay("taylor_dialog_move", 1.0);
			}
		break;

		case "taylor_dialog_move":
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap23"), "wr_church_outside", "goto", "taylor");//???

			if(CheckAttribute(Pchar, "quest.Taylor_chalice") && Pchar.quest.Taylor_chalice == "yes")
			{
				Locations[FindLocation("wr_church_inside")].reload.l1.emerge = "main_entre";
			}
			else
			{

				LAi_QuestDelay("activate_Taylor", 0.1);	//restarts loop
			}

			PlaySound("OBJECTS\VOICES\DEAD\male\dead7.wav");
			LAi_SetPoorType(CharacterFromID("pir_cap23"));

			LAi_QuestDelay("taylor_dialog_move1", 1.0);
		break;

		case "taylor_dialog_move1":
			PlaySound("PEOPLE\Run_roof.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_church_outside", "goto", "goto6");

			LAi_QuestDelay("activate_Taylor", 0.1);	//restarts loop
		break;
	//................................................................................................
		case "activate_Roberts":
			pchar.quest.activate_Roberts1.win_condition.l1 = "locator";
			pchar.quest.activate_Roberts1.win_condition.l1.location = "wr_church_attic";
			pchar.quest.activate_Roberts1.win_condition.l1.locator_group = "goto";
			pchar.quest.activate_Roberts1.win_condition.l1.locator = "censer";
			pchar.quest.activate_Roberts1.win_condition = "activate_Roberts1";
		break;

		case "activate_Roberts1":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "sit", "sit13");

			LAi_QuestDelay("activate_Roberts2", 1.0);
		break;

		case "activate_Roberts2":
			LAi_SetPlayerType(Pchar);
		break;

		case "roberts_dialog_move1":
			if(CheckCharacterItem(Pchar,"fake_censer"))
			{
				LAi_QuestDelay("roberts_dialog_move2", 0.1);
			}
			else LAi_QuestDelay("roberts_dialog_move2", 2.0);
		break;

		case "roberts_dialog_move2":
			PlaySound("PEOPLE\Run_roof.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_church_attic", "reload", "reload4");

			if(CheckAttribute(Pchar, "quest.Roberts_censer") && Pchar.quest.Roberts_censer == "yes")
			{
				Locations[FindLocation("wr_church_attic_stairs")].reload.l2.emerge = "reload4";
			}
			else LAi_QuestDelay("activate_Roberts", 0.1);
		break;

		case "Roberts_censer_check":
			if(CheckAttribute(Pchar, "quest.Roberts_censer") && Pchar.quest.Roberts_censer == "yes")
			{
				return;
			}
			else
			{
				if(CheckCharacterItem(CharacterFromID("pir_cap16"),"fake_censer"))
				{
					Pchar.quest.Roberts_censer = "yes";
					TakeItemFromCharacter(CharacterFromID("pir_cap16"), "fake_censer");
					GiveItem2Character(CharacterFromID("pir_cap16"), "bladecenser");
					RemoveCharacterEquip(CharacterFromID("pir_cap16"), BLADE_ITEM_TYPE);
					EquipCharacterbyItem(CharacterFromID("pir_cap16"), "bladecenser");
					PlaySound("OBJECTS\DUEL\censer.wav");
					PlaySound("OBJECTS\DUEL\censer.wav");
					GetCharacterPos(CharacterFromID("pir_cap16"), &u, &v, &w);
					CreateParticleSystem("gunfire" , u, v+1, w, 0.0, 0.0, 0.0, sti(20) );

					LAi_QuestDelay("pchar_churchsilver_check", 1.0);
				}
				else LAi_QuestDelay("Roberts_censer_check", 0.5);
			}
		break;
	//................................................................................................
		case "Rackham_candelabre_check":
			if(CheckAttribute(Pchar, "quest.Rackham_candelabre") && Pchar.quest.Rackham_candelabre == "yes")
			{
				return;
			}
			else
			{
				if(CheckCharacterItem(CharacterFromID("pir_cap18"),"fake_candelabre"))
				{
					Pchar.quest.Rackham_candelabre = "yes";
					TakeItemFromCharacter(CharacterFromID("pir_cap18"), "fake_candelabre");
					GiveItem2Character(CharacterFromID("pir_cap18"), "bladecandelabre");
					RemoveCharacterEquip(CharacterFromID("pir_cap18"), BLADE_ITEM_TYPE);
					EquipCharacterbyItem(CharacterFromID("pir_cap18"), "bladecandelabre");
					PlaySound("OBJECTS\DUEL\candelabre.wav");

					LAi_QuestDelay("pchar_churchsilver_check", 1.0);
				}
				else LAi_QuestDelay("Rackham_candelabre_check", 0.5);
			}
		break;
	//................................................................................................
		case "activate_LaBouche":
			pchar.quest.activate_LaBouche1.win_condition.l1 = "locator";
			pchar.quest.activate_LaBouche1.win_condition.l1.location = "wr_chapel_stairs";
			pchar.quest.activate_LaBouche1.win_condition.l1.locator_group = "goto";
			pchar.quest.activate_LaBouche1.win_condition.l1.locator = "goto3";
			pchar.quest.activate_LaBouche1.win_condition = "activate_LaBouche1";
		break;

		case "activate_LaBouche1":
			PlaySound("PEOPLE\yawn.wav");
			LAi_SetStayType(CharacterFromID("pir_cap8"));

			LAi_QuestDelay("activate_LaBouche2", 1.0);
		break;

		case "activate_LaBouche2":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "sleeping");

			LAi_QuestDelay("activate_LaBouche3", 1.0);
		break;

		case "activate_LaBouche3":
			LAi_SetPlayerType(Pchar);
		break;

		case "labouche_dialog_move":
			LAi_SetActorType(CharacterFromID("pir_cap8"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap8"));
		break;

		case "LaBouche_reliquary_check":
			if(CheckAttribute(Pchar, "quest.LaBouche_reliquary") && Pchar.quest.LaBouche_reliquary == "yes")
			{
				return;
			}
			else
			{
				if(CheckCharacterItem(CharacterFromID("pir_cap8"),"fake_reliquary"))
				{
					Pchar.quest.LaBouche_reliquary = "yes";
					TakeItemFromCharacter(CharacterFromID("pir_cap8"), "fake_reliquary");
					GiveItem2Character(CharacterFromID("pir_cap8"), "bladereliquary");
					RemoveCharacterEquip(CharacterFromID("pir_cap8"), BLADE_ITEM_TYPE);
					EquipCharacterbyItem(CharacterFromID("pir_cap8"), "bladereliquary");
					PlaySound("OBJECTS\VOICES\skeleton_body2.wav");
					GetCharacterPos(CharacterFromID("pir_cap8"), &u, &v, &w);
					CreateParticleSystem("blast_dirt_small" , u, v+1, w, 0.0, 0.0, 0.0, sti(20) );

					LAi_QuestDelay("LaBouche_reliquary_check1", 1.0);
					LAi_QuestDelay("pchar_churchsilver_check", 1.0);
				}
				else LAi_QuestDelay("LaBouche_reliquary_check", 0.5);
			}
		break;

		case "LaBouche_reliquary_check1":
			PlaySound("PEOPLE\yawn.wav");
			LAi_SetActorType(CharacterFromID("pir_cap8"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap8"));
		break;

		case "pchar_churchsilver_check":
			LAi_SetCitizenType(CharacterFromID("pir_cap1"));

			if(CheckCharacterItem(Pchar,"fake_reliquary") || CheckCharacterItem(Pchar,"fake_candelabre")
			|| CheckCharacterItem(Pchar,"fake_censer") || CheckCharacterItem(Pchar,"fake_chalice")
			|| CheckCharacterItem(Pchar,"jewelcross"))
			{
				return;
			}
			else
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "bladechurchsilver");
				TakeItemFromCharacter(Pchar, "fake_anchor");
				GiveItem2Character(Pchar, "bladeanchor");
				EquipCharacterbyItem(Pchar, "bladeanchor");
				TakeItemFromCharacter(Pchar, "fake_pclub");
				GiveItem2Character(Pchar, "bladepclub203");
			}

			LAi_QuestDelay("pchar_churchsilver_check2", 0.5);
		break;

		case "pchar_churchsilver_check2":
			int blanc = GetCharacterItem(Pchar, "bladeanchor");
			int fanc = GetCharacterItem(Pchar, "fake_anchor");
		
			if(CheckCharacterItem(Pchar,"bladeanchor"))
			{
				if(blanc > 1) 
				{
					TakeNItems(Pchar,"bladeanchor", blanc-1);
				}
				TakeNItems(Pchar,"fake_anchor", -100);
			}
			else
			{
				if(CheckCharacterItem(Pchar,"fake_anchor"))
				{
					if(fanc > 1) 
					{
						TakeNItems(Pchar,"fake_anchor", fanc-1);
					}
				}
				else GiveItem2Character(Pchar, "bladeanchor");			//just in case				
			}
		break;
	//................................................................................................
		case "votiv_ship":
			Locations[FindLocation("wr_church_inside")].image = "";
			DoQuestReloadToLocation("wr_church_inside", "goto", "pulpit", "votiv_ship1");
		break;

		case "votiv_ship1":
			Locations[FindLocation("wr_church_inside")].image = "wr_church_inside.tga";
			PlaySound("INTERFACE\key_lock.wav");

			LAi_QuestDelay("votiv_ship2", 1.0);
		break;

		case "votiv_ship2":
			PlaySound("INTERFACE\closet_open.wav");

			LAi_QuestDelay("votiv_ship3", 1.5);
		break;

		case "votiv_ship3":
			Logit(LanguageConvertString(tmpLangFileID,"A door opened - Which one?"));
			if(CheckAttribute(Pchar,"quest.cave_shore1") && Pchar.quest.cave_shore1 == "done")
			{

			}
			else
			{
					Pchar.quest.cave_shore1 = "done";
					AddQuestRecord("Cave_Shore", "1");
			}

			ChangeCharacterAddressGroup(Pchar, "wr_church_inside", "box", "box3");
			PlaySound("PEOPLE\step_echo1.wav");
			Pchar.quest.votiv_lever_function = "on_again";

			if(CheckAttribute(Pchar,"quest.church_side_door") && Pchar.quest.church_side_door == "done")
			{

			}
			else
			{
					Pchar.quest.church_side_door = "done";

					pchar.quest.church_side_door.win_condition.l1 = "locator";
					pchar.quest.church_side_door.win_condition.l1.location = "wr_church_outside";
					pchar.quest.church_side_door.win_condition.l1.locator_group = "goto";
					pchar.quest.church_side_door.win_condition.l1.locator = "side_entre";
					pchar.quest.church_side_door.win_condition = "church_side_door";
			}
		break;

		case "church_side_door":
			Logit(LanguageConvertString(tmpLangFileID,"No this was not what I expected. I have to try that lever on the Ship once more!"));
			AddQuestRecord("Cave_Shore", "2");
		break;
	//................................................................................................
		case "collection_box":
			//LogIt("collect_right_coins = " + Pchar.quest.collect_right_coins);
			//LogIt("collect_coins = " + Pchar.quest.collect_coins);

			if(CheckAttribute(Pchar, "quest.collect_right_coins") && Pchar.quest.collect_right_coins == "7")
			{
				if(CheckAttribute(Pchar, "quest.collect_coins") && Pchar.quest.collect_coins == "7")
				{
						if(Locations[FindLocation("wr_church_inside")].models.always.locators == "church_1_locators_JRH_up")
						{
							PlaySound("INTERFACE\step_lock.wav");

							Locations[FindLocation("wr_church_inside")].models.always.locators = "church_1_locators_JRH_down";
							locations[FindLocation("wr_church_inside")].models.always.l1 = "ship_down";
							locations[FindLocation("wr_church_inside")].models.always.l2 = "rope_down";

							if(CheckAttribute(Pchar, "quest.votiv_lever") && Pchar.quest.votiv_lever == "B")
							{
								locations[FindLocation("wr_church_inside")].models.always.l3 = "lever_down_B";
							}

							if(CheckAttribute(Pchar, "quest.votiv_lever") && Pchar.quest.votiv_lever == "M")
							{
								locations[FindLocation("wr_church_inside")].models.always.l3 = "lever_down_M";
							}

							if(CheckAttribute(Pchar, "quest.votiv_lever") && Pchar.quest.votiv_lever == "F")
							{
								locations[FindLocation("wr_church_inside")].models.always.l3 = "lever_down_F";
							}

							CloseQuestHeader("Collection_box");

							Pchar.quest.pircap_perks = "neutral";
							TakeItemFromCharacter(Pchar, "excel_document");

							TakeItemFromCharacter(CharacterFromID("pir_cap29"), "coin1");
							TakeItemFromCharacter(CharacterFromID("pir_cap29"), "coin2");
							TakeItemFromCharacter(CharacterFromID("pir_cap28"), "coin3");
							TakeItemFromCharacter(CharacterFromID("pir_cap28"), "coin4");
							TakeItemFromCharacter(CharacterFromID("pir_cap26"), "coin5");
							TakeItemFromCharacter(CharacterFromID("pir_cap26"), "coin6");
							TakeItemFromCharacter(CharacterFromID("pir_cap27"), "coin7");
							TakeItemFromCharacter(CharacterFromID("pir_cap27"), "coin8");
							TakeItemFromCharacter(CharacterFromID("pir_cap32"), "coin9");
							TakeItemFromCharacter(CharacterFromID("pir_cap32"), "coin10");
							TakeItemFromCharacter(CharacterFromID("pir_cap32"), "coin11");
							TakeItemFromCharacter(CharacterFromID("pir_cap31"), "coin12");
							TakeItemFromCharacter(CharacterFromID("pir_cap30"), "coin13");
							TakeItemFromCharacter(CharacterFromID("pir_cap30"), "coin14");
							TakeItemFromCharacter(CharacterFromID("pir_cap30"), "coin15");
							TakeItemFromCharacter(CharacterFromID("pir_cap31"), "coin16");

							LAi_QuestDelay("votiv_ship_moves", 0.3);

							pchar.quest.Vane_my_coins.win_condition.l1 = "location";
							pchar.quest.Vane_my_coins.win_condition.l1.location = "wr_sacristy";
							pchar.quest.Vane_my_coins.win_condition = "Vane_my_coins";
						}
				}
				else LAi_QuestDelay("votiv_ship_up_check", 0.1);
			}
			else LAi_QuestDelay("votiv_ship_up_check", 0.1);
		break;

		case "votiv_ship_up_check":
			if(Locations[FindLocation("wr_church_inside")].models.always.locators == "church_1_locators_JRH_down")
			{
				PlaySound("INTERFACE\step_lock.wav");

				Locations[FindLocation("wr_church_inside")].models.always.locators = "church_1_locators_JRH_up";
				locations[FindLocation("wr_church_inside")].models.always.l1 = "ship_up";
				locations[FindLocation("wr_church_inside")].models.always.l2 = "rope_up";
				locations[FindLocation("wr_church_inside")].models.always.l3 = "";

				LAi_QuestDelay("votiv_ship_moves", 0.3);
			}
		break;

		case "votiv_ship_moves":
			Locations[FindLocation("wr_church_inside")].image = "";
			DoQuestReloadToLocation("wr_church_inside", "goto", "coins", "votiv_ship_moves1");
		break;

		case "votiv_ship_moves1":
			PlaySound("PEOPLE\creak2.wav");
			Locations[FindLocation("wr_church_inside")].image = "wr_church_inside.tga";
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "pulpit");

			LAi_QuestDelay("votiv_ship_moves2", 1.0);
		break;

		case "votiv_ship_moves2":
			LAi_SetPlayerType(Pchar);
			if(Locations[FindLocation("wr_church_inside")].models.always.locators == "church_1_locators_JRH_down")
			{
				PlaySound("VOICE\ENGLISH\blaze_hah.wav");
			}
			else PlaySound("VOICE\ENGLISH\blaze_huh.wav");
		break;
	//................................................................................................
		case "Vane_my_coins":
			LAi_QuestDelay("Vane_my_coins1", 2.0);
		break;

		case "Vane_my_coins1":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "my_coins";
		break;

		case "Vane_no_coins":
			PlaySound("VOICE\ENGLISH\Blaze_sigh.wav");
			LAi_SetSitType(CharacterFromID("pir_cap1"));
		break;

		case "Vane_my_coins_returned":
			PlaySound("INTERFACE\coins7.wav");
			TakeItemFromCharacter(Pchar, "coin1"); TakeItemFromCharacter(Pchar, "coin5"); TakeItemFromCharacter(Pchar, "coin8");
			TakeItemFromCharacter(Pchar, "coin9"); TakeItemFromCharacter(Pchar, "coin11"); TakeItemFromCharacter(Pchar, "coin13");
			TakeItemFromCharacter(Pchar, "coin14"); TakeItemFromCharacter(Pchar, "coin16"); TakeItemFromCharacter(Pchar, "coin4");
			TakeItemFromCharacter(Pchar, "coin4_bad");

			LAi_QuestDelay("Vane_my_coins_returned1", 2.0);
		break;

		case "Vane_my_coins_returned1":
			PlaySound("VOICE\ENGLISH\pir_capR3.wav");
			LAi_SetSitType(CharacterFromID("pir_cap1"));
		break;
	//................................................................................................
		case "coin_too_large":
			Logit(LanguageConvertString(tmpLangFileID,"The Moidor is too large!"));
		break;

		case "coin_too_small":
			Logit(LanguageConvertString(tmpLangFileID,"This coin fell through the box to the floor!"));
			LAi_SetSitType(Pchar);

			LAi_QuestDelay("coin_too_small1", 1.0);
		break;

		case "coin_too_small1":
			LAi_SetPlayerType(Pchar);
			PlaySound("INTERFACE\took_item.wav");
			GiveItem2Character(Pchar, "coin11");
		break;
	//................................................................................................
		case "cave_shore_storm":
			SetCurrentTime(12.00, 0);
			SetNextWeather("Heavy Storm");
			Pchar.quest.JRH_rain = "Heavy Storm";
		break;
//-----------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------
		case "between_turn_around":
			pchar.quest.between_turn_around1.win_condition.l1 = "locator";
			pchar.quest.between_turn_around1.win_condition.l1.location = "wr_church_outside";
			pchar.quest.between_turn_around1.win_condition.l1.locator_group = "reload";
			pchar.quest.between_turn_around1.win_condition.l1.locator = "reload7";
			pchar.quest.between_turn_around1.win_condition = "between_turn_around1";
		break;

		case "between_turn_around1":
			DeleteQuestHeader("Collection_box");
			Locations[FindLocation("wr_cave_shore")].models.always.locators = "shore04_l_JRH0";

		//just to be sure:
			SetCharacterShipLocation(characterFromID("pir_cap1"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap2"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap3"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap4"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap5"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap6"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap7"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap8"), "wr_cave_shore");

			SetCharacterShipLocation(characterFromID("pir_cap9"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap10"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap11"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap12"), "wr_cave_shore");

			SetCharacterShipLocation(characterFromID("pir_cap13"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap14"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap15"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap16"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap17"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap18"), "wr_cave_shore");

			SetCharacterShipLocation(characterFromID("pir_cap19"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap20"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap21"), "wr_cave_shore");

			SetCharacterShipLocation(characterFromID("pir_cap22"), "Redmond_shore_02");
			SetCharacterShipLocation(characterFromID("pir_cap23"), "wr_cave_shore");	//ladder

			SetCharacterShipLocation(characterFromID("pir_cap24"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap25"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap29"), "wr_cave_shore");

			SetCharacterShipLocation(characterFromID("CoastBrother1"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother2"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother3"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother4"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother5"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother6"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother7"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother8"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother9"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother10"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother11"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother12"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother13"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother14"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother15"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother16"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother17"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother19"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother22"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother23"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother24"), "wr_cannon_tower");
			SetCharacterShipLocation(characterFromID("CoastBrother29"), "Redmond_shore_ship");//PrisonShip
			SetCharacterShipLocation(characterFromID("CoastBrother30"), "Redmond_shore_ship");//PrisonShip
			SetCharacterShipLocation(characterFromID("CoastBrother32"), "Redmond_shore_ship");//tartane2
			SetCharacterShipLocation(characterFromID("CoastBrother33"), "Redmond_shore_03");//tartane2
			SetCharacterShipLocation(characterFromID("CoastBrother25"), "wr_port");		//prize ship galleon
			SetCharacterShipLocation(characterFromID("CoastBrother26"), "wr_port");		//prize ship corvette
			SetCharacterShipLocation(characterFromID("CoastBrother27"), "wr_port");		//boat2
			SetCharacterShipLocation(characterFromID("wr_aub"), "wr_ships");		//boat2

			LAi_QuestDelay("between_turn_around2", 1.0);		//effect
			LAi_QuestDelay("shore_turn_around", 0.1);		//starts next
		break;

		case "between_turn_around2":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto8");

			LAi_QuestDelay("between_turn_around3", 1.0);
		break;

		case "between_turn_around3":
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("wood_tower", 0.1);
		break;
	//.......................................................................................................
		case "shore_turn_around":
			pchar.quest.shore_turn_around1.win_condition.l1 = "locator";
			pchar.quest.shore_turn_around1.win_condition.l1.location = "wr_cave_shore";
			pchar.quest.shore_turn_around1.win_condition.l1.locator_group = "goto";		//was a 'reload'
			pchar.quest.shore_turn_around1.win_condition.l1.locator = "reload4";
			pchar.quest.shore_turn_around1.win_condition = "shore_turn_around1";
		break;

		case "shore_turn_around1":
			LAi_QuestDelay("shore_turn_around2", 0.001);		//effect
			LAi_QuestDelay("shore_back_turn_around", 0.1);		//starts next
		break;

		case "shore_turn_around2":
			PlaySound("INTERFACE\shelf_close.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload3");

			LAi_QuestDelay("shore_turn_around3", 1.0);
		break;

		case "shore_turn_around3":
			LAi_QuestDelay("shore_turn_around4", 1.0);
		break;

		case "shore_turn_around4":
			LAi_ActorTurnToLocator(Pchar, "reload", "locator3");

			LAi_QuestDelay("shore_turn_around5", 1.0);
		break;

		case "shore_turn_around5":
			LAi_SetPlayerType(Pchar);

			pchar.quest.fallen_tree.win_condition.l1 = "locator";
			pchar.quest.fallen_tree.win_condition.l1.location = "wr_cave_shore";
			pchar.quest.fallen_tree.win_condition.l1.locator_group = "goto";
			pchar.quest.fallen_tree.win_condition.l1.locator = "arrive";
			pchar.quest.fallen_tree.win_condition = "fallen_tree";
		break;
	//.......................................................................................................
		case "shore_back_turn_around":
			pchar.quest.shore_back_turn_around1.win_condition.l1 = "locator";
			pchar.quest.shore_back_turn_around1.win_condition.l1.location = "wr_cave_shore";
			pchar.quest.shore_back_turn_around1.win_condition.l1.locator_group = "reload";
			pchar.quest.shore_back_turn_around1.win_condition.l1.locator = "reload3";
			pchar.quest.shore_back_turn_around1.win_condition = "shore_back_turn_around1";
		break;

		case "shore_back_turn_around1":
			LAi_QuestDelay("shore_back_turn_around2", 0.001);		//effect
			LAi_QuestDelay("between_turn_around", 0.1);		//starts next
		break;

		case "shore_back_turn_around2":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "ships_other", "ship_9");

			LAi_QuestDelay("shore_back_turn_around3", 1.0);
		break;

		case "shore_back_turn_around3":
			LAi_SetPlayerType(Pchar);
		break;
	//.......................................................................................................
	//[16] from here ...
		case "ready_for_wood_tower":
			LAi_SetPlayerType(Pchar);

			DoQuestReloadToLocation("wr_cave_shore", "goto", "arrive", "wood_tower");//was reload locator3
		break;

		case "fallen_tree":
			LAi_SetStayType(Pchar);
			PauseAllSounds();
			PlaySound("PEOPLE\roof_creak.wav");
			PlaySound("PEOPLE\roof_creak.wav");

			LAi_QuestDelay("fallen_tree1", 1.0);
			LAi_QuestDelay("fallen_tree2", 2.0);
		break;

		case "fallen_tree1":
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");
		break;

		case "fallen_tree2":
			Locations[FindLocation("wr_cave_shore")].models.always.locators = "shore04_l_JRH1";	//with tree
			Locations[FindLocation("wr_cave_shore")].image = "";

			DoQuestReloadToLocation("wr_cave_shore", "goto", "arrive", "fallen_tree3");
		break;

		case "fallen_tree3":
			LAi_SetActorType(Pchar);
			LAi_ActorSetLayMode(Pchar);

			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("blast_dirt" , u, v+1, w, 0.0, 0.0, 0.0, sti(20) );

			PlaySound("PEOPLE\derrick_fall.wav");
			PlaySound("PEOPLE\roof_broken1.wav");
			PlaySound("PEOPLE\wood3.wav");
			PlaySound("PEOPLE\wood3.wav");

			Php = LAi_GetCharacterHP(Pchar);
			Php2 = Php/2;
			LAi_ApplyCharacterDamage(Pchar, Php2);

			Locations[FindLocation("wr_cave_shore")].image = "wr_cave_shore.tga";

			LAi_QuestDelay("fallen_tree4", 4.0);
		break;

		case "fallen_tree4":
			LAi_SetPoorType(Pchar);
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("stars_short" , u, v+1, w, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("OBJECTS\VOICES\DEAD\male\dead7.wav");

			LAi_QuestDelay("fallen_tree5", 4.0);
		break;

		case "fallen_tree5":
			LAi_SetActorType(Pchar);

			LAi_QuestDelay("fallen_tree6", 2.0);
		break;

		case "fallen_tree6":
			LAi_ActorTurnToLocator(Pchar, "reload", "locator3");

			LAi_QuestDelay("fallen_tree7", 1.0);
		break;

		case "fallen_tree7":
			LAi_SetPlayerType(Pchar);
		break;

		case "wood_tower":
			Pchar.quest.wet_gp = "yes";
			Pchar.quest.swivelgun = "not_charged";
			Pchar.quest.flagchest = "locked";
			Pchar.quest.cave_shore_boat = "ground";
			Pchar.quest.cave_shore_pirates = "citizens";
			Pchar.quest.wood_tower_view_direction = "front";
			Pchar.quest.wood_tower_route = "way_up";
			Pchar.quest.Vane_ships = "near_shore";

			Pchar.quest.Cocklyn = "in_cannon_tower";
			Pchar.quest.Spriggs = "in_wood_tower";
			Pchar.quest.Bunce = "in_boat";
			Pchar.quest.Gow = "on_ship";
			Pchar.quest.Winter = "on_ship";
			Pchar.quest.Lowther = "on_ship";

			Locations[FindLocation("wr_cave_shore")].reload.l2.disable = 1;			//cannon tower
			locations[FindLocation("wr_cave_shore")].reload.l111.disable = 1;		//to cavern
			Locations[FindLocation("wr_cannon_tower")].models.always.locators = "imayak_l_JRH2";//one musket missing
			Locations[FindLocation("wr_cannon_tower")].models.always.l3 = "barrel3";	//gp barrel
			Locations[FindLocation("wr_cannon_tower")].locators_radius.box.box1 = 0.7;	//gp barrel
			Locations[FindLocation("wr_cavern")].models.always.locators = "cavern_l_JRH_no_chest";
			locations[FindLocation("wr_Cavern")].reload.l2.disable = 0;			//to cave shore

			RemoveCharacterEquip(CharacterFromID("pir_cap6"), BLADE_ITEM_TYPE);
			GiveItem2Character(CharacterFromID("pir_cap6"), "bladeX4");
			EquipCharacterbyItem(CharacterFromID("pir_cap6"), "bladeX4");

			RemoveCharacterEquip(CharacterFromID("pir_cap10"), BLADE_ITEM_TYPE);
			GiveItem2Character(CharacterFromID("pir_cap10"), "bladeX4");
			EquipCharacterbyItem(CharacterFromID("pir_cap10"), "bladeX4");

			RemoveCharacterEquip(CharacterFromID("pir_cap11"), BLADE_ITEM_TYPE);
			GiveItem2Character(CharacterFromID("pir_cap11"), "bladeX4");
			EquipCharacterbyItem(CharacterFromID("pir_cap11"), "bladeX4");

			RemoveCharacterEquip(CharacterFromID("pir_cap17"), BLADE_ITEM_TYPE);
			GiveItem2Character(CharacterFromID("pir_cap17"), "bladeX4");
			EquipCharacterbyItem(CharacterFromID("pir_cap17"), "bladeX4");

			RemoveCharacterEquip(CharacterFromID("pir_cap21"), BLADE_ITEM_TYPE);
			GiveItem2Character(CharacterFromID("pir_cap21"), "bladeX4");
			EquipCharacterbyItem(CharacterFromID("pir_cap21"), "bladeX4");

			RemoveCharacterEquip(CharacterFromID("pir_cap24"), BLADE_ITEM_TYPE);
			GiveItem2Character(CharacterFromID("pir_cap24"), "bladeX4");
			EquipCharacterbyItem(CharacterFromID("pir_cap24"), "bladeX4");
		break;
	//.....................................................................................
		case "pick_up_ship_ladder":
			SetCurrentTime(12.00, 0);
			SetNextWeather("Heavy Storm");
			Pchar.quest.JRH_rain = "Heavy Storm";

			locations[FindLocation("wr_cave_shore")].image = "";
			DoQuestReloadToLocation("wr_cave_shore", "goto", "swim", "pick_up_ship_ladder1");
		break;

		case "pick_up_ship_ladder1":
			locations[FindLocation("wr_cave_shore")].image = "wr_cave_shore.tga";
		break;
	//...............................................................................................
		case "place_ladder_cave_shore":
			SetCurrentTime(12.00, 0);
			SetNextWeather("Heavy Storm");
			Pchar.quest.JRH_rain = "Heavy Storm";

			Locations[FindLocation("wr_cave_shore")].models.always.locators = "shore04_l_JRH3_spyglass";//ladder placed
			locations[FindLocation("wr_cave_shore")].image = "";
			DoQuestReloadToLocation("wr_cave_shore", "reload", "reload5", "place_ladder_cave_shore1");
		break;

		case "place_ladder_cave_shore1":
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("blast_dirt_small" , u, v+1, w, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("PEOPLE\wood1.wav");
			locations[FindLocation("wr_cave_shore")].image = "wr_cave_shore.tga";
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladeladder2");
			if(!CheckCharacterItem(Pchar,"bladeX4")) GiveItem2Character(Pchar, "bladeX4");
			EquipCharacterbyItem(Pchar, "bladeX4");

			LAi_SetFightMode(pchar, false);
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("equip_megaphone", 0.1);
			LAi_QuestDelay("fill_flagchest", 0.1);

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap17"), "wr_wood_tower1", "goto", "goto3");
			LAi_SetStayType(CharacterFromID("pir_cap17"));

			pchar.quest.silent_seashore.win_condition.l1 = "locator";
			pchar.quest.silent_seashore.win_condition.l1.location = "wr_wood_tower2";
			pchar.quest.silent_seashore.win_condition.l1.locator_group = "reload";
			pchar.quest.silent_seashore.win_condition.l1.locator = "reload4";
			pchar.quest.silent_seashore.win_condition = "silent_seashore";
		break;
	//...............................................................................................
		case "silent_seashore":
			Locations[FindLocation("wr_cave_shore")].type = "silent_seashore";

			pchar.quest.Vane_seashore.win_condition.l1 = "locator";
			pchar.quest.Vane_seashore.win_condition.l1.location = "wr_wood_tower1";
			pchar.quest.Vane_seashore.win_condition.l1.locator_group = "reload";
			pchar.quest.Vane_seashore.win_condition.l1.locator = "reload1";
			pchar.quest.Vane_seashore.win_condition = "Vane_seashore";
		break;

		case "Vane_seashore":
			if(CheckAttribute(Pchar, "quest.Gow") && Pchar.quest.Gow == "on_shore")
			{
				Locations[FindLocation("wr_cave_shore")].type = "silent_seashore";
			}
			else Locations[FindLocation("wr_cave_shore")].type = "Vane_seashore";

			pchar.quest.silent_seashore.win_condition.l1 = "locator";
			pchar.quest.silent_seashore.win_condition.l1.location = "wr_wood_tower2";
			pchar.quest.silent_seashore.win_condition.l1.locator_group = "reload";
			pchar.quest.silent_seashore.win_condition.l1.locator = "reload4";
			pchar.quest.silent_seashore.win_condition = "silent_seashore";
		break;
	//...............................................................................................
		case "Lowther_leaves":
			PlaySound("VOICE\ENGLISH\pir_capG.wav");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap17"), "wr_wood_tower1", "goto", "lowther");

			LAi_QuestDelay("Lowther_leaves0", 1.0);
		break;

		case "Lowther_leaves0":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto2");

			LAi_QuestDelay("Lowther_leaves1", 1.5);
		break;

		case "Lowther_leaves1":
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap17"), "wr_cave_shore", "goto", "boat3D");//Lowther
			LAi_SetCitizenType(CharacterFromID("pir_cap17"));
			Pchar.quest.Lowther = "on_shore";

			LAi_QuestDelay("hint_megaphone", 1.0);
		break;

		case "hint_megaphone":
			LAi_SetPlayerType(Pchar);
			Logit(LanguageConvertString(tmpLangFileID,"I'll try the megaphone on the Shore - maybe someone can here me?"));
			AddQuestRecord("Cave_Shore", "3");
		break;
	//...............................................................................................
		case "equip_megaphone":
			if(CheckCharacterItem(Pchar,"megaphone"))
			{
				TakeItemFromCharacter(Pchar, "megaphone");
				GiveItem2Character(Pchar, "blademegaphone");
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterbyItem(Pchar, "blademegaphone");

				LAi_QuestDelay("megaphone", 0.1);
				LAi_QuestDelay("use_megaphone", 0.1);
				LAi_QuestDelay("Lowther_leaves", 1.0);
			}
			else LAi_QuestDelay("equip_megaphone", 0.5);
		break;
	//...............................................................................................
		case "swivelgun_longer_smoke":
			CreateParticleSystem("smoke_short" , 5.3, 4.45, 3.0, 5.3, 7.0, 3.0, sti(20) );
		break;

		case "swivelgun_longer_black_smoke":
			PlaySound("OBJECTS\DUEL\man_attack5.wav");
			Logit(LanguageConvertString(tmpLangFileID,"Gunpowder must be wet!"));

			CreateParticleSystem("gunfire_black" , 5.3, 4.45, 3.0, 5.3, 7.0, 3.0, sti(20) );

			LAi_QuestDelay("swivelgun_longer_black_smoke1", 2.0);
		break;

		case "swivelgun_longer_black_smoke1":
			CreateParticleSystem("gunfire_black" , 5.3, 4.45, 3.0, 5.3, 7.0, 3.0, sti(20) );
		break;

		case "swivelgun_turn":
			PlaySound("INTERFACE\rum_wheel.wav");

			locations[FindLocation("wr_wood_tower2")].image = "";		//temp off
			if(Locations[FindLocation(Pchar.location)].models.always.locators == "store04_locators_JRH6")
			{
				Locations[FindLocation(Pchar.location)].models.always.locators = "store04_locators_JRH7";
			}
			else  Locations[FindLocation(Pchar.location)].models.always.locators = "store04_locators_JRH6";

			DoQuestReloadToLocation("wr_wood_tower2", "goto", "swivelgun", "swivelgun_turn1");
		break;

		case "swivelgun_turn1":
			LAi_SetPlayerType(Pchar);
			PlaySound("INTERFACE\lever_placed.wav");
			locations[FindLocation("wr_wood_tower2")].image = "wr_wood_tower2.tga";//change this
		break;
	//...............................................................................................
		case "fill_flagchest":
			pchar.quest.fill_flagchest1.win_condition.l1 = "location";
			pchar.quest.fill_flagchest1.win_condition.l1.location = "wr_wood_tower2";
			pchar.quest.fill_flagchest1.win_condition = "fill_flagchest1";
		break;

		case "fill_flagchest1":
			locations[FindLocation(Pchar.location)].box3.items.bladeflag_pir = 1;
		break;
	//...............................................................................................
		case "megaphone":
			if(LAi_IsFightMode(Pchar) && IsEquipCharacterByItem(Pchar, "blademegaphone"))
			{
				LAi_QuestDelay("megaphone1", 0.5);
			}
			else LAi_QuestDelay("megaphone", 0.5);
		break;

		case "megaphone1":
			if(LAi_IsFightMode(Pchar) && IsEquipCharacterByItem(Pchar, "blademegaphone"))
			{
				PlaySound("OBJECTS\SHIPCHARGE\CannonReload-001.wav");
				PlaySound("OBJECTS\SHIPCHARGE\CannonReload-001.wav");

				LAi_LockFightMode(Pchar, true);
				LAi_QuestDelay("reset_megaphone", 1.0);
			}
		break;

		case "reset_megaphone":
			LAi_LockFightMode(Pchar, false);
			LAi_SetFightMode(Pchar, false);

			LAi_QuestDelay("megaphone", 0.5);
		break;
	//...............................................................................................
		case "use_megaphone":
			pchar.quest.use_megaphone1.win_condition.l1 = "locator";
			pchar.quest.use_megaphone1.win_condition.l1.location = "wr_cave_shore";
			pchar.quest.use_megaphone1.win_condition.l1.locator_group = "goto";
			pchar.quest.use_megaphone1.win_condition.l1.locator = "megaphone";
			pchar.quest.use_megaphone1.win_condition = "use_megaphone1";
		break;

		case "use_megaphone1":
			LAi_SetFightMode(Pchar, true);
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap6"), "wr_cave_shore", "goto", "window");

			LAi_QuestDelay("use_megaphone2", 3.0);
		break;

		case "use_megaphone2":
			PlaySound("VOICE\ENGLISH\pir_capM.wav");

			LAi_QuestDelay("use_megaphone3", 2.0);
			LAi_QuestDelay("use_megaphone4", 4.5);
		break;

		case "use_megaphone3":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "window");
		break;

		case "use_megaphone4":
			LAi_ActorGoToLocator(Pchar, "goto", "window_dialog", "use_megaphone5", 2.0);
		break;

		case "use_megaphone5":
			LAi_ActorTurnToLocator(Pchar, "goto", "window");

			LAi_QuestDelay("use_megaphone6", 1.0);
		break;

		case "use_megaphone6":
			PlaySound("VOICE\ENGLISH\pir_capMMM.wav");

			LAi_QuestDelay("use_megaphone7", 1.0);
		break;

		case "use_megaphone7":
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap6"), "wr_cave_shore", "goto", "window_down");

			LAi_QuestDelay("use_megaphone8", 2.0);
		break;

		case "use_megaphone8":
			PlaySound("INTERFACE\lever_placed.wav");

			LAi_QuestDelay("use_megaphone9", 2.0);
		break;

		case "use_megaphone9":
			PlaySound("PEOPLE\counter_openclose.wav");

			LAi_QuestDelay("use_megaphone10", 1.0);
		break;

		case "use_megaphone10":
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap6"), "wr_cave_shore", "reload", "reload2");
			locations[FindLocation("wr_cave_shore")].reload.l2.disable = 0;		//to cannon_tower
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("use_megaphone11", 1.0);
		break;

		case "use_megaphone11":
			LAi_SetCitizenType(CharacterFromID("pir_cap6"));
			Pchar.quest.Cocklyn = "on_shore";

			pchar.quest.use_megaphone12.win_condition.l1 = "location";
			pchar.quest.use_megaphone12.win_condition.l1.location = "wr_cannon_tower";
			pchar.quest.use_megaphone12.win_condition = "use_megaphone12";
		break;

		case "use_megaphone12":
			locations[FindLocation(Pchar.location)].box1.items.bladewhistle = 1;

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap6"), "wr_cave_shore", "goto", "boat1");

			LAi_QuestDelay("equip_whistle", 0.1);
		break;

		case "equip_whistle":
			if(CheckCharacterItem(Pchar,"bladewhistle"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterbyItem(Pchar, "bladewhistle");

				//SetCurrentTime(12.00, 0);
				SetNextWeather("Heavy Rain");
				Pchar.quest.JRH_rain = "Heavy Rain";
				Pchar.quest.JRH_sky = "C_Ni2";

				LAi_QuestDelay("bosuns_pipe", 0.1);
			}
			else LAi_QuestDelay("equip_whistle", 0.5);
		break;
	//...............................................................................................
		case "cannon_tower_dry_gp":
			if(CheckCharacterItem(Pchar,"gunpowder"))
			{
				Pchar.quest.wet_gp = "no";

				if(!IsEquipCharacterByItem(Pchar, "pistol20")) EquipCharacterbyItem(Pchar, "pistol20");
				SetModel(PChar, "PriestRedM_a", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

				string weaponID11 = GetCharacterEquipByGroup(Pchar,GUN_ITEM_TYPE);
				aref weapon11;
				Items_FindItem(weaponID11, &weapon11);

				weapon11.model = "pistol201";
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE );
				EquipCharacterByItem(Pchar, "pistol20");
				EquipCharacterbyItem(Pchar, "ammobag2");

				Logit(LanguageConvertString(tmpLangFileID,"Finally I got some dry gunpowder!"));
				PlaySound("OBJECTS\DUEL\man_attack6.wav");
			}
		break;
	//...............................................................................................
		case "spriggs_arrives":
			PlaySound("INTERFACE\key_unlock.wav");

			LAi_QuestDelay("spriggs_arrives1", 2.5);
		break;

		case "spriggs_arrives1":
			PlaySound("INTERFACE\closed_door.wav");
			LAi_SetStayType(CharacterFromID("pir_cap24"));
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap24"), "wr_wood_tower2", "reload", "reload4");
			locations[FindLocation("wr_wood_tower2")].reload.l4.disable = 0;		//to balcony

			LAi_QuestDelay("wood_tower_up", 0.1);
			LAi_QuestDelay("spriggs_arrives2", 1.0);
		break;

		case "spriggs_arrives2":
			PlaySound("VOICE\ENGLISH\pir_capI.wav");

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload4");

			LAi_QuestDelay("spriggs_arrives3", 2.5);
		break;

		case "spriggs_arrives3":
			LAi_QuestDelay("spriggs_arrives7", 2.0);

			LAi_SetActorType(CharacterFromID("pir_cap24"));
			LAi_ActorGoToLocator(CharacterFromID("pir_cap24"), "goto", "stairs1", "spriggs_arrives4", 4.0);
		break;

		case "spriggs_arrives4":
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap24"), "wr_wood_tower2", "goto", "stairs1");
			LAi_ActorGoToLocator(CharacterFromID("pir_cap24"), "goto", "stairs2", "spriggs_arrives5", 3.0);
		break;

		case "spriggs_arrives5":
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap24"), "wr_wood_tower2", "goto", "stairs2");
			LAi_ActorGoToLocator(CharacterFromID("pir_cap24"), "goto", "stairs3", "spriggs_arrives6", 3.0);
		break;

		case "spriggs_arrives6":
			PlaySound("PEOPLE\counter_close.wav");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap24"), "wr_cave_shore", "goto", "boat6D");
			LAi_SetCitizenType(CharacterFromID("pir_cap24"));
			Pchar.quest.Spriggs = "on_shore";
			LAi_SetPlayerType(Pchar);

			pchar.quest.wood_tower_musket.win_condition.l1 = "locator";
			pchar.quest.wood_tower_musket.win_condition.l1.location = "wr_wood_tower3";
			pchar.quest.wood_tower_musket.win_condition.l1.locator_group = "goto";
			pchar.quest.wood_tower_musket.win_condition.l1.locator = "wall0";	//was wall1
			pchar.quest.wood_tower_musket.win_condition = "wood_tower_musket";
		break;

		case "spriggs_arrives7":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "stairs1");
		break;
	//...............................................................................................
		case "wood_tower_up":
			LAi_SetPlayerType(Pchar);

			pchar.quest.wood_tower_up1.win_condition.l1 = "locator";
			pchar.quest.wood_tower_up1.win_condition.l1.location = "wr_cave_shore";
			pchar.quest.wood_tower_up1.win_condition.l1.locator_group = "goto";
			pchar.quest.wood_tower_up1.win_condition.l1.locator = "R7";
			pchar.quest.wood_tower_up1.win_condition = "wood_tower_up1";
		break;

		case "wood_tower_up1":
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("wood_tower_up2", 2.0);
		break;

		case "wood_tower_up2":
			PlaySound("PEOPLE\Run_wood.wav");
			PlaySound("PEOPLE\creak2.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_cave_shore", "reload", "reload10");

			Pchar.quest.wood_tower_down.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.wood_tower_down.win_condition.l1.location = "wr_cave_shore";
			Pchar.quest.wood_tower_down.win_condition = "wood_tower_down";
		break;

		case "wood_tower_down":
			LAi_SetPlayerType(Pchar);

			pchar.quest.wood_tower_down1.win_condition.l1 = "locator";
			pchar.quest.wood_tower_down1.win_condition.l1.location = "wr_cave_shore";
			pchar.quest.wood_tower_down1.win_condition.l1.locator_group = "goto";
			pchar.quest.wood_tower_down1.win_condition.l1.locator = "R10";	//was reload10
			pchar.quest.wood_tower_down1.win_condition = "wood_tower_down1";
		break;

		case "wood_tower_down1":
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("wood_tower_down2", 2.0);
		break;

		case "wood_tower_down2":
			PlaySound("PEOPLE\Run_wood.wav");
			PlaySound("PEOPLE\creak2.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_cave_shore", "reload", "reload7");

			Pchar.quest.wood_tower_up.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.wood_tower_up.win_condition.l1.location = "wr_cave_shore";
			Pchar.quest.wood_tower_up.win_condition = "wood_tower_up";
		break;
	//...............................................................................................
		case "notice_wt3_musket":
			//from itemlogic
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "randitem", "randitem7");

			LAi_QuestDelay("notice_wt3_musket1", 1.5);
		break;

		case "notice_wt3_musket1":
			LAi_SetPlayerType(Pchar);
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");
			Logit(LanguageConvertString(tmpLangFileID,"Can I balance on the edging to the Musket?"));
			AddQuestRecord("Cave_shore", "6");
		break;
	//...............................................................................................
		case "wood_tower_musket":
			PlaySound("PEOPLE\step_stairway.wav");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("wood_tower_musket0", 1.5);
		break;

		case "wood_tower_musket0":
			ChangeCharacterAddressGroup(Pchar, "wr_wood_tower3", "goto", "wall1");
			PlaySound("PEOPLE\run_wood.wav");

			LAi_QuestDelay("wood_tower_musket1", 1.5);
		break;

		case "wood_tower_musket1":
			ChangeCharacterAddressGroup(Pchar, "wr_wood_tower3", "goto", "wall2");
			PlaySound("PEOPLE\run_wood.wav");

			LAi_QuestDelay("wood_tower_musket2", 0.1);
		break;

		case "wood_tower_musket2":
			if(CheckCharacterItem(Pchar,"musket_item"))
			{
				TakeItemFromCharacter(Pchar, "musket_item");
				GiveItem2Character(Pchar, "pistolmket");
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterbyItem(Pchar, "pistolmket");
				PlaySound("OBJECTS\DUEL\reload1.wav");
				Pchar.quest.wt3_musket = "picked_up";
				RemoveCharacterEquip(Pchar, POUCH_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "ammobag2");
				GiveItem2Character(Pchar, "ammobag1");
				SetModel(PChar, "PriestRedM", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

				LAi_QuestDelay("wood_tower_musket3", 1.5);
			}
			else LAi_QuestDelay("wood_tower_musket2", 0.5);
		break;

		case "wood_tower_musket3":
			ChangeCharacterAddressGroup(Pchar, "wr_wood_tower3", "goto", "wall1");
			PlaySound("PEOPLE\run_wood.wav");

			LAi_QuestDelay("wood_tower_musket4", 1.5);
		break;

		case "wood_tower_musket4":
			ChangeCharacterAddressGroup(Pchar, "wr_wood_tower3", "goto", "wall0");
			PlaySound("PEOPLE\run_wood.wav");

			LAi_QuestDelay("wood_tower_musket5", 1.5);
		break;

		case "wood_tower_musket5":
			locations[FindLocation("wr_wood_tower3")].image = "";		//temp off
			Locations[FindLocation(Pchar.location)].models.always.locators = "LH_F1_l_JRH3";
			DoQuestReloadToLocation("wr_wood_tower3", "goto", "stairs", "wood_tower_musket6");
		break;

		case "wood_tower_musket6":
			PlaySound("PEOPLE\step_stairway.wav");
			PlaySound("PEOPLE\step_stairway.wav");

			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("wr_wood_tower3")].image = "wr_wood_tower3.tga";//reset change this later
		break;
	//...............................................................................................
		case "place_musket_lever":
			//from itemogic
			EquipCharacterByItem(Pchar, "pistol20");
			TakeItemFromCharacter(Pchar, "ammobag1");
			GiveItem2Character(Pchar, "ammobag2");
			EquipCharacterByItem(Pchar, "ammobag2");
			SetModel(PChar, "PriestRedM_a", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Clear";
			Pchar.quest.JRH_sky = "7_Gr";

			locations[FindLocation("wr_cannon_tower")].image = "";		//temp off
			DoQuestReloadToLocation("wr_cannon_tower", "goto", "goto5", "place_musket_lever1");
		break;

		case "place_musket_lever1":
			PlaySound("INTERFACE\lever_placed.wav");
			LAi_SetFightMode(Pchar, false);
			locations[FindLocation("wr_cannon_tower")].image = "wr_cannon_tower.tga";
	
			LAi_QuestDelay("equip_boathook", 0.1);
		break;
	//...............................................................................................
		case "Winter_walks":
			Pchar.Winter_walks = "done";
			PlaySound("VOICE\ENGLISH\pir_capFFF.wav");
			LAi_SetStayType(CharacterFromID("pir_cap21"));

			LAi_QuestDelay("Winter_walks1", 1.5);
		break;

		case "Winter_walks1":
			LAi_SetCitizenType(CharacterFromID("pir_cap21"));
		break;
	//...............................................................................................
		case "equip_boathook":
			if(CheckCharacterItem(Pchar,"boathook"))
			{
				TakeItemFromCharacter(Pchar, "boathook");
				GiveItem2Character(Pchar, "bladeboathook_1");
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterbyItem(Pchar, "bladeboathook_1");
				Locations[FindLocation("wr_wood_tower3")].locators_radius.box.box1 = 1.0;
			Pchar.quest.wt3_box1 = "large";
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap21"), "wr_cave_shore", "goto", "boat5D");//Winter
			LAi_SetCitizenType(CharacterFromID("pir_cap21"));

				LAi_QuestDelay("ready_for_ladder_down", 0.1);
			}
			else LAi_QuestDelay("equip_boathook", 0.5);
		break;
	//...............................................................................................
		case "ready_for_ladder_down":
			pchar.quest.ready_for_ladder_down1.win_condition.l1 = "locator";
			pchar.quest.ready_for_ladder_down1.win_condition.l1.location = "wr_wood_tower3";
			pchar.quest.ready_for_ladder_down1.win_condition.l1.locator_group = "box";
			pchar.quest.ready_for_ladder_down1.win_condition.l1.locator = "box1";
			pchar.quest.ready_for_ladder_down1.win_condition = "ready_for_ladder_down1";
		break;

		case "ready_for_ladder_down1":
			if(IsEquipCharacterByItem(Pchar, "bladeboathook_1"))
			{
				ChangeCharacterAddressGroup(Pchar, "wr_wood_tower3", "goto", "ladder");
				LAi_SetStayType(Pchar);

			}
			else LAi_QuestDelay("ready_for_ladder_down", 0.5);
		break;
	//...............................................................................................
		case "prepare_pull_down_ladder":
			PlaySound("INTERFACE\damper_change.wav");

			LAi_QuestDelay("pull_down_ladder", 1.0);
		break;

		case "pull_down_ladder":
			//from itemlogic
			locations[FindLocation("wr_wood_tower3")].image = "";		//temp off
			Locations[FindLocation("wr_wood_tower3")].models.always.locators = "LH_F1_l_JRH3_L";	//ladder

			DoQuestReloadToLocation("wr_wood_tower3", "goto", "ladder", "pull_down_ladder1");
		break;

		case "pull_down_ladder1":
			PlaySound("INTERFACE\shelf_open.wav");
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("blast_dirt_small" , u, v+1, w, 0.0, 0.0, 0.0, sti(20) );

			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladeboathook_2");
			EquipCharacterByItem(Pchar, "bladeX4");
			LAi_SetFightMode(Pchar, false);
			LAi_LocationFightDisable(&Locations[FindLocation("wr_wood_tower3")], true);

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap10"), "wr_cave_shore", "goto", "inside_boat");//Bunce in boat
			LAi_SetActorType(CharacterFromID("pir_cap10"));
			LAi_ActorSetLayMode(CharacterFromID("pir_cap10"));

			locations[FindLocation("wr_wood_tower3")].image = "wr_wood_tower3.tga";

			LAi_QuestDelay("wood_tower_top_staytype", 0.1);
			LAi_QuestDelay("wood_tower_spyglass", 0.1);
		break;
	//...............................................................................................
		case "wood_tower_top_staytype":
			LAi_SetPlayerType(Pchar);

			pchar.quest.wood_tower_top_staytype1.win_condition.l1 = "locator";
			pchar.quest.wood_tower_top_staytype1.win_condition.l1.location = "wr_cave_shore";
			pchar.quest.wood_tower_top_staytype1.win_condition.l1.locator_group = "goto";
			pchar.quest.wood_tower_top_staytype1.win_condition.l1.locator = "spyglass";
			pchar.quest.wood_tower_top_staytype1.win_condition = "wood_tower_top_staytype1";
		break;

		case "wood_tower_top_staytype1":
			//loops from 1 to 2 etc
			LAi_SetStayType(Pchar);
			PlaySound("PEOPLE\counter_open.wav");

			pchar.quest.wood_tower_top_staytype2.win_condition.l1 = "locator";
			pchar.quest.wood_tower_top_staytype2.win_condition.l1.location = "wr_wood_tower3";
			pchar.quest.wood_tower_top_staytype2.win_condition.l1.locator_group = "goto";
			pchar.quest.wood_tower_top_staytype2.win_condition.l1.locator = "stairs";
			pchar.quest.wood_tower_top_staytype2.win_condition = "wood_tower_top_staytype2";
		break;

		case "wood_tower_top_staytype2":
			Pchar.quest.wood_tower_route = "way_up";
			LAi_SetPlayerType(Pchar);

			pchar.quest.wood_tower_top_staytype1.win_condition.l1 = "locator";
			pchar.quest.wood_tower_top_staytype1.win_condition.l1.location = "wr_cave_shore";
			pchar.quest.wood_tower_top_staytype1.win_condition.l1.locator_group = "goto";
			pchar.quest.wood_tower_top_staytype1.win_condition.l1.locator = "head";			//was reload8
			pchar.quest.wood_tower_top_staytype1.win_condition = "wood_tower_top_staytype1";
		break;
	//...............................................................................................
	//NEW UP SEQUENCE
		case "wood_top_up":
			LAi_SetSitType(Pchar);
			PlaySound("OBJECTS\DUEL\man_attack1.wav");

			ChangeCharacterAddressGroup(Pchar, "wr_cave_shore", "goto", "flag_sit");

			LAi_QuestDelay("wood_top_up1", 1.0);
		break;

		case "wood_top_up1":
			LAi_SetStayType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "wr_cave_shore", "goto", "flag_stay");

			LAi_QuestDelay("wood_top_up2", 1.0);
		break;

		case "wood_top_up2":
			PlaySound("PEOPLE\run_roof.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_cave_shore", "goto", "flag_pole");
		break;

	//NEW DOWN SEQUENCE
		case "wood_top_down":
			LAi_SetStayType(Pchar);
			PlaySound("PEOPLE\run_roof.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_cave_shore", "goto", "flag_stay");

			LAi_QuestDelay("wood_top_down1", 1.0);
		break;

		case "wood_top_down1":
			LAi_SetSitType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "wr_cave_shore", "goto", "flag_sit");

			LAi_QuestDelay("wood_top_down2", 1.0);
		break;

		case "wood_top_down2":
			Pchar.quest.flag_pole = "free";
			//LogIt("flag_pole = " + Pchar.quest.flag_pole);
			LAi_SetStayType(Pchar);
			PlaySound("PEOPLE\clothes1.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_cave_shore", "goto", "head");
		break;
	//--------------------------------------------------------------------------------------
		case "wood_top_down3":
			//from itemlogic box6

			PlaySound("PEOPLE\counter_close.wav");

			//if any of them hav been up on the hill
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap24"), "wr_cave_shore", "goto", "boat6D");
			LAi_SetCitizenType(CharacterFromID("pir_cap24"));

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap6"), "wr_cave_shore", "goto", "boat1");
			LAi_SetCitizenType(CharacterFromID("pir_cap6"));

			if(CheckAttribute(Pchar, "quest.Bunce") && Pchar.quest.Bunce == "on_shore")
			{
				ChangeCharacterAddressGroup(CharacterFromID("pir_cap10"), "wr_cave_shore", "goto", "boat3D");
				LAi_SetCitizenType(CharacterFromID("pir_cap10"));
			}

			RemoveCharacterEquip(CharacterFromID("pir_cap6"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(CharacterFromID("pir_cap6"), "bladedrum");
			EquipCharacterbyItem(CharacterFromID("pir_cap6"), "bladeX4");

			RemoveCharacterEquip(CharacterFromID("pir_cap10"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(CharacterFromID("pir_cap10"), "bladedrum");
			EquipCharacterbyItem(CharacterFromID("pir_cap10"), "bladeX4");

			RemoveCharacterEquip(CharacterFromID("pir_cap24"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(CharacterFromID("pir_cap24"), "bladedrum");
			EquipCharacterbyItem(CharacterFromID("pir_cap24"), "bladeX4");
		break;
	//...............................................................................................
		case "wood_tower_spyglass":
			if(CheckCharacterItem(Pchar,"spyglass5"))
			{
				TakeItemFromCharacter(Pchar, "spyglass5");
				GiveItem2Character(Pchar, "bladespyglass5");
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterbyItem(Pchar, "bladespyglass5");
				PlaySound("INTERFACE\button1.wav");
			}
			else LAi_QuestDelay("wood_tower_spyglass", 0.5);
		break;

		case "blaze_huh":
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");
		break;

		case "boat_zoom":
			Locations[FindLocation("wr_wood_tower3")].reload.l2.emerge = "head";			//was reload8
			Locations[FindLocation(Pchar.location)].models.always.locators = "Shore04_l_JRH3";
			locations[FindLocation(Pchar.location)].image = "zoom_boat.tga";

			DoQuestReloadToLocation("wr_cave_shore", "goto", "head", "boat_zoom1");
		break;

		case "boat_zoom1":
			LAi_SetFightMode(Pchar, false);
			LAi_SetStayType(Pchar);
			Locations[FindLocation("wr_cave_shore")].image = "wr_cave_shore.tga";
			Pchar.quest.Bunce = "in_boat";

			LAi_QuestDelay("boat_zoom2", 1.5);
		break;

		case "boat_zoom2":
			pchar.quest.wake_up_Bunce.win_condition.l1 = "locator";
			pchar.quest.wake_up_Bunce.win_condition.l1.location = "wr_cave_shore";
			pchar.quest.wake_up_Bunce.win_condition.l1.locator_group = "goto";
			pchar.quest.wake_up_Bunce.win_condition.l1.locator = "boat7";
			pchar.quest.wake_up_Bunce.win_condition = "wake_up_Bunce";
		break;

		case "wake_up_Bunce":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "inside_boat");

			LAi_QuestDelay("wake_up_Bunce1", 0.5);
		break;

		case "wake_up_Bunce1":
			LAi_SetPlayerType(Pchar);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			EquipCharacterbyItem(Pchar, "bladeanchor");
			Logit(LanguageConvertString(tmpLangFileID,"I'll wake you up mister!"));
			PlaySound("OBJECTS\DUEL\man_attack5.wav");
		break;

		case "Bunce_wakes_up":
			//from LAi_events
			LAi_SetStayType(CharacterFromID("pir_cap10"));
			PlaySound("PEOPLE\yawn.wav");
			PlaySound("PEOPLE\yawn.wav");
			PlaySound("PEOPLE\creak2.wav");

			LAi_QuestDelay("Bunce_wakes_up0", 1.5);
		break;

		case "Bunce_wakes_up0":
			PlaySound("VOICE\ENGLISH\pir_capF.wav");

			LAi_QuestDelay("Bunce_wakes_up1", 2.0);
		break;

		case "Bunce_wakes_up1":
			PlaySound("OBJECTS\DUEL\man_attack1.wav");

			LAi_QuestDelay("Bunce_wakes_up2", 0.5);
		break;

		case "Bunce_wakes_up2":
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap10"), "wr_cave_shore", "goto", "boat3");
			PlaySound("PEOPLE\step_stone.wav");
			PlaySound("PEOPLE\step_stone.wav");

			LAi_QuestDelay("Bunce_wakes_up3", 1.0);
		break;

		case "Bunce_wakes_up3":
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap10"), "wr_cave_shore", "goto", "boat3D");
			PlaySound("PEOPLE\step_ground1.wav");
			PlaySound("PEOPLE\step_ground1.wav");

			LAi_QuestDelay("Bunce_wakes_up4", 0.5);
		break;

		case "Bunce_wakes_up4":
			PlaySound("PEOPLE\beltkey_drop.wav");
			LAi_SetActorType(CharacterFromID("pir_cap10"));
			LAi_ActorGoToLocator(CharacterFromID("pir_cap10"), "reload", "locator3", "Bunce_wakes_up5", 23.0);//was 10.0

			LAi_QuestDelay("Bunce_wakes_up6", 2.0);
		break;

		case "Bunce_wakes_up5":
			LAi_SetCitizenType(CharacterFromID("pir_cap10"));
		break;

		case "Bunce_wakes_up6":
			Locations[FindLocation(Pchar.location)].models.always.locators = "Shore04_l_JRH3_key";
			locations[FindLocation(Pchar.location)].image = "";

			DoQuestReloadToLocation("wr_cave_shore", "goto", "boat7", "Bunce_wakes_up7");
		break;

		case "Bunce_wakes_up7":
			PlaySound("VOICe\ENGLISH\blaze_what_was_that.wav");

			Locations[FindLocation("wr_cave_shore")].image = "wr_cave_shore.tga";
			Pchar.quest.Bunce = "on_shore";
			LAi_LocationFightDisable(&Locations[FindLocation("wr_cave_shore")], false);//reset

			LAi_QuestDelay("Bunce_wakes_up8", 2.0);
		break;

		case "Bunce_wakes_up8":
			ChangeCharacterAddressGroup(Pchar, "wr_cave_shore", "goto", "boat7D");
			PlaySound("PEOPLE\step_ground1.wav");
			PlaySound("PEOPLE\step_ground1.wav");

			LAi_QuestDelay("Bunce_wakes_up9", 1.0);
		break;

		case "Bunce_wakes_up9":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "boat3");

			LAi_QuestDelay("Bunce_wakes_up10", 1.0);
		break;

		case "Bunce_wakes_up10":
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("pick_up_key19", 0.1);
		break;

		case "pick_up_key19":
			if(CheckCharacterItem(Pchar,"key19"))
			{
				Locations[FindLocation(Pchar.location)].models.always.locators = "Shore04_l_JRH3";//reset to normal mode
				PlaySound("INTERFACE\took_item.wav");
			}
			else LAi_QuestDelay("pick_up_key19", 0.5);
		break;

		case "pick_up_pirate_flag":
			if(CheckCharacterItem(Pchar,"bladeflag_pir"))
			{
				PlaySound("PEOPLE\clothes1.wav");
				LAi_SetActorType(Pchar);
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterbyItem(Pchar, "bladeflag_pir");
				SetNextWind("S",30);		//was W

				SetNextWeather("Clear");
				Pchar.quest.JRH_rain = "Clear";
				Pchar.quest.JRH_sky = "";

				Pchar.flag_knowledge = "yes";
				DoQuickSave(); // PB: Not a fix, but might prevent some frustration

				LAi_QuestDelay("Spriggs_flag", 1.0);
			}
			else LAi_QuestDelay("pick_up_pirate_flag", 0.5);

		break;

	//...............................................................................................
		case "Spriggs_flag":
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap24"), "wr_wood_tower2", "goto", "goto3");
			PlaySound("INTERFACE\closed_door.wav");

			LAi_QuestDelay("Spriggs_flag1", 1.0);
		break;

		case "Spriggs_flag1":
			LAi_SetActorType(CharacterFromID("pir_cap24"));
			LAi_ActorDialog(characterFromID("pir_cap24"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap24"));
			Characters[GetCharacterIndex("pir_cap24")].dialog.CurrentNode  = "flag";
		break;

		case "Spriggs_flag2":
			PlaySound("PEOPLE\clothes1.wav");
			
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladeflag_pir");
			if(!CheckCharacterItem(Pchar,"bladeX4")) GiveItem2Character(Pchar, "bladeX4");
			EquipCharacterByItem(Pchar, "bladeX4");

			GiveItem2Character(CharacterFromID("pir_cap24"), "bladeflag_pir");
			RemoveCharacterEquip(CharacterFromID("pir_cap24"), BLADE_ITEM_TYPE);
			EquipCharacterByItem(CharacterFromID("pir_cap24"), "bladeflag_pir");

			Pchar.quest.Spriggs = "on_shore";
			Characters[GetCharacterIndex("pir_cap24")].dialog.CurrentNode  = "First time";

			LAi_QuestDelay("Spriggs_flag3", 1.0);
		break;

		case "Spriggs_flag3":
			LAi_SetActorType(CharacterFromID("pir_cap24"));
			LAi_ActorGoToLocator(CharacterFromID("pir_cap24"), "reload", "reload4", "Spriggs_flag4", 2.0);
		break;

		case "Spriggs_flag4":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "tower_too_high";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Spriggs_flag5":
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap24"), "none", "", "");
			LAi_SetPlayerType(Pchar);
	
			SetLocatorRadius(locations[FindLocation("wr_cave_shore")], "box", "box6", 0.0001);
			Locations[FindLocation("wr_cave_shore")].locators_radius.box.box6 = 0.0001;
	
			pchar.quest.delay_hoist_spanish_flag.win_condition.l1 = "locator";
			pchar.quest.delay_hoist_spanish_flag.win_condition.l1.location = "wr_cave_shore";
			pchar.quest.delay_hoist_spanish_flag.win_condition.l1.locator_group = "goto";
			pchar.quest.delay_hoist_spanish_flag.win_condition.l1.locator = "head";
			pchar.quest.delay_hoist_spanish_flag.win_condition = "delay_hoist_spanish_flag";
		break;
	//...............................................................................................
		case "delay_hoist_spanish_flag":
			LAi_QuestDelay("hoist_spanish_flag", 1.5);
		break;

		case "hoist_spanish_flag":
			//Yes 'spanish' is the only case we use
			if(CheckAttribute(Pchar, "quest.Vane_ships") && Pchar.quest.Vane_ships == "near_shore")
			{
				if(CheckAttribute(Pchar, "quest.Gow") && Pchar.quest.Gow == "on_ship")
				{
					Pchar.quest.Gow = "on_shore";
					PlaySound("OBJECTS\DUEL\pistol_big2.wav");
					CreateParticleSystem("cancloud" , 145.8, 2.0, 251.3, 4.5, 1.5, 0.0, sti(20) );
					CreateParticleSystem("cancloud" , 145.8, 2.0, 250.0, 4.5, 1.5, 0.0, sti(20) );

					LAi_QuestDelay("hoist_spanish_flag0", 2.0);
				}
				else
				{
					Pchar.quest.flag_pole = "free";

					LAi_QuestDelay("wood_top_down", 1.0);
				}
			}
			else LAi_QuestDelay("wood_top_down", 0.01);
		break;

		case "hoist_spanish_flag0":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "ships_other", "ship_14");

			LAi_QuestDelay("hoist_spanish_flag1", 1.0);
		break;

		case "hoist_spanish_flag1":
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			EquipCharacterByItem(Pchar, "bladespyglass5");
			PlaySound("INTERFACE\button2.wav");

			LAi_QuestDelay("hoist_spanish_flag2", 1.0);
		break;

		case "hoist_spanish_flag2":
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(Pchar, true);

			LAi_QuestDelay("hoist_spanish_flag3", 1.0);
		break;

		case "hoist_spanish_flag3":
			locations[FindLocation(Pchar.location)].image = "zoom_cutter.tga";

			DoQuestReloadToLocation("wr_cave_shore", "goto", "head", "hoist_spanish_flag4");
		break;

		case "hoist_spanish_flag4":
			CreateParticleSystem("KNBcancloud" , 145.8, 2.0, 251.3, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("KNBcancloud" , 145.8, 2.0, 250.0, 4.5, 1.5, 0.0, sti(20) );
		
			LAi_SetFightMode(Pchar, false);
			LAi_SetStayType(Pchar);

			Pchar.flag_knowledge = "no";
			Locations[FindLocation("wr_cave_shore")].image = "wr_cave_shore.tga";

			SetLocatorRadius(locations[FindLocation("wr_cave_shore")], "box", "box6", 1.0);
			Locations[FindLocation("wr_cave_shore")].locators_radius.box.box6 = 1.0;

			pchar.quest.hoist_spanish_flag5.win_condition.l1 = "location";
			pchar.quest.hoist_spanish_flag5.win_condition.l1.location = "wr_wood_tower3";
			pchar.quest.hoist_spanish_flag5.win_condition = "hoist_spanish_flag5";
		break;
	
		case "hoist_spanish_flag5":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "send_boat";
			LAi_ActorSelfDialog(pchar, "");

			pchar.quest.hoist_spanish_flag6.win_condition.l1 = "location";
			pchar.quest.hoist_spanish_flag6.win_condition.l1.location = "wr_wood_tower1";
			pchar.quest.hoist_spanish_flag6.win_condition = "hoist_spanish_flag6";
		break;

		case "hoist_spanish_flag6":
			AddQuestRecord("Cave_Shore", "4");

			if(Locations[FindLocation("wr_cave_shore")].models.always.locators == "Shore04_l_JRH3")
			Locations[FindLocation("wr_cave_shore")].models.always.locators = "Shore04_l_JRH3F";

			if(Locations[FindLocation("wr_cave_shore")].models.always.locators == "Shore04_l_JRH4")
			Locations[FindLocation("wr_cave_shore")].models.always.locators = "Shore04_l_JRH4F";

			Characters[GetCharacterIndex("pir_cap25")].Ship.Type = "obj_Boat3";
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap11"), "wr_cave_shore", "goto", "citizen03");
			LAi_SetStayType(CharacterFromID("pir_cap11"));

			SetNextWind("S",30);

			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Clear";
			Pchar.quest.JRH_sky = "";
		
			pchar.quest.hoist_spanish_flag7.win_condition.l1 = "locator";
			pchar.quest.hoist_spanish_flag7.win_condition.l1.location = "wr_cave_shore";
			pchar.quest.hoist_spanish_flag7.win_condition.l1.locator_group = "quest";
			pchar.quest.hoist_spanish_flag7.win_condition.l1.locator = "spriggs_down";
			pchar.quest.hoist_spanish_flag7.win_condition = "hoist_spanish_flag7";
		break;

		case "hoist_spanish_flag7":
			EquipCharacterByItem(Pchar, "bladewhistle");

			PlaySound("PEOPLE\jump_roof.wav");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap24"), "wr_cave_shore", "goto", "reload5");
			LAi_SetCitizenType(CharacterFromID("pir_cap24"));
			RemoveCharacterEquip(CharacterFromID("pir_cap24"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(CharacterFromID("pir_cap24"), "bladeflag_pir");
			EquipCharacterByItem(CharacterFromID("pir_cap24"), "bladeX4");
			EquipCharacterByItem(CharacterFromID("pir_cap24"), "PiratesPistol");
		break;
	//...............................................................................................
		case "bosuns_pipe":
			if(LAi_IsFightMode(Pchar) && IsEquipCharacterByItem(Pchar, "bladewhistle"))
			{
				LAi_QuestDelay("bosuns_pipe1", 0.5);
			}
			else LAi_QuestDelay("bosuns_pipe", 0.5);
		break;

		case "bosuns_pipe1":
			//LogIt("pir caps were " + Pchar.quest.cave_shore_pirates);
			if(LAi_IsFightMode(Pchar) && IsEquipCharacterByItem(Pchar, "bladewhistle"))
			{
				if(CheckAttribute(Pchar, "quest.cave_shore_boat") && Pchar.quest.cave_shore_boat == "ground")
				{
					if(CheckAttribute(Pchar, "quest.cave_shore_pirates") && Pchar.quest.cave_shore_pirates == "staytypes")
					{
						PlaySound("OBJECTS\SHIPCHARGE\whistle_carry_on.wav");
						Logit(LanguageConvertString(tmpLangFileID,"'Carry on'"));

						if(CheckAttribute(Pchar, "quest.Winter") && Pchar.quest.Winter == "on_shore")
						{
							ChangeCharacterAddressGroup(CharacterFromID("pir_cap21"), "wr_cave_shore", "goto", "boat5D");
							LAi_SetCitizenType(CharacterFromID("pir_cap21"));
						}

						Pchar.quest.cave_shore_pirates = "citizens";
						//LogIt("pir caps are " + Pchar.quest.cave_shore_pirates);
						LAi_LockFightMode(Pchar, true);

						LAi_QuestDelay("bosuns_pipe_pc11_down", 1.0);
						LAi_QuestDelay("bosuns_pipe_pc17_down", 1.3);
						LAi_QuestDelay("bosuns_pipe_pc24_down", 1.7);
						LAi_QuestDelay("reset_bosuns_pipe", 2.7);
					}
					else
					{
						if(CheckAttribute(Pchar, "quest.cave_shore_pirates") && Pchar.quest.cave_shore_pirates == "citizens")
						{
							PlaySound("OBJECTS\SHIPCHARGE\whistle_call_mates.wav");
							Logit(LanguageConvertString(tmpLangFileID,"'Call mates'"));

							LAi_SetOfficerType(CharacterFromID("pir_cap6"));
							LAi_SetOfficerType(CharacterFromID("pir_cap10"));
							LAi_SetOfficerType(CharacterFromID("pir_cap11"));
							LAi_SetOfficerType(CharacterFromID("pir_cap17"));
							LAi_SetOfficerType(CharacterFromID("pir_cap21"));
							LAi_SetOfficerType(CharacterFromID("pir_cap24"));

							Pchar.quest.cave_shore_pirates = "officers";
							//LogIt("pir caps are " + Pchar.quest.cave_shore_pirates);
							LAi_LockFightMode(Pchar, true);

							LAi_QuestDelay("reset_bosuns_pipe", 3.5);
						}
					}
					else
					{
						if(CheckAttribute(Pchar, "quest.cave_shore_pirates") && Pchar.quest.cave_shore_pirates == "liftning")
						{
							return;
						}
					}
					else
					{
							//they are officers

							PlaySound("OBJECTS\SHIPCHARGE\whistle_carry_on.wav");
							Logit(LanguageConvertString(tmpLangFileID,"'Carry on'"));

							LAi_SetCitizenType(CharacterFromID("pir_cap6"));
							LAi_SetCitizenType(CharacterFromID("pir_cap10"));
							LAi_SetCitizenType(CharacterFromID("pir_cap11"));
							LAi_SetCitizenType(CharacterFromID("pir_cap17"));
							LAi_SetCitizenType(CharacterFromID("pir_cap21"));
							LAi_SetCitizenType(CharacterFromID("pir_cap24"));

							Pchar.quest.cave_shore_pirates = "citizens";
							//LogIt("pir caps are " + Pchar.quest.cave_shore_pirates);
							LAi_LockFightMode(Pchar, true);

							LAi_QuestDelay("reset_bosuns_pipe", 2.7);
					}
				}

				if(CheckAttribute(Pchar, "quest.cave_shore_boat") && Pchar.quest.cave_shore_boat == "chest")
				{
					if(CheckAttribute(Pchar, "quest.cave_shore_pirates") && Pchar.quest.cave_shore_pirates == "staytypes")
					{
						PlaySound("OBJECTS\SHIPCHARGE\whistle_away_boat.wav");
						Logit(LanguageConvertString(tmpLangFileID,"'Away boat'"));

						if(CheckAttribute(Pchar, "quest.Gow") && Pchar.quest.Gow == "on_shore")
						{
			   			    if(CheckAttribute(Pchar, "quest.Lowther") && Pchar.quest.Lowther == "on_shore")
			    			    {
							if(CheckAttribute(Pchar, "quest.Winter") && Pchar.quest.Winter == "on_shore")
							{
				    			    if(CheckAttribute(Pchar, "quest.Cocklyn") && Pchar.quest.Cocklyn == "on_shore")
				    			    {
								if(CheckAttribute(Pchar, "quest.Spriggs") && Pchar.quest.Spriggs == "on_shore")
								{
					    			    if(CheckAttribute(Pchar, "quest.Bunce") && Pchar.quest.Bunce == "on_shore")
					    			    {
									Pchar.quest.cave_shore_pirates = "lifting";
									//LogIt("pir caps are " + Pchar.quest.cave_shore_pirates);

									LAi_LockFightMode(Pchar, true);
									LAi_QuestDelay("bosuns_pipe_lift", 5.8);
									LAi_QuestDelay("reset_bosuns_pipe", 5.8);
					    			    }
					    			    else
					    			    {
									LAi_QuestDelay("red_chest_too_heavy", 5.0);//was 1.0
					    			    }
								}
								else
								{
					    			    LAi_QuestDelay("red_chest_too_heavy", 5.0);
								}
				    			    }
				    			    else
				    			    {
								LAi_QuestDelay("red_chest_too_heavy", 5.0);
				    			    }
							}
							else
							{
				    			    LAi_QuestDelay("red_chest_too_heavy", 5.0);
							}
			    			    }
			    			    else
			    			    {
							LAi_QuestDelay("red_chest_too_heavy", 5.0);
			    			    }
						}
						else
						{
			    			    LAi_QuestDelay("red_chest_too_heavy", 5.0);
						}
					}
					else
					{
						if(CheckAttribute(Pchar, "quest.cave_shore_pirates") && Pchar.quest.cave_shore_pirates == "actors")
						{
							PlaySound("OBJECTS\SHIPCHARGE\whistle_the_side.wav");
							Logit(LanguageConvertString(tmpLangFileID,"'The side'"));

							if(CheckAttribute(Pchar, "quest.Cocklyn") && Pchar.quest.Cocklyn == "on_shore")
							{
								ChangeCharacterAddressGroup(CharacterFromID("pir_cap6"), "wr_cave_shore", "goto", "boat1");
							}
							if(CheckAttribute(Pchar, "quest.Bunce") && Pchar.quest.Bunce == "on_shore")
							{
								ChangeCharacterAddressGroup(CharacterFromID("pir_cap10"), "wr_cave_shore", "goto", "boat2");
							}
							if(CheckAttribute(Pchar, "quest.Winter") && Pchar.quest.Winter == "on_shore")
							{
								ChangeCharacterAddressGroup(CharacterFromID("pir_cap21"), "wr_cave_shore", "goto", "boat5");
							}

							LAi_SetStayType(characterFromID("pir_cap6"));
							LAi_SetStayType(characterFromID("pir_cap10"));
							LAi_SetStayType(characterFromID("pir_cap21"));

							Pchar.quest.cave_shore_pirates = "staytypes";
							//LogIt("pir caps are " + Pchar.quest.cave_shore_pirates);
							LAi_LockFightMode(Pchar, true);

							LAi_QuestDelay("bosuns_pipe_pc11_up", 1.5);
							LAi_QuestDelay("bosuns_pipe_pc17_up", 1.0);
							LAi_QuestDelay("bosuns_pipe_pc24_up", 1.2);
							LAi_QuestDelay("reset_bosuns_pipe", 5.2);
						}
					}
					else
					{
						if(CheckAttribute(Pchar, "quest.cave_shore_pirates") && Pchar.quest.cave_shore_pirates == "citizens")
						{
							PlaySound("OBJECTS\SHIPCHARGE\whistle_call_mates.wav");
							Logit(LanguageConvertString(tmpLangFileID,"'Call mates'"));

							LAi_SetActorType(CharacterFromID("pir_cap6"));
							LAi_SetActorType(CharacterFromID("pir_cap10"));
							LAi_SetActorType(CharacterFromID("pir_cap11"));
							LAi_SetActorType(CharacterFromID("pir_cap17"));
							LAi_SetActorType(CharacterFromID("pir_cap21"));
							LAi_SetActorType(CharacterFromID("pir_cap24"));

							LAi_ActorGoToLocator(CharacterFromID("pir_cap6"), "goto", "boat7D", "", "");
							LAi_ActorGoToLocator(CharacterFromID("pir_cap10"), "goto", "boat7D", "", "");
							LAi_ActorGoToLocator(CharacterFromID("pir_cap11"), "goto", "boat7D", "", "");
							LAi_ActorGoToLocator(CharacterFromID("pir_cap17"), "goto", "boat7D", "", "");
							LAi_ActorGoToLocator(CharacterFromID("pir_cap21"), "goto", "boat7D", "", "");
							LAi_ActorGoToLocator(CharacterFromID("pir_cap24"), "goto", "boat7D", "", "");

							Pchar.quest.cave_shore_pirates = "actors";
							//LogIt("pir caps are " + Pchar.quest.cave_shore_pirates);
							LAi_LockFightMode(Pchar, true);

							LAi_QuestDelay("reset_bosuns_pipe", 3.5);
						}
					}
					else
					{
						if(CheckAttribute(Pchar, "quest.cave_shore_pirates") && Pchar.quest.cave_shore_pirates == "liftning")
						{
							return;
						}
					}
					else
					{
							//they are officers

							PlaySound("OBJECTS\SHIPCHARGE\whistle_the_side.wav");
							Logit(LanguageConvertString(tmpLangFileID,"'The side'"));

							if(CheckAttribute(Pchar, "quest.Cocklyn") && Pchar.quest.Cocklyn == "on_shore")
							{
								ChangeCharacterAddressGroup(CharacterFromID("pir_cap6"), "wr_cave_shore", "goto", "boat1");
							}
							if(CheckAttribute(Pchar, "quest.Bunce") && Pchar.quest.Bunce == "on_shore")
							{
								ChangeCharacterAddressGroup(CharacterFromID("pir_cap10"), "wr_cave_shore", "goto", "boat2");
							}
							if(CheckAttribute(Pchar, "quest.Winter") && Pchar.quest.Winter == "on_shore")
							{
								ChangeCharacterAddressGroup(CharacterFromID("pir_cap21"), "wr_cave_shore", "goto", "boat5");
							}

							LAi_SetStayType(characterFromID("pir_cap6"));
							LAi_SetStayType(characterFromID("pir_cap10"));
							LAi_SetStayType(characterFromID("pir_cap21"));

							Pchar.quest.cave_shore_pirates = "staytypes";
							//LogIt("pir caps are " + Pchar.quest.cave_shore_pirates);
							LAi_LockFightMode(Pchar, true);

							LAi_QuestDelay("bosuns_pipe_pc11_up", 1.5);
							LAi_QuestDelay("bosuns_pipe_pc17_up", 1.7);
							LAi_QuestDelay("bosuns_pipe_pc24_up", 1.0);
							LAi_QuestDelay("reset_bosuns_pipe", 5.2);
					}
				}
			}
		break;

		case "reset_bosuns_pipe":
			LAi_LockFightMode(Pchar, false);
			LAi_SetFightMode(Pchar, false);

			LAi_QuestDelay("bosuns_pipe", 0.5);
		break;

		case "bosuns_pipe_pc11_up":
			if(CheckAttribute(Pchar, "quest.Gow") && Pchar.quest.Gow == "on_shore")
			{
				PlaySound("PEOPLE\step_stone.wav");
				ChangeCharacterAddressGroup(CharacterFromID("pir_cap11"), "wr_cave_shore", "goto", "boat3");
				LAi_SetStayType(characterFromID("pir_cap11"));
			}
		break;

		case "bosuns_pipe_pc17_up":
			if(CheckAttribute(Pchar, "quest.Lowther") && Pchar.quest.Lowther == "on_shore")
			{
				PlaySound("PEOPLE\step_stone1.wav");
				ChangeCharacterAddressGroup(CharacterFromID("pir_cap17"), "wr_cave_shore", "goto", "boat4");
				LAi_SetStayType(characterFromID("pir_cap17"));
			}
		break;

		case "bosuns_pipe_pc24_up":
			if(CheckAttribute(Pchar, "quest.Spriggs") && Pchar.quest.Spriggs == "on_shore")
			{
				PlaySound("PEOPLE\step_stone2.wav");
				ChangeCharacterAddressGroup(CharacterFromID("pir_cap24"), "wr_cave_shore", "goto", "boat6");
				LAi_SetStayType(characterFromID("pir_cap24"));
			}
		break;

		case "bosuns_pipe_pc11_down":
			if(CheckAttribute(Pchar, "quest.Gow") && Pchar.quest.Gow == "on_shore")
			{
				PlaySound("PEOPLE\step_ground2.wav");
				ChangeCharacterAddressGroup(CharacterFromID("pir_cap11"), "wr_cave_shore", "goto", "boat3D");
				LAi_SetCitizenType(characterFromID("pir_cap11"));
			}
		break;

		case "bosuns_pipe_pc17_down":
			if(CheckAttribute(Pchar, "quest.Lowther") && Pchar.quest.Lowther == "on_shore")
			{
				PlaySound("PEOPLE\step_ground.wav");
				ChangeCharacterAddressGroup(CharacterFromID("pir_cap17"), "wr_cave_shore", "goto", "boat4D");
				LAi_SetCitizenType(characterFromID("pir_cap17"));
			}
			if(CheckAttribute(Pchar, "quest.Bunce") && Pchar.quest.Bunce == "on_shore")
			{
				LAi_SetCitizenType(CharacterFromID("pir_cap10"));
			}
		break;

		case "bosuns_pipe_pc24_down":
			if(CheckAttribute(Pchar, "quest.Spriggs") && Pchar.quest.Spriggs == "on_shore")
			{
				PlaySound("PEOPLE\step_ground1.wav");
				ChangeCharacterAddressGroup(CharacterFromID("pir_cap24"), "wr_cave_shore", "goto", "boat6D");
				LAi_SetCitizenType(characterFromID("pir_cap24"));
			}
			if(CheckAttribute(Pchar, "quest.Cocklyn") && Pchar.quest.Cocklyn == "on_shore")
			{
				LAi_SetCitizenType(CharacterFromID("pir_cap6"));
			}
		break;

		case "bosuns_pipe_lift":
			PlaySound("OBJECTS\DUEL\man_attack1.wav");

			LAi_SetPlayerType(CharacterFromID("pir_cap6"));
			LAi_SetPlayerType(CharacterFromID("pir_cap10"));
			LAi_SetPlayerType(CharacterFromID("pir_cap11"));
			LAi_SetPlayerType(CharacterFromID("pir_cap17"));
			LAi_SetPlayerType(CharacterFromID("pir_cap21"));
			LAi_SetPlayerType(CharacterFromID("pir_cap24"));

			LAi_SetFightMode(CharacterFromID("pir_cap6"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap10"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap11"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap17"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap21"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap24"), true);

			LAi_QuestDelay("bosuns_pipe_lift_ready", 1.0);
		break;

		case "bosuns_pipe_lift_ready":
			Pchar.quest.cave_shore_red_chest = "free";
		break;

		case "red_chest_too_heavy":
			PlaySound("VOICE\ENGLISH\blaze_hah.wav");
			Logit(LanguageConvertString(tmpLangFileID,"No idea Captain - this boat is far too heavy!!"));

			LAi_QuestDelay("reset_bosuns_pipe", 0.1);
		break;

		case "equip_redchest_caveshore":
			if(Locations[FindLocation(Pchar.location)].models.always.locators == "Shore04_l_JRH3")
			Locations[FindLocation(Pchar.location)].models.always.locators = "Shore04_l_JRH4";

			if(Locations[FindLocation(Pchar.location)].models.always.locators == "Shore04_l_JRH3F")
			Locations[FindLocation(Pchar.location)].models.always.locators = "Shore04_l_JRH4F";

			locations[FindLocation("wr_cave_shore")].image = "";
			DoQuestReloadToLocation("wr_cave_shore", "goto", "boat7", "equip_redchest_caveshore1");
		break;

		case "equip_redchest_caveshore1":
			locations[FindLocation("wr_wood_tower3")].image = "wr_wood_tower3.tga";
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("blast_dirt" , 5.4, 3.6, -10.5, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("PEOPLE\wood3.wav");

			Locations[FindLocation("wr_cavern")].models.always.locators = "cavern_l_JRH_place_chest";
			Locations[FindLocation("wr_cavern")].locators_radius.box.box4 = 1.0;

			LAi_QuestDelay("equip_redchest_caveshore2", 2.0);
		break;

		case "equip_redchest_caveshore2":
			curExp = sti(Pchar.Experience);
			nextExp = CalculateExperienceFromRank(sti(Pchar.rank)+1);
			addExp = nextExp-curExp;
			AddCharacterExpNS(Pchar, addExp);
			int COM = CalcCharacterSkill(Pchar, "Commerce");
			Pchar.skill.Commerce = COM + 1;

			ChangeCharacterAddressGroup(Pchar, "wr_cave_shore", "goto", "boat7D");
			Pchar.quest.cave_shore_boat = "ground";
			PlaySound("PEOPLE\step_ground1.wav");
			PlaySound("PEOPLE\step_ground1.wav");

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap21"), "wr_cave_shore", "goto", "boat5D");
			LAi_SetCitizenType(CharacterFromID("pir_cap21"));

			Pchar.quest.cave_shore_pirates = "citizens";

			LAi_QuestDelay("bosuns_pipe_pc11_down", 1.0);
			LAi_QuestDelay("bosuns_pipe_pc17_down", 1.3);
			LAi_QuestDelay("bosuns_pipe_pc24_down", 1.7);
			LAi_QuestDelay("reset_bosuns_pipe", 2.7);
			LAi_QuestDelay("equip_redchest_caveshore3", 2.0);
		break;

		case "equip_redchest_caveshore3":
			PlayStereoSound("Ambient\SEASHORE\fanfare.wav");
			Pchar.quest.Gow = "";
			Pchar.quest.Lowther = "";
			Pchar.quest.Winter = "";
			Pchar.quest.Cocklyn = "";
			Pchar.quest.Spriggs = "";
			Pchar.quest.Bunce = "";
		break;
	//...............................................................................................
	//[17] from here

		case "ready_for_Vane_ladder":
			LAi_SetPlayerType(Pchar);

			DoQuestReloadToLocation("wr_cavern", "reload", "reload3", "Vane_ladder");
		break;

		case "Vane_ladder":
			LAi_SetPlayerType(Pchar);
			Pchar.quest.Vane_ladder = "not_started";
			Pchar.quest.crew_to_ships = "closed";

			Locations[FindLocation("wr_church_outside")].locators_radius.goto.citizen01 = 6.0;
			Locations[FindLocation("wr_church_outside")].models.always.locators = "Pirl_l_JRH_outside_rum";
			Locations[FindLocation("wr_church_inside")].reload.l8.disable = 1;		//to chapel_stairs
			Locations[FindLocation("wr_church_inside")].reload.l2.disable = 0;		//to sacristy
			Locations[FindLocation("wr_sacristy")].reload.l3.disable = 1;			//to between
			Locations[FindLocation("wr_church_attic_stairs")].reload.l2.emerge = "reload4"; //to attic

			Locations[FindLocation("wr_mine")].reload.l2.disable = 0;			//to LS cellar

			ChangeCharacterAddressGroup(characterFromID("pir_cap1"), "wr_church_outside", "goto", "citizen01");
			LAi_SetStayType(CharacterFromID("pir_cap1"));

			ChangeCharacterAddressGroup(CharacterFromID("pir_cap2"), "wr_church_outside", "goto", "citizen02");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap3"), "wr_church_outside", "goto", "citizen03");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap4"), "wr_church_outside", "goto", "citizen06");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap5"), "wr_church_outside", "goto", "citizen05");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap8"), "wr_church_outside", "goto", "locator3");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap9"), "wr_church_outside", "goto", "locator4");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap15"), "wr_church_outside", "goto", "locator10");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap18"), "wr_church_outside", "goto", "citizen08");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap20"), "wr_church_outside", "officers", "reload1_1");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap23"), "wr_church_outside", "goto", "locator7");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap26"), "wr_church_outside", "goto", "goto9");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap27"), "wr_church_outside", "goto", "goto16");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap28"), "wr_church_outside", "goto", "goto17");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap29"), "wr_church_outside", "goto", "goto12");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap30"), "wr_church_outside", "goto", "goto13");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap31"), "wr_church_outside", "goto", "goto14");
			ChangeCharacterAddressGroup(CharacterFromID("pir_cap32"), "wr_church_outside", "goto", "goto15");
			LAi_SetCitizenType(CharacterFromID("pir_cap2"));
			LAi_SetCitizenType(CharacterFromID("pir_cap3"));
			LAi_SetCitizenType(CharacterFromID("pir_cap4"));
			LAi_SetCitizenType(CharacterFromID("pir_cap5"));
			LAi_SetCitizenType(CharacterFromID("pir_cap8"));
			LAi_SetCitizenType(CharacterFromID("pir_cap9"));
			LAi_SetCitizenType(CharacterFromID("pir_cap15"));
			LAi_SetCitizenType(CharacterFromID("pir_cap18"));
			LAi_SetCitizenType(CharacterFromID("pir_cap20"));
			LAi_SetCitizenType(CharacterFromID("pir_cap23"));
			LAi_SetCitizenType(CharacterFromID("pir_cap26"));
			LAi_SetCitizenType(CharacterFromID("pir_cap27"));
			LAi_SetCitizenType(CharacterFromID("pir_cap28"));
			LAi_SetCitizenType(CharacterFromID("pir_cap29"));
			LAi_SetCitizenType(CharacterFromID("pir_cap30"));
			LAi_SetCitizenType(CharacterFromID("pir_cap31"));
			LAi_SetCitizenType(CharacterFromID("pir_cap32"));

			//Roberts group
			ChangeCharacterAddressGroup(characterFromID("pir_cap16"), "wr_church_outside", "goto", "citizen02");
			ChangeCharacterAddressGroup(characterFromID("pir_cap7"), "wr_church_outside", "goto", "citizen04");
			ChangeCharacterAddressGroup(characterFromID("pir_cap14"), "wr_church_outside", "goto", "goto6");
			ChangeCharacterAddressGroup(characterFromID("pir_cap22"), "wr_church_outside", "goto", "locator8");
			LAi_SetStayType(CharacterFromID("pir_cap16"));
			LAi_SetStayType(CharacterFromID("pir_cap7"));
			LAi_SetStayType(CharacterFromID("pir_cap14"));
			LAi_SetStayType(CharacterFromID("pir_cap22"));

			SetModel(characterFromID("pir_cap1"), "pir_cap1_redC_MD", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap8"), "pir_cap8_red_MD", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap16"), "pir_cap16_red_MD", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap18"), "pir_cap18_red_MD", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap23"), "pir_cap23_red_MD", "man", "man", 1.8, false);

			SetModel(characterFromID("pir_cap2"), "Animists1_MD2", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap3"), "Animists1_MD2", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap4"), "Animists1_M_black", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap5"), "Animists1_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap7"), "Animists1_MD1", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap9"), "Animists1_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap14"), "Animists1_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap15"), "Animists1_MD1", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap20"), "Animists1_MD1", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap22"), "Animists1_MD2", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap26"), "Animists1_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap27"), "Animists1_MD2", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap28"), "Animists1_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap29"), "Animists1_MD1", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap30"), "Animists1_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap31"), "Animists1_MD2", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap32"), "Animists1_MD1", "man", "man", 1.8, false);

			RemoveCharacterEquip(CharacterFromID("pir_cap8"), BLADE_ITEM_TYPE);
			GiveItem2Character(CharacterFromID("pir_cap8"), "bladereliquary");
			EquipCharacterbyItem(CharacterFromID("pir_cap8"), "bladereliquary");

			RemoveCharacterEquip(CharacterFromID("pir_cap16"), BLADE_ITEM_TYPE);
			GiveItem2Character(CharacterFromID("pir_cap16"), "bladecenser");
			EquipCharacterbyItem(CharacterFromID("pir_cap16"), "bladecenser");

			RemoveCharacterEquip(CharacterFromID("pir_cap18"), BLADE_ITEM_TYPE);
			GiveItem2Character(CharacterFromID("pir_cap18"), "bladecandelabre");
			EquipCharacterbyItem(CharacterFromID("pir_cap18"), "bladecandelabre");

			RemoveCharacterEquip(CharacterFromID("pir_cap23"), BLADE_ITEM_TYPE);
			GiveItem2Character(CharacterFromID("pir_cap23"), "bladechalice");
			EquipCharacterbyItem(CharacterFromID("pir_cap23"), "bladechalice");

			pchar.quest.close_qbook_shore.win_condition.l1 = "location";
			pchar.quest.close_qbook_shore.win_condition.l1.location = "wr_church_outside";
			pchar.quest.close_qbook_shore.win_condition = "close_qbook_shore";
		break;

		case "close_qbook_shore":
			CloseQuestHeader("Cave_shore");

			pchar.quest.Vane_ladder1.win_condition.l1 = "locator";
			pchar.quest.Vane_ladder1.win_condition.l1.location = "wr_church_outside";
			pchar.quest.Vane_ladder1.win_condition.l1.locator_group = "goto";
			pchar.quest.Vane_ladder1.win_condition.l1.locator = "citizen01";
			pchar.quest.Vane_ladder1.win_condition = "Vane_ladder1";
		break;

		case "Vane_ladder1":
			LAi_SetStayType(Pchar);
			LAi_SetOfficerType(CharacterFromID("pir_cap1"));

			LAi_QuestDelay("Vane_ladder2", 2.0);
			LAi_QuestDelay("Vane_ladder2_just_in_case", 3.0);
			LAi_QuestDelay("Vane_ladder2_just_in_case", 4.0);

			pchar.quest.no_coins_collectionbox.win_condition.l1 = "location";
			pchar.quest.no_coins_collectionbox.win_condition.l1.location = "wr_church_inside";
			pchar.quest.no_coins_collectionbox.win_condition = "no_coins_collectionbox";
		break;

		case "no_coins_collectionbox":
			locations[FindLocation(Pchar.location)].box1.items.coin2 = 0;
			locations[FindLocation(Pchar.location)].box1.items.coin3 = 0;
			locations[FindLocation(Pchar.location)].box1.items.coin6 = 0;
			locations[FindLocation(Pchar.location)].box1.items.coin7 = 0;
			locations[FindLocation(Pchar.location)].box1.items.coin10 = 0;
			locations[FindLocation(Pchar.location)].box1.items.coin12 = 0;
			locations[FindLocation(Pchar.location)].box1.items.coin15 = 0;
		break;

		case "Vane_ladder2_just_in_case":
			if(CheckAttribute(Pchar, "quest.Vane_ladder") && Pchar.quest.Vane_ladder == "not_started")
			{
				LAi_QuestDelay("Vane_ladder2", 0.01);
			}
		break;

		case "Vane_ladder2":
			if(IsEquipCharacterByItem(Pchar, "blademegaphone") || IsEquipCharacterByItem(Pchar, "bladespyglass5"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladeanchor");
			}
			TakeItemFromCharacter(Pchar, "blademegaphone"); TakeItemFromCharacter(Pchar, "bladespyglass5");

			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "blue_cavern_open";
		break;

		case "pir_caps_hurrah":
			PlaySound("OBJECTS\SHIPCHARGE\hurrah.wav");
		break;

		case "Vane_ladder3":
			//from Vane dialog
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("pir_cap1"));

			PlaySound("OBJECTS\SHIPCHARGE\gunner_fire.wav");

			LAi_SetOfficerType(CharacterFromID("pir_cap2"));
			LAi_SetOfficerType(CharacterFromID("pir_cap3"));
			LAi_SetOfficerType(CharacterFromID("pir_cap4"));
			LAi_SetOfficerType(CharacterFromID("pir_cap5"));
			LAi_SetOfficerType(CharacterFromID("pir_cap7"));
			LAi_SetOfficerType(CharacterFromID("pir_cap8"));
			LAi_SetOfficerType(CharacterFromID("pir_cap9"));
			LAi_SetOfficerType(CharacterFromID("pir_cap14"));
			LAi_SetOfficerType(CharacterFromID("pir_cap15"));
			LAi_SetOfficerType(CharacterFromID("pir_cap16"));
			LAi_SetOfficerType(CharacterFromID("pir_cap18"));
			LAi_SetOfficerType(CharacterFromID("pir_cap20"));
			LAi_SetOfficerType(CharacterFromID("pir_cap22"));
			LAi_SetOfficerType(CharacterFromID("pir_cap23"));
			LAi_SetOfficerType(CharacterFromID("pir_cap26"));
			LAi_SetOfficerType(CharacterFromID("pir_cap27"));
			LAi_SetOfficerType(CharacterFromID("pir_cap28"));
			LAi_SetOfficerType(CharacterFromID("pir_cap29"));
			LAi_SetOfficerType(CharacterFromID("pir_cap30"));
			LAi_SetOfficerType(CharacterFromID("pir_cap31"));
			LAi_SetOfficerType(CharacterFromID("pir_cap32"));

			LAi_QuestDelay("Vane_ladder4", 2.0);
		break;

		case "Vane_ladder4":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "different_tasks";
		break;

		case "Vane_ladder5":
			//from Vane dialog
			LAi_SetActorType(CharacterFromID("pir_cap16"));
			LAi_ActorGoToLocator(CharacterFromID("pir_cap16"), "reload", "reload2", "", "");
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("pir_cap16"));

			LAi_QuestDelay("Vane_ladder7", 2.0);
			LAi_QuestDelay("Vane_ladder6", 5.0);
		break;

		case "Vane_ladder6":
			ChangeCharacterAddressGroup(characterFromID("pir_cap16"), "none", "", "");
		break;

		case "Vane_ladder7":
			PlaySound("VOICE\ENGLISH\pir_capEE.wav");

			LAi_QuestDelay("Vane_ladder8", 2.0);
		break;

		case "Vane_ladder8":
			LAi_SetActorType(CharacterFromID("pir_cap7"));
			LAi_ActorGoToLocator(CharacterFromID("pir_cap7"), "reload", "reload2", "", "");
			LAi_SetActorType(CharacterFromID("pir_cap14"));
			LAi_ActorGoToLocator(CharacterFromID("pir_cap14"), "reload", "reload2", "", "");
			LAi_SetActorType(CharacterFromID("pir_cap22"));
			LAi_ActorGoToLocator(CharacterFromID("pir_cap22"), "reload", "reload2", "", "");
			PlaySound("VOICE\ENGLISH\pir_capT.wav");

			LAi_QuestDelay("Vane_ladder10", 4.5);
			LAi_QuestDelay("Vane_ladder9", 5.0);
		break;

		case "Vane_ladder9":
			ChangeCharacterAddressGroup(characterFromID("pir_cap7"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap14"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap22"), "none", "", "");
		break;

		case "Vane_ladder10":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "to_the_cavern";
		break;

		case "Vane_ladder11":
			//from Vane dialog
			Locations[FindLocation("wr_dungeon4_low")].environment.weather = "true";
			Locations[FindLocation("wr_dungeon3_right")].environment.weather = "true";
			Locations[FindLocation("wr_friday")].environment.weather = "true";

			LAi_SetOfficerType(CharacterFromID("pir_cap1"));

			LAi_SetCitizenType(CharacterFromID("pir_cap2"));
			LAi_SetCitizenType(CharacterFromID("pir_cap3"));
			LAi_SetCitizenType(CharacterFromID("pir_cap4"));
			LAi_SetCitizenType(CharacterFromID("pir_cap5"));
			LAi_SetCitizenType(CharacterFromID("pir_cap8"));
			LAi_SetCitizenType(CharacterFromID("pir_cap15"));
			LAi_SetCitizenType(CharacterFromID("pir_cap20"));
			LAi_SetCitizenType(CharacterFromID("pir_cap23"));
			LAi_SetCitizenType(CharacterFromID("pir_cap26"));
			LAi_SetCitizenType(CharacterFromID("pir_cap27"));
			LAi_SetCitizenType(CharacterFromID("pir_cap29"));
			LAi_SetCitizenType(CharacterFromID("pir_cap30"));
			LAi_SetCitizenType(CharacterFromID("pir_cap31"));

			LAi_SetPlayerType(Pchar);
			SetQuestHeader("Revenge");
			AddQuestRecord("Revenge", "1");
			DeleteQuestHeader("Cave_shore");

			pchar.quest.Vane_ladder12.win_condition.l1 = "locator";
			pchar.quest.Vane_ladder12.win_condition.l1.location = "wr_cavern";
			pchar.quest.Vane_ladder12.win_condition.l1.locator_group = "goto";
			pchar.quest.Vane_ladder12.win_condition.l1.locator = "water";
			pchar.quest.Vane_ladder12.win_condition = "Vane_ladder12";
		break;

		case "Vane_ladder12":
			LAi_SetStayType(Pchar);

			ChangeCharacterAddressGroup(characterFromID("pir_cap1"), "wr_cavern", "goto", "monk1");//Vane
			ChangeCharacterAddressGroup(characterFromID("pir_cap18"), "wr_cavern", "goto", "monk2");//Rackham
			ChangeCharacterAddressGroup(characterFromID("pir_cap9"), "wr_cavern", "goto", "monk3");//Low
			ChangeCharacterAddressGroup(characterFromID("pir_cap32"), "wr_cavern", "goto", "monk3");//Exquemelin
			ChangeCharacterAddressGroup(characterFromID("pir_cap28"), "wr_cavern", "goto", "goto2");//Wynn

			LAi_QuestDelay("Vane_ladder13", 2.0);
		break;

		case "Vane_ladder13":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "need_ladder";
		break;

		case "Vane_ladder14":
			//from Vane dialog
			PlaySound("OBJECTS\SHIPCHARGE\gunner_fire.wav");

			RemoveCharacterEquip(CharacterFromID("pir_cap10"), BLADE_ITEM_TYPE);
			GiveItem2Character(CharacterFromID("pir_cap10"), "bladeladder2");
			EquipCharacterbyItem(CharacterFromID("pir_cap10"), "bladeladder2");

			LAi_SetOfficerType(CharacterFromID("pir_cap10"));
			LAi_SetOfficerType(CharacterFromID("pir_cap21"));
			LAi_SetOfficerType(CharacterFromID("pir_cap24"));
			LAi_SetOfficerType(CharacterFromID("pir_cap11"));
			LAi_SetOfficerType(CharacterFromID("pir_cap6"));
			LAi_SetOfficerType(CharacterFromID("pir_cap17"));

			ChangeCharacterAddressGroup(characterFromID("pir_cap10"), "wr_cavern", "goto", "shore1");//Bunce
			ChangeCharacterAddressGroup(characterFromID("pir_cap21"), "wr_cavern", "goto", "shore3");//Winter
			ChangeCharacterAddressGroup(characterFromID("pir_cap24"), "wr_cavern", "goto", "shore4");//Spriggs
			ChangeCharacterAddressGroup(characterFromID("pir_cap11"), "wr_cavern", "goto", "shore5");//Gow
			ChangeCharacterAddressGroup(characterFromID("pir_cap6"), "wr_cavern", "goto", "goto3");//Cocklyn
			ChangeCharacterAddressGroup(characterFromID("pir_cap17"), "wr_cavern", "reload", "reload2");//Lowther

			LAi_QuestDelay("Vane_ladder15", 6.0);
		break;

		case "Vane_ladder15":
			PlaySound("VOICE\ENGLISH\pir_capF.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("pir_cap10"));

			LAi_QuestDelay("Vane_ladder16", 3.0);
		break;

		case "Vane_ladder16":
			PlaySound("VOICE\ENGLISH\pir_capCC.wav");
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("pir_cap18"));

			LAi_QuestDelay("Vane_ladder17", 2.5);
		break;

		case "Vane_ladder17":
			PlaySound("VOICE\ENGLISH\pir_capFFF.wav");
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("pir_cap21"));

			LAi_QuestDelay("Vane_ladder18", 2.0);
		break;

		case "Vane_ladder18":
			PlaySound("VOICE\ENGLISH\pir_capQ.wav");
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("pir_cap9"));

			LAi_QuestDelay("Vane_ladder19", 3.5);
		break;

		case "Vane_ladder19":
			PlaySound("VOICE\ENGLISH\pir_capI.wav");
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("pir_cap24"));

			LAi_QuestDelay("Vane_ladder20", 3.0);
		break;

		case "Vane_ladder20":
			PlaySound("VOICE\ENGLISH\Fre_m_a_010.wav");
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("pir_cap32"));

			LAi_QuestDelay("Vane_ladder21", 5.0);
		break;

		case "Vane_ladder21":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "new_outfits";
		break;

		case "Vane_ladder22":
			//from Vane dialog
			SetModel(characterFromID("pir_cap10"), "Animists1_M", "man", "man", 1.8, false);
			PlaySound("PEOPLE\clothes1.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "water");

			LAi_QuestDelay("Vane_ladder23", 2.0);
		break;

		case "Vane_ladder23":
			SetModel(characterFromID("pir_cap21"), "Animists1_M", "man", "man", 1.8, false);
			PlaySound("PEOPLE\clothes2.wav");

			LAi_QuestDelay("Vane_ladder24", 1.0);
		break;

		case "Vane_ladder24":
			SetModel(characterFromID("pir_cap11"), "Animists1_M", "man", "man", 1.8, false);
			PlaySound("PEOPLE\clothes1.wav");

			LAi_QuestDelay("Vane_ladder25", 0.5);
		break;

		case "Vane_ladder25":
			SetModel(characterFromID("pir_cap6"), "Animists1_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap17"), "Animists1_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap24"), "Animists1_M", "man", "man", 1.8, false);
			PlaySound("PEOPLE\clothes2.wav");

			LAi_QuestDelay("Vane_ladder26", 1.0);
		break;

		case "Vane_ladder26":
			PlaySound("VOICE\ENGLISH\Fre_m_c_036.wav");

			LAi_QuestDelay("Vane_ladder27", 5.0);
		break;

		case "Vane_ladder27":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "leave_ladder";
		break;

		case "Vane_ladder28":
			//from Vane dialog
			PlaySound("OBJECTS\SHIPCHARGE\hurrah.wav");

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload3");
			LAi_SetOfficerType(CharacterFromID("pir_cap1"));

			LAi_SetActorType(CharacterFromID("pir_cap21"));
			LAi_SetActorType(CharacterFromID("pir_cap24"));
			LAi_SetActorType(CharacterFromID("pir_cap11"));
			LAi_SetActorType(CharacterFromID("pir_cap6"));
			LAi_SetActorType(CharacterFromID("pir_cap17"));

			LAi_ActorRunToLocator(characterFromID("pir_cap17"), "reload", "reload2", "", "");
			LAi_ActorRunToLocator(characterFromID("pir_cap21"), "reload", "reload2", "", "");

			LAi_QuestDelay("Vane_ladder29", 1.0);
		break;

		case "Vane_ladder29":
			LAi_ActorRunToLocator(characterFromID("pir_cap6"), "reload", "reload2", "", "");
			LAi_ActorRunToLocator(characterFromID("pir_cap24"), "reload", "reload2", "", "");

			LAi_QuestDelay("Vane_ladder30", 1.0);
		break;

		case "Vane_ladder30":
			LAi_QuestDelay("Vane_ladder32", 2.0);

			LAi_ActorRunToLocator(characterFromID("pir_cap11"), "reload", "reload2", "Vane_ladder31", 5.0);
		break;

		case "Vane_ladder31":
			ChangeCharacterAddressGroup(characterFromID("pir_cap21"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap11"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap24"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap6"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap17"), "none", "", "");
		break;

		case "Vane_ladder32":
			LAi_SetActorType(CharacterFromID("pir_cap10"));
			LAi_ActorGoToLocator(CharacterFromID("pir_cap10"), "goto", "water", "Vane_ladder32A", 4.0);//was 33
		break;

		case "Vane_ladder32A":
			LAi_SetPlayerType(CharacterFromID("pir_cap10"));
			LAi_SetFightMode(CharacterFromID("pir_cap10"), true);

			LAi_QuestDelay("Vane_ladder33", 1.0);
		break;

		case "Vane_ladder33":
			ChangeCharacterAddressGroup(characterFromID("pir_cap10"), "wr_cavern", "goto", "water");

			RemoveCharacterEquip(CharacterFromID("pir_cap10"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(CharacterFromID("pir_cap10"), "bladeladder2");
			EquipCharacterbyItem(CharacterFromID("pir_cap10"), "blade6");

			Locations[FindLocation("wr_cavern")].models.always.l3 = "ladder_very_big";
			Locations[FindLocation("wr_cavern")].locators_radius.reload.reload3 = 0.7;

			locations[FindLocation("Redmond_Town_01")].type = "silent_town";

			Locations[FindLocation("wr_cavern")].image = "";
			DoQuestReloadToLocation("wr_cavern", "goto", "water", "Vane_ladder34");
		break;

		case "Vane_ladder34":
			Locations[FindLocation("wr_cavern")].image = "wr_cavern.tga";
			PlaySound("PEOPLE\wood1.wav");
			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("wr_dungeon4_low")].locators_radius.reload.reload3 = 1.5;
			Locations[FindLocation("wr_dungeon4_low")].models.always.l1 = "rock3";

			//lights
			Locations[FindLocation("wr_mine")].models.always.locators = "mine_l_JRH2";
			Locations[FindLocation("wr_dungeon4_main")].models.always.locators = "d04_l_JRH_OFF1";
			Locations[FindLocation("wr_dungeon3_right")].models.always.locators = "d03_l_JRH_R2";
			Locations[FindLocation("wr_dungeon3_right")].reload.l6.emerge = "goto5";
			Locations[FindLocation("wr_dungeon3_right")].reload.l1.disable = 1;	//to cell
			Locations[FindLocation("wr_dungeon3_left")].models.always.locators = "d03_l_JRH_L2";

			Locations[FindLocation("wr_mine")].environment.weather = "false";
			Locations[FindLocation("wr_mine")].environment.sea = "false";
			//Locations[FindLocation("wr_mine")].reload.l2.disable = 1;		//to LS cellar
			Locations[FindLocation("wr_mine")].reload.l3.disable = 1;		//to guard room
			Locations[FindLocation("wr_mine")].reload.l6.disable = 0;		//arrive tunnel
			locations[FindLocation("wr_mine")].id.label = "Port Royal old mine";

			ChangeCharacterAddressGroup(CharacterFromID("wr_boc5"), "none", "", "");//bsw away from food supply, if not earlier
			Locations[FindLocation("wr_food_supply")].reload.l4.disable = 0;	//'fence'
			locations[FindLocation("wr_food_supply")].id.label = "Woodes Rogers' food cellar";

			locations[FindLocation("wr_wine_cellar")].id.label = "Roger's wine cellar";

			Locations[FindLocation("wr_kitchen")].reload.l2.disable = 1;			//to wr bedroom
			Locations[FindLocation("wr_kitchen")].reload.l3.disable = 0;			//to food_supply
			Locations[FindLocation("wr_kitchen")].reload.l5.disable = 1;			//to CK bedroom
			Locations[FindLocation("wr_kitchen")].reload.l6.disable = 0;			//to crew_tavern
			ChangeCharacterAddressGroup(CharacterFromID("wr_prt7"), "none", "", "");	//in kitchen
			ChangeCharacterAddressGroup(CharacterFromID("wr_cor1_3"), "none", "", "");	//in kitchen
			Pchar.quest.wr_kitchendoor = "stuck";
			locations[FindLocation("wr_kitchen")].id.label = "Woodes Rogers' kitchen";

			Locations[FindLocation("wr_crew")].reload.l5.disable = 1;			//to town
			locations[FindLocation("wr_crew")].id.label = "Crew's quarter";
			locations[FindLocation("wr_crew")].type = "Rogers_cellar";				//empty tavern
			ChangeCharacterAddressGroup(CharacterFromID("wr_raoul"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_omat1"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_rabbl"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_sail4"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_snav"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_cha"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_fat2"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_kor"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_grey"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_solhol"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_bry1"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_oman2"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_sail1"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_kill"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_18_1"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_hubspa5"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_solspa4"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_vito"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_9SNat"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_blm"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_Ron"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_man3"), "none", "", "");	//terrace
			ChangeCharacterAddressGroup(CharacterFromID("wr_pir7"), "none", "", "");	//terrace
			ChangeCharacterAddressGroup(characterFromID("rosabella"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wench3"), "none", "", "");

			Locations[FindLocation("wr_booty")].reload.l3.disable = 0;

			Locations[FindLocation("wr_friday")].reload.l2.disable = 0;			//window to facade
			locations[FindLocation("wr_friday")].id.label = "Friday's room";

			locations[FindLocation("ck_bedroom")].id.label = "Caroline K's bedroom";

			Locations[FindLocation("Redmond_UsurerHouse")].models.always.locators = "SS_l_JRH3";
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l1.disable = 1;		//to town
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l6.disable = 0;		//to cellar
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l7.disable = 1;		//backdoor to town
			locations[FindLocation("Redmond_UsurerHouse")].type = "Rogers_neutral";			//to avoid people there at night

			Locations[FindLocation("Loanshark_cellar")].reload.l1.disable = 0;		//to mine
			locations[FindLocation("Loanshark_cellar")].id.label = "Loanshark cellar";

			locations[FindLocation("wr_library")].id.label = "Woodes Rogers' library";

			Locations[FindLocation("Redmond_Town_01")].models.always.locators = "Red01_l_JRH7";	//was 6
			Locations[FindLocation("Redmond_Town_01")].reload.l16.disable = 1;		//kitchen
			Locations[FindLocation("Redmond_Town_01")].reload.l18.disable = 1;		//window
			Locations[FindLocation("Redmond_Town_01")].reload.l23.disable = 1;		//gate terrace
			Locations[FindLocation("Redmond_Town_01")].reload.l26.disable = 1;		//tavern storeroom
			Locations[FindLocation("Redmond_Town_01")].reload.l20.disable = 1;		//LS back door
			Locations[FindLocation("Redmond_Town_01")].reload.l9.close_for_night = 0;	//shipyard
			Locations[FindLocation("Redmond_shipyard")].reload.l2.disable = 0;		//shipyard stairs

			Locations[FindLocation("Redmond_Town_04")].reload.l19.disable = 1;		//crew's quarter

			Locations[FindLocation("Redmond_tavern")].models.always.locators = "LT_l_JRH3";
			Locations[FindLocation("Redmond_tavern")].reload.l2.disable = 1;		//taverrn upstairs
			Locations[FindLocation("Redmond_tavern")].reload.l3.disable = 0;		//balcony
			Locations[FindLocation("Redmond_tavern")].reload.l6.disable = 1;		//tavern storeroom

			locations[FindLocation("Tavern_storeroom")].id.label = "Tavern storeroom";
			locations[FindLocation("Shop_stairs")].id.label = "Rogers' Paintings Furniture & Weapons";

			LAi_SetActorType(CharacterFromID("pir_cap10"));
			LAi_ActorRunToLocator(characterFromID("pir_cap10"), "reload", "reload2", "Vane_ladder35", 3.0);

			pchar.quest.make_moon_night1.win_condition.l1 = "location";
			pchar.quest.make_moon_night1.win_condition.l1.location = "wr_dungeon4_low";
			pchar.quest.make_moon_night1.win_condition = "make_moon_night1";
		break;

		case "Vane_ladder35":
			ChangeCharacterAddressGroup(characterFromID("pir_cap10"), "none", "", "");
			PlaySound("PEOPLE\wood3.wav");
			locations[FindLocation("wr_cavern")].reload.l2.disable = 1;
		break;
//--------------------------------------------------------------------------------------------------------------------------------
		case "make_moon_night1":
			SetCurrentTime(23.00, 0);
			SetNextWeather("Clear");

			pchar.quest.Vane_mine_search.win_condition.l1 = "locator";
			pchar.quest.Vane_mine_search.win_condition.l1.location = "wr_mine";
			pchar.quest.Vane_mine_search.win_condition.l1.locator_group = "goto";
			pchar.quest.Vane_mine_search.win_condition.l1.locator = "goto5";
			pchar.quest.Vane_mine_search.win_condition = "Vane_mine_search";
		break;

		case "Vane_mine_search":
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "goto3", "Vane_mine_search1", 3.0);
		break;

		case "Vane_mine_search1":
			LAi_SetOfficerType(CharacterFromID("pir_cap1"));
			LAi_SetOfficerType(CharacterFromID("pir_cap23"));
			LAi_SetOfficerType(CharacterFromID("pir_cap3"));
			LAi_SetOfficerType(CharacterFromID("pir_cap4"));
			LAi_SetOfficerType(CharacterFromID("pir_cap5"));
			LAi_SetOfficerType(CharacterFromID("pir_cap18"));
			LAi_SetOfficerType(CharacterFromID("pir_cap29"));
			LAi_SetOfficerType(CharacterFromID("pir_cap30"));
			LAi_SetOfficerType(CharacterFromID("pir_cap31"));

			ChangeCharacterAddressGroup(characterFromID("pir_cap1"), "wr_mine", "goto", "pc_A");
			ChangeCharacterAddressGroup(characterFromID("pir_cap23"), "wr_mine", "goto", "pc_B");
			ChangeCharacterAddressGroup(characterFromID("pir_cap3"), "wr_mine", "goto", "goto5");
			ChangeCharacterAddressGroup(characterFromID("pir_cap4"), "wr_mine", "goto", "pc_C");
			ChangeCharacterAddressGroup(characterFromID("pir_cap5"), "wr_mine", "goto", "pc_D");
			ChangeCharacterAddressGroup(characterFromID("pir_cap18"), "wr_mine", "goto", "pc_E");
			ChangeCharacterAddressGroup(characterFromID("pir_cap29"), "wr_mine", "goto", "goto14");
			ChangeCharacterAddressGroup(characterFromID("pir_cap30"), "wr_mine", "goto", "goto4");
			ChangeCharacterAddressGroup(characterFromID("pir_cap31"), "wr_mine", "reload", "reload6");

			LAi_QuestDelay("Vane_mine_search3", 1.0);	//was 4.0, 2.0 ok
			LAi_QuestDelay("Vane_mine_search2", 4.0);
		break;

		case "Vane_mine_search2":
			LAi_SetOfficerType(CharacterFromID("pir_cap8"));
			LAi_SetOfficerType(CharacterFromID("pir_cap9"));
			LAi_SetOfficerType(CharacterFromID("pir_cap26"));
			LAi_SetOfficerType(CharacterFromID("pir_cap27"));

			ChangeCharacterAddressGroup(characterFromID("pir_cap8"), "wr_mine", "goto", "pc_C");
			ChangeCharacterAddressGroup(characterFromID("pir_cap9"), "wr_mine", "goto", "goto14");
			ChangeCharacterAddressGroup(characterFromID("pir_cap26"), "wr_mine", "goto", "goto4");
			ChangeCharacterAddressGroup(characterFromID("pir_cap27"), "wr_mine", "reload", "reload6");
		break;

		case "Vane_mine_search3":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "search_complex";
		break;

		case "Vane_mine_search4":
			//from Vane dialog
			PlaySound("VOICE\ENGLISH\pir_capFF.wav");
			LAi_SetActorType(CharacterFromID("pir_cap23"));
			LAi_SetActorType(CharacterFromID("pir_cap3"));
			LAi_SetActorType(CharacterFromID("pir_cap4"));
			LAi_SetActorType(CharacterFromID("pir_cap5"));
			LAi_ActorRunToLocator(characterFromID("pir_cap23"), "reload", "reload2", "", 3.0);
			LAi_ActorRunToLocator(characterFromID("pir_cap3"), "reload", "reload2", "", 3.0);
			LAi_ActorRunToLocator(characterFromID("pir_cap4"), "reload", "reload2", "", 3.0);
			LAi_ActorRunToLocator(characterFromID("pir_cap5"), "reload", "reload2", "", 3.0);

			LAi_QuestDelay("Vane_mine_search5", 2.0);
			LAi_QuestDelay("Vane_mine_search4_A", 3.0);
		break;

		case "Vane_mine_search4_A":
			ChangeCharacterAddressGroup(characterFromID("pir_cap23"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap3"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap4"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap5"), "none", "", "");
		break;

		case "Vane_mine_search5":
			PlaySound("VOICE\ENGLISH\pir_capC.wav");
			LAi_SetActorType(CharacterFromID("pir_cap18"));
			LAi_SetActorType(CharacterFromID("pir_cap29"));
			LAi_SetActorType(CharacterFromID("pir_cap30"));
			LAi_SetActorType(CharacterFromID("pir_cap31"));
			LAi_ActorRunToLocator(characterFromID("pir_cap18"), "goto", "goto8", "", 5.0);
			LAi_ActorRunToLocator(characterFromID("pir_cap29"), "goto", "goto8", "", 5.0);
			LAi_ActorRunToLocator(characterFromID("pir_cap30"), "goto", "goto8", "", 5.0);
			LAi_ActorRunToLocator(characterFromID("pir_cap31"), "goto", "goto8", "", 5.0);

			LAi_QuestDelay("Vane_mine_search6", 2.0);
			LAi_QuestDelay("Vane_mine_search5_A", 5.0);
		break;

		case "Vane_mine_search5_A":
			ChangeCharacterAddressGroup(characterFromID("pir_cap18"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap29"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap30"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap31"), "none", "", "");
		break;

		case "Vane_mine_search6":
			PlaySound("VOICE\ENGLISH\Eng_f_c_020.wav");
			LAi_SetActorType(CharacterFromID("pir_cap8"));
			LAi_SetActorType(CharacterFromID("pir_cap9"));
			LAi_SetActorType(CharacterFromID("pir_cap26"));
			LAi_SetActorType(CharacterFromID("pir_cap27"));
			LAi_ActorRunToLocator(characterFromID("pir_cap8"), "reload", "reload2", "", 3.0);
			LAi_ActorRunToLocator(characterFromID("pir_cap9"), "reload", "reload2", "", 3.0);
			LAi_ActorRunToLocator(characterFromID("pir_cap26"), "reload", "reload2", "", 3.0);
			LAi_ActorRunToLocator(characterFromID("pir_cap27"), "reload", "reload2", "", 3.0);

			LAi_QuestDelay("Vane_mine_search7", 5.0);
			LAi_QuestDelay("Vane_mine_search6_A", 3.0);
		break;

		case "Vane_mine_search6_A":
			ChangeCharacterAddressGroup(characterFromID("pir_cap8"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap9"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap26"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap27"), "none", "", "");
		break;
	//...................................................................................
		case "Vane_mine_search7":
			PlaySound("PEOPLE\counter_openclose.wav");

			LAi_SetOfficerType(CharacterFromID("pir_cap16"));
			LAi_SetOfficerType(CharacterFromID("pir_cap7"));
			LAi_SetOfficerType(CharacterFromID("pir_cap14"));
			LAi_SetOfficerType(CharacterFromID("pir_cap22"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap16"), "wr_mine", "goto", "goto8");
			ChangeCharacterAddressGroup(characterFromID("pir_cap7"), "wr_mine", "reload", "reload3");
			ChangeCharacterAddressGroup(characterFromID("pir_cap14"), "wr_mine", "reload", "reload3");
			ChangeCharacterAddressGroup(characterFromID("pir_cap22"), "wr_mine", "reload", "reload3");

			LAi_QuestDelay("Vane_mine_search8", 1.0);
			LAi_QuestDelay("Vane_mine_search9", 5.0);
		break;

		case "Vane_mine_search8":
			PlaySound("VOICe\ENGLISH\blaze_what_was_that.wav");

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto8");
		break;

		case "Vane_mine_search9":
			LAi_SetActorType(CharacterFromID("pir_cap16"));
			LAi_ActorDialog(characterFromID("pir_cap16"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap16"));
			Characters[GetCharacterIndex("pir_cap16")].dialog.CurrentNode  = "wine_cellars_empty";
		break;

		case "Vane_mine_search10":
			//from Roberts dialog
			PlaySound("VOICE\ENGLISH\pir_capR3.wav");
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("pir_cap1"));

			LAi_QuestDelay("Vane_mine_search11", 2.0);
		break;
	//...................................................................................
		case "Vane_mine_search11":
			PlaySound("PEOPLE\counter_open.wav");
			LAi_SetOfficerType(CharacterFromID("pir_cap23"));
			LAi_SetOfficerType(CharacterFromID("pir_cap3"));
			LAi_SetOfficerType(CharacterFromID("pir_cap4"));
			LAi_SetOfficerType(CharacterFromID("pir_cap5"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap23"), "wr_mine", "reload", "reload2");//from LS cellar

			LAi_QuestDelay("Vane_mine_search11_A", 0.5);
		break;

		case "Vane_mine_search11_A":
			ChangeCharacterAddressGroup(characterFromID("pir_cap3"), "wr_mine", "reload", "reload2");//from LS cellar

			LAi_QuestDelay("Vane_mine_search11_B", 0.5);
		break;

		case "Vane_mine_search11_B":
			ChangeCharacterAddressGroup(characterFromID("pir_cap4"), "wr_mine", "reload", "reload2");//from LS cellar

			LAi_QuestDelay("Vane_mine_search11_C", 0.5);
		break;

		case "Vane_mine_search11_C":
			PlaySound("PEOPLE\counter_close.wav");
			ChangeCharacterAddressGroup(characterFromID("pir_cap5"), "wr_mine", "reload", "reload2");//from LS cellar

			LAi_QuestDelay("Vane_mine_search12", 2.0);
		break;
	//...................................................................................
		case "Vane_mine_search12":
			PlaySound("PEOPLE\counter_open.wav");
			LAi_SetOfficerType(CharacterFromID("pir_cap8"));
			LAi_SetOfficerType(CharacterFromID("pir_cap9"));
			LAi_SetOfficerType(CharacterFromID("pir_cap26"));
			LAi_SetOfficerType(CharacterFromID("pir_cap27"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap8"), "wr_mine", "reload", "reload2");//from LS cellar

			LAi_QuestDelay("Vane_mine_search12_A", 0.5);
		break;

		case "Vane_mine_search12_A":
			ChangeCharacterAddressGroup(characterFromID("pir_cap9"), "wr_mine", "reload", "reload2");//from LS cellar

			LAi_QuestDelay("Vane_mine_search12_B", 0.5);
		break;

		case "Vane_mine_search12_B":
			ChangeCharacterAddressGroup(characterFromID("pir_cap26"), "wr_mine", "reload", "reload2");//from LS cellar

			LAi_QuestDelay("Vane_mine_search12_C", 0.5);
		break;

		case "Vane_mine_search12_C":
			PlaySound("PEOPLE\counter_close.wav");
			ChangeCharacterAddressGroup(characterFromID("pir_cap27"), "wr_mine", "reload", "reload2");//from LS cellar

			LAi_QuestDelay("Vane_mine_search13", 2.0);
		break;
	//...................................................................................
		case "Vane_mine_search13":
			PlaySound("VOICE\ENGLISH\pir_capA.wav");
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("pir_cap23"));

			LAi_QuestDelay("Vane_mine_search14", 4.0);
		break;

		case "Vane_mine_search14":
			PlaySound("VOICE\ENGLISH\pir_capD.wav");
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("pir_cap4"));

			LAi_QuestDelay("Vane_mine_search15", 3.0);
		break;

		case "Vane_mine_search15":
			PlaySound("VOICE\ENGLISH\pir_capIII.wav");
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("pir_cap27"));

			LAi_QuestDelay("Vane_mine_search16", 3.0);
		break;

		case "Vane_mine_search16":
			LAi_SetActorType(CharacterFromID("pir_cap8"));
			LAi_ActorDialog(characterFromID("pir_cap8"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap8"));
			Characters[GetCharacterIndex("pir_cap8")].dialog.CurrentNode  = "shop_&_residence_empty";
		break;

		case "Vane_mine_search17":
			//from La Bouche dialog
			PlaySound("VOICE\ENGLISH\pir_capR11.wav");
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("pir_cap1"));

			LAi_QuestDelay("Vane_mine_search18", 4.0);
		break;

		case "Vane_mine_search18":
			PlaySound("PEOPLE\counter_openclose.wav");

			LAi_SetOfficerType(CharacterFromID("pir_cap18"));
			LAi_SetOfficerType(CharacterFromID("pir_cap29"));
			LAi_SetOfficerType(CharacterFromID("Selkirk"));
			LAi_SetOfficerType(CharacterFromID("Friday"));
			LAi_SetOfficerType(CharacterFromID("pir_cap30"));
			LAi_SetOfficerType(CharacterFromID("pir_cap31"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap18"), "wr_mine", "goto", "goto9");
			ChangeCharacterAddressGroup(characterFromID("pir_cap29"), "wr_mine", "goto", "goto9A");
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "wr_mine", "goto", "selkirk");
			ChangeCharacterAddressGroup(characterFromID("Friday"), "wr_mine", "goto", "friday");
			ChangeCharacterAddressGroup(characterFromID("pir_cap30"), "wr_mine", "goto", "goto8");
			ChangeCharacterAddressGroup(characterFromID("pir_cap31"), "wr_mine", "reload", "reload3");

			LAi_QuestDelay("Vane_mine_search19", 1.0);
			LAi_QuestDelay("Vane_mine_search20", 5.0);
		break;

		case "Vane_mine_search19":
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto8");
		break;

		case "Vane_mine_search20":
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorDialog(characterFromID("Selkirk"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Selkirk"));
			Characters[GetCharacterIndex("Selkirk")].dialog.CurrentNode  = "kidnapped";
		break;

		case "Vane_mine_search21":
			//from Selkirk dialog
			PlaySound("VOICE\ENGLISH\pir_capHH.wav");
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("pir_cap30"));

			LAi_QuestDelay("Vane_mine_search22", 3.0);
		break;

		case "Vane_mine_search22":
			PlaySound("VOICE\ENGLISH\pir_capP.wav");
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("pir_cap7"));

			LAi_QuestDelay("Vane_mine_search23", 3.0);
		break;

		case "Vane_mine_search23":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "Selkirk_ok";
		break;

		case "Vane_mine_search24":
			PlaySound("AMBIENT\pirate_captains.wav");

			LAi_QuestDelay("Vane_mine_search25", 3.5);
		break;

		case "Vane_mine_search25":
			//from Vane dialog
			LAi_SetActorType(CharacterFromID("pir_cap18"));
			LAi_ActorDialog(characterFromID("pir_cap18"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap18"));
			Characters[GetCharacterIndex("pir_cap18")].dialog.CurrentNode  = "kitchen_empty";
		break;

		case "Vane_mine_search26":
			//from Rackham dialog
			PlaySound("PEOPLE\clothes2.wav");
			SetModel(characterFromID("Selkirk"), "rabwhite1Priest", "man", "man", 1.8, false);
			SetModel(characterFromID("Friday"), "Animists1_black", "man", "man", 1.8, false);
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("Friday"));

			LAi_QuestDelay("Vane_mine_search27", 1.0);
		break;

		case "Vane_mine_search27":
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorDialog(characterFromID("Selkirk"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Selkirk"));
			Characters[GetCharacterIndex("Selkirk")].dialog.CurrentNode  = "way_out";
		break;

		case "Vane_mine_search28":
			//from Selkirk dialog
			PlaySound("VOICE\ENGLISH\gr_friday1.wav");
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("Friday"));

			LAi_QuestDelay("Vane_mine_search29", 2.0);
		break;

		case "Vane_mine_search29":
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorDialog(characterFromID("Selkirk"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Selkirk"));
			Characters[GetCharacterIndex("Selkirk")].dialog.CurrentNode  = "open_window";
		break;

		case "Vane_mine_search30":
			//from Selkirk dialog
			PlaySound("VOICE\ENGLISH\pir_capR7.wav");
			LAi_SetPlayerType(Pchar);
			AddQuestRecord("Revenge", "2");

			LAi_SetCitizenType(CharacterFromID("pir_cap1"));
			LAi_SetCitizenType(CharacterFromID("pir_cap3"));
			LAi_SetCitizenType(CharacterFromID("pir_cap4"));
			LAi_SetCitizenType(CharacterFromID("pir_cap5"));
			LAi_SetCitizenType(CharacterFromID("pir_cap7"));
			LAi_SetCitizenType(CharacterFromID("pir_cap8"));
			LAi_SetCitizenType(CharacterFromID("pir_cap9"));
			LAi_SetCitizenType(CharacterFromID("pir_cap14"));
			LAi_SetCitizenType(CharacterFromID("pir_cap16"));
			LAi_SetCitizenType(CharacterFromID("pir_cap18"));
			LAi_SetCitizenType(CharacterFromID("pir_cap22"));
			LAi_SetCitizenType(CharacterFromID("pir_cap23"));
			LAi_SetCitizenType(CharacterFromID("pir_cap26"));
			LAi_SetCitizenType(CharacterFromID("pir_cap27"));
			LAi_SetCitizenType(CharacterFromID("pir_cap29"));
			LAi_SetCitizenType(CharacterFromID("pir_cap30"));
			LAi_SetCitizenType(CharacterFromID("pir_cap31"));
			LAi_SetOfficerType(CharacterFromID("Selkirk"));

			pchar.quest.make_moon_night2.win_condition.l1 = "location";
			pchar.quest.make_moon_night2.win_condition.l1.location = "wr_friday";
			pchar.quest.make_moon_night2.win_condition = "make_moon_night2";
		break;
//--------------------------------------------------------------------------------------------------------------------------------
		case "make_moon_night2":
			SetCurrentTime(23.00, 0);
			SetNextWeather("Moon Night");
			ChangeCharacterAddressGroup(CharacterFromID("Woodes Rogers"), "none", "", "");
			Pchar.quest.wr_quest1 = "off";
			Pchar.quest.woodesrogers = "dead";

			LAi_QuestDelay("cat_burglar", 0.1);
		break;

		case "cat_burglar":
			Pchar.quest.high_roof_check = "sudden_death";

			pchar.quest.cat_burglar0.win_condition.l1 = "locator";
			pchar.quest.cat_burglar0.win_condition.l1.location = "Redmond_Town_01";
			pchar.quest.cat_burglar0.win_condition.l1.locator_group = "goto";
			pchar.quest.cat_burglar0.win_condition.l1.locator = "cat_burglar1";
			pchar.quest.cat_burglar0.win_condition = "cat_burglar0";
		break;

		case "cat_burglar0":
			Locations[FindLocation("wr_dungeon4_low")].environment.weather = "false";		//reset
			Locations[FindLocation("wr_dungeon3_right")].environment.weather = "false";
			Locations[FindLocation("wr_friday")].environment.weather = "false";

			PlaySound("PEOPLE\creak2.wav");

			LAi_QuestDelay("cat_burglar1", 1.0);

			pchar.quest.cat_burglar2.win_condition.l1 = "locator";
			pchar.quest.cat_burglar2.win_condition.l1.location = "Redmond_Town_01";
			pchar.quest.cat_burglar2.win_condition.l1.locator_group = "goto";
			pchar.quest.cat_burglar2.win_condition.l1.locator = "cat_burglar2";
			pchar.quest.cat_burglar2.win_condition = "cat_burglar2";
		break;

		case "cat_burglar1":
			PlaySound("PEOPLE\counter_close.wav");
		break;

		case "cat_burglar2":
			LAi_QuestDelay("cat_burglar3", 0.5);

			pchar.quest.cat_burglar6.win_condition.l1 = "locator";
			pchar.quest.cat_burglar6.win_condition.l1.location = "Redmond_Town_01";
			pchar.quest.cat_burglar6.win_condition.l1.locator_group = "goto";
			pchar.quest.cat_burglar6.win_condition.l1.locator = "cat_burglar3";
			pchar.quest.cat_burglar6.win_condition = "cat_burglar6";
		break;

		case "cat_burglar3":
			PlaySound("PEOPLE\step_stairway.wav");

			LAi_QuestDelay("cat_burglar4", 1.0);
		break;

		case "cat_burglar4":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "cityzen7");

			LAi_QuestDelay("cat_burglar5", 1.0);
		break;

		case "cat_burglar5":
			LAi_SetPlayerType(Pchar);
			PlaySound("OBJECTS\VOICES\DEAD\male\dead1.wav");
		break;

		case "cat_burglar6":
			LAi_QuestDelay("cat_burglar7", 0.5);
		break;

		case "cat_burglar7":
			PlaySound("PEOPLE\Jump_Stone.wav");

			LAi_QuestDelay("cat_burglar8", 1.5);
		break;

		case "cat_burglar8":
			PlaySound("PEOPLE\slide_down_roof.wav");
			ChangeCharacterAddressGroup(Pchar, "Redmond_Town_01", "goto", "cat_burglar4");

			LAi_QuestDelay("cat_burglar9", 0.4);
		break;

		case "cat_burglar9":
			ChangeCharacterAddressGroup(Pchar, "Redmond_Town_01", "goto", "cat_burglar5");

			LAi_QuestDelay("cat_burglar10", 0.3);
		break;

		case "cat_burglar10":
			ChangeCharacterAddressGroup(Pchar, "Redmond_Town_01", "goto", "cat_burglar6");

			LAi_QuestDelay("cat_burglar11", 0.2);
		break;

		case "cat_burglar11":
			ChangeCharacterAddressGroup(Pchar, "Redmond_Town_01", "goto", "cat_burglar7");

			LAi_QuestDelay("cat_burglar12", 0.1);
		break;

		case "cat_burglar12":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead0.wav");

			CreateParticleSystem("blast_dirt_small" , -17.5, 5.5, 0, 0.0, 0.0, 0.0, sti(20) );
			ChangeCharacterAddressGroup(Pchar, "Redmond_Town_01", "goto", "cat_burglar8");
			LAi_SetSitType(Pchar);

			LAi_QuestDelay("cat_burglar13", 0.5);

			pchar.quest.cat_burglar14.win_condition.l1 = "locator";
			pchar.quest.cat_burglar14.win_condition.l1.location = "Redmond_Town_01";
			pchar.quest.cat_burglar14.win_condition.l1.locator_group = "goto";
			pchar.quest.cat_burglar14.win_condition.l1.locator = "cat_burglar9";
			pchar.quest.cat_burglar14.win_condition = "cat_burglar14";
		break;

		case "cat_burglar13":
			PlaySound("PEOPLE\cavern1.wav");

			LAi_QuestDelay("cat_burglar_fall", 2.0);
		break;
	//........................................................................................
		case "cat_burglar_fall":
			if(CheckAttribute(Pchar, "quest.high_roof_check") && Pchar.quest.high_roof_check == "ok")
			{
				//LogIt("high_roof_check = " + Pchar.quest.high_roof_check);
				return;
			}
			else
			{
				//fall down
				//LogIt("high_roof_check = " + Pchar.quest.high_roof_check);
				ChangeCharacterAddressGroup(Pchar, "Redmond_Town_01", "goto", "roof_fall");
				PlaySound("OBJECTS\VOICES\DEAD\male\dead6.wav");

				LAi_QuestDelay("cat_burglar_fall1", 1.0);
			}
		break;

		case "cat_burglar_fall1":
			PlaySound("PEOPLE\Jump.wav");
			PlaySound("PEOPLE\Jump.wav");
			PlaySound("PEOPLE\sponge.wav");

			LAi_QuestDelay("dead_by_minebomb", 0.01);
		break;
	//........................................................................................
		case "cat_burglar14":
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("cat_burglar15", 0.2);

			pchar.quest.cat_burglar18.win_condition.l1 = "locator";
			pchar.quest.cat_burglar18.win_condition.l1.location = "Redmond_Town_01";
			pchar.quest.cat_burglar18.win_condition.l1.locator_group = "goto";
			pchar.quest.cat_burglar18.win_condition.l1.locator = "cat_burglar10";
			pchar.quest.cat_burglar18.win_condition = "cat_burglar18";
		break;

		case "cat_burglar15":
			PlaySound("PEOPLE\Jump_Stone.wav");

			LAi_QuestDelay("cat_burglar16", 1.0);
		break;

		case "cat_burglar16":
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "look_at");

			LAi_QuestDelay("cat_burglar17", 0.5);
		break;

		case "cat_burglar17":
			LAi_SetPlayerType(Pchar);
		break;

		case "cat_burglar18":
			LAi_SetSitType(Pchar);

			LAi_QuestDelay("cat_burglar19", 0.3);
			LAi_QuestDelay("cat_burglar25A", 0.5);

			pchar.quest.cat_burglar22.win_condition.l1 = "locator";
			pchar.quest.cat_burglar22.win_condition.l1.location = "Redmond_Town_01";
			pchar.quest.cat_burglar22.win_condition.l1.locator_group = "goto";
			pchar.quest.cat_burglar22.win_condition.l1.locator = "cat_burglar12";
			pchar.quest.cat_burglar22.win_condition = "cat_burglar22";
		break;

		case "cat_burglar19":
			PlaySound("PEOPLE\step_stairway.wav");
			PlaySound("PEOPLE\step_stairway.wav");

			LAi_QuestDelay("cat_burglar20", 1.0);
		break;

		case "cat_burglar20":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "cat_burglar11");

			LAi_QuestDelay("cat_burglar21", 0.5);
		break;

		case "cat_burglar21":
			LAi_SetPlayerType(Pchar);

		break;

		case "cat_burglar22":
			LAi_QuestDelay("cat_burglar23", 0.5);
		break;

		case "cat_burglar23":
			PlaySound("PEOPLE\Jump_Stone.wav");

			LAi_QuestDelay("cat_burglar24", 1.5);
		break;

		case "cat_burglar24":
			LAi_SetSitType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "Redmond_Town_01", "goto", "cat_burglar13");
			PlaySound("PEOPLE\Jump.wav");

			LAi_QuestDelay("cat_burglar24A", 0.5);
		break;

		case "cat_burglar24A":
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("cat_burglar25", 0.5);
		break;

		case "cat_burglar25":
			LAi_SetSitType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "Redmond_Town_01", "goto", "cat_burglar14");
			PlaySound("PEOPLE\step_stairway.wav");
			PlaySound("PEOPLE\step_stairway.wav");

			LAi_QuestDelay("cat_burglar25A", 0.5);

			pchar.quest.cat_burglar26.win_condition.l1 = "locator";
			pchar.quest.cat_burglar26.win_condition.l1.location = "Redmond_Town_01";
			pchar.quest.cat_burglar26.win_condition.l1.locator_group = "goto";
			pchar.quest.cat_burglar26.win_condition.l1.locator = "cat_burglar15";
			pchar.quest.cat_burglar26.win_condition = "cat_burglar26";
		break;

		case "cat_burglar25A":
			LAi_SetPlayerType(Pchar);
		break;

		case "cat_burglar26":
			PlaySound("PEOPLE\run_wood.wav");

			LAi_QuestDelay("cat_burglar27", 1.5);
		break;

		case "cat_burglar27":
			PlaySound("PEOPLE\run_wood.wav");
			ChangeCharacterAddressGroup(Pchar, "Redmond_Town_01", "goto", "cat_burglar16");

			LAi_QuestDelay("cat_burglar28", 2.0);
		break;

		case "cat_burglar28":
			PlaySound("PEOPLE\step_stairway2.wav");
			ChangeCharacterAddressGroup(Pchar, "Redmond_Town_01", "goto", "cat_burglar17");

			LAi_QuestDelay("cat_burglar29", 0.5);
		break;

		case "cat_burglar29":
			PlaySound("PEOPLE\step_stairway.wav");
			PlaySound("PEOPLE\step_stairway.wav");
			ChangeCharacterAddressGroup(Pchar, "Redmond_Town_01", "reload", "balcony");

			pchar.quest.Vane_to_port.win_condition.l1 = "location";
			pchar.quest.Vane_to_port.win_condition.l1.location = "Redmond_tavern";
			pchar.quest.Vane_to_port.win_condition = "Vane_to_port";
		break;
	//...............................................................................................
		case "Vane_to_port":
			ChangeCharacterAddressGroup(characterFromID("Defoe"), "Redmond_Town_01", "goto", "defoe");
			LAi_SetStayType(characterFromID("Defoe"));
			Characters[GetCharacterIndex("Defoe")].dialog.CurrentNode  = "open_shipyard";

			pchar.quest.Vane_to_port1.win_condition.l1 = "locator";
			pchar.quest.Vane_to_port1.win_condition.l1.location = "Redmond_Town_01";
			pchar.quest.Vane_to_port1.win_condition.l1.locator_group = "goto";
			pchar.quest.Vane_to_port1.win_condition.l1.locator = "defoe";
			pchar.quest.Vane_to_port1.win_condition = "Vane_to_port1";
		break;

		case "Vane_to_port1":
			LAi_SetStayType(Pchar);
			LAi_SetActorType(CharacterFromID("Defoe"));
			LAi_ActorDialog(characterFromID("Defoe"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Defoe"));
		break;

		case "Vane_to_port2":
			//from Defoe dialog
			LAi_SetPlayerType(Pchar);
			LAi_SetActorType(characterFromID("Defoe"));
			LAi_ActorRunToLocator(characterFromID("Defoe"), "reload", "shipyard", "", 20.0);

			pchar.quest.Vane_to_port3.win_condition.l1 = "locator";
			pchar.quest.Vane_to_port3.win_condition.l1.location = "Redmond_Town_01";
			pchar.quest.Vane_to_port3.win_condition.l1.locator_group = "goto";
			pchar.quest.Vane_to_port3.win_condition.l1.locator = "magic_key";
			pchar.quest.Vane_to_port3.win_condition = "Vane_to_port3";
		break;

		case "Vane_to_port3":
			LAi_SetStayType(Pchar);
			PlaySound("INTERFACE\key_unlock2.wav");

			LAi_QuestDelay("Vane_to_port4", 1.0);
		break;

		case "Vane_to_port4":
			LAi_ActorGoToLocator(characterFromID("Defoe"), "officers", "shipyard_1", "", 2.0);

			LAi_QuestDelay("Vane_to_port5", 2.0);
		break;

		case "Vane_to_port5":
			ChangeCharacterAddressGroup(characterFromID("Defoe"), "Redmond_Town_01", "officers", "shipyard_1");
			LAi_SetStayType(characterFromID("Defoe"));

			LAi_QuestDelay("Vane_to_port6", 1.0);
		break;

		case "Vane_to_port6":
			PlaySound("PEOPLE\counter_openclose.wav");

			LAi_QuestDelay("Vane_to_port7", 1.0);
		break;

		case "Vane_to_port7":
			ChangeCharacterAddressGroup(characterFromID("Claire Voyant"), "Redmond_Town_01", "reload", "shipyard");

			LAi_QuestDelay("Vane_to_port8", 1.0);
		break;

		case "Vane_to_port8":
			LAi_SetActorType(characterFromID("Claire Voyant"));
			LAi_ActorDialog(characterFromID("Claire Voyant"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Claire Voyant"));
			Characters[GetCharacterIndex("Claire Voyant")].dialog.CurrentNode  = "magic_key";
		break;

		case "Vane_to_port9":
			//from claire dialog
			GiveItem2Character(CharacterFromID("Claire Voyant"), "bladekeysimple");
			EquipCharacterbyItem(CharacterFromID("Claire Voyant"), "bladekeysimple");

			LAi_SetActorType(CharacterFromID("Defoe"));
			LAi_ActorDialog(characterFromID("Defoe"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Defoe"));
			Characters[GetCharacterIndex("Defoe")].dialog.CurrentNode  = "shipyard_key";
		break;


		case "Vane_to_port10":
			//from Defoe dialog
			LAi_SetActorType(characterFromID("Claire Voyant"));
			LAi_ActorDialog(characterFromID("Claire Voyant"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Claire Voyant"));
			Characters[GetCharacterIndex("Claire Voyant")].dialog.CurrentNode  = "breathe_on_key";
		break;

		case "Vane_to_port11":
			//from claire dialog
			LAi_SetActorType(CharacterFromID("Defoe"));
			LAi_ActorDialog(characterFromID("Defoe"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Defoe"));
			Characters[GetCharacterIndex("Defoe")].dialog.CurrentNode  = "ironic_key";
		break;

		case "Vane_to_port12":
			//from Defoe dialog
			LAi_SetPlayerType(CharacterFromID("Claire Voyant"));
			LAi_SetFightMode(CharacterFromID("Claire Voyant"), true);

			LAi_QuestDelay("Vane_to_port13", 1.0);
		break;

		case "Vane_to_port13":
			PlaySound("INTERFACE\oxygen.wav");

			LAi_QuestDelay("Vane_to_port14", 1.0);
		break;

		case "Vane_to_port14":
			LAi_SetActorType(characterFromID("Claire Voyant"));
			LAi_ActorGoToLocator(characterFromID("Claire Voyant"), "reload", "reload7", "", 5.0);

			LAi_QuestDelay("Vane_to_port15", 3.0);
			LAi_QuestDelay("Vane_to_port16", 5.0);
		break;

		case "Vane_to_port15":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "shya_look");
			LAi_SetActorType(CharacterFromID("Defoe"));
			LAi_ActorTurnToLocator(CharacterFromID("Defoe"), "reload", "reload7_in");
		break;

		case "Vane_to_port16":
			ChangeCharacterAddressGroup(characterFromID("Claire Voyant"), "Redmond_Town_01", "goto", "claire");

			LAi_QuestDelay("Vane_to_port17", 0.5);
		break;

		case "Vane_to_port17":
			ChangeCharacterAddressGroup(characterFromID("Claire Voyant"), "Redmond_Town_01", "reload", "reload7_in");

			LAi_QuestDelay("Vane_to_port18", 1.0);
		break;

		case "Vane_to_port18":
			PlaySound("INTERFACE\key_unlock.wav");

			LAi_QuestDelay("Vane_to_port19", 1.0);
		break;

		case "Vane_to_port19":
			LAi_SetActorType(characterFromID("Claire Voyant"));
			LAi_ActorTurnToCharacter(characterFromID("Claire Voyant"), CharacterFromID("Defoe"));

			LAi_QuestDelay("Vane_to_port20", 1.0);
		break;
	//...............................................................................................
	//1 Charles Vane
		case "Vane_to_port20":
			Pchar.quest.med_Claire = "acetum";
			LAi_SetStayType(characterFromID("Claire Voyant"));
			LAi_SetStayType(characterFromID("Defoe"));

			LAi_SetStayType(characterFromID("pir_cap1"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap1"), "Redmond_Town_01", "goto", "pc1");
			PlaySound("VOICE\ENGLISH\pir_capR3.wav");

			LAi_QuestDelay("Vane_to_port21", 2.0);
		break;

		case "Vane_to_port21":
			PlaySound("VOICE\ENGLISH\defoe_welcome.wav");

			LAi_QuestDelay("Vane_to_port22", 3.0);
		break;

		case "Vane_to_port22":
			ChangeCharacterAddressGroup(characterFromID("pir_cap1"), "Redmond_Town_01", "goto", "pc2");
			PlaySound("VOICE\ENGLISH\pir_capR4.wav");

			LAi_QuestDelay("Vane_to_port22A", 0.5);
		break;

		case "Vane_to_port22A":
			ChangeCharacterAddressGroup(characterFromID("pir_cap1"), "Redmond_Town_01", "reload", "reload7");

			LAi_QuestDelay("Vane_to_port22B", 0.5);
		break;

		case "Vane_to_port22B":
			LAi_SetActorType(characterFromID("pir_cap1"));
			LAi_ActorRunToLocator(characterFromID("pir_cap1"), "reload", "shipyard", "", 2.0);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto47");

			LAi_QuestDelay("Vane_to_port22C", 2.0);
		break;

		case "Vane_to_port22C":
			ChangeCharacterAddressGroup(characterFromID("pir_cap1"), "none", "", "");
			PlaySound("INTERFACE\closed_door.wav");

			LAi_QuestDelay("Vane_to_port23", 1.0);
		break;
	//...............................................................................................
	//2 Thomas Anstis
		case "Vane_to_port23":
			LAi_SetStayType(characterFromID("pir_cap7"));
			PlaySound("INTERFACE\closet_open.wav");
			ChangeCharacterAddressGroup(characterFromID("pir_cap7"), "Redmond_Town_01", "goto", "pc1");

			LAi_QuestDelay("Vane_to_port23A", 1.0);
		break;

		case "Vane_to_port23A":
			PlaySound("VOICE\ENGLISH\defoe_feast.wav");

			LAi_QuestDelay("Vane_to_port23B", 4.5);
		break;

		case "Vane_to_port23B":
			ChangeCharacterAddressGroup(characterFromID("pir_cap7"), "Redmond_Town_01", "goto", "pc2");
			PlaySound("VOICE\ENGLISH\pir_capP.wav");

			LAi_QuestDelay("Vane_to_port23C", 0.5);
		break;

		case "Vane_to_port23C":
			ChangeCharacterAddressGroup(characterFromID("pir_cap7"), "Redmond_Town_01", "reload", "reload7");

			LAi_QuestDelay("Vane_to_port23D", 0.5);
		break;

		case "Vane_to_port23D":
			LAi_SetActorType(characterFromID("pir_cap7"));
			LAi_ActorRunToLocator(characterFromID("pir_cap7"), "reload", "shipyard", "", 2.0);

			LAi_QuestDelay("Vane_to_port23E", 2.0);
		break;

		case "Vane_to_port23E":
			ChangeCharacterAddressGroup(characterFromID("pir_cap7"), "none", "", "");
			PlaySound("INTERFACE\closed_door.wav");

			LAi_QuestDelay("Vane_to_port26", 1.0);
		break;
	//...............................................................................................
	//3 Olivier La Buze
		case "Vane_to_port26":
			PlaySound("INTERFACE\closet_open.wav");
			LAi_SetActorType(characterFromID("pir_cap8"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap8"), "Redmond_Town_01", "goto", "pc1");

			LAi_QuestDelay("Vane_to_port26A", 1.0);
		break;

		case "Vane_to_port26A":
			PlaySound("VOICE\ENGLISH\defoe_again.wav");

			LAi_QuestDelay("Vane_to_port26B", 2.5);
		break;

		case "Vane_to_port26B":
			ChangeCharacterAddressGroup(characterFromID("pir_cap8"), "Redmond_Town_01", "goto", "pc2");
			PlaySound("VOICE\ENGLISH\pir_capLL.wav");

			LAi_QuestDelay("Vane_to_port26C", 0.5);
		break;

		case "Vane_to_port26C":
			ChangeCharacterAddressGroup(characterFromID("pir_cap8"), "Redmond_Town_01", "reload", "reload7");

			LAi_QuestDelay("Vane_to_port26D", 0.5);
		break;

		case "Vane_to_port26D":
			LAi_SetActorType(characterFromID("pir_cap8"));
			LAi_ActorRunToLocator(characterFromID("pir_cap8"), "reload", "shipyard", "", 2.0);

			LAi_QuestDelay("Vane_to_port26E", 2.0);
		break;

		case "Vane_to_port26E":
			ChangeCharacterAddressGroup(characterFromID("pir_cap8"), "none", "", "");
			PlaySound("INTERFACE\closed_door.wav");

			LAi_QuestDelay("Vane_to_port24", 1.0);
		break;
	//...............................................................................................
	//4 Alexander Selkirk
		case "Vane_to_port24":
			PlaySound("INTERFACE\closet_open.wav");
			LAi_SetActorType(characterFromID("Selkirk"));
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "Redmond_Town_01", "goto", "pc1");

			LAi_QuestDelay("Vane_to_port24A", 1.0);
		break;

		case "Vane_to_port24A":
			PlaySound("VOICE\ENGLISH\defoe_meet.wav");

			LAi_QuestDelay("Vane_to_port24B", 2.5);
		break;

		case "Vane_to_port24B":
			PlaySound("OBJECTS\DUEL\man_attack5.wav");

			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "Redmond_Town_01", "goto", "pc2");

			LAi_QuestDelay("Vane_to_port24C", 0.5);
		break;

		case "Vane_to_port24C":
			PlaySound("VOICE\ENGLISH\Eng_m_c_073.wav");
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "Redmond_Town_01", "reload", "reload7");

			LAi_QuestDelay("Vane_to_port24D", 0.5);
		break;

		case "Vane_to_port24D":
			LAi_SetActorType(characterFromID("Selkirk"));
			LAi_ActorRunToLocator(characterFromID("Selkirk"), "reload", "shipyard", "", 2.0);

			LAi_QuestDelay("Vane_to_port24E", 2.0);
		break;

		case "Vane_to_port24E":
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "none", "", "");
			PlaySound("INTERFACE\closed_door.wav");

			LAi_QuestDelay("Vane_to_port25", 1.0);
		break;
	//...............................................................................................
	//5 Howell Davis
		case "Vane_to_port25":
			PlaySound("INTERFACE\closet_open.wav");
			LAi_SetActorType(characterFromID("pir_cap5"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap5"), "Redmond_Town_01", "goto", "pc1");

			LAi_QuestDelay("Vane_to_port25B", 1.0);
		break;

		case "Vane_to_port25B":
			ChangeCharacterAddressGroup(characterFromID("pir_cap5"), "Redmond_Town_01", "goto", "pc2");

			LAi_QuestDelay("Vane_to_port25C", 0.5);
		break;

		case "Vane_to_port25C":
			ChangeCharacterAddressGroup(characterFromID("pir_cap5"), "Redmond_Town_01", "reload", "reload7");

			LAi_QuestDelay("Vane_to_port25D", 0.5);
		break;

		case "Vane_to_port25D":
			PlaySound("VOICE\ENGLISH\pir_capFF.wav");
			LAi_SetActorType(characterFromID("pir_cap5"));
			LAi_ActorRunToLocator(characterFromID("pir_cap5"), "reload", "shipyard", "", 2.0);

			LAi_QuestDelay("Vane_to_port25E", 2.0);
		break;

		case "Vane_to_port25E":
			ChangeCharacterAddressGroup(characterFromID("pir_cap5"), "Redmond_shipyard", "goto", "goto12");
			PlaySound("INTERFACE\closed_door.wav");

			Locations[FindLocation("Shipyard_shore")].models.always.locators = "FFport02_l_JRH_out2";//no smg goods
			Locations[FindLocation("Shipyard_shore")].reload.l1.disable = 1;		//to dock
			Locations[FindLocation("Shipyard_shore")].reload.l2.disable = 1;		//to dock

			Locations[FindLocation("Redmond_shore_ship")].models.always.locators = "ShoreShip_l_JRH2";//no smg goods

			Locations[FindLocation("Redmond_shore_03")].models.always.locators = "shore10_l_JRH1";
			ChangeCharacterAddressGroup(CharacterFromID("wr_fwn"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_sol6f77"), "none", "", "");

			Locations[FindLocation("wr_port")].models.always.locators = "QCport_l_JRH1";
//don't lock to farm
		//	Locations[FindLocation("wr_port")].reload.l2.disable = 1;			//to farm
			ChangeCharacterAddressGroup(CharacterFromID("wr_pir5"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("wr_hubport"), "none", "", "");
			SetCharacterShipLocation(characterFromID("Coastbrother27"), "none");		//boat2 at wr_port

			LAi_SetPlayerType(Pchar);

			pchar.quest.Vane_to_port25F.win_condition.l1 = "location";
			pchar.quest.Vane_to_port25F.win_condition.l1.location = "Redmond_shipyard";
			pchar.quest.Vane_to_port25F.win_condition = "Vane_to_port25F";
		break;

		case "Vane_to_port25F":
			LAi_SetActorType(characterFromID("pir_cap5"));
			LAi_ActorRunToLocator(characterFromID("pir_cap5"), "reload", "reload2", "Vane_to_port25G", 4.0);

			pchar.quest.Vane_to_port27.win_condition.l1 = "locator";
			pchar.quest.Vane_to_port27.win_condition.l1.location = "Redmond_shipyard";
			pchar.quest.Vane_to_port27.win_condition.l1.locator_group = "reload";
			pchar.quest.Vane_to_port27.win_condition.l1.locator = "reload2";
			pchar.quest.Vane_to_port27.win_condition = "Vane_to_port27";
		break;

		case "Vane_to_port25G":
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(characterFromID("pir_cap5"), "wr_port", "goto", "Q7");
		break;

		case "Vane_to_port27":
			DoQuestReloadToLocation("wr_port", "reload", "reload3", "Vane_at_port");
		break;
	//...............................................................................................
		case "Vane_at_port":
			SetCurrentTime(23.00, 0);
			SetNextWeather("Moon Night");

			ChangeCharacterAddressGroup(CharacterFromID("Defoe"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("Claire Voyant"), "none", "", "");

			ChangeCharacterAddressGroup(characterFromID("pir_cap1"), "wr_port", "goto", "Q3");
			ChangeCharacterAddressGroup(characterFromID("pir_cap7"), "wr_port", "goto", "Q4");
			ChangeCharacterAddressGroup(characterFromID("pir_cap8"), "wr_port", "goto", "Q5");
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "wr_port", "goto", "Q6");

			pchar.quest.Vane_at_port0.win_condition.l1 = "locator";
			pchar.quest.Vane_at_port0.win_condition.l1.location = "wr_port";
			pchar.quest.Vane_at_port0.win_condition.l1.locator_group = "goto";
			pchar.quest.Vane_at_port0.win_condition.l1.locator = "goto15";
			pchar.quest.Vane_at_port0.win_condition = "Vane_at_port0";
		break;

		case "Vane_at_port0":
			LAi_SetActorType(characterFromID("pir_cap1"));
			LAi_ActorRunToLocator(characterFromID("pir_cap1"), "goto", "R1_back", "", "");
			LAi_SetActorType(characterFromID("pir_cap7"));
			LAi_ActorRunToLocator(characterFromID("pir_cap7"), "goto", "R2", "", "");
			LAi_SetActorType(characterFromID("pir_cap8"));
			LAi_ActorRunToLocator(characterFromID("pir_cap8"), "goto", "R3", "", "");
			LAi_SetActorType(characterFromID("Selkirk"));
			LAi_ActorRunToLocator(characterFromID("Selkirk"), "goto", "R4", "", "");
			LAi_SetActorType(characterFromID("pir_cap5"));
			LAi_ActorRunToLocator(characterFromID("pir_cap5"), "goto", "R5", "", "");

			LAi_QuestDelay("Vane_at_port00", 5.0);		//was 6.0

			pchar.quest.Vane_at_port1.win_condition.l1 = "locator";
			pchar.quest.Vane_at_port1.win_condition.l1.location = "wr_port";
			pchar.quest.Vane_at_port1.win_condition.l1.locator_group = "goto";
			pchar.quest.Vane_at_port1.win_condition.l1.locator = "R5";
			pchar.quest.Vane_at_port1.win_condition = "Vane_at_port1";
		break;

		case "Vane_at_port00":
			ChangeCharacterAddressGroup(characterFromID("pir_cap1"), "wr_port", "goto", "R1_back");
			ChangeCharacterAddressGroup(characterFromID("pir_cap7"), "wr_port", "goto", "R2");
			ChangeCharacterAddressGroup(characterFromID("pir_cap8"), "wr_port", "goto", "R3");
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "wr_port", "goto", "R4");
			ChangeCharacterAddressGroup(characterFromID("pir_cap5"), "wr_port", "goto", "R5");
		break;

		case "Vane_at_port1":
			ChangeCharacterAddressGroup(Pchar, "wr_port", "goto", "R6");
			LAi_SetStayType(Pchar);

			//LEFT
			ChangeCharacterAddressGroup(characterFromID("pir_cap18"), "wr_port", "goto", "L8");
			ChangeCharacterAddressGroup(characterFromID("pir_cap3"), "wr_port", "goto", "L9");
			ChangeCharacterAddressGroup(characterFromID("pir_cap16"), "wr_port", "goto", "L10");
			ChangeCharacterAddressGroup(characterFromID("pir_cap23"), "wr_port", "goto", "R10");
			ChangeCharacterAddressGroup(characterFromID("pir_cap4"), "wr_port", "goto", "R9");

			ChangeCharacterAddressGroup(characterFromID("pir_cap9"), "wr_port", "goto", "Q1");
			ChangeCharacterAddressGroup(characterFromID("pir_cap26"), "wr_port", "goto", "Q2");
			ChangeCharacterAddressGroup(characterFromID("pir_cap30"), "wr_port", "goto", "Q3");
			ChangeCharacterAddressGroup(characterFromID("pir_cap27"), "wr_port", "goto", "Q4");
			ChangeCharacterAddressGroup(characterFromID("pir_cap29"), "wr_port", "goto", "Q5");

			//RIGHT
			ChangeCharacterAddressGroup(characterFromID("Friday"), "wr_port", "goto", "Q6");
			ChangeCharacterAddressGroup(characterFromID("pir_cap14"), "wr_port", "goto", "Q7");
			ChangeCharacterAddressGroup(characterFromID("pir_cap22"), "wr_port", "goto", "Q8");
			ChangeCharacterAddressGroup(characterFromID("pir_cap31"), "wr_port", "goto", "Q9");

			LAi_SetActorType(characterFromID("pir_cap18"));
			LAi_ActorRunToLocator(characterFromID("pir_cap18"), "goto", "L1", "", "");
			LAi_SetActorType(characterFromID("pir_cap3"));
			LAi_ActorRunToLocator(characterFromID("pir_cap3"), "goto", "L2", "", "");
			LAi_SetActorType(characterFromID("pir_cap16"));
			LAi_ActorRunToLocator(characterFromID("pir_cap16"), "goto", "L3", "", "");
			LAi_SetActorType(characterFromID("pir_cap23"));
			LAi_ActorRunToLocator(characterFromID("pir_cap23"), "goto", "L4", "", "");
			LAi_SetActorType(characterFromID("pir_cap4"));
			LAi_ActorRunToLocator(characterFromID("pir_cap4"), "goto", "L5", "", "");
			LAi_SetActorType(characterFromID("pir_cap9"));
			LAi_ActorRunToLocator(characterFromID("pir_cap9"), "goto", "L6", "", "");
			LAi_SetActorType(characterFromID("pir_cap26"));
			LAi_ActorRunToLocator(characterFromID("pir_cap26"), "goto", "L7", "", "");

			LAi_SetActorType(characterFromID("pir_cap30"));
			LAi_ActorRunToLocator(characterFromID("pir_cap30"), "goto", "L8", "", "");
			LAi_SetActorType(characterFromID("pir_cap27"));
			LAi_ActorRunToLocator(characterFromID("pir_cap27"), "goto", "L9", "", "");
			LAi_SetActorType(characterFromID("pir_cap29"));
			LAi_ActorRunToLocator(characterFromID("pir_cap29"), "goto", "L10", "", "");

			LAi_SetActorType(characterFromID("Friday"));
			LAi_ActorRunToLocator(characterFromID("Friday"), "goto", "R7", "", "");
			LAi_SetActorType(characterFromID("pir_cap14"));
			LAi_ActorRunToLocator(characterFromID("pir_cap14"), "goto", "R8", "", "");
			LAi_SetActorType(characterFromID("pir_cap22"));
			LAi_ActorRunToLocator(characterFromID("pir_cap22"), "goto", "R9", "", "");
			LAi_SetActorType(characterFromID("pir_cap31"));
			LAi_ActorRunToLocator(characterFromID("pir_cap31"), "goto", "R10", "", "");

			LAi_QuestDelay("Vane_at_port2", 3.5);
		break;

		case "Vane_at_port2":
			//LEFT
			ChangeCharacterAddressGroup(characterFromID("pir_cap18"), "wr_port", "goto", "L1");

			ChangeCharacterAddressGroup(characterFromID("pir_cap3"), "wr_port", "goto", "L2");
			ChangeCharacterAddressGroup(characterFromID("pir_cap16"), "wr_port", "goto", "L3");
			ChangeCharacterAddressGroup(characterFromID("pir_cap23"), "wr_port", "goto", "L4");
			ChangeCharacterAddressGroup(characterFromID("pir_cap4"), "wr_port", "goto", "L5");

			ChangeCharacterAddressGroup(characterFromID("pir_cap9"), "wr_port", "goto", "L6");
			ChangeCharacterAddressGroup(characterFromID("pir_cap26"), "wr_port", "goto", "L7");
			ChangeCharacterAddressGroup(characterFromID("pir_cap30"), "wr_port", "goto", "L8");
			ChangeCharacterAddressGroup(characterFromID("pir_cap27"), "wr_port", "goto", "L9");
			ChangeCharacterAddressGroup(characterFromID("pir_cap29"), "wr_port", "goto", "L10");

			//RIGHT
			ChangeCharacterAddressGroup(characterFromID("Friday"), "wr_port", "goto", "R7");
			ChangeCharacterAddressGroup(characterFromID("pir_cap14"), "wr_port", "goto", "R8");
			ChangeCharacterAddressGroup(characterFromID("pir_cap22"), "wr_port", "goto", "R9");
			ChangeCharacterAddressGroup(characterFromID("pir_cap31"), "wr_port", "goto", "R10");

			LAi_QuestDelay("Vane_at_port3", 1.0);
		break;

		case "Vane_at_port3":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "L3");

			LAi_QuestDelay("Vane_at_port4", 2.0);
		break;

		case "Vane_at_port4":
			LAi_ActorTurnToLocator(Pchar, "goto", "L9");

			LAi_QuestDelay("Vane_at_port5", 2.0);
		break;

		case "Vane_at_port5":
			LAi_ActorTurnToLocator(Pchar, "ships_other", "ship_6");

			LAi_QuestDelay("Vane_at_port6", 2.0);
		break;

		case "Vane_at_port6":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "swim_to_galleon";
		break;

		case "Vane_at_port7":
			//from Vane dialog
			PlaySound("OBJECTS\SHIPCHARGE\hurrah.wav");

			LAi_QuestDelay("Vane_at_port8", 1.0);
		break;

		case "Vane_at_port8":
			SetModel(characterFromID("pir_cap1"), "pir_cap1_redC_M", "man", "man", 1.8, false);
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "swim_to_galleon_&_shut_up";
		break;

		case "Vane_at_port9":
			//from Vane dialog
			SetModel(characterFromID("pir_cap8"), "pir_cap8_red_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap16"), "pir_cap16_red_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap18"), "pir_cap18_red_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap23"), "pir_cap23_red_M", "man", "man", 1.8, false);

			SetModel(characterFromID("pir_cap3"), "Animists1_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap4"), "Animists1_M_black", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap5"), "Animists1_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap7"), "Animists1_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap9"), "Animists1_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap14"), "Animists1_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap15"), "Animists1_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap22"), "Animists1_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap26"), "Animists1_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap27"), "Animists1_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap29"), "Animists1_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap30"), "Animists1_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap31"), "Animists1_M", "man", "man", 1.8, false);

			LAi_QuestDelay("Vane_at_port10A", 0.01);

			LAi_QuestDelay("Vane_at_port11", 0.5);
			LAi_QuestDelay("Vane_at_port12", 1.5);
			LAi_QuestDelay("Vane_at_port13", 2.5);
			LAi_QuestDelay("Vane_at_port14", 3.5);
			LAi_QuestDelay("Vane_at_port15", 4.5);
			LAi_QuestDelay("Vane_at_port16", 5.5);
			LAi_QuestDelay("Vane_at_port17", 6.5);
		break;
	//-------------------------------------------------------------------------------------------------------------
		case "Vane_at_port10A":
			LAi_SetSitType(characterFromID("pir_cap18"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap18"), "wr_port", "goto", "swim_L1");

			LAi_QuestDelay("Vane_at_port10B", 0.5);
		break;

		case "Vane_at_port10B":
			LAi_SetPlayerType(characterFromID("pir_cap18"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap18"), "wr_port", "goto", "swim_L2");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");

			CreateParticleSystemX("ball_splash", -8.4, -1.0, 17.1, 0.0, 0.0, 0.0, 0);
		break;
	//-------------------------------------------------------------------------------------------------------------
		case "Vane_at_port11":
			LAi_ActorRunToLocator(characterFromID("pir_cap3"), "goto", "L1", "", "");

			LAi_QuestDelay("Vane_at_port11A", 1.0);
		break;

		case "Vane_at_port11A":
			LAi_SetSitType(characterFromID("pir_cap3"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap3"), "wr_port", "goto", "swim_L1");

			LAi_QuestDelay("Vane_at_port11B", 0.5);
		break;

		case "Vane_at_port11B":
			LAi_SetPlayerType(characterFromID("pir_cap3"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap3"), "wr_port", "goto", "swim_L2");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash1.wav");
			CreateParticleSystemX("ball_splash", -8.4, -1.0, 17.1, 0.0, 0.0, 0.0, 0);
		break;
	//-------------------------------------------------------------------------------------------------------------
		case "Vane_at_port12":
			LAi_ActorRunToLocator(characterFromID("pir_cap16"), "goto", "L1", "", "");

			LAi_QuestDelay("Vane_at_port12A", 1.5);
		break;

		case "Vane_at_port12A":
			LAi_SetSitType(characterFromID("pir_cap16"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap16"), "wr_port", "goto", "swim_L1");

			LAi_QuestDelay("Vane_at_port12B", 0.5);
		break;

		case "Vane_at_port12B":
			LAi_SetPlayerType(characterFromID("pir_cap16"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap16"), "wr_port", "goto", "swim_L2");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash1.wav");
			CreateParticleSystemX("ball_splash", -8.4, -1.0, 17.1, 0.0, 0.0, 0.0, 0);
		break;
	//-------------------------------------------------------------------------------------------------------------
		case "Vane_at_port13":
			LAi_ActorRunToLocator(characterFromID("pir_cap23"), "goto", "L1", "", "");

			LAi_QuestDelay("Vane_at_port13A", 2.0);
		break;

		case "Vane_at_port13A":
			LAi_SetSitType(characterFromID("pir_cap23"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap23"), "wr_port", "goto", "swim_L1");

			LAi_QuestDelay("Vane_at_port13B", 0.5);
		break;

		case "Vane_at_port13B":
			LAi_SetPlayerType(characterFromID("pir_cap23"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap23"), "wr_port", "goto", "swim_L2");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			CreateParticleSystemX("ball_splash", -8.4, -1.0, 17.1, 0.0, 0.0, 0.0, 0);
		break;
	//-------------------------------------------------------------------------------------------------------------
		case "Vane_at_port14":
			LAi_ActorRunToLocator(characterFromID("pir_cap4"), "goto", "L1", "", "");

			LAi_QuestDelay("Vane_at_port14A", 2.5);
		break;

		case "Vane_at_port14A":
			LAi_SetSitType(characterFromID("pir_cap4"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap4"), "wr_port", "goto", "swim_L1");

			LAi_QuestDelay("Vane_at_port14B", 0.5);
		break;

		case "Vane_at_port14B":
			LAi_SetPlayerType(characterFromID("pir_cap4"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap4"), "wr_port", "goto", "swim_L2");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			CreateParticleSystemX("ball_splash", -8.4, -1.0, 17.1, 0.0, 0.0, 0.0, 0);
		break;
	//-------------------------------------------------------------------------------------------------------------
		case "Vane_at_port15":
			LAi_ActorRunToLocator(characterFromID("pir_cap9"), "goto", "L1", "", "");

			LAi_QuestDelay("Vane_at_port15A", 3.0);
		break;

		case "Vane_at_port15A":
			LAi_SetSitType(characterFromID("pir_cap9"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap9"), "wr_port", "goto", "swim_L1");

			LAi_QuestDelay("Vane_at_port15B", 0.5);
		break;

		case "Vane_at_port15B":
			LAi_SetPlayerType(characterFromID("pir_cap9"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap9"), "wr_port", "goto", "swim_L2");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash1.wav");
			CreateParticleSystemX("ball_splash", -8.4, -1.0, 17.1, 0.0, 0.0, 0.0, 0);
		break;
	//-------------------------------------------------------------------------------------------------------------
		case "Vane_at_port16":
			LAi_ActorRunToLocator(characterFromID("pir_cap26"), "goto", "L1", "", "");

			LAi_QuestDelay("Vane_at_port16A", 3.5);
		break;

		case "Vane_at_port16A":
			LAi_SetSitType(characterFromID("pir_cap26"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap26"), "wr_port", "goto", "swim_L1");

			LAi_QuestDelay("Vane_at_port16B", 0.5);
		break;

		case "Vane_at_port16B":
			LAi_SetPlayerType(characterFromID("pir_cap26"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap26"), "wr_port", "goto", "swim_L2");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			CreateParticleSystemX("ball_splash", -8.4, -1.0, 17.1, 0.0, 0.0, 0.0, 0);
		break;
	//-------------------------------------------------------------------------------------------------------------
		case "Vane_at_port17":
			LAi_ActorRunToLocator(characterFromID("pir_cap30"), "goto", "L1", "", "");

			LAi_QuestDelay("Vane_at_port17A", 3.5);
		break;

		case "Vane_at_port17A":
			LAi_SetSitType(characterFromID("pir_cap30"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap30"), "wr_port", "goto", "swim_L1");

			LAi_QuestDelay("Vane_at_port17B", 0.5);
		break;

		case "Vane_at_port17B":
			LAi_SetPlayerType(characterFromID("pir_cap30"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap30"), "wr_port", "goto", "swim_L2");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash1.wav");
			CreateParticleSystemX("ball_splash", -8.4, -1.0, 17.1, 0.0, 0.0, 0.0, 0);

			LAi_QuestDelay("Vane_at_port20", 5.0);
		break;
	//-------------------------------------------------------------------------------------------------------------
		case "Vane_at_port20":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "search_farm";
		break;

		case "Vane_at_port20A":
			//from Vane dialog
			PlaySound("VOICE\ENGLISH\pir_capIII.wav");

			LAi_QuestDelay("Vane_at_port20B", 0.5);
		break;

		case "Vane_at_port20B":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("pir_cap27"));

			LAi_QuestDelay("Vane_at_port20C", 1.5);
		break;

		case "Vane_at_port20C":
			ChangeCharacterAddressGroup(characterFromID("pir_cap18"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap3"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap16"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap23"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap4"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap9"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap26"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap30"), "none", "", "");

			LAi_SetActorType(characterFromID("pir_cap22"));
			LAi_ActorRunToLocator(characterFromID("pir_cap22"), "goto", "goto12", "", "");
			LAi_SetActorType(characterFromID("pir_cap31"));
			LAi_ActorRunToLocator(characterFromID("pir_cap31"), "goto", "goto12", "", "");
			LAi_SetActorType(characterFromID("pir_cap29"));
			LAi_ActorRunToLocator(characterFromID("pir_cap29"), "goto", "goto12", "", "");
			LAi_SetActorType(characterFromID("pir_cap27"));
			LAi_ActorRunToLocator(characterFromID("pir_cap27"), "goto", "goto12", "", "");

			LAi_QuestDelay("Vane_at_port22", 2.5);
		break;

		case "Vane_at_port22":
			PlaySound("VOICE\ENGLISH\pir_capR12.wav");
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("Selkirk"));

			LAi_QuestDelay("Vane_at_port23", 1.0);
		break;

		case "Vane_at_port23":
			ChangeCharacterAddressGroup(characterFromID("pir_cap22"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap31"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap27"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap29"), "none", "", "");

			LAi_SetActorType(characterFromID("pir_cap1"));
			LAi_ActorTurnToLocator(CharacterFromID("pir_cap1"), "ships_other", "ship_2");

			LAi_QuestDelay("Vane_at_port24A", 1.0);
		break;

	//-------------------------------------------------------------------------------------------------------------
		case "Vane_at_port24A":
			LAi_SetSitType(characterFromID("pir_cap1"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap1"), "wr_port", "goto", "swim_R1");

			LAi_QuestDelay("Vane_at_port24B", 0.5);

			LAi_QuestDelay("Vane_at_port25", 0.1);
			LAi_QuestDelay("Vane_at_port26", 1.0);
			LAi_QuestDelay("Vane_at_port27", 2.0);
			LAi_QuestDelay("Vane_at_port28", 3.0);
		break;

		case "Vane_at_port24B":
			LAi_SetPlayerType(characterFromID("pir_cap1"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap1"), "wr_port", "goto", "swim_R2");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			CreateParticleSystemX("ball_splash", -2.8, -1.0, 17.1, 0.0, 0.0, 0.0, 0);
		break;
	//-------------------------------------------------------------------------------------------------------------
		case "Vane_at_port25":
			LAi_ActorRunToLocator(characterFromID("pir_cap7"), "goto", "R1", "", "");

			LAi_QuestDelay("Vane_at_port25A", 1.0);
		break;

		case "Vane_at_port25A":
			LAi_SetSitType(characterFromID("pir_cap7"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap7"), "wr_port", "goto", "swim_R1");

			LAi_QuestDelay("Vane_at_port25B", 0.5);
		break;

		case "Vane_at_port25B":
			LAi_SetPlayerType(characterFromID("pir_cap7"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap7"), "wr_port", "goto", "swim_R2");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash1.wav");
			CreateParticleSystemX("ball_splash", -2.8, -1.0, 17.1, 0.0, 0.0, 0.0, 0);
		break;
	//-------------------------------------------------------------------------------------------------------------
		case "Vane_at_port26":
			LAi_ActorRunToLocator(characterFromID("pir_cap8"), "goto", "R1", "", "");

			LAi_QuestDelay("Vane_at_port26A", 1.5);
		break;

		case "Vane_at_port26A":
			LAi_SetSitType(characterFromID("pir_cap8"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap8"), "wr_port", "goto", "swim_R1");

			LAi_QuestDelay("Vane_at_port26B", 0.5);
		break;

		case "Vane_at_port26B":
			LAi_SetPlayerType(characterFromID("pir_cap8"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap8"), "wr_port", "goto", "swim_R2");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash1.wav");
			CreateParticleSystemX("ball_splash", -2.8, -1.0, 17.1, 0.0, 0.0, 0.0, 0);
		break;
	//-------------------------------------------------------------------------------------------------------------
		case "Vane_at_port27":
			LAi_ActorRunToLocator(characterFromID("Selkirk"), "goto", "R1", "", "");

			LAi_QuestDelay("Vane_at_port27A", 2.0);
		break;

		case "Vane_at_port27A":
			LAi_SetSitType(characterFromID("Selkirk"));
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "wr_port", "goto", "swim_R1");

			LAi_QuestDelay("Vane_at_port27B", 0.5);
		break;

		case "Vane_at_port27B":
			LAi_SetPlayerType(characterFromID("Selkirk"));
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "wr_port", "goto", "swim_R2");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			CreateParticleSystemX("ball_splash", -2.8, -1.0, 17.1, 0.0, 0.0, 0.0, 0);
		break;
	//-------------------------------------------------------------------------------------------------------------
		case "Vane_at_port28":
			LAi_SetPlayerType(Pchar);
			PlaySound("VOICE\ENGLISH\pir_capFF.wav");
			LAi_ActorRunToLocator(characterFromID("pir_cap5"), "goto", "R1", "", "");

			LAi_QuestDelay("Vane_at_port28A", 2.5);

			pchar.quest.Vane_at_port29_wait.win_condition.l1 = "locator";
			pchar.quest.Vane_at_port29_wait.win_condition.l1.location = "wr_port";
			pchar.quest.Vane_at_port29_wait.win_condition.l1.locator_group = "goto";
			pchar.quest.Vane_at_port29_wait.win_condition.l1.locator = "pchar_splash";
			pchar.quest.Vane_at_port29_wait.win_condition = "Vane_at_port29_wait";
		break;

		case "Vane_at_port28A":
			LAi_SetSitType(characterFromID("pir_cap5"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap5"), "wr_port", "goto", "swim_R1");

			LAi_QuestDelay("Vane_at_port28B", 0.5);
		break;

		case "Vane_at_port28B":
			LAi_SetPlayerType(characterFromID("pir_cap5"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap5"), "wr_port", "goto", "swim_R2");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			CreateParticleSystemX("ball_splash", -2.8, -1.0, 17.1, 0.0, 0.0, 0.0, 0);
		break;
	//-------------------------------------------------------------------------------------------------------------
		case "Vane_at_port29_wait":
			LAi_QuestDelay("Vane_at_port_pchar_splash", 0.5);
		break;

		case "Vane_at_port_pchar_splash":
			PlaySound("PEOPLE\jump_water.wav");
			CreateParticleSystemX("ball_splash", -2.8, -1.0, 17.1, 0.0, 0.0, 0.0, 0);

			LAi_QuestDelay("Vane_at_port29", 2.0);
		break;

		case "Vane_at_port29":
			LAi_SetPlayerType(characterFromID("Friday"));
			ChangeCharacterAddressGroup(characterFromID("Friday"), "wr_port", "goto", "swim_R2");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash1.wav");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash1.wav");
			CreateParticleSystemX("ball_splash", -2.8, -1.0, 17.1, 0.0, 0.0, 0.0, 0);

			LAi_QuestDelay("Vane_at_port30", 1.0);
		break;

		case "Vane_at_port30":
			LAi_SetPlayerType(characterFromID("pir_cap14"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap14"), "wr_port", "goto", "swim_R2");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			CreateParticleSystemX("ball_splash", -2.8, -1.0, 17.1, 0.0, 0.0, 0.0, 0);

			LAi_QuestDelay("Vane_at_corvette", 6.0);
		break;
	//-------------------------------------------------------------------------------------------------------------

	//[18] from here
		case "Vane_at_corvette":
			ChangeCharacterAddressGroup(characterFromID("pir_cap1"), "wr_corv_deck1", "goto", "gunner3");//was gunner4
			LAi_SetStayType(characterFromID("pir_cap1"));
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "wr_corv_capsm", "goto", "goto3");
			LAi_SetStayType(characterFromID("Selkirk"));

			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("wr_port")].image = "";

			LAi_QuestDelay("Vane_at_corvette1", 0.1);
		break;

		case "Vane_at_corvette1":
			//reset
			LAi_SetSitType(Pchar);
			Locations[FindLocation("wr_port")].image = "wr_port.tga";
			PlaySound("INTERFACE\anchor_up.wav");
			CreateParticleSystemX("ball_splash", -8.0, 0.0, 145.0, 0.0, 0.0, 0.0, 0);

		//ships parameters
			Locations[FindLocation("wr_ships")].locators_radius.box.box5 = 0.7;		//cannon up
			Locations[FindLocation("wr_ships")].locators_radius.box.box6 = 0.0001;		//cannon down - box not visible from start
			Locations[FindLocation("wr_ships")].locators_radius.box.box7 = 0.7;		//cannon high up

			Locations[FindLocation("wr_corv_smallcabin_R")].id.label = "Cabin";
			Locations[FindLocation("wr_corv_deck1")].models.always.locators = "deck1_l_JRH_fight";
			Locations[FindLocation("wr_corv_deck1")].reload.l5.disable = 1;			//to weather deck
			Locations[FindLocation("wr_corv_deck1")].reload.l4.disable = 1;			//small cab L
			Locations[FindLocation("wr_corv_deck1")].reload.l7.disable = 1;			//small cab R
			Locations[FindLocation("wr_corv_deck1")].models.always.l2 = "elevator&ropes_G1";//elevator down

			Locations[FindLocation("wr_corv_crew")].models.always.locators = "camp_deck_l_JRH1C";	//no belt but barrel
			Locations[FindLocation("wr_corv_crew")].reload.l1.disable = 0;		//to corv_deck1
			Locations[FindLocation("wr_corv_crew")].reload.l2.disable = 0;		//to capsmall
			Locations[FindLocation("wr_corv_crew")].reload.l1.emerge = "box3";

			Locations[FindLocation("wr_corv_capmd")].reload.l1.disable = 1;		//to wr_ships
			Locations[FindLocation("wr_corv_capmd")].reload.l2.disable = 1;		//to capsm via wc, open later

			Locations[FindLocation("wr_gall_deck2_stern")].locators_radius.box.box5 = 0.7;
			Locations[FindLocation("wr_gall_deck2_stern")].locators_radius.box.box6 = 0.7;
			Locations[FindLocation("wr_gall_deck2_stern")].locators_radius.reload.reload2 = 0.0001;
			Locations[FindLocation("wr_gall_deck2_stern")].locators_radius.reload.reload3 = 0.0001;

			Locations[FindLocation("wr_gall_deck2_stern")].locators_radius.reload.reload4 = 1.0;	//gold lock open
			Locations[FindLocation("wr_gall_deck2_stern")].locators_radius.box.box12 = 0.0001;

			LAi_SetStayType(characterFromID("pir_cap7"));
			LAi_SetStayType(characterFromID("pir_cap8"));
			LAi_SetStayType(characterFromID("pir_cap5"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap7"), "wr_corv_crew", "goto", "gunner1");
			ChangeCharacterAddressGroup(characterFromID("pir_cap8"), "wr_corv_crew", "goto", "gunner2");
			ChangeCharacterAddressGroup(characterFromID("pir_cap5"), "wr_corv_crew", "goto", "gunner3");

			LAi_QuestDelay("Vane_at_corvette2", 1.0);

			pchar.quest.Vane_at_corvette10.win_condition.l1 = "locator";
			pchar.quest.Vane_at_corvette10.win_condition.l1.location = "wr_corv_deck1";
			pchar.quest.Vane_at_corvette10.win_condition.l1.locator_group = "goto";
			pchar.quest.Vane_at_corvette10.win_condition.l1.locator = "box2";
			pchar.quest.Vane_at_corvette10.win_condition = "Vane_at_corvette10";
		break;

		case "Vane_at_corvette2":
			PlaySound("OBJECTS\DUEL\man_attack1.wav");

			ChangeCharacterAddressGroup(Pchar, "wr_port", "goto", "pchar_climb2");

			LAi_QuestDelay("Vane_at_corvette3", 1.0);
		break;

		case "Vane_at_corvette3":
			DoQuestReloadToLocation("wr_corv_deck1", "goto", "water", "Vane_at_corvette4");
		break;

		case "Vane_at_corvette4":
			//reset
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "gunner2");
			PlaySound("PEOPLE\step_wood.wav");
			PlaySound("PEOPLE\step_echo.wav");
			Pchar.quest.wet_gp = "yes";

			if(!IsEquipCharacterByItem(Pchar, "pistol20")) EquipCharacterbyItem(Pchar, "pistol20");
			SetModel(PChar, "PriestRedM_a", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			string weaponID9 = GetCharacterEquipByGroup(Pchar,GUN_ITEM_TYPE);
			aref weapon9;
			Items_FindItem(weaponID9, &weapon9);

			weapon9.model = "pistol201_w";
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE );
			EquipCharacterByItem(Pchar, "pistol20");
			EquipCharacterbyItem(Pchar, "ammobag2");

			LAi_QuestDelay("Vane_at_corvette8", 1.0);	//was 2.0
			LAi_QuestDelay("Vane_at_corvette9", 2.0);	//was 3.0
		break;
	//-------------------------------------------------------------------------------------------------------
		case "Vane_at_corvette8":
			PlaySound("PEOPLE\step_wood.wav");
			ChangeCharacterAddressGroup(characterFromID("pir_cap14"), "wr_corv_deck1", "goto", "water2");
			LAi_SetActorType(characterFromID("pir_cap14"));
			LAi_ActorRunToLocator(characterFromID("pir_cap14"), "goto", "gunner1", "Vane_at_corvette8A", 3.0);
		break;

		case "Vane_at_corvette8A":
			ChangeCharacterAddressGroup(characterFromID("pir_cap14"), "wr_corv_deck1", "goto", "gunner1");
			LAi_SetStayType(characterFromID("pir_cap14"));
		break;
	//-------------------------------------------------------------------------------------------------------
		case "Vane_at_corvette9":
			PlaySound("PEOPLE\step_wood.wav");
			ChangeCharacterAddressGroup(characterFromID("Friday"), "wr_corv_deck1", "goto", "water4");
			LAi_SetActorType(characterFromID("Friday"));
			LAi_ActorRunToLocator(characterFromID("Friday"), "goto", "water4A", "Vane_at_corvette9A", 2.0);
			LAi_SetPlayerType(Pchar);
		break;

		case "Vane_at_corvette9A":
			LAi_ActorRunToLocator(characterFromID("Friday"), "goto", "water4B", "Vane_at_corvette9B", 1.0);
		break;

		case "Vane_at_corvette9B":
			LAi_ActorRunToLocator(characterFromID("Friday"), "goto", "gunner2", "Vane_at_corvette9C", 2.0);
		break;

		case "Vane_at_corvette9C":
			ChangeCharacterAddressGroup(characterFromID("Friday"), "wr_corv_deck1", "goto", "gunner2");
			LAi_SetStayType(characterFromID("Friday"));
		break;

		case "Vane_at_corvette10":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "cannons_ready";
		break;
	//-------------------------------------------------------------------------------------------------------
		case "yellow_jump_crate2":
			ChangeCharacterAddressGroup(Pchar, "wr_corv_deck1", "reload", "reload11");
		break;

		case "yellow_jump_crate3":
			ChangeCharacterAddressGroup(Pchar, "wr_corv_deck1", "goto", "box2");
		break;
	//-------------------------------------------------------------------------------------------------------
		case "Vane_at_corvette11":
			//from Vane dialog
			LAi_SetActorType(characterFromID("pir_cap1"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap1"), "goto", "gunner3_pipe");
			AddQuestRecord("Revenge", "3");
		Locations[FindLocation("wr_corv_capsm")].models.always.locators = "capsm_l_JRH1";

			LAi_QuestDelay("Vane_at_corvette11A", 1.0);

			pchar.quest.Vane_at_corvette12.win_condition.l1 = "locator";
			pchar.quest.Vane_at_corvette12.win_condition.l1.location = "wr_corv_crew";
			pchar.quest.Vane_at_corvette12.win_condition.l1.locator_group = "goto";
			pchar.quest.Vane_at_corvette12.win_condition.l1.locator = "goto12";
			pchar.quest.Vane_at_corvette12.win_condition = "Vane_at_corvette12";
		break;

		case "Vane_at_corvette11A":
			LAi_SetStayType(characterFromID("pir_cap1"));
		break;

		case "Vane_at_corvette12":
			LAi_QuestDelay("Vane_at_corvette5", 0.1);

			pchar.quest.Vane_corvette_fight.win_condition.l1 = "locator";
			pchar.quest.Vane_corvette_fight.win_condition.l1.location = "wr_corv_capmd";
			pchar.quest.Vane_corvette_fight.win_condition.l1.locator_group = "goto";
			pchar.quest.Vane_corvette_fight.win_condition.l1.locator = "goto4";
			pchar.quest.Vane_corvette_fight.win_condition = "Vane_corvette_fight";
		break;

		case "Vane_at_corvette5":
			if(CheckCharacterItem(Pchar,"bladebarrel2"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterbyItem(Pchar, "bladebarrel2");
			}
			else LAi_QuestDelay("Vane_at_corvette5", 0.5);
		break;
	//-------------------------------------------------------------------------------------------------------
		case "enter_via_wc":
			//from itemlogic
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto3");		//Selkirk

			LAi_QuestDelay("enter_via_wc1", 1.0);
		break;

		case "enter_via_wc1":
			LAi_SetPlayerType(Pchar);
			//PlaySound("VOICE\ENGLISH\Eng_m_c_076.wav");
			PlaySound("VOICE\ENGLISH\Eng_m_c_040.wav");
		break;
	//-------------------------------------------------------------------------------------------------------
		case "Vane_at_corvette6":
			//from itemlogic: placing barrel
			PlaySound("PEOPLE\step_echo.wav");
			LAi_SetFightMode(Pchar, false);
			LAi_LocationFightDisable(&Locations[FindLocation("wr_corv_capsm")], true);
			Locations[FindLocation("wr_corv_capsm")].image = "Deck_Capsm.tga";

			Locations[FindLocation("wr_ships")].models.always.locators = "udeck_l_JRH_S1";
			Locations[FindLocation("wr_ships")].locators_radius.box.box8 = 0.5;
			Locations[FindLocation("wr_ships")].locators_radius.box.box9 = 0.0001;
			Locations[FindLocation("wr_ships")].locators_radius.box.box11 = 0.0001;
			Locations[FindLocation("wr_ships")].locators_radius.box.box15 = 0.5;
			Locations[FindLocation("wr_ships")].locators_radius.reload.reload2 = 0.0001;	//to boat
			Locations[FindLocation("wr_ships")].locators_radius.reload.reload7 = 0.0001;	//to wr_corv_deck1
			Locations[FindLocation("wr_ships")].reload.l5.disable = 0;			//to capmd
			Locations[FindLocation("wr_ships")].reload.l6.disable = 1;			//to crew
			Locations[FindLocation("wr_ships")].reload.l8.disable = 1;			//to stern
			Locations[FindLocation("wr_ships")].reload.l9.disable = 1;			//to stern
			Locations[FindLocation("wr_ships")].reload.l10.disable = 1;			//to prow
			Locations[FindLocation("wr_ships")].reload.l11.disable = 1;			//to prow

			Locations[FindLocation("wr_ships")].locators_radius.reload.reload6 = 1.0;//visible to crew but blocked

			Locations[FindLocation("wr_ships")].models.always.l2 = "";
			Locations[FindLocation("wr_ships")].models.always.l3 = "";
			Locations[FindLocation("wr_ships")].models.always.l4 = "cannon_pipe";
			Locations[FindLocation("wr_ships")].models.always.l5 = "anchor_lost";		//was anchor1
			Locations[FindLocation("wr_ships")].models.always.l6 = "elevator&ropes_C1";
			Locations[FindLocation("wr_ships")].models.always.l7 = "elevator&ropes_G1";
			Locations[FindLocation("wr_ships")].models.always.l8 = "";
			Locations[FindLocation("wr_ships")].models.always.l9 = "plank1";		//deck
			Locations[FindLocation("wr_ships")].models.always.l10 = "pinion_small_L";
			Locations[FindLocation("wr_ships")].models.always.l11 = "pinion_large_R";
			Locations[FindLocation("wr_ships")].models.always.l13 = "wheel_R";
			Locations[FindLocation("wr_ships")].models.always.l14 = "";
			Locations[FindLocation("wr_ships")].models.always.l15 = "";
			Locations[FindLocation("wr_ships")].models.always.l16 = "";
			Locations[FindLocation("wr_ships")].models.always.l17 = "steering_wheel";
			Locations[FindLocation("wr_ships")].models.always.l18 = "door_broken";

			Locations[FindLocation("wr_ships")].locators_radius.reload.reload12 = 0.0001;
			Locations[FindLocation("wr_ships")].locators_radius.box.box4 = 0.0001;
			Locations[FindLocation("wr_ships")].locators_radius.goto.mast1 = 3.5;

			Locations[FindLocation("wr_gall_deck2_prow")].locators_radius.box.box1 = 1.0;
			Locations[FindLocation("wr_gall_deck2_prow")].locators_radius.box.box2 = 1.0;
			Locations[FindLocation("wr_gall_deck2_prow")].locators_radius.reload.reload2 = 0.0001;
			Locations[FindLocation("wr_gall_deck2_prow")].locators_radius.reload.reload3 = 0.0001;

			Locations[FindLocation("wr_gall_hold_first")].models.always.l4 = "";// no elevator&ropes on hold floor

			Pchar.quest.ship_wc = "start";
			Pchar.quest.captains_door = "closed";
			Pchar.quest.ammodeck = "locked";
			Pchar.quest.guncrew = "locked_in";			//free later
			Pchar.quest.anchor = "up";
			Pchar.quest.pinion_pos_left = "small";			//(small, large)
			Pchar.quest.pinion_pos_right = "large";			//(small, large)
			Pchar.quest.wheel_pos_left = "free";			//(wheel)
			Pchar.quest.wheel_pos_right = "wheel";			//(wheel)
			Pchar.quest.anchor_mechanism = "anchor_lost";		//(complete, anchor_lost)
			Pchar.quest.deck_position = "elsewhere";		//(cannon, mechanism_L, mechanism_R)

			Pchar.quest.guncrew = "locked_in";			//are they?
			Pchar.quest.elevatorG_status = "elevator_ready";
			Pchar.quest.bladeirontool = "picked_up";
			Pchar.quest.plank_position = "deck";
			Pchar.quest.elevator_position = "deck";
			Pchar.quest.pistolwheel = "picked_up";
			Pchar.quest.elevator_ropes = "picked_up";
			Pchar.quest.deck_cannon = "no_ropes";			//new situation
			Pchar.quest.anchor_lost = "up";				//new
			Pchar.quest.anchor_size = "small";			//(small) (large earlier)

			Pchar.quest.cannon_ram = "0";
			Pchar.quest.cannon_wad = "0";				//0 means not even "ready"
			Pchar.quest.cannon_enable_move = "no";
			Pchar.quest.cannon_priming = "no";
			Pchar.quest.cannon_temp = "cold";
			Pchar.quest.cannon_powder = "0";
			Pchar.quest.cannon_ball = "0";
			Pchar.quest.deck_bell = "broken";
			Pchar.quest.cannon_goodspile = "current";

			Pchar.quest.pistolclub = "know_how";
			Pchar.quest.pistolthrow = "know_how";

			SetCharacterShipLocation(characterFromID("wr_aub"), "none");//boat2 at wr_ships

			ChangeCharacterAddressGroup(CharacterFromID("wr_aub"), "none", "", "");		//killed earlier
			ChangeCharacterAddressGroup(CharacterFromID("wr_sail7"), "none", "", "");	//killed earlier
			ChangeCharacterAddressGroup(CharacterFromID("wr_cor1"), "none", "", "");	//killed earlier
			ChangeCharacterAddressGroup(CharacterFromID("wr_wll3"), "none", "", "");	//killed earlier
			ChangeCharacterAddressGroup(characterFromID("wr_kor1"), "wr_corv_capmd", "sit", "sit5");
			ChangeCharacterAddressGroup(characterFromID("wr_man5_1"), "wr_corv_capmd", "sit", "sit6");
			ChangeCharacterAddressGroup(characterFromID("wr_fsh1"), "none", "", "");
			LAi_SetSitType(characterFromID("wr_kor1"));
			LAi_SetSitType(characterFromID("wr_man5_1"));
			LAi_NoRebirthEnable(characterFromID("wr_kor1"));
			LAi_NoRebirthEnable(characterFromID("wr_man5_1"));
			GiveItem2Character(CharacterFromID("wr_man5_1"), "cognac");
			GiveItem2Character(CharacterFromID("wr_kor1"), "cognac");
		break;
	//-----------------------------------------------------------------------------------------------------
		case "Vane_corvette_fight":
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "wr_corv_capmd", "goto", "goto3");
			LAi_SetOfficerType(characterFromID("Selkirk"));

			pchar.quest.Vane_corvette_fight1.win_condition.l1 = "locator";
			pchar.quest.Vane_corvette_fight1.win_condition.l1.location = "wr_corv_capmd";
			pchar.quest.Vane_corvette_fight1.win_condition.l1.locator_group = "goto";
			pchar.quest.Vane_corvette_fight1.win_condition.l1.locator = "goto5";
			pchar.quest.Vane_corvette_fight1.win_condition = "Vane_corvette_fight1";
		break;

		case "Vane_corvette_fight1":
			LAi_group_Register("WR_GUARDS_4");
			LAi_group_SetRelation(LAI_GROUP_PLAYER, "WR_GUARDS_4", LAI_GROUP_ENEMY);
			LAi_group_FightGroups(LAI_GROUP_PLAYER, "WR_GUARDS_4", true);

			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "pchar", "Vane_corvette_fight4", 2.0);
			LAi_SetActorType(characterFromID("Selkirk"));
			LAi_ActorGoToLocator(characterFromID("Selkirk"), "goto", "selkirk", "Vane_corvette_fight5", 3.0);

			LAi_QuestDelay("Vane_corvette_fight2", 1.0);
			LAi_QuestDelay("Vane_corvette_fight3", 2.0);
			LAi_QuestDelay("Vane_corvette_fight6B", 8.5);	//was fight6 & 6.0
		break;

		case "Vane_corvette_fight2":
			LAi_SetStayType(characterFromID("wr_kor1"));

			LAi_QuestDelay("Vane_corvette_fight2A", 1.0);
		break;

		case "Vane_corvette_fight2A":
			ChangeCharacterAddressGroup(characterFromID("wr_kor1"), "wr_corv_capmd", "goto", "stay5");
			LAi_SetActorType(characterFromID("wr_kor1"));
			LAi_ActorAttack(CharacterFromID("wr_kor1"), Pchar, "");
			LAi_group_MoveCharacter(characterFromID("wr_kor1"), "WR_GUARDS_4");

			LAi_group_MoveCharacter(characterFromID("Selkirk"), LAI_GROUP_PLAYER);
		break;

		case "Vane_corvette_fight3":
			LAi_SetStayType(characterFromID("wr_man5_1"));

			LAi_QuestDelay("Vane_corvette_fight3A", 1.0);
		break;

		case "Vane_corvette_fight3A":
			ChangeCharacterAddressGroup(characterFromID("wr_man5_1"), "wr_corv_capmd", "goto", "stay6");
			LAi_SetActorType(characterFromID("wr_man5_1"));
			LAi_ActorAttack(CharacterFromID("wr_man5_1"), Pchar, "");
			LAi_group_MoveCharacter(characterFromID("wr_man5_1"), "WR_GUARDS_4");
		break;

		case "Vane_corvette_fight4":
			ChangeCharacterAddressGroup(Pchar, "wr_corv_capmd", "goto", "pchar");
			LAi_SetPlayerType(Pchar);
		break;

		case "Vane_corvette_fight5":
			LAi_SetActorType(characterFromID("Selkirk"));
			LAi_ActorAttack(CharacterFromID("Selkirk"), characterFromID("wr_man5_1"), "");

			LAi_QuestDelay("Vane_corvette_fight10", 1.0);
			LAi_QuestDelay("Vane_corvette_fight11", 1.0);
		break;

		case "Vane_corvette_fight8":
			if(!LAi_IsDead(CharacterFromID("wr_kor1")))
			{
				LAi_SetActorType(characterFromID("Selkirk"));
				LAi_ActorAttack(CharacterFromID("Selkirk"), characterFromID("wr_kor1"), "");
			}
		break;

		case "Vane_corvette_fight6B":
			Pchar.quest.Vane_corvette_fight7.win_condition.l1 = "NPC_Death";
			Pchar.quest.Vane_corvette_fight7.win_condition.l1.character = "wr_kor1";
			Pchar.quest.Vane_corvette_fight7.win_condition.l2 = "NPC_Death";
			Pchar.quest.Vane_corvette_fight7.win_condition.l2.character = "wr_man5_1";
			Pchar.quest.Vane_corvette_fight7.win_condition = "Vane_corvette_fight7";
		break;

		case "Vane_corvette_fight7":
			if(!IsEquipCharacterByItem(Pchar, "pistol20")) EquipCharacterbyItem(Pchar, "pistol20");
			SetModel(PChar, "PriestRedM_a", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			string weaponID12 = GetCharacterEquipByGroup(Pchar,GUN_ITEM_TYPE);
			aref weapon12;
			Items_FindItem(weaponID12, &weapon12);

			weapon12.model = "pistol201";
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE );
			EquipCharacterByItem(Pchar, "pistol20");
			EquipCharacterbyItem(Pchar, "ammobag2");

			Locations[FindLocation("wr_corv_capmd")].reload.l2.disable = 0;		//capsm via wc
			TakeNItems(Pchar,"gunpowder", -100);
			LAi_SetActorType(characterFromID("Selkirk"));
			LAi_ActorGoToLocator(characterFromID("Selkirk"), "goto", "search_key", "Vane_corvette_fight9", 3.0);

			LAi_QuestDelay("end_corvette_fight", 5.0);	//was 3.0 like above

			Pchar.quest.corvette_cabin_dry_gp.win_condition.l1 = "item";
			Pchar.quest.corvette_cabin_dry_gp.win_condition.l1.character = Pchar.id;
			Pchar.quest.corvette_cabin_dry_gp.win_condition.l1.item = "gunpowder";
			Pchar.quest.corvette_cabin_dry_gp.win_condition = "corvette_cabin_dry_gp";
		break;

		case "corvette_cabin_dry_gp":
			Pchar.quest.wet_gp = "no";

			Logit(LanguageConvertString(tmpLangFileID,"Finally I got some dry gunpowder!"));
			PlaySound("OBJECTS\DUEL\man_attack6.wav");
		break;

		case "Vane_corvette_fight9":
			LAi_SetStayType(characterFromID("Selkirk"));
		break;

		case "Vane_corvette_fight10":
			if(LAi_IsDead(CharacterFromID("wr_kor1")) && LAi_IsDead(CharacterFromID("wr_man5_1")) )
			{
				return;
			}
			else
			{
				if(!IsEquipCharacterByItem(characterFromID("Selkirk"), "bladespyglass6"))
				{
					RemoveCharacterEquip(characterFromID("Selkirk"), BLADE_ITEM_TYPE );
					if(!CheckCharacterItem(characterFromID("Selkirk"), "bladespyglass6"));
					{
						GiveItem2Character(characterFromID("Selkirk"), "bladespyglass6");
					}
					EquipCharacterbyItem(characterFromID("Selkirk"), "bladespyglass6");
				}
				else LAi_QuestDelay("Vane_corvette_fight10", 1.0);
			}
		break;

		case "Vane_corvette_fight11":
			if(LAi_IsDead(CharacterFromID("wr_kor1")) && LAi_IsDead(CharacterFromID("wr_man5_1")) )
			{
				return;
			}
			else
			{
				if(!IsEquipCharacterByItem(Pchar, "bladeanchor"))
				{
					RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE );
					if(!CheckCharacterItem(Pchar, "bladeanchor"));
					{
						GiveItem2Character(Pchar, "bladeanchor");
					}
					EquipCharacterbyItem(Pchar, "bladeanchor");
				}
				else LAi_QuestDelay("Vane_corvette_fight11", 1.0);
			}
		break;

		case "end_corvette_fight":
			RemoveCharacterEquip(characterFromID("Selkirk"), BLADE_ITEM_TYPE );
			GiveItem2Character(CharacterFromID("Selkirk"), "blade1");
			EquipCharacterbyItem(characterFromID("Selkirk"), "blade1");
			GiveItem2Character(CharacterFromID("Selkirk"), "pistol5");
			EquipCharacterbyItem(characterFromID("Selkirk"), "pistol5");
			TakeNItems(CharacterFromID("Selkirk"),"pistolbullets", 6);
			TakeNItems(CharacterFromID("Selkirk"),"gunpowder", 6);

			LAi_SetActorType(Pchar);

			LAi_SetActorType(characterFromID("Selkirk"));
			LAi_ActorGoToLocator(characterFromID("Selkirk"), "goto", "stay_key", "end_corvette_fight1", 3.0);
		break;

		case "end_corvette_fight1":
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorDialog(characterFromID("Selkirk"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Selkirk"));
			Characters[GetCharacterIndex("Selkirk")].dialog.CurrentNode  = "got_the_key";
		break;

		case "end_corvette_fight2":
			//from Selkirk dialog
			GiveItem2Character(Pchar, "blade1");
			TakeNItems(Pchar,"gunpowder", 18);
			TakeNItems(Pchar,"cognac", 2);

			LAi_QuestDelay("end_corvette_fight7", 1.5);
		break;

		case "end_corvette_fight7":
			LAi_ActorGoToLocator(characterFromID("Selkirk"), "goto", "unlock_key", "end_corvette_fight8", 2.0);
		break;

		case "end_corvette_fight8":
			PlaySound("INTERFACE\key_unlock.wav");
			Locations[FindLocation("wr_corv_capmd")].reload.l1.disable = 0;		//to wr_ships
			ChangeCharacterAddressGroup(Pchar, "wr_corv_capmd", "goto", "pchar");
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("Selkirk"));

			LAi_QuestDelay("end_corvette_fight9", 2.0);
		break;

		case "end_corvette_fight9":
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "wr_ships", "goto", "selkirk_wait");
			LAi_SetPlayerType(Pchar);

			Pchar.quest.corvette_status = "schhh";

			SetCurrentTime(23.00, 0);
			SetNextWeather("Clear");

			locations[FindLocation("wr_ships")].type = "party";

			pchar.quest.end_corvette_fight10.win_condition.l1 = "location";
			pchar.quest.end_corvette_fight10.win_condition.l1.location = "wr_ships";
			pchar.quest.end_corvette_fight10.win_condition = "end_corvette_fight10";
		break;

		case "end_corvette_fight10":
			SetCurrentTime(23.00, 0);
			SetNextWeather("Clear");

			LAi_SetPlayerType(Pchar);
			LAi_SetofficerType(characterFromID("Selkirk"));

			pchar.quest.Vane_broadside.win_condition.l1 = "locator";
			pchar.quest.Vane_broadside.win_condition.l1.location = "wr_ships";
			pchar.quest.Vane_broadside.win_condition.l1.locator_group = "goto";
			pchar.quest.Vane_broadside.win_condition.l1.locator = "mast1";
			pchar.quest.Vane_broadside.win_condition = "Vane_broadside";
		break;
	//--------------------------------------------------------------------------------------------------------
		case "Vane_broadside":
			Pchar.quest.pistolthrow = "not_yet";		//just in case, is reset after cabin fight
			LAi_SetStayType(Pchar);
			LAi_SetActorType(characterFromID("Selkirk"));
			LAi_ActorRunToLocator(characterFromID("Selkirk"), "goto", "selkirk_gunner", "Vane_broadside1", 4.0);
		break;

		case "Vane_broadside1":
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "wr_ships", "goto", "selkirk_gunner");

			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorDialog(characterFromID("Selkirk"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Selkirk"));
			Characters[GetCharacterIndex("Selkirk")].dialog.CurrentNode  = "cannon_is_loaded";
		break;

		case "Vane_broadside2":
			//from Vane dialog
			LAi_SetPlayerType(Pchar);
			LAi_ActorTurnToLocator(CharacterFromID("Selkirk"), "goto", "goto6");

			LAi_QuestDelay("Vane_broadside3", 1.0);
		break;

		case "Vane_broadside3":
			LAi_SetStayType(characterFromID("Selkirk"));
		break;
	//-----------------------------------------------------------------------------------------------------
		case "anchor_placed_at_corvette":
			//from itemlogic box14
			Locations[FindLocation("wr_ships")].image = "";
			DoQuestReloadToLocation("wr_ships", "goto", "prow", "anchor_placed_at_corvette1");
		break;

		case "anchor_placed_at_corvette1":
			PlaySound("PEOPLE\creak2.wav");
			LAi_SetFightMode(Pchar, false);
			LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], true);
			Locations[FindLocation("wr_ships")].image = "wr_ships.tga";
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("anchor_placed_at_corvette2", 1.5);
		break;

		case "anchor_placed_at_corvette2":
			LAi_SetSitType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "wr_ships", "goto", "pickup_ropes");
			PlaySound("PEOPLE\step_wood.wav");
			PlaySound("PEOPLE\step_wood.wav");

			LAi_QuestDelay("jump_corvette", 0.5);
		break;

		case "jump_corvette":
			LAi_SetPlayerType(Pchar);
			Pchar.quest.broadside = "prepared";
		break;
	//-----------------------------------------------------------------------------------------------------
		case "anchor_guard1":
			PlaySound("INTERFACE\closet_open.wav");
			PlaySound("AMBIENT\galleon_party.wav");

			LAi_QuestDelay("anchor_guard1_A", 1.5);
		break;

		case "anchor_guard1_A":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload9");
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorTurnToLocator(CharacterFromID("Selkirk"), "reload", "reload9");

			LAi_QuestDelay("anchor_guard1_B", 1.0);
		break;

		case "anchor_guard1_B":
			PlaySound("VOICE\ENGLISH\blaze_what_was_that.wav");
			LAi_SetSitType(Pchar);
			LAi_SetSitType(CharacterFromID("Selkirk"));

			LAi_QuestDelay("anchor_guard1_C", 1.5);
		break;

		case "anchor_guard1_C":
			PlaySound("VOICE\ENGLISH\blaze_drunk1.wav");

			LAi_QuestDelay("anchor_guard1_D", 2.0);
		break;

		case "anchor_guard1_D":
			PlaySound("VOICE\ENGLISH\blaze_lets_go.wav");

			LAi_QuestDelay("anchor_guard1_E", 2.0);
		break;

		case "anchor_guard1_E":
			PlaySound("INTERFACE\closed_door.wav");

			LAi_QuestDelay("anchor_guard1_F", 1.0);
		break;

		case "anchor_guard1_F":
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
			LAi_SetPlayerType(Pchar);
			LAi_SetStayType(characterFromID("Selkirk"));
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "wr_ships", "goto", "selkirk_gunner");
		break;
	//-----------------------------------------------------------------------------------------------------
		case "anchor_guard2":
			PlaySound("INTERFACE\closet_open.wav");
			PlaySound("AMBIENT\galleon_party.wav");

			LAi_QuestDelay("anchor_guard2_A", 1.5);
		break;

		case "anchor_guard2_A":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload9");
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorTurnToLocator(CharacterFromID("Selkirk"), "reload", "reload9");

			LAi_QuestDelay("anchor_guard2_B", 1.0);
		break;

		case "anchor_guard2_B":
			PlaySound("VOICE\ENGLISH\blaze_heard_something.wav");
			LAi_SetSitType(Pchar);
			LAi_SetSitType(CharacterFromID("Selkirk"));

			LAi_QuestDelay("anchor_guard2_C", 1.5);
		break;

		case "anchor_guard2_C":
			PlaySound("VOICE\ENGLISH\blaze_drunk2.wav");

			LAi_QuestDelay("anchor_guard2_D", 3.0);
		break;

		case "anchor_guard2_D":
			PlaySound("OBJECTS\DUEL\man_attack5.wav");

			LAi_QuestDelay("anchor_guard2_E", 1.0);
		break;

		case "anchor_guard2_E":
			PlaySound("INTERFACE\closed_door.wav");

			LAi_QuestDelay("anchor_guard2_F", 1.0);
		break;

		case "anchor_guard2_F":
			PlaySound("VOICE\ENGLISH\blaze_puh.wav");
			LAi_SetPlayerType(Pchar);
			LAi_SetStayType(characterFromID("Selkirk"));
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "wr_ships", "goto", "selkirk_gunner");
		break;
	//-----------------------------------------------------------------------------------------------------
		case "corvette_broadside":
			PlaySound("INTERFACE\closet_open.wav");
			PlaySound("AMBIENT\galleon_party.wav");

			LAi_QuestDelay("corvette_broadside1", 1.5);
		break;

		case "corvette_broadside1":
			PlaySound("VOICE\ENGLISH\alarm1.wav");
			ChangeCharacterAddressGroup(characterFromID("wr_pir7"), "wr_ships", "goto", "alarm");
			LAi_SetActorType(CharacterFromID("wr_pir7"));
			LAi_ActorTurnToCharacter(characterFromID("wr_pir7"), Pchar);
			LAi_NoRebirthEnable(characterFromID("wr_pir7"));

			if(CheckCharacterItem(Pchar, "blade1"));
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "bladeX4");
				EquipCharacterByItem(Pchar, "blade1");
			}

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload9");
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorTurnToLocator(CharacterFromID("Selkirk"), "reload", "reload9");

			LAi_QuestDelay("corvette_broadside4", 1.5);
		break;
	//-----------------------------------------------------------------------------------------------------
		case "corvette_broadside4":
			LAi_SetSitType(characterFromID("Selkirk"));
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "wr_ships", "goto", "selkirk_gunner");

			LAi_QuestDelay("corvette_broadside4_A", 0.5);	//was 1.0
		break;

		case "corvette_broadside4_A":
			LAi_SetStayType(characterFromID("Selkirk"));
			PlaySound("OBJECTS\SHIPCHARGE\CR18C.wav");
			PlaySound("OBJECTS\SHIPCHARGE\CR24C.wav");
			CreateParticleSystem("smoke_short" , -4.7, 3.2, 8.2, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , -4.7, 3.2, 8.2, 4.5, 1.5, 0.0, sti(20) );

			CreateParticleSystem("gunfire_red" , -4.7, 3.2, 8.2, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire_red" , -4.7, 3.2, 8.2, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire_red" , -4.7, 3.2, 8.2, 0.0, 4.5, 0.0, sti(20) );

			CreateParticleSystem("gunfire" , -4.7, 3.2, 8.2, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , -4.7, 3.2, 8.2, 0.0, 4.5, 0.0, sti(20) );

			CreateParticleSystem("splinters", -5.9, 3.6, 8.2, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -5.9, 3.6, 8.2, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", -5.9, 3.6, 8.2, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -5.9, 3.6, 8.2, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("blast_dirt" , -5.9, 3.6, 8.2, 0.0, 0.0, 0.0, sti(20) );

			LAi_KillCharacter(CharacterFromID("wr_pir7"));

			LAi_QuestDelay("kill_pir7_sound", 0.5);
			LAi_QuestDelay("corvette_broadside2", 3.0);
			LAi_QuestDelay("corvette_broadside4_B", 5.0);

		break;

		case "kill_pir7_sound":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead6.wav");
		break;

		case "corvette_broadside4_B":
			CreateParticleSystem("smoke_short" , -4.7, 3.2, 8.2, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , -4.7, 3.2, 8.2, 4.5, 1.5, 0.0, sti(20) );

			LAi_QuestDelay("corvette_broadside4_C", 5.0);
		break;

		case "corvette_broadside4_C":
			CreateParticleSystem("smoke_short" , -4.7, 3.2, 8.2, 4.5, 1.5, 0.0, sti(20) );
		break;
	//-----------------------------------------------------------------------------------------------------
		case "corvette_broadside2":
			PlaySound("OBJECTS\SHIPCHARGE\CannonReload-002.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "friday_gunner");

			LAi_QuestDelay("corvette_broadside3_1", 1.0);
			LAi_QuestDelay("corvette_broadside3_2", 1.5);
			LAi_QuestDelay("corvette_broadside3_3", 1.8);
			LAi_QuestDelay("corvette_broadside3_4", 2.1);
			LAi_QuestDelay("corvette_broadside3_5", 2.3);
			LAi_QuestDelay("corvette_broadside3_6", 2.7);
		break;
	//...............................................................................................
		case "corvette_broadside3_1":
			PlaySound("OBJECTS\SHIPCHARGE\LG24J.wav");
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire1.wav");

			CreateParticleSystem("smoke_short" , -4.6, 2.7, 11.5, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , -4.6, 2.7, 11.5, 4.5, 1.5, 0.0, sti(20) );

			CreateParticleSystem("splinters", -5.0, 4.5, 11.5, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -5.0, 4.5, 11.5, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", -5.0, 4.5, 11.5, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -5.0, 4.5, 11.5, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("blast_dirt" , -5.5, 2.7, 11.5, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("corvette_broadside3_1A", 5.0);
		break;

		case "corvette_broadside3_1A":
			CreateParticleSystem("smoke_short" , -4.6, 2.7, 11.5, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , -4.6, 2.7, 11.5, 4.5, 1.5, 0.0, sti(20) );

			LAi_QuestDelay("corvette_broadside3_1B", 5.0);
		break;

		case "corvette_broadside3_1B":
			CreateParticleSystem("smoke_short" , -4.6, 2.7, 11.5, 4.5, 1.5, 0.0, sti(20) );
		break;
	//...............................................................................................
		case "corvette_broadside3_2":
			PlaySound("OBJECTS\SHIPCHARGE\LG24J.wav");
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire1.wav");

			CreateParticleSystem("smoke_short" , -4.9, 2.7, 7.1, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , -4.9, 2.7, 7.1, 4.5, 1.5, 0.0, sti(20) );

			CreateParticleSystem("splinters", -5.0, 4.5, 7.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -5.0, 4.5, 7.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", -5.0, 4.5, 7.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -5.0, 4.5, 7.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("blast_dirt" , -5.5, 2.7, 7.1, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("corvette_broadside3_2A", 5.0);
		break;

		case "corvette_broadside3_2A":
			CreateParticleSystem("smoke_short" , -4.9, 2.7, 7.1, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , -4.9, 2.7, 7.1, 4.5, 1.5, 0.0, sti(20) );

			LAi_QuestDelay("corvette_broadside3_2B", 5.0);
		break;

		case "corvette_broadside3_2B":
			CreateParticleSystem("smoke_short" , -4.9, 2.7, 7.1, 4.5, 1.5, 0.0, sti(20) );
		break;
	//...............................................................................................
		case "corvette_broadside3_3":
			PlaySound("OBJECTS\SHIPCHARGE\LG24J.wav");
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire1.wav");

			CreateParticleSystem("smoke_short" , -4.8, 2.7, 2.1, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , -4.8, 2.7, 2.1, 4.5, 1.5, 0.0, sti(20) );

			CreateParticleSystem("splinters", -5.0, 4.5, 2.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -5.0, 4.5, 2.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", -5.0, 4.5, 2.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -5.0, 4.5, 2.1, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("blast_dirt" , -5.5, 2.7, 2.1, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("corvette_broadside3_3A", 5.0);
		break;

		case "corvette_broadside3_3A":
			CreateParticleSystem("smoke_short" , -4.8, 2.7, 2.1, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , -4.8, 2.7, 2.1, 4.5, 1.5, 0.0, sti(20) );

			LAi_QuestDelay("corvette_broadside3_3B", 5.0);
		break;

		case "corvette_broadside3_3B":
			CreateParticleSystem("smoke_short" , -4.8, 2.7, 2.1, 4.5, 1.5, 0.0, sti(20) );
		break;
	//...............................................................................................
		case "corvette_broadside3_4":
			PlaySound("OBJECTS\SHIPCHARGE\LG24J.wav");
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire1.wav");

			CreateParticleSystem("smoke_short" , -4.8, 2.7, -1.4, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , -4.8, 2.7, -1.4, 4.5, 1.5, 0.0, sti(20) );

			CreateParticleSystem("splinters", -5.0, 4.5, -1.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -5.0, 4.5, -1.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", -5.0, 4.5, -1.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -5.0, 4.5, -1.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("blast_dirt" , -5.5, 2.7, -1.4, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("corvette_broadside3_4A", 5.0);
		break;

		case "corvette_broadside3_4A":
			CreateParticleSystem("smoke_short" , -4.8, 2.7, -1.4, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , -4.8, 2.7, -1.4, 4.5, 1.5, 0.0, sti(20) );

			LAi_QuestDelay("corvette_broadside3_4B", 5.0);
		break;

		case "corvette_broadside3_4B":
			CreateParticleSystem("smoke_short" , -4.8, 2.7, -1.4, 4.5, 1.5, 0.0, sti(20) );
		break;
	//...............................................................................................
		case "corvette_broadside3_5":
			PlaySound("OBJECTS\SHIPCHARGE\LG24J.wav");
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire1.wav");

			CreateParticleSystem("smoke_short" , -4.7, 2.7, -5.0, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , -4.7, 2.7, -5.0, 4.5, 1.5, 0.0, sti(20) );

			CreateParticleSystem("splinters", -5.0, 4.5, -5.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -5.0, 4.5, -5.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", -5.0, 4.5, -5.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -5.0, 4.5, -5.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("blast_dirt" , -5.5, 2.7, -5.0, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("corvette_broadside3_5A", 5.0);
		break;

		case "corvette_broadside3_5A":
			CreateParticleSystem("smoke_short" , -4.7, 2.7, -5.0, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , -4.7, 2.7, -5.0, 4.5, 1.5, 0.0, sti(20) );

			LAi_QuestDelay("corvette_broadside3_5B", 5.0);
		break;

		case "corvette_broadside3_5B":
			CreateParticleSystem("smoke_short" , -4.7, 2.7, -5.0, 4.5, 1.5, 0.0, sti(20) );
		break;
	//...............................................................................................
		case "corvette_broadside3_6":
			PlaySound("OBJECTS\SHIPCHARGE\LG24J.wav");
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire1.wav");

			CreateParticleSystem("smoke_short" , -4.4, 2.7, -10.4, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , -4.4, 2.7, -10.4, 4.5, 1.5, 0.0, sti(20) );

			CreateParticleSystem("splinters", -5.0, 4.5, -10.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -5.0, 4.5, -10.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", -5.0, 4.5, -10.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", -5.0, 4.5, -10.4, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("blast_dirt" , -5.5, 2.7, -10.4, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("corvette_broadside3_6A", 5.0);
			LAi_QuestDelay("corvette_deckfight", 0.1);
		break;

		case "corvette_broadside3_6A":
			CreateParticleSystem("smoke_short" , -4.4, 2.7, -10.4, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , -4.4, 2.7, -10.4, 4.5, 1.5, 0.0, sti(20) );

			LAi_QuestDelay("corvette_broadside3_6B", 5.0);
		break;

		case "corvette_broadside3_6B":
			CreateParticleSystem("smoke_short" , -4.4, 2.7, -10.4, 4.5, 1.5, 0.0, sti(20) );
		break;
	//...............................................................................................
		case "corvette_deckfight":
			//enough with these 2 lines!
			LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], false);
			Pchar.quest.deck_position = "fight_enabled";

			LAi_SetPlayerType(Pchar);

			PlaySound("OBJECTS\ABORDAGE\abordage.wav");	//not so loud until boarders arrive
			PlaySound("VOICE\ENGLISH\Eng_m_c_070.wav");
		//____________________________________________________________________________________________________
		//ENEMIES
			//1:st wave
			ChangeCharacterAddressGroup(characterFromID("wr_solhol"), "wr_ships", "reload", "reload8");
			LAi_group_MoveCharacter(characterFromID("wr_solhol"), "WR_GUARDS_5");
			LAi_NoRebirthEnable(characterFromID("wr_solhol"));

			ChangeCharacterAddressGroup(characterFromID("wr_sol6f77"), "wr_ships", "reload", "reload9");
			LAi_group_MoveCharacter(characterFromID("wr_sol6f77"), "WR_GUARDS_5");
			LAi_NoRebirthEnable(characterFromID("wr_sol6f77"));

			ChangeCharacterAddressGroup(characterFromID("wr_fwn"), "wr_ships", "reload", "reload10");
			LAi_group_MoveCharacter(characterFromID("wr_fwn"), "WR_GUARDS_5");
			LAi_NoRebirthEnable(characterFromID("wr_fwn"));

			ChangeCharacterAddressGroup(characterFromID("wr_man2"), "wr_ships", "reload", "reload11");
			GiveItem2Character(CharacterFromID("wr_man2"), "blade4");
			EquipCharacterbyItem(CharacterFromID("wr_man2"), "blade4");
			GiveItem2Character(CharacterFromID("wr_man2"), "pistol1");
			EquipCharacterbyItem(CharacterFromID("wr_man2"), "pistol1");
			LAi_SetImmortal(characterFromID("wr_man2"), false);
			LAi_group_MoveCharacter(characterFromID("wr_man2"), "WR_GUARDS_5");
			LAi_NoRebirthEnable(characterFromID("wr_man2"));

		    //stand by
			//2:nd wave
			ChangeCharacterAddressGroup(characterFromID("wr_man3"), "wr_ships", "goto", "hidden_enemies");
			LAi_group_MoveCharacter(characterFromID("wr_man3"), "WR_GUARDS_5");
			LAi_NoRebirthEnable(characterFromID("wr_man3"));
			ChangeCharacterAddressGroup(characterFromID("wr_oman2"), "wr_ships", "goto", "hidden_enemies");
			LAi_group_MoveCharacter(characterFromID("wr_oman2"), "WR_GUARDS_5");
			LAi_NoRebirthEnable(characterFromID("wr_oman2"));
			ChangeCharacterAddressGroup(characterFromID("wr_pir5"), "wr_ships", "goto", "hidden_enemies");
			LAi_group_MoveCharacter(characterFromID("wr_pir5"), "WR_GUARDS_5");
			LAi_NoRebirthEnable(characterFromID("wr_pir5"));
			ChangeCharacterAddressGroup(characterFromID("wr_sail1"), "wr_ships", "goto", "hidden_enemies");
			LAi_group_MoveCharacter(characterFromID("wr_sail1"), "WR_GUARDS_5");
			LAi_NoRebirthEnable(characterFromID("wr_sail1"));

			//3:rd wave
			ChangeCharacterAddressGroup(characterFromID("wr_hubport"), "wr_ships", "goto", "hidden_enemies");
			LAi_group_MoveCharacter(characterFromID("wr_hubport"), "WR_GUARDS_5");
			LAi_NoRebirthEnable(characterFromID("wr_hubport"));
			ChangeCharacterAddressGroup(characterFromID("wr_kill"), "wr_ships", "goto", "hidden_enemies");
			LAi_group_MoveCharacter(characterFromID("wr_kill"), "WR_GUARDS_5");
			LAi_NoRebirthEnable(characterFromID("wr_kill"));
			ChangeCharacterAddressGroup(characterFromID("wr_18_1"), "wr_ships", "goto", "hidden_enemies");
			LAi_group_MoveCharacter(characterFromID("wr_18_1"), "WR_GUARDS_5");
			LAi_NoRebirthEnable(characterFromID("wr_18_1"));
			ChangeCharacterAddressGroup(characterFromID("wr_hubspa5"), "wr_ships", "goto", "hidden_enemies");
			LAi_group_MoveCharacter(characterFromID("wr_hubspa5"), "WR_GUARDS_5");
			LAi_NoRebirthEnable(characterFromID("wr_hubspa5"));

			//4:th wave
			ChangeCharacterAddressGroup(characterFromID("wr_solspa4"), "wr_ships", "goto", "hidden_enemies");
			LAi_group_MoveCharacter(characterFromID("wr_solspa4"), "WR_GUARDS_5");
			LAi_NoRebirthEnable(characterFromID("wr_solspa4"));
			ChangeCharacterAddressGroup(characterFromID("wr_vito"), "wr_ships", "goto", "hidden_enemies");
			LAi_group_MoveCharacter(characterFromID("wr_vito"), "WR_GUARDS_5");
			LAi_NoRebirthEnable(characterFromID("wr_vito"));
			ChangeCharacterAddressGroup(characterFromID("wr_9sNat"), "wr_ships", "goto", "hidden_enemies");
			LAi_group_MoveCharacter(characterFromID("wr_9sNat"), "WR_GUARDS_5");
			LAi_NoRebirthEnable(characterFromID("wr_9sNat"));
			ChangeCharacterAddressGroup(characterFromID("wr_evl2"), "wr_ships", "goto", "hidden_enemies");
			LAi_group_MoveCharacter(characterFromID("wr_evl2"), "WR_GUARDS_5");
			LAi_NoRebirthEnable(characterFromID("wr_evl2"));
		//____________________________________________________________________________________________________
		//ALLIES
			//1:st wave
			ChangeCharacterAddressGroup(characterFromID("pir_cap1"), "wr_ships", "reload", "reload5");
			LAi_group_MoveCharacter(characterFromID("pir_cap1"), LAI_GROUP_PLAYER);

			ChangeCharacterAddressGroup(characterFromID("Friday"), "wr_ships", "reload", "reload5");
			LAi_group_MoveCharacter(characterFromID("Friday"), LAI_GROUP_PLAYER);

			LAi_group_MoveCharacter(characterFromID("Selkirk"), LAI_GROUP_PLAYER);

		    //stand by
			//2:nd wave
			ChangeCharacterAddressGroup(characterFromID("pir_cap7"), "wr_ships", "goto", "hidden_allies");
			LAi_group_MoveCharacter(characterFromID("pir_cap7"), LAI_GROUP_PLAYER);
			LAi_SetImmortal(characterFromID("pir_cap7"), false);
			LAi_NoRebirthEnable(characterFromID("pir_cap7"));

			ChangeCharacterAddressGroup(characterFromID("pir_cap5"), "wr_ships", "goto", "hidden_allies");
			LAi_group_MoveCharacter(characterFromID("pir_cap5"), LAI_GROUP_PLAYER);
			LAi_SetImmortal(characterFromID("pir_cap5"), false);
			LAi_NoRebirthEnable(characterFromID("pir_cap5"));

			//3:rd wave
			ChangeCharacterAddressGroup(characterFromID("pir_cap8"), "wr_ships", "goto", "hidden_allies");
			LAi_group_MoveCharacter(characterFromID("pir_cap8"), LAI_GROUP_PLAYER);
			LAi_SetImmortal(characterFromID("pir_cap8"), false);
			LAi_NoRebirthEnable(characterFromID("pir_cap8"));

			ChangeCharacterAddressGroup(characterFromID("pir_cap14"), "wr_ships", "goto", "hidden_allies");
			LAi_group_MoveCharacter(characterFromID("pir_cap14"), LAI_GROUP_PLAYER);
			LAi_SetImmortal(characterFromID("pir_cap14"), false);
			LAi_NoRebirthEnable(characterFromID("pir_cap14"));

		ChangeCharacterAddressGroup(characterFromID("pir_cap16"), "wr_ships", "goto", "hidden_allies");
		LAi_group_MoveCharacter(characterFromID("pir_cap16"), LAI_GROUP_PLAYER);
		
		ChangeCharacterAddressGroup(characterFromID("pir_cap23"), "wr_ships", "goto", "hidden_allies");
		LAi_group_MoveCharacter(characterFromID("pir_cap23"), LAI_GROUP_PLAYER);

		ChangeCharacterAddressGroup(characterFromID("pir_cap9"), "wr_ships", "goto", "hidden_allies");
		LAi_group_MoveCharacter(characterFromID("pir_cap9"), LAI_GROUP_PLAYER);
		
		ChangeCharacterAddressGroup(characterFromID("pir_cap18"), "wr_ships", "goto", "hidden_allies");
		LAi_group_MoveCharacter(characterFromID("pir_cap18"), LAI_GROUP_PLAYER);

		ChangeCharacterAddressGroup(characterFromID("pir_cap4"), "wr_ships", "goto", "hidden_allies");
		LAi_group_MoveCharacter(characterFromID("pir_cap4"), LAI_GROUP_PLAYER);
		
		ChangeCharacterAddressGroup(characterFromID("pir_cap26"), "wr_ships", "goto", "hidden_allies");
		LAi_group_MoveCharacter(characterFromID("pir_cap26"), LAI_GROUP_PLAYER);

		ChangeCharacterAddressGroup(characterFromID("pir_cap3"), "wr_ships", "goto", "hidden_allies");
		LAi_group_MoveCharacter(characterFromID("pir_cap3"), LAI_GROUP_PLAYER);
		
		ChangeCharacterAddressGroup(characterFromID("pir_cap30"), "wr_ships", "goto", "hidden_allies");
		LAi_group_MoveCharacter(characterFromID("pir_cap30"), LAI_GROUP_PLAYER);

			LAi_group_Register("WR_GUARDS_5");
			LAi_group_SetRelation(LAI_GROUP_PLAYER, "WR_GUARDS_5", LAI_GROUP_ENEMY);
			LAi_group_FightGroups(LAI_GROUP_PLAYER, "WR_GUARDS_5", true);
	
			LAi_QuestDelay("Friday_bladecheck", 0.1);
			LAi_QuestDelay("corvette_deckfight_2wave", 4.0);
	
			Pchar.quest.corvette_deckfight_over.win_condition.l1 = "NPC_Death";
			Pchar.quest.corvette_deckfight_over.win_condition.l1.character = "wr_solhol";
			Pchar.quest.corvette_deckfight_over.win_condition.l2 = "NPC_Death";
			Pchar.quest.corvette_deckfight_over.win_condition.l2.character = "wr_sol6f77";
			Pchar.quest.corvette_deckfight_over.win_condition.l3 = "NPC_Death";
			Pchar.quest.corvette_deckfight_over.win_condition.l3.character = "wr_fwn";
			Pchar.quest.corvette_deckfight_over.win_condition.l4 = "NPC_Death";
			Pchar.quest.corvette_deckfight_over.win_condition.l4.character = "wr_man2";
			Pchar.quest.corvette_deckfight_over.win_condition.l5 = "NPC_Death";
			Pchar.quest.corvette_deckfight_over.win_condition.l5.character = "wr_man3";
			Pchar.quest.corvette_deckfight_over.win_condition.l6 = "NPC_Death";
			Pchar.quest.corvette_deckfight_over.win_condition.l6.character = "wr_oman2";
			Pchar.quest.corvette_deckfight_over.win_condition.l7 = "NPC_Death";
			Pchar.quest.corvette_deckfight_over.win_condition.l7.character = "wr_pir5";
			Pchar.quest.corvette_deckfight_over.win_condition.l8 = "NPC_Death";
			Pchar.quest.corvette_deckfight_over.win_condition.l8.character = "wr_sail1";
			Pchar.quest.corvette_deckfight_over.win_condition.l9 = "NPC_Death";
			Pchar.quest.corvette_deckfight_over.win_condition.l9.character = "wr_hubport";
			Pchar.quest.corvette_deckfight_over.win_condition.l10 = "NPC_Death";
			Pchar.quest.corvette_deckfight_over.win_condition.l10.character = "wr_kill";
			Pchar.quest.corvette_deckfight_over.win_condition.l11 = "NPC_Death";
			Pchar.quest.corvette_deckfight_over.win_condition.l11.character = "wr_18_1";
			Pchar.quest.corvette_deckfight_over.win_condition.l12 = "NPC_Death";
			Pchar.quest.corvette_deckfight_over.win_condition.l12.character = "wr_hubspa5";
			Pchar.quest.corvette_deckfight_over.win_condition.l13 = "NPC_Death";
			Pchar.quest.corvette_deckfight_over.win_condition.l13.character = "wr_solspa4";
			Pchar.quest.corvette_deckfight_over.win_condition.l14 = "NPC_Death";
			Pchar.quest.corvette_deckfight_over.win_condition.l14.character = "wr_vito";
			Pchar.quest.corvette_deckfight_over.win_condition.l15 = "NPC_Death";
			Pchar.quest.corvette_deckfight_over.win_condition.l15.character = "wr_9sNat";
			Pchar.quest.corvette_deckfight_over.win_condition.l16 = "NPC_Death";
			Pchar.quest.corvette_deckfight_over.win_condition.l16.character = "wr_evl2";
			Pchar.quest.corvette_deckfight_over.win_condition = "corvette_deckfight_over";
		break;

		case "corvette_deckfight_2wave":
			ChangeCharacterAddressGroup(characterFromID("wr_man3"), "wr_ships", "reload", "reload8");
			ChangeCharacterAddressGroup(characterFromID("wr_oman2"), "wr_ships", "reload", "reload9");
			ChangeCharacterAddressGroup(characterFromID("wr_pir5"), "wr_ships", "reload", "reload10");
			ChangeCharacterAddressGroup(characterFromID("wr_sail1"), "wr_ships", "reload", "reload11");

			ChangeCharacterAddressGroup(characterFromID("pir_cap7"), "wr_ships", "reload", "reload5");
			ChangeCharacterAddressGroup(characterFromID("pir_cap5"), "wr_ships", "reload", "reload7");

			LAi_QuestDelay("corvette_boarders_ready", 0.1);
			LAi_QuestDelay("corvette_deckfight_3wave", 4.0);
		break;

		case "corvette_deckfight_3wave":
			ChangeCharacterAddressGroup(characterFromID("wr_hubport"), "wr_ships", "reload", "reload8");
			ChangeCharacterAddressGroup(characterFromID("wr_kill"), "wr_ships", "reload", "reload9");
			ChangeCharacterAddressGroup(characterFromID("wr_18_1"), "wr_ships", "reload", "reload10");
			ChangeCharacterAddressGroup(characterFromID("wr_hubspa5"), "wr_ships", "reload", "reload11");

			ChangeCharacterAddressGroup(characterFromID("pir_cap8"), "wr_ships", "reload", "reload5");
			ChangeCharacterAddressGroup(characterFromID("pir_cap14"), "wr_ships", "reload", "reload7");

			LAi_QuestDelay("La_Buze_bladecheck", 1.0);
			LAi_QuestDelay("corvette_deckfight_4wave", 4.0);
		break;

		case "corvette_deckfight_4wave":
			ChangeCharacterAddressGroup(characterFromID("wr_solspa4"), "wr_ships", "reload", "reload8");
			ChangeCharacterAddressGroup(characterFromID("wr_vito"), "wr_ships", "reload", "reload9");
			ChangeCharacterAddressGroup(characterFromID("wr_9sNat"), "wr_ships", "reload", "reload10");
			ChangeCharacterAddressGroup(characterFromID("wr_evl2"), "wr_ships", "reload", "reload11");
		break;
	//...............................................................................................
		case "corvette_boarders_ready":
			PlaySound("OBJECTS\ABORDAGE\abordage_wining.wav");
			ChangeCharacterAddressGroup(characterFromID("pir_cap16"), "wr_ships", "goto", "boarding_6A");

			LAi_QuestDelay("corvette_boarders_ready1", 0.5);
		break;

		case "corvette_boarders_ready1":
			//RemoveCharacterEquip(characterFromID("pir_cap23"), GUN_ITEM_TYPE);
			//TakeItemFromCharacter(characterFromID("pir_cap23"), "pistol204");
			ChangeCharacterAddressGroup(characterFromID("pir_cap23"), "wr_ships", "goto", "boarding_8A");
			ChangeCharacterAddressGroup(characterFromID("pir_cap9"), "wr_ships", "goto", "boarding_4A");

			LAi_QuestDelay("corvette_boarders_ready2", 0.5);
		break;

		case "corvette_boarders_ready2":
			ChangeCharacterAddressGroup(characterFromID("pir_cap18"), "wr_ships", "goto", "boarding_2A");
			ChangeCharacterAddressGroup(characterFromID("pir_cap4"), "wr_ships", "goto", "boarding_3A");

			LAi_QuestDelay("corvette_boarders_ready3", 0.5);
		break;

		case "corvette_boarders_ready3":
			ChangeCharacterAddressGroup(characterFromID("pir_cap26"), "wr_ships", "goto", "boarding_5A");
			ChangeCharacterAddressGroup(characterFromID("pir_cap3"), "wr_ships", "goto", "boarding_7A");
			ChangeCharacterAddressGroup(characterFromID("pir_cap30"), "wr_ships", "goto", "boarding_9A");

			LAi_QuestDelay("corvette_boarders_1wave", 1.5);
		break;
	//...............................................................................................
		case "corvette_boarders_1wave":
			PlaySound("OBJECTS\ABORDAGE\abordage2.wav");
			LAi_SetSitType(CharacterFromID("pir_cap16"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap16"), "wr_ships", "goto", "boarding_6B");

			LAi_QuestDelay("corvette_boarders_1wave_A", 1.0);
		break;

		case "corvette_boarders_1wave_A":
			LAi_SetStayType(CharacterFromID("pir_cap16"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap16"), "wr_ships", "goto", "boarding_6C");
			PlaySound("PEOPLE\step_stairway.wav");
			LAi_group_MoveCharacter(characterFromID("pir_cap16"), LAI_GROUP_PLAYER);
			LAi_SetImmortal(characterFromID("pir_cap16"), false);
			LAi_NoRebirthEnable(characterFromID("pir_cap16"));

		LAi_group_SetRelation(LAI_GROUP_PLAYER, "WR_GUARDS_5", LAI_GROUP_ENEMY);
		LAi_group_FightGroups(LAI_GROUP_PLAYER, "WR_GUARDS_5", true);

			LAi_QuestDelay("Roberts_bladecheck", 1.0);
			LAi_QuestDelay("corvette_boarders_2wave", 1.0);
		break;

		case "corvette_boarders_2wave":
			LAi_SetSitType(CharacterFromID("pir_cap23"));
			LAi_SetSitType(CharacterFromID("pir_cap9"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap23"), "wr_ships", "goto", "boarding_8B");
			ChangeCharacterAddressGroup(characterFromID("pir_cap9"), "wr_ships", "goto", "boarding_4B");

			LAi_QuestDelay("corvette_boarders_2wave_A", 1.0);
		break;

		case "corvette_boarders_2wave_A":
			LAi_SetStayType(CharacterFromID("pir_cap23"));
			LAi_SetStayType(CharacterFromID("pir_cap9"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap23"), "wr_ships", "goto", "boarding_8C");
			ChangeCharacterAddressGroup(characterFromID("pir_cap9"), "wr_ships", "goto", "boarding_4C");
			PlaySound("PEOPLE\step_stairway1.wav");
			LAi_group_MoveCharacter(characterFromID("pir_cap23"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("pir_cap9"), LAI_GROUP_PLAYER);
			LAi_SetImmortal(characterFromID("pir_cap23"), false);
			LAi_SetImmortal(characterFromID("pir_cap9"), false);
			LAi_NoRebirthEnable(characterFromID("pir_cap23"));
			LAi_NoRebirthEnable(characterFromID("pir_cap9"));

		LAi_group_SetRelation(LAI_GROUP_PLAYER, "WR_GUARDS_5", LAI_GROUP_ENEMY);
		LAi_group_FightGroups(LAI_GROUP_PLAYER, "WR_GUARDS_5", true);

			LAi_QuestDelay("corvette_boarders_3wave", 0.1);
			LAi_QuestDelay("Taylor_bladecheck", 1.0);
		break;

		case "corvette_boarders_3wave":
			LAi_SetSitType(CharacterFromID("pir_cap18"));
			LAi_SetSitType(CharacterFromID("pir_cap4"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap18"), "wr_ships", "goto", "boarding_2B");
			ChangeCharacterAddressGroup(characterFromID("pir_cap4"), "wr_ships", "goto", "boarding_3B");

			LAi_QuestDelay("corvette_boarders_3wave_A", 1.0);
			LAi_QuestDelay("corvette_boarders_4wave", 0.1);
		break;

		case "corvette_boarders_3wave_A":
			LAi_SetStayType(CharacterFromID("pir_cap18"));
			LAi_SetStayType(CharacterFromID("pir_cap4"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap18"), "wr_ships", "goto", "boarding_2C");
			ChangeCharacterAddressGroup(characterFromID("pir_cap4"), "wr_ships", "goto", "boarding_3C");
			PlaySound("PEOPLE\step_stairway2.wav");
			LAi_group_MoveCharacter(characterFromID("pir_cap18"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("pir_cap4"), LAI_GROUP_PLAYER);
			LAi_SetImmortal(characterFromID("pir_cap18"), false);
			LAi_SetImmortal(characterFromID("pir_cap4"), false);
			LAi_NoRebirthEnable(characterFromID("pir_cap18"));
			LAi_NoRebirthEnable(characterFromID("pir_cap4"));

		LAi_group_SetRelation(LAI_GROUP_PLAYER, "WR_GUARDS_5", LAI_GROUP_ENEMY);
		LAi_group_FightGroups(LAI_GROUP_PLAYER, "WR_GUARDS_5", true);

			LAi_QuestDelay("Rackham_bladecheck", 1.0);
		break;

		case "corvette_boarders_4wave":
			LAi_SetSitType(CharacterFromID("pir_cap26"));
			LAi_SetSitType(CharacterFromID("pir_cap3"));
			LAi_SetSitType(CharacterFromID("pir_cap30"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap26"), "wr_ships", "goto", "boarding_5B");
			ChangeCharacterAddressGroup(characterFromID("pir_cap3"), "wr_ships", "goto", "boarding_7B");
			ChangeCharacterAddressGroup(characterFromID("pir_cap30"), "wr_ships", "goto", "boarding_9B");

			LAi_QuestDelay("corvette_boarders_4wave_A", 1.0);
		break;

		case "corvette_boarders_4wave_A":
			LAi_SetStayType(CharacterFromID("pir_cap26"));
			LAi_SetStayType(CharacterFromID("pir_cap3"));
			LAi_SetStayType(CharacterFromID("pir_cap30"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap26"), "wr_ships", "goto", "boarding_5C");
			ChangeCharacterAddressGroup(characterFromID("pir_cap3"), "wr_ships", "goto", "boarding_7C");
			ChangeCharacterAddressGroup(characterFromID("pir_cap30"), "wr_ships", "goto", "boarding_9C");
			PlaySound("PEOPLE\step_stairway.wav");
			LAi_group_MoveCharacter(characterFromID("pir_cap26"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("pir_cap3"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("pir_cap30"), LAI_GROUP_PLAYER);
			LAi_SetImmortal(characterFromID("pir_cap26"), false);
			LAi_SetImmortal(characterFromID("pir_cap3"), false);
			LAi_SetImmortal(characterFromID("pir_cap30"), false);
			LAi_NoRebirthEnable(characterFromID("pir_cap26"));
			LAi_NoRebirthEnable(characterFromID("pir_cap3"));
			LAi_NoRebirthEnable(characterFromID("pir_cap30"));

		LAi_group_SetRelation(LAI_GROUP_PLAYER, "WR_GUARDS_5", LAI_GROUP_ENEMY);
		LAi_group_FightGroups(LAI_GROUP_PLAYER, "WR_GUARDS_5", true);
		break;

		case "Friday_bladecheck":
			if(CheckAttribute(Pchar, "quest.wr_deckfight") && Pchar.quest.wr_deckfight == "over")
			{
				return;
			}
			else
			{
				if(!IsEquipCharacterByItem(characterFromID("Friday"), "bladeaxe1"))
				{
					RemoveCharacterEquip(characterFromID("Friday"), BLADE_ITEM_TYPE );
					if(!CheckCharacterItem(characterFromID("Friday"), "bladeaxe1"));
					{
						GiveItem2Character(characterFromID("Friday"), "bladeaxe1");
					}
					EquipCharacterbyItem(characterFromID("Friday"), "bladeaxe1");
				}
				else LAi_QuestDelay("Friday_bladecheck", 1.0);
			}
		break;

		case "La_Buze_bladecheck":
			if(CheckAttribute(Pchar, "quest.wr_deckfight") && Pchar.quest.wr_deckfight == "over")
			{
				return;
			}
			else
			{
				if(!IsEquipCharacterByItem(characterFromID("pir_cap8"), "bladereliquary"))
				{
					RemoveCharacterEquip(characterFromID("pir_cap8"), BLADE_ITEM_TYPE );
					if(!CheckCharacterItem(characterFromID("pir_cap8"), "bladereliquary"));
					{
						GiveItem2Character(characterFromID("pir_cap8"), "bladereliquary");
					}
					EquipCharacterbyItem(characterFromID("pir_cap8"), "bladereliquary");
				}
				else LAi_QuestDelay("La_Buze_bladecheck", 1.0);
			}
		break;

		case "Roberts_bladecheck":
			if(CheckAttribute(Pchar, "quest.wr_deckfight") && Pchar.quest.wr_deckfight == "over")
			{
				return;
			}
			else
			{
				if(!IsEquipCharacterByItem(characterFromID("pir_cap16"), "bladecenser"))
				{
					RemoveCharacterEquip(characterFromID("pir_cap16"), BLADE_ITEM_TYPE );
					if(!CheckCharacterItem(characterFromID("pir_cap16"), "bladecenser"));
					{
						GiveItem2Character(characterFromID("pir_cap16"), "bladecenser");
					}
					EquipCharacterbyItem(characterFromID("pir_cap16"), "bladecenser");
				}
				else LAi_QuestDelay("Roberts_bladecheck", 1.0);
			}
		break;

		case "Rackham_bladecheck":
			if(CheckAttribute(Pchar, "quest.wr_deckfight") && Pchar.quest.wr_deckfight == "over")
			{
				return;
			}
			else
			{
				if(!IsEquipCharacterByItem(characterFromID("pir_cap18"), "bladecandelabre"))
				{
					RemoveCharacterEquip(characterFromID("pir_cap18"), BLADE_ITEM_TYPE );
					if(!CheckCharacterItem(characterFromID("pir_cap18"), "bladecandelabre"));
					{
						GiveItem2Character(characterFromID("pir_cap18"), "bladecandelabre");
					}
					EquipCharacterbyItem(characterFromID("pir_cap18"), "bladecandelabre");
				}
				else LAi_QuestDelay("Rackham_bladecheck", 1.0);
			}
		break;

		case "Taylor_bladecheck":
			if(CheckAttribute(Pchar, "quest.wr_deckfight") && Pchar.quest.wr_deckfight == "over")
			{
				return;
			}
			else
			{
				if(!IsEquipCharacterByItem(characterFromID("pir_cap23"), "bladechalice"))
				{
					RemoveCharacterEquip(characterFromID("pir_cap23"), BLADE_ITEM_TYPE );
					if(!CheckCharacterItem(characterFromID("pir_cap23"), "bladechalice"));
					{
						GiveItem2Character(characterFromID("pir_cap23"), "bladechalice");
					}
					EquipCharacterbyItem(characterFromID("pir_cap23"), "bladechalice");
				}
				else LAi_QuestDelay("Taylor_bladecheck", 1.0);
			}
		break;

		case "corvette_deckfight_over":
			AddQuestRecord("Woodes_Rogers_crew", "5");

			Pchar.quest.wr_deckfight = "over";
			Pchar.quest.corvette_status = "ordinary";
			Pchar.quest.broadside = "over";
			LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], true);
			PlaySound("OBJECTS\ABORDAGE\abordage_wining.wav");
			if(LAi_IsFightMode(Pchar)) LAi_SetFightMode(PChar, false);

			SetModel(CharacterFromID("wr_voy"), "wr_voy", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			if(LAi_IsDead(CharacterFromID("pir_cap7"))) Pchar.quest.pc7_status = "dead";
			if(LAi_IsDead(CharacterFromID("pir_cap8"))) Pchar.quest.pc8_status = "dead";
			if(LAi_IsDead(CharacterFromID("pir_cap16"))) Pchar.quest.pc16_status = "dead";
			if(LAi_IsDead(CharacterFromID("pir_cap23"))) Pchar.quest.pc23_status = "dead";
			if(LAi_IsDead(CharacterFromID("pir_cap9"))) Pchar.quest.pc9_status = "dead";
			if(LAi_IsDead(CharacterFromID("pir_cap18"))) Pchar.quest.pc18_status = "dead";
			if(LAi_IsDead(CharacterFromID("pir_cap4"))) Pchar.quest.pc4_status = "dead";
			if(LAi_IsDead(CharacterFromID("pir_cap5"))) Pchar.quest.pc5_status = "dead";
			if(LAi_IsDead(CharacterFromID("pir_cap26"))) Pchar.quest.pc26_status = "dead";
			if(LAi_IsDead(CharacterFromID("pir_cap3"))) Pchar.quest.pc27_status = "dead";
			if(LAi_IsDead(CharacterFromID("pir_cap30"))) Pchar.quest.pc29_status = "dead";
			if(LAi_IsDead(CharacterFromID("pir_cap14"))) Pchar.quest.pc14_status = "dead";

			LAi_SetOfficerType(CharacterFromID("Selkirk"));
			LAi_SetOfficerType(CharacterFromID("Friday"));
			LAi_SetOfficerType(CharacterFromID("pir_cap1"));
			LAi_SetOfficerType(CharacterFromID("pir_cap7"));
			LAi_SetOfficerType(CharacterFromID("pir_cap8"));
			LAi_SetOfficerType(CharacterFromID("pir_cap16"));
			LAi_SetOfficerType(CharacterFromID("pir_cap23"));
			LAi_SetOfficerType(CharacterFromID("pir_cap9"));
			LAi_SetOfficerType(CharacterFromID("pir_cap18"));
			LAi_SetOfficerType(CharacterFromID("pir_cap4"));
			LAi_SetOfficerType(CharacterFromID("pir_cap5"));
			LAi_SetOfficerType(CharacterFromID("pir_cap26"));
			LAi_SetOfficerType(CharacterFromID("pir_cap3"));
			LAi_SetOfficerType(CharacterFromID("pir_cap30"));
			LAi_SetOfficerType(CharacterFromID("pir_cap14"));

			if(!IsEquipCharacterByItem(characterFromID("Friday"), "bladeaxe1"))
			{
				RemoveCharacterEquip(characterFromID("Friday"), BLADE_ITEM_TYPE );
				if(!CheckCharacterItem(characterFromID("Friday"), "bladeaxe1"));
				{
					GiveItem2Character(characterFromID("Friday"), "bladeaxe1");
				}
				EquipCharacterbyItem(characterFromID("Friday"), "bladeaxe1");
			}

			Locations[FindLocation("wr_ships")].reload.l17.disable = 0;
			Locations[FindLocation("wr_gall_deck2_prow")].models.always.locators = "deck2_l_JRH_prowA1";
			Locations[FindLocation("wr_gall_deck2_prow")].reload.l5.disable = 0;
			Locations[FindLocation("wr_gall_deck2_prow")].locators_radius.reload.reload1 = 0.0001;//to galley
			Locations[FindLocation("wr_gall_deck2_prow")].locators_radius.reload.reload4 = 0.0001;//to hold first
			Locations[FindLocation("wr_gall_deck2_prow")].reload.l1.go = "wr_gall_galley_flooded";

			LAi_SetCitizenType(CharacterFromID("guncrew_1"));
			LAi_SetCitizenType(CharacterFromID("guncrew_2"));
			LAi_SetCitizenType(CharacterFromID("guncrew_3"));
			LAi_SetCitizenType(CharacterFromID("guncrew_4"));
			ChangeCharacterAddressGroup(characterFromID("guncrew_1"), "wr_gall_galley_flooded", "goto", "goto1");
			ChangeCharacterAddressGroup(characterFromID("guncrew_2"), "wr_gall_galley_flooded", "goto", "goto2");
			ChangeCharacterAddressGroup(characterFromID("guncrew_3"), "wr_gall_galley_flooded", "goto", "goto3");
			ChangeCharacterAddressGroup(characterFromID("guncrew_4"), "wr_gall_galley_flooded", "goto", "goto4");

			RemoveCharacterEquip(characterFromID("guncrew_2"), GUN_ITEM_TYPE );
			TakeItemFromCharacter(characterFromID("guncrew_2"), "pistolrammer");
			RemoveCharacterEquip(characterFromID("guncrew_2"), BLADE_ITEM_TYPE );
			GiveItem2Character(characterFromID("guncrew_2"), "bladerammer");
			EquipCharacterbyItem(characterFromID("guncrew_2"), "bladerammer");

			RemoveCharacterEquip(characterFromID("guncrew_3"), GUN_ITEM_TYPE );
			TakeItemFromCharacter(characterFromID("guncrew_3"), "pistolboom");
			RemoveCharacterEquip(characterFromID("guncrew_3"), BLADE_ITEM_TYPE );
			GiveItem2Character(characterFromID("guncrew_3"), "bladeboom");
			EquipCharacterbyItem(characterFromID("guncrew_3"), "bladeboom");

			RemoveCharacterEquip(characterFromID("guncrew_4"), GUN_ITEM_TYPE );
			TakeItemFromCharacter(characterFromID("guncrew_4"), "pistolsponge");
			RemoveCharacterEquip(characterFromID("guncrew_4"), BLADE_ITEM_TYPE );
			GiveItem2Character(characterFromID("guncrew_4"), "bladesponge");
			EquipCharacterbyItem(characterFromID("guncrew_4"), "bladesponge");

			LAi_QuestDelay("corvette_sniper", 3.0);
		break;

		case "corvette_sniper":
			PlaySound("PEOPLE\counter_open.wav");
			ChangeCharacterAddressGroup(characterFromID("wr_voy"), "wr_ships", "reload", "reload8");

			LAi_QuestDelay("corvette_sniper0", 2.0);
		break;

		case "corvette_sniper0":
			PlaySound("VOICE\ENGLISH\Eng_m_a_059.wav");
			LAi_SetActorType(CharacterFromID("wr_voy"));
			LAi_ActorTurnToCharacter(characterFromID("wr_voy"), Pchar);

			LAi_QuestDelay("corvette_sniper1A", 1.0);
		break;

		case "corvette_sniper1A":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("wr_voy"));
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorTurnToCharacter(CharacterFromID("Selkirk"), characterFromID("wr_voy"));
			LAi_SetActorType(CharacterFromID("Friday"));
			LAi_ActorTurnToCharacter(CharacterFromID("Friday"), characterFromID("wr_voy"));
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorTurnToCharacter(CharacterFromID("pir_cap1"), characterFromID("wr_voy"));

			LAi_SetActorType(CharacterFromID("pir_cap7"));
			LAi_ActorTurnToCharacter(CharacterFromID("pir_cap7"), characterFromID("wr_voy"));
			LAi_SetActorType(CharacterFromID("pir_cap5"));
			LAi_ActorTurnToCharacter(CharacterFromID("pir_cap5"), characterFromID("wr_voy"));
			LAi_SetActorType(CharacterFromID("pir_cap8"));
			LAi_ActorTurnToCharacter(CharacterFromID("pir_cap8"), characterFromID("wr_voy"));
			LAi_SetActorType(CharacterFromID("pir_cap14"));
			LAi_ActorTurnToCharacter(CharacterFromID("pir_cap14"), characterFromID("wr_voy"));
			LAi_SetActorType(CharacterFromID("pir_cap16"));
			LAi_ActorTurnToCharacter(CharacterFromID("pir_cap16"), characterFromID("wr_voy"));
			LAi_SetActorType(CharacterFromID("pir_cap23"));
			LAi_ActorTurnToCharacter(CharacterFromID("pir_cap23"), characterFromID("wr_voy"));
			LAi_SetActorType(CharacterFromID("pir_cap9"));
			LAi_ActorTurnToCharacter(CharacterFromID("pir_cap9"), characterFromID("wr_voy"));
			LAi_SetActorType(CharacterFromID("pir_cap18"));
			LAi_ActorTurnToCharacter(CharacterFromID("pir_cap18"), characterFromID("wr_voy"));
			LAi_SetActorType(CharacterFromID("pir_cap4"));
			LAi_ActorTurnToCharacter(CharacterFromID("pir_cap4"), characterFromID("wr_voy"));
			LAi_SetActorType(CharacterFromID("pir_cap26"));
			LAi_ActorTurnToCharacter(CharacterFromID("pir_cap26"), characterFromID("wr_voy"));
			LAi_SetActorType(CharacterFromID("pir_cap3"));
			LAi_ActorTurnToCharacter(CharacterFromID("pir_cap3"), characterFromID("wr_voy"));
			LAi_SetActorType(CharacterFromID("pir_cap30"));
			LAi_ActorTurnToCharacter(CharacterFromID("pir_cap30"), characterFromID("wr_voy"));

			LAi_QuestDelay("corvette_sniper1", 1.0);
		break;

		case "corvette_sniper1":
			LAi_LocationFightDisable(&Locations[FindLocation("wr_ships")], false);
			LAi_SetPlayerType(CharacterFromID("wr_voy"));
			LAi_SetFightMode(CharacterFromID("wr_voy"), true);

			LAi_QuestDelay("corvette_sniper2", 1.0);
		break;

		case "corvette_sniper2":
			PlaySound("OBJECTS\duel\pistol_medium.wav");
			GetCharacterPos(CharacterFromID("wr_voy"), &u, &v, &w);
			CreateParticleSystem("gunfire" , u+0.2, v+1.2, w+0.1, 0.0, 0.0, 0.0, sti(20) );
			TakeItemFromCharacter(Pchar, "bible");

			LAi_QuestDelay("corvette_sniper3", 0.5);
		break;

		case "corvette_sniper3":
			PlaySound("OBJECTS\duel\pistol_medium.wav");
			CreateParticleSystem("gunfire" , u+0.2, v+1.2, w+0.1, 0.0, 0.0, 0.0, sti(20) );
			GiveItem2Character(Pchar, "bible_shot");

			LAi_QuestDelay("corvette_sniper4", 0.5);
		break;

		case "corvette_sniper4":
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("blast_dirt_small" , u, v+1.2, w, 0.0, 0.0, 0.0, sti(20) );

			Php = LAi_GetCharacterHP(Pchar);
			Php2 = Php/2;
			LAi_ApplyCharacterDamage(Pchar, Php2);

			PlaySound("OBJECTS\VOICES\DEAD\male\dead0.wav");
			PlaySound("OBJECTS\VOICES\DEAD\male\dead0.wav");

			LAi_group_MoveCharacter(characterFromID("wr_voy"), "WR_GUARDS_5");
			LAi_SetFightMode(CharacterFromID("wr_voy"), false);
			LAi_SetActorType(Pchar);
			LAi_ActorAnimation(Pchar, "death_0","corvette_sniper5", 1.0);
		break;

		case "corvette_sniper5":
			LAi_ActorSetLayMode(Pchar);

			LAi_SetOfficerType(characterFromID("pir_cap1"));
			LAi_SetOfficerType(characterFromID("Selkirk"));
			LAi_SetOfficerType(characterFromID("Friday"));

			LAi_SetActorType(CharacterFromID("pir_cap7"));
			LAi_ActorAttack(CharacterFromID("pir_cap7"), characterFromID("wr_voy"), "");
			LAi_SetActorType(CharacterFromID("pir_cap5"));
			LAi_ActorAttack(CharacterFromID("pir_cap5"), characterFromID("wr_voy"), "");
			LAi_SetActorType(CharacterFromID("pir_cap8"));
			LAi_ActorAttack(CharacterFromID("pir_cap8"), characterFromID("wr_voy"), "");
			LAi_SetActorType(CharacterFromID("pir_cap14"));
			LAi_ActorAttack(CharacterFromID("pir_cap14"), characterFromID("wr_voy"), "");
			LAi_SetActorType(CharacterFromID("pir_cap16"));
			LAi_ActorAttack(CharacterFromID("pir_cap16"), characterFromID("wr_voy"), "");
			LAi_SetActorType(CharacterFromID("pir_cap23"));
			LAi_ActorAttack(CharacterFromID("pir_cap23"), characterFromID("wr_voy"), "");
			LAi_SetActorType(CharacterFromID("pir_cap9"));
			LAi_ActorAttack(CharacterFromID("pir_cap9"), characterFromID("wr_voy"), "");
			LAi_SetActorType(CharacterFromID("pir_cap18"));
			LAi_ActorAttack(CharacterFromID("pir_cap18"), characterFromID("wr_voy"), "");
			LAi_SetActorType(CharacterFromID("pir_cap4"));
			LAi_ActorAttack(CharacterFromID("pir_cap4"), characterFromID("wr_voy"), "");
			LAi_SetActorType(CharacterFromID("pir_cap26"));
			LAi_ActorAttack(CharacterFromID("pir_cap26"), characterFromID("wr_voy"), "");
			LAi_SetActorType(CharacterFromID("pir_cap3"));
			LAi_ActorAttack(CharacterFromID("pir_cap3"), characterFromID("wr_voy"), "");
			LAi_SetActorType(CharacterFromID("pir_cap30"));
			LAi_ActorAttack(CharacterFromID("pir_cap30"), characterFromID("wr_voy"), "");

			LAi_QuestDelay("corvette_sniper6", 4.0);
		break;

		case "corvette_sniper6":
			PlaySound("INTERFACE\closed_locked_door.wav");
			ChangeCharacterAddressGroup(characterFromID("wr_voy"), "wr_ships", "goto", "doctor_inv");

			LAi_QuestDelay("corvette_sniper7", 4.0);
		break;

		case "corvette_sniper7":
			ChangeCharacterAddressGroup(characterFromID("wr_voy"), "none", "", "");

			LAi_QuestDelay("corvette_sniper8", 2.0);
		break;

		case "corvette_sniper8":
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorTurnToCharacter(CharacterFromID("Selkirk"), Pchar);
			LAi_SetActorType(CharacterFromID("Friday"));
			LAi_ActorTurnToCharacter(CharacterFromID("Friday"), Pchar);

			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "blaze_wounded";
		break;

		case "corvette_sniper9":
			//from Vane dialog
			LAi_SetSitType(CharacterFromID("Selkirk"));
			LAi_SetSitType(CharacterFromID("Friday"));

			LAi_SetOfficerType(CharacterFromID("pir_cap1"));
			LAi_SetOfficerType(CharacterFromID("pir_cap7"));
			LAi_SetOfficerType(CharacterFromID("pir_cap8"));
			LAi_SetOfficerType(CharacterFromID("pir_cap16"));
			LAi_SetOfficerType(CharacterFromID("pir_cap23"));
			LAi_SetOfficerType(CharacterFromID("pir_cap9"));
			LAi_SetOfficerType(CharacterFromID("pir_cap18"));
			LAi_SetOfficerType(CharacterFromID("pir_cap4"));
			LAi_SetOfficerType(CharacterFromID("pir_cap5"));
			LAi_SetOfficerType(CharacterFromID("pir_cap26"));
			LAi_SetOfficerType(CharacterFromID("pir_cap3"));
			LAi_SetOfficerType(CharacterFromID("pir_cap30"));
			LAi_SetOfficerType(CharacterFromID("pir_cap14"));

			LAi_QuestDelay("corvette_sniper10", 1.0);
		break;

		case "corvette_sniper10":
			PlaySound("PEOPLE\clothes2.wav");
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);

			SetModel(PChar, "BlazePira4M_WL", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			LAi_QuestDelay("corvette_sniper11", 3.0);
		break;

		case "corvette_sniper11":
			LAi_SetOfficerType(CharacterFromID("Friday"));

			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorDialog(characterFromID("Selkirk"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Selkirk"));
			Characters[GetCharacterIndex("Selkirk")].dialog.CurrentNode  = "blaze_not_wounded";
		break;
	//----------------------------------------------------------------------------------------------------
		case "corvette_greetings_dialog":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorTurnToCharacter(CharacterFromID("pir_cap1"), CharacterFromID("Selkirk"));
			PlaySound("VOICE\ENGLISH\pir_capR6.wav");

			LAi_QuestDelay("corvette_greetings_dialog1", 4.5);
		break;

		case "corvette_greetings_dialog1":
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorTurnToCharacter(CharacterFromID("Selkirk"), CharacterFromID("pir_cap1"));
			PlaySound("VOICE\ENGLISH\Eng_m_c_073.wav");

			LAi_QuestDelay("corvette_greetings_dialog2", 3.5);
		break;

		case "corvette_greetings_dialog2":
			LAi_ActorTurnToCharacter(CharacterFromID("pir_cap1"), CharacterFromID("Selkirk"));
			PlaySound("VOICE\ENGLISH\pir_capR7.wav");

			LAi_QuestDelay("corvette_greetings_dialog3", 2.5);
		break;

		case "corvette_greetings_dialog3":
			LAi_ActorTurnToCharacter(CharacterFromID("Selkirk"), CharacterFromID("pir_cap1"));
			PlaySound("VOICE\ENGLISH\Eng_m_c_078.wav");

			LAi_QuestDelay("corvette_greetings_dialog4", 2.5);
		break;

		case "corvette_greetings_dialog4":
			LAi_ActorTurnToCharacter(CharacterFromID("pir_cap1"), CharacterFromID("Selkirk"));
			PlaySound("VOICE\ENGLISH\pir_capR11.wav");

			LAi_QuestDelay("corvette_greetings_dialog5", 4.0);
		break;

		case "corvette_greetings_dialog5":
			LAi_ActorTurnToCharacter(CharacterFromID("Selkirk"), CharacterFromID("pir_cap1"));
			PlaySound("VOICE\ENGLISH\Eng_m_c_077.wav");

			LAi_QuestDelay("corvette_greetings_dialog6", 2.5);
		break;

		case "corvette_greetings_dialog6":
			LAi_ActorTurnToCharacter(CharacterFromID("pir_cap1"), CharacterFromID("Selkirk"));
			PlaySound("VOICE\ENGLISH\pir_capR4.wav");

			LAi_QuestDelay("corvette_pchar_get_dressed", 3.0);
		break;
	//----------------------------------------------------------------------------------------------------
		case "corvette_pchar_get_dressed":
			LAi_SetPoorType(Pchar);
			PlaySound("OBJECTS\VOICES\DEAD\male\dead7.wav");

			LAi_ActorTurnToCharacter(CharacterFromID("pir_cap1"), Pchar);
			LAi_ActorTurnToCharacter(CharacterFromID("Selkirk"), Pchar);

			LAi_QuestDelay("corvette_pchar_get_dressed1", 2.0);
		break;

		case "corvette_pchar_get_dressed1":
			LAi_SetStayType(Pchar);
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");

			LAi_QuestDelay("corvette_pchar_get_dressed1A", 2.0);
		break;

		case "corvette_pchar_get_dressed1A":
			PlaySound("PEOPLE\clothes1.wav");
			SetModel(PChar, "BlazePira4M_WT", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			LAi_QuestDelay("corvette_pchar_get_dressed2", 2.0);
		break;

		case "corvette_pchar_get_dressed2":
			PlaySound("PEOPLE\clothes1.wav");
			SetModel(PChar, "Pira4M_WT", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			LAi_QuestDelay("corvette_pchar_get_dressed3", 2.0);
		break;

		case "corvette_pchar_get_dressed3":
			PlaySound("PEOPLE\clothes1.wav");
			SetModel(PChar, "Pira4M_CT", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			LAi_QuestDelay("corvette_pchar_get_dressed4", 2.0);
		break;

		case "corvette_pchar_get_dressed4":
			PlaySound("INTERFACE\cancel.wav");
			SetModel(PChar, "Pira4M_HT", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			LAi_QuestDelay("corvette_pchar_get_dressed5", 2.0);
		break;

		case "corvette_pchar_get_dressed5":
			PlaySound("PEOPLE\clothes2.wav");
			SetModel(PChar, "Pira4M_HTU", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			LAi_QuestDelay("corvette_pchar_get_dressed6", 2.0);
		break;

		case "corvette_pchar_get_dressed6":
			PlaySound("PEOPLE\clothes1.wav");
			SetModel(PChar, "Pira4M_HTUS", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			LAi_QuestDelay("corvette_pchar_get_dressed7", 2.0);
		break;

		case "corvette_pchar_get_dressed7":
			if(CheckCharacterItem(Pchar, "blade1"));
			{
				PlaySound("OBJECTS\DUEL\sabre_sh.wav");
				EquipCharacterByItem(Pchar, "blade1");
			}

			LAi_QuestDelay("corvette_pchar_get_dressed8", 2.0);
		break;

		case "corvette_pchar_get_dressed8":
			PlaySound("PEOPLE\clothes1.wav");
			SetModel(PChar, "Pira4M_HTUS_b", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			LAi_QuestDelay("corvette_pchar_get_dressed9", 2.0);
		break;

		case "corvette_pchar_get_dressed9":
			PlaySound("OBJECTS\DUEL\reload1.wav");
			EquipCharacterbyItem(Pchar, "pistol20");

			LAi_QuestDelay("corvette_pchar_get_dressed10", 2.0);
		break;

		case "corvette_pchar_get_dressed10":
			PlaySound("INTERFACE\button1.wav");

			LAi_SetPlayerType(Pchar);
			LAi_SetOfficerType(characterFromID("Selkirk"));
			LAi_SetOfficerType(characterFromID("Friday"));
			LAi_SetOfficerType(characterFromID("pir_cap1"));

			SetModel(PChar, "Pira4M_HTUS_a", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			LAi_QuestDelay("corvette_pchar_get_dressed11", 1.0);
		break;

		case "corvette_pchar_get_dressed11":
			PlaySound("VOICE\ENGLISH\blaze_puh.wav");

			LAi_QuestDelay("galleon_search", 1.0);
		break;

		case "galleon_search":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "galleon_search";
		break;

		case "galleon_search1":
			//from Vane dialog
			PlaySound("VOICE\ENGLISH\pir_capR12.wav");

			LAi_SetActorType(CharacterFromID("Friday"));
			LAi_ActorRunToLocator(characterFromID("Friday"), "goto", "friday_report", "", "");
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorRunToLocator(characterFromID("Selkirk"), "reload", "reload11", "", "");

			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorRunToLocator(characterFromID("pir_cap1"), "reload", "reload12", "", "");
			LAi_SetActorType(CharacterFromID("pir_cap7"));
			LAi_ActorRunToLocator(characterFromID("pir_cap7"), "reload", "reload8", "", "");
			LAi_SetActorType(CharacterFromID("pir_cap5"));
			LAi_ActorRunToLocator(characterFromID("pir_cap5"), "reload", "reload12", "", "");
			LAi_SetActorType(CharacterFromID("pir_cap8"));
			LAi_ActorRunToLocator(characterFromID("pir_cap8"), "reload", "reload8", "", "");
			LAi_SetActorType(CharacterFromID("pir_cap14"));
			LAi_ActorRunToLocator(characterFromID("pir_cap14"), "reload", "reload11", "", "");
			LAi_SetActorType(CharacterFromID("pir_cap16"));
			LAi_ActorRunToLocator(characterFromID("pir_cap16"), "reload", "reload12", "", "");
			LAi_SetActorType(CharacterFromID("pir_cap23"));
			LAi_ActorRunToLocator(characterFromID("pir_cap23"), "reload", "reload10", "", "");
			LAi_SetActorType(CharacterFromID("pir_cap9"));
			LAi_ActorRunToLocator(characterFromID("pir_cap9"), "reload", "reload8", "", "");
			LAi_SetActorType(CharacterFromID("pir_cap18"));
			LAi_ActorRunToLocator(characterFromID("pir_cap18"), "reload", "reload9", "", "");
			LAi_SetActorType(CharacterFromID("pir_cap4"));
			LAi_ActorRunToLocator(characterFromID("pir_cap4"), "reload", "reload9", "", "");
			LAi_SetActorType(CharacterFromID("pir_cap26"));
			LAi_ActorRunToLocator(characterFromID("pir_cap26"), "reload", "reload9", "", "");
			LAi_SetActorType(CharacterFromID("pir_cap3"));
			LAi_ActorRunToLocator(characterFromID("pir_cap3"), "reload", "reload11", "", "");
			LAi_SetActorType(CharacterFromID("pir_cap30"));
			LAi_ActorRunToLocator(characterFromID("pir_cap30"), "reload", "reload10", "", "");

			LAi_QuestDelay("galleon_search2", 6.0);//was 4.0
		break;

		case "galleon_search2":
			PlaySound("VOICE\ENGLISH\gr_friday2.wav");

			LAi_SetActorType(CharacterFromID("Friday"));
			LAi_ActorTurnToCharacter(CharacterFromID("Friday"), Pchar);
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("Friday"));

			LAi_QuestDelay("galleon_search3", 2.5);
		break;

		case "galleon_search3":
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorDialog(characterFromID("Selkirk"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Selkirk"));
			Characters[GetCharacterIndex("Selkirk")].dialog.CurrentNode  = "friday_found_open_hatch";
		break;

		case "galleon_search4":
			//from Selkirk dailog

			LAi_SetPlayerType(Pchar);
			LAi_SetActorType(CharacterFromID("Friday"));
			LAi_ActorRunToLocator(characterFromID("Friday"), "reload", "reload17", "", "");
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorRunToLocator(characterFromID("Selkirk"), "reload", "reload17", "", "");

			ChangeCharacterAddressGroup(characterFromID("pir_cap1"), "wr_ships", "reload", "reload12");
			LAi_SetCitizenType(CharacterFromID("pir_cap1"));

			if(!LAi_IsDead(CharacterFromID("pir_cap7")))
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap7"), "wr_ships", "reload", "reload8");
				LAi_SetCitizenType(CharacterFromID("pir_cap7"));
			}

			if(!LAi_IsDead(CharacterFromID("pir_cap5")))
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap5"), "wr_ships", "reload", "reload12");
				LAi_SetCitizenType(CharacterFromID("pir_cap5"));
			}

			if(!LAi_IsDead(CharacterFromID("pir_cap8")))
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap8"), "wr_ships", "reload", "reload8");
				LAi_SetCitizenType(CharacterFromID("pir_cap8"));
			}

			if(!LAi_IsDead(CharacterFromID("pir_cap14")))
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap14"), "wr_ships", "reload", "reload11");
				LAi_SetCitizenType(CharacterFromID("pir_cap14"));
			}

			if(!LAi_IsDead(CharacterFromID("pir_cap16")))
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap16"), "wr_ships", "reload", "reload12");
				LAi_SetCitizenType(CharacterFromID("pir_cap16"));
			}

			if(!LAi_IsDead(CharacterFromID("pir_cap23")))
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap23"), "wr_ships", "reload", "reload10");
				LAi_SetCitizenType(CharacterFromID("pir_cap23"));
			}

			if(!LAi_IsDead(CharacterFromID("pir_cap18")))
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap18"), "wr_ships", "reload", "reload9");
				LAi_SetCitizenType(CharacterFromID("pir_cap18"));
			}

			if(!LAi_IsDead(CharacterFromID("pir_cap4")))
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap4"), "wr_ships", "reload", "reload9");
				LAi_SetCitizenType(CharacterFromID("pir_cap4"));
			}

			if(!LAi_IsDead(CharacterFromID("pir_cap26")))
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap26"), "wr_ships", "reload", "reload9");
				LAi_SetCitizenType(CharacterFromID("pir_cap26"));
			}

			if(!LAi_IsDead(CharacterFromID("pir_cap3")))
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap3"), "wr_ships", "reload", "reload10");
				LAi_SetCitizenType(CharacterFromID("pir_cap3"));
			}

			if(!LAi_IsDead(CharacterFromID("pir_cap30")))
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap30"), "wr_ships", "reload", "reload10");
				LAi_SetCitizenType(CharacterFromID("pir_cap30"));
			}

			LAi_QuestDelay("galleon_search5", 4.0);
		break;

		case "galleon_search5":
			ChangeCharacterAddressGroup(characterFromID("Friday"), "wr_ships", "reload", "reload17");
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "wr_ships", "goto", "gotoR17");
			LAi_SetStayType(CharacterFromID("Friday"));
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorTurnToCharacter(CharacterFromID("Selkirk"), Pchar);
			LAi_SetStayType(CharacterFromID("Selkirk"));

			pchar.quest.galleon_search6.win_condition.l1 = "location";
			pchar.quest.galleon_search6.win_condition.l1.location = "wr_gall_deck2_prow";
			pchar.quest.galleon_search6.win_condition = "galleon_search6";
		break;

		case "galleon_search6":
			PlaySound("PEOPLE\crew_noise.wav");

			ChangeCharacterAddressGroup(characterFromID("Friday"), "wr_gall_deck2_prow", "goto", "friday");
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "wr_gall_deck2_prow", "goto", "selkirk");
			LAi_SetOfficerType(CharacterFromID("Friday"));
			LAi_SetOfficerType(CharacterFromID("Selkirk"));

			Characters[GetCharacterIndex("guncrew_1")].quest.meeting = "default";
			Characters[GetCharacterIndex("guncrew_2")].quest.meeting = "default";
			Characters[GetCharacterIndex("guncrew_3")].quest.meeting = "default";
			Characters[GetCharacterIndex("guncrew_4")].quest.meeting = "default";

			pchar.quest.galleon_anvil1.win_condition.l1 = "locator";
			pchar.quest.galleon_anvil1.win_condition.l1.location = "wr_gall_deck2_prow";
			pchar.quest.galleon_anvil1.win_condition.l1.locator_group = "goto";
			pchar.quest.galleon_anvil1.win_condition.l1.locator = "anvil";
			pchar.quest.galleon_anvil1.win_condition = "galleon_anvil1";

			pchar.quest.galleon_search8.win_condition.l1 = "location";
			pchar.quest.galleon_search8.win_condition.l1.location = "wr_gall_galley_flooded";
			pchar.quest.galleon_search8.win_condition = "galleon_search8";
		break;

		case "galleon_search8":
			PlaySound("PEOPLE\drowning_crew.wav");

			LAi_SetStayType(CharacterFromID("Friday"));
			LAi_SetStayType(CharacterFromID("Selkirk"));

			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "goto1", "galleon_search9", 5.0);
			LAi_SetActorType(CharacterFromID("guncrew_1"));
			LAi_ActorGoToLocator(CharacterFromID("guncrew_1"), "reload", "reload1", "", 5.0);
			LAi_SetActorType(CharacterFromID("guncrew_2"));
			LAi_ActorGoToLocator(CharacterFromID("guncrew_2"), "reload", "reload1", "", 5.0);
			LAi_SetActorType(CharacterFromID("guncrew_3"));
			LAi_ActorGoToLocator(CharacterFromID("guncrew_3"), "reload", "reload1", "", 5.0);
			LAi_SetActorType(CharacterFromID("guncrew_4"));
			LAi_ActorGoToLocator(CharacterFromID("guncrew_4"), "reload", "reload1", "", 5.0);
		break;

		case "galleon_search9":
			LAi_ActorTurnToLocator(Pchar, "reload", "reload1");
			PlaySound("OBJECTS\SHIPCHARGE\_Abandon1.wav");

			LAi_QuestDelay("galleon_search10", 1.0);
		break;

		case "galleon_search10":
			PlaySound("INTERFACE\closed_door.wav");
			LAi_SetPlayerType(Pchar);

			LAi_SetStayType(CharacterFromID("guncrew_1"));
			LAi_SetStayType(CharacterFromID("guncrew_2"));
			LAi_SetStayType(CharacterFromID("guncrew_3"));
			LAi_SetStayType(CharacterFromID("guncrew_4"));
			ChangeCharacterAddressGroup(characterFromID("guncrew_1"), "wr_gall_deck2_prow", "goto", "gunner4");
			ChangeCharacterAddressGroup(characterFromID("guncrew_2"), "wr_gall_deck2_prow", "goto", "gunner7");
			ChangeCharacterAddressGroup(characterFromID("guncrew_3"), "wr_gall_deck2_prow", "goto", "gunner6");
			ChangeCharacterAddressGroup(characterFromID("guncrew_4"), "wr_gall_deck2_prow", "goto", "gunner5");

			Pchar.quest.guncrew = "at_anvil";
		break;
	//----------------------------------------------------------------------------------------------------
		case "galleon_anvil":
			LAi_SetPlayerType(Pchar);

			pchar.quest.galleon_anvil1.win_condition.l1 = "locator";
			pchar.quest.galleon_anvil1.win_condition.l1.location = "wr_gall_deck2_prow";
			pchar.quest.galleon_anvil1.win_condition.l1.locator_group = "goto";
			pchar.quest.galleon_anvil1.win_condition.l1.locator = "anvil";
			pchar.quest.galleon_anvil1.win_condition = "galleon_anvil1";
		break;

		case "galleon_anvil1":
			LAi_SetStayType(Pchar);
		break;

		case "anvil_too_heavy":
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
			Logit(LanguageConvertString(tmpLangFileID,"Hmm. That's not a good idea"));
			ChangeCharacterAddressGroup(Pchar, "wr_gall_deck2_prow", "goto", "anvil_backoff");

			if(CheckAttribute(Pchar,"quest.guncrew") && Pchar.quest.guncrew == "at_anvil")
			{
				LAi_SetStayType(Pchar);
				LAi_QuestDelay("anvil_dialog", 0.5);
			}
			else
			{
				LAi_QuestDelay("galleon_anvil", 0.1);
			}
		break;
	//----------------------------------------------------------------------------------------------------
		case "anvil_dialog":
			LAi_SetActorType(CharacterFromID("guncrew_1"));
			LAi_ActorDialog(characterFromID("guncrew_1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("guncrew_1"));
			Characters[GetCharacterIndex("guncrew_1")].dialog.CurrentNode  = "anvil";
		break;

		case "anvil_push":
			//from guncrew_1 dialog
			PlaySound("OBJECTS\DUEL\woman_hit3.wav");
			LAi_SetPlayerType(CharacterFromID("guncrew_1"));
			LAi_SetFightMode(CharacterFromID("guncrew_1"), true);

			LAi_QuestDelay("anvil_push1", 1.0);
		break;

		case "anvil_push1":
			PlaySound("OBJECTS\DUEL\man_attack1.wav");
			LAi_SetSitType(CharacterFromID("guncrew_2"));
			LAi_SetSitType(CharacterFromID("guncrew_3"));
			LAi_SetSitType(CharacterFromID("guncrew_4"));

			LAi_QuestDelay("anvil_push2", 0.5);
		break;

		case "anvil_push2":
			PlaySound("OBJECTS\DUEL\anchor.wav");
			PlaySound("OBJECTS\DUEL\anchor.wav");

			LAi_QuestDelay("anvil_push3", 0.5);
		break;

		case "anvil_push3":
			Locations[FindLocation("wr_gall_deck2_prow")].models.always.locators = "deck2_l_JRH_prowA2";
			Locations[FindLocation("wr_gall_deck2_prow")].image = "";
			Locations[FindLocation("wr_gall_deck2_prow")].locators_radius.box.box6 = 0.0001;	//anvil
			Locations[FindLocation("wr_gall_deck2_prow")].locators_radius.reload.reload4 = 1.0;	//to hold first
			DoQuestReloadToLocation("wr_gall_deck2_prow", "goto", "anvil_backoff", "anvil_push4");
		break;

		case "anvil_push4":
			LAi_SetStayType(CharacterFromID("guncrew_2"));
			LAi_SetStayType(CharacterFromID("guncrew_3"));
			LAi_SetStayType(CharacterFromID("guncrew_4"));

			CreateParticleSystem("blast_dirt_small" , -2.5, 14.45, 8.8, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("PEOPLE\wood3.wav");
			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("wr_gall_deck2_prow")].image = "wr_gall_deck2_prow.tga";

			Locations[FindLocation("wr_gall_hold_first")].reload.l1.disable = 0;
			Locations[FindLocation("wr_gall_hold_first")].locators_radius.reload.reload3 = 0.0001;	//stairs to irontool
			Locations[FindLocation("wr_gall_hold_first")].models.always.l2 = "plank1";		//deck
			Locations[FindLocation("wr_gall_hold_second")].id.label = "Cargo Hold";
			Locations[FindLocation("wr_gall_hold_second")].reload.l2.disable = 0;			//start up to inner
			Locations[FindLocation("wr_gall_hold_second")].locators_radius.reload.reload3 = 1.0;
			Locations[FindLocation("wr_gall_hold_second")].reload.l2.go = "wr_gall_cap_inner";
			Locations[FindLocation("wr_gall_hold_second")].reload.l2.emerge = "reload2";

			Locations[FindLocation("wr_gall_hold_second")].reload.l3.disable = 0;
			Locations[FindLocation("wr_gall_hold_second")].models.always.locators = "hold_l_JRH_second";
			ChangeCharacterAddressGroup(characterFromID("wr_ltnorr"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("wr_man4"), "none", "", "");
			Locations[FindLocation("wr_gall_deck2_stern")].reload.l4.go = "wr_gall_cap_outer";
			Locations[FindLocation("wr_gall_deck2_stern")].reload.l4.emerge = "goto4";

			Locations[FindLocation("wr_gall_cap_outer")].id.label = "Captain's deck";
			ChangeCharacterAddressGroup(characterFromID("wr_pir9"), "none", "", "");

			Locations[FindLocation("wr_gall_captain")].locators_radius.box.box1 = 0.0001;
			Locations[FindLocation("wr_gall_captain")].locators_radius.box.box2 = 0.0001;
			Locations[FindLocation("wr_gall_captain")].locators_radius.box.box3 = 0.0001;	//trunk function

			LAi_SetSitType(characterFromID("wr_bri"));
			LAi_SetStayType(characterFromID("wr_pir13"));
			LAi_SetStayType(characterFromID("wr_voy"));
			LAi_SetSitType(characterFromID("wr_cor4"));
			ChangeCharacterAddressGroup(characterFromID("wr_bri"), "wr_gall_captain", "sit", "sit1");
			ChangeCharacterAddressGroup(characterFromID("wr_pir13"), "wr_gall_captain", "goto", "stay2");
			ChangeCharacterAddressGroup(characterFromID("wr_voy"), "wr_gall_captain", "goto", "stay16");
			ChangeCharacterAddressGroup(characterFromID("wr_cor4"), "wr_gall_captain", "sit", "sit2");

			LAi_SetStayType(characterFromID("wr_fsh1"));
			LAi_SetSitType(characterFromID("wr_blm"));
			LAi_SetSitType(characterFromID("wr_ron"));
			LAi_SetSitType(characterFromID("wr_ltnorr"));
			LAi_SetSitType(characterFromID("wr_man4"));
			LAi_SetStayType(characterFromID("wr_pir9"));
			LAi_SetStayType(characterFromID("wr_will"));
			ChangeCharacterAddressGroup(characterFromID("wr_blm"), "wr_gall_captain", "sit", "sit4");
			ChangeCharacterAddressGroup(characterFromID("wr_ron"), "wr_gall_captain", "sit", "sit5");
			ChangeCharacterAddressGroup(characterFromID("wr_ltnorr"), "wr_gall_captain", "sit", "sit6");
			ChangeCharacterAddressGroup(characterFromID("wr_man4"), "wr_gall_captain", "sit", "sit7");
			ChangeCharacterAddressGroup(characterFromID("wr_fsh1"), "wr_gall_captain", "goto", "stay15");
			ChangeCharacterAddressGroup(characterFromID("wr_pir9"), "wr_gall_captain", "goto", "stay11");//door
			ChangeCharacterAddressGroup(characterFromID("wr_will"), "wr_gall_captain", "goto", "stay12");//door

			LAi_SetSitType(characterFromID("wr_cor1_3"));
			ChangeCharacterAddressGroup(characterFromID("wr_cor1_3"), "wr_gall_captain", "sit", "sit9");

			GiveItem2Character(characterFromID("wr_fsh1"), "blade1-2");
			EquipCharacterbyItem(CharacterFromID("wr_fsh1"), "blade1-2");

			GiveItem2Character(characterFromID("wr_cor1_3"), "blade1-2");
			EquipCharacterbyItem(CharacterFromID("wr_cor1_3"), "blade1-2");
			GiveItem2Character(CharacterFromID("wr_cor1_3"), "pistol2");
			EquipCharacterbyItem(CharacterFromID("wr_cor1_3"), "pistol2");
			TakenItems(CharacterFromID("wr_cor1_3"), "gunpowder", 1);
			TakenItems(CharacterFromID("wr_cor1_3"), "pistolbullets", 2);
	
			pchar.quest.galleon_search11.win_condition.l1 = "location";
			pchar.quest.galleon_search11.win_condition.l1.location = "wr_gall_hold_second";
			pchar.quest.galleon_search11.win_condition = "galleon_search11";
		break;

		case "galleon_search11":
			SetCurrentTime(7.00, 0);
			SetNextWeather("Clear");

			pchar.quest.galleon_search12.win_condition.l1 = "locator";
			pchar.quest.galleon_search12.win_condition.l1.location = "wr_ships";
			pchar.quest.galleon_search12.win_condition.l1.locator_group = "goto";
			pchar.quest.galleon_search12.win_condition.l1.locator = "qdeck";
			pchar.quest.galleon_search12.win_condition = "galleon_search12";
		break;

		case "galleon_search12":
			LAi_SetStayType(characterFromID("pir_cap1"));
			LAi_SetStayType(characterFromID("pir_cap8"));
			LAi_SetStayType(characterFromID("pir_cap16"));
			LAi_SetStayType(characterFromID("pir_cap18"));
			LAi_SetStayType(characterFromID("pir_cap23"));

			LAi_SetStayType(characterFromID("pir_cap5"));
			LAi_SetStayType(characterFromID("pir_cap14"));
			LAi_SetStayType(characterFromID("pir_cap3"));
			LAi_SetStayType(characterFromID("pir_cap30"));
			LAi_SetStayType(characterFromID("pir_cap7"));
			LAi_SetStayType(characterFromID("pir_cap9"));
			LAi_SetStayType(characterFromID("pir_cap26"));
			LAi_SetStayType(characterFromID("pir_cap4"));

			ChangeCharacterAddressGroup(characterFromID("pir_cap1"), "wr_gall_cap_outer", "goto", "goto4");
			ChangeCharacterAddressGroup(characterFromID("guncrew_1"), "wr_gall_cap_outer", "goto", "vane1");
			ChangeCharacterAddressGroup(characterFromID("guncrew_2"), "wr_gall_cap_outer", "goto", "vane2");
			ChangeCharacterAddressGroup(characterFromID("guncrew_3"), "wr_gall_cap_outer", "goto", "vane3");
			ChangeCharacterAddressGroup(characterFromID("guncrew_4"), "wr_gall_cap_outer", "goto", "vane4");
			ChangeCharacterAddressGroup(characterFromID("Friday"), "wr_gall_cap_outer", "goto", "vane6");
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "wr_gall_cap_outer", "goto", "vane7");

			if(!LAi_IsDead(CharacterFromID("pir_cap16"))) ChangeCharacterAddressGroup(characterFromID("pir_cap16"), "wr_gall_cap_outer", "goto", "vane5");
			if(!LAi_IsDead(CharacterFromID("pir_cap23"))) ChangeCharacterAddressGroup(characterFromID("pir_cap23"), "wr_gall_cap_outer", "goto", "vane8");
			if(!LAi_IsDead(CharacterFromID("pir_cap8"))) ChangeCharacterAddressGroup(characterFromID("pir_cap8"), "wr_gall_cap_outer", "goto", "vane9");
			if(!LAi_IsDead(CharacterFromID("pir_cap18"))) ChangeCharacterAddressGroup(characterFromID("pir_cap18"), "wr_gall_cap_outer", "goto", "vane10");

			if(!LAi_IsDead(CharacterFromID("pir_cap5")))
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap5"), "wr_gall_cap_outer", "goto", "vane11");
				ChangeCharacterAddressGroup(characterFromID("pir_cap7"), "none", "", "");
			}
			else
			{
				if(!LAi_IsDead(CharacterFromID("pir_cap7"))) ChangeCharacterAddressGroup(characterFromID("pir_cap7"), "wr_gall_cap_outer", "goto", "vane11");
			}

			if(!LAi_IsDead(CharacterFromID("pir_cap14")))
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap14"), "wr_gall_cap_outer", "goto", "vane12");
				ChangeCharacterAddressGroup(characterFromID("pir_cap9"), "none", "", "");
			}
			else
			{
				if(!LAi_IsDead(CharacterFromID("pir_cap9"))) ChangeCharacterAddressGroup(characterFromID("pir_cap9"), "wr_gall_cap_outer", "goto", "vane12");
			}

			if(!LAi_IsDead(CharacterFromID("pir_cap3")))
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap3"), "wr_gall_cap_outer", "goto", "vane13");
				ChangeCharacterAddressGroup(characterFromID("pir_cap4"), "none", "", "");
			}
			else
			{
				if(!LAi_IsDead(CharacterFromID("pir_cap4"))) ChangeCharacterAddressGroup(characterFromID("pir_cap4"), "wr_gall_cap_outer", "goto", "vane13");
			}

			if(!LAi_IsDead(CharacterFromID("pir_cap30")))
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap30"), "wr_gall_cap_outer", "goto", "vane14");
				ChangeCharacterAddressGroup(characterFromID("pir_cap26"), "none", "", "");
			}
			else
			{
				if(!LAi_IsDead(CharacterFromID("pir_cap26"))) ChangeCharacterAddressGroup(characterFromID("pir_cap26"), "wr_gall_cap_outer", "goto", "vane14");
			}

			GiveItem2Character(CharacterFromID("pir_cap9"), "pistolthrowaxe");
			EquipCharacterbyItem(CharacterFromID("pir_cap9"), "pistolthrowaxe");
			GiveItem2Character(CharacterFromID("pir_cap4"), "pistolthrowaxe");
			EquipCharacterbyItem(CharacterFromID("pir_cap4"), "pistolthrowaxe");
			GiveItem2Character(CharacterFromID("pir_cap26"), "pistolthrowaxe");
			EquipCharacterbyItem(CharacterFromID("pir_cap26"), "pistolthrowaxe");
			GiveItem2Character(CharacterFromID("pir_cap18"), "pistolthrowaxe");
			EquipCharacterbyItem(CharacterFromID("pir_cap18"), "pistolthrowaxe");
			GiveItem2Character(CharacterFromID("pir_cap3"), "pistoldart");
			EquipCharacterbyItem(CharacterFromID("pir_cap3"), "pistoldart");
			GiveItem2Character(CharacterFromID("pir_cap30"), "pistoldart");
			EquipCharacterbyItem(CharacterFromID("pir_cap30"), "pistoldart");

			GiveItem2Character(CharacterFromID("wr_bri"), "bladeA5");
			EquipCharacterbyItem(CharacterFromID("wr_bri"), "bladeA5");
			GiveItem2Character(CharacterFromID("wr_bri"), "pistol2");
			EquipCharacterbyItem(CharacterFromID("wr_bri"), "pistol2");

			pchar.quest.cabin_inspect1.win_condition.l1 = "locator";
			pchar.quest.cabin_inspect1.win_condition.l1.location = "wr_gall_captain";
			pchar.quest.cabin_inspect1.win_condition.l1.locator_group = "reload";
			pchar.quest.cabin_inspect1.win_condition.l1.locator = "reload1";
			pchar.quest.cabin_inspect1.win_condition = "cabin_inspect1";
		break;
	//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
		case "cabin_inspect1":
			PlaySound("VOICE\ENGLISH\Eng_m_a_056.wav");

			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "vane4B", "cabin_inspect2", 1.0);
		break;

		case "cabin_inspect2":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("wr_voy"));

			LAi_QuestDelay("cabin_inspect3", 3.0);
		break;

		case "cabin_inspect3":
			PlaySound("VOICE\ENGLISH\Fre_m_c_076.wav");

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("wr_man4"));

			LAi_QuestDelay("cabin_inspect4", 3.0);
		break;

		case "cabin_inspect4":
			PlaySound("VOICE\ENGLISH\por_m_b_006.wav");

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("wr_bri"));

			LAi_QuestDelay("cabin_inspect5", 3.0);
		break;

		case "cabin_inspect5":
			PlaySound("VOICE\ENGLISH\Eng_m_c_012.wav");
			LAi_SetActorType(CharacterFromID("wr_pir13"));

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("wr_ron"));

			LAi_QuestDelay("cabin_inspect6", 3.0);
		break;

		case "cabin_inspect6":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("wr_voy"));

			LAi_QuestDelay("cabin_fight1", 2.0);
		break;
	//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
		case "cabin_fight1":
			PlaySound("VOICE\ENGLISH\Eng_m_a_059.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "pchar", "cabin_fight1A", 3.0);

			LAi_QuestDelay("cabin_fight2", 1.0);
			LAi_QuestDelay("cabin_fight3", 2.0);
		break;

		case "cabin_fight1A":
			PlaySound("PEOPLE\Jump_Counter.wav");
			LAi_SetSitType(characterFromID("wr_voy"));
			ChangeCharacterAddressGroup(characterFromID("wr_voy"), "wr_gall_captain", "goto", "table1");

			LAi_QuestDelay("cabin_fight1B", 0.5);
		break;

		case "cabin_fight1B":
			ChangeCharacterAddressGroup(characterFromID("wr_voy"), "wr_gall_captain", "goto", "dover");

			LAi_QuestDelay("cabin_fight1C", 0.5);
		break;

		case "cabin_fight1C":
			LAi_SetStayType(characterFromID("wr_voy"));
		break;
	//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
		case "cabin_fight2":
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "wr_gall_captain", "reload", "reload1");
			ChangeCharacterAddressGroup(characterFromID("Friday"), "wr_gall_captain", "reload", "reload1");
			LAi_SetActorType(characterFromID("Friday"));
			LAi_ActorGoToLocator(characterFromID("Friday"), "goto", "friday", "", "");
			LAi_SetActorType(characterFromID("Selkirk"));
			LAi_ActorGoToLocator(characterFromID("Selkirk"), "goto", "selkirk", "", "");

			LAi_QuestDelay("cabin_fight2A", 1.0);
		break;

		case "cabin_fight2A":
			LAi_SetActorType(characterFromID("wr_pir13"));
			LAi_ActorGoToLocator(characterFromID("wr_pir13"), "goto", "cook", "", "");
			LAi_SetStayType(characterFromID("wr_cor4"));

			LAi_QuestDelay("cabin_fight2B", 1.0);
		break;

		case "cabin_fight2B":
			ChangeCharacterAddressGroup(characterFromID("wr_cor4"), "wr_gall_captain", "goto", "dampier");
		break;
	//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
		case "cabin_fight3":
			PlaySound("VOICE\ENGLISH\pir_capR8.wav");
			ChangeCharacterAddressGroup(characterFromID("pir_cap1"), "wr_gall_captain", "reload", "reload1");
			LAi_SetActorType(characterFromID("pir_cap1"));
			LAi_ActorGoToLocator(characterFromID("pir_cap1"), "goto", "vane", "", "");

			LAi_QuestDelay("cabin_fight3A", 0.5);
		break;

		case "cabin_fight3AA":
			LAi_SetStayType(characterFromID("wr_bri"));

			LAi_QuestDelay("cabin_fight3A", 2.5);
		break;

		case "cabin_fight3A":
			PlaySound("PEOPLE\Jump_Counter.wav");
			ChangeCharacterAddressGroup(characterFromID("wr_bri"), "wr_gall_captain", "goto", "table2");

			LAi_QuestDelay("cabin_fight3B", 0.5);
		break;

		case "cabin_fight3B":
			ChangeCharacterAddressGroup(characterFromID("wr_bri"), "wr_gall_captain", "goto", "courtney");

			LAi_QuestDelay("cabin_fight3C", 0.5);
		break;

		case "cabin_fight3C":
			LAi_SetStayType(characterFromID("wr_bri"));

			LAi_QuestDelay("cabin_fight4", 0.01);
			LAi_QuestDelay("Friday_bladecheck_cabin", 0.1);
			LAi_QuestDelay("Dover_bladecheck_cabin", 0.1);
			LAi_QuestDelay("Courtney_bladecheck_cabin", 0.1);
			LAi_QuestDelay("La_Buze_bladecheck_cabin", 0.1);
			LAi_QuestDelay("Roberts_bladecheck_cabin", 0.1);
			LAi_QuestDelay("Rackham_bladecheck_cabin", 0.1);
			LAi_QuestDelay("Taylor_bladecheck_cabin", 0.1);
		break;
	//----------------------------------------------------------------------------------------------------------
		case "Friday_bladecheck_cabin":
			if(pchar.location == "wr_gall_captain")
			{
				if(!IsEquipCharacterByItem(characterFromID("Friday"), "bladeaxe1"))
				{
					RemoveCharacterEquip(characterFromID("Friday"), BLADE_ITEM_TYPE );
					if(!CheckCharacterItem(characterFromID("Friday"), "bladeaxe1"));
					{
						GiveItem2Character(characterFromID("Friday"), "bladeaxe1");
					}
					EquipCharacterbyItem(characterFromID("Friday"), "bladeaxe1");
				}
				else LAi_QuestDelay("Friday_bladecheck_cabin", 1.0);
			}
			else return;
		break;

		case "Dover_bladecheck_cabin":
			if(pchar.location == "wr_gall_captain")
			{
				if(!IsEquipCharacterByItem(characterFromID("wr_voy"), "bladep6"))
				{
					RemoveCharacterEquip(characterFromID("wr_voy"), BLADE_ITEM_TYPE );
					if(!CheckCharacterItem(characterFromID("wr_voy"), "bladep6"));
					{
						GiveItem2Character(characterFromID("wr_voy"), "bladep6");
					}
					EquipCharacterbyItem(characterFromID("wr_voy"), "bladep6");
				}
				else LAi_QuestDelay("Dover_bladecheck_cabin", 1.0);
			}
			else return;
		break;

		case "Courtney_bladecheck_cabin":
			if(pchar.location == "wr_gall_captain")
			{
				if(!IsEquipCharacterByItem(characterFromID("wr_bri"), "bladeA5"))
				{
					RemoveCharacterEquip(characterFromID("wr_bri"), BLADE_ITEM_TYPE );
					if(!CheckCharacterItem(characterFromID("wr_bri"), "bladeA5"));
					{
						GiveItem2Character(characterFromID("wr_bri"), "bladeA5");
					}
					EquipCharacterbyItem(characterFromID("wr_bri"), "bladeA5");
				}
				else LAi_QuestDelay("Courtney_bladecheck_cabin", 1.0);
			}
			else return;
		break;

		case "La_Buze_bladecheck_cabin":
			if(pchar.location == "wr_gall_captain")
			{
				if(!IsEquipCharacterByItem(characterFromID("pir_cap8"), "bladereliquary"))
				{
					RemoveCharacterEquip(characterFromID("pir_cap8"), BLADE_ITEM_TYPE );
					if(!CheckCharacterItem(characterFromID("pir_cap8"), "bladereliquary"));
					{
						GiveItem2Character(characterFromID("pir_cap8"), "bladereliquary");
					}
					EquipCharacterbyItem(characterFromID("pir_cap8"), "bladereliquary");
				}
				else LAi_QuestDelay("La_Buze_bladecheck_cabin", 1.0);
			}
			else return;
		break;

		case "Roberts_bladecheck_cabin":
			if(pchar.location == "wr_gall_captain")
			{
				if(!IsEquipCharacterByItem(characterFromID("pir_cap16"), "bladecenser"))
				{
					RemoveCharacterEquip(characterFromID("pir_cap16"), BLADE_ITEM_TYPE );
					if(!CheckCharacterItem(characterFromID("pir_cap16"), "bladecenser"));
					{
						GiveItem2Character(characterFromID("pir_cap16"), "bladecenser");
					}
					EquipCharacterbyItem(characterFromID("pir_cap16"), "bladecenser");
				}
				else LAi_QuestDelay("Roberts_bladecheck_cabin", 1.0);
			}
			else return;
		break;

		case "Rackham_bladecheck_cabin":
			if(pchar.location == "wr_gall_captain")
			{
				if(!IsEquipCharacterByItem(characterFromID("pir_cap18"), "bladecandelabre"))
				{
					RemoveCharacterEquip(characterFromID("pir_cap18"), BLADE_ITEM_TYPE );
					if(!CheckCharacterItem(characterFromID("pir_cap18"), "bladecandelabre"));
					{
						GiveItem2Character(characterFromID("pir_cap18"), "bladecandelabre");
					}
					EquipCharacterbyItem(characterFromID("pir_cap18"), "bladecandelabre");
				}
				else LAi_QuestDelay("Rackham_bladecheck_cabin", 1.0);
			}
			else return;
		break;

		case "Taylor_bladecheck_cabin":
			if(pchar.location == "wr_gall_captain")
			{
				if(!IsEquipCharacterByItem(characterFromID("pir_cap23"), "bladechalice"))
				{
					RemoveCharacterEquip(characterFromID("pir_cap23"), BLADE_ITEM_TYPE );
					if(!CheckCharacterItem(characterFromID("pir_cap23"), "bladechalice"));
					{
						GiveItem2Character(characterFromID("pir_cap23"), "bladechalice");
					}
					EquipCharacterbyItem(characterFromID("pir_cap23"), "bladechalice");
				}
				else LAi_QuestDelay("Taylor_bladecheck_cabin", 1.0);
			}
			else return;
		break;
	//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
		case "cabin_fight4":
			PlaySound("OBJECTS\ABORDAGE\abordage.wav");
			PlaySound("OBJECTS\ABORDAGE\abordage.wav");

			LAi_SetplayerType(Pchar);
			LAi_SetFightMode(PChar, true);

			if(!LAi_IsDead(CharacterFromID("pir_cap16"))) ChangeCharacterAddressGroup(characterFromID("pir_cap16"), "wr_gall_captain", "goto", "vane4B");
			if(!LAi_IsDead(CharacterFromID("pir_cap23"))) ChangeCharacterAddressGroup(characterFromID("pir_cap23"), "wr_gall_captain", "goto", "vane4C");
			if(!LAi_IsDead(CharacterFromID("pir_cap8"))) ChangeCharacterAddressGroup(characterFromID("pir_cap8"), "wr_gall_captain", "goto", "vane3B");
			if(!LAi_IsDead(CharacterFromID("pir_cap18"))) ChangeCharacterAddressGroup(characterFromID("pir_cap18"), "wr_gall_captain", "goto", "vane3C");

			LAi_SetHP(CharacterFromID("pir_cap8"), 100.0, 100.0);
			LAi_SetHP(CharacterFromID("pir_cap16"), 100.0, 100.0);
			LAi_SetHP(CharacterFromID("pir_cap18"), 100.0, 100.0);
			LAi_SetHP(CharacterFromID("pir_cap23"), 100.0, 100.0);

			if(!LAi_IsDead(CharacterFromID("pir_cap5")))
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap5"), "wr_gall_captain", "goto", "vane3A");
			}
			else
			{
				if(!LAi_IsDead(CharacterFromID("pir_cap7"))) ChangeCharacterAddressGroup(characterFromID("pir_cap7"), "wr_gall_captain", "goto", "vane3A");
			}

			if(!LAi_IsDead(CharacterFromID("pir_cap14")))
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap14"), "wr_gall_captain", "goto", "vane3D");
			}
			else
			{
				if(!LAi_IsDead(CharacterFromID("pir_cap9"))) ChangeCharacterAddressGroup(characterFromID("pir_cap9"), "wr_gall_captain", "goto", "vane3D");
			}

			if(!LAi_IsDead(CharacterFromID("pir_cap3")))
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap3"), "wr_gall_captain", "goto", "vane4A");
			}
			else
			{
				if(!LAi_IsDead(CharacterFromID("pir_cap4"))) ChangeCharacterAddressGroup(characterFromID("pir_cap4"), "wr_gall_captain", "goto", "vane4A");
			}

			if(!LAi_IsDead(CharacterFromID("pir_cap30")))
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap30"), "wr_gall_captain", "goto", "vane4D");
			}
			else
			{
				if(!LAi_IsDead(CharacterFromID("pir_cap26"))) ChangeCharacterAddressGroup(characterFromID("pir_cap26"), "wr_gall_captain", "goto", "vane4D");
			}

			LAi_SetHP(CharacterFromID("pir_cap7"), 80.0, 80.0);
			LAi_SetHP(CharacterFromID("pir_cap5"), 80.0, 80.0);
			LAi_SetHP(CharacterFromID("pir_cap14"), 80.0, 80.0);
			LAi_SetHP(CharacterFromID("pir_cap9"), 80.0, 80.0);
			LAi_SetHP(CharacterFromID("pir_cap4"), 80.0, 80.0);
			LAi_SetHP(CharacterFromID("pir_cap26"), 80.0, 80.0);
			LAi_SetHP(CharacterFromID("pir_cap3"), 80.0, 80.0);
			LAi_SetHP(CharacterFromID("pir_cap30"), 80.0, 80.0);

			LAi_SetStayType(characterFromID("wr_blm"));
			LAi_SetStayType(characterFromID("wr_ron"));
			LAi_SetStayType(characterFromID("wr_ltnorr"));
			LAi_SetStayType(characterFromID("wr_man4"));
			LAi_SetStayType(characterFromID("wr_cor1_3"));

			ChangeCharacterAddressGroup(characterFromID("wr_blm"), "wr_gall_captain", "goto", "stay4");
			ChangeCharacterAddressGroup(characterFromID("wr_ron"), "wr_gall_captain", "goto", "stay5");
			ChangeCharacterAddressGroup(characterFromID("wr_ltnorr"), "wr_gall_captain", "goto", "stay6");
			ChangeCharacterAddressGroup(characterFromID("wr_man4"), "wr_gall_captain", "goto", "stay7");
			ChangeCharacterAddressGroup(characterFromID("wr_cor1_3"), "wr_gall_captain", "goto", "stay9");

			LAi_SetHP(CharacterFromID("wr_blm"), 70.0, 70.0);
			LAi_SetHP(CharacterFromID("wr_man4"), 70.0, 70.0);
			LAi_SetHP(CharacterFromID("wr_cor1_3"), 70.0, 70.0);
			LAi_SetHP(CharacterFromID("wr_ron"), 70.0, 70.0);
			LAi_SetHP(CharacterFromID("wr_ltnorr"), 70.0, 70.0);
			LAi_SetHP(CharacterFromID("wr_fsh1"), 70.0, 70.0);
			LAi_SetHP(CharacterFromID("wr_will"), 70.0, 70.0);
			LAi_SetHP(CharacterFromID("wr_pir9"), 70.0, 70.0);

		//.....................................................................................

			LAi_SetImmortal(characterFromID("wr_fsh1"), false);
			LAi_SetImmortal(characterFromID("wr_blm"), false);
			LAi_SetImmortal(characterFromID("wr_ron"), false);
			LAi_SetImmortal(characterFromID("wr_ltnorr"), false);
			LAi_SetImmortal(characterFromID("wr_man4"), false);
			LAi_SetImmortal(characterFromID("wr_pir9"), false);
			LAi_SetImmortal(characterFromID("wr_will"), false);
			LAi_SetImmortal(characterFromID("wr_cor1_3"), false);

			LAi_SetActorType(characterFromID("wr_voy"));
			LAi_SetActorType(characterFromID("wr_cor4"));
			LAi_SetActorType(characterFromID("wr_bri"));
			LAi_SetActorType(characterFromID("wr_pir13"));

			LAi_group_MoveCharacter(characterFromID("wr_cor4"), "WR_GUARDS_6");
			LAi_group_MoveCharacter(characterFromID("wr_voy"), "WR_GUARDS_6");
			LAi_group_MoveCharacter(characterFromID("wr_bri"), "WR_GUARDS_6");
			LAi_group_MoveCharacter(characterFromID("wr_pir13"), "WR_GUARDS_6");

			LAi_group_MoveCharacter(characterFromID("wr_fsh1"), "WR_GUARDS_6");
			LAi_group_MoveCharacter(characterFromID("wr_blm"), "WR_GUARDS_6");
			LAi_group_MoveCharacter(characterFromID("wr_ron"), "WR_GUARDS_6");
			LAi_group_MoveCharacter(characterFromID("wr_ltnorr"), "WR_GUARDS_6");
			LAi_group_MoveCharacter(characterFromID("wr_man4"), "WR_GUARDS_6");
			LAi_group_MoveCharacter(characterFromID("wr_pir9"), "WR_GUARDS_6");
			LAi_group_MoveCharacter(characterFromID("wr_will"), "WR_GUARDS_6");
			LAi_group_MoveCharacter(characterFromID("wr_cor1_3"), "WR_GUARDS_6");

			LAi_NoRebirthEnable(characterFromID("wr_fsh1"));
			LAi_NoRebirthEnable(characterFromID("wr_blm"));
			LAi_NoRebirthEnable(characterFromID("wr_ron"));
			LAi_NoRebirthEnable(characterFromID("wr_ltnorr"));
			LAi_NoRebirthEnable(characterFromID("wr_man4"));
			LAi_NoRebirthEnable(characterFromID("wr_pir9"));
			LAi_NoRebirthEnable(characterFromID("wr_will"));
			LAi_NoRebirthEnable(characterFromID("wr_cor1_3"));

		//.....................................................................................

			LAi_SetImmortal(characterFromID("pir_cap8"), false);
			LAi_SetImmortal(characterFromID("pir_cap16"), false);
			LAi_SetImmortal(characterFromID("pir_cap18"), false);
			LAi_SetImmortal(characterFromID("pir_cap23"), false);
			LAi_SetImmortal(characterFromID("pir_cap7"), false);
			LAi_SetImmortal(characterFromID("pir_cap5"), false);
			LAi_SetImmortal(characterFromID("pir_cap14"), false);
			LAi_SetImmortal(characterFromID("pir_cap9"), false);
			LAi_SetImmortal(characterFromID("pir_cap4"), false);
			LAi_SetImmortal(characterFromID("pir_cap26"), false);
			LAi_SetImmortal(characterFromID("pir_cap3"), false);
			LAi_SetImmortal(characterFromID("pir_cap30"), false);

			LAi_group_MoveCharacter(characterFromID("Selkirk"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("Friday"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("pir_cap1"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("pir_cap8"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("pir_cap16"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("pir_cap18"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("pir_cap23"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("pir_cap7"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("pir_cap5"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("pir_cap14"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("pir_cap9"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("pir_cap4"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("pir_cap26"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("pir_cap3"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("pir_cap30"), LAI_GROUP_PLAYER);

			LAi_NoRebirthEnable(characterFromID("pir_cap8"));
			LAi_NoRebirthEnable(characterFromID("pir_cap16"));
			LAi_NoRebirthEnable(characterFromID("pir_cap18"));
			LAi_NoRebirthEnable(characterFromID("pir_cap23"));
			LAi_NoRebirthEnable(characterFromID("pir_cap7"));
			LAi_NoRebirthEnable(characterFromID("pir_cap5"));
			LAi_NoRebirthEnable(characterFromID("pir_cap14"));
			LAi_NoRebirthEnable(characterFromID("pir_cap9"));
			LAi_NoRebirthEnable(characterFromID("pir_cap4"));
			LAi_NoRebirthEnable(characterFromID("pir_cap26"));
			LAi_NoRebirthEnable(characterFromID("pir_cap3"));
			LAi_NoRebirthEnable(characterFromID("pir_cap30"));

		//.....................................................................................

			LAi_group_Register("WR_GUARDS_6");
			LAi_group_SetRelation(LAI_GROUP_PLAYER, "WR_GUARDS_6", LAI_GROUP_ENEMY);
			LAi_group_FightGroups(LAI_GROUP_PLAYER, "WR_GUARDS_6", true);

			Pchar.quest.cabin_fight5.win_condition.l1 = "NPC_Death";
			Pchar.quest.cabin_fight5.win_condition.l1.character = "wr_fsh1";
			Pchar.quest.cabin_fight5.win_condition.l2 = "NPC_Death";
			Pchar.quest.cabin_fight5.win_condition.l2.character = "wr_blm";
			Pchar.quest.cabin_fight5.win_condition.l3 = "NPC_Death";
			Pchar.quest.cabin_fight5.win_condition.l3.character = "wr_ron";
			Pchar.quest.cabin_fight5.win_condition.l4 = "NPC_Death";
			Pchar.quest.cabin_fight5.win_condition.l4.character = "wr_ltnorr";
			Pchar.quest.cabin_fight5.win_condition.l5 = "NPC_Death";
			Pchar.quest.cabin_fight5.win_condition.l5.character = "wr_man4";
			Pchar.quest.cabin_fight5.win_condition.l6 = "NPC_Death";
			Pchar.quest.cabin_fight5.win_condition.l6.character = "wr_pir9";
			Pchar.quest.cabin_fight5.win_condition.l7 = "NPC_Death";
			Pchar.quest.cabin_fight5.win_condition.l7.character = "wr_cor1_3";
			Pchar.quest.cabin_fight5.win_condition.l8 = "NPC_Death";
			Pchar.quest.cabin_fight5.win_condition.l8.character = "wr_will";
			Pchar.quest.cabin_fight5.win_condition = "cabin_fight5";
		break;

		case "cabin_fight5":
			LAi_SetActorType(characterFromID("wr_voy"));
			LAi_SetActorType(characterFromID("wr_cor4"));
			LAi_SetActorType(characterFromID("wr_bri"));
			LAi_SetActorType(characterFromID("wr_pir13"));

			LAi_ActorRunToLocator(characterFromID("wr_pir13"), "goto", "escape2", "", "");
			LAi_ActorRunToLocator(characterFromID("wr_cor4"), "goto", "escape1", "", "");
			LAi_ActorRunToLocator(characterFromID("wr_bri"), "goto", "escape2", "", "");
			LAi_ActorRunToLocator(characterFromID("wr_voy"), "goto", "escape1", "", "");

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "stay16");

			LAi_SetActorType(characterFromID("Selkirk"));
			LAi_SetActorType(characterFromID("pir_cap1"));
			LAi_SetActorType(characterFromID("Friday"));

			LAi_ActorAttack(CharacterFromID("Selkirk"), characterFromID("wr_voy"), "");
			LAi_ActorAttack(CharacterFromID("Friday"), characterFromID("wr_bri"), "");
			LAi_ActorAttack(CharacterFromID("pir_cap1"), characterFromID("wr_bri"), "");

			LAi_SetActorType(characterFromID("pir_cap16"));
			LAi_SetActorType(characterFromID("pir_cap8"));
			LAi_SetActorType(characterFromID("pir_cap5"));
			LAi_SetActorType(characterFromID("pir_cap7"));
			LAi_SetActorType(characterFromID("pir_cap3"));
			LAi_SetActorType(characterFromID("pir_cap4"));

			LAi_SetActorType(characterFromID("pir_cap23"));
			LAi_SetActorType(characterFromID("pir_cap18"));
			LAi_SetActorType(characterFromID("pir_cap14"));
			LAi_SetActorType(characterFromID("pir_cap9"));
			LAi_SetActorType(characterFromID("pir_cap30"));
			LAi_SetActorType(characterFromID("pir_cap26"));

			LAi_ActorAttack(CharacterFromID("pir_cap16"), characterFromID("wr_voy"), "");
			LAi_ActorAttack(CharacterFromID("pir_cap8"), characterFromID("wr_voy"), "");
			LAi_ActorAttack(CharacterFromID("pir_cap5"), characterFromID("wr_voy"), "");
			LAi_ActorAttack(CharacterFromID("pir_cap7"), characterFromID("wr_voy"), "");
			LAi_ActorAttack(CharacterFromID("pir_cap3"), characterFromID("wr_voy"), "");
			LAi_ActorAttack(CharacterFromID("pir_cap4"), characterFromID("wr_voy"), "");

			LAi_ActorAttack(CharacterFromID("pir_cap23"), characterFromID("wr_bri"), "");
			LAi_ActorAttack(CharacterFromID("pir_cap18"), characterFromID("wr_bri"), "");
			LAi_ActorAttack(CharacterFromID("pir_cap14"), characterFromID("wr_bri"), "");
			LAi_ActorAttack(CharacterFromID("pir_cap9"), characterFromID("wr_bri"), "");
			LAi_ActorAttack(CharacterFromID("pir_cap30"), characterFromID("wr_bri"), "");
			LAi_ActorAttack(CharacterFromID("pir_cap26"), characterFromID("wr_bri"), "");

			LAi_QuestDelay("cabin_escape1A", 3.0);
			LAi_QuestDelay("cabin_escape2A", 4.0);
			LAi_QuestDelay("cabin_escape3A", 4.5);
		break;
	//...............................................................................................................
		case "cabin_escape1A":
			LAi_SetSitType(characterFromID("wr_cor4"));
			ChangeCharacterAddressGroup(characterFromID("wr_cor4"), "wr_gall_captain", "goto", "escape1A");

			LAi_QuestDelay("cabin_escape1B", 1.0);
		break;

		case "cabin_escape1B":
			LAi_SetStayType(characterFromID("wr_cor4"));
			ChangeCharacterAddressGroup(characterFromID("wr_cor4"), "wr_gall_captain", "goto", "escape1B");

			LAi_QuestDelay("cabin_escape1C", 0.5);
		break;

		case "cabin_escape1C":
			ChangeCharacterAddressGroup(characterFromID("wr_cor4"), "none", "", "");
			PlaySound("PEOPLE\jump_water.wav");
		break;
	//...............................................................................................................
		case "cabin_escape2A":
			LAi_ActorTurnToLocator(Pchar, "sit", "sit1");
			LAi_SetSitType(characterFromID("wr_pir13"));
			ChangeCharacterAddressGroup(characterFromID("wr_pir13"), "wr_gall_captain", "goto", "escape2A");

			LAi_QuestDelay("cabin_escape2B", 1.0);
		break;

		case "cabin_escape2B":
			LAi_SetStayType(characterFromID("wr_pir13"));
			ChangeCharacterAddressGroup(characterFromID("wr_pir13"), "wr_gall_captain", "goto", "escape2B");

			LAi_QuestDelay("cabin_escape2C", 0.5);
		break;

		case "cabin_escape2C":
			ChangeCharacterAddressGroup(characterFromID("wr_pir13"), "none", "", "");
			PlaySound("PEOPLE\jump_water.wav");
		break;
	//...............................................................................................................
		case "cabin_escape3A":
			LAi_SetSitType(characterFromID("wr_voy"));
			ChangeCharacterAddressGroup(characterFromID("wr_voy"), "wr_gall_captain", "goto", "escape1A");

			LAi_SetSitType(characterFromID("wr_bri"));
			ChangeCharacterAddressGroup(characterFromID("wr_bri"), "wr_gall_captain", "goto", "escape2A");

			LAi_QuestDelay("cabin_escape3B", 1.0);
		break;

		case "cabin_escape3B":
			LAi_SetStayType(characterFromID("wr_voy"));
			ChangeCharacterAddressGroup(characterFromID("wr_voy"), "wr_gall_captain", "goto", "escape1C");

			LAi_SetStayType(characterFromID("wr_bri"));
			ChangeCharacterAddressGroup(characterFromID("wr_bri"), "wr_gall_captain", "goto", "escape2B");

			LAi_QuestDelay("cabin_escape3C", 0.5);
		break;

		case "cabin_escape3C":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "escape1C");	//was stay16

			LAi_SetActorType(characterFromID("wr_voy"));
			LAi_ActorTurnToCharacter(CharacterFromID("wr_voy"), Pchar);

			ChangeCharacterAddressGroup(characterFromID("wr_bri"), "none", "", "");
			PlaySound("PEOPLE\jump_water.wav");

			LAi_QuestDelay("cabin_escape3D", 1.0);
		break;

		case "cabin_escape3D":
			LAi_SetPlayerType(CharacterFromID("wr_voy"));
			LAi_SetFightMode(CharacterFromID("wr_voy"), true);

			LAi_QuestDelay("cabin_escape3E", 1.0);
		break;

		case "cabin_escape3E":
			PlaySound("OBJECTS\duel\pistol_medium.wav");
			GetCharacterPos(CharacterFromID("wr_voy"), &u, &v, &w);
			CreateParticleSystem("gunfire" , u, v+1.2, w-0.6, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("cabin_escape3F", 0.5);
		break;

		case "cabin_escape3F":
			PlaySound("OBJECTS\duel\bullet_miss1.wav");
			LAi_ApplyCharacterDamage(Pchar, 10);
			PlaySound("OBJECTS\VOICES\DEAD\male\dead0.wav");

			if(CheckAttribute(Pchar,"model"))
			{
				switch(Pchar.model)
				{
					case "Pira4M_HTUS_a":
						SetModel(Pchar, "Pira4M_TUS_a", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
					break;

					case "Pira4M_HTUS_b":
						SetModel(Pchar, "Pira4M_TUS_b", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
					break;

					case "Pira4M_HTUS":
						SetModel(Pchar, "Pira4M_TUS", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
					break;
				}
			}

			LAi_QuestDelay("cabin_escape3G", 0.5);
		break;

		case "cabin_escape3G":
			PlaySound("VOICE\ENGLISH\blaze_puh.wav");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("cabin_escape3H", 1.0);
		break;

		case "cabin_escape3H":
			ChangeCharacterAddressGroup(characterFromID("wr_voy"), "none", "", "");

			LAi_QuestDelay("cabin_escape3J", 0.5);
			LAi_QuestDelay("cabin_escape4", 1.0);
		break;

		case "cabin_escape3J":
			PlaySound("PEOPLE\jump_water.wav");
		break;
	//...............................................................................................................
		case "cabin_escape4":
			curExp = sti(Pchar.Experience);
			nextExp = CalculateExperienceFromRank(sti(Pchar.rank)+1);
			addExp = nextExp-curExp;
			AddCharacterExpNS(Pchar, addExp);
			int CAN = CalcCharacterSkill(Pchar, "Cannons");
			Pchar.skill.Cannons = CAN + 1;

			AddQuestRecord("Woodes_Rogers_crew", "6");
			CloseQuestHeader("Woodes_Rogers_crew");
			PlaySound("OBJECTS\SHIPCHARGE\hurrah.wav");
			LAi_SetStayType(Pchar);
			Pchar.quest.pistolthrow = "know_how";		//reset

			if(LAi_IsDead(CharacterFromID("pir_cap7"))) Pchar.quest.pc7_status = "dead";
			if(LAi_IsDead(CharacterFromID("pir_cap8"))) Pchar.quest.pc8_status = "dead";
			if(LAi_IsDead(CharacterFromID("pir_cap16"))) Pchar.quest.pc16_status = "dead";
			if(LAi_IsDead(CharacterFromID("pir_cap23"))) Pchar.quest.pc23_status = "dead";
			if(LAi_IsDead(CharacterFromID("pir_cap9"))) Pchar.quest.pc9_status = "dead";
			if(LAi_IsDead(CharacterFromID("pir_cap18"))) Pchar.quest.pc18_status = "dead";
			if(LAi_IsDead(CharacterFromID("pir_cap4"))) Pchar.quest.pc4_status = "dead";
			if(LAi_IsDead(CharacterFromID("pir_cap5"))) Pchar.quest.pc5_status = "dead";
			if(LAi_IsDead(CharacterFromID("pir_cap26"))) Pchar.quest.pc26_status = "dead";
			if(LAi_IsDead(CharacterFromID("pir_cap3"))) Pchar.quest.pc27_status = "dead";
			if(LAi_IsDead(CharacterFromID("pir_cap30"))) Pchar.quest.pc29_status = "dead";
			if(LAi_IsDead(CharacterFromID("pir_cap14"))) Pchar.quest.pc14_status = "dead";

			LAi_SetStayType(characterFromID("Selkirk"));
			LAi_SetStayType(characterFromID("pir_cap1"));
			LAi_SetStayType(characterFromID("Friday"));
			LAi_SetStayType(characterFromID("pir_cap16"));
			LAi_SetStayType(characterFromID("pir_cap8"));
			LAi_SetStayType(characterFromID("pir_cap5"));
			LAi_SetStayType(characterFromID("pir_cap7"));
			LAi_SetStayType(characterFromID("pir_cap3"));
			LAi_SetStayType(characterFromID("pir_cap4"));
			LAi_SetStayType(characterFromID("pir_cap23"));
			LAi_SetStayType(characterFromID("pir_cap18"));
			LAi_SetStayType(characterFromID("pir_cap14"));
			LAi_SetStayType(characterFromID("pir_cap9"));
			LAi_SetStayType(characterFromID("pir_cap30"));
			LAi_SetStayType(characterFromID("pir_cap26"));

			LAi_QuestDelay("galleon_sinking", 2.0);
		break;
	//...............................................................................................................
		case "galleon_sinking":
			PlaySound("INTERFACE\closet_open.wav");
			ChangeCharacterAddressGroup(characterFromID("guncrew_3"), "wr_gall_captain", "goto", "stay11");

			LAi_QuestDelay("galleon_sinking1", 1.0);
		break;

		case "galleon_sinking1":
			PlaySound("OBJECTS\SHIPCHARGE\_Abandon1.wav");

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload1");

			LAi_SetActorType(characterFromID("Selkirk"));
			LAi_SetActorType(characterFromID("pir_cap1"));
			LAi_SetActorType(characterFromID("Friday"));
			LAi_SetActorType(characterFromID("pir_cap16"));
			LAi_SetActorType(characterFromID("pir_cap8"));
			LAi_SetActorType(characterFromID("pir_cap5"));
			LAi_SetActorType(characterFromID("pir_cap7"));
			LAi_SetActorType(characterFromID("pir_cap3"));
			LAi_SetActorType(characterFromID("pir_cap4"));
			LAi_SetActorType(characterFromID("pir_cap23"));
			LAi_SetActorType(characterFromID("pir_cap18"));
			LAi_SetActorType(characterFromID("pir_cap14"));
			LAi_SetActorType(characterFromID("pir_cap9"));
			LAi_SetActorType(characterFromID("pir_cap30"));
			LAi_SetActorType(characterFromID("pir_cap26"));

			LAi_ActorTurnToLocator(characterFromID("Selkirk"), "reload", "reload1");
			LAi_ActorTurnToLocator(characterFromID("Friday"), "reload", "reload1");
			LAi_ActorTurnToLocator(characterFromID("pir_cap1"), "reload", "reload1");
			LAi_ActorTurnToLocator(characterFromID("pir_cap16"), "reload", "reload1");
			LAi_ActorTurnToLocator(characterFromID("pir_cap8"), "reload", "reload1");
			LAi_ActorTurnToLocator(characterFromID("pir_cap5"), "reload", "reload1");
			LAi_ActorTurnToLocator(characterFromID("pir_cap7"), "reload", "reload1");
			LAi_ActorTurnToLocator(characterFromID("pir_cap3"), "reload", "reload1");
			LAi_ActorTurnToLocator(characterFromID("pir_cap4"), "reload", "reload1");
			LAi_ActorTurnToLocator(characterFromID("pir_cap23"), "reload", "reload1");
			LAi_ActorTurnToLocator(characterFromID("pir_cap18"), "reload", "reload1");
			LAi_ActorTurnToLocator(characterFromID("pir_cap14"), "reload", "reload1");
			LAi_ActorTurnToLocator(characterFromID("pir_cap9"), "reload", "reload1");
			LAi_ActorTurnToLocator(characterFromID("pir_cap30"), "reload", "reload1");
			LAi_ActorTurnToLocator(characterFromID("pir_cap26"), "reload", "reload1");

			LAi_QuestDelay("galleon_sinking2", 1.0);
			LAi_QuestDelay("galleon_sinking3", 1.5);
			LAi_QuestDelay("galleon_sinking4", 2.0);
		break;

		case "galleon_sinking2":
			AddQuestRecord("Revenge", "4");

			PlaySound("VOICE\ENGLISH\pir_capR5.wav");

			LAi_ActorRunToLocator(characterFromID("pir_cap16"), "reload", "reload1", "", "");
			LAi_ActorRunToLocator(characterFromID("pir_cap23"), "reload", "reload1", "", "");
			LAi_ActorRunToLocator(characterFromID("pir_cap3"), "reload", "reload1", "", "");
			LAi_ActorRunToLocator(characterFromID("pir_cap4"), "reload", "reload1", "", "");
			LAi_ActorRunToLocator(characterFromID("pir_cap30"), "reload", "reload1", "", "");
			LAi_ActorRunToLocator(characterFromID("pir_cap26"), "reload", "reload1", "", "");

			LAi_QuestDelay("galleon_sinking2A", 3.0);
		break;

		case "galleon_sinking2A":
			if(CheckAttribute(Pchar, "quest.pc16_status") && Pchar.quest.pc16_status == "dead")
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap16"), "none", "", "");
			}
			else
			{
				LAi_SetStayType(characterFromID("pir_cap16"));
				ChangeCharacterAddressGroup(characterFromID("pir_cap16"), "wr_ships", "goto", "look1");
			}

			if(CheckAttribute(Pchar, "quest.pc27_status") && Pchar.quest.pc27_status == "dead")
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap3"), "none", "", "");
			}
			else
			{
				LAi_SetStayType(characterFromID("pir_cap3"));
				ChangeCharacterAddressGroup(characterFromID("pir_cap3"), "wr_ships", "goto", "look2");
			}

			if(CheckAttribute(Pchar, "quest.pc23_status") && Pchar.quest.pc23_status == "dead")
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap23"), "none", "", "");
			}
			else
			{
				LAi_SetStayType(characterFromID("pir_cap23"));
				ChangeCharacterAddressGroup(characterFromID("pir_cap23"), "wr_ships", "goto", "look3");
			}

			if(CheckAttribute(Pchar, "quest.pc4_status") && Pchar.quest.pc4_status == "dead")
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap4"), "none", "", "");
			}
			else
			{
				LAi_SetStayType(characterFromID("pir_cap4"));
				ChangeCharacterAddressGroup(characterFromID("pir_cap4"), "wr_ships", "goto", "look10");
			}

			if(CheckAttribute(Pchar, "quest.pc29_status") && Pchar.quest.pc29_status == "dead")
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap30"), "none", "", "");
			}
			else
			{
				LAi_SetStayType(characterFromID("pir_cap30"));
				ChangeCharacterAddressGroup(characterFromID("pir_cap30"), "wr_ships", "goto", "look7");
			}

			if(CheckAttribute(Pchar, "quest.pc26_status") && Pchar.quest.pc26_status == "dead")
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap26"), "none", "", "");
			}
			else
			{
				LAi_SetStayType(characterFromID("pir_cap26"));
				ChangeCharacterAddressGroup(characterFromID("pir_cap26"), "wr_ships", "goto", "look8");
			}
		break;

		case "galleon_sinking3":
			LAi_ActorRunToLocator(characterFromID("pir_cap7"), "reload", "reload1", "", "");
			LAi_ActorRunToLocator(characterFromID("pir_cap5"), "reload", "reload1", "", "");
			LAi_ActorRunToLocator(characterFromID("pir_cap8"), "reload", "reload1", "", "");
			LAi_ActorRunToLocator(characterFromID("pir_cap14"), "reload", "reload1", "", "");
			LAi_ActorRunToLocator(characterFromID("pir_cap9"), "reload", "reload1", "", "");
			LAi_ActorRunToLocator(characterFromID("pir_cap18"), "reload", "reload1", "", "");

			LAi_QuestDelay("galleon_sinking3A", 3.0);
		break;

		case "galleon_sinking3A":
			if(CheckAttribute(Pchar, "quest.pc8_status") && Pchar.quest.pc8_status == "dead")
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap8"), "none", "", "");
			}
			else
			{
				LAi_SetStayType(characterFromID("pir_cap8"));
				ChangeCharacterAddressGroup(characterFromID("pir_cap8"), "wr_ships", "goto", "look11");
			}

			if(CheckAttribute(Pchar, "quest.pc5_status") && Pchar.quest.pc5_status == "dead")
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap5"), "none", "", "");
			}
			else
			{
				LAi_SetStayType(characterFromID("pir_cap5"));
				ChangeCharacterAddressGroup(characterFromID("pir_cap5"), "wr_ships", "goto", "look12");
			}

			if(CheckAttribute(Pchar, "quest.pc7_status") && Pchar.quest.pc7_status == "dead")
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap7"), "none", "", "");
			}
			else
			{
				LAi_SetStayType(characterFromID("pir_cap7"));
				ChangeCharacterAddressGroup(characterFromID("pir_cap7"), "wr_ships", "goto", "look13");
			}

			if(CheckAttribute(Pchar, "quest.pc18_status") && Pchar.quest.pc18_status == "dead")
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap18"), "none", "", "");
			}
			else
			{
				LAi_SetStayType(characterFromID("pir_cap18"));
				ChangeCharacterAddressGroup(characterFromID("pir_cap18"), "wr_ships", "goto", "look14");
			}

			if(CheckAttribute(Pchar, "quest.pc14_status") && Pchar.quest.pc14_status == "dead")
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap14"), "none", "", "");
			}
			else
			{
				LAi_SetStayType(characterFromID("pir_cap14"));
				ChangeCharacterAddressGroup(characterFromID("pir_cap14"), "wr_ships", "goto", "look15");
			}

			if(CheckAttribute(Pchar, "quest.pc9_status") && Pchar.quest.pc9_status == "dead")
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap9"), "none", "", "");
			}
			else
			{
				LAi_SetStayType(characterFromID("pir_cap9"));
				ChangeCharacterAddressGroup(characterFromID("pir_cap9"), "wr_ships", "goto", "look16");
			}
		break;

		case "galleon_sinking4":
			LAi_ActorRunToLocator(characterFromID("Friday"), "goto", "friday_report", "", "");
			LAi_ActorRunToLocator(characterFromID("Selkirk"), "reload", "reload1", "", "");
			LAi_ActorRunToLocator(characterFromID("pir_cap1"), "reload", "reload1", "", "");

			LAi_QuestDelay("galleon_sinking4A", 3.0);
		break;

		case "galleon_sinking4A":
			LAi_SetPlayerType(Pchar);

			LAi_SetStayType(characterFromID("pir_cap1"));
			LAi_SetStayType(characterFromID("Selkirk"));
			LAi_SetStayType(characterFromID("Friday"));

			ChangeCharacterAddressGroup(characterFromID("pir_cap1"), "wr_ships", "goto", "look5");
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "wr_ships", "goto", "look9");
			ChangeCharacterAddressGroup(characterFromID("Friday"), "wr_ships", "goto", "look6");

			Locations[FindLocation("wr_gall_cap_outer")].reload.l3.emerge = "jump1";
			ChangeCharacterAddressGroup(characterFromID("guncrew_1"), "wr_ships", "goto", "gunner");
			ChangeCharacterAddressGroup(characterFromID("guncrew_2"), "wr_gall_cap_outer", "goto", "vane1");
			ChangeCharacterAddressGroup(characterFromID("guncrew_4"), "wr_gall_cap_outer", "goto", "gunner");

			pchar.quest.galleon_sinking5.win_condition.l1 = "location";
			pchar.quest.galleon_sinking5.win_condition.l1.location = "wr_gall_cap_outer";
			pchar.quest.galleon_sinking5.win_condition = "galleon_sinking5";
		break;

		case "galleon_sinking5":
			PlaySound("OBJECTS\SHIPCHARGE\_Abandon2.wav");

			pchar.quest.galleon_sinking6.win_condition.l1 = "locator";
			pchar.quest.galleon_sinking6.win_condition.l1.location = "wr_gall_cap_outer";
			pchar.quest.galleon_sinking6.win_condition.l1.locator_group = "goto";
			pchar.quest.galleon_sinking6.win_condition.l1.locator = "gunner";
			pchar.quest.galleon_sinking6.win_condition = "galleon_sinking6";
		break;

		case "galleon_sinking6":
			PlaySound("OBJECTS\SHIPCHARGE\_Abandon3.wav");

			SetModel(characterFromID("pir_cap1"), "pir_cap1_redC_MD", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap8"), "pir_cap8_red_MD", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap16"), "pir_cap16_red_MD", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap18"), "pir_cap18_red_MD", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap23"), "pir_cap23_red_MD", "man", "man", 1.8, false);

			SetModel(characterFromID("pir_cap2"), "Animists1_MD2", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap3"), "Animists1_MD2", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap4"), "Animists1_M_black", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap5"), "Animists1_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap7"), "Animists1_MD1", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap9"), "Animists1_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap14"), "Animists1_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap15"), "Animists1_MD1", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap20"), "Animists1_MD1", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap22"), "Animists1_MD2", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap26"), "Animists1_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap3"), "Animists1_MD2", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap28"), "Animists1_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap30"), "Animists1_MD1", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap30"), "Animists1_M", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap31"), "Animists1_MD2", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap32"), "Animists1_MD1", "man", "man", 1.8, false);

			pchar.quest.galleon_sinking7.win_condition.l1 = "location";
			pchar.quest.galleon_sinking7.win_condition.l1.location = "wr_ships";
			pchar.quest.galleon_sinking7.win_condition = "galleon_sinking7";
		break;

		case "galleon_sinking7":
			PlaySound("OBJECTS\SHIPCHARGE\_Abandon0.wav");

			pchar.quest.goodbye_Vane_Moody.win_condition.l1 = "locator";
			pchar.quest.goodbye_Vane_Moody.win_condition.l1.location = "wr_corvette";
			pchar.quest.goodbye_Vane_Moody.win_condition.l1.locator_group = "goto";
			pchar.quest.goodbye_Vane_Moody.win_condition.l1.locator = "look7";
			pchar.quest.goodbye_Vane_Moody.win_condition = "goodbye_Vane_Moody";
		break;

		case "abandon_galleon":
			LAi_SetPlayerType(Pchar);
		break;

		case "abandon_galleon1":
			LAi_ApplyCharacterDamage(Pchar, 10);
			PlaySound("PEOPLE\Jump.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorSetLayMode(Pchar);

			LAi_QuestDelay("abandon_galleon2", 2.0);
		break;

		case "abandon_galleon2":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead7.wav");
			LAi_SetPoorType(Pchar);

			LAi_QuestDelay("abandon_galleon3", 1.0);
		break;

		case "abandon_galleon3":
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("guncrew4_jump", 1.0);
			LAi_QuestDelay("guncrew1_jump", 2.0);
			LAi_QuestDelay("guncrew2_jump", 2.5);
			LAi_QuestDelay("guncrew3_jump1", 4.5);		//was 6.0
			LAi_QuestDelay("guncrew3_jump2", 7.5);
		break;
	//--------------------------------------------------------------------------------
		case "guncrew4_jump":
			LAi_SetSitType(characterFromID("guncrew_4"));
			ChangeCharacterAddressGroup(characterFromID("guncrew_4"), "wr_ships", "goto", "jump6");

			LAi_QuestDelay("guncrew4_jump1", 1.0);
		break;

		case "guncrew4_jump1":
			PlaySound("PEOPLE\Jump.wav");
			LAi_SetActorType(characterFromID("guncrew_4"));
			LAi_ActorSetLayMode(characterFromID("guncrew_4"));

			LAi_QuestDelay("guncrew4_jump2", 2.0);
		break;

		case "guncrew4_jump2":
			LAi_SetPoorType(characterFromID("guncrew_4"));

			LAi_QuestDelay("guncrew4_jump3", 1.0);
		break;

		case "guncrew4_jump3":
			LAi_SetStayType(characterFromID("guncrew_4"));

			LAi_QuestDelay("guncrew4_jump4", 0.5);
		break;

		case "guncrew4_jump4":
			LAi_SetActorType(characterFromID("guncrew_4"));
			LAi_ActorTurnToCharacter(CharacterFromID("guncrew_4"), Pchar);

			LAi_QuestDelay("guncrew4_jump5", 1.0);
		break;

		case "guncrew4_jump5":
			LAi_SetStayType(characterFromID("guncrew_4"));
			ChangeCharacterAddressGroup(characterFromID("guncrew_4"), "wr_ships", "goto", "turn6");
		break;
	//--------------------------------------------------------------------------------
		case "guncrew1_jump":
			LAi_SetSitType(characterFromID("guncrew_1"));
			ChangeCharacterAddressGroup(characterFromID("guncrew_1"), "wr_ships", "goto", "jump5");

			LAi_QuestDelay("guncrew1_jump1", 1.0);
		break;

		case "guncrew1_jump1":
			PlaySound("PEOPLE\Jump.wav");
			LAi_SetActorType(characterFromID("guncrew_1"));
			LAi_ActorSetLayMode(characterFromID("guncrew_1"));

			LAi_QuestDelay("guncrew1_jump2", 2.0);
		break;

		case "guncrew1_jump2":
			LAi_SetPoorType(characterFromID("guncrew_1"));

			LAi_QuestDelay("guncrew1_jump3", 1.0);
		break;

		case "guncrew1_jump3":
			LAi_SetStayType(characterFromID("guncrew_1"));

			LAi_QuestDelay("guncrew1_jump4", 0.5);
		break;

		case "guncrew1_jump4":
			LAi_SetActorType(characterFromID("guncrew_1"));
			LAi_ActorTurnToCharacter(CharacterFromID("guncrew_1"), Pchar);

			LAi_QuestDelay("guncrew1_jump5", 1.0);
		break;

		case "guncrew1_jump5":
			LAi_SetStayType(characterFromID("guncrew_1"));
		break;
	//--------------------------------------------------------------------------------
		case "guncrew2_jump":
			LAi_SetSitType(characterFromID("guncrew_2"));
			ChangeCharacterAddressGroup(characterFromID("guncrew_2"), "wr_ships", "goto", "jump7");

			LAi_QuestDelay("guncrew2_jump1", 1.0);
		break;

		case "guncrew2_jump1":
			PlaySound("PEOPLE\Jump.wav");
			LAi_SetActorType(characterFromID("guncrew_2"));
			LAi_ActorSetLayMode(characterFromID("guncrew_2"));

			LAi_QuestDelay("guncrew2_jump2", 2.0);
		break;

		case "guncrew2_jump2":
			LAi_SetPoorType(characterFromID("guncrew_2"));

			LAi_QuestDelay("guncrew2_jump3", 1.0);
		break;

		case "guncrew2_jump3":
			LAi_SetStayType(characterFromID("guncrew_2"));

			LAi_QuestDelay("guncrew2_jump4", 0.5);
		break;

		case "guncrew2_jump4":
			LAi_SetActorType(characterFromID("guncrew_2"));
			LAi_ActorTurnToCharacter(CharacterFromID("guncrew_2"), Pchar);

			LAi_QuestDelay("guncrew2_jump5", 1.0);
		break;

		case "guncrew2_jump5":
			LAi_SetStayType(characterFromID("guncrew_2"));
			ChangeCharacterAddressGroup(characterFromID("guncrew_2"), "wr_ships", "goto", "turn7");
		break;
	//--------------------------------------------------------------------------------
		case "guncrew3_jump1":
			RemoveCharacterEquip(characterFromID("guncrew_3"), BLADE_ITEM_TYPE );
			TakeItemFromCharacter(characterFromID("guncrew_3"), "bladeboom");
			PlaySound("PEOPLE\jump_water.wav");
		break;

		case "guncrew3_jump2":
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "jump1");

			LAi_QuestDelay("guncrew3_jump3", 2.0);
		break;

		case "guncrew3_jump3":
			PlaySound("INTERFACE\running_water_short.wav");
			ChangeCharacterAddressGroup(characterFromID("guncrew_3"), "wr_ships", "goto", "overboard1");

			LAi_QuestDelay("guncrew3_jump4", 1.0);
		break;

		case "guncrew3_jump4":
			PlaySound("INTERFACE\anchor_up.wav");
			ChangeCharacterAddressGroup(characterFromID("guncrew_3"), "wr_ships", "goto", "overboard2");

			LAi_QuestDelay("guncrew3_jump5", 1.0);
		break;

		case "guncrew3_jump5":
			PlaySound("OBJECTS\DUEL\man_attack1.wav");
			ChangeCharacterAddressGroup(characterFromID("guncrew_3"), "wr_ships", "goto", "overboard3");

			LAi_QuestDelay("guncrew3_jump6", 0.5);
		break;

		case "guncrew3_jump6":
			PlaySound("PEOPLE\Jump_Stone.wav");
			ChangeCharacterAddressGroup(characterFromID("guncrew_3"), "wr_ships", "goto", "overboard4");
			GiveItem2Character(characterFromID("guncrew_3"), "bladeboom");
			EquipCharacterbyItem(characterFromID("guncrew_3"), "bladeboom");

			LAi_QuestDelay("guncrew3_jump7", 0.5);
		break;

		case "guncrew3_jump7":
			PlaySound("VOICE\ENGLISH\pir_capR4.wav");
			LAi_SetActorType(characterFromID("pir_cap1"));
			LAi_ActorTurnToCharacter(CharacterFromID("pir_cap1"), CharacterFromID("guncrew_3"));

			LAi_SetActorType(characterFromID("guncrew_3"));
			LAi_ActorTurnToCharacter(CharacterFromID("guncrew_3"), Pchar);

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("pir_cap1"));

			LAi_QuestDelay("guncrew3_jump8", 1.0);
		break;

		case "guncrew3_jump8":
			LAi_SetStayType(characterFromID("guncrew_3"));
			LAi_SetStayType(characterFromID("pir_cap1"));

			LAi_QuestDelay("galleon_sinking9", 1.0);
		break;
	//--------------------------------------------------------------------------------
		case "galleon_sinking9":
			LAi_SetActorType(characterFromID("pir_cap1"));
			LAi_ActorTurnToLocator(CharacterFromID("pir_cap1"), "goto", "look6");

			LAi_QuestDelay("galleon_sinking10", 1.0);
		break;

		case "galleon_sinking10":
			LAi_SetActorType(characterFromID("guncrew_1"));
			LAi_ActorRunToLocator(characterFromID("guncrew_1"), "box", "box3", "galleon_sinking10A", 2.0);

			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "galleon_cut_loose";
		break;

		case "galleon_sinking10A":
			PlaySound("INTERFACE\bell_broken.wav");
			LAi_SetStayType(characterFromID("guncrew_1"));
			ChangeCharacterAddressGroup(characterFromID("guncrew_1"), "wr_ships", "box", "box3");
		break;

		case "galleon_sinking11":
			LAi_SetStayType(CharacterFromID("pir_cap1"));
			ChangeCharacterAddressGroup(characterFromID("guncrew_3"), "wr_ships", "goto", "turn4");
			LAi_SetPlayerType(CharacterFromID("guncrew_3"));
			LAi_SetFightMode(CharacterFromID("guncrew_3"), true);

			LAi_SetStayType(characterFromID("pir_cap3"));
			LAi_SetStayType(characterFromID("pir_cap30"));

			LAi_SetPlayerType(CharacterFromID("pir_cap16"));
			LAi_SetPlayerType(CharacterFromID("pir_cap3"));
			LAi_SetPlayerType(CharacterFromID("pir_cap23"));
			LAi_SetPlayerType(CharacterFromID("pir_cap4"));
			LAi_SetPlayerType(CharacterFromID("pir_cap30"));
			LAi_SetPlayerType(CharacterFromID("pir_cap26"));
			LAi_SetPlayerType(CharacterFromID("pir_cap8"));
			LAi_SetPlayerType(CharacterFromID("pir_cap5"));
			LAi_SetPlayerType(CharacterFromID("pir_cap7"));
			LAi_SetPlayerType(CharacterFromID("pir_cap18"));
			LAi_SetPlayerType(CharacterFromID("pir_cap14"));
			LAi_SetPlayerType(CharacterFromID("pir_cap9"));
			LAi_SetPlayerType(CharacterFromID("Selkirk"));
			LAi_SetPlayerType(CharacterFromID("Friday"));

			LAi_SetFightMode(CharacterFromID("pir_cap16"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap3"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap23"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap4"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap30"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap26"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap8"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap5"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap7"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap18"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap14"), true);
			LAi_SetFightMode(CharacterFromID("pir_cap9"), true);
			LAi_SetFightMode(CharacterFromID("Selkirk"), true);
			LAi_SetFightMode(CharacterFromID("Friday"), true);

			LAi_QuestDelay("galleon_sinking12A", 1.0);
			LAi_QuestDelay("galleon_sinking12B", 2.0);
			LAi_QuestDelay("galleon_sinking12C", 2.5);
			LAi_QuestDelay("galleon_sinking12D", 3.0);
			LAi_QuestDelay("galleon_sinking12E", 3.5);
			LAi_QuestDelay("galleon_sinking12F", 3.5);
		break;

		case "galleon_sinking12A":
			PlaySound("AMBIENT\SHIPYARD\axe.wav");
		break;

		case "galleon_sinking12B":
			PlaySound("PEOPLE\axe_saw.wav");
		break;

		case "galleon_sinking12C":
			PlaySound("PEOPLE\chopchop.wav");
		break;

		case "galleon_sinking12D":
			PlaySound("PEOPLE\axe_saw.wav");
		break;

		case "galleon_sinking12E":
			PlaySound("PEOPLE\pickaxe_box.wav");
		break;

		case "galleon_sinking12F":
			PlaySound("PEOPLE\hammer_creak.wav");
			PlaySound("OBJECTS\SHIPCHARGE\mast_fall2.wav");

			LAi_QuestDelay("galleon_sinking13", 3.0);
		break;

		case "galleon_sinking13":
			PlaySound("OBJECTS\SHIPCHARGE\ship_sink.wav");

			LAi_QuestDelay("galleon_sinking14", 3.0);
		break;

		case "galleon_sinking14":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead1.wav");
			PlaySound("OBJECTS\VOICES\DEAD\male\dead1.wav");

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "jump1");

			if(CheckAttribute(Pchar,"quest.anchor") && Pchar.quest.anchor == "down")
			{
				Locations[FindLocation("wr_corvette")].models.always.l5 = "anchor0";		//down
				Locations[FindLocation("wr_corvette")].models.always.l6 = "elevator&ropes_C2";	//air
				Locations[FindLocation("wr_corvette")].locators_radius.reload.reload7 = 1.0;
				Locations[FindLocation("wr_corvette")].locators_radius.box.box8 = 0.0001;
				Locations[FindLocation("wr_corvette")].locators_radius.box.box9 = 0.5;
			}

			if(CheckAttribute(Pchar,"quest.anchor") && Pchar.quest.anchor == "up")
			{
				Locations[FindLocation("wr_corvette")].models.always.l5 = "anchor_small1";
				Locations[FindLocation("wr_corvette")].models.always.l6 = "elevator&ropes_C1";	//deck
				Locations[FindLocation("wr_corvette")].locators_radius.reload.reload7 = 0.0001;
				Locations[FindLocation("wr_corvette")].locators_radius.box.box8 = 0.5;
				Locations[FindLocation("wr_corvette")].locators_radius.box.box9 = 0.0001;
			}

			Locations[FindLocation("wr_port")].models.always.locators = "QCport_l_JRH2";

			SetCharacterShipLocation(characterFromID("wr_dead1"), "wr_corvette");	//broken_mast
			SetCharacterShipLocation(characterFromID("wr_dead2"), "wr_corvette");	//barrel3_roll
			SetCharacterShipLocation(characterFromID("wr_dead3"), "wr_corvette");	//boat2_down
			SetCharacterShipLocation(characterFromID("wr_dead4"), "wr_corvette");	//hatch12
			SetCharacterShipLocation(characterFromID("wr_dead5"), "wr_corvette");	//barrel3_roll
			SetCharacterShipLocation(characterFromID("wr_dead6"), "wr_corvette");	//ladder
			SetCharacterShipLocation(characterFromID("wr_dead7"), "wr_corvette");	//broken_mast
			SetCharacterShipLocation(characterFromID("wr_dead8"), "wr_corvette");	//hatch12
			SetCharacterShipLocation(characterFromID("wr_dead9"), "wr_corvette");	//barrel3
			SetCharacterShipLocation(characterFromID("wr_dead10"), "wr_corvette");	//hatch12
			SetCharacterShipLocation(characterFromID("wr_dead11"), "wr_corvette");	//barrel3_down
			SetCharacterShipLocation(characterFromID("wr_dead12"), "wr_corvette");	//boat2

			Characters[GetCharacterIndex("CoastBrother25")].Ship.Type = "obj_Boat3"; 		//was galeon1 earlier
			Characters[GetCharacterIndex("Coastbrother26")].nation = PIRATE;		//corvette
			SetCharacterShipLocation(characterFromID("Coastbrother27"), "wr_port");		//boat2 at wr_port

			LAi_QuestDelay("galleon_sinking20", 2.0);
		break;

		case "galleon_sinking20":
			PostVideoAndQuest("Undersea",1, "galleon_sinking21");
		break;

		case "galleon_sinking21":
			SetCurrentTime(7.00, 0);
			SetNextWeather("Clear");

			Locations[FindLocation("wr_corvette")].type = "silent_seashore";	//fixed in JRH_locations

			DoQuestReloadToLocation("wr_corvette", "goto", "jump4" ,"galleon_sinking22");
		break;
	//===========================================================================================================
		case "galleon_sinking22":
			CreateParticleSystemX("ball_splash", -14.0, 1.3, -6.6, 0.0, 0.0, 0.0, 0);	//mast ok

			CreateParticleSystemX("ball_splash", -14.0, 1.3, -8.6, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", -14.0, 1.3, -4.6, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", -14.0, 1.3, -10.6, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", -14.0, 1.3, -2.6, 0.0, 0.0, 0.0, 0);

			PlaySound("OBJECTS\SHIPCHARGE\ship_sink_short.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_corvette", "goto", "turn3");

			ChangeCharacterAddressGroup(characterFromID("pir_cap1"), "wr_corvette", "goto", "look5");
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "wr_corvette", "goto", "selkirk_exit");
			ChangeCharacterAddressGroup(characterFromID("Friday"), "wr_corvette", "goto", "friday_exit");
			SetModel(characterFromID("Selkirk"), "rabwhite1", "man", "man", 1.8, false);
			SetModel(characterFromID("Friday"), "rabblack_1", "man", "man", 1.8, false);

			LAi_SetStayType(characterFromID("guncrew_1"));
			LAi_SetStayType(characterFromID("guncrew_2"));
			LAi_SetStayType(characterFromID("guncrew_3"));
			LAi_SetStayType(characterFromID("guncrew_4"));
			ChangeCharacterAddressGroup(characterFromID("guncrew_1"), "wr_corvette", "goto", "gc1_exit");
			ChangeCharacterAddressGroup(characterFromID("guncrew_2"), "wr_corvette", "goto", "gc2_exit");
			ChangeCharacterAddressGroup(characterFromID("guncrew_3"), "wr_corvette", "goto", "gc3_exit");
			ChangeCharacterAddressGroup(characterFromID("guncrew_4"), "wr_corvette", "goto", "gc4_exit");


			if(CheckAttribute(Pchar, "quest.pc16_status") && Pchar.quest.pc16_status == "dead")
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap16"), "none", "", "");
			}
			else
			{
				LAi_SetStayType(characterFromID("pir_cap16"));
				ChangeCharacterAddressGroup(characterFromID("pir_cap16"), "wr_corvette", "goto", "look1");
			}

			if(CheckAttribute(Pchar, "quest.pc27_status") && Pchar.quest.pc27_status == "dead")
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap3"), "none", "", "");
			}
			else
			{
				LAi_SetStayType(characterFromID("pir_cap3"));
				ChangeCharacterAddressGroup(characterFromID("pir_cap3"), "wr_corvette", "goto", "look2");
			}

			if(CheckAttribute(Pchar, "quest.pc23_status") && Pchar.quest.pc23_status == "dead")
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap23"), "none", "", "");
			}
			else
			{
				LAi_SetStayType(characterFromID("pir_cap23"));
				ChangeCharacterAddressGroup(characterFromID("pir_cap23"), "wr_corvette", "goto", "look3");
			}

			if(CheckAttribute(Pchar, "quest.pc4_status") && Pchar.quest.pc4_status == "dead")
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap4"), "none", "", "");
			}
			else
			{
				LAi_SetStayType(characterFromID("pir_cap4"));
				ChangeCharacterAddressGroup(characterFromID("pir_cap4"), "wr_corvette", "goto", "look10");
			}

			if(CheckAttribute(Pchar, "quest.pc29_status") && Pchar.quest.pc29_status == "dead")
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap30"), "none", "", "");
			}
			else
			{
				LAi_SetStayType(characterFromID("pir_cap30"));
				ChangeCharacterAddressGroup(characterFromID("pir_cap30"), "wr_corvette", "goto", "look7");
			}

			if(CheckAttribute(Pchar, "quest.pc26_status") && Pchar.quest.pc26_status == "dead")
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap26"), "none", "", "");
			}
			else
			{
				LAi_SetStayType(characterFromID("pir_cap26"));
				ChangeCharacterAddressGroup(characterFromID("pir_cap26"), "wr_corvette", "goto", "look8");
			}

			if(CheckAttribute(Pchar, "quest.pc8_status") && Pchar.quest.pc8_status == "dead")
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap8"), "none", "", "");
			}
			else
			{
				LAi_SetStayType(characterFromID("pir_cap8"));
				ChangeCharacterAddressGroup(characterFromID("pir_cap8"), "wr_corvette", "goto", "look11");
			}

			if(CheckAttribute(Pchar, "quest.pc5_status") && Pchar.quest.pc5_status == "dead")
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap5"), "none", "", "");
			}
			else
			{
				LAi_SetStayType(characterFromID("pir_cap5"));
				ChangeCharacterAddressGroup(characterFromID("pir_cap5"), "wr_corvette", "goto", "look12");
			}

			if(CheckAttribute(Pchar, "quest.pc7_status") && Pchar.quest.pc7_status == "dead")
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap7"), "none", "", "");
			}
			else
			{
				LAi_SetStayType(characterFromID("pir_cap7"));
				ChangeCharacterAddressGroup(characterFromID("pir_cap7"), "wr_corvette", "goto", "look13");
			}

			if(CheckAttribute(Pchar, "quest.pc18_status") && Pchar.quest.pc18_status == "dead")
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap18"), "none", "", "");
			}
			else
			{
				LAi_SetStayType(characterFromID("pir_cap18"));
				ChangeCharacterAddressGroup(characterFromID("pir_cap18"), "wr_corvette", "goto", "look14");
			}

			if(CheckAttribute(Pchar, "quest.pc14_status") && Pchar.quest.pc14_status == "dead")
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap14"), "none", "", "");
			}
			else
			{
				LAi_SetStayType(characterFromID("pir_cap14"));
				ChangeCharacterAddressGroup(characterFromID("pir_cap14"), "wr_corvette", "goto", "look15");
			}

			if(CheckAttribute(Pchar, "quest.pc9_status") && Pchar.quest.pc9_status == "dead")
			{
				ChangeCharacterAddressGroup(characterFromID("pir_cap9"), "none", "", "");
			}
			else
			{
				LAi_SetStayType(characterFromID("pir_cap9"));
				ChangeCharacterAddressGroup(characterFromID("pir_cap9"), "wr_corvette", "goto", "look16");
			}

			SetModel(characterFromID("pir_cap16"), "pir_cap16", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap3"), "pir_cap3", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap23"), "pir_cap23", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap4"), "pir_cap4", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap30"), "pir_cap30", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap26"), "pir_cap26", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap8"), "pir_cap8", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap5"), "pir_cap5", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap7"), "pir_cap7", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap18"), "pir_cap18", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap14"), "pir_cap14", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap9"), "pir_cap9", "man", "man", 1.8, false);

			Locations[FindLocation("wr_corv_deck1")].reload.l5.go = "wr_corvette";
			Locations[FindLocation("wr_corv_crew")].reload.l3.go = "wr_corvette";
			Locations[FindLocation("wr_corv_capmd")].reload.l1.go = "wr_corvette";

			Locations[FindLocation("wr_port")].reload.l1.go = "wr_corvette";

			LAi_QuestDelay("galleon_sinking22A", 0.75);
			LAi_QuestDelay("galleon_sinking23", 6.0);	//was 8
		break;

		case "galleon_sinking22A":
			CreateParticleSystemX("ball_splash", -14.0, 1.3, -6.6, 0.0, 0.0, 0.0, 0);

			CreateParticleSystemX("ball_splash", -14.0, 1.3, -8.6, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", -14.0, 1.3, -4.6, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", -14.0, 1.3, -10.6, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", -14.0, 1.3, -2.6, 0.0, 0.0, 0.0, 0);

			LAi_QuestDelay("galleon_sinking22B", 0.75);
		break;

		case "galleon_sinking22B":
			CreateParticleSystemX("ball_splash", -14.0, 1.3, -6.6, 0.0, 0.0, 0.0, 0);

			CreateParticleSystemX("ball_splash", -14.0, 1.3, -8.6, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", -14.0, 1.3, -4.6, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", -14.0, 1.3, -10.6, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", -14.0, 1.3, -2.6, 0.0, 0.0, 0.0, 0);

			LAi_QuestDelay("galleon_sinking22C", 0.75);
		break;

		case "galleon_sinking22C":
			CreateParticleSystemX("ball_splash", -14.0, 1.3, -6.6, 0.0, 0.0, 0.0, 0);

			CreateParticleSystemX("ball_splash", -14.0, 1.3, -8.6, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", -14.0, 1.3, -4.6, 0.0, 0.0, 0.0, 0);
		break;

		case "galleon_sinking23":
			PlaySound("AMBIENT\pirate_captains.wav");

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, CharacterFromID("pir_cap1"));

			LAi_SetOfficerType(CharacterFromID("pir_cap16"));
			LAi_SetOfficerType(CharacterFromID("pir_cap3"));
			LAi_SetOfficerType(CharacterFromID("pir_cap23"));
			LAi_SetOfficerType(CharacterFromID("pir_cap4"));
			LAi_SetOfficerType(CharacterFromID("pir_cap30"));
			LAi_SetOfficerType(CharacterFromID("pir_cap26"));
			LAi_SetOfficerType(CharacterFromID("pir_cap8"));
			LAi_SetOfficerType(CharacterFromID("pir_cap5"));
			LAi_SetOfficerType(CharacterFromID("pir_cap7"));
			LAi_SetOfficerType(CharacterFromID("pir_cap18"));
			LAi_SetOfficerType(CharacterFromID("pir_cap14"));
			LAi_SetOfficerType(CharacterFromID("pir_cap9"));

			LAi_QuestDelay("galleon_sinking24", 3.0);
		break;

		case "galleon_sinking24":
			PlaySound("AMBIENT\crew_negative.wav");

			LAi_QuestDelay("galleon_sinking25", 6.0);
		break;

		case "galleon_sinking25":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "take_corvette";
		break;

		case "galleon_sinking26":
			SetModel(characterFromID("pir_cap1"), "pir_cap1", "man", "man", 1.8, false);
			PlaySound("VOICE\ENGLISH\pir_capR10.wav");
			LAi_SetPlayerType(Pchar);
			LAi_SetStayType(characterFromID("pir_cap1"));

			LAi_QuestDelay("galleon_sinking27", 3.0);
		break;

		case "galleon_sinking27":
			PlaySound("INTERFACE\officers_ammo.wav");

			LAi_SetStayType(CharacterFromID("pir_cap16"));
			LAi_SetStayType(CharacterFromID("pir_cap3"));
			LAi_SetActorType(CharacterFromID("pir_cap23"));
			LAi_SetCitizenType(CharacterFromID("pir_cap4"));
			LAi_SetActorType(CharacterFromID("pir_cap30"));
			LAi_SetActorType(CharacterFromID("pir_cap26"));
			LAi_SetActorType(CharacterFromID("pir_cap8"));
			LAi_SetActorType(CharacterFromID("pir_cap5"));
			LAi_SetActorType(CharacterFromID("pir_cap7"));
			LAi_SetActorType(CharacterFromID("pir_cap18"));
			LAi_SetActorType(CharacterFromID("pir_cap14"));
			LAi_SetActorType(CharacterFromID("pir_cap9"));

			LAi_ActorGoToLocator(characterFromID("pir_cap9"), "goto", "look12", "", "");
			LAi_ActorGoToLocator(characterFromID("pir_cap14"), "goto", "look11", "", "");
			LAi_ActorGoToLocator(characterFromID("pir_cap18"), "goto", "box5", "", "");
			LAi_ActorGoToLocator(characterFromID("pir_cap7"), "goto", "look10", "", "");
			LAi_ActorGoToLocator(characterFromID("pir_cap23"), "reload", "reload6", "", "");
			LAi_ActorGoToLocator(characterFromID("pir_cap5"), "goto", "goto1", "", "");
			LAi_ActorGoToLocator(characterFromID("pir_cap8"), "reload", "reload5", "", "");
			LAi_ActorGoToLocator(characterFromID("pir_cap26"), "reload", "reload6", "", "");
			LAi_ActorGoToLocator(characterFromID("pir_cap30"), "goto", "look9", "", "");

			LAi_QuestDelay("galleon_sinking28A", 1.0);
			LAi_QuestDelay("galleon_sinking28", 4.0);
		break;

		case "galleon_sinking28A":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorGoToLocator(characterFromID("pir_cap1"), "goto", "captain_vane", "", "");
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
		break;

		case "galleon_sinking28":
			ChangeCharacterAddressGroup(characterFromID("pir_cap1"), "wr_corvette", "goto", "captain_vane");
			LAi_SetStayType(CharacterFromID("pir_cap1"));

			LAi_SetCitizenType(CharacterFromID("pir_cap16"));
			LAi_SetCitizenType(CharacterFromID("pir_cap3"));
			LAi_SetCitizenType(CharacterFromID("pir_cap23"));
			LAi_SetCitizenType(CharacterFromID("pir_cap4"));
			LAi_SetCitizenType(CharacterFromID("pir_cap30"));
			LAi_SetCitizenType(CharacterFromID("pir_cap26"));
			LAi_SetCitizenType(CharacterFromID("pir_cap8"));
			LAi_SetCitizenType(CharacterFromID("pir_cap5"));
			LAi_SetCitizenType(CharacterFromID("pir_cap7"));
			LAi_SetCitizenType(CharacterFromID("pir_cap18"));
			LAi_SetCitizenType(CharacterFromID("pir_cap14"));
			LAi_SetCitizenType(CharacterFromID("pir_cap9"));

			SetModel(characterFromID("pir_cap31"), "pir_cap31", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap22"), "pir_cap22", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap27"), "pir_cap27", "man", "man", 1.8, false);
			SetModel(characterFromID("pir_cap29"), "pir_cap29", "man", "man", 1.8, false);
		break;
	//...............................................................................................................
		case "goodbye_Vane_Moody":
			LAi_SetStayType(Pchar);

			LAi_SetActorType(CharacterFromID("pir_cap16"));
			LAi_SetActorType(CharacterFromID("pir_cap3"));
			LAi_SetActorType(CharacterFromID("pir_cap23"));
			LAi_SetActorType(CharacterFromID("pir_cap4"));
			LAi_SetActorType(CharacterFromID("pir_cap30"));
			LAi_SetActorType(CharacterFromID("pir_cap26"));
			LAi_SetActorType(CharacterFromID("pir_cap8"));
			LAi_SetActorType(CharacterFromID("pir_cap5"));
			LAi_SetActorType(CharacterFromID("pir_cap7"));
			LAi_SetActorType(CharacterFromID("pir_cap18"));
			LAi_SetActorType(CharacterFromID("pir_cap14"));
			LAi_SetActorType(CharacterFromID("pir_cap9"));

			LAi_ActorTurnToLocator(CharacterFromID("pir_cap16"), "reload", "reload2");
			LAi_ActorTurnToLocator(CharacterFromID("pir_cap3"), "reload", "reload2");
			LAi_ActorTurnToLocator(CharacterFromID("pir_cap23"), "reload", "reload2");
			LAi_ActorTurnToLocator(CharacterFromID("pir_cap4"), "reload", "reload2");
			LAi_ActorTurnToLocator(CharacterFromID("pir_cap30"), "reload", "reload2");
			LAi_ActorTurnToLocator(CharacterFromID("pir_cap26"), "reload", "reload2");
			LAi_ActorTurnToLocator(CharacterFromID("pir_cap8"), "reload", "reload2");
			LAi_ActorTurnToLocator(CharacterFromID("pir_cap5"), "reload", "reload2");
			LAi_ActorTurnToLocator(CharacterFromID("pir_cap7"), "reload", "reload2");
			LAi_ActorTurnToLocator(CharacterFromID("pir_cap18"), "reload", "reload2");
			LAi_ActorTurnToLocator(CharacterFromID("pir_cap14"), "reload", "reload2");
			LAi_ActorTurnToLocator(CharacterFromID("pir_cap9"), "reload", "reload2");

			PlaySound("PEOPLE\Jump_Stone.wav");
			ChangeCharacterAddressGroup(characterFromID("pir_cap29"), "wr_corvette", "reload", "reload2");

			LAi_QuestDelay("goodbye_Vane_Moody1", 1.0);
		break;

		case "goodbye_Vane_Moody1":
			LAi_SetActorType(CharacterFromID("pir_cap29"));
			LAi_ActorRunToLocator(characterFromID("pir_cap29"), "goto", "dulaien", "goodbye_Vane_Moody2", 2.0);
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");
		break;

		case "goodbye_Vane_Moody2":
			LAi_SetStayType(CharacterFromID("pir_cap29"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap29"), "wr_corvette", "goto", "dulaien");
			PlaySound("VOICE\ENGLISH\pir_capC.wav");

			LAi_QuestDelay("goodbye_Vane_Moody3", 1.5);
		break;

		case "goodbye_Vane_Moody3":
			//PlaySound("VOICE\ENGLISH\pir_capR8.wav");
			PlaySound("VOICE\ENGLISH\pir_capR10.wav");
			LAi_ActorTurnToLocator(Pchar, "goto", "captain_Vane");

			LAi_QuestDelay("goodbye_Vane_Auger", 4.5);
		break;
	//-----------------------------------------------------------------------------------------------------------------
		case "goodbye_Vane_Auger":
			PlaySound("PEOPLE\Jump_Stone.wav");
			ChangeCharacterAddressGroup(characterFromID("pir_cap22"), "wr_corvette", "reload", "reload2");

			LAi_QuestDelay("goodbye_Vane_Auger1", 1.0);
		break;

		case "goodbye_Vane_Auger1":
			LAi_SetActorType(CharacterFromID("pir_cap22"));
			LAi_ActorRunToLocator(characterFromID("pir_cap22"), "goto", "quelch", "goodbye_Vane_Auger2", 2.0);
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");
		break;

		case "goodbye_Vane_Auger2":
			LAi_SetStayType(CharacterFromID("pir_cap22"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap22"), "wr_corvette", "goto", "quelch");
			PlaySound("VOICE\ENGLISH\pir_capAAA.wav");

			LAi_QuestDelay("goodbye_Vane_Auger3", 3.5);
		break;

		case "goodbye_Vane_Auger3":
			PlaySound("VOICE\ENGLISH\pir_capR3.wav");
			LAi_ActorTurnToLocator(Pchar, "goto", "captain_Vane");

			LAi_QuestDelay("goodbye_Vane_Dulaien", 2.0);
		break;
	//-----------------------------------------------------------------------------------------------------------------
		case "goodbye_Vane_Dulaien":
			PlaySound("PEOPLE\Jump_Stone.wav");
			ChangeCharacterAddressGroup(characterFromID("pir_cap31"), "wr_corvette", "reload", "reload2");

			LAi_QuestDelay("goodbye_Vane_Dulaien1", 1.0);
		break;

		case "goodbye_Vane_Dulaien1":
			LAi_SetActorType(CharacterFromID("pir_cap31"));
			LAi_ActorRunToLocator(characterFromID("pir_cap31"), "goto", "auger", "goodbye_Vane_Dulaien2", 2.0);
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");
		break;

		case "goodbye_Vane_Dulaien2":
			LAi_SetStayType(CharacterFromID("pir_cap31"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap31"), "wr_corvette", "goto", "auger");
			PlaySound("VOICE\ENGLISH\Fre_m_b_018.wav");

			LAi_QuestDelay("goodbye_Vane_Dulaien3", 3.0);
		break;

		case "goodbye_Vane_Dulaien3":
			PlaySound("VOICE\ENGLISH\pir_capR2.wav");
			LAi_ActorTurnToLocator(Pchar, "goto", "captain_Vane");

			LAi_QuestDelay("goodbye_Vane_Quelch", 2.0);
		break;
	//-----------------------------------------------------------------------------------------------------------------
		case "goodbye_Vane_Quelch":
			PlaySound("PEOPLE\Jump_Stone.wav");
			ChangeCharacterAddressGroup(characterFromID("pir_cap27"), "wr_corvette", "reload", "reload2");

			LAi_QuestDelay("goodbye_Vane_Quelch1", 1.0);
		break;

		case "goodbye_Vane_Quelch1":
			LAi_SetActorType(CharacterFromID("pir_cap27"));
			LAi_ActorRunToLocator(characterFromID("pir_cap27"), "goto", "moody", "goodbye_Vane_Quelch2", 1.5);
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");
		break;

		case "goodbye_Vane_Quelch2":
			LAi_SetStayType(CharacterFromID("pir_cap27"));
			ChangeCharacterAddressGroup(characterFromID("pir_cap27"), "wr_corvette", "goto", "moody");
			PlaySound("VOICE\ENGLISH\pir_capIII.wav");

			LAi_QuestDelay("goodbye_Vane_Quelch3", 2.5);
		break;

		case "goodbye_Vane_Quelch3":
			LAi_SetActorType(CharacterFromID("pir_cap1"));
			LAi_ActorDialog(characterFromID("pir_cap1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "bye_bye";
		break;
	//-----------------------------------------------------------------------------------------------------------------
		case "goodbye_Vane_loop":
			//from Vane dialog
			PlaySound("VOICE\ENGLISH\pir_capR7.wav");
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "bye_bye_loop";
		break;
	//-----------------------------------------------------------------------------------------------------------------
		case "goodbye_Vane_Pchar":
			//from Vane dialog
			PlaySound("VOICE\ENGLISH\pir_capR7.wav");
			LAi_SetStayType(Pchar);
			LAi_SetStayType(CharacterFromID("pir_cap1"));
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "bye_bye_loop";

			LAi_QuestDelay("goodbye_Vane_Pchar0", 2.0);
		break;

		case "goodbye_Vane_Pchar0":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");

			LAi_SetStayType(CharacterFromID("pir_cap16"));
			LAi_SetStayType(CharacterFromID("pir_cap3"));
			LAi_SetStayType(CharacterFromID("pir_cap23"));
			LAi_SetStayType(CharacterFromID("pir_cap4"));
			LAi_SetStayType(CharacterFromID("pir_cap30"));
			LAi_SetStayType(CharacterFromID("pir_cap26"));
			LAi_SetStayType(CharacterFromID("pir_cap8"));
			LAi_SetStayType(CharacterFromID("pir_cap5"));
			LAi_SetStayType(CharacterFromID("pir_cap7"));
			LAi_SetStayType(CharacterFromID("pir_cap18"));
			LAi_SetStayType(CharacterFromID("pir_cap14"));
			LAi_SetStayType(CharacterFromID("pir_cap9"));

			LAi_SetStayType(CharacterFromID("pir_cap29"));
			LAi_SetStayType(CharacterFromID("pir_cap22"));
			LAi_SetStayType(CharacterFromID("pir_cap31"));
			LAi_SetStayType(CharacterFromID("pir_cap27"));

			LAi_SetActorType(CharacterFromID("guncrew_1"));
			LAi_SetActorType(CharacterFromID("guncrew_2"));
			LAi_SetActorType(CharacterFromID("guncrew_3"));
			LAi_SetActorType(CharacterFromID("guncrew_4"));
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_SetActorType(CharacterFromID("Friday"));

			LAi_ActorGoToLocator(characterFromID("Selkirk"), "reload", "reload2", "goodbye_Vane_Pchar1", 2.0);
			LAi_ActorGoToLocator(characterFromID("guncrew_2"), "reload", "reload2", "", "");
		break;

		case "goodbye_Vane_Pchar1":
			PlaySound("PEOPLE\jump_stone.wav");
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "wr_port", "goto", "R3");
			ChangeCharacterAddressGroup(characterFromID("guncrew_2"), "wr_port", "goto", "L4");
			LAi_SetStayType(CharacterFromID("Selkirk"));
			LAi_SetStayType(CharacterFromID("guncrew_2"));

			LAi_ActorGoToLocator(characterFromID("guncrew_4"), "reload", "reload2", "goodbye_Vane_Pchar2", 1.0);
			LAi_ActorGoToLocator(characterFromID("guncrew_1"), "reload", "reload2", "", "");
		break;

		case "goodbye_Vane_Pchar2":
			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("wr_port")].locators_radius.goto.Q9 = 1.0;
			PlaySound("PEOPLE\jump_stone.wav");
			ChangeCharacterAddressGroup(characterFromID("guncrew_1"), "wr_port", "goto", "L3");
			ChangeCharacterAddressGroup(characterFromID("guncrew_4"), "wr_port", "goto", "L2");
			LAi_SetStayType(CharacterFromID("guncrew_4"));
			LAi_SetStayType(CharacterFromID("guncrew_1"));

			LAi_ActorGoToLocator(characterFromID("Friday"), "reload", "reload2", "goodbye_Vane_Pchar3", 1.0);
			LAi_ActorGoToLocator(characterFromID("guncrew_3"), "reload", "reload2", "", "");
		break;

		case "goodbye_Vane_Pchar3":
			PlaySound("PEOPLE\jump_stone.wav");
			ChangeCharacterAddressGroup(characterFromID("Friday"), "wr_port", "goto", "R4");
			ChangeCharacterAddressGroup(characterFromID("guncrew_3"), "wr_port", "goto", "L1");
			LAi_SetStayType(CharacterFromID("Friday"));
			LAi_SetStayType(CharacterFromID("guncrew_3"));
			ChangeCharacterAddressGroup(characterFromID("Minerva"), "wr_port", "goto", "R2");
			LAi_SetStayType(CharacterFromID("Minerva"));

			LAi_SetCitizenType(CharacterFromID("pir_cap16"));
			LAi_SetCitizenType(CharacterFromID("pir_cap3"));
			LAi_SetCitizenType(CharacterFromID("pir_cap23"));
			LAi_SetCitizenType(CharacterFromID("pir_cap4"));
			LAi_SetCitizenType(CharacterFromID("pir_cap30"));
			LAi_SetCitizenType(CharacterFromID("pir_cap26"));
			LAi_SetCitizenType(CharacterFromID("pir_cap8"));
			LAi_SetCitizenType(CharacterFromID("pir_cap5"));
			LAi_SetCitizenType(CharacterFromID("pir_cap7"));
			LAi_SetCitizenType(CharacterFromID("pir_cap18"));
			LAi_SetCitizenType(CharacterFromID("pir_cap14"));
			LAi_SetCitizenType(CharacterFromID("pir_cap9"));

			LAi_SetCitizenType(CharacterFromID("pir_cap22"));
			LAi_SetCitizenType(CharacterFromID("pir_cap31"));
			LAi_SetCitizenType(CharacterFromID("pir_cap27"));
			LAi_SetCitizenType(CharacterFromID("pir_cap29"));

			Pchar.quest.distillery_items = "something_else";
			Pchar.quest.Minerva_copper = "no";
			Pchar.quest.Minerva_silver = "no";
			Pchar.quest.Minerva_gold = "no";

			characters[GetCharacterIndex("CoastBrother26")].sailaway = true;

			pchar.quest.goodbye_Vane_Pchar4.win_condition.l1 = "location";
			pchar.quest.goodbye_Vane_Pchar4.win_condition.l1.location = "wr_port";
			pchar.quest.goodbye_Vane_Pchar4.win_condition = "goodbye_Vane_Pchar4";
		break;

		case "goodbye_Vane_Pchar4":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "L4");

			LAi_QuestDelay("goodbye_Vane_Pchar5", 2.0);

			pchar.quest.goodbye_Vane_Pchar15.win_condition.l1 = "locator";
			pchar.quest.goodbye_Vane_Pchar15.win_condition.l1.location = "wr_port";
			pchar.quest.goodbye_Vane_Pchar15.win_condition.l1.locator_group = "goto";
			pchar.quest.goodbye_Vane_Pchar15.win_condition.l1.locator = "Q9";
			pchar.quest.goodbye_Vane_Pchar15.win_condition = "goodbye_Vane_Pchar15";
		break;

		case "goodbye_Vane_Pchar5":
			LAi_SetActorType(characterFromID("Minerva"));
			LAi_ActorDialog(characterFromID("Minerva"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Minerva"));
			Characters[GetCharacterIndex("Minerva")].dialog.CurrentNode  = "back_to_Rogers";
		break;

		case "goodbye_Vane_Pchar5A":
			LAi_QuestDelay("goodbye_Vane_Pchar5B", 1.0);
		break;

		case "goodbye_Vane_Pchar5B":
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire1.wav");

			LAi_QuestDelay("goodbye_Vane_Pchar6", 1.0);
		break;

		case "goodbye_Vane_Pchar6":
			CreateParticleSystem("cancloud" , -4.0, 2.0, 141.0, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("cancloud" , -4.0, 2.0, 141.0, 4.5, 1.5, 0.0, sti(20) );

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "ships_other", "ship_2");

			LAi_QuestDelay("goodbye_Vane_Pchar7", 2.5);
		break;

		case "goodbye_Vane_Pchar7":
			AddQuestRecord("Revenge", "5");
			CloseQuestHeader("Revenge");

			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");

			LAi_QuestDelay("goodbye_Vane_Pchar8", 3.0);		//was 2.0
		break;

		case "goodbye_Vane_Pchar8":
			PlaySound("VOICE\ENGLISH\Eng_m_c_073.wav");

			LAi_QuestDelay("goodbye_Vane_Pchar9", 4.5);		//was 3.5
		break;

		case "goodbye_Vane_Pchar9":
			LAi_ActorTurnToLocator(Pchar, "goto", "R2");

			LAi_QuestDelay("goodbye_Vane_Pchar10", 1.0);
		break;

		case "goodbye_Vane_Pchar10":
			PlaySound("VOICE\ENGLISH\blaze_lead_way_out.wav");

			LAi_QuestDelay("goodbye_Vane_Pchar11", 1.5);
		break;

		case "goodbye_Vane_Pchar11":
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_SetActorType(CharacterFromID("Friday"));
			LAi_ActorRunToLocator(characterFromID("Friday"), "goto", "goto19", "", "");
			LAi_ActorRunToLocator(characterFromID("Selkirk"), "goto", "goto19", "", "");

			LAi_QuestDelay("goodbye_Vane_Pchar12", 1.0);
		break;

		case "goodbye_Vane_Pchar12":
			PlaySound("VOICE\ENGLISH\guncrew_2.wav");

			LAi_QuestDelay("goodbye_Vane_Pchar13", 1.0);
		break;

		case "goodbye_Vane_Pchar13":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "L4");

			PlaySound("OBJECTS\SHIPCHARGE\gunner_fire.wav");

			LAi_QuestDelay("goodbye_Vane_Pchar14", 1.0);
		break;

		case "goodbye_Vane_Pchar14":
			LAi_SetActorType(CharacterFromID("guncrew_1"));
			LAi_SetActorType(CharacterFromID("guncrew_2"));
			LAi_SetActorType(CharacterFromID("guncrew_3"));
			LAi_SetActorType(CharacterFromID("guncrew_4"));
			LAi_ActorRunToLocator(characterFromID("guncrew_1"), "goto", "goto19", "", "");
			LAi_ActorRunToLocator(characterFromID("guncrew_2"), "goto", "goto19", "", "");
			LAi_ActorRunToLocator(characterFromID("guncrew_3"), "goto", "goto19", "", "");
			LAi_ActorRunToLocator(characterFromID("guncrew_4"), "goto", "goto19", "", "");

			Pchar.quest.wr_library = "medicine";
			Pchar.quest.medicine_quest = "started";
			Locations[FindLocation("wr_library")].models.always.locators = "Res02_l_JRH12";
			Locations[FindLocation("wr_library")].locators_radius.reload.reload2 = 0.5;
			Locations[FindLocation("wr_library")].reload.l1.disable = 1;
			Locations[FindLocation("wr_library")].reload.l2.disable = 1;
			Locations[FindLocation("wr_library")].reload.l3.disable = 1;
			Locations[FindLocation("wr_library")].reload.l4.disable = 1;
			Locations[FindLocation("wr_library")].reload.l5.disable = 0;
			Locations[FindLocation("wr_library")].reload.l6.disable = 1;
			Locations[FindLocation("wr_library")].reload.l7.disable = 1;
			LAi_LocationFightDisable(&Locations[FindLocation("wr_library")], false);

			ChangeCharacterAddressGroup(characterFromID("wr_boc4"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("wr_cor1_1"), "none", "", "");

			LAi_QuestDelay("goodbye_Vane_Pchar14A", 2.0);
		break;

		case "goodbye_Vane_Pchar14A":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "R2");

			LAi_QuestDelay("goodbye_Vane_Pchar14B", 1.0);
		break;

		case "goodbye_Vane_Pchar14B":
			PlaySound("VOICE\ENGLISH\blaze_lets_go.wav");
			LAi_SetPlayerType(Pchar);
			LAi_SetOfficerType(CharacterFromID("Minerva"));
		break;
//__________________________________________________________________________________________________________
		case "goodbye_Vane_Pchar15":
			DoQuestReloadToLocation("wr_library", "goto", "arrive", "goodbye_Vane_Pchar16");
		break;

		case "goodbye_Vane_Pchar16":
			PlaySound("INTERFACE\key_lock.wav");

			LAi_SetStayType(CharacterFromID("guncrew_1"));
			LAi_SetStayType(CharacterFromID("guncrew_2"));
			LAi_SetStayType(CharacterFromID("guncrew_3"));
			LAi_SetStayType(CharacterFromID("guncrew_4"));
			ChangeCharacterAddressGroup(characterFromID("guncrew_4"), "wr_library", "goto", "goto4");
			ChangeCharacterAddressGroup(characterFromID("guncrew_2"), "wr_library", "goto", "goto5");
			ChangeCharacterAddressGroup(characterFromID("guncrew_3"), "wr_library", "goto", "goto20");
			ChangeCharacterAddressGroup(characterFromID("guncrew_1"), "wr_library", "reload", "reload1");

			ChangeCharacterAddressGroup(characterFromID("Minerva"), "wr_library", "reload", "reload6");

			RemoveCharacterEquip(characterFromID("guncrew_1"), GUN_ITEM_TYPE );
			GiveItem2Character(characterFromID("guncrew_1"), "pistolmket");
			EquipCharacterbyItem(characterFromID("guncrew_1"), "pistolmket");

			RemoveCharacterEquip(characterFromID("guncrew_2"), GUN_ITEM_TYPE );
			GiveItem2Character(characterFromID("guncrew_2"), "pistolmket");
			EquipCharacterbyItem(characterFromID("guncrew_2"), "pistolmket");

			RemoveCharacterEquip(characterFromID("guncrew_3"), GUN_ITEM_TYPE );
			GiveItem2Character(characterFromID("guncrew_3"), "pistolmket");
			EquipCharacterbyItem(characterFromID("guncrew_3"), "pistolmket");

			RemoveCharacterEquip(characterFromID("guncrew_4"), GUN_ITEM_TYPE );
			GiveItem2Character(characterFromID("guncrew_4"), "pistolmket");
			EquipCharacterbyItem(characterFromID("guncrew_4"), "pistolmket");

			GiveItem2Character(characterFromID("wench3"), "bladep0");
			EquipCharacterbyItem(characterFromID("wench3"), "bladep0");
			GiveItem2Character(characterFromID("wench3"), "pistol0");
			EquipCharacterbyItem(characterFromID("wench3"), "pistol0");
			LAi_SetStayType(CharacterFromID("Wench3"));
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "wr_study", "goto", "caroline");

			Pchar.quest.distillery_items = "something_else";
			Pchar.quest.Minerva_copper = "no";
			Pchar.quest.Minerva_silver = "no";
			Pchar.quest.Minerva_gold = "no";

			ChangeCharacterAddressGroup(characterFromID("Woodes Rogers"), "wr_study", "goto", "wr_dead");
			LAi_SetActorType(CharacterFromID("Woodes Rogers"));
			LAi_ActorSetLayMode(CharacterFromID("Woodes Rogers"));
			Locations[FindLocation("wr_study")].locators_radius.box.box16 = 1.0;

			Pchar.quest.study_lever1 = "missing";
			Pchar.quest.study_lever2 = "missing";
			Pchar.quest.study_lever3 = "missing";
			Pchar.quest.study_lever4 = "missing";

			Locations[FindLocation("wr_study")].locators_radius.box.box1 = 0.0001;
			Locations[FindLocation("wr_study")].locators_radius.box.box2 = 0.0001;
			Locations[FindLocation("wr_study")].locators_radius.box.box3 = 0.0001;
			Locations[FindLocation("wr_study")].locators_radius.box.box4 = 0.0001;
			Locations[FindLocation("wr_study")].locators_radius.box.box5 = 0.0001;
			Locations[FindLocation("wr_study")].locators_radius.box.box6 = 0.0001;

			Locations[FindLocation("wr_study")].locators_radius.box.box8 = 0.5;
			Locations[FindLocation("wr_study")].locators_radius.box.box9 = 0.5;
			Locations[FindLocation("wr_study")].locators_radius.box.box10 = 0.5;
			Locations[FindLocation("wr_study")].locators_radius.box.box11 = 0.5;
			Locations[FindLocation("wr_study")].locators_radius.goto.wr_dead = 2.0;

			locations[FindLocation("Tavern_storeroom")].id.label = "Tavern storeroom";
			locations[FindLocation("wr_study")].id.label = "Woodes Rogers' study";
			locations[FindLocation("wr_gunroom")].id.label = "Gunroom";
			locations[FindLocation("storeroom_attic")].id.label = "Storeroom attic";

			LAi_QuestDelay("goodbye_Vane_Pchar17", 1.0);

			pchar.quest.study_puzzle3.win_condition.l1 = "location";
			pchar.quest.study_puzzle3.win_condition.l1.location = "wr_study";
			pchar.quest.study_puzzle3.win_condition = "study_puzzle3";
		break;

		case "goodbye_Vane_Pchar17":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "arrive_look");

			LAi_QuestDelay("goodbye_Vane_Pchar18", 1.0);
		break;

		case "goodbye_Vane_Pchar18":
			PlaySound("VOICE\ENGLISH\blaze_hah.wav");

			LAi_QuestDelay("goodbye_Vane_Pchar19", 1.0);
		break;

		case "goodbye_Vane_Pchar19":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto12");

			LAi_QuestDelay("goodbye_Vane_Pchar20", 1.0);
		break;

		case "goodbye_Vane_Pchar20":
			LAi_SetPlayerType(Pchar);

			RemoveCharacterEquip(CharacterFromID("Woodes Rogers"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(CharacterFromID("Woodes Rogers"), "bladeA5");
		break;
	//...............................................................................................
	//[20] from here ... testing study to secret puzzle - study_puzzle0 t.o.m 0_B only temp
		case "study_puzzle1":
			//start from b_r
			DoQuestReloadToLocation("wr_library", "goto", "arrive", "study_puzzle2");
		break;
	//...............................................................................................
		case "study_puzzle2":
			//only used at start from b_r
			LAi_SetPlayerType(Pchar);

			pchar.quest.study_puzzle3.win_condition.l1 = "location";
			pchar.quest.study_puzzle3.win_condition.l1.location = "wr_study";
			pchar.quest.study_puzzle3.win_condition = "study_puzzle3";
		break;

		case "study_puzzle3":
			SetModel(characterFromID("Selkirk"), "Selkirk_officer", "man", "man", 1.8, true);
			SetModel(characterFromID("Friday"), "Friday_officer", "man", "man", 1.8, true);
			SetModel(characterFromID("Dave Edna"), "Dave_officer", "man", "man", 1.8, true);
			SetModel(characterFromID("Grandma"), "Grandma_boss", "man", "man", 1.8, true);
			SetModel(characterFromID("wench3"), "Caroline_officer", "man", "man", 1.8, true);

			LAi_SetSitType(CharacterFromID("Grandma"));
			ChangeCharacterAddressGroup(characterFromID("Grandma"), "ck_drawing_room", "sit", "sit1");
			RemoveCharacterEquip(characterFromID("Grandma"), GUN_ITEM_TYPE );
			RemoveCharacterEquip(characterFromID("Grandma"), BLADE_ITEM_TYPE );
			TakeItemFromCharacter(characterFromID("Grandma"), "bladebroom");
			TakeItemFromCharacter(characterFromID("Grandma"), "pistolbbuss");

			LAi_SetSitType(CharacterFromID("Dave Edna"));
			ChangeCharacterAddressGroup(characterFromID("Dave Edna"), "ck_drawing_room", "sit", "sit4");
			RemoveCharacterEquip(characterFromID("Dave Edna"), GUN_ITEM_TYPE );
			RemoveCharacterEquip(characterFromID("Dave Edna"), BLADE_ITEM_TYPE );
			TakeItemFromCharacter(characterFromID("Dave Edna"), "bladestool");
			TakeItemFromCharacter(characterFromID("Dave Edna"), "pistolbbuss");
			GiveItem2Character(characterFromID("Dave Edna"), "bladeA2");
			EquipCharacterbyItem(characterFromID("Dave Edna"), "bladeA2");

			LAi_SetStayType(CharacterFromID("Minerva"));
			ChangeCharacterAddressGroup(characterFromID("Minerva"), "ck_drawing_room", "goto", "goto5");

			RemoveCharacterEquip(characterFromID("wench3"), GUN_ITEM_TYPE );
			RemoveCharacterEquip(characterFromID("wench3"), BLADE_ITEM_TYPE );
			TakeItemFromCharacter(characterFromID("wench3"), "bladep0");
			TakeItemFromCharacter(characterFromID("wench3"), "pistol0");

			LAi_SetSitType(CharacterFromID("Selkirk"));
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "ck_drawing_room", "sit", "sit5");
			RemoveCharacterEquip(characterFromID("Selkirk"), GUN_ITEM_TYPE );
			RemoveCharacterEquip(characterFromID("Selkirk"), BLADE_ITEM_TYPE );
			TakeItemFromCharacter(characterFromID("Selkirk"), "blade1");
			TakeItemFromCharacter(characterFromID("Selkirk"), "pistol5");
			GiveItem2Character(characterFromID("Selkirk"), "bladespyglass6");
			EquipCharacterbyItem(characterFromID("Selkirk"), "bladespyglass6");

			LAi_SetSitType(CharacterFromID("Friday"));
			ChangeCharacterAddressGroup(characterFromID("Friday"), "ck_drawing_room", "sit", "sit6");

			LAi_SetSitType(CharacterFromID("Defoe"));
			ChangeCharacterAddressGroup(characterFromID("Defoe"), "ck_drawing_room", "sit", "sit3");
			GiveItem2Character(characterFromID("Defoe"), "bladeX4");
			EquipCharacterbyItem(characterFromID("Defoe"), "bladeX4");
			GiveItem2Character(characterFromID("Defoe"), "pistol201");
			EquipCharacterbyItem(characterFromID("Defoe"), "pistol201");

			locations[FindLocation("wr_library")].id.label = "Woodes Rogers' library";

			locations[FindLocation(Pchar.location)].box7.items.bladelever = 4;
			locations[FindLocation(Pchar.location)].box7.items."bladeA5" = 1;
			locations[FindLocation(Pchar.location)].box7.items."spyglass3" = 1;
			locations[FindLocation(Pchar.location)].box16.items.temp_coins = 83;
			locations[FindLocation(Pchar.location)].box16.items.sewing_kit = 1;
			locations[FindLocation(Pchar.location)].box16.items.tobacco = 1;
			locations[FindLocation(Pchar.location)].box16.items.folding_knife = 1;
			locations[FindLocation(Pchar.location)].box16.items.compass1 = 1;
			locations[FindLocation(Pchar.location)].box16.items.pistoltinderbox = 1;
			locations[FindLocation(Pchar.location)].box16.items.key17 = 1;

			pchar.quest.study_puzzle5.win_condition.l1 = "locator";
			pchar.quest.study_puzzle5.win_condition.l1.location = "wr_study";
			pchar.quest.study_puzzle5.win_condition.l1.locator_group = "goto";
			pchar.quest.study_puzzle5.win_condition.l1.locator = "wr_dead";
			pchar.quest.study_puzzle5.win_condition = "study_puzzle5";
		break;

		case "tinder_box":
			//from LAi_events
			LAi_SetFightMode(Pchar, false);
		break;
	//...............................................................................................
		case "study_puzzle5":
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToCharacter(characterFromID("Wench3"), PChar);
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
			Characters[GetCharacterIndex("Wench3")].dialog.CurrentNode  = "search_study";
		break;

		case "study_puzzle6":
			//from Caroline dialog
			DeleteQuestHeader("Revenge");
			DeleteQuestHeader("Woodes_Rogers_crew");
			SetQuestHeader("Secrets");
			AddQuestRecord("Secrets", "1");

			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorGoToLocator(characterFromID("Wench3"), "reload", "reload1", "study_puzzle7", 3.0);

			LAi_QuestDelay("find_key17", 0.1);
		break;

		case "find_key17":
			if(CheckCharacterItem(Pchar,"key17"))
			{
				AddQuestRecord("Secrets", "2");
				LAi_QuestDelay("find_lever", 0.1);
			}
			else LAi_QuestDelay("find_key17", 0.5);
		break;
//package A
		case "find_lever":
			if(CheckCharacterItem(Pchar,"bladelever"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladelever");
				AddQuestRecord("Secrets", "3");

	//			LAi_QuestDelay("package1", 0.1);
	//			LAi_QuestDelay("find_package", 0.1);
			}
			else LAi_QuestDelay("find_lever", 0.5);
		break;
	/*
		case "find_package":
			if(CheckCharacterItem(Pchar,"package"))
			{
				AddQuestRecord("Secrets", "5");
			}
			else LAi_QuestDelay("find_package", 0.5);
		break;
	*/
		case "study_puzzle7":
			PlaySound("INTERFACE\closed_door.wav");
			LAi_SetStayType(CharacterFromID("Wench3"));
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "ck_drawing_room", "goto", "goto3");
		break;
	//...............................................................................................
		case "study_place_lever2_A":
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			if(!CheckCharacterItem(Pchar,"bladeX4")) GiveItem2Character(Pchar, "bladeX4");
			EquipCharacterByItem(Pchar, "bladeX4");
			TakeItemFromCharacter(pchar, "bladelever");

			PlaySound("INTERFACE\lever_placed.wav");
			Pchar.quest.study_lever2 = "up";
			Locations[FindLocation("wr_study")].models.always.l2 = "lever2_up";
			
			LAi_QuestDelay("study_place_lever2_B", 0.5);
		break;

		case "study_place_lever3_A":
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			if(!CheckCharacterItem(Pchar,"bladeX4")) GiveItem2Character(Pchar, "bladeX4");
			EquipCharacterByItem(Pchar, "bladeX4");
			TakeItemFromCharacter(pchar, "bladelever");

			PlaySound("INTERFACE\lever_placed.wav");
			Pchar.quest.study_lever3 = "up";
			Locations[FindLocation("wr_study")].models.always.l3 = "lever3_up";
			
			LAi_QuestDelay("study_place_lever3_B", 0.5);
		break;

		case "study_place_lever1_A":
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			if(!CheckCharacterItem(Pchar,"bladeX4")) GiveItem2Character(Pchar, "bladeX4");
			EquipCharacterByItem(Pchar, "bladeX4");
			TakeItemFromCharacter(pchar, "bladelever");

			PlaySound("INTERFACE\lever_placed.wav");
			Pchar.quest.study_lever1 = "up";
			Locations[FindLocation("wr_study")].models.always.l1 = "lever1_up";
			
			LAi_QuestDelay("study_place_lever1_B", 0.5);
		break;

		case "study_place_lever4_A":
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			if(!CheckCharacterItem(Pchar,"bladeX4")) GiveItem2Character(Pchar, "bladeX4");
			EquipCharacterByItem(Pchar, "bladeX4");
			TakeItemFromCharacter(pchar, "bladelever");

			PlaySound("INTERFACE\lever_placed.wav");
			Pchar.quest.study_lever4 = "up";
			Locations[FindLocation("wr_study")].models.always.l4 = "lever4_up";
			
			LAi_QuestDelay("study_place_lever4_B", 0.5);
		break;
	//..............................................................................................
		case "study_place_lever2_B":
			Locations[FindLocation("wr_study")].image = "";
			DoQuestReloadToLocation("wr_study", "goto", "stay8", "study_loading_image_back");
		break;

		case "study_place_lever3_B":
			Locations[FindLocation("wr_study")].image = "";
			DoQuestReloadToLocation("wr_study", "goto", "stay9", "study_loading_image_back");
		break;

		case "study_place_lever1_B":
			Locations[FindLocation("wr_study")].image = "";
			DoQuestReloadToLocation("wr_study", "goto", "stay10", "study_loading_image_back");
		break;

		case "study_place_lever4_B":
			Locations[FindLocation("wr_study")].image = "";
			DoQuestReloadToLocation("wr_study", "goto", "stay11", "study_loading_image_back");
		break;

		case "study_loading_image_back":
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], true);
			LAi_SetFightMode(Pchar, false);
			Locations[FindLocation("wr_study")].image = "wr_study.tga";
		break;
	//...............................................................................................
		case "study_wall_free":
			if(CheckAttribute(Pchar,"quest.study_lever2") && Pchar.quest.study_lever2 == "down")
			{
				if(CheckAttribute(Pchar,"quest.study_lever3") && Pchar.quest.study_lever3 == "down")
				{
					if(CheckAttribute(Pchar,"quest.study_lever4") && Pchar.quest.study_lever4 == "down")
					{
						Locations[FindLocation("wr_study")].locators_radius.box.box12 = 0.0001;
						Locations[FindLocation("wr_study")].locators_radius.box.box13 = 0.0001;
						Locations[FindLocation("wr_study")].locators_radius.box.box14 = 0.0001;
						Locations[FindLocation("wr_study")].locators_radius.box.box15 = 0.0001;
					}
				}
			}

			Locations[FindLocation("wr_study")].image = "";
			DoQuestReloadToLocation("wr_study", "goto", "stay10", "study_wall_free1");
		break;

		case "study_wall_free1":
			Locations[FindLocation("wr_study")].image = "wr_study.tga";
			PlaySound("INTERFACE\shelf_open.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");

			LAi_QuestDelay("study_pchar_playertype", 1.0);
		break;

		case "study_pchar_playertype":
			LAi_SetPlayerType(Pchar);

			if(CheckAttribute(Pchar,"quest.study_lever1") && Pchar.quest.study_lever1 == "down")
			{
				//wall is gone
				if(CheckAttribute(Pchar,"quest.study_lever2") && Pchar.quest.study_lever2 == "down")
				{
					//bars are up
					if(CheckAttribute(Pchar,"quest.study_lever3") && Pchar.quest.study_lever3 == "down")
					{
						//door is unlocked
						if(CheckAttribute(Pchar,"quest.study_lever4") && Pchar.quest.study_lever4 == "down")
						{
							Locations[FindLocation("wr_study")].reload.l2.disable = 0;	//OPEN!!!

							pchar.quest.fill_secret_box.win_condition.l1 = "location";
							pchar.quest.fill_secret_box.win_condition.l1.location = "wr_secret";
							pchar.quest.fill_secret_box.win_condition = "fill_secret_box";
						}
						else Locations[FindLocation("wr_study")].reload.l2.disable = 1;
					}
					else Locations[FindLocation("wr_study")].reload.l2.disable = 1;
				}
				else Locations[FindLocation("wr_study")].reload.l2.disable = 1;
			}
			else Locations[FindLocation("wr_study")].reload.l2.disable = 1;

			if(CheckAttribute(Pchar,"quest.study_secret_door") && Pchar.quest.study_secret_door == "observed")
			{
				return;
			}
			else
			{
				Pchar.quest.study_secret_door = "observed"
				PlaySound("VOICE\ENGLISH\blaze_hah.wav");

				AddQuestRecord("Secrets", "4");
			}
		break;
	//...............................................................................................
		case "study_bars_up":
			Locations[FindLocation("wr_study")].image = "";
			DoQuestReloadToLocation("wr_study", "goto", "stay8", "study_bars_up1");
		break;

		case "study_bars_up1":
			PlaySound("INTERFACE\rusty.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");

			LAi_QuestDelay("study_bars_up2", 2.0);
		break;

		case "study_bars_up2":
			Pchar.quest.study_lever1 = "up";
			Locations[FindLocation("wr_study")].models.always.l1 = "lever1_up";
			Locations[FindLocation("wr_study")].locators_radius.box.box10 = 0.5;
			Locations[FindLocation("wr_study")].locators_radius.box.box14 = 0.0001;
			Locations[FindLocation(Pchar.location)].models.always.locators = "sh05_locators_JRH";

			DoQuestReloadToLocation("wr_study", "goto", "stay8", "study_bars_up3");
		break;

		case "study_bars_up3":
			Locations[FindLocation("wr_study")].image = "wr_study.tga";
			PlaySound("INTERFACE\shelf_close.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");

			LAi_QuestDelay("study_pchar_playertype", 1.0);
		break;
	//...............................................................................................
		case "study_girder_free":
			Locations[FindLocation("wr_study")].image = "";
			DoQuestReloadToLocation("wr_study", "goto", "stay9", "study_girder_free1");
		break;

		case "study_girder_free1":
			PlaySound("INTERFACE\girder_open.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");

			LAi_QuestDelay("study_girder_free2", 2.0);
		break;

		case "study_girder_free2":
			Pchar.quest.study_lever2 = "up";
			Locations[FindLocation("wr_study")].models.always.l2 = "lever2_up";
			Locations[FindLocation("wr_study")].models.always.l5 = "bars_down";
			Locations[FindLocation("wr_study")].locators_radius.box.box8 = 0.5;
			Locations[FindLocation("wr_study")].locators_radius.box.box12 = 0.0001;

			DoQuestReloadToLocation("wr_study", "goto", "stay9", "study_girder_free3");
		break;

		case "study_girder_free3":
			Locations[FindLocation("wr_study")].image = "wr_study.tga";
			PlaySound("INTERFACE\elevator_gate.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");

			LAi_QuestDelay("study_pchar_playertype", 1.0);
		break;
	//...............................................................................................
		case "study_secret_unlock":
			Locations[FindLocation("wr_study")].image = "";
			DoQuestReloadToLocation("wr_study", "goto", "stay11", "study_secret_unlock1");
		break;

		case "study_secret_unlock1":
			PlaySound("INTERFACE\key_unlock.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");

			LAi_QuestDelay("study_secret_unlock2", 2.0);
		break;

		case "study_secret_unlock2":
			Pchar.quest.study_lever3 = "up";
			Locations[FindLocation("wr_study")].models.always.l3 = "lever3_up";
			Locations[FindLocation("wr_study")].models.always.l6 = "girder_block";
			Locations[FindLocation("wr_study")].locators_radius.box.box9 = 0.5;
			Locations[FindLocation("wr_study")].locators_radius.box.box13 = 0.0001;

			DoQuestReloadToLocation("wr_study", "goto", "stay11", "study_secret_unlock3");
		break;

		case "study_secret_unlock3":
			Locations[FindLocation("wr_study")].image = "wr_study.tga";
			PlaySound("INTERFACE\girder_close.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");

			LAi_QuestDelay("study_pchar_playertype", 1.0);
		break;
	//...............................................................................................
	//lever up functions
		case "study_bars_down":
			Locations[FindLocation("wr_study")].image = "";
			DoQuestReloadToLocation("wr_study", "goto", "stay8", "study_bars_down1");
		break;

		case "study_bars_down1":
			Locations[FindLocation("wr_study")].image = "wr_study.tga";
			PlaySound("INTERFACE\elevator_gate.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");

			LAi_QuestDelay("study_pchar_playertype", 1.0);
		break;

		case "study_girder_block":
			Locations[FindLocation("wr_study")].image = "";
			DoQuestReloadToLocation("wr_study", "goto", "stay9", "study_girder_block1");
		break;

		case "study_girder_block1":
			Locations[FindLocation("wr_study")].image = "wr_study.tga";
			PlaySound("INTERFACE\girder_close.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");

			LAi_QuestDelay("study_pchar_playertype", 1.0);
		break;

		case "study_wall_block":
			Locations[FindLocation("wr_study")].image = "";
			DoQuestReloadToLocation("wr_study", "goto", "stay10", "study_wall_block1");
		break;

		case "study_wall_block1":
			Locations[FindLocation("wr_study")].image = "wr_study.tga";
			PlaySound("INTERFACE\shelf_close.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");

			LAi_QuestDelay("study_pchar_playertype", 1.0);
		break;

		case "study_secret_lock":
			Locations[FindLocation("wr_study")].image = "";
			DoQuestReloadToLocation("wr_study", "goto", "stay11", "study_secret_lock1");
		break;

		case "study_secret_lock1":
			Locations[FindLocation("wr_study")].image = "wr_study.tga";
			PlaySound("INTERFACE\key_lock.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");

			LAi_QuestDelay("study_pchar_playertype", 1.0);
		break;
	//...............................................................................................
	//reset
		case "study_levers_reset1":
			if(CheckAttribute(Pchar,"quest.study_lever1") && Pchar.quest.study_lever1 == "down")
			{
				Pchar.quest.study_teleport_check = "yes";
				Pchar.quest.study_teleport = "yes";
				Pchar.quest.study_sound1 = "yes";
				Pchar.quest.study_lever1 = "up";
				Locations[FindLocation("wr_study")].models.always.l1 = "lever1_up";
				Locations[FindLocation("wr_study")].locators_radius.box.box10 = 0.5;
				Locations[FindLocation("wr_study")].locators_radius.box.box14 = 0.0001;
				Locations[FindLocation(Pchar.location)].models.always.locators = "sh05_locators_JRH";
			}

			if(CheckAttribute(Pchar,"quest.study_lever2") && Pchar.quest.study_lever2 == "down")
			{
				Pchar.quest.study_teleport = "yes";
				Pchar.quest.study_sound2 = "yes";
				Pchar.quest.study_lever2 = "up";
				Locations[FindLocation("wr_study")].models.always.l2 = "lever2_up";
				Locations[FindLocation("wr_study")].models.always.l5 = "bars_down";
				Locations[FindLocation("wr_study")].locators_radius.box.box8 = 0.5;
				Locations[FindLocation("wr_study")].locators_radius.box.box12 = 0.0001;
			}

			if(CheckAttribute(Pchar,"quest.study_lever3") && Pchar.quest.study_lever3 == "down")
			{
				Pchar.quest.study_teleport = "yes";
				Pchar.quest.study_sound3 = "yes";
				Pchar.quest.study_lever3 = "up";
				Locations[FindLocation("wr_study")].models.always.l3 = "lever3_up";
				Locations[FindLocation("wr_study")].models.always.l6 = "girder_block";
				Locations[FindLocation("wr_study")].locators_radius.box.box9 = 0.5;
				Locations[FindLocation("wr_study")].locators_radius.box.box13 = 0.0001;
			}

			if(CheckAttribute(Pchar,"quest.study_lever4") && Pchar.quest.study_lever4 == "down")
			{
				Pchar.quest.study_teleport = "yes";
				Pchar.quest.study_sound4 = "yes";
				Pchar.quest.study_lever4 = "up";
				Locations[FindLocation("wr_study")].models.always.l4 = "lever4_up";
				Locations[FindLocation("wr_study")].locators_radius.box.box11 = 0.5;
				Locations[FindLocation("wr_study")].locators_radius.box.box15 = 0.0001;
			}

			if(CheckAttribute(Pchar,"quest.study_teleport") && Pchar.quest.study_teleport == "yes")
			{
				if(CheckAttribute(Pchar,"quest.study_position"))
				{
					Locations[FindLocation("wr_study")].image = "";
					if(Pchar.quest.study_position == "8") DoQuestReloadToLocation("wr_study", "goto", "stay8", "study_levers_reset1A");
					if(Pchar.quest.study_position == "9") DoQuestReloadToLocation("wr_study", "goto", "stay9", "study_levers_reset1A");
					if(Pchar.quest.study_position == "10") DoQuestReloadToLocation("wr_study", "goto", "stay10", "study_levers_reset1A");
					if(Pchar.quest.study_position == "11") DoQuestReloadToLocation("wr_study", "goto", "stay11", "study_levers_reset1A");
				}
			}
		break;

		case "study_levers_reset1A":
			Locations[FindLocation("wr_study")].image = "wr_study.tga";
			Pchar.quest.study_teleport = "no";

			if(CheckAttribute(Pchar,"quest.study_sound1") && Pchar.quest.study_sound1 == "yes")
			{
				PlaySound("INTERFACE\shelf_close.wav");
				Pchar.quest.study_sound1 = "no";

				if(CheckAttribute(Pchar,"quest.study_sound2") && Pchar.quest.study_sound2 == "yes")
				{
					LAi_QuestDelay("study_levers_reset2", 3.0);
				}
				else
				{
					if(CheckAttribute(Pchar,"quest.study_sound3") && Pchar.quest.study_sound3 == "yes")
					{
						LAi_QuestDelay("study_levers_reset3", 3.0);
					}
				}
				else
				{
					if(CheckAttribute(Pchar,"quest.study_sound4") && Pchar.quest.study_sound4 == "yes")
					{
						LAi_QuestDelay("study_levers_reset4", 3.0);
					}
				}
			}
			else
			{
				if(CheckAttribute(Pchar,"quest.study_sound2") && Pchar.quest.study_sound2 == "yes")
				{
					PlaySound("INTERFACE\elevator_gate.wav");
					Pchar.quest.study_sound2 = "no";

					if(CheckAttribute(Pchar,"quest.study_sound3") && Pchar.quest.study_sound3 == "yes")
					{
						LAi_QuestDelay("study_levers_reset3", 1.0);
					}
					else
					{
						if(CheckAttribute(Pchar,"quest.study_sound4") && Pchar.quest.study_sound4 == "yes")
						{
							LAi_QuestDelay("study_levers_reset4", 1.0);
						}
					}
				}
			}
			else
			{
				if(CheckAttribute(Pchar,"quest.study_sound3") && Pchar.quest.study_sound3 == "yes")
				{
					PlaySound("INTERFACE\girder_close.wav");
					Pchar.quest.study_sound3 = "no";

					if(CheckAttribute(Pchar,"quest.study_sound4") && Pchar.quest.study_sound4 == "yes")
					LAi_QuestDelay("study_levers_reset4", 2.0);
				}
			}
			else
			{
				if(CheckAttribute(Pchar,"quest.study_sound4") && Pchar.quest.study_sound4 == "yes")
				{
					PlaySound("INTERFACE\key_lock.wav");
					Pchar.quest.study_sound4 = "no";
				}
			}


			if(CheckAttribute(Pchar,"quest.study_teleport_check") && Pchar.quest.study_teleport_check == "yes")
			{
				Pchar.quest.study_teleport_check = "no";
				LAi_SetActorType(Pchar);
				LAi_ActorTurnToLocator(Pchar, "reload", "reload2");

				LAi_QuestDelay("study_levers_reset1B", 1.0);
			}
		break;

		case "study_levers_reset1B":
			LAi_SetPlayerType(Pchar);
		break;

		case "study_levers_reset2":
			PlaySound("INTERFACE\elevator_gate.wav");
			Pchar.quest.study_sound2 = "no";

			if(CheckAttribute(Pchar,"quest.study_sound3") && Pchar.quest.study_sound3 == "yes")
			LAi_QuestDelay("study_levers_reset3", 1.0);
		break;

		case "study_levers_reset3":
			PlaySound("INTERFACE\girder_close.wav");
			Pchar.quest.study_sound3 = "no";

			if(CheckAttribute(Pchar,"quest.study_sound4") && Pchar.quest.study_sound4 == "yes")
			LAi_QuestDelay("study_levers_reset4", 2.0);
		break;

		case "study_levers_reset4":
			PlaySound("INTERFACE\key_lock.wav");
			Pchar.quest.study_sound4 = "no";
		break;
	//.......................................................................................................
		case "fill_secret_box":
			Pchar.quest.drawing_kit = "none";

			locations[FindLocation(Pchar.location)].box1.items.red_uniform = 1;	//mycket snygg kostym, ihoplagd, aldrig använd
			locations[FindLocation(Pchar.location)].box1.items.sextant = 1;		//kvadrant
			locations[FindLocation(Pchar.location)].box1.items.tin_jug = 1;		//liten tennkanna
			locations[FindLocation(Pchar.location)].box1.items.tobacco = 3;		//flera tobaksflätor
			locations[FindLocation(Pchar.location)].box1.items."pistol9+2" = 2;	//2 par mycket vackra pistoler
			locations[FindLocation(Pchar.location)].box1.items.silver_bar = 1;	//silvertacka
			locations[FindLocation(Pchar.location)].box1.items.clock1 = 1;		//gammal spansk klocka och (1 el 2 itms)
 			locations[FindLocation(Pchar.location)].box1.items.foreign_items = 1;	//några andra småsaker av ringa värde
			locations[FindLocation(Pchar.location)].box1.items.drawing_kit = 1;	//cirkelbestick av mässing
			locations[FindLocation(Pchar.location)].box1.items.strange_shells = 1;	//5 el 6 underliga snäckor
			locations[FindLocation(Pchar.location)].box1.items.package = 1;		//gammal sjömanskappa, med oljedukspaket (karta + anteckningsbok)
			locations[FindLocation(Pchar.location)].box1.items.temp_purse = 2660;	//påse med pengar

	//		LAi_QuestDelay("red_uniform", 0.1);

			pchar.quest.drawing_room.win_condition.l1 = "location";
			pchar.quest.drawing_room.win_condition.l1.location = "ck_drawing_room";
			pchar.quest.drawing_room.win_condition = "drawing_room";
		break;

		case "secret_room_finished_check":
			if(CheckAttribute(Pchar,"quest.study_notebook") && Pchar.quest.study_notebook == "yes")
			{
				if(CheckAttribute(Pchar,"quest.red_uniform") && Pchar.quest.red_uniform == "yes")
				{
					if(CheckCharacterItem(Pchar,"mapBB1"))
					{
						Locations[FindLocation("wr_library")].reload.l4.disable = 0;
						locations[FindLocation("ck_drawing_room")].id.label = "Caroline K's drawing room";
						AddQuestRecord("Secrets", "8");
						CloseQuestHeader("Secrets");			

						LAi_QuestDelay("secret_room_finished", 0.1);
					}
				}
			}
		break;

		case "secret_room_finished":
			PlaySound("VOICE\ENGLISH\blaze_lets_go.wav");
			Logit(LanguageConvertString(tmpLangFileID,"It's time to go downstairs and visit Caroline in her Drawing Room."));

		break;

	/*
		case "red_uniform":
			if(IsEquipCharacterByItem(Pchar, "red_uniform"))
			{
				PlaySound("PEOPLE\clothes1.wav");
				TakeItemFromCharacter(Pchar, "red_uniform");
				Pchar.quest.red_uniform = "yes";

				if(CheckAttribute(Pchar,"model"))
				{
					switch(Pchar.model)
					{
						case "Pira4M_TUS_a":
							SetModel(PChar, "ShkiperM_U_a", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);
						break;

						case "Pira4M_TUS_b":
							SetModel(PChar, "ShkiperM_U_b", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);
						break;

						case "Pira4M_TUS":
							SetModel(PChar, "ShkiperM_U", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);
						break;
					}
				}

				LAi_QuestDelay("red_uniform1", 1.0);
			}
			else LAi_QuestDelay("red_uniform", 0.5);	//loops until uniform is picked up
		break;

		case "red_uniform1":
			PlaySound("VOICE\ENGLISH\blaze_very_nice.wav");

			if(CheckCharacterItem(Pchar,"mapBB1"))
			{
				if(CheckAttribute(Pchar,"quest.study_notebook") && Pchar.quest.study_notebook == "yes")
				{
					Locations[FindLocation("wr_library")].reload.l4.disable = 0;
					locations[FindLocation("ck_drawing_room")].id.label = "Caroline K's drawing room";
					AddQuestRecord("Secrets", "8");
					CloseQuestHeader("Secrets");
				}
			}
		break;
	
//package B
	
		case "package1":
			if(CheckCharacterItem(Pchar,"folding_knife"))
			{
				LAi_QuestDelay("package2", 0.1);
			}
			else LAi_QuestDelay("package1", 0.5);
		break;

		case "package2":
			if(IsEquipCharacterByItem(Pchar, "folding_knife"))
			{
				PlaySound("INTERFACE\water_tap.wav");
				LAi_QuestDelay("package3", 0.3);
			}
			else LAi_QuestDelay("package2", 0.5);		//loops until equipped
		break;

		case "package3":
			PlaySound("INTERFACE\button1.wav");

			LAi_QuestDelay("package3A", 1.0);
		break;

		case "package3A":
			if(CheckCharacterItem(Pchar,"package"))
			{
				LAi_SetFightMode(Pchar, true)

				LAi_QuestDelay("package4", 0.1);
			}
			else LAi_QuestDelay("package3A", 0.5);
		break;

		case "package4":
			if(LAi_IsFightMode(Pchar))
			{
				LAi_SetstayType(Pchar);

				LAi_QuestDelay("package5", 0.5);

			}
			else LAi_QuestDelay("package4", 0.5);
		break;

		case "package5":
			PlaySound("OBJECTS\SHIPCHARGE\sail_damage1.wav");
			PlaySound("OBJECTS\SHIPCHARGE\sail_damage1.wav");
			PlaySound("OBJECTS\SHIPCHARGE\sail_damage1.wav");

			LAi_QuestDelay("package6", 1.0);
		break;

		case "package6":
			PlaySound("INTERFACE\paper.wav");

			LAi_QuestDelay("package7", 1.0);
		break;

		case "package7":
			TakeItemFromCharacter(Pchar, "package");
			GiveItem2Character(Pchar, "notebook");
			GiveItem2Character(Pchar, "sealed_map");
			LAi_SetFightMode(PChar, false);

			LAi_QuestDelay("package8", 1.0);
		break;

		case "package8":
			AddQuestRecord("Secrets", "6");
			LAi_SetPlayerType(Pchar);

			PlaySound("VOICE\ENGLISH\blaze_hah.wav");
			Logit(LanguageConvertString(tmpLangFileID,"I have opened the package - let's see what's inside!"));

			LAi_QuestDelay("package9", 1.0);
		break;

		case "notebook":
			//from examine check items.c (IF)

			Pchar.quest.study_notebook = "yes";

			PlaySound("INTERFACE\notebook_01.wav");

			SetQuestHeader("Benjamin_Hornigold");
			AddQuestRecord("Benjamin_Hornigold", "1");
			CloseQuestHeader("Benjamin_Hornigold");

			SetQuestHeader("Caesar");
			AddQuestRecord("Caesar", "1");

			SetQuestHeader("Israel_Hands");
			AddQuestRecord("Israel_Hands", "1");

			SetQuestHeader("Charles_Eden");
			AddQuestRecord("Charles_Eden", "1");

			SetQuestHeader("Richards");
			AddQuestRecord("Richards", "1");

			SetQuestHeader("Johnson");
			AddQuestRecord("Johnson", "1");		//blank

			PlaySound("INTERFACE\notebook_01.wav");

			if(CheckCharacterItem(Pchar,"mapBB1"))
			{
				if(CheckAttribute(Pchar,"quest.red_uniform") && Pchar.quest.red_uniform == "yes")
				{
					Locations[FindLocation("wr_library")].reload.l4.disable = 0;
					locations[FindLocation("ck_drawing_room")].id.label = "Caroline K's drawing room";
					AddQuestRecord("Secrets", "8");
					CloseQuestHeader("Secrets");
				}
			}

			LAi_QuestDelay("notebook1", 1.0);
		break;

		case "notebook1":
			PlaySound("VOICE\ENGLISH\blaze_mhm.wav");
		break;

		case "package9":
			if(LAi_IsFightMode(Pchar))
			{
				LAi_SetstayType(Pchar);

				LAi_QuestDelay("package10", 0.5);

			}
			else LAi_QuestDelay("package9", 0.5);
		break;

		case "package10":
			PlaySound("OBJECTS\SHIPCHARGE\sail_damage1.wav");
			PlaySound("OBJECTS\SHIPCHARGE\sail_damage1.wav");
			PlaySound("OBJECTS\SHIPCHARGE\sail_damage1.wav");

			LAi_QuestDelay("package11", 1.0);
		break;

		case "package11":
			PlaySound("INTERFACE\paper.wav");

			LAi_QuestDelay("package12", 1.0);
		break;

		case "package12":
			TakeItemFromCharacter(Pchar, "sealed_map");
			GiveItem2Character(Pchar, "mapBB1");
		
			LAi_SetFightMode(PChar, false);

			if(CheckAttribute(Pchar,"quest.study_notebook") && Pchar.quest.study_notebook == "yes")
			{
				if(CheckAttribute(Pchar,"quest.red_uniform") && Pchar.quest.red_uniform == "yes")
				{
					Locations[FindLocation("wr_library")].reload.l4.disable = 0;
					locations[FindLocation("ck_drawing_room")].id.label = "Caroline K's drawing room";
					AddQuestRecord("Secrets", "8");
					CloseQuestHeader("Secrets");
				}
			}

			LAi_QuestDelay("package13", 1.0);
		break;

		case "package13":
			AddQuestRecord("Secrets", "7");
			LAi_SetPlayerType(Pchar);

			PlaySound("OBJECTS\DUEL\man_attack6.wav");
			Logit(LanguageConvertString(tmpLangFileID,"I have opened the sealed paper - let's see what it is!"));
		break;
	*/

	//.......................................................................................................
		case "drawing_room":
			DeleteQuestHeader("Secrets");

			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			if(CheckCharacterItem(Pchar,"blade1") || CheckCharacterItem(Pchar,"blade1-1") || CheckCharacterItem(Pchar,"blade1-2"))
			{
				//do nothing
			}
			else GiveItem2Character(Pchar, "blade1");

			if(CheckCharacterItem(Pchar,"blade1")) EquipCharacterByItem(Pchar, "blade1");
			if(CheckCharacterItem(Pchar,"blade1-1")) EquipCharacterByItem(Pchar, "blade1-1");
			if(CheckCharacterItem(Pchar,"blade1-2")) EquipCharacterByItem(Pchar, "blade1-2");

			if(!IsEquipCharacterByItem(Pchar, "ammobag2"))
			{
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				if(!CheckCharacterItem(Pchar,"pistol20")) GiveItem2Character(Pchar, "pistol20");
				EquipCharacterByItem(Pchar, "pistol20");
				if(!CheckCharacterItem(Pchar,"ammobag2")) GiveItem2Character(Pchar, "ammobag2");
				EquipCharacterByItem(Pchar, "ammobag2");
				TakeItemFromCharacter(Pchar, "ammobag1");

				SetModel(Pchar, "ShkiperM_U_a", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
				//just in case
			}
		//..........................................................................................

			if (makeint(pchar.money) < 2743)
			{
				pchar.money = 0; pchar.money = 2743;
			}

			int p9 = GetCharacterItem(Pchar, "pistol9+2");
			if(p9 < 2)
			{
				TakeItemFromCharacter(Pchar, "pistol9+2"); TakeNItems(Pchar,"pistol9+2", 2);
			}

			int tob = GetCharacterItem(Pchar, "tobacco");
			if(tob < 4)
			{
				TakeNItems(Pchar,"tobacco", -3); TakeNItems(Pchar,"tobacco", 4);
			}

			if(!CheckCharacterItem(Pchar,"mapBB1")) GiveItem2Character(Pchar, "mapBB1");
			if(!CheckCharacterItem(Pchar,"bladeA5")) GiveItem2Character(Pchar, "bladeA5");
			if(!CheckCharacterItem(Pchar,"spyglass3")) GiveItem2Character(Pchar, "spyglass3");
			if(!CheckCharacterItem(Pchar,"sewing_kit")) GiveItem2Character(Pchar, "sewing_kit");
			if(!CheckCharacterItem(Pchar,"folding_knife")) GiveItem2Character(Pchar, "folding_knife");
			if(!CheckCharacterItem(Pchar,"compass1")) GiveItem2Character(Pchar, "compass1");
			if(!CheckCharacterItem(Pchar,"pistoltinderbox")) GiveItem2Character(Pchar, "pistoltinderbox");
			if(!CheckCharacterItem(Pchar,"sextant")) GiveItem2Character(Pchar, "sextant");
			if(!CheckCharacterItem(Pchar,"tin_jug")) GiveItem2Character(Pchar, "tin_jug");
			if(!CheckCharacterItem(Pchar,"silver_bar")) GiveItem2Character(Pchar, "silver_bar");
			if(!CheckCharacterItem(Pchar,"clock1")) GiveItem2Character(Pchar, "clock1");
			if(!CheckCharacterItem(Pchar,"foreign_items")) GiveItem2Character(Pchar, "foreign_items");
			if(!CheckCharacterItem(Pchar,"drawing_kit")) GiveItem2Character(Pchar, "drawing_kit");
			if(!CheckCharacterItem(Pchar,"strange_shells")) GiveItem2Character(Pchar, "strange_shells");

			Pchar.quest.clear_study_boxes = "yes";
			RemoveCharacterEquip(CharacterFromID("Woodes Rogers"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(CharacterFromID("Woodes Rogers"), "bladeA5");

			Pchar.quest.medicine_quest = "something_else";
			Pchar.quest.med_Selkirk = "something_else";

		//..........................................................................................

			pchar.quest.drawing_room0.win_condition.l1 = "locator";
			pchar.quest.drawing_room0.win_condition.l1.location = "ck_drawing_room";
			pchar.quest.drawing_room0.win_condition.l1.locator_group = "goto";
			pchar.quest.drawing_room0.win_condition.l1.locator = "goto8";
			pchar.quest.drawing_room0.win_condition = "drawing_room0";
		break;

		case "drawing_room0":
			Pchar.quest.booty_money = "no";
			Pchar.quest.booty_bladeA5 = "no";
			Pchar.quest.booty_uniform = "no";
			Pchar.quest.booty_spyglass3 = "no";
			Pchar.quest.booty_sewing_kit = "no";
			Pchar.quest.booty_tobacco = "no";
			Pchar.quest.booty_folding_knife = "no";
			Pchar.quest.booty_compass1 = "no";
			Pchar.quest.booty_pistoltinderbox = "no";
			Pchar.quest.booty_sextant = "no";
			Pchar.quest.booty_tin_jug = "no";
			Pchar.quest.booty_pistol9 = "no";
			Pchar.quest.booty_silver_bar = "no";
			Pchar.quest.booty_clock1 = "no";
			Pchar.quest.booty_foreign_items = "no";
			Pchar.quest.booty_drawing_kit = "no";
			Pchar.quest.booty_strange_shells = "no";

			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToCharacter(characterFromID("Wench3"), PChar);
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
			Characters[GetCharacterIndex("Wench3")].dialog.CurrentNode  = "you_found_the_chest";
		break;

		case "drawing_room1":
			//from Caroline dialog
			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_ActorDialog(characterFromID("grandma"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("grandma"));
			Characters[GetCharacterIndex("grandma")].dialog.CurrentNode  = "divide_the_booty";
		break;

		case "grandma_booty_sit1":
			//from grandma dialog "divide_the_booty"
			PlaySound("AMBIENT\SHOP\sigh1.wav");

			LAi_SetStayType(characterFromID("Wench3"));
			LAi_SetSitType(CharacterFromID("grandma"));
			ChangeCharacterAddressGroup(characterFromID("Grandma"), "ck_drawing_room", "sit", "sit1");
		break;

		case "grandma_booty_map":
			//from Grandma dialog
			PlaySound("INTERFACE\paper.wav");

			LAi_QuestDelay("grandma_booty_sit2", 1.0);
		break;

		case "grandma_booty_money":
			//from Grandma dialog
			PlaySound("INTERFACE\coins7.wav");

			if(CheckAttribute(Pchar,"quest.grandma_booty") && Pchar.quest.grandma_booty == 1)
			{
				LAi_QuestDelay("grandma_booty_sit3", 1.0);
			}
			else LAi_QuestDelay("grandma_booty_sit4", 1.0);
		break;

		case "grandma_booty_bladeA5":
			//from Grandma dialog
			PlaySound("OBJECTS\DUEL\sabre_sh.wav");
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			EquipCharacterByItem(Pchar, "bladeA5");
			TakeItemFromCharacter(Pchar, "blade1");
			TakeItemFromCharacter(Pchar, "blade1-1");
			TakeItemFromCharacter(Pchar, "blade1-2");

			if(CheckAttribute(Pchar,"quest.grandma_booty") && Pchar.quest.grandma_booty == 1)
			{
				LAi_QuestDelay("grandma_booty_sit3", 1.0);
			}
			else LAi_QuestDelay("grandma_booty_sit4", 1.0);
		break;

		case "grandma_booty_spyglass3":
			//from Grandma dialog
			EquipCharacterbyItem(Pchar, "spyglass3");
			PlaySound("OBJECTS\duel\spyglass.wav");

			if(CheckAttribute(Pchar,"quest.grandma_booty") && Pchar.quest.grandma_booty == 1)
			{
				LAi_QuestDelay("grandma_booty_sit3", 1.0);
			}
			else LAi_QuestDelay("grandma_booty_sit4", 1.0);
		break;

		case "grandma_booty_folding_knife":
			//from Grandma dialog
			PlaySound("INTERFACE\water_tap.wav");

			if(CheckAttribute(Pchar,"quest.grandma_booty") && Pchar.quest.grandma_booty == 1)
			{
				LAi_QuestDelay("grandma_booty_sit3", 1.0);
			}
			else LAi_QuestDelay("grandma_booty_sit4", 1.0);
		break;

		case "grandma_booty_folding_knife1":
			PlaySound("INTERFACE\button1.wav");

			if(CheckAttribute(Pchar,"quest.grandma_booty") && Pchar.quest.grandma_booty == 1)
			{
				LAi_QuestDelay("grandma_booty_sit3", 1.0);
			}
			else LAi_QuestDelay("grandma_booty_sit4", 1.0);
		break;

		case "grandma_booty_compass1":
			//from Grandma dialog
			PlaySound("INTERFACE\button1.wav");

			if(CheckAttribute(Pchar,"quest.grandma_booty") && Pchar.quest.grandma_booty == 1)
			{
				LAi_QuestDelay("grandma_booty_sit3", 1.0);
			}
			else LAi_QuestDelay("grandma_booty_sit4", 1.0);
		break;

		case "grandma_booty_pistoltinderbox":
			//from Grandma dialog
			PlaySound("OBJECTS\duel\GI_ValidClick.wav");

			if(CheckAttribute(Pchar,"quest.grandma_booty") && Pchar.quest.grandma_booty == 1)
			{
				LAi_QuestDelay("grandma_booty_sit3", 1.0);
			}
			else LAi_QuestDelay("grandma_booty_sit4", 1.0);
		break;

		case "grandma_booty_sextant":
			//from Grandma dialog
			PlaySound("INTERFACE\pinion_take.wav");

			if(CheckAttribute(Pchar,"quest.grandma_booty") && Pchar.quest.grandma_booty == 1)
			{
				LAi_QuestDelay("grandma_booty_sit3", 1.0);
			}
			else LAi_QuestDelay("grandma_booty_sit4", 1.0);
		break;

		case "grandma_booty_tin_jug":
			//from Grandma dialog
			PlaySound("PEOPLE\step_iron.wav");

			if(CheckAttribute(Pchar,"quest.grandma_booty") && Pchar.quest.grandma_booty == 1)
			{
				LAi_QuestDelay("grandma_booty_sit3", 1.0);
			}
			else LAi_QuestDelay("grandma_booty_sit4", 1.0);
		break;

		case "grandma_booty_pistol9":
			//from Grandma dialog
			PlaySound("OBJECTS\duel\reload1.wav");

			LAi_QuestDelay("grandma_booty_pistol9_1", 0.5);
		break;

		case "grandma_booty_pistol9_1":
			PlaySound("OBJECTS\duel\reload1.wav");

			if(CheckAttribute(Pchar,"quest.grandma_booty") && Pchar.quest.grandma_booty == 1)
			{
				LAi_QuestDelay("grandma_booty_sit3", 1.0);
			}
			else LAi_QuestDelay("grandma_booty_sit4", 1.0);
		break;

		case "grandma_booty_silver_bar":
			//from Grandma dialog
			PlaySound("INTERFACE\pinion_place.wav");

			if(CheckAttribute(Pchar,"quest.grandma_booty") && Pchar.quest.grandma_booty == 1)
			{
				LAi_QuestDelay("grandma_booty_sit3", 1.0);
			}
			else LAi_QuestDelay("grandma_booty_sit4", 1.0);
		break;

		case "grandma_booty_clock1":
			//from Grandma dialog
			PlaySound("INTERFACE\clock_small.wav");

			if(CheckAttribute(Pchar,"quest.grandma_booty") && Pchar.quest.grandma_booty == 1)
			{
				LAi_QuestDelay("grandma_booty_sit3", 1.0);
			}
			else LAi_QuestDelay("grandma_booty_sit4", 1.0);
		break;

		case "grandma_booty_foreign_items":
			//from Grandma dialog
			PlaySound("AMBIENT\TAVERN\drop6.wav");
			PlaySound("AMBIENT\TAVERN\drop6.wav");

			if(CheckAttribute(Pchar,"quest.grandma_booty") && Pchar.quest.grandma_booty == 1)
			{
				LAi_QuestDelay("grandma_booty_sit3", 1.0);
			}
			else LAi_QuestDelay("grandma_booty_sit4", 1.0);
		break;

		case "grandma_booty_drawing_kit":
			//from Grandma dialog
			PlaySound("AMBIENT\RESIDENCE\some1.wav");

			if(CheckAttribute(Pchar,"quest.grandma_booty") && Pchar.quest.grandma_booty == 1)
			{
				LAi_QuestDelay("grandma_booty_sit3", 1.0);
			}
			else LAi_QuestDelay("grandma_booty_sit4", 1.0);
		break;

		case "grandma_booty_strange_shells":
			//from Grandma dialog
			PlaySound("AMBIENT\TAVERN\tinkle2.wav");
			PlaySound("AMBIENT\TAVERN\tinkle2.wav");

			if(CheckAttribute(Pchar,"quest.grandma_booty") && Pchar.quest.grandma_booty == 1)
			{
				LAi_QuestDelay("grandma_booty_sit3", 1.0);
			}
			else LAi_QuestDelay("grandma_booty_sit4", 1.0);
		break;
	//.......................................................................................................
		case "grandma_booty_sit2":
			//from map choice
			PlaySound("AMBIENT\SHOP\sigh1.wav");

			LAi_SetSitType(CharacterFromID("grandma"));
			ChangeCharacterAddressGroup(characterFromID("Grandma"), "ck_drawing_room", "sit", "sit1");
		break;

		case "grandma_booty_sit3":
			//from booty choice nr2
			PlaySound("AMBIENT\SHOP\sigh1.wav");

			LAi_SetSitType(CharacterFromID("grandma"));
			ChangeCharacterAddressGroup(characterFromID("Grandma"), "ck_drawing_room", "sit", "sit1");
		break;

		case "grandma_booty_sit4":
			//from booty choice nr3
			PlaySound("PEOPLE\fart1.wav");

			LAi_SetSitType(CharacterFromID("grandma"));
			ChangeCharacterAddressGroup(characterFromID("Grandma"), "ck_drawing_room", "sit", "sit1");

			LAi_QuestDelay("grandma_booty_sit5", 1.0);
		break;
	//.......................................................................................................
		case "grandma_booty_sit5":
			PlaySound("VOICE\ENGLISH\gr_wench3_oh.wav");
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToCharacter(characterFromID("Wench3"), characterFromID("grandma"));
			LAi_SetActorType(characterFromID("Minerva"));
			LAi_ActorTurnToCharacter(characterFromID("Minerva"), characterFromID("grandma"));

			LAi_QuestDelay("grandma_booty_sit6", 1.0);
		break;

		case "grandma_booty_sit6":
			PlaySound("PEOPLE\laugh1.wav");

			LAi_QuestDelay("grandma_booty_sit7", 1.0);
		break;

		case "grandma_booty_sit7":
			LAi_SetStayType(characterFromID("Wench3"));

			if(CheckAttribute(Pchar,"quest.booty_money") && Pchar.quest.booty_money == "no")
			{

				AddMoneyToCharacter(Pchar,-2743);
			}
			if(CheckAttribute(Pchar,"quest.booty_bladeA5") && Pchar.quest.booty_bladeA5 == "no")
			{
				if(IsEquipCharacterByItem(Pchar, "bladeA5"))
				{
					RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				}
				TakeItemFromCharacter(Pchar, "bladeA5");

				if(CheckCharacterItem(Pchar,"blade1")) EquipCharacterByItem(Pchar, "blade1");
				if(CheckCharacterItem(Pchar,"blade1-1")) EquipCharacterByItem(Pchar, "blade1-1");
				if(CheckCharacterItem(Pchar,"blade1-2")) EquipCharacterByItem(Pchar, "blade1-2");
			}
			else
			{
				TakeItemFromCharacter(Pchar, "blade1");
				TakeItemFromCharacter(Pchar, "blade1-1");
				TakeItemFromCharacter(Pchar, "blade1-2");

			}
			if(CheckAttribute(Pchar,"quest.booty_spyglass3") && Pchar.quest.booty_spyglass3 == "no")
			{
				if(IsEquipCharacterByItem(Pchar, "spyglass3"))
				{
					RemoveCharacterEquip(Pchar, SPYGLASS_ITEM_TYPE);
				}
				TakeItemFromCharacter(Pchar, "spyglass3");

				if(CheckCharacterItem(Pchar,"spyglass1")) EquipCharacterByItem(Pchar, "spyglass1");
				if(CheckCharacterItem(Pchar,"spyglass2")) EquipCharacterByItem(Pchar, "spyglass2");
				if(CheckCharacterItem(Pchar,"spyglass3")) EquipCharacterByItem(Pchar, "spyglass3");
				if(CheckCharacterItem(Pchar,"spyglass4")) EquipCharacterByItem(Pchar, "spyglass4");
			}
			else
			{
				RemoveCharacterEquip(Pchar, SPYGLASS_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "spyglass1");
				TakeItemFromCharacter(Pchar, "spyglass2");
				EquipCharacterByItem(Pchar, "spyglass3");
			}

			if(CheckAttribute(Pchar,"quest.booty_folding_knife") && Pchar.quest.booty_folding_knife == "no")
			{
				if(IsEquipCharacterByItem(Pchar, "folding_knife"))
				{
					RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				}
				TakeItemFromCharacter(Pchar, "folding_knife");

				if(CheckCharacterItem(Pchar,"blade1")) EquipCharacterByItem(Pchar, "blade1");
				if(CheckCharacterItem(Pchar,"blade1-1")) EquipCharacterByItem(Pchar, "blade1-1");
				if(CheckCharacterItem(Pchar,"blade1-2")) EquipCharacterByItem(Pchar, "blade1-2");
				if(CheckCharacterItem(Pchar,"bladeA5")) EquipCharacterByItem(Pchar, "bladeA5");
			}
			if(CheckAttribute(Pchar,"quest.booty_compass1") && Pchar.quest.booty_compass1 == "no")
			{
				TakeItemFromCharacter(Pchar, "compass1");
			}
			if(CheckAttribute(Pchar,"quest.booty_pistoltinderbox") && Pchar.quest.booty_pistoltinderbox == "no")
			{
				if(IsEquipCharacterByItem(Pchar, "pistoltinderbox"))
				{
					RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				}
				TakeItemFromCharacter(Pchar, "pistoltinderbox");

				EquipCharacterByItem(Pchar, "pistol20");
				if(!CheckCharacterItem(Pchar,"ammobag2")) GiveItem2Character(Pchar, "ammobag2");
				EquipCharacterByItem(Pchar, "ammobag2");
				TakeItemFromCharacter(Pchar, "ammobag1");

				SetModel(Pchar, "ShkiperM_U_a", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
			}
			if(CheckAttribute(Pchar,"quest.booty_sextant") && Pchar.quest.booty_sextant == "no")
			{
				TakeItemFromCharacter(Pchar, "sextant");
			}
			if(CheckAttribute(Pchar,"quest.booty_tin_jug") && Pchar.quest.booty_tin_jug == "no")
			{
				TakeItemFromCharacter(Pchar, "tin_jug");
			}
			if(CheckAttribute(Pchar,"quest.booty_pistol9") && Pchar.quest.booty_pistol9 == "no")
			{
					if(IsEquipCharacterByItem(Pchar, "pistol9+2"))
					{
						RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
					}
					TakeNItems(Pchar,"pistol9+2", -2);

					EquipCharacterByItem(Pchar, "pistol20");
					if(!CheckCharacterItem(Pchar,"ammobag2")) GiveItem2Character(Pchar, "ammobag2");
					EquipCharacterByItem(Pchar, "ammobag2");
					TakeItemFromCharacter(Pchar, "ammobag1");

					SetModel(Pchar, "ShkiperM_U_a", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
			}
			if(CheckAttribute(Pchar,"quest.booty_silver_bar") && Pchar.quest.booty_silver_bar == "no")
			{
				TakeItemFromCharacter(Pchar, "silver_bar");
			}
			if(CheckAttribute(Pchar,"quest.booty_clock1") && Pchar.quest.booty_clock1 == "no")
			{
				TakeItemFromCharacter(Pchar, "clock1");
			}
			if(CheckAttribute(Pchar,"quest.booty_foreign_items") && Pchar.quest.booty_foreign_items == "no")
			{
				TakeItemFromCharacter(Pchar, "foreign_items");
			}
			if(CheckAttribute(Pchar,"quest.booty_drawing_kit") && Pchar.quest.booty_drawing_kit == "no")
			{
				TakeItemFromCharacter(Pchar, "drawing_kit");
			}
			if(CheckAttribute(Pchar,"quest.booty_strange_shells") && Pchar.quest.booty_strange_shells == "no")
			{
				TakeItemFromCharacter(Pchar, "strange_shells");
			}

			LAi_QuestDelay("grandma_future_plans", 1.0);
		break;

		case "grandma_future_plans":
			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_ActorDialog(characterFromID("grandma"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("grandma"));
			Characters[GetCharacterIndex("grandma")].dialog.CurrentNode  = "future_plans";
		break;

		case "grandma_future_plans0":
			//from grandma dialog
			PlaySound("VOICE\ENGLISH\Eng_m_c_074.wav");

			LAi_SetStayType(CharacterFromID("Selkirk"));
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "ck_drawing_room", "goto", "stay5");

			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_ActorTurnToCharacter(CharacterFromID("grandma"), characterFromID("Selkirk"));
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToCharacter(characterFromID("Wench3"), characterFromID("Selkirk"));
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Selkirk"));

			LAi_QuestDelay("grandma_future_plans1", 3.5);
		break;

		case "grandma_future_plans1":
			PlaySound("PEOPLE\step_stairway2.wav");
			LAi_SetSitType(CharacterFromID("Selkirk"));
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "ck_drawing_room", "sit", "sit5");

			LAi_SetStayType(CharacterFromID("Dave Edna"));
			ChangeCharacterAddressGroup(characterFromID("Dave Edna"), "ck_drawing_room", "goto", "stay4");

			LAi_QuestDelay("grandma_future_plans1A", 0.5);
		break;

		case "grandma_future_plans1A":
			LAi_SetActorType(characterFromID("Dave Edna"));
			LAi_ActorDialog(characterFromID("Dave Edna"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Dave Edna"));
			Characters[GetCharacterIndex("Dave Edna")].dialog.CurrentNode  = "ship_not_equipped";
		break;

		case "grandma_future_plans2":
			//from Dave dialog
			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_ActorDialog(characterFromID("grandma"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("grandma"));
			Characters[GetCharacterIndex("grandma")].dialog.CurrentNode  = "skip_ships";
		break;

		case "grandma_future_plans3":
			//from grandma dialog
			PlaySound("VOICE\ENGLISH\Dave_Edna_2.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Dave Edna"));

			LAi_QuestDelay("grandma_future_plans4", 3.5);
		break;

		case "grandma_future_plans4":
			PlaySound("PEOPLE\step_stairway2.wav");
			LAi_SetSitType(CharacterFromID("Dave Edna"));
			ChangeCharacterAddressGroup(characterFromID("Dave Edna"), "ck_drawing_room", "sit", "sit4");

			LAi_SetSitType(CharacterFromID("grandma"));
			ChangeCharacterAddressGroup(characterFromID("Grandma"), "ck_drawing_room", "sit", "sit1");

			LAi_QuestDelay("grandma_future_plans5", 1.0);
		break;

		case "grandma_future_plans5":
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToCharacter(characterFromID("Wench3"), PChar);
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
			Characters[GetCharacterIndex("Wench3")].dialog.CurrentNode  = "what_about_the_store";
		break;

		case "grandma_future_plans6":
			//from Caroline dialog
			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_ActorDialog(characterFromID("grandma"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("grandma"));
			Characters[GetCharacterIndex("grandma")].dialog.CurrentNode  = "Minerva_store";
		break;

		case "grandma_future_plans7":
			//from grandma dialog
			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_ActorTurnToCharacter(characterFromID("grandma"), characterFromID("Minerva"));
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Minerva"));
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorTurnToCharacter(characterFromID("Wench3"), characterFromID("Minerva"));

			LAi_QuestDelay("grandma_future_plans8", 1.0);
		break;

		case "grandma_future_plans8":
			LAi_SetActorType(characterFromID("Minerva"));
			LAi_ActorDialog(characterFromID("Minerva"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Minerva"));
			Characters[GetCharacterIndex("Minerva")].dialog.CurrentNode  = "thanks_for_the_shop";
		break;

//--------------------------------------------------------------------------------------------------------------------
//farm, sloop here? grandma dialog

		case "grandma_farm_sloop":
			//from Caroline dialog
			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_ActorDialog(characterFromID("grandma"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("grandma"));
			Characters[GetCharacterIndex("grandma")].dialog.CurrentNode  = "farm_sloop";
		break;
//--------------------------------------------------------------------------------------------------------------------

		case "grandma_future_plans9":
			//from Minerva dialog
			//No, from grandma farm sloop dialog
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorDialog(characterFromID("Selkirk"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Selkirk"));
			Characters[GetCharacterIndex("Selkirk")].dialog.CurrentNode  = "no_crew";
		break;

		case "grandma_future_plans10":
			//from Selkirk dialog
			PlaySound("PEOPLE\step_stairway2.wav");
			LAi_SetSitType(CharacterFromID("Selkirk"));
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "ck_drawing_room", "sit", "sit5");

			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_ActorDialog(characterFromID("grandma"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("grandma"));
			Characters[GetCharacterIndex("grandma")].dialog.CurrentNode  = "Claire_crew";
		break;

		case "grandma_future_plans11":
			//from grandma dialog
			PlaySound("INTERFACE\closet_open.wav");

			LAi_QuestDelay("grandma_future_plans11A", 1.0);
		break;

		case "grandma_future_plans11A":
			//from grandma dialog
			Pchar.quest.med_Claire = "acetum";
			LAi_SetStayType(CharacterFromID("Claire Voyant"));
			ChangeCharacterAddressGroup(characterFromID("Claire Voyant"), "ck_drawing_room", "reload", "reload1");
			PlaySound("VOICE\ENGLISH\claire_fortune.wav");

			LAi_QuestDelay("grandma_future_plans12", 2.0);
		break;

		case "grandma_future_plans12":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Claire Voyant"));

			LAi_QuestDelay("grandma_future_plans12A", 1.0);
		break;

		case "grandma_future_plans12A":
			PlaySound("VOICE\ENGLISH\grandma_4.wav");

			LAi_QuestDelay("grandma_future_plans13", 2.0);
		break;

		case "grandma_future_plans13":
			LAi_SetActorType(CharacterFromID("Claire Voyant"));
			LAi_ActorGoToLocator(CharacterFromID("Claire Voyant"), "goto", "claire1", "grandma_future_plans14", 3.0);
		break;

		case "grandma_future_plans14":
			LAi_SetActorType(CharacterFromID("Claire Voyant"));
			LAi_ActorDialog(characterFromID("Claire Voyant"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Claire Voyant"));
			Characters[GetCharacterIndex("Claire Voyant")].dialog.CurrentNode  = "crew_is_complete";
		break;

		case "grandma_future_plans15":
			//from Claire dialog
			LAi_SetActorType(CharacterFromID("Claire Voyant"));
			LAi_ActorGoToLocator(CharacterFromID("Claire Voyant"), "goto", "goto6", "grandma_future_plans16", 2.0);
		break;

		case "grandma_future_plans16":
			LAi_SetStayType(CharacterFromID("Claire Voyant"));
			ChangeCharacterAddressGroup(characterFromID("Claire Voyant"), "ck_drawing_room", "goto", "goto6");

			LAi_QuestDelay("grandma_future_plans17", 1.0);
		break;

		case "grandma_future_plans17":
			PlaySound("VOICE\ENGLISH\claire_welcome.wav");

			LAi_QuestDelay("grandma_future_plans18", 2.0);
		break;

		case "grandma_future_plans18":
			PlaySound("PEOPLE\run_wood.wav");

			if(makeint(PChar.skill.Leadership)<10)
			ChangeCharacterAddressGroup(characterFromID("gm_crew17"), "ck_drawing_room", "goto", "crewC2");

			if(makeint(PChar.skill.Repair)<10)
			ChangeCharacterAddressGroup(characterFromID("gm_crew2"), "ck_drawing_room", "goto", "crewC3");

			if(makeint(PChar.skill.Sailing)<10)
			ChangeCharacterAddressGroup(characterFromID("gm_crew21"), "ck_drawing_room", "goto", "crewC4");

			if(makeint(PChar.skill.Grappling)<10)
			ChangeCharacterAddressGroup(characterFromID("gm_crew16"), "ck_drawing_room", "goto", "crewC5");

			if(makeint(PChar.skill.Defence)<10)
			ChangeCharacterAddressGroup(characterFromID("gm_crew19"), "ck_drawing_room", "goto", "crewC6");

			if(makeint(PChar.skill.Sneak)<10)
			ChangeCharacterAddressGroup(characterFromID("gm_crew8"), "ck_drawing_room", "goto", "crewC7");

			if(makeint(PChar.skill.Cannons)<10)
			ChangeCharacterAddressGroup(characterFromID("gm_crew23"), "ck_drawing_room", "goto", "crewC8");

			LAi_SetStayType(CharacterFromID("Minerva"));
			LAi_SetStayType(CharacterFromID("wench3"));
			LAi_SetSitType(CharacterFromID("Grandma"));
			ChangeCharacterAddressGroup(characterFromID("Grandma"), "ck_drawing_room", "sit", "sit1");

			LAi_QuestDelay("grandma_future_plans18A", 0.5);
			LAi_QuestDelay("grandma_future_plans19", 1.0);
		break;

		case "grandma_future_plans18A":
			PlaySound("PEOPLE\recoil.wav");
		break;

		case "grandma_future_plans19":
			PlaySound("PEOPLE\run_stone.wav");

			if(makeint(PChar.skill.Commerce)<10)
			ChangeCharacterAddressGroup(characterFromID("gm_crew9"), "ck_drawing_room", "goto", "crewB2");

			if(makeint(PChar.skill.Grappling)<10)
			ChangeCharacterAddressGroup(characterFromID("gm_crew15"), "ck_drawing_room", "goto", "crewB3");

			if(makeint(PChar.skill.Accuracy)<10)
			ChangeCharacterAddressGroup(characterFromID("gm_crew12"), "ck_drawing_room", "goto", "crewB4");

			if(makeint(PChar.skill.Cannons)<10)
			ChangeCharacterAddressGroup(characterFromID("gm_crew13"), "ck_drawing_room", "goto", "crewB5");

			if(makeint(PChar.skill.Sailing)<10)
			ChangeCharacterAddressGroup(characterFromID("gm_crew14"), "ck_drawing_room", "goto", "crewB6");

			if(makeint(PChar.skill.Fencing)<10)
			ChangeCharacterAddressGroup(characterFromID("gm_crew6"), "ck_drawing_room", "goto", "crewB7");

			if(makeint(PChar.skill.Fencing)<10)
			ChangeCharacterAddressGroup(characterFromID("gm_crew7"), "ck_drawing_room", "goto", "crewB8");

			LAi_QuestDelay("grandma_future_plans18A", 0.5);
			LAi_QuestDelay("grandma_future_plans20", 1.0);
		break;

		case "grandma_future_plans20":
			PlaySound("PEOPLE\run_roof.wav");

			ChangeCharacterAddressGroup(characterFromID("gm_crew18"), "ck_drawing_room", "goto", "crewA1");
			ChangeCharacterAddressGroup(characterFromID("gm_crew10"), "ck_drawing_room", "goto", "crewA2");
			ChangeCharacterAddressGroup(characterFromID("gm_crew3"), "ck_drawing_room", "goto", "crewA3");
			ChangeCharacterAddressGroup(characterFromID("gm_crew11"), "ck_drawing_room", "goto", "crewA4");
			ChangeCharacterAddressGroup(characterFromID("gm_crew1"), "ck_drawing_room", "goto", "crewA5");
			ChangeCharacterAddressGroup(characterFromID("gm_crew20"), "ck_drawing_room", "goto", "crewA6");
			ChangeCharacterAddressGroup(characterFromID("gm_crew5"), "ck_drawing_room", "goto", "crewA7");
			ChangeCharacterAddressGroup(characterFromID("gm_crew4"), "ck_drawing_room", "goto", "crewA8");
			ChangeCharacterAddressGroup(characterFromID("gm_crew22"), "ck_drawing_room", "goto", "crewA9");

			Locations[FindLocation("ck_drawing_room")].reload.l1.disable = 1;

			Pchar.quest.gm_officers = 2;				//choose 2 officers
			Pchar.quest.gm_sailors = 3;				//choose 3 sailors

			LAi_QuestDelay("grandma_future_plans18A", 0.5);
			LAi_QuestDelay("caroline_choose_sailors", 1.0);
		break;

		case "caroline_choose_sailors":
			LAi_SetActorType(characterFromID("Wench3"));
			//LAi_ActorTurnToCharacter(characterFromID("Wench3"), PChar);
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
			Characters[GetCharacterIndex("Wench3")].dialog.CurrentNode  = "choose_sailors";
		break;

		case "grandma_choose_officers":
			//from Caroline dialog
			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_ActorDialog(characterFromID("grandma"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("grandma"));
			Characters[GetCharacterIndex("grandma")].dialog.CurrentNode  = "choose_officers";
		break;

		case "claire_crew_lines":
			//from grandma dialog
			LAi_SetSitType(CharacterFromID("Grandma"));
			ChangeCharacterAddressGroup(characterFromID("Grandma"), "ck_drawing_room", "sit", "sit1");

			LAi_SetStayType(CharacterFromID("Wench3"));
			ChangeCharacterAddressGroup(characterFromID("Wench3"), "ck_drawing_room", "goto", "goto3");

			LAi_SetActorType(CharacterFromID("Claire Voyant"));
			LAi_ActorDialog(characterFromID("Claire Voyant"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Claire Voyant"));
			Characters[GetCharacterIndex("Claire Voyant")].dialog.CurrentNode  = "claire_crew_lines";
		break;

		case "pchar_choose_sailors_and_officers":
			//from Claire dialog
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("gm_crew16"));

			LAi_SetStayType(CharacterFromID("Claire Voyant"));
			ChangeCharacterAddressGroup(characterFromID("Claire Voyant"), "ck_drawing_room", "goto", "goto6");

			LAi_QuestDelay("pchar_choose_sailors_and_officers1", 1.0);
		break;

		case "pchar_choose_sailors_and_officers1":
			Logit(LanguageConvertString(tmpLangFileID,"I have 3 sailors left to hire."));

			PlaySound("VOICE\ENGLISH\blaze_hah.wav");

			LAi_SetPlayerType(Pchar);
		break;

//----------------------------------------------------------------------------------------------------------------------------
	//1 boatswain----------------------------------------------------
		case "gm_crew1_convincing_pchar":
			Characters[GetCharacterIndex("gm_crew1")].quest.officertype = "boatswain";
			LaunchOfficer(characterFromID("gm_crew1"));

			LAi_SetActorType(CharacterFromID("gm_crew1"));
			LAi_ActorDialog(characterFromID("gm_crew1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("gm_crew1"));
			Characters[GetCharacterIndex("gm_crew1")].dialog.CurrentNode  = "boatswain2";
		break;
	//3 carpenter-----------------------------------------------------
		case "gm_crew3_convincing_pchar":
			Characters[GetCharacterIndex("gm_crew3")].quest.officertype = "carpenter";
			LaunchOfficer(characterFromID("gm_crew3"));

			LAi_SetActorType(CharacterFromID("gm_crew3"));
			LAi_ActorDialog(characterFromID("gm_crew3"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("gm_crew3"));
			Characters[GetCharacterIndex("gm_crew3")].dialog.CurrentNode  = "carpenter2";
		break;
	//4 doctor--------------------------------------------------------
		case "gm_crew4_convincing_pchar":
			Characters[GetCharacterIndex("gm_crew4")].quest.officertype = "doctor";
			LaunchOfficer(characterFromID("gm_crew4"));

			LAi_SetActorType(CharacterFromID("gm_crew4"));
			LAi_ActorDialog(characterFromID("gm_crew4"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("gm_crew4"));
			Characters[GetCharacterIndex("gm_crew4")].dialog.CurrentNode  = "doctor2";
		break;
	//5 fighter big black---------------------------------------------
		case "gm_crew5_convincing_pchar":
			Characters[GetCharacterIndex("gm_crew5")].quest.officertype = "deck fighter";
			LaunchOfficer(characterFromID("gm_crew5"));

			LAi_SetActorType(CharacterFromID("gm_crew5"));
			LAi_ActorDialog(characterFromID("gm_crew5"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("gm_crew5"));
			Characters[GetCharacterIndex("gm_crew5")].dialog.CurrentNode  = "fighter_big2";
		break;
	//10 gunner-------------------------------------------------------
		case "gm_crew10_convincing_pchar":
			Characters[GetCharacterIndex("gm_crew10")].quest.officertype = "cannoneer";
			LaunchOfficer(characterFromID("gm_crew10"));

			LAi_SetActorType(CharacterFromID("gm_crew10"));
			LAi_ActorDialog(characterFromID("gm_crew10"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("gm_crew10"));
			Characters[GetCharacterIndex("gm_crew10")].dialog.CurrentNode  = "gunner2";
		break;
	//11 fighter spanish----------------------------------------------
		case "gm_crew11_convincing_pchar":
			Characters[GetCharacterIndex("gm_crew11")].quest.officertype = "deck fighter";
			LaunchOfficer(characterFromID("gm_crew11"));

			LAi_SetActorType(CharacterFromID("gm_crew11"));
			LAi_ActorDialog(characterFromID("gm_crew11"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("gm_crew11"));
			Characters[GetCharacterIndex("gm_crew11")].dialog.CurrentNode  = "fighter_spanish2";
		break;
	//18 quartermaster------------------------------------------------
		case "gm_crew18_convincing_pchar":
			Characters[GetCharacterIndex("gm_crew18")].quest.officertype = "quartermaster";
			LaunchOfficer(characterFromID("gm_crew18"));

			LAi_SetActorType(CharacterFromID("gm_crew18"));
			LAi_ActorDialog(characterFromID("gm_crew18"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("gm_crew18"));
			Characters[GetCharacterIndex("gm_crew18")].dialog.CurrentNode  = "quartermaster2";
		break;
	//20 first mate---------------------------------------------------
		case "gm_crew20_convincing_pchar":
			Characters[GetCharacterIndex("gm_crew20")].quest.officertype = "first mate";
			LaunchOfficer(characterFromID("gm_crew20"));

			LAi_SetActorType(CharacterFromID("gm_crew20"));
			LAi_ActorDialog(characterFromID("gm_crew20"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("gm_crew20"));
			Characters[GetCharacterIndex("gm_crew20")].dialog.CurrentNode  = "first_mate2";
		break;
	//22 navigator----------------------------------------------------
		case "gm_crew22_convincing_pchar":
			Characters[GetCharacterIndex("gm_crew22")].quest.officertype = "navigator";
			LaunchOfficer(characterFromID("gm_crew22"));

			LAi_SetActorType(CharacterFromID("gm_crew22"));
			LAi_ActorDialog(characterFromID("gm_crew22"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("gm_crew22"));
			Characters[GetCharacterIndex("gm_crew22")].dialog.CurrentNode  = "navigator2";
		break;
	//--------------------------------------------------------------
		case "gm_officers_complete":
			if(CheckAttribute(Pchar,"quest.gm_officers") && Pchar.quest.gm_officers == 1)
			{
				Logit(LanguageConvertString(tmpLangFileID,"I have 1 officer left to hire."));

				switch(Pchar.quest.gm_chosen_officer)
				{
					case "gm_crew1":
						SetOfficersIndex(Pchar, 1, GetCharacterIndex("gm_crew1"));

						Characters[GetCharacterIndex("gm_crew1")].Dialog.Filename = "Enc_Officer_dialog.c";
						Characters[GetCharacterIndex("gm_crew1")].Dialog.CurrentNode = "Hired";
					break;

					case "gm_crew3":
						SetOfficersIndex(Pchar, 1, GetCharacterIndex("gm_crew3"));

						Characters[GetCharacterIndex("gm_crew3")].Dialog.Filename = "Enc_Officer_dialog.c";
						Characters[GetCharacterIndex("gm_crew3")].Dialog.CurrentNode = "Hired";
					break;

					case "gm_crew4":
						SetOfficersIndex(Pchar, 1, GetCharacterIndex("gm_crew4"));

						Characters[GetCharacterIndex("gm_crew4")].Dialog.Filename = "Enc_Officer_dialog.c";
						Characters[GetCharacterIndex("gm_crew4")].Dialog.CurrentNode = "Hired";
					break;

					case "gm_crew5":
						SetOfficersIndex(Pchar, 1, GetCharacterIndex("gm_crew5"));

						Characters[GetCharacterIndex("gm_crew5")].Dialog.Filename = "Enc_Officer_dialog.c";
						Characters[GetCharacterIndex("gm_crew5")].Dialog.CurrentNode = "Hired";
					break;

					case "gm_crew10":
						SetOfficersIndex(Pchar, 1, GetCharacterIndex("gm_crew10"));

						Characters[GetCharacterIndex("gm_crew10")].Dialog.Filename = "Enc_Officer_dialog.c";
						Characters[GetCharacterIndex("gm_crew10")].Dialog.CurrentNode = "Hired";
					break;

					case "gm_crew11":
						SetOfficersIndex(Pchar, 1, GetCharacterIndex("gm_crew11"));

						Characters[GetCharacterIndex("gm_crew11")].Dialog.Filename = "Enc_Officer_dialog.c";
						Characters[GetCharacterIndex("gm_crew11")].Dialog.CurrentNode = "Hired";
					break;

					case "gm_crew18":
						SetOfficersIndex(Pchar, 1, GetCharacterIndex("gm_crew18"));

						Characters[GetCharacterIndex("gm_crew18")].Dialog.Filename = "Enc_Officer_dialog.c";
						Characters[GetCharacterIndex("gm_crew18")].Dialog.CurrentNode = "Hired";
					break;

					case "gm_crew20":
						SetOfficersIndex(Pchar, 1, GetCharacterIndex("gm_crew20"));

						Characters[GetCharacterIndex("gm_crew20")].Dialog.Filename = "Enc_Officer_dialog.c";
						Characters[GetCharacterIndex("gm_crew20")].Dialog.CurrentNode = "Hired";
					break;

					case "gm_crew22":
						SetOfficersIndex(Pchar, 1, GetCharacterIndex("gm_crew22"));

						Characters[GetCharacterIndex("gm_crew22")].Dialog.Filename = "Enc_Officer_dialog.c";
						Characters[GetCharacterIndex("gm_crew22")].Dialog.CurrentNode = "Hired";
					break;
				}
			}

			if(CheckAttribute(Pchar,"quest.gm_officers") && Pchar.quest.gm_officers == 0)
			{
				ChangeCharacterAddressGroup(characterFromID("gm_crew1"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("gm_crew3"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("gm_crew4"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("gm_crew5"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("gm_crew10"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("gm_crew11"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("gm_crew18"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("gm_crew20"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("gm_crew22"), "none", "", "");

				switch(Pchar.quest.gm_chosen_officer)
				{
					case "gm_crew1":
						SetOfficersIndex(Pchar, 2, GetCharacterIndex("gm_crew1"));

						Characters[GetCharacterIndex("gm_crew1")].Dialog.Filename = "Enc_Officer_dialog.c";
						Characters[GetCharacterIndex("gm_crew1")].Dialog.CurrentNode = "Hired";
					break;

					case "gm_crew3":
						SetOfficersIndex(Pchar, 2, GetCharacterIndex("gm_crew3"));

						Characters[GetCharacterIndex("gm_crew3")].Dialog.Filename = "Enc_Officer_dialog.c";
						Characters[GetCharacterIndex("gm_crew3")].Dialog.CurrentNode = "Hired";
					break;

					case "gm_crew4":
						SetOfficersIndex(Pchar, 2, GetCharacterIndex("gm_crew4"));

						Characters[GetCharacterIndex("gm_crew4")].Dialog.Filename = "Enc_Officer_dialog.c";
						Characters[GetCharacterIndex("gm_crew4")].Dialog.CurrentNode = "Hired";
					break;

					case "gm_crew5":
						SetOfficersIndex(Pchar, 2, GetCharacterIndex("gm_crew5"));

						Characters[GetCharacterIndex("gm_crew5")].Dialog.Filename = "Enc_Officer_dialog.c";
						Characters[GetCharacterIndex("gm_crew5")].Dialog.CurrentNode = "Hired";
					break;

					case "gm_crew10":
						SetOfficersIndex(Pchar, 2, GetCharacterIndex("gm_crew10"));

						Characters[GetCharacterIndex("gm_crew10")].Dialog.Filename = "Enc_Officer_dialog.c";
						Characters[GetCharacterIndex("gm_crew10")].Dialog.CurrentNode = "Hired";
					break;

					case "gm_crew11":
						SetOfficersIndex(Pchar, 2, GetCharacterIndex("gm_crew11"));

						Characters[GetCharacterIndex("gm_crew11")].Dialog.Filename = "Enc_Officer_dialog.c";
						Characters[GetCharacterIndex("gm_crew11")].Dialog.CurrentNode = "Hired";
					break;

					case "gm_crew18":
						SetOfficersIndex(Pchar, 2, GetCharacterIndex("gm_crew18"));

						Characters[GetCharacterIndex("gm_crew18")].Dialog.Filename = "Enc_Officer_dialog.c";
						Characters[GetCharacterIndex("gm_crew18")].Dialog.CurrentNode = "Hired";
					break;

					case "gm_crew20":
						SetOfficersIndex(Pchar, 2, GetCharacterIndex("gm_crew20"));

						Characters[GetCharacterIndex("gm_crew20")].Dialog.Filename = "Enc_Officer_dialog.c";
						Characters[GetCharacterIndex("gm_crew20")].Dialog.CurrentNode = "Hired";
					break;

					case "gm_crew22":
						SetOfficersIndex(Pchar, 2, GetCharacterIndex("gm_crew22"));

						Characters[GetCharacterIndex("gm_crew22")].Dialog.Filename = "Enc_Officer_dialog.c";
						Characters[GetCharacterIndex("gm_crew22")].Dialog.CurrentNode = "Hired";
					break;
				}

				if(CheckAttribute(Pchar,"quest.gm_sailors") && Pchar.quest.gm_sailors == 0)
				{
					PlaySound("INTERFACE\closed_locked_door.wav");

					pchar.quest.drawing_room_map.win_condition.l1 = "locator";
					pchar.quest.drawing_room_map.win_condition.l1.location = "ck_drawing_room";
					pchar.quest.drawing_room_map.win_condition.l1.locator_group = "goto";
					pchar.quest.drawing_room_map.win_condition.l1.locator = "goto8";
					pchar.quest.drawing_room_map.win_condition = "drawing_room_map";
				}
			}
		break;

		case "gm_sailors_complete":
			if(CheckAttribute(Pchar,"quest.gm_sailors") && Pchar.quest.gm_sailors == 2)
			{
				Logit(LanguageConvertString(tmpLangFileID,"I have 2 sailors left to hire."));
			}

			if(CheckAttribute(Pchar,"quest.gm_sailors") && Pchar.quest.gm_sailors == 1)
			{
				Logit(LanguageConvertString(tmpLangFileID,"I have 1 sailor left to hire."));
			}

			if(CheckAttribute(Pchar,"quest.gm_sailors") && Pchar.quest.gm_sailors == 0)
			{
				ChangeCharacterAddressGroup(characterFromID("gm_crew2"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("gm_crew6"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("gm_crew7"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("gm_crew8"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("gm_crew9"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("gm_crew12"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("gm_crew13"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("gm_crew14"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("gm_crew15"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("gm_crew16"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("gm_crew17"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("gm_crew19"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("gm_crew21"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("gm_crew23"), "none", "", "");

				if(CheckAttribute(Pchar,"quest.gm_officers") && Pchar.quest.gm_officers == 2)
				{
					Logit(LanguageConvertString(tmpLangFileID,"I have 2 officers left to hire."));
				}

				if(CheckAttribute(Pchar,"quest.gm_officers") && Pchar.quest.gm_officers == 1)
				{
					Logit(LanguageConvertString(tmpLangFileID,"I have 1 officer left to hire."));
				}

				if(CheckAttribute(Pchar,"quest.gm_officers") && Pchar.quest.gm_officers == 0)
				{
					PlaySound("INTERFACE\closed_locked_door.wav");

					pchar.quest.drawing_room_map.win_condition.l1 = "locator";
					pchar.quest.drawing_room_map.win_condition.l1.location = "ck_drawing_room";
					pchar.quest.drawing_room_map.win_condition.l1.locator_group = "goto";
					pchar.quest.drawing_room_map.win_condition.l1.locator = "goto8";
					pchar.quest.drawing_room_map.win_condition = "drawing_room_map";
				}
			}
		break;
//.....................................................................................................................
		case "drawing_room_map":
			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_ActorDialog(characterFromID("grandma"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("grandma"));
			Characters[GetCharacterIndex("grandma")].dialog.CurrentNode  = "examine_Hgold_map";
		break;

		case "drawing_room_map1":
			//from grandma dialog
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "stay2", "drawing_room_map2", 2.0);
		break;

		case "drawing_room_map2":
			PlaySound("INTERFACE\paper.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("grandma"));

			LAi_QuestDelay("drawing_room_map3", 1.0);
		break;

		case "drawing_room_map3":
			PlaySound("AMBIENT\SHOP\sigh1.wav");
			LAi_SetSitType(CharacterFromID("grandma"));
			ChangeCharacterAddressGroup(characterFromID("Grandma"), "ck_drawing_room", "sit", "sit1");

			ChangeCharacterAddressGroup(characterFromID("Defoe"), "ck_drawing_room", "goto", "stay3");
			ChangeCharacterAddressGroup(characterFromID("Dave Edna"), "ck_drawing_room", "goto", "stay4");
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "ck_drawing_room", "goto", "stay5");

			LAi_QuestDelay("drawing_room_map3A", 1.0);
		break;

		case "drawing_room_map3A":
			PlaySound("PEOPLE\step_stairway2.wav");
			LAi_SetSitType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "ck_drawing_room", "sit", "sit2");

			LAi_QuestDelay("drawing_room_map4", 1.0);
		break;

		case "drawing_room_map4":
			LAi_SetActorType(characterFromID("wench3"));
			LAi_ActorGoToLocator(characterFromID("wench3"), "goto", "map_ck", "", "");
			LAi_SetActorType(characterFromID("Minerva"));
			LAi_ActorGoToLocator(characterFromID("Minerva"), "goto", "map_mi", "", "");
			LAi_SetActorType(characterFromID("Defoe"));
			LAi_ActorGoToLocator(characterFromID("Defoe"), "goto", "map_de", "", "");
			LAi_SetActorType(characterFromID("Selkirk"));
			LAi_ActorGoToLocator(characterFromID("Selkirk"), "goto", "map_as", "", "");
			LAi_SetActorType(characterFromID("Claire Voyant"));
			LAi_ActorGoToLocator(characterFromID("Claire Voyant"), "goto", "claire1", "", "");

			LAi_QuestDelay("drawing_room_map5", 1.0);
		break;

		case "drawing_room_map5":
			//AFTER 1.0 sec
			ChangeCharacterAddressGroup(characterFromID("wench3"), "ck_drawing_room", "goto", "map_ck");
			ChangeCharacterAddressGroup(characterFromID("Minerva"), "ck_drawing_room", "goto", "map_mi");

			LAi_SetActorType(characterFromID("Defoe"));
			LAi_ActorGoToLocator(characterFromID("Defoe"), "goto", "map_dd", "", "");

			LAi_QuestDelay("drawing_room_map6", 1.0);
		break;

		case "drawing_room_map6":
			//AFTER 2.0 sec
			ChangeCharacterAddressGroup(characterFromID("Defoe"), "ck_drawing_room", "goto", "map_dd");

			LAi_SetActorType(characterFromID("Claire Voyant"));
			LAi_ActorGoToLocator(characterFromID("Claire Voyant"), "goto", "map_cv", "", "");

			LAi_SetActorType(characterFromID("Dave Edna"));
			LAi_ActorGoToLocator(characterFromID("Dave Edna"), "goto", "map_de", "", "");

			ChangeCharacterAddressGroup(characterFromID("Friday"), "ck_drawing_room", "goto", "stay5");

			LAi_QuestDelay("drawing_room_map7", 1.0);
		break;

		case "drawing_room_map7":
			//AFTER 3.0 sec
			ChangeCharacterAddressGroup(characterFromID("Selkirk"), "ck_drawing_room", "goto", "map_as");
			ChangeCharacterAddressGroup(characterFromID("Claire Voyant"), "ck_drawing_room", "goto", "map_cv");

			LAi_SetActorType(characterFromID("Friday"));
			LAi_ActorGoToLocator(characterFromID("Friday"), "goto", "map_fr", "", "");

			LAi_QuestDelay("drawing_room_map8", 1.0);
		break;

		case "drawing_room_map8":
			//AFTER 4.0 sec
			ChangeCharacterAddressGroup(characterFromID("Dave Edna"), "ck_drawing_room", "goto", "map_de");

			LAi_QuestDelay("drawing_room_map9", 1.0);
		break;

		case "drawing_room_map9":
			//AFTER 5.0 sec
			ChangeCharacterAddressGroup(characterFromID("Friday"), "ck_drawing_room", "goto", "map_fr");

			LAi_QuestDelay("drawing_room_monkey", 1.0);
		break;
	//...............................................................................................................
		case "drawing_room_monkey":
			PlaySound("PEOPLE\run_roof.wav");

			LAi_QuestDelay("drawing_room_monkey1", 1.0);
		break;

		case "drawing_room_monkey1":
			PlaySound("VOICE\ENGLISH\grandma_6.wav");
			LAi_SetStayType(CharacterFromID("grandma"));

			LAi_QuestDelay("drawing_room_monkey1A", 1.0);
		break;

		case "drawing_room_monkey1A":
			PlaySound("VOICe\ENGLISH\blaze_what_was_that.wav");

			ChangeCharacterAddressGroup(Pchar, "ck_drawing_room", "goto", "stay2");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("drawing_room_monkey2", 1.0);
		break;

		case "drawing_room_monkey2":
			PlaySound("VOICE\ENGLISH\gr_Friday3.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "chimney2");

			LAi_QuestDelay("drawing_room_monkey3", 2.0);
		break;

		case "drawing_room_monkey3":
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorDialog(characterFromID("Selkirk"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Selkirk"));
			Characters[GetCharacterIndex("Selkirk")].dialog.CurrentNode  = "someone_on_the_roof";
		break;

		case "drawing_room_monkey4":
			//from Selkirk dialog
			PlaySound("VOICE\ENGLISH\gr_wench3_oh.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("wench3"));

			LAi_QuestDelay("drawing_room_monkey5", 1.0);
		break;

		case "drawing_room_monkey5":
			PlaySound("PEOPLE\cavern1.wav");

			LAi_QuestDelay("drawing_room_monkey6", 1.0);
		break;

		case "drawing_room_monkey6":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "chimney2");

			LAi_SetActorType(CharacterFromID("wench3"));
			LAi_ActorTurnToLocator(CharacterFromID("wench3"), "goto", "chimney1");
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorTurnToLocator(CharacterFromID("Selkirk"), "goto", "chimney1");
			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_ActorTurnToLocator(CharacterFromID("grandma"), "goto", "chimney1");
			LAi_SetActorType(CharacterFromID("Friday"));
			LAi_ActorTurnToLocator(CharacterFromID("Friday"), "goto", "chimney1");
			LAi_SetActorType(CharacterFromID("Claire Voyant"));
			LAi_ActorTurnToLocator(CharacterFromID("Claire Voyant"), "goto", "chimney1");
			LAi_SetActorType(CharacterFromID("Minerva"));
			LAi_ActorTurnToLocator(CharacterFromID("Minerva"), "goto", "chimney1");
			LAi_SetActorType(CharacterFromID("Defoe"));
			LAi_ActorTurnToLocator(CharacterFromID("Defoe"), "goto", "chimney1");
			LAi_SetActorType(CharacterFromID("Dave Edna"));
			LAi_ActorTurnToLocator(CharacterFromID("Dave Edna"), "goto", "chimney1");

			LAi_QuestDelay("drawing_room_monkey7", 1.0);
		break;

		case "drawing_room_monkey7":
			PlaySound("PEOPLE\cavern1.wav");
			PlaySound("PEOPLE\slide_down_roof.wav");
			CreateParticleSystem("blast_dirt" , 2.3, -1.0, 2.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 2.3, -1.0, 2.0, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("drawing_room_monkey8", 1.0);
		break;

		case "drawing_room_monkey8":
			PlaySound("PEOPLE\recoil.wav");
			SetModel(characterFromID("Powdermonkey"), "monkey", "monkey", "monkey", 1.8, false);
			ChangeCharacterAddressGroup(characterFromID("Powdermonkey"), "ck_drawing_room", "goto", "chimney1");
			ChangeCharacterAddressGroup(characterFromID("Friday"), "ck_drawing_room", "goto", "friday_jump");

			LAi_QuestDelay("drawing_room_monkey9", 0.5);
		break;

		case "drawing_room_monkey9":
			PlaySound("VOICE\ENGLISH\gr_friday2.wav");

			LAi_QuestDelay("drawing_room_monkey10", 1.0);
		break;

		case "drawing_room_monkey10":
			PlaySound("OBJECTS\DUEL\monkey_hit1.wav");

			LAi_QuestDelay("drawing_room_monkey11", 1.0);
		break;

		case "drawing_room_monkey11":
			LAi_SetActorType(CharacterFromID("Powdermonkey"));
			LAi_ActorTurnToLocator(CharacterFromID("Powdermonkey"), "goto", "monkey");

			LAi_QuestDelay("drawing_room_monkey12", 1.0);
		break;

		case "drawing_room_monkey12":
			PlaySound("PEOPLE\recoil.wav");
			ChangeCharacterAddressGroup(characterFromID("Powdermonkey"), "ck_drawing_room", "goto", "monkey");

			LAi_QuestDelay("drawing_room_monkey13", 1.0);
		break;

		case "drawing_room_monkey13":
			PlaySound("OBJECTS\DUEL\monkey_attack2.wav");

			LAi_QuestDelay("drawing_room_monkey14", 1.0);
		break;

		case "drawing_room_monkey14":
			LAi_SetActorType(characterFromID("Minerva"));
			LAi_ActorDialog(characterFromID("Minerva"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Minerva"));
			Characters[GetCharacterIndex("Minerva")].dialog.CurrentNode  = "monkey";
		break;

		case "drawing_room_monkey15":
			//from Minerva dialog
			PlaySound("OBJECTS\DUEL\monkey_hit3.wav");

			LAi_SetActorType(characterFromID("Friday"));
			LAi_ActorGoToLocator(characterFromID("Friday"), "goto", "map_fr", "", "");

			LAi_QuestDelay("drawing_room_map10", 1.0);
		break;
	//...............................................................................................................
		case "drawing_room_map10":
			ChangeCharacterAddressGroup(characterFromID("Friday"), "ck_drawing_room", "goto", "map_fr");

			LAi_SetActorType(characterFromID("wench3"));
			LAi_SetActorType(characterFromID("Minerva"));
			LAi_SetActorType(characterFromID("Defoe"));
			LAi_SetActorType(characterFromID("Selkirk"));
			LAi_SetActorType(characterFromID("Claire Voyant"));
			LAi_SetActorType(characterFromID("grandma"));
			LAi_SetActorType(characterFromID("Dave Edna"));
			LAi_SetActorType(characterFromID("Friday"));
			LAi_SetActorType(Pchar);

			LAi_ActorTurnToLocator(CharacterFromID("wench3"), "goto", "table");
			LAi_ActorTurnToLocator(CharacterFromID("Minerva"), "goto", "table");
			LAi_ActorTurnToLocator(CharacterFromID("Defoe"), "goto", "table");
			LAi_ActorTurnToLocator(CharacterFromID("Selkirk"), "goto", "table");
			LAi_ActorTurnToLocator(CharacterFromID("Claire Voyant"), "goto", "table");
			LAi_ActorTurnToLocator(CharacterFromID("grandma"), "goto", "table");
			LAi_ActorTurnToLocator(CharacterFromID("Dave Edna"), "goto", "table");
			LAi_ActorTurnToLocator(CharacterFromID("Friday"), "goto", "table");
			LAi_ActorTurnToLocator(Pchar, "goto", "table");

			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_ActorDialog(characterFromID("grandma"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("grandma"));
			Characters[GetCharacterIndex("grandma")].dialog.CurrentNode  = "treasure_map";
		break;

		case "drawing_room_map11":
			//from grandma dialog
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorDialog(characterFromID("Selkirk"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Selkirk"));
			Characters[GetCharacterIndex("Selkirk")].dialog.CurrentNode  = "two_islands";
		break;

		case "drawing_room_map12":
			//from Selkirk dialog
			LAi_SetActorType(CharacterFromID("Claire Voyant"));
			LAi_ActorDialog(characterFromID("Claire Voyant"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Claire Voyant"));
			Characters[GetCharacterIndex("Claire Voyant")].dialog.CurrentNode  = "notebook";
		break;

		case "drawing_room_map13":
			//from Claire dialog
			LAi_SetActorType(characterFromID("Dave Edna"));
			LAi_ActorDialog(characterFromID("Dave Edna"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Dave Edna"));
			Characters[GetCharacterIndex("Dave Edna")].dialog.CurrentNode  = "sell_Hgold_map";
		break;

		case "drawing_room_map13A":
			//from Dave dialog
			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_ActorDialog(characterFromID("grandma"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("grandma"));
			Characters[GetCharacterIndex("grandma")].dialog.CurrentNode  = "notebook";

		break;

		case "drawing_room_map14":
			//from Grandma dialog
		Characters[GetCharacterIndex("Defoe")].dialog.CurrentNode  = "Hgold_story";
			LAi_SetActorType(CharacterFromID("Defoe"));
			LAi_ActorDialog(characterFromID("Defoe"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Defoe"));
			
		break;

		case "drawing_room_map15":
			//from Defoe dialog
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
			Characters[GetCharacterIndex("Wench3")].dialog.CurrentNode  = "Hgold_map_to_Rogers";
		break;

		case "drawing_room_map16":
			//from Caroline dialog
		Characters[GetCharacterIndex("Defoe")].dialog.CurrentNode  = "Bellamys_story";
			LAi_SetActorType(CharacterFromID("Defoe"));
			LAi_ActorDialog(characterFromID("Defoe"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Defoe"));
		
		break;
	//.......................................................................................................
	//[21] from here ... testing Hornigold shore scene
		case "Hornigold_shore":
			//from Defoe dialog
			SetCurrentTime(12.00, 0);
			SetNextWeather("Clear");
			SetNextWind("W",30);

			SetCharacterShipLocation(characterFromID("Teach"), "BB_Hornigold_shore");		//pinnace4
			SetCharacterShipLocation(characterFromID("Hornigold"), "BB_Hornigold_shore");		//schooner1
			SetCharacterShipLocation(characterFromID("Richards"), "BB_Hornigold_shore");		//sloop_cutter1_18 (for Bellamy)
			SetCharacterShipLocation(characterFromID("Hands"), "BB_Hornigold_shore");		//FR_Sloop (for La Buze)
			SetCharacterShipLocation(characterFromID("Caesar"), "BB_Hornigold_shore");		//boat (3 crew)

			SetModel(PChar, "pir_cap2", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			if(CheckCharacterItem(Pchar,"bladeA5")) EquipCharacterByItem(Pchar, "bladeA5");
			if(CheckCharacterItem(Pchar,"blade1")) EquipCharacterByItem(Pchar, "blade1");
			if(CheckCharacterItem(Pchar,"blade1-1")) EquipCharacterByItem(Pchar, "blade1-1");
			if(CheckCharacterItem(Pchar,"blade1-2")) EquipCharacterByItem(Pchar, "blade1-2");

			GiveItem2Character(Pchar, "pistol3");
			Pchar.equip.gun = "pistol3";

			LAi_SetPoorType(Pchar);
			LAi_SetPoorType(characterFromID("Teach"));

			GiveItem2Character(characterFromID("Teach"), "bladeMap_Hgold");
			EquipCharacterByItem(CharacterFromID("Teach"), "bladeMap_Hgold");
			GiveItem2Character(characterFromID("Hornigold"), "bladepclub203");
			EquipCharacterByItem(CharacterFromID("Hornigold"), "bladepclub203");

			DoQuestReloadToLocation("BB_Hornigold_shore", "goto", "bb4", "Hornigold_shore0");
		break;

		case "Hornigold_shore0":
			LAi_ActorGoToLocator(CharacterFromID("Hornigold"), "goto", "bb5", "Hornigold_shore1", 5.0);
		break;

		case "Hornigold_shore1":
			LAi_ActorTurnToLocator(CharacterFromID("Hornigold"), "goto", "bb6");
			LAi_SetActorType(characterFromID("Teach"));
			PlaySound("PEOPLE\step_ground2.wav");

			LAi_QuestDelay("Hornigold_shore1_A", 1.0);
		break;

		case "Hornigold_shore1_A":
			PlaySound("VOICE\ENGLISH\gr_Teach5.wav");

			LAi_QuestDelay("Hornigold_shore2", 2.0);
		break;

		case "Hornigold_shore2":
			LAi_SetActorType(characterFromID("Hornigold"));
			LAi_ActorDialog(characterFromID("Hornigold"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hornigold"));
			Characters[GetCharacterIndex("Hornigold")].dialog.CurrentNode  = "La_Concorde";
		break;

		case "Hornigold_shore3":
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorDialog(characterFromID("Teach"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Teach"));
			Characters[GetCharacterIndex("Teach")].dialog.CurrentNode  = "separate_way";
		break;

		case "Hornigold_shore3_A":
			LAi_SetActorType(characterFromID("fake_pir_cap8"));
			LAi_ActorGoToLocator(CharacterFromID("fake_pir_cap8"), "goto", "bb12", "Hornigold_shore3_B", 2.0);
		break;

		case "Hornigold_shore3_B":
			PlaySound("VOICE\ENGLISH\pir_capLL.wav");

			LAi_QuestDelay("Hornigold_shore4", 2.0);
		break;

		case "Hornigold_shore4":
			LAi_SetActorType(characterFromID("Hornigold"));
			LAi_ActorDialog(characterFromID("Hornigold"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hornigold"));
			Characters[GetCharacterIndex("Hornigold")].dialog.CurrentNode  = "talk_business";
		break;

		case "Hornigold_shore5":
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorDialog(characterFromID("Teach"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Teach"));
			Characters[GetCharacterIndex("Teach")].dialog.CurrentNode  = "keep_the_ship";
		break;

		case "Hornigold_shore6":
			LAi_QuestDelay("Hornigold_shore6_A", 3.0);

			LAi_SetActorType(characterFromID("Hornigold"));
			LAi_ActorDialog(characterFromID("Hornigold"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hornigold"));
			Characters[GetCharacterIndex("Hornigold")].dialog.CurrentNode  = "getting_mad";
		break;

		case "Hornigold_shore6_A":
			LAi_SetActorType(CharacterFromID("Caesar"));
			LAi_ActorGoToLocator(CharacterFromID("Caesar"), "goto", "bb8A", "Hornigold_shore6_B", 1.0);
		break;

		case "Hornigold_shore6_B":
			PlaySound("OBJECTS\DUEL\man_attack5.wav");
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], false);//temp only
			LAi_SetPlayerType(CharacterFromID("Caesar"));
			LAi_SetFightMode(CharacterFromID("Caesar"), true);

			LAi_QuestDelay("Hornigold_shore6_C", 4.0);
		break;

		case "Hornigold_shore6_C":
			if(LAi_IsFightMode(CharacterFromID("Caesar")))
			{
				//just in case..
				LAi_SetFightMode(CharacterFromID("Caesar"), false);
				LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], true);//reset
			}
		break;

		case "Hornigold_shore7":
			ChangeCharacterAddressGroup(Pchar, "BB_Hornigold_shore", "goto", "bb4");
			LAi_ActorGoToLocator(CharacterFromID("Teach"), "goto", "bb6A", "Hornigold_shore7_A", 1.0);
		break;

		case "Hornigold_shore7_A":
			LAi_SetFightMode(CharacterFromID("Caesar"), false);
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], true);//reset

			LAi_ActorGoToLocator(CharacterFromID("Hornigold"), "goto", "bb5A", "Hornigold_shore7_AA", 1.0);
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorDialog(characterFromID("Teach"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Teach"));
			Characters[GetCharacterIndex("Teach")].dialog.CurrentNode  = "gives_map";
		break;

		case "Hornigold_shore7_AA":
			LAi_ActorTurnToLocator(CharacterFromID("Hornigold"), "goto", "bb6A");
		break;

		case "Hornigold_shore7_B":
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], false);//temp only
			LAi_SetPlayerType(CharacterFromID("Teach"));
			LAi_SetFightMode(CharacterFromID("Teach"), true);

			LAi_QuestDelay("Hornigold_shore7_C", 1.5);
		break;

		case "Hornigold_shore7_C":
			RemoveCharacterEquip(CharacterFromID("Teach"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(CharacterFromID("Teach"), "bladeMap_Hgold");
			GiveItem2Character(CharacterFromID("Teach"), "bladeX4");
			EquipCharacterByItem(CharacterFromID("Teach"), "bladeX4");

			PlaySound("PEOPLE\step_sand.wav");
			GiveItem2Character(CharacterFromID("Hornigold"), "pistolMap_Hgold");
			EquipCharacterByItem(CharacterFromID("Hornigold"), "pistolMap_Hgold");

			LAi_QuestDelay("Hornigold_shore7_D", 0.5);
		break;

		case "Hornigold_shore7_D":
			LAi_SetFightMode(CharacterFromID("Teach"), false);
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], true);//reset

			LAi_QuestDelay("Hornigold_shore8", 1.0);
		break;

		case "Hornigold_shore8":
			LAi_SetActorType(characterFromID("Hornigold"));
			LAi_ActorDialog(characterFromID("Hornigold"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hornigold"));
			Characters[GetCharacterIndex("Hornigold")].dialog.CurrentNode  = "wow_a_map";
		break;

		case "Hornigold_shore9":
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorDialog(characterFromID("Teach"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Teach"));
			Characters[GetCharacterIndex("Teach")].dialog.CurrentNode  = "give_me_your_pistol";
		break;

		case "Hornigold_shore10":
			LAi_SetActorType(characterFromID("Hornigold"));
			LAi_ActorDialog(characterFromID("Hornigold"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hornigold"));
			Characters[GetCharacterIndex("Hornigold")].dialog.CurrentNode  = "gives_pistol";
		break;

		case "Hornigold_shore11":
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], false);//temp only
			LAi_SetPlayerType(CharacterFromID("Hornigold"));
			LAi_SetFightMode(CharacterFromID("Hornigold"), true);

			LAi_QuestDelay("Hornigold_shore12", 1.5);
		break;

		case "Hornigold_shore12":
			RemoveCharacterEquip(CharacterFromID("Hornigold"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(CharacterFromID("Hornigold"), "bladepclub203");
			GiveItem2Character(CharacterFromID("Hornigold"), "bladeX4");
			EquipCharacterByItem(CharacterFromID("Hornigold"), "bladeX4");

			PlaySound("OBJECTS\DUEL\reload1.wav");
			GiveItem2Character(CharacterFromID("Teach"), "bladep203");
			EquipCharacterByItem(CharacterFromID("Teach"), "bladep203");

			LAi_QuestDelay("Hornigold_shore13", 0.5);
		break;

		case "Hornigold_shore13":
			LAi_SetFightMode(CharacterFromID("Hornigold"), false);
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], true);//reset

			LAi_QuestDelay("Hornigold_shore14", 1.0);
		break;

		case "Hornigold_shore14":
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorGoToLocator(CharacterFromID("Teach"), "goto", "bb6", "Hornigold_shore15", 2.0);
		break;

		case "Hornigold_shore15":
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorTurnToLocator(CharacterFromID("Teach"), "goto", "bb6A");

			LAi_QuestDelay("Hornigold_shore16", 1.0);
		break;

		case "Hornigold_shore16":
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorDialog(characterFromID("Teach"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Teach"));
			Characters[GetCharacterIndex("Teach")].dialog.CurrentNode  = "officers_over_here";
		break;

		case "Hornigold_shore17":
			LAi_SetActorType(characterFromID("Hornigold"));
			LAi_ActorGoToLocator(CharacterFromID("Hornigold"), "goto", "bb5", "Hornigold_shore18", 2.0);
		break;

		case "Hornigold_shore18":
			LAi_SetActorType(characterFromID("Hornigold"));
			LAi_ActorTurnToLocator(CharacterFromID("Hornigold"), "goto", "bb6");

			LAi_QuestDelay("Hornigold_shore19", 1.0);
		break;

		case "Hornigold_shore19":
			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorGoToLocator(CharacterFromID("Hands"), "goto", "bb10", "Hornigold_shore20", 2.0);
		break;

		case "Hornigold_shore20":
			PlaySound("VOICE\ENGLISH\gr_Hands1.wav");
			LAi_ActorTurnToLocator(CharacterFromID("Hands"), "goto", "bb12");

			LAi_QuestDelay("Hornigold_shore22", 1.0);
		break;

		case "Hornigold_shore22":
			PlaySound("VOICE\ENGLISH\gr_Richards.wav");
			LAi_SetStayType(characterFromID("Richards"));

			LAi_QuestDelay("Hornigold_shore23", 2.0);
		break;

		case "Hornigold_shore23":
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "bb11", "Hornigold_shore24", 2.0);
		break;

		case "Hornigold_shore24":
			PlaySound("VOICE\ENGLISH\pir_capEE.wav");
			LAi_ActorTurnToLocator(Pchar, "goto", "bb6");

			LAi_QuestDelay("Hornigold_shore24A", 2.0);//was 2.0 to 25
		break;

		case "Hornigold_shore24A":
			PlaySound("OBJECTS\DUEL\man_attack5.wav");
			ChangeCharacterAddressGroup(CharacterFromID("Caesar"), "BB_Hornigold_shore", "goto", "bb8A");

			LAi_QuestDelay("Hornigold_shore25", 1.0);
		break;

		case "Hornigold_shore25":
			PlaySound("VOICE\ENGLISH\gr_Teach5.wav");
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorTurnToCharacter(characterFromID("Teach"), characterFromID("Caesar"));

			LAi_QuestDelay("Hornigold_shore26", 2.0);
		break;

		case "Hornigold_shore26":
			PlaySound("VOICE\ENGLISH\gr_Hgold5.wav");
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorTurnToCharacter(characterFromID("Teach"), characterFromID("Hornigold"));

			LAi_QuestDelay("Hornigold_shore27", 2.0);
		break;

		case "Hornigold_shore27":
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorGoToLocator(CharacterFromID("Teach"), "randitem", "randitem2", "", 21.0);

			LAi_QuestDelay("Hornigold_shore28", 2.0);
		break;

		case "Hornigold_shore28":
			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorGoToLocator(CharacterFromID("Hands"), "randitem", "randitem2", "", 20.0);
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorGoToLocator(CharacterFromID("Caesar"), "randitem", "randitem2", "", 20.0);
			LAi_SetActorType(characterFromID("Richards"));
			LAi_ActorGoToLocator(CharacterFromID("Richards"), "randitem", "randitem2", "", 20.0);

			LAi_ActorTurnToLocator(CharacterFromID("fake_pir_cap8"), "randitem", "randitem2");
			LAi_ActorTurnToLocator(CharacterFromID("Hornigold"), "randitem", "randitem2");
			LAi_ActorTurnToLocator(Pchar, "randitem", "randitem2");

			LAi_QuestDelay("Hornigold_shore29", 4.0);
		break;

		case "Hornigold_shore29":
			PlaySound("VOICE\ENGLISH\Blaze_sigh.wav");

			LAi_QuestDelay("drawing_room_map17", 14.0);
		break;
	//.......................................................................................................
		case "drawing_room_map17":
			//from Hgold shore
			SetModel(PChar, "ShkiperM_U_a", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "pistol3");
			EquipCharacterByItem(Pchar, "pistol20");
			TakeItemFromCharacter(Pchar, "ammobag1");
			if(!CheckCharacterItem(Pchar,"ammobag2"))
			{
				GiveItem2Character(Pchar, "ammobag2");
			}
			EquipCharacterbyItem(Pchar, "ammobag2");

			LAi_SetSitType(Pchar);

			DoQuestReloadToLocation("ck_drawing_room", "sit", "sit2", "drawing_room_map18");
		break;

		case "drawing_room_map18":
			PlaySound("VOICE\ENGLISH\blaze_puh.wav");

			LAi_QuestDelay("drawing_room_map19", 2.0);
		break;

		case "drawing_room_map19":
			LAi_SetActorType(CharacterFromID("Selkirk"));
			LAi_ActorDialog(characterFromID("Selkirk"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Selkirk"));
			Characters[GetCharacterIndex("Selkirk")].dialog.CurrentNode  = "BBs_treasure";
		break;

		case "drawing_room_map20":
			//from Selkirk dialog
			LAi_SetActorType(characterFromID("Dave Edna"));
			LAi_ActorDialog(characterFromID("Dave Edna"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Dave Edna"));
			Characters[GetCharacterIndex("Dave Edna")].dialog.CurrentNode  = "La_Concorde";
		break;

		case "drawing_room_map21":
			//from Dave dialog
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
			Characters[GetCharacterIndex("Wench3")].dialog.CurrentNode  = "Spotswood_to_Rogers";
		break;

		case "drawing_room_map22":
			//from Caroline dialog
		Characters[GetCharacterIndex("Defoe")].dialog.CurrentNode  = "Spotswood_Maynard";
			LAi_SetActorType(CharacterFromID("Defoe"));
			LAi_ActorDialog(characterFromID("Defoe"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Defoe"));
		break;

		case "drawing_room_map23":
			//from Defoe dialog
			LAi_SetActorType(CharacterFromID("grandma"));
			LAi_ActorDialog(characterFromID("grandma"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("grandma"));
			Characters[GetCharacterIndex("grandma")].dialog.CurrentNode  = "6_map_pieces";
		break;

		case "drawing_room_map24":
			//from grandma dialog
			LAi_SetActorType(CharacterFromID("Claire Voyant"));
			LAi_ActorDialog(characterFromID("Claire Voyant"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Claire Voyant"));
			Characters[GetCharacterIndex("Claire Voyant")].dialog.CurrentNode  = "Teach_joke";
		break;

		case "drawing_room_map25":
			//from Claire dialog
			PlaySound("INTERFACE\key_unlock.wav");
			ChangeCharacterAddressGroup(characterFromID("JRH"), "ck_drawing_room", "reload", "reload2");
			Locations[FindLocation("ck_drawing_room")].reload.l2.disable = 0;

			LAi_QuestDelay("drawing_room_map26", 2.0);
		break;

		case "drawing_room_map26":
			PlaySound("VOICE\ENGLISH\claire_welcome.wav");

			ChangeCharacterAddressGroup(Pchar, "ck_drawing_room", "goto", "stay2");

			LAi_SetActorType(characterFromID("wench3"));
			LAi_SetActorType(characterFromID("Minerva"));
			LAi_SetActorType(characterFromID("Defoe"));
			LAi_SetActorType(characterFromID("Selkirk"));
			LAi_SetActorType(characterFromID("Claire Voyant"));
			LAi_SetActorType(characterFromID("grandma"));
			LAi_SetActorType(characterFromID("Dave Edna"));
			LAi_SetActorType(characterFromID("Friday"));
			LAi_SetActorType(Pchar);

			LAi_ActorTurnToLocator(CharacterFromID("wench3"), "reload", "reload2");
			LAi_ActorTurnToLocator(CharacterFromID("Minerva"), "reload", "reload2");
			LAi_ActorTurnToLocator(CharacterFromID("Defoe"), "reload", "reload2");
			LAi_ActorTurnToLocator(CharacterFromID("Selkirk"), "reload", "reload2");
			LAi_ActorTurnToLocator(CharacterFromID("Claire Voyant"), "reload", "reload2");
			LAi_ActorTurnToLocator(CharacterFromID("grandma"), "reload", "reload2");
			LAi_ActorTurnToLocator(CharacterFromID("Dave Edna"), "reload", "reload2");
			LAi_ActorTurnToLocator(CharacterFromID("Friday"), "reload", "reload2");
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");

			LAi_QuestDelay("drawing_room_map27", 2.5);
		break;

		case "drawing_room_map27":
			LAi_SetActorType(characterFromID("jrh"));
			LAi_ActorGoToLocator(CharacterFromID("jrh"), "goto", "jrh1", "drawing_room_map28", 2.0);

			LAi_SetStayType(characterFromID("wench3"));
			LAi_SetStayType(characterFromID("Minerva"));
			LAi_SetStayType(characterFromID("Defoe"));
			LAi_SetStayType(characterFromID("Selkirk"));
			LAi_SetStayType(characterFromID("Claire Voyant"));
			LAi_SetStayType(characterFromID("grandma"));
			LAi_SetStayType(characterFromID("Dave Edna"));
			LAi_SetStayType(characterFromID("Friday"));
		break;

		case "drawing_room_map28":
			LAi_SetActorType(CharacterFromID("jrh"));
			LAi_ActorDialog(characterFromID("jrh"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("jrh"));
			Characters[GetCharacterIndex("jrh")].dialog.CurrentNode  = "drawing_room";
		break;

		case "drawing_room_map29":
			PlaySound("VOICE\ENGLISH\jrh_3.wav");

			LAi_QuestDelay("drawing_room_map29A", 3.0);
		break;

		case "drawing_room_map29A":
			LAi_SetActorType(characterFromID("jrh"));
			LAi_ActorGoToLocator(CharacterFromID("jrh"), "goto", "jrh2", "drawing_room_map30", 2.0);//was reload2
		break;

		case "drawing_room_map30":
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(characterFromID("JRH"), "none", "", "");

			LAi_QuestDelay("drawing_room_map31", 1.0);
		break;

		case "drawing_room_map31":
			LAi_SetActorType(characterFromID("wench3"));
			LAi_SetActorType(characterFromID("Minerva"));
			LAi_SetActorType(characterFromID("Defoe"));
			LAi_SetActorType(characterFromID("Selkirk"));
			LAi_SetActorType(characterFromID("Claire Voyant"));
			LAi_SetActorType(characterFromID("grandma"));
			LAi_SetActorType(characterFromID("Dave Edna"));
			LAi_SetActorType(characterFromID("Friday"));
			LAi_SetActorType(characterFromID("Powdermonkey"));

			LAi_ActorTurnToLocator(CharacterFromID("wench3"), "goto", "hat");
			LAi_ActorTurnToLocator(CharacterFromID("Minerva"), "goto", "hat");
			LAi_ActorTurnToLocator(CharacterFromID("Defoe"), "goto", "hat");
			LAi_ActorTurnToLocator(CharacterFromID("Selkirk"), "goto", "hat");
			LAi_ActorTurnToLocator(CharacterFromID("Claire Voyant"), "goto", "hat");
			LAi_ActorTurnToLocator(CharacterFromID("grandma"), "goto", "hat");
			LAi_ActorTurnToLocator(CharacterFromID("Dave Edna"), "goto", "hat");
			LAi_ActorTurnToLocator(CharacterFromID("Friday"), "goto", "hat");
			LAi_ActorTurnToLocator(CharacterFromID("Powdermonkey"), "goto", "hat");

			PlaySound("VOICE\ENGLISH\blaze_lets_go.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "hat", "drawing_room_map32", 1.5);//was 2.0

			ChangeCharacterAddressGroup(characterFromID("wench3"), "ck_drawing_room", "goto", "goto3");

			LAi_QuestDelay("drawing_room_map31A", 1.5);		//was 1.0
		break;

		case "drawing_room_map31A":
			PlaySound("VOICE\ENGLISH\grandma_yell.wav");
		break;

		case "drawing_room_map32":
			PauseAllSounds();
			LAi_SetActorType(characterFromID("Wench3"));
			LAi_ActorDialog(characterFromID("Wench3"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Wench3"));
			Characters[GetCharacterIndex("Wench3")].dialog.CurrentNode  = "fine_hat";
		break;

		case "drawing_room_map33":
			//from Caroline dialog
			PlaySound("INTERFACE\cancel.wav");
			SetModel(Pchar, "ShkiperM_UH_a", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);

			LAi_SetStayType(characterFromID("Wench3"));

			LAi_QuestDelay("drawing_room_map34", 1.0);
		break;

		case "drawing_room_map34":
			PlaySound("VOICE\ENGLISH\blaze_very_nice.wav");

			LAi_QuestDelay("goodbye_dave", 1.0);
		break;
	//.................................................................................................
		case "goodbye_dave":
			PlaySound("VOICE\ENGLISH\Dave_Edna_1.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Dave Edna"));

			LAi_QuestDelay("goodbye_minerva", 4.5);
		break;

		case "goodbye_minerva":
			PlaySound("VOICE\ENGLISH\Fre_f_a_003.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Minerva"));

			LAi_QuestDelay("goodbye_defoe", 3.0);
		break;

		case "goodbye_defoe":
			PlaySound("VOICE\ENGLISH\defoe_again.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Defoe"));

			LAi_QuestDelay("goodbye_grandma", 3.5);
		break;

		case "goodbye_grandma":
			PlaySound("VOICE\ENGLISH\grandma_4.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("grandma"));

			LAi_QuestDelay("goodbye_selkirk", 3.0);
		break;

		case "goodbye_selkirk":
			PlaySound("VOICE\ENGLISH\Eng_m_c_076.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Selkirk"));

			LAi_QuestDelay("goodbye_claire", 2.5);
		break;

		case "goodbye_claire":
			PlaySound("VOICE\ENGLISH\claire_light.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Claire Voyant"));

			LAi_QuestDelay("goodbye_friday", 3.0);
		break;

		case "goodbye_friday":
			PlaySound("VOICE\ENGLISH\gr_friday1.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Friday"));

			LAi_QuestDelay("goodbye_monkey", 2.5);
		break;

		case "goodbye_monkey":
			PlaySound("OBJECTS\VOICES\DEAD\monkey\monkey_dead1.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Powdermonkey"));

			LAi_QuestDelay("goodbye_caroline", 2.0);
		break;

		case "goodbye_caroline":
			PlaySound("VOICE\ENGLISH\gr_wench3_mhm.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("wench3"));

			LAi_QuestDelay("goodbye_sigh", 2.0);
		break;

		case "goodbye_sigh":
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");

			LAi_QuestDelay("goodbye_grandma_sniff", 3.0);
		break;

		case "goodbye_grandma_sniff":
			PlaySound("AMBIENT\JAIL\sniff.wav");PlaySound("AMBIENT\JAIL\sniff.wav");PlaySound("AMBIENT\JAIL\sniff.wav");

			LAi_QuestDelay("goodbye_grandma_fart", 2.5);
		break;

		case "goodbye_grandma_fart":
			PlaySound("PEOPLE\fart1.wav");PlaySound("PEOPLE\fart1.wav");

			LAi_QuestDelay("goodbye_caroline_angry", 1.0);
		break;

		case "goodbye_caroline_angry":
			PlaySound("OBJECTS\DUEL\woman_hit3.wav");
			LAi_SetActorType(characterFromID("wench3"));
			LAi_ActorTurnToCharacter(characterFromID("wench3"), characterFromID("grandma"));
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("grandma"));

			LAi_SetActorType(characterFromID("Minerva"));
			LAi_SetActorType(characterFromID("Defoe"));
			LAi_SetActorType(characterFromID("Selkirk"));
			LAi_SetActorType(characterFromID("Claire Voyant"));
			LAi_SetActorType(characterFromID("Dave Edna"));
			LAi_SetActorType(characterFromID("Friday"));
			LAi_SetActorType(characterFromID("Powdermonkey"));

			LAi_ActorTurnToCharacter(characterFromID("Minerva"), characterFromID("grandma"));
			LAi_ActorTurnToCharacter(characterFromID("Defoe"), characterFromID("grandma"));
			LAi_ActorTurnToCharacter(characterFromID("Selkirk"), characterFromID("grandma"));
			LAi_ActorTurnToCharacter(characterFromID("Claire Voyant"), characterFromID("grandma"));
			LAi_ActorTurnToCharacter(characterFromID("Dave Edna"), characterFromID("grandma"));
			LAi_ActorTurnToCharacter(characterFromID("Friday"), characterFromID("grandma"));
			LAi_ActorTurnToCharacter(characterFromID("Powdermonkey"), characterFromID("grandma"));

			LAi_QuestDelay("goodbye_laugh", 1.0);
		break;

		case "goodbye_laugh":
			PlaySound("AMBIENT\JAIL\cough.wav");

			LAi_SetStayType(characterFromID("wench3"));
			LAi_SetStayType(characterFromID("Minerva"));
			LAi_SetStayType(characterFromID("Defoe"));
			LAi_SetStayType(characterFromID("Selkirk"));
			LAi_SetStayType(characterFromID("Claire Voyant"));
			LAi_SetStayType(characterFromID("grandma"));
			LAi_SetStayType(characterFromID("Dave Edna"));
			LAi_SetStayType(characterFromID("Friday"));

			LAi_QuestDelay("goodbye_turn_around", 1.0);
		break;

		case "goodbye_turn_around":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "jrh2");

			LAi_QuestDelay("goodbye_leave", 1.0);
		break;

		case "goodbye_leave":
			LAi_SetPlayerType(Pchar);
			PlaySound("PEOPLE\laugh1.wav");

			ChangeCharacterAddressGroup(characterFromID("wr_man3"), "none", "", "");	//terrace guard
			ChangeCharacterAddressGroup(characterFromID("wr_pir7"), "none", "", "");	//terrace guard

			locations[FindLocation("wr_crew")].id.label = "Crew's quarter";

			Locations[FindLocation("Redmond_UsurerHouse")].models.always.locators = "SS_l_JRH3";
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l1.disable = 0;		//to town
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l3.disable = 1;		//to library
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l4.disable = 1;		//to behind counter
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l6.disable = 1;		//to cellar
			Locations[FindLocation("Redmond_UsurerHouse")].reload.l7.disable = 1;		//to town behind counter
			locations[FindLocation("Redmond_UsurerHouse")].type = "house";			//reset

			locations[FindLocation("Loanshark_cellar")].id.label = "Loanshark cellar";
			locations[FindLocation("wr_library")].id.label = "Woodes Rogers' library";

			locations[FindLocation("Shop_stairs")].id.label = "Rogers' Paintings Furniture & Weapons";

			Locations[FindLocation("Redmond_Town_01")].models.always.locators = "Red01_l_JRH7";	//was 6
			Locations[FindLocation("Redmond_Town_01")].reload.l18.disable = 1;		//window
			Locations[FindLocation("Redmond_Town_01")].reload.l23.disable = 1;		//gate terrace
			Locations[FindLocation("Redmond_Town_01")].reload.l26.disable = 1;		//tavern storeroom
			Locations[FindLocation("Redmond_Town_01")].reload.l27.disable = 1;		//Rogers shop
			Locations[FindLocation("Redmond_Town_01")].reload.l20.disable = 1;		//LS back door
		//	Locations[FindLocation("Redmond_Town_01")].reload.l9.close_for_night = 1;	//shipyard
			Locations[FindLocation("Redmond_shipyard")].reload.l2.disable = 0;		//shipyard stairs
			locations[FindLocation("shipyard_stairs")].id.label = "Shipyard stairs";
			Locations[FindLocation("Shipyard_shore")].reload.l1.disable = 1;		//to docks
			Locations[FindLocation("Shipyard_shore")].reload.l2.disable = 1;		//to docks
		
			Locations[FindLocation("Redmond_tavern")].models.always.locators = "LT_l_JRH3";
			Locations[FindLocation("Redmond_tavern")].reload.l3.disable = 1;		//balcony: officer problems
			Locations[FindLocation("Redmond_tavern")].reload.l4.disable = 1;		//counter: officer problems
			Locations[FindLocation("Redmond_tavern")].reload.l6.disable = 1;		//tavern storeroom

			locations[FindLocation("Tavern_storeroom")].id.label = "Tavern storeroom";
			locations[FindLocation("wr_kitchen")].id.label = "Woodes Rogers' kitchen";

			Locations[FindLocation("Redmond_Town_01")].reload.l13.disable = 0;	//to governor's residence
			Locations[FindLocation("Redmond_Port")].reload.l6.disable = 0;		//to harbour office
			Locations[FindLocation("Redmond_Port")].reload.l4.disable = 1;		//to my ship

			locations[FindLocation("Redmond_church")].reload.l1.disable = 0;
			locations[FindLocation("Redmond_church")].reload.l2.disable = 1;
			locations[FindLocation("Redmond_church")].reload.l3.disable = 1;
			locations[FindLocation("church_choir")].id.label = "Port Royal Church Choir";
			locations[FindLocation("wr_crypt")].id.label = "Port Royal catacombs";

			Locations[FindLocation("Redmond_town_exit_2")].models.always.locators = "Redexit2_l_JRH";
			locations[FindLocation("Redmond_town_exit_2")].reload.l5.disable = 1;		//to well
			Locations[FindLocation("Redmond_Town_exit_2")].reload.l1.disable = 0;		//to town

			Locations[FindLocation("Shipyard_shore")].models.always.locators = "FFport02_l_JRH_out";
			locations[FindLocation("Shipyard_shore")].type = "silent_town";
			Locations[FindLocation("Redmond_shore_02")].models.always.locators = "shore03_l";

		//just to be sure
			ChangeCharacterAddressGroup(characterFromID("wr_sol6f77"), "none", "", "");	//shore 03 guard
			ChangeCharacterAddressGroup(characterFromID("wr_fwn"), "none", "", "");		//shore 03 guard

			locations[FindLocation("Redmond_Town_01")].type = "blues_town";
			locations[FindLocation("Redmond_Town_03")].type = "blues_town";
			locations[FindLocation("Redmond_Town_04")].type = "blues_town";
			locations[FindLocation("Redmond_Port")].type = "blues_port";


		/*
			//reset sound types
			//no don't
			locations[FindLocation("Redmond_Town_01")].type = "town";
			locations[FindLocation("Redmond_Town_03")].type = "town";
			locations[FindLocation("Redmond_Town_04")].type = "town";
			locations[FindLocation("Redmond_Port")].type = "port";

			Pchar.quest.Rdm_officiant = "Simona";//resets officiant
			DeleteAttribute(PChar, "quest.disable_rebirth");
			bDisableFastReload = 0;
		*/
			LAi_QuestDelay("goodbye_blues", 1.5);
		
		break;
	
		case "goodbye_blues":
			PlaySound("INTERFACE\blues_end.wav");
		//	Pchar.quest.WR_part1 = "finished";			//the quest guns can now be lost if reincarnated
			Pchar.quest.pistolthrow = "know_how";			//just to be sure
		/*
			ref chr = CharacterFromID("Dante Siciliano");
			DeleteAttribute(chr, "Flags.Pirate");			//reset to no special flag
			DeleteAttribute(chr, "Flags.Pirate.texture");
		*/
			pchar.quest.Shipyard_shore_ambush.win_condition.l1 = "location";
			pchar.quest.Shipyard_shore_ambush.win_condition.l1.location = "Redmond_town_04";
			pchar.quest.Shipyard_shore_ambush.win_condition = "to_the_farm";
		break;
//------------------------------------------------------------------------------------------------------------------------------
//start WoodesRogers part 2

		case "to_the_farm":
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("to_the_farm1", 2.0);
		break;

		case "to_the_farm1":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "to_the_farm";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "to_the_farm2":
			LAi_SetPlayerType(pchar);
			PlaySound("VOICE\ENGLISH\blaze_lets_go.wav");

			SetCharacterShipLocation(characterFromID("CoastBrother29"), "Redmond_shore_ship");//PrisonShip
			SetCharacterShipLocation(characterFromID("CoastBrother30"), "Redmond_shore_ship");//PrisonShip
			SetCharacterShipLocation(characterFromID("CoastBrother32"), "Redmond_shore_ship");//tartane2
			SetCharacterShipLocation(characterFromID("CoastBrother33"), "Redmond_shore_03");//tartane2

			pchar.quest.Shipyard_shore_ambush.win_condition.l1 = "location";
			pchar.quest.Shipyard_shore_ambush.win_condition.l1.location = "Shipyard_shore";
			pchar.quest.Shipyard_shore_ambush.win_condition = "Shipyard_shore_ambush";
		break;
		
		case "Shipyard_shore_ambush":
			PlaySound("INTERFACE\key_lock.wav");
			Locations[FindLocation("Shipyard_shore")].reload.l30.disable = 1;	//back to stairs

			LAi_SetImmortal(pchar, true);
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "target", "Shipyard_shore_ambush1", 1.0);

			LAi_QuestDelay("Shipyard_shore_ambush_officers", 1.0);		//0.01 possible
		break;
	
		case "Shipyard_shore_ambush1":
			LAi_SetStayType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "Shipyard_shore", "goto", "target");
			RemoveCharacterEquip(characterFromID("wr_boc3"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("wr_boc3"), "pistol2");
			ChangeCharacterAddressGroup(characterFromID("wr_boc3"), "Shipyard_shore", "reload", "Falaise_de_fleur_location_01_05");
	
			LAi_QuestDelay("Shipyard_shore_ambush2", 0.5);
		break;

		case "Shipyard_shore_ambush2":
			LAi_SetActorType(characterFromID("wr_boc3"));
			LAi_ActorAttack(CharacterFromID("wr_boc3"), Pchar, "");
			
			LAi_QuestDelay("Shipyard_shore_ambush3", 2.5);		//was 1.5
			LAi_QuestDelay("Shipyard_shore_ambush5", 3.0);
		break;

		case "Shipyard_shore_ambush3":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead6.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorAnimation(Pchar, "death_1", "Shipyard_shore_ambush4", 4.0);

			LAi_QuestDelay("Shipyard_shore_ambush3A", 2.0);
		break;

		case "Shipyard_shore_ambush3A":
			PlaySound("VOICE\ENGLISH\Spa_m_b_050.wav");
		break;

		case "Shipyard_shore_ambush4":
			ChangeCharacterAddressGroup(Pchar, "Shipyard_shore", "goto", "target2");
			ChangeCharacterAddressGroup(characterFromID("wr_boc3"), "none", "", "");
			LAi_SetActorType(Pchar);
			LAi_ActorSetLayMode(Pchar);
		break;

		case "Shipyard_shore_ambush5":
			LAi_SetStayType(characterFromID("wr_boc3"));

			LAi_QuestDelay("Shipyard_shore_ambush6", 6.0);
		break;

		case "Shipyard_shore_ambush_officers":
			PlaySound("OBJECTS\DUEL\pistol_bbus.wav");
			CreateParticleSystem("gunfire" , -21.3, 6.1, 48.7, -21.3, 6.1, 48.7, sti(20) );
			
			LAi_QuestDelay("Shipyard_shore_ambush_officers1", 0.75);
		break;

		case "Shipyard_shore_ambush_officers1":
			PlaySound("OBJECTS\DUEL\pistol_bbus.wav");
			CreateParticleSystem("gunfire" , -21.4, 6.1, 45.3, -21.4, 6.1, 45.3, sti(20) );
		
			for (i = 1; i < 24; i++)
			{
				LAi_KillCharacter(characterFromID("gm_crew" + i));
			}
		break;
	
		case "Shipyard_shore_ambush6":
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			Locations[FindLocation("Shipyard_shore")].image = "";
			locations[FindLocation("Shipyard_shore")].type = "blues_port";

			DoQuestReloadToLocation("Shipyard_shore", "goto", "target" ,"Shipyard_shore_ambush7");
		break;

		case "Shipyard_shore_ambush7":
			SetModel(Pchar, "Howard_Pyle_1", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
			LAi_SetImmortal(pchar, false);
			Php = LAi_GetCharacterHP(Pchar);
			int Php95 = Php*0.95;
			LAi_ApplyCharacterDamage(Pchar, Php95);

			DeleteAttribute(Pchar, "items");
		TakeItemFromCharacter(Pchar, "chinatiger");	
			AddMoneyToCharacter(Pchar,-10000);
			GiveItem2Character(Pchar, "bladeX4");
			EquipCharacterByItem(Pchar, "bladeX4");
			GiveItem2Character(Pchar, "long_johns");
			GiveItem2Character(Pchar, "bandana");

			Locations[FindLocation("Shipyard_shore")].image = "Shipyard_shore.tga";
			
			LAi_QuestDelay("Shipyard_shore_ambush8", 3.0);
		break;

		case "Shipyard_shore_ambush8":
			LAi_SetPoorType(Pchar);
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("stars_short" , u, v+1, w, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("OBJECTS\VOICES\DEAD\male\dead7.wav");

			LAi_QuestDelay("pchar_playertype", 4.0);
			LAi_QuestDelay("Shipyard_shore_ambush9", 5.0);
			LAi_QuestDelay("start_alchemy2", 0.1);
		break;

		case "Shipyard_shore_ambush9":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "hidden_items";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "farm_ready_for_part2":
			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("wr_port")].reload.l2.disable = 0;			//to farm
	
			SetCharacterShipLocation(characterFromID("Coastbrother25"), "none");		//boat3 at wr_port
			SetCharacterShipLocation(characterFromID("Coastbrother26"), "none");		//corvette at wr_port
			SetCharacterShipLocation(characterFromID("Coastbrother27"), "none");		//boat2 at wr_port
		break;

	//-------------------------------------------------------------------------------------------------------
		case "delay_no_reinc":
			GameOverOrg("land");
		break;
	//-------------------------------------------------------------------------------------------------------
		case "pistol20_ammo_check":
			//from IF: itemsbox and IF: and LAi_events (fire_pistol)
			gp = GetCharacterItem(Pchar, "gunpowder");
			pb = GetCharacterItem(Pchar, "pistolbullets");

			if(gp >= 1 && pb >= 1)
			{
				if(CheckCharacterItem(Pchar,"pistolthrow5"))
				{
					if(IsEquipCharacterByItem(Pchar, "pistolthrow5"))
					RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE );

					TakeItemFromCharacter(Pchar, "pistolthrow5");
					GiveItem2Character(Pchar, "pistol20");
					EquipCharacterByItem(Pchar, "pistol20");

					if(CheckCharacterItem(Pchar,"ammobag1"))
					{
						TakeItemFromCharacter(Pchar, "ammobag1");
						GiveItem2Character(Pchar, "ammobag2");
					}
				}

				if(CheckCharacterItem(Pchar,"pistolthrow4"))
				{
					if(IsEquipCharacterByItem(Pchar, "pistolthrow4"))
					RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE );

					TakeItemFromCharacter(Pchar, "pistolthrow4");
					GiveItem2Character(Pchar, "pistolbelt");
					EquipCharacterByItem(Pchar, "pistolbelt");
					GiveItem2Character(Pchar, "pistol202");
					GiveItem2Character(Pchar, "pistol204");
					GiveItem2Character(Pchar, "pistol205");
					GiveItem2Character(Pchar, "pistol206");
					EquipCharacterByItem(Pchar, "pistol202");

					if(CheckCharacterItem(Pchar,"ammobag1"))
					{
						TakeItemFromCharacter(Pchar, "ammobag1");
						GiveItem2Character(Pchar, "ammobag2");
					}
				}

				if(CheckCharacterItem(Pchar,"pistolthrow3"))
				{
					if(IsEquipCharacterByItem(Pchar, "pistolthrow3"))
					RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE );

					TakeItemFromCharacter(Pchar, "pistolthrow3");
					GiveItem2Character(Pchar, "pistolbelt");
					EquipCharacterByItem(Pchar, "pistolbelt");
					GiveItem2Character(Pchar, "pistol204");
					GiveItem2Character(Pchar, "pistol205");
					GiveItem2Character(Pchar, "pistol206");
					EquipCharacterByItem(Pchar, "pistol204");

					if(CheckCharacterItem(Pchar,"ammobag1"))
					{
						TakeItemFromCharacter(Pchar, "ammobag1");
						GiveItem2Character(Pchar, "ammobag2");
					}
				}

				if(CheckCharacterItem(Pchar,"pistolthrow2"))
				{
					if(IsEquipCharacterByItem(Pchar, "pistolthrow2"))
					RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE );

					TakeItemFromCharacter(Pchar, "pistolthrow2");
					GiveItem2Character(Pchar, "pistolbelt");
					EquipCharacterByItem(Pchar, "pistolbelt");
					GiveItem2Character(Pchar, "pistol205");
					GiveItem2Character(Pchar, "pistol206");
					EquipCharacterByItem(Pchar, "pistol205");

					if(CheckCharacterItem(Pchar,"ammobag1"))
					{
						TakeItemFromCharacter(Pchar, "ammobag1");
						GiveItem2Character(Pchar, "ammobag2");
					}
				}

				if(CheckCharacterItem(Pchar,"pistolthrow1"))
				{
					if(IsEquipCharacterByItem(Pchar, "pistolthrow1"))
					RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE );

					TakeItemFromCharacter(Pchar, "pistolthrow1");
					GiveItem2Character(Pchar, "pistolbelt");
					EquipCharacterByItem(Pchar, "pistolbelt");
					GiveItem2Character(Pchar, "pistol206");
					EquipCharacterByItem(Pchar, "pistol206");

					if(CheckCharacterItem(Pchar,"ammobag1"))
					{
						TakeItemFromCharacter(Pchar, "ammobag1");
						GiveItem2Character(Pchar, "ammobag2");
					}
				}
			}
			else
			{
				if(CheckAttribute(Pchar,"quest.pistolthrow") && Pchar.quest.pistolthrow == "know_how")
				{
					if(IsEquipCharacterByItem(Pchar, "pistol20"))
					{
						RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
						TakeItemFromCharacter(Pchar, "pistol20");

						GiveItem2Character(Pchar, "pistolthrow5");
						EquipCharacterByItem(Pchar, "pistolthrow5");
					}

					if(CheckCharacterItem(Pchar, "pistolbelt"))
					{
						if(CheckCharacterItem(Pchar, "pistol206") && CheckCharacterItem(Pchar, "pistol205")
						&& CheckCharacterItem(Pchar, "pistol204") && CheckCharacterItem(Pchar, "pistol202"))
						{
							RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
							TakeItemFromCharacter(Pchar, "pistol206"); TakeItemFromCharacter(Pchar, "pistol205");
							TakeItemFromCharacter(Pchar, "pistol204"); TakeItemFromCharacter(Pchar, "pistol202");
							RemoveCharacterEquip(Pchar, BELT_ITEM_TYPE);
							TakeItemFromCharacter(Pchar, "pistolbelt");
							GiveItem2Character(Pchar, "pistolthrow4");
							EquipCharacterByItem(Pchar, "pistolthrow4");
						}
						else
						{
							if(CheckCharacterItem(Pchar, "pistol206") && CheckCharacterItem(Pchar, "pistol205")
							&& CheckCharacterItem(Pchar, "pistol204"))
							{
								RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
								TakeItemFromCharacter(Pchar, "pistol206"); TakeItemFromCharacter(Pchar, "pistol205");
								TakeItemFromCharacter(Pchar, "pistol204");
								RemoveCharacterEquip(Pchar, BELT_ITEM_TYPE);
								TakeItemFromCharacter(Pchar, "pistolbelt");
								GiveItem2Character(Pchar, "pistolthrow3");
								EquipCharacterByItem(Pchar, "pistolthrow3");
							}
						}
						else
						{
							if(CheckCharacterItem(Pchar, "pistol206") && CheckCharacterItem(Pchar, "pistol205"))
							{
								RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
								TakeItemFromCharacter(Pchar, "pistol206"); TakeItemFromCharacter(Pchar, "pistol205");
								RemoveCharacterEquip(Pchar, BELT_ITEM_TYPE);
								TakeItemFromCharacter(Pchar, "pistolbelt");
								GiveItem2Character(Pchar, "pistolthrow2");
								EquipCharacterByItem(Pchar, "pistolthrow2");
							}
						}
						else
						{
							if(CheckCharacterItem(Pchar, "pistol206"))
							{
								RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
								TakeItemFromCharacter(Pchar, "pistol206");
								RemoveCharacterEquip(Pchar, BELT_ITEM_TYPE);
								TakeItemFromCharacter(Pchar, "pistolbelt");
								GiveItem2Character(Pchar, "pistolthrow1");
								EquipCharacterByItem(Pchar, "pistolthrow1");
							}
						}
					}
				}
			}

			LAi_QuestDelay("pchar_outfit_check", 0.1);
		break;
	//-------------------------------------------------------------------------------------------------------
		case "pchar_outfit_check":
			//from IF: itemsbox (pick up) and IF: items.c (inventory) and "pistol20_ammo_check" (above)
			//and seadogs: reinc loose pistol20

			if(IsEquipCharacterByItem(Pchar, "ammobag2"))		//enough! p20, pbelt or any pthrow must be equipped already
			{
				if(CheckAttribute(Pchar,"model"))
				{
					switch(Pchar.model)
					{
						case "Pira4M_HTUS":
							SetModel(Pchar, "Pira4M_HTUS_a", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("PEOPLE\clothes1.wav"); PlaySound("INTERFACE\button1.wav");
						break;

						case "Pira4M_TUS":
							SetModel(Pchar, "Pira4M_TUS_a", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("PEOPLE\clothes1.wav"); PlaySound("INTERFACE\button1.wav");
						break;

						case "PriestRedM":
							SetModel(Pchar, "PriestRedM_a", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("PEOPLE\clothes1.wav"); PlaySound("INTERFACE\button1.wav");
						break;

						case "ShkiperM_U":
							SetModel(Pchar, "ShkiperM_U_a", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("PEOPLE\clothes1.wav"); PlaySound("INTERFACE\button1.wav");
						break;

						case "ShkiperM_UH":
							SetModel(Pchar, "ShkiperM_UH_a", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("PEOPLE\clothes1.wav"); PlaySound("INTERFACE\button1.wav");
						break;

						case "Howard_Pyle":
							SetModel(Pchar, "Howard_Pyle_a", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("PEOPLE\clothes1.wav"); PlaySound("INTERFACE\button1.wav");
						break;

						case "Howard_Pyle_hat":
							SetModel(Pchar, "Howard_Pyle_hat_a", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("PEOPLE\clothes1.wav"); PlaySound("INTERFACE\button1.wav");
						break;
					//..........................................................................................................
						case "Pira4M_HTUS_b":
							SetModel(Pchar, "Pira4M_HTUS_a", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("INTERFACE\button1.wav");
						break;

						case "Pira4M_TUS_b":
							SetModel(Pchar, "Pira4M_TUS_a", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("INTERFACE\button1.wav");
						break;

						case "PriestRedM_b":
							SetModel(Pchar, "PriestRedM_a", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("INTERFACE\button1.wav");
						break;

						case "ShkiperM_U_b":
							SetModel(Pchar, "ShkiperM_U_a", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("INTERFACE\button1.wav");
						break;

						case "ShkiperM_UH_b":
							SetModel(Pchar, "ShkiperM_UH_a", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("INTERFACE\button1.wav");
						break;

						case "Howard_Pyle_b":
							SetModel(Pchar, "Howard_Pyle_a", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("INTERFACE\button1.wav");
						break;

						case "Howard_Pyle_hat_b":
							SetModel(Pchar, "Howard_Pyle_hat_a", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("INTERFACE\button1.wav");
						break;
					}
				}
			}
			else
			{
				if(IsEquipCharacterByItem(Pchar, "pistol20") || IsEquipCharacterByItem(Pchar, "pistolbelt") || IsEquipCharacterByItem(Pchar, "pistolthrow5")
				|| IsEquipCharacterByItem(Pchar, "pistolthrow4") || IsEquipCharacterByItem(Pchar, "pistolthrow3") || IsEquipCharacterByItem(Pchar, "pistolthrow2")
				|| IsEquipCharacterByItem(Pchar, "pistolthrow1"))
				{
					if(CheckAttribute(Pchar,"model"))
					{
						switch(Pchar.model)
						{
							case "Pira4M_HTUS":
								SetModel(Pchar, "Pira4M_HTUS_b", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
								PlaySound("PEOPLE\clothes1.wav");
							break;

							case "Pira4M_TUS":
								SetModel(Pchar, "Pira4M_TUS_b", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
								PlaySound("PEOPLE\clothes1.wav");
							break;

							case "PriestRedM":
								SetModel(Pchar, "PriestRedM_b", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
								PlaySound("PEOPLE\clothes1.wav");
							break;

							case "ShkiperM_U":
								SetModel(Pchar, "ShkiperM_U_b", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
								PlaySound("PEOPLE\clothes1.wav");
							break;

							case "ShkiperM_UH":
								SetModel(Pchar, "ShkiperM_UH_b", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
								PlaySound("PEOPLE\clothes1.wav");
							break;

							case "Howard_Pyle":
								SetModel(Pchar, "Howard_Pyle_b", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
								PlaySound("PEOPLE\clothes1.wav");
							break;

							case "Howard_Pyle_hat":
								SetModel(Pchar, "Howard_Pyle_hat_b", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
								PlaySound("PEOPLE\clothes1.wav");
							break;
							//..........................................................................................................
							case "Pira4M_HTUS_a":
								SetModel(Pchar, "Pira4M_HTUS_b", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
								PlaySound("INTERFACE\button1.wav");
							break;

							case "Pira4M_TUS_a":
								SetModel(Pchar, "Pira4M_TUS_b", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
								PlaySound("INTERFACE\button1.wav");
							break;

							case "PriestRedM_a":
								SetModel(Pchar, "PriestRedM_b", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
								PlaySound("INTERFACE\button1.wav");
							break;

							case "ShkiperM_U_a":
								SetModel(Pchar, "ShkiperM_U_b", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
								PlaySound("INTERFACE\button1.wav");
							break;

							case "ShkiperM_UH_a":
								SetModel(Pchar, "ShkiperM_UH_b", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
								PlaySound("INTERFACE\button1.wav");
							break;

							case "Howard_Pyle_a":
								SetModel(Pchar, "Howard_Pyle_b", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
								PlaySound("INTERFACE\button1.wav");
							break;

							case "Howard_Pyle_hat_a":
								SetModel(Pchar, "Howard_Pyle_hat_b", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
								PlaySound("INTERFACE\button1.wav");
							break;
						}
					}
				}
			}
			else
			{
				if(CheckAttribute(Pchar,"model"))
				{
					switch(Pchar.model)
					{
						case "Pira4M_HTUS_b":
							SetModel(Pchar, "Pira4M_HTUS", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("PEOPLE\clothes1.wav");
						break;

						case "Pira4M_TUS_b":
							SetModel(Pchar, "Pira4M_TUS", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("PEOPLE\clothes1.wav");
						break;

						case "PriestRedM_b":
							SetModel(Pchar, "PriestRedM", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("PEOPLE\clothes1.wav");
						break;

						case "ShkiperM_U_b":
							SetModel(Pchar, "ShkiperM_U", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("PEOPLE\clothes1.wav");
						break;

						case "ShkiperM_UH_b":
							SetModel(Pchar, "ShkiperM_UH", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("PEOPLE\clothes1.wav");
						break;

						case "Howard_Pyle_b":
							SetModel(Pchar, "Howard_Pyle", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("PEOPLE\clothes1.wav");
						break;

						case "Howard_Pyle_hat_b":
							SetModel(Pchar, "Howard_Pyle_hat", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("PEOPLE\clothes1.wav");
						break;
					//..........................................................................................................
						case "Pira4M_HTUS_a":
							SetModel(Pchar, "Pira4M_HTUS", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("PEOPLE\clothes1.wav"); PlaySound("INTERFACE\button1.wav");
						break;

						case "Pira4M_TUS_a":
							SetModel(Pchar, "Pira4M_TUS", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("PEOPLE\clothes1.wav"); PlaySound("INTERFACE\button1.wav");
						break;

						case "PriestRedM_a":
							SetModel(Pchar, "PriestRedM", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("PEOPLE\clothes1.wav"); PlaySound("INTERFACE\button1.wav");
						break;

						case "ShkiperM_U_a":
							SetModel(Pchar, "ShkiperM_U", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("PEOPLE\clothes1.wav"); PlaySound("INTERFACE\button1.wav");
						break;

						case "ShkiperM_UH_a":
							SetModel(Pchar, "ShkiperM_UH", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("PEOPLE\clothes1.wav"); PlaySound("INTERFACE\button1.wav");
						break;

						case "Howard_Pyle_a":
							SetModel(Pchar, "Howard_Pyle", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("PEOPLE\clothes1.wav"); PlaySound("INTERFACE\button1.wav");
						break;

						case "Howard_Pyle_hat_a":
							SetModel(Pchar, "Howard_Pyle_hat", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
							PlaySound("PEOPLE\clothes1.wav"); PlaySound("INTERFACE\button1.wav");
						break;
					}
				}
			}
		break;
//.................................................................................................
		case "pistol_ranking_list":
			//from loosing ap/pf/ab: reinc (seadogs) or give itemsbox
			Pchar.quest.reduce_ammo = "off";	//resets function

			if(CheckCharacterItem(Pchar, "pistol20"))
			{
				Pchar.quest.ammo_prefer = "pb";
			}
			else
			{
				if(CheckCharacterItem(Pchar, "pistol10"))
				{
					Pchar.quest.ammo_prefer = "pg";
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar, "pistolmket"))
				{
					Pchar.quest.ammo_prefer = "mb";
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar, "pistol9") || CheckCharacterItem(Pchar, "pistol4") || CheckCharacterItem(Pchar, "pistol8")
				|| CheckCharacterItem(Pchar, "pistol6") || CheckCharacterItem(Pchar, "pistol3_14") || CheckCharacterItem(Pchar, "pistol206")
				|| CheckCharacterItem(Pchar, "pistol5") || CheckCharacterItem(Pchar, "pistol203"))
				{
					Pchar.quest.ammo_prefer = "pb";
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar, "pistolmtoon") || CheckCharacterItem(Pchar, "pistolbbuss"))
				{
					Pchar.quest.ammo_prefer = "pg";
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar, "pistol201") || CheckCharacterItem(Pchar, "pistol205") || CheckCharacterItem(Pchar, "pistol7")
				|| CheckCharacterItem(Pchar, "pistol4_1") || CheckCharacterItem(Pchar, "pistol204") || CheckCharacterItem(Pchar, "pistol2")
				|| CheckCharacterItem(Pchar, "piratespistol") || CheckCharacterItem(Pchar, "pistol0") || CheckCharacterItem(Pchar, "pistol202"))
				{
					Pchar.quest.ammo_prefer = "pb";
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar, "pistol3"))
				{
					Pchar.quest.ammo_prefer = "pg";
				}
			}
			else
			{
				if(CheckCharacterItem(Pchar, "pistol1"))
				{
					Pchar.quest.ammo_prefer = "pb";
				}
			}
			else
			{
				//no gun left (that uses ammo)
				Pchar.quest.ammo_prefer = "pb";
			}

			//LogIt("prefer = " + Pchar.quest.ammo_prefer);

			LAi_QuestDelay("reduce_ammo", 0.1);
		break;

		case "reduce_ammo":
			int maxp; int maxs; int sh;

			gp = GetCharacterItem(Pchar, "gunpowder");
			pb = GetCharacterItem(Pchar, "pistolbullets");
			pg = GetCharacterItem(Pchar, "pistolgrapes");
			mb = GetCharacterItem(Pchar, "musketbullets");

			//-------------------------------------------------
			if(IsEquipCharacterByItem(Pchar, "ammobag"))
			{
				maxp = 24;
			}
			else
			{
				if(IsEquipCharacterByItem(Pchar, "ammobag2") || IsEquipCharacterByItem(Pchar, "bladepowderhornP") || IsEquipCharacterByItem(Pchar, "bladepowderhornA"))
				{
					maxp = 18;
				}
				else
				{
					if(IsEquipCharacterByItem(Pchar, "powderflask"))
					{
						maxp = 12;
					}
				}
				else maxp = 6;
			}

			if(gp > maxp)
			{
				TakeNItems(Pchar,"gunpowder", -100);
				TakeNItems(Pchar,"gunpowder", maxp);
			}

			//-------------------------------------------------
			if(IsEquipCharacterByItem(Pchar, "ammobag"))
			{
				maxs = 24;
			}
			else
			{
				if(IsEquipCharacterByItem(Pchar, "ammobag2"))
				{
					maxs = 18;
				}
				else
				{
					if(IsEquipCharacterByItem(Pchar, "ammopouch"))
					{
						maxs = 12;
					}
					else maxs = 6;
				}
			}

			sh = pb + pg + mb*2;

			if(sh > maxs)
			{
				if(CheckAttribute(Pchar,"quest.ammo_prefer"))
				{
					switch(Pchar.quest.ammo_prefer)
					{
						case "pb":
							if(mb > 0)
							{
								LAi_QuestDelay("reduce_mb", 0.1);
							}
							else
							{
								if(pg > 0)
								{
									LAi_QuestDelay("reduce_pg", 0.1);
								}
								else
								{
									if(pb > 0)
									{
										LAi_QuestDelay("reduce_pb", 0.1);
									}
								}
							}
						break;

						case "pg":
							if(mb > 0)
							{
								LAi_QuestDelay("reduce_mb", 0.1);
							}
							else
							{
								if(pb > 0)
								{
									LAi_QuestDelay("reduce_pb", 0.1);
								}
								else
								{
									if(pg > 0)
									{
										LAi_QuestDelay("reduce_pg", 0.1);
									}
								}
							}
						break;

						case "mb":
							if(pg > 0)
							{
								LAi_QuestDelay("reduce_pg", 0.1);
							}
							else
							{
								if(pb > 0)
								{
									LAi_QuestDelay("reduce_pb", 0.1);
								}
								else
								{
									if(mb > 0)
									{
										LAi_QuestDelay("reduce_mb", 0.1);
									}
								}
							}
						break;
					}
				}
			}
		break;

		case "reduce_mb":
			mb = GetCharacterItem(Pchar, "musketbullets");

			if(CheckCharacterItem(Pchar, "ammopouch"))
			{
				maxs = 12;
			}
			else maxs = 6;

			TakeNItems(Pchar,"musketbullets", -1);
			sh = pb + pg + mb*2;

			if(sh > maxs)
			{
				LAi_QuestDelay("reduce_ammo", 0.1); 	//always restart from 'reduce_ammo'
			}
			else return;
		break;

		case "reduce_pg":
			pg = GetCharacterItem(Pchar, "pistolgrapes");

			if(CheckCharacterItem(Pchar, "ammopouch"))
			{
				maxs = 12;
			}
			else maxs = 6;

			TakeNItems(Pchar,"pistolgrapes", -1);
			sh = pb + pg + mb*2;

			if(sh > maxs)
			{
				LAi_QuestDelay("reduce_ammo", 0.1); 	//always restart from 'reduce_ammo'
			}
			else return;
		break;

		case "reduce_pb":
			pb = GetCharacterItem(Pchar, "pistolbullets");

			if(CheckCharacterItem(Pchar, "ammopouch"))
			{
				maxs = 12;
			}
			else maxs = 6;

			TakeNItems(Pchar,"pistolbullets", -1);
			sh = pb + pg + mb*2;

			if(sh > maxs)
			{
				LAi_QuestDelay("reduce_ammo", 0.1);	//always restart from 'reduce_ammo'
			}
			else return;
		break;

//----------------------------------------------------------------------------------------------------------------
//Teach head, storyteller

		case "Teach_head_teleport":
			PlaySound("PEOPLE\transform.wav");
			LAi_SetStayType(Pchar);

			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("stars_short" , u, v+1.5, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("stars_short" , u, v+1.0, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("stars_short" , u, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("stars_short" , u, v, w, 0.0, 0.0, 0.0, sti(20) );

			if(Pchar.location != "bb_lower_cave") SetModel(PChar, "Skel4", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);
		//	SetModel(PChar, "Skel4", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);			

			LAi_QuestDelay("Teach_head_teleport1", 2.5);	//was 1.5
		break;

		case "Teach_head_teleport1":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead6.wav");
			
			LAi_QuestDelay("Teach_head_teleport2", 1.5);
		break;

		case "Teach_head_teleport2":
			if(CheckAttribute(Pchar,"quest.Teach_head"))
			{
				switch(Pchar.quest.Teach_head)
				{
					case "1":
						DoQuestReloadToLocation("Redmond_Town_01", "reload", "reload_2_3" ,"Teach_head_1");		
					break;

					case "2":
						DoQuestReloadToLocation("QC_Town", "reload", "reload9" ,"Teach_head_2");
					break;

					case "3":
						DoQuestReloadToLocation("Redmond_Port", "reload", "reload_2_city" ,"Teach_head_3");
					break;
				
					case "4":
						DoQuestReloadToLocation("Redmond_Town_01", "reload", "reload5" ,"Teach_head_4");
					break;
				
					case "5":
						DoQuestReloadToLocation("Redmond_Town_01", "reload", "reload_2_3" ,"Teach_head_5");	
					break;

					case "6":
						DoQuestReloadToLocation("Redmond_Port", "reload", "reload_2_city" ,"Teach_head_6");
					break;

					case "7":
						DoQuestReloadToLocation("Redmond_Town_04", "officers", "reload_4_1_2" ,"Teach_head_7");		
					break;

					case "8":
						//pistol6
				//		DoQuestReloadToLocation("Redmond_Port", "reload", "reload_2_city" ,"Teach_head_8");
						DoQuestReloadToLocation("Redmond_Town_01", "reload", "Door_7" ,"Teach_head_8");
					break;

					case "9":
						//med chest
				//		DoQuestReloadToLocation("Redmond_Port", "reload", "reload_2_city" ,"Teach_head_9");
						DoQuestReloadToLocation("Redmond_Town_01", "reload", "Door_6" ,"Teach_head_9");
					break;

					case "10":
						DoQuestReloadToLocation("wr_cave_shore", "reload", "reload2" ,"Teach_head_10");
					break;

					case "11":
						DoQuestReloadToLocation("Redmond_Port", "reload", "reload_2_city" ,"Teach_head_11");	
					break;

					case "12":
						DoQuestReloadToLocation("wr_corv_crew", "reload", "reload1" ,"Teach_head_12");
					break;

					case "14":
						DoQuestReloadToLocation("Redmond_Town_03", "reload", "door_6" ,"Teach_head_14");
					break;

					case "15":
						DoQuestReloadToLocation("wr_church_outside", "reload", "reload2" ,"Teach_head_15");		
					break;

					case "16":
						DoQuestReloadToLocation("wr_cave_shore", "reload", "locator3" ,"Teach_head_16");
					break;

					case "17":
						DoQuestReloadToLocation("wr_cavern", "reload", "reload3" ,"Teach_head_17");		
					break;

					case "18":
						DoQuestReloadToLocation("wr_port", "goto", "pchar_climb1" ,"Teach_head_18");
					break;

					case "20":
						DoQuestReloadToLocation("Redmond_Town_01", "reload", "door_7" ,"Teach_head_20");
					break;

					case "21":
						DoQuestReloadToLocation("Redmond_Town_04", "reload", "reload2" ,"Teach_head_21");
					
					break;
				}
			}				
		break;
//pär jump starts

	//....................................................................................................

		case "Teach_head_1":
			SetModel(PChar, "Howard_Pyle", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			DeleteAttribute(Pchar, "items");

			AddMoneyToCharacter(Pchar,-2000);
			TakeItemFromCharacter(Pchar, "map");
			GiveItem2Character(Pchar, "bladeX4");
			EquipCharacterByItem(Pchar, "bladeX4");

			LAi_QuestDelay("Teach_head_all1", 0.01);	
		break;

		case "Teach_head_2":
			SetModel(PChar, "Howard_Pyle", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			DeleteAttribute(Pchar, "items");

			AddMoneyToCharacter(Pchar,-2000);
			AddMoneyToCharacter(Pchar, 550);
			GiveItem2Character(Pchar, "bladeX4");
			GiveItem2Character(Pchar, "blade1");
			EquipCharacterByItem(Pchar, "blade1");
			GiveItem2Character(Pchar, "PiratesPistol");
			EquipCharacterByItem(Pchar, "PiratesPistol");
			TakeNItems(Pchar,"gunpowder", 6);
			TakeNItems(Pchar,"pistolbullets", 6);
			TakeNItems(Pchar,"medical1", 2);
			TakeNItems(PChar, "compass1",1);
			EquipCharacterbyItem(PChar, "compass1");
			TakeNItems(PChar, "spyglass2",1);
			EquipCharacterbyItem(PChar, "spyglass2"); 

			SetQuestHeader("Woodes_Rogers_quest");
			AddQuestRecord("Woodes_Rogers_quest", "1");
			AddQuestRecord("Woodes_Rogers_quest", "2");

			LAi_QuestDelay("Teach_head_all1", 0.01);	
		break;

		case "Teach_head_3":
			SetModel(PChar, "Pira4B", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			DeleteAttribute(Pchar, "items");

			AddMoneyToCharacter(Pchar, -2000);
			GiveItem2Character(Pchar, "bladeX4");	// PB: Gives you your fists
			EquipCharacterByItem(Pchar, "bladeX4");
			TakeItemFromCharacter(Pchar, "map");

			AddMoneyToCharacter(characterFromID("Wench3"), 5);
			GiveItem2Character(characterFromID("Wench3"), "pistol0");
			EquipCharacterbyItem(characterFromID("Wench3"), "pistol0");
			GiveItem2Character(characterFromID("Wench3"), "bladep0");
			EquipCharacterbyItem(characterFromID("Wench3"), "bladep0");
			TakenItems(CharacterFromID("Wench3"), "gunpowder", 6);
			TakenItems(CharacterFromID("Wench3"), "pistolbullets", 6);

			SetQuestHeader("Woodes_Rogers_quest");
			AddQuestRecord("Woodes_Rogers_quest", "1");
			AddQuestRecord("Woodes_Rogers_quest", "2");
			AddQuestRecord("Woodes_Rogers_quest", "3");
			AddQuestRecord("Woodes_Rogers_quest", "5");
			AddQuestRecord("Woodes_Rogers_quest", "6");
			AddQuestRecord("Woodes_Rogers_quest", "7");
			CloseQuestHeader("Woodes_Rogers_quest");		

			LAi_QuestDelay("Teach_head_all1", 0.01);	
		break;

		case "Teach_head_4":
			SetModel(PChar, "Pira4M_C", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			Pchar.perks.list.BasicDefence = true;	
					
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);	
			DeleteAttribute(Pchar, "items");

			AddMoneyToCharacter(Pchar,-2000);
			AddMoneyToCharacter(Pchar, 1002);	//sold kitchen items
			GiveItem2Character(Pchar, "bladeX4");	// PB: Gives you your fists
			GiveItem2Character(Pchar, "Barmansknife");
			EquipCharacterByItem(Pchar, "Barmansknife");
			GiveItem2Character(Pchar, "pistol201");
			GiveItem2Character(Pchar, "pistol202");
			EquipCharacterbyItem(Pchar, "pistol202");
			TakeItemFromCharacter(Pchar, "map");
			TakeNItems(Pchar,"medical1", 2);			

			LAi_QuestDelay("selkirk_gone2", 0.1);	//4 only obs

			LAi_QuestDelay("Teach_head_all1", 0.01);	
		break;

		case "Teach_head_5":
			SetModel(PChar, "Pira4M_C", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			Pchar.perks.list.BasicDefence = true;	

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			DeleteAttribute(Pchar, "items");

			AddMoneyToCharacter(Pchar,-2000);
			AddMoneyToCharacter(Pchar, 1962);		//sold items from shop too now
			TakeItemFromCharacter(Pchar, "map");
			GiveItem2Character(Pchar, "bladepickaxe1");
			GiveItem2Character(Pchar, "blade4-2");
			EquipCharacterByItem(Pchar, "blade4-2");
			GiveItem2Character(Pchar, "pistol201");
			GiveItem2Character(Pchar, "pistol202");
			GiveItem2Character(Pchar, "pistol203");
			EquipCharacterbyItem(Pchar, "pistol203");
			GiveItem2Character(Pchar, "powderflask");
			EquipCharacterbyItem(Pchar, "powderflask");
			GiveItem2Character(Pchar, "ammopouch");
			EquipCharacterbyItem(Pchar, "ammopouch");
			TakeNItems(Pchar,"gunpowder", 12);
			TakeNItems(Pchar,"pistolbullets", 12);
			TakeNItems(Pchar,"medical1", 2);
			TakeNItems(Pchar,"chinatiger", 1);

			AddQuestRecord("Woodes_Rogers_reward_3", "1");
			AddQuestRecord("Woodes_Rogers_reward_3", "2");
			AddQuestRecord("Woodes_Rogers_reward_3", "3");
			AddQuestRecord("Woodes_Rogers_reward_3", "4");
			AddQuestRecord("Woodes_Rogers_reward_3", "5");

			LAi_QuestDelay("Teach_head_all1", 0.01);	
		break;

		case "Teach_head_6":
			SetModel(PChar, "Pira4M_H", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			Pchar.perks.list.BasicDefence = true;	
		
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			DeleteAttribute(Pchar, "items");

			AddMoneyToCharacter(Pchar,-2000);
			AddMoneyToCharacter(Pchar, 1962);
			TakeItemFromCharacter(Pchar, "map");
			GiveItem2Character(Pchar, "bladeA11");
			EquipCharacterByItem(Pchar, "bladeA11");
			GiveItem2Character(Pchar, "pistol201");
			GiveItem2Character(Pchar, "pistol202");
			GiveItem2Character(Pchar, "pistol203");
			GiveItem2Character(Pchar, "pistol204");
			EquipCharacterbyItem(Pchar, "pistol204");
			GiveItem2Character(Pchar, "powderflask");
			EquipCharacterbyItem(Pchar, "powderflask");
			GiveItem2Character(Pchar, "ammopouch");
			EquipCharacterbyItem(Pchar, "ammopouch");
			TakeNItems(Pchar,"gunpowder", 12);
			TakeNItems(Pchar,"pistolbullets", 12);
			TakeNItems(Pchar,"medical1", 2);
			TakeNItems(Pchar,"chinatiger", 1);

			LAi_QuestDelay("Teach_head_all1", 0.01);	
		break;

		case "Teach_head_7":
			SetModel(PChar, "Pira4M_HT", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			Pchar.perks.list.BasicDefence = true;	

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			DeleteAttribute(Pchar, "items");

			AddMoneyToCharacter(Pchar,-2000);
			AddMoneyToCharacter(Pchar, 1962);
			GiveItem2Character(Pchar, "map");
			GiveItem2Character(Pchar, "bladeA11");
			GiveItem2Character(Pchar, "bladebarrel");
			EquipCharacterByItem(Pchar, "bladebarrel");
			GiveItem2Character(Pchar, "pistol201");
			GiveItem2Character(Pchar, "pistol202");
			GiveItem2Character(Pchar, "pistol203");
			GiveItem2Character(Pchar, "pistol204");
			EquipCharacterbyItem(Pchar, "pistol204");
			GiveItem2Character(Pchar, "powderflask");
			EquipCharacterbyItem(Pchar, "powderflask");
			GiveItem2Character(Pchar, "ammopouch");
			EquipCharacterbyItem(Pchar, "ammopouch");
			TakeNItems(Pchar,"gunpowder", 12);
			TakeNItems(Pchar,"pistolbullets", 12);
			GiveItem2Character(Pchar, "spyglass2");
			EquipCharacterbyItem(Pchar, "spyglass2");
			TakeNItems(Pchar,"medical1", 2);
			TakeNItems(Pchar,"chinatiger", 1);

			LAi_QuestDelay("Teach_head_all1", 0.01);	
		break;

		case "Teach_head_8":
			SetModel(PChar, "Pira4M_HT", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			Pchar.perks.list.BasicDefence = true;	

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			DeleteAttribute(Pchar, "items");

			AddMoneyToCharacter(Pchar,-2000);
			AddMoneyToCharacter(Pchar, 1962);
			GiveItem2Character(Pchar, "map");
			GiveItem2Character(Pchar, "bladeA11");
			EquipCharacterByItem(Pchar, "bladeA11");
			GiveItem2Character(Pchar, "pistol201");
			GiveItem2Character(Pchar, "pistol202");
			GiveItem2Character(Pchar, "pistol203");
			GiveItem2Character(Pchar, "pistol204");
			GiveItem2Character(Pchar, "pistol205");
			EquipCharacterbyItem(Pchar, "pistol205");
			GiveItem2Character(Pchar, "powderflask");
			EquipCharacterbyItem(Pchar, "powderflask");
			GiveItem2Character(Pchar, "ammopouch");
			EquipCharacterbyItem(Pchar, "ammopouch");
			TakeNItems(Pchar,"gunpowder", 12);
			TakeNItems(Pchar,"pistolbullets", 12);
			GiveItem2Character(Pchar, "spyglass2");
			EquipCharacterbyItem(Pchar, "spyglass2");
			TakeNItems(Pchar,"medical1", 2);
			TakeNItems(Pchar,"chinatiger", 1);

			AddQuestRecord("Woodes_Rogers_reward_5", "2");
			CloseQuestHeader("Woodes_Rogers_reward_5");
			
			LAi_QuestDelay("Teach_head_all1", 0.01);	
		break;

		case "Teach_head_9":
			SetModel(PChar, "Pira4M_HTU", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			Pchar.perks.list.BasicDefence = true;	

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			DeleteAttribute(Pchar, "items");

			AddMoneyToCharacter(Pchar,-2000);
			GiveItem2Character(Pchar, "map");		
			GiveItem2Character(Pchar, "bladeX4");
			EquipCharacterByItem(Pchar, "bladeX4");
			GiveItem2Character(Pchar, "pistol206");
			EquipCharacterByItem(Pchar, "pistol206");
			GiveItem2Character(Pchar, "spyglass2");
			EquipCharacterbyItem(Pchar, "spyglass2");
			TakeNItems(Pchar,"medical1", 2);
			TakeNItems(Pchar,"chinatiger", 1);

			SetQuestHeader("Charles_Vanes_quest");
			AddQuestRecord("Charles_Vanes_quest", "1");

			LAi_QuestDelay("Teach_head_all1", 0.01);	
		break;

		case "Teach_head_10":
			SetModel(PChar, "Pira4M_HTU_cr", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			Pchar.perks.list.BasicDefence = true;	

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			DeleteAttribute(Pchar, "items");

			AddMoneyToCharacter(Pchar,-2000);
			GiveItem2Character(Pchar, "map");			
			GiveItem2Character(Pchar, "bladeX4");
			EquipCharacterByItem(Pchar, "bladeX4");
			GiveItem2Character(Pchar, "pistol206");
			EquipCharacterByItem(Pchar, "pistol206");
			GiveItem2Character(Pchar, "bladesurgcan3_r");
			EquipCharacterByItem(Pchar, "bladesurgcan3_r");
			GiveItem2Character(Pchar, "pistolmdchest_F6_CS");		
			EquipCharacterByItem(Pchar, "pistolmdchest_F6_CS");
			GiveItem2Character(Pchar, "leeches");
			GiveItem2Character(Pchar, "prescriptions");
			GiveItem2Character(Pchar, "rolls_of_bandages");
			GiveItem2Character(Pchar, "medicine_leaves");			
			GiveItem2Character(Pchar, "spyglass2");
			EquipCharacterbyItem(Pchar, "spyglass2");
			TakeNItems(Pchar,"medical1", 2);
			TakeNItems(Pchar,"chinatiger", 1);			

			SetQuestHeader("Charles_Vanes_quest");
			AddQuestRecord("Charles_Vanes_quest", "1");
			AddQuestRecord("Charles_Vanes_quest", "8");
			AddQuestRecord("Charles_Vanes_quest", "2");
			AddQuestRecord("Charles_Vanes_quest", "3");
			SetQuestHeader("Medicine_chest");
			CloseQuestHeader("Medicine_chest");

			PlaySound("VOICE\ENGLISH\ayay_captain.wav");

			LAi_QuestDelay("Teach_head_all1", 0.01);	
		break;

		case "Teach_head_11":
			SetModel(PChar, "Pira4M_HTUS", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			Pchar.perks.list.BasicDefence = true;	
			Pchar.perks.list.GunProfessional = true;
			Pchar.perks.list.GunFighter = true;
			Pchar.perks.list.IronWill = true;

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			DeleteAttribute(Pchar, "items");

			AddMoneyToCharacter(Pchar,-2000);
			GiveItem2Character(Pchar, "map");			
			GiveItem2Character(Pchar, "bladeX4");
			GiveItem2Character(Pchar, "bladeA11");
			EquipCharacterByItem(Pchar, "bladeA11");
			GiveItem2Character(Pchar, "pistol201");
			GiveItem2Character(Pchar, "pistol202");
			GiveItem2Character(Pchar, "pistol203");
			GiveItem2Character(Pchar, "pistol204");
			GiveItem2Character(Pchar, "pistol205");
			GiveItem2Character(Pchar, "pistol206");
			EquipCharacterByItem(Pchar, "pistol203");
			GiveItem2Character(Pchar, "powderflask");
			EquipCharacterbyItem(Pchar, "powderflask");
			GiveItem2Character(Pchar, "ammopouch");
			EquipCharacterbyItem(Pchar, "ammopouch");
			TakeNItems(Pchar, "gunpowder", -100);
			TakeNItems(Pchar, "pistolbullets", -100);
			TakeNItems(Pchar,"gunpowder", 12);
			TakeNItems(Pchar,"pistolbullets", 12);
			GiveItem2Character(Pchar, "spyglass2");
			EquipCharacterbyItem(Pchar, "spyglass2");
			TakeNItems(Pchar,"medical1", 2);
			TakeNItems(Pchar,"chinatiger", 1);

			SetQuestHeader("Charles_Vanes_quest");
			AddQuestRecord("Charles_Vanes_quest", "1");
			AddQuestRecord("Charles_Vanes_quest", "8");
			AddQuestRecord("Charles_Vanes_quest", "2");
			AddQuestRecord("Charles_Vanes_quest", "3");
			AddQuestRecord("Charles_Vanes_quest", "4");
			AddQuestRecord("Charles_Vanes_quest", "5");

			LAi_QuestDelay("Teach_head_all1", 0.01);	
		break;

		case "Teach_head_12":
			SetModel(PChar, "Pira4M_HTUS_b", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			Pchar.perks.list.BasicDefence = true;	
			Pchar.perks.list.GunProfessional = true;
			Pchar.perks.list.GunFighter = true;
			Pchar.perks.list.IronWill = true;

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			DeleteAttribute(Pchar, "items");

			AddMoneyToCharacter(Pchar,-2000);
			GiveItem2Character(Pchar, "map");	
			GiveItem2Character(Pchar, "bladeX4");
			EquipCharacterByItem(Pchar, "bladeX4");
			GiveItem2Character(Pchar, "pistol20");
			EquipCharacterByItem(Pchar, "pistol20");
			GiveItem2Character(Pchar, "powderflask");
			EquipCharacterbyItem(Pchar, "powderflask");
			GiveItem2Character(Pchar, "ammopouch");
			EquipCharacterbyItem(Pchar, "ammopouch");
			TakeNItems(Pchar, "gunpowder", -100);
			TakeNItems(Pchar, "pistolbullets", -100);
			TakeNItems(Pchar,"gunpowder", 12);
			TakeNItems(Pchar,"pistolbullets", 12);
			TakeNItems(PChar, "spyglass2",1);
			EquipCharacterbyItem(PChar, "spyglass2"); 
			TakeNItems(Pchar,"medical1", 2);
			TakeNItems(Pchar,"chinatiger", 1);
			GiveItem2Character(Pchar, "amnesty_doc");
			GiveItem2Character(Pchar, "book41");
			GiveItem2Character(Pchar, "book42");
			GiveItem2Character(Pchar, "book43");
			GiveItem2Character(Pchar, "book44");
			GiveItem2Character(Pchar, "book45");
			GiveItem2Character(Pchar, "book46");
			GiveItem2Character(Pchar, "book47");
			GiveItem2Character(Pchar, "book48");
			GiveItem2Character(Pchar, "book49");
			GiveItem2Character(Pchar, "book50");

			SetQuestHeader("Charles_Vanes_quest");
			AddQuestRecord("Charles_Vanes_quest", "1");
			AddQuestRecord("Charles_Vanes_quest", "8");
			AddQuestRecord("Charles_Vanes_quest", "2");
			AddQuestRecord("Charles_Vanes_quest", "3");
			AddQuestRecord("Charles_Vanes_quest", "4");
			AddQuestRecord("Charles_Vanes_quest", "5");
			SetQuestHeader("Woodes_Rogers_reward_7");
			AddQuestRecord("Woodes_Rogers_reward_7", "1");
			AddQuestRecord("Woodes_Rogers_reward_7", "2");
			AddQuestRecord("Woodes_Rogers_reward_7", "3");
			AddQuestRecord("Woodes_Rogers_reward_7", "4");

			LAi_QuestDelay("Teach_head_all1", 0.01);	
		break;

		case "Teach_head_14":
			SetModel(PChar, "Pira4M_HTUS_a", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			Pchar.perks.list.BasicDefence = true;	
			Pchar.perks.list.GunProfessional = true;
			Pchar.perks.list.GunFighter = true;
			Pchar.perks.list.IronWill = true;

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			DeleteAttribute(Pchar, "items");

			AddMoneyToCharacter(Pchar,-2000);
			AddMoneyToCharacter(Pchar, 30);
			GiveItem2Character(Pchar, "map");	
			GiveItem2Character(Pchar, "bladeanchor");			
			EquipCharacterByItem(Pchar, "bladeanchor");
			GiveItem2Character(Pchar, "bladepclub203");
			TakeItemFromCharacter(Pchar, "bladeX4");
			GiveItem2Character(Pchar, "pistol20");
			EquipCharacterByItem(Pchar, "pistol20");
			GiveItem2Character(Pchar, "ammobag2");
			EquipCharacterbyItem(Pchar, "ammobag2");
			TakeNItems(Pchar, "gunpowder", -100);
			TakeNItems(Pchar, "pistolbullets", -100);
			TakeNItems(Pchar,"gunpowder", 15);
			TakeNItems(Pchar,"pistolbullets", 18);
			TakeNItems(PChar, "spyglass2",1);
			EquipCharacterbyItem(PChar, "spyglass2"); 
			TakeNItems(Pchar,"medical1", 2);
			TakeNItems(Pchar,"chinatiger", 1);
			TakeNItems(Pchar, "blade1", 8);
			TakeNItems(Pchar, "pistol2", 8);

			SetQuestHeader("Charles_Vanes_quest");
			AddQuestRecord("Charles_Vanes_quest", "1");
			AddQuestRecord("Charles_Vanes_quest", "8");
			AddQuestRecord("Charles_Vanes_quest", "2");
			AddQuestRecord("Charles_Vanes_quest", "3");
			AddQuestRecord("Charles_Vanes_quest", "4");
			AddQuestRecord("Charles_Vanes_quest", "5");
			CloseQuestHeader("Wine_cellars");

			LAi_QuestDelay("Teach_head_all1", 0.01);	
		break;

		case "Teach_head_15":
			SetModel(PChar, "PriestRedM_cloth", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			Pchar.perks.list.BasicDefence = true;	
			Pchar.perks.list.GunProfessional = true;
			Pchar.perks.list.GunFighter = true;
			Pchar.perks.list.IronWill = true;	

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			DeleteAttribute(Pchar, "items");

			AddMoneyToCharacter(Pchar,-2000);
			GiveItem2Character(Pchar, "map");
			TakeItemFromCharacter(Pchar, "bladeX4");			
			GiveItem2Character(Pchar, "bladechurchsilver");
			EquipCharacterByItem(Pchar, "bladechurchsilver");
			GiveItem2Character(Pchar, "pistol20");
			EquipCharacterByItem(Pchar, "pistol20");
			GiveItem2Character(Pchar, "ammobag2");
			EquipCharacterbyItem(Pchar, "ammobag2");
			GiveItem2Character(Pchar, "fake_anchor");
			GiveItem2Character(Pchar, "fake_pclub");
			TakeNItems(Pchar, "gunpowder", -100);
			TakeNItems(Pchar, "pistolbullets", -100);
			TakeNItems(Pchar,"gunpowder", 15);
			TakeNItems(Pchar,"pistolbullets", 18);
			TakeNItems(PChar, "spyglass2",1);
			EquipCharacterbyItem(PChar, "spyglass2"); 
			TakeNItems(Pchar,"medical1", 2);
			TakeNItems(Pchar,"chinatiger", 1);
			GiveItem2Character(Pchar, "pack_of_red_cloth");
			GiveItem2Character(Pchar, "fake_chalice");
			GiveItem2Character(Pchar, "fake_reliquary");
			GiveItem2Character(Pchar, "jewelcross");
			GiveItem2Character(Pchar, "fake_censer");
			GiveItem2Character(Pchar, "fake_candelabre");

			SetQuestHeader("Charles_Vanes_quest");
			AddQuestRecord("Charles_Vanes_quest", "1");
			AddQuestRecord("Charles_Vanes_quest", "8");
			AddQuestRecord("Charles_Vanes_quest", "2");
			AddQuestRecord("Charles_Vanes_quest", "3");
			AddQuestRecord("Charles_Vanes_quest", "4");
			AddQuestRecord("Charles_Vanes_quest", "5");
			AddQuestRecord("Charles_Vanes_quest", "9");
			AddQuestRecord("Charles_Vanes_quest", "6");
			DeleteQuestHeader("Wine_cellars");	

			LAi_QuestDelay("Teach_head_all1", 0.01);	
		break;

		case "Teach_head_16":
			SetModel(PChar, "PriestRedM_a", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			Pchar.perks.list.BasicDefence = true;	
			Pchar.perks.list.GunProfessional = true;
			Pchar.perks.list.GunFighter = true;
			Pchar.perks.list.IronWill = true;

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			DeleteAttribute(Pchar, "items");

			AddMoneyToCharacter(Pchar,-2000);
			GiveItem2Character(Pchar, "map");
			GiveItem2Character(Pchar, "bladeanchor");			
			EquipCharacterByItem(Pchar, "bladeanchor");
			GiveItem2Character(Pchar, "bladepclub203");
			TakeItemFromCharacter(Pchar, "bladeX4");
			GiveItem2Character(Pchar, "pistol20");
			EquipCharacterByItem(Pchar, "pistol20");
			GiveItem2Character(Pchar, "ammobag2");
			EquipCharacterbyItem(Pchar, "ammobag2");
			TakeNItems(Pchar, "gunpowder", -100);
			TakeNItems(Pchar, "pistolbullets", -100);
			TakeNItems(Pchar,"gunpowder", 15);
			TakeNItems(Pchar,"pistolbullets", 18);
			TakeNItems(PChar, "spyglass2",1);
			EquipCharacterbyItem(PChar, "spyglass2"); 
			TakeNItems(Pchar,"medical1", 2);
			TakeNItems(Pchar,"chinatiger", 1);

			SetQuestHeader("Cave_shore");
			AddQuestRecord("Cave_shore", "1");
			AddQuestRecord("Cave_shore", "2");

			LAi_QuestDelay("Teach_head_all1", 0.01);	
		break;

		case "Teach_head_17":
			SetModel(PChar, "PriestRedM_a", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			Pchar.perks.list.BasicDefence = true;	
			Pchar.perks.list.GunProfessional = true;
			Pchar.perks.list.GunFighter = true;
			Pchar.perks.list.IronWill = true;

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			DeleteAttribute(Pchar, "items");

			AddMoneyToCharacter(Pchar,-2000);
			GiveItem2Character(Pchar, "map");
			GiveItem2Character(Pchar, "bladeanchor");			
			EquipCharacterByItem(Pchar, "bladeanchor");
			GiveItem2Character(Pchar, "bladepclub203");
			TakeItemFromCharacter(Pchar, "bladeX4");
			GiveItem2Character(Pchar, "pistol20");
			EquipCharacterByItem(Pchar, "pistol20");
			GiveItem2Character(Pchar, "ammobag2");
			EquipCharacterbyItem(Pchar, "ammobag2");
			TakeNItems(Pchar, "gunpowder", -100);
			TakeNItems(Pchar, "pistolbullets", -100);
			TakeNItems(Pchar,"gunpowder", 18);
			TakeNItems(Pchar,"pistolbullets", 18);
			TakeNItems(Pchar,"potionwine2", 2);
			TakeNItems(PChar, "spyglass2",1);
			EquipCharacterbyItem(PChar, "spyglass2");
			TakeNItems(Pchar,"chinatiger", 1); 
			
			SetQuestHeader("Cave_shore");
			AddQuestRecord("Cave_shore", "1");
			AddQuestRecord("Cave_shore", "2");
			AddQuestRecord("Cave_shore", "3");
			AddQuestRecord("Cave_shore", "4");
			AddQuestRecord("Cave_shore", "5");
			AddQuestRecord("Cave_shore", "6");

			LAi_QuestDelay("Teach_head_all1", 0.01);	
		break;

		case "Teach_head_18":
			SetModel(PChar, "PriestRedM_a", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			Pchar.perks.list.BasicDefence = true;	
			Pchar.perks.list.GunProfessional = true;
			Pchar.perks.list.GunFighter = true;
			Pchar.perks.list.IronWill = true;

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			DeleteAttribute(Pchar, "items");

			AddMoneyToCharacter(Pchar,-2000);
			GiveItem2Character(Pchar, "map");
			GiveItem2Character(Pchar, "bladeanchor");			
			EquipCharacterByItem(Pchar, "bladeanchor");
			GiveItem2Character(Pchar, "bladepclub203");
			TakeItemFromCharacter(Pchar, "bladeX4");
			GiveItem2Character(Pchar, "pistol20");
			EquipCharacterByItem(Pchar, "pistol20");
			GiveItem2Character(Pchar, "ammobag2");
			EquipCharacterbyItem(Pchar, "ammobag2");
			TakeNItems(Pchar, "gunpowder", -100);
			TakeNItems(Pchar, "pistolbullets", -100);
			TakeNItems(Pchar,"gunpowder", 18);
			TakeNItems(Pchar,"pistolbullets", 18);
			TakeNItems(Pchar,"potionwine2", 2);
			TakeNItems(PChar, "spyglass2",1);
			EquipCharacterbyItem(PChar, "spyglass2");
			TakeNItems(Pchar,"chinatiger", 1); 
			GiveItem2Character(Pchar, "bible");
			
			SetQuestHeader("Revenge");
			AddQuestRecord("Revenge", "1");
			AddQuestRecord("Revenge", "2");
	
			LAi_QuestDelay("Vane_at_corvette", 0.1);

			LAi_QuestDelay("Teach_head_all1", 0.01);	
		break;

		case "Teach_head_20":
			SetModel(PChar, "Pira4M_TUS_a", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			Pchar.perks.list.BasicDefence = true;	
			Pchar.perks.list.GunProfessional = true;
			Pchar.perks.list.GunFighter = true;
			Pchar.perks.list.IronWill = true;

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			DeleteAttribute(Pchar, "items");

			AddMoneyToCharacter(Pchar,-2000);
			GiveItem2Character(Pchar, "map");
			GiveItem2Character(Pchar, "blade1");		
			EquipCharacterbyItem(Pchar, "blade1");
			GiveItem2Character(Pchar, "pistol20");		
			EquipCharacterbyItem(Pchar, "pistol20");
			GiveItem2Character(Pchar, "ammobag2");
			EquipCharacterbyItem(Pchar, "ammobag2");
			GiveItem2Character(Pchar, "bladepclub203");
			TakeItemFromCharacter(Pchar, "bladeX4");
			TakeNItems(Pchar,"gunpowder", 12);
			TakeNItems(Pchar,"pistolbullets", 12);
			TakeNItems(PChar, "spyglass2", 1);
			EquipCharacterbyItem(Pchar, "spyglass2");
			TakeNItems(Pchar,"chinatiger", 1); 

			SetQuestHeader("Revenge");
			AddQuestRecord("Revenge", "1");
			AddQuestRecord("Revenge", "2");
			AddQuestRecord("Revenge", "3");
			AddQuestRecord("Revenge", "4");
			AddQuestRecord("Revenge", "5");
			CloseQuestHeader("Revenge");

			LAi_QuestDelay("Teach_head_all1", 0.01);	
		break;

		case "Teach_head_21":
			SetModel(PChar, "ShkiperM_UH_a", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			Pchar.perks.list.BasicDefence = true;	
			Pchar.perks.list.GunProfessional = true;
			Pchar.perks.list.IronWill = true;
			Pchar.perks.list.GunFighter = true;

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			DeleteAttribute(Pchar, "items");		

			AddMoneyToCharacter(Pchar, 2743);
			GiveItem2Character(Pchar, "bladeX4");
			GiveItem2Character(Pchar, "bladeA5");
			EquipCharacterbyItem(Pchar, "bladeA5");
			GiveItem2Character(Pchar, "pistol20");
			EquipCharacterbyItem(Pchar, "pistol20");
			GiveItem2Character(Pchar, "ammobag2");
			EquipCharacterbyItem(Pchar, "ammobag2");
			GiveItem2Character(Pchar, "bladepclub203");
			TakeNItems(Pchar,"pistolbullets", 18);
			TakeNItems(Pchar,"gunpowder", 18);
			GiveItem2Character(Pchar, "sewing_kit");
			TakeNItems(Pchar,"tobacco", 4);
			GiveItem2Character(Pchar, "spyglass2");
			EquipCharacterbyItem(Pchar, "spyglass2");
			GiveItem2Character(Pchar, "map");
			GiveItem2Character(Pchar, "mapBB1");
			GiveItem2Character(Pchar, "chinatiger");
			GiveItem2Character(Pchar, "key17");

			SetQuestHeader("Benjamin_Hornigold");
			AddQuestRecord("Benjamin_Hornigold", "3");
			CloseQuestHeader("Benjamin_Hornigold");
			SetQuestHeader("Caesar");
			AddQuestRecord("Caesar", "1");
			SetQuestHeader("Israel_Hands");
			AddQuestRecord("Israel_Hands", "1");
			SetQuestHeader("Charles_Eden");
			AddQuestRecord("Charles_Eden", "1");
			SetQuestHeader("Richards");
			AddQuestRecord("Richards", "1");
			SetQuestHeader("Johnson");
			AddQuestRecord("Johnson", "1");

			LAi_SetOfficerType(characterFromID("gm_crew1"));

			LAi_SetOfficerType(characterFromID("gm_crew20"));

			curExp = sti(Pchar.Experience);
			nextExp = CalculateExperienceFromRank(sti(Pchar.rank)+7);
			addExp = nextExp-curExp;
			AddCharacterExpNS(Pchar, addExp);
			Pchar.perks.freepoints = 0;//this takes away the added perk

			LAi_QuestDelay("Teach_head_all1", 0.01);	
		break;
//pär jump
	//....................................................................................................

		case "Teach_head_all1":
			PlaySound("PEOPLE\teleport.wav");
			LAi_SetPlayerType(Pchar);
		
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("blast_dirt" , u, v+1.5, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v+1.0, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , u, v, w, 0.0, 0.0, 0.0, sti(20) );
		
			LAi_QuestDelay("Teach_head_all2", 2.0);	
		break;

		case "Teach_head_all2":
			if(pchar.location == "BB_burning_cave")
			{
				PlaySound("VOICE\ENGLISH\blaze_huh.wav");

				//LAi_QuestDelay("Pchar_scream", 1.0);
			}
			else
			{
				PlaySound("VOICE\ENGLISH\blaze_puh.wav");
				PlaySound("VOICE\ENGLISH\blaze_puh.wav");
			}
		break;
	
	//....................................................................................................

		case "antidote_test":
		//	Pchar.chr_ai.poison =  10;
			Pchar.chr_ai.poison =  300;
		break;

		//<-- JRH

//_________________________________________________________________________________________________________________
//Q2 Eden
//estate start
		case "governor_info_estate_done":
			LAi_SetStayType(Pchar);
			LAi_SetActorType(characterFromID("Edmund Christobel Shaw"));
			LAi_ActorGoToLocator(characterFromID("Edmund Christobel Shaw"), "goto", "box1", "governor_info_estate_done1", 2.0);
		break;

		case "governor_info_estate_done1":
			PlaySound("INTERFACE\key_unlock.wav");
			Pchar.Cayman_box1 = "unlocked";

			LAi_QuestDelay("governor_info_estate_done2", 2.0);
		break;

		case "governor_info_estate_done2":
			LAi_SetStayType(Pchar);
			LAi_SetActorType(characterFromID("Edmund Christobel Shaw"));
			LAi_ActorGoToLocator(characterFromID("Edmund Christobel Shaw"), "goto", "goto12", "governor_info_estate_done3", 2.0);
		break;

		case "governor_info_estate_done3":
			LAi_SetStayType(characterFromID("Edmund Christobel Shaw"));
			LAi_SetPlayerType(Pchar);
			PlaySound("VOICE\ENGLISH\blaze_lets_go.wav");

			Pchar.quest.reset_cayman_governor.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.reset_cayman_governor.win_condition.l1.location = "Grand_Cayman_townhall";
			Pchar.quest.reset_cayman_governor.win_condition = "reset_cayman_governor";
		break;

		case "reset_cayman_governor":
			ChangeCharacterAddressGroup(characterFromID("Edmund Christobel Shaw"), "Grand_Cayman_townhall", "sit", "sit2");
			LAi_SetHuberType(characterFromID("Edmund Christobel Shaw"));
			Pchar.servants_info = "0";	//start case

			LAi_QuestDelay("estate_doors_locked", 0.1);

			LAi_QuestDelay("maze_gate1_down_check", 0.5);
			LAi_QuestDelay("maze_gate2_down_check", 0.5);
			LAi_QuestDelay("maze_F1_check", 0.5);
			LAi_QuestDelay("maze_F2_check", 0.5);
			LAi_QuestDelay("maze_F3_check", 0.5);
			LAi_QuestDelay("maze_F4_check", 0.5);
		break;

		case "estate_doors_locked":
			pchar.quest.estate_doors_locked2.win_condition.l1 = "locator";
			pchar.quest.estate_doors_locked2.win_condition.l1.location = "BB_Eden_estate";
			pchar.quest.estate_doors_locked2.win_condition.l1.locator_group = "reload";
			pchar.quest.estate_doors_locked2.win_condition.l1.locator = "reload2";
			pchar.quest.estate_doors_locked2.win_condition = "estate_doors_locked_A";	

			pchar.quest.estate_doors_locked3.win_condition.l1 = "locator";
			pchar.quest.estate_doors_locked3.win_condition.l1.location = "BB_Eden_estate";
			pchar.quest.estate_doors_locked3.win_condition.l1.locator_group = "reload";
			pchar.quest.estate_doors_locked3.win_condition.l1.locator = "reload3";
			pchar.quest.estate_doors_locked3.win_condition = "estate_doors_locked_A";

			pchar.quest.estate_doors_locked4.win_condition.l1 = "locator";
			pchar.quest.estate_doors_locked4.win_condition.l1.location = "BB_Eden_estate";
			pchar.quest.estate_doors_locked4.win_condition.l1.locator_group = "reload";
			pchar.quest.estate_doors_locked4.win_condition.l1.locator = "reload4";
			pchar.quest.estate_doors_locked4.win_condition = "estate_doors_locked_A";	

			pchar.quest.estate_doors_locked5.win_condition.l1 = "locator";
			pchar.quest.estate_doors_locked5.win_condition.l1.location = "BB_Eden_estate";
			pchar.quest.estate_doors_locked5.win_condition.l1.locator_group = "reload";
			pchar.quest.estate_doors_locked5.win_condition.l1.locator = "reload5";
			pchar.quest.estate_doors_locked5.win_condition = "estate_doors_locked_A";

			pchar.quest.estate_doors_locked6.win_condition.l1 = "locator";
			pchar.quest.estate_doors_locked6.win_condition.l1.location = "BB_Eden_estate";
			pchar.quest.estate_doors_locked6.win_condition.l1.locator_group = "reload";
			pchar.quest.estate_doors_locked6.win_condition.l1.locator = "reload6";
			pchar.quest.estate_doors_locked6.win_condition = "estate_doors_locked_A";	

			pchar.quest.estate_doors_locked9.win_condition.l1 = "locator";
			pchar.quest.estate_doors_locked9.win_condition.l1.location = "BB_Eden_estate";
			pchar.quest.estate_doors_locked9.win_condition.l1.locator_group = "reload";
			pchar.quest.estate_doors_locked9.win_condition.l1.locator = "reload9";
			pchar.quest.estate_doors_locked9.win_condition = "estate_doors_locked_A";
		break;
	
		case "estate_doors_locked_A":
			if(!CheckAttribute(Pchar,"estate_doors") || Pchar.estate_doors != "locked")
			{
				Pchar.estate_doors = "locked";
				characters[GetCharacterIndex("black_servant1")].dialog.CurrentNode = "locked_doors";
				characters[GetCharacterIndex("Caesar")].dialog.CurrentNode = "locked_doors";
				Pchar.servants_info = "2";
			}
		break;

		case "enter_estate":
			PlaySound("PEOPLE\counter_close.wav");

			LAi_QuestDelay("Estate_change_soundtype", 2.0);	
		break;

		case "Estate_change_soundtype":
			if(Locations[FindLocation(Pchar.location)].type == "Chinese_garden")
			{
				PauseAllSounds();
				Locations[FindLocation(Pchar.location)].type = "Estate_garden";
				PostEvent("LoadSceneSound", 0);
			}
			else
			{
				PauseAllSounds();
				Locations[FindLocation(Pchar.location)].type = "Chinese_garden";
				PostEvent("LoadSceneSound", 0);
			}
		break;
	//----------------------------------------------------------------------------------------------------------------
		case "servant_is_Caesar":
			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_Eden_estate", "goto", "hands2");
			if(IsOfficer(CharacterFromID("Pell")))				
			{
				ChangeCharacterAddressGroup(characterFromID("Pell"), "BB_Eden_estate", "goto", "pell2");
			}

			characters[GetCharacterIndex("Caesar")].dialog.CurrentNode = "First time";
			Characters[GetCharacterIndex("Caesar")].Dialog.Filename = "Caesar_dialog.c";
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorDialog(characterFromID("Caesar"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Caesar"));
		break;

		case "servant_is_Caesar1":
			characters[GetCharacterIndex("Hands")].dialog.CurrentNode = "First time";
			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorDialog(characterFromID("Hands"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hands"));
		break;

		case "servant_is_Caesar2":
			characters[GetCharacterIndex("Hands")].dialog.CurrentNode = "neutral";
			characters[GetCharacterIndex("Pell")].dialog.CurrentNode = "neutral";

			characters[GetCharacterIndex("Caesar")].dialog.CurrentNode = "Eden_saved_me";
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorDialog(characterFromID("Caesar"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Caesar"));
		break;

		case "servant_is_Caesar3":
			LAi_SetActorType(characterFromID("black_servant1"));
			LAi_ActorDialog(characterFromID("black_servant1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("black_servant1"));
			characters[GetCharacterIndex("black_servant1")].dialog.CurrentNode = "who_are_you";
		break;

		case "servant_is_Caesar4":
			characters[GetCharacterIndex("Caesar")].dialog.CurrentNode = "shut_up";
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorDialog(characterFromID("Caesar"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Caesar"));
		break;

	//this may now be different cases depending on if pchar has spoken 0, 1 or 2 timws with servants already

		case "servant_is_Caesar5":
			characters[GetCharacterIndex("black_servant1")].dialog.CurrentNode = "repeat_look_around";

			Characters[GetCharacterIndex("Caesar")].Dialog.Filename = "Eden servants_dialog.c";
			if(CheckAttribute(Pchar,"servants_info"))
			{
				switch(Pchar.servants_info)
				{
					case "0": 
						//no servants info
						characters[GetCharacterIndex("Caesar")].dialog.CurrentNode = "repeat_look_around";
					break;

					case "1": 
						//you have only basic info	
						characters[GetCharacterIndex("Caesar")].dialog.CurrentNode = "repeat_look_around";
					break;

					case "2": 
						//you have tried locked doors
						characters[GetCharacterIndex("Caesar")].dialog.CurrentNode = "locked_doors";
					break;

					case "3": 
						//you know about the curtain
						characters[GetCharacterIndex("Caesar")].dialog.CurrentNode = "repeat_look_around";
					break;

					case "4": 
						//you are back from the garden house
						characters[GetCharacterIndex("Caesar")].dialog.CurrentNode = "repeat_look_around";
					break;
			/*
			//No, this will not happen at all if Pchar.servants_info = "5"
			//change of road is earlier - in Caesar_dialog.c
					case "5": 
		//here's the big difference - the dialog must continue with Hands talk of the wine cellar and Pough showing up too 
						//you are through with the Estate rooms tour
						characters[GetCharacterIndex("Caesar")].dialog.CurrentNode = "repeat_look_around";
					break;
			*/
					
				}
			}
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorDialog(characterFromID("Caesar"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Caesar"));
		break;

		case "servant_is_Caesar6":
			ChangeCharacterAddressGroup(characterFromID("black_servant1"), "BB_Eden_estate", "goto", "servant1");
			ChangeCharacterAddressGroup(characterFromID("Caesar"), "BB_Eden_estate", "goto", "servant2");
			LAi_SetStayType(characterFromID("black_servant1"));
			LAi_SetStayType(characterFromID("Caesar"));

			LAi_SetPlayerType(Pchar);
			if(IsOfficer(CharacterFromID("Hands")))				
			{
				LAi_SetOfficerType(characterFromID("Hands"));
			}
			if(IsOfficer(CharacterFromID("Pell")))				
			{
				LAi_SetOfficerType(characterFromID("Pell"));
			}

			if(!CheckAttribute(Pchar,"Caesar.message10") || Pchar.Caesar.message10 != "done")
			{
				AddQuestRecord("Caesar","10");
				AddQuestRecord("Charles_Eden", "3");
				Pchar.Caesar.message10 = "done";
			}
		break;
	
		case "servant_is_Caesar7":
			ChangeCharacterAddressGroup(characterFromID("black_servant1"), "BB_Eden_estate", "goto", "servant1");
			ChangeCharacterAddressGroup(characterFromID("Caesar"), "BB_Eden_estate", "goto", "servant2");
			LAi_SetStayType(characterFromID("black_servant1"));
			LAi_SetStayType(characterFromID("Caesar"));

			LAi_SetPlayerType(Pchar);
			if(IsOfficer(CharacterFromID("Hands")))				
			{
				LAi_SetOfficerType(characterFromID("Hands"));
			}
			if(IsOfficer(CharacterFromID("Pell")))				
			{
				LAi_SetOfficerType(characterFromID("Pell"));
			}
		break;
	//----------------------------------------------------------------------------------------------------------------
		case "maze_fountain":
			if(Pchar.location == "BB_Eden_maze")
			{
				Play3DSound("NATURE\fountain.wav", -167.8, 6.4, -227.5);
				Play3DSound("NATURE\fountain.wav", -167.8, 6.4, -227.5);
				Play3DSound("NATURE\fountain.wav", -167.8, 6.4, -227.5);
				Play3DSound("NATURE\fountain.wav", -167.8, 6.4, -227.5);

				LAi_QuestDelay("maze_fountain_1", 0.4);
				LAi_QuestDelay("maze_fountain", 2.8);
			}
			else
			{
				//no fountain sound please

				pchar.quest.maze_fountain.win_condition.l1 = "location";
				pchar.quest.maze_fountain.win_condition.l1.location = "BB_Eden_maze";
				pchar.quest.maze_fountain.win_condition = "maze_fountain";
			}
		break;

		case "maze_fountain_1":
			Play3DSound("NATURE\fountain.wav", -167.8, 6.4, -227.5);
			Play3DSound("NATURE\fountain.wav", -167.8, 6.4, -227.5);
			Play3DSound("NATURE\fountain.wav", -167.8, 6.4, -227.5);
			Play3DSound("NATURE\fountain.wav", -167.8, 6.4, -227.5);
		break;
	//----------------------------------------------------------------------------------------------------------------
		case "behind_curtain":
			if(!CheckAttribute(Pchar,"behind_curtain") || Pchar.behind_curtain != "revealed")
			{
				Pchar.behind_curtain = "revealed";
				AddQuestRecord("Charles_Eden", "4");
			}

			ChangeCharacterAddressGroup(characterFromID("black_servant1"), "BB_Eden_estate", "goto", "servant1");
			ChangeCharacterAddressGroup(characterFromID("Caesar"), "BB_Eden_estate", "goto", "servant2");
			LAi_SetStayType(characterFromID("black_servant1"));
			LAi_SetStayType(characterFromID("Caesar"));
			characters[GetCharacterIndex("black_servant1")].dialog.CurrentNode = "locked_doors1";
			characters[GetCharacterIndex("Caesar")].dialog.CurrentNode = "locked_doors1";

			SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload7", 0.7);
			Locations[FindLocation("BB_Eden_estate")].locators_radius.reload.reload7 = 0.7;
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload8", 0.7);
			Locations[FindLocation("BB_Eden_estate")].locators_radius.reload.reload8 = 0.7;

			LAi_SetPlayerType(Pchar);
			if(IsOfficer(CharacterFromID("Hands")))				
			{
				LAi_SetOfficerType(characterFromID("Hands"));
			}
			if(IsOfficer(CharacterFromID("Pell")))				
			{
				LAi_SetOfficerType(characterFromID("Pell"));
			}
			
			pchar.quest.Margaret_Pough_to_maze.win_condition.l1 = "location";
			pchar.quest.Margaret_Pough_to_maze.win_condition.l1.location = "BB_Eden_garden_house";
			pchar.quest.Margaret_Pough_to_maze.win_condition = "Margaret_Pough_to_maze";
		break;

		case "Margaret_Pough_to_maze":
			SetNextWeather("Clear");

			ChangeCharacterAddressGroup(characterFromID("Margaret_Pough"), "BB_Eden_maze", "goto", "margaret");
						
			LAi_SetStayType(characterFromID("Margaret_Pough"));

			pchar.quest.Margaret_Pough.win_condition.l1 = "location";
			pchar.quest.Margaret_Pough.win_condition.l1.location = "BB_Eden_maze";
			pchar.quest.Margaret_Pough.win_condition = "Margaret_Pough";
		break;

/*
		case "GH_boxes_check":
			if(CheckAttribute(Pchar,"GH_box1") && Pchar.GH_box1 == "checked")
			{
				if(CheckAttribute(Pchar,"GH_box2") && Pchar.GH_box2 == "checked")
				{
					if(CheckAttribute(Pchar,"GH_box3") && Pchar.GH_box3 == "checked")
					{
						ChangeCharacterAddressGroup(characterFromID("Margaret_Pough"), "BB_Eden_maze", "goto", "margaret");
						
						LAi_SetStayType(characterFromID("Margaret_Pough"));

						pchar.quest.Margaret_Pough.win_condition.l1 = "location";
						pchar.quest.Margaret_Pough.win_condition.l1.location = "BB_Eden_maze";
						pchar.quest.Margaret_Pough.win_condition = "Margaret_Pough";
					}
				}
			}
		break;
*/
		case "Margaret_Pough":
			LAi_SetActorType(characterFromID("Margaret_Pough"));
			LAi_ActorDialog(characterFromID("Margaret_Pough"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Margaret_Pough"));
			Characters[GetCharacterIndex("Margaret_Pough")].dialog.CurrentNode  = "what";
		break;

		case "Pough_done":
			SetNextWeather("Clear");
			AddQuestRecord("Charles_Eden", "6");
			LAi_SetStayType(Pchar);
			LAi_SetActorType(characterFromID("Margaret_Pough"));
			LAi_ActorRunToLocator(characterFromID("Margaret_Pough"), "goto", "leave", "Pough_done1", 15.0);
			Locations[FindLocation("BB_Eden_estate")].reload.l4.disable = 0;
			characters[GetCharacterIndex("black_servant1")].dialog.CurrentNode = "repeat_look_around";
			characters[GetCharacterIndex("Caesar")].dialog.CurrentNode = "repeat_look_around";
			Pchar.servants_info = "4";

			ChangeCharacterAddressGroup(characterFromID("maze_monkey1"), "BB_Eden_maze", "goto", "monkey1");
			ChangeCharacterAddressGroup(characterFromID("maze_monkey2"), "BB_Eden_maze", "goto", "monkey2");
			ChangeCharacterAddressGroup(characterFromID("maze_monkey3"), "BB_Eden_maze", "goto", "monkey3");
			ChangeCharacterAddressGroup(characterFromID("maze_monkey4"), "BB_Eden_maze", "goto", "monkey4");
			ChangeCharacterAddressGroup(characterFromID("maze_monkey5"), "BB_Eden_maze", "goto", "monkey5");
			ChangeCharacterAddressGroup(characterFromID("maze_monkey6"), "BB_Eden_maze", "goto", "monkey6");
			ChangeCharacterAddressGroup(characterFromID("maze_monkey7"), "BB_Eden_maze", "goto", "monkey7");
			ChangeCharacterAddressGroup(characterFromID("maze_monkey8"), "BB_Eden_maze", "goto", "monkey8");
			ChangeCharacterAddressGroup(characterFromID("maze_monkey6"), "BB_Eden_maze", "goto", "monkey9");
			ChangeCharacterAddressGroup(characterFromID("maze_monkey7"), "BB_Eden_maze", "goto", "monkey10");
			ChangeCharacterAddressGroup(characterFromID("maze_monkey8"), "BB_Eden_maze", "goto", "monkey11");
			ChangeCharacterAddressGroup(characterFromID("maze_monkey8"), "BB_Eden_maze", "goto", "monkey12");
			ChangeCharacterAddressGroup(characterFromID("maze_monkey8"), "BB_Eden_maze", "goto", "monkey13");
			ChangeCharacterAddressGroup(characterFromID("maze_monkey8"), "BB_Eden_maze", "goto", "monkey14");

			LAi_QuestDelay("pchar_playertype", 5.0);
		break;

		case "Pough_done1":
			ChangeCharacterAddressGroup(characterFromID("Margaret_Pough"), "BB_Eden_estate", "goto", "unlock");

			pchar.quest.Margaret_Pough2_up.win_condition.l1 = "locator";
			pchar.quest.Margaret_Pough2_up.win_condition.l1.location = "BB_Eden_estate";
			pchar.quest.Margaret_Pough2_up.win_condition.l1.locator_group = "goto";
			pchar.quest.Margaret_Pough2_up.win_condition.l1.locator = "unlock";
			pchar.quest.Margaret_Pough2_up.win_condition = "Margaret_Pough2";
		break;

		case "Margaret_Pough2":
			LAi_SetActorType(characterFromID("Margaret_Pough"));
			LAi_ActorDialog(characterFromID("Margaret_Pough"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Margaret_Pough"));
			Characters[GetCharacterIndex("Margaret_Pough")].dialog.CurrentNode  = "unlock";
		break;

		case "Pough2_done":
			SetNextWeather("Clear");
			LAi_SetCitizenType(characterFromID("Margaret_Pough"));
			Characters[GetCharacterIndex("Margaret_Pough")].dialog.CurrentNode  = "neutral";

			pchar.quest.clear_weather.win_condition.l1 = "location";
			pchar.quest.clear_weather.win_condition.l1.location = "BB_Eden_dining_room";
			pchar.quest.clear_weather.win_condition = "clear_weather";

			pchar.quest.Margaret_Pough3_A.win_condition.l1 = "location";
			pchar.quest.Margaret_Pough3_A.win_condition.l1.location = "BB_Eden_chapel";
			pchar.quest.Margaret_Pough3_A.win_condition = "Margaret_Pough3_A";
		break;

		case "Margaret_Pough3_A":
			ChangeCharacterAddressGroup(characterFromID("Margaret_Pough"), "BB_Eden_estate", "goto", "goto6");
			LAi_SetStayType(characterFromID("Margaret_Pough"));
			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_Eden_estate", "goto", "entre");

			pchar.quest.Margaret_Pough3.win_condition.l1 = "locator";
			pchar.quest.Margaret_Pough3.win_condition.l1.location = "BB_Eden_estate";
			pchar.quest.Margaret_Pough3.win_condition.l1.locator_group = "goto";
			pchar.quest.Margaret_Pough3.win_condition.l1.locator = "goto6";
			pchar.quest.Margaret_Pough3.win_condition = "Margaret_Pough3";
		break;

		case "Margaret_Pough3":
			LAi_SetActorType(characterFromID("Margaret_Pough"));
			LAi_ActorDialog(characterFromID("Margaret_Pough"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Margaret_Pough"));
			Characters[GetCharacterIndex("Margaret_Pough")].dialog.CurrentNode  = "chapel";
		break;

		case "Pough3_done":
			characters[GetCharacterIndex("Hands")].dialog.CurrentNode = "wine_cellar";
			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorDialog(characterFromID("Hands"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hands"));
		break;
//-------------------------------------------------------------------------------------------------------
//Eden bribing scene in here

		case "Eden_bribing_scene_delay":
			//from Hands dialog
			if(CheckAttribute(Pchar,"model"))
			{
				switch(Pchar.model)
				{
					case "Howard_Pyle_3":
						Pchar.Pyle_model = "3";	
					break;

					case "Howard_Pyle_4":
						Pchar.Pyle_model = "4";		
					break;

					case "Howard_Pyle_5":
						Pchar.Pyle_model = "5";		
					break;

					case "Howard_Pyle":
						Pchar.Pyle_model = "0";		
					break;
				}
			}

			LAi_QuestDelay("Eden_bribing_scene", 1.0);
		break;	

		case "Eden_bribing_scene":
			LAi_SetStayType(Pchar);
			SetModel(Pchar, "bb_Hands1", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);

			aref ito, ifrom;
			DeleteAttribute(characterFromID("Brthug1"), "items");
			
			if(CheckAttribute(Pchar, "items"))
			{
				makearef(ifrom, Pchar.items);
				Characters[GetCharacterIndex("Brthug1")].items = "";
				makearef(ito, Characters[GetCharacterIndex("Brthug1")].items);
				CopyAttributes(&ito, &ifrom);
				DeleteAttribute(Pchar, "items");
			}
		
			GiveItem2Character(Pchar, "bladeX4");
			GiveItem2Character(Pchar, "blade1");	
			EquipCharacterByItem(Pchar, "blade1");
			GiveItem2Character(Pchar, "pistol206");
			EquipCharacterByItem(Pchar, "pistol206");
			TakenItems(Pchar, "gunpowder", 6);
			TakenItems(Pchar, "pistolbullets", 6);

			pchar.old.name = "Israel";
			pchar.old.lastname = "Hands";
			pchar.name = TranslateString("","Israel");
			pchar.lastname = TranslateString("","Hands");	
		
			if(IsOfficer(CharacterFromID("Hands"))) 
			{
				RemoveOfficersIndex(pchar, GetCharacterIndex("Hands"));
				RemovePassenger(pchar, characterFromID("Hands"));
				Pchar.Hands_officer = "yes";
			}
			if(IsOfficer(CharacterFromID("Pell")))  
			{
				RemoveOfficersIndex(pchar, GetCharacterIndex("Pell"));
				RemovePassenger(pchar, characterFromID("Pell"));
				Pchar.Pell_officer = "yes";
			}

			SetModel(characterFromID("Teach"), "bb_Teach3", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);

			ChangeCharacterAddressGroup(characterFromID("Teach"), "BB_Eden_office", "goto", "goto4");
			ChangeCharacterAddressGroup(characterFromID("bb_crew5"), "BB_Eden_office", "goto", "crew1");
			ChangeCharacterAddressGroup(characterFromID("Richards"), "BB_Eden_office", "goto", "crew2");		//was bb_crew16
			ChangeCharacterAddressGroup(characterFromID("bb_crew8"), "BB_Eden_office", "officers", "reload3_1");
			ChangeCharacterAddressGroup(characterFromID("Knight"), "BB_Eden_office", "sit", "sit2");
			LAi_SetStayType(characterFromID("Teach"));
			LAi_SetStayType(characterFromID("Richards"));
			LAi_SetSitType(characterFromID("Knight"));

			GiveItem2Character(characterFromID("Eden"), "bladeX4");
			GiveItem2Character(characterFromID("Eden"), "bladep204");
			EquipCharacterbyItem(characterFromID("Eden"), "bladep204");

			GiveItem2Character(characterFromID("Teach"), "bladeX4");
			GiveItem2Character(characterFromID("Teach"), "bladeMap_Hgold");
			EquipCharacterbyItem(characterFromID("Teach"), "bladeMap_Hgold");
		
			RemoveCharacterEquip(characterFromID("bb_crew5"), BLADE_ITEM_TYPE);
			TakenItems(characterFromID("bb_crew5"), "blade4", -1);
			GiveItem2Character(characterFromID("bb_crew5"), "bladeaxe2");		
			EquipCharacterbyItem(characterFromID("bb_crew5"), "bladeaxe2");
			
			RemoveCharacterEquip(characterFromID("bb_crew8"), BLADE_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("bb_crew8"), GUN_ITEM_TYPE);
			TakenItems(characterFromID("bb_crew8"), "piratespistol", -1);
			TakenItems(characterFromID("bb_crew8"), "blade4", -1);
			GiveItem2Character(characterFromID("bb_crew8"), "pistolbbuss");
			EquipCharacterByItem(characterFromID("bb_crew8"), "pistolbbuss");
			GiveItem2Character(characterFromID("bb_crew8"), "piratesdagger");		
			EquipCharacterbyItem(characterFromID("bb_crew8"), "piratesdagger");

			Locations[FindLocation("BB_Eden_office")].image = "Eden_estate.tga";

			SetNextWeather("Clear");
			DoQuestReloadToLocation("BB_Eden_office", "reload", "reload2" ,"Eden_bribing_scene1");
		break;

		case "Eden_bribing_scene1":
			PlaySound("INTERFACE\closed_locked_door.wav");

			LAi_QuestDelay("Eden_bribing_scene2", 2.0);
		break;

		case "Eden_bribing_scene2":
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorDialog(characterFromID("Teach"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Teach"));
			Characters[GetCharacterIndex("Teach")].dialog.CurrentNode  = "Hands_please";
		break;

		case "Eden_bribing_scene3":
			PlaySound("VOICE\ENGLISH\gr_Hands1.wav");
			LAi_SetPlayerType(Pchar);
			LAi_SetStayType(characterFromID("Teach"));

			Characters[GetCharacterIndex("bb_crew5")].Dialog.Filename = "bb_crew2_dialog.c";
			Characters[GetCharacterIndex("bb_crew8")].Dialog.Filename = "bb_crew2_dialog.c";
			Characters[GetCharacterIndex("Richards")].Dialog.Filename = "bb_crew2_dialog.c";
			Characters[GetCharacterIndex("bb_crew5")].dialog.CurrentNode  = "neutral";
			Characters[GetCharacterIndex("bb_crew8")].dialog.CurrentNode  = "neutral";
			Characters[GetCharacterIndex("Richards")].dialog.CurrentNode  = "neutral";
			Characters[GetCharacterIndex("Teach")].dialog.CurrentNode  = "neutral";
			characters[GetCharacterIndex("Knight")].dialog.CurrentNode = "office1";
			
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "sit", "sit2", 2.0);
			Locations[FindLocation("BB_Eden_office")].locators_radius.sit.sit2 = 2.0;
	
			pchar.quest.Eden_bribing_scene4.win_condition.l1 = "locator";
			pchar.quest.Eden_bribing_scene4.win_condition.l1.location = "BB_Eden_office";
			pchar.quest.Eden_bribing_scene4.win_condition.l1.locator_group = "sit";
			pchar.quest.Eden_bribing_scene4.win_condition.l1.locator = "sit2";
			pchar.quest.Eden_bribing_scene4.win_condition = "Eden_bribing_scene4";
		break;

		case "Teach_neutral_done":
			Characters[GetCharacterIndex("Teach")].dialog.CurrentNode  = "neutral";
		break;

		case "bb_crew2_neutral_done":
			Characters[GetCharacterIndex("bb_crew8")].dialog.CurrentNode  = "neutral";
			Characters[GetCharacterIndex("bb_crew5")].dialog.CurrentNode  = "neutral";
			Characters[GetCharacterIndex("Richards")].dialog.CurrentNode  = "neutral";
		break;

		case "Eden_bribing_scene4":
			characters[GetCharacterIndex("Knight")].dialog.CurrentNode = "office1";
			LAi_SetActorType(characterFromID("Knight"));
			LAi_ActorDialog(characterFromID("Knight"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Knight"));
		break;
	
		case "Knight_office2_done":
			//from Knight desk dialog, may be repeated
			Characters[GetCharacterIndex("Knight")].dialog.CurrentNode  = "office2";
			ChangeCharacterAddressGroup(characterFromID("Knight"), "BB_Eden_office", "sit", "sit2");
			LAi_SetSitType(characterFromID("Knight"));
			PlaySound("PEOPLE\creak2.wav");
		break;

		case "Eden_bribing_scene6":
			//from Knight desk dialog, only first time
			LAi_QuestDelay("Eden_bribing_scene7", 1.0);

			SetLocatorRadius(locations[FindLocation(Pchar.location)], "goto", "thug2", 5.0);

			pchar.quest.Eden_bribing_scene9.win_condition.l1 = "locator";
			pchar.quest.Eden_bribing_scene9.win_condition.l1.location = "BB_Eden_office";
			pchar.quest.Eden_bribing_scene9.win_condition.l1.locator_group = "goto";
			pchar.quest.Eden_bribing_scene9.win_condition.l1.locator = "thug2";
			pchar.quest.Eden_bribing_scene9.win_condition = "Eden_bribing_scene9";
		break;

		case "Eden_bribing_scene7":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Teach"));

			LAi_QuestDelay("pchar_sigh", 1.0);
			LAi_QuestDelay("pchar_playertype", 1.0);
			LAi_QuestDelay("Eden_bribing_scene8", 2.0);
		break;

		case "Eden_bribing_scene8":
			PlaySound("AMBIENT\crew_negative.wav");
			LAi_SetCitizenType(characterFromID("Teach"));
			LAi_SetCitizenType(characterFromID("Richards"));
			LAi_SetCitizenType(characterFromID("bb_crew5"));
			LAi_SetCitizenType(characterFromID("bb_crew8"));

	//		LAi_QuestDelay("Eden_bribing_scene9", 6.0);
		break;

		case "Eden_bribing_scene9":
			PlaySound("INTERFACE\closed_locked_door.wav");
			ChangeCharacterAddressGroup(characterFromID("Eden"), "BB_Eden_office", "reload", "reload1");

			LAi_QuestDelay("Eden_bribing_scene10", 1.0);
		break;

		case "Eden_bribing_scene10":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Eden"));
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorTurnToCharacter(characterFromID("Teach"), characterFromID("Eden"));
			LAi_SetActorType(characterFromID("Richards"));
			LAi_ActorTurnToCharacter(characterFromID("Richards"), characterFromID("Eden"));
			LAi_SetActorType(characterFromID("bb_crew5"));
			LAi_ActorTurnToCharacter(characterFromID("bb_crew5"), characterFromID("Eden"));
			LAi_SetActorType(characterFromID("bb_crew8"));
			LAi_ActorTurnToCharacter(characterFromID("bb_crew8"), characterFromID("Eden"));

			LAi_QuestDelay("Eden_bribing_scene11", 1.0);
		break;

		case "Eden_bribing_scene11":
			PlaySound("VOICE\ENGLISH\Eden_so.wav");
			
			LAi_QuestDelay("Eden_bribing_scene12", 1.0);
		break;

		case "Eden_bribing_scene12":
			LAi_SetActorType(characterFromID("Eden"));
			LAi_ActorGoToLocator(characterFromID("Eden"), "goto", "goto6", "Eden_bribing_scene13", 4.0);

			PlaySound("PEOPLE\creak2.wav");
			LAi_SetStayType(characterFromID("Knight"));
			ChangeCharacterAddressGroup(characterFromID("Knight"), "BB_Eden_office", "goto", "stay1");

			LAi_QuestDelay("Eden_bribing_scene12_A", 1.0);
		break;

		case "Eden_bribing_scene12_A":
			ChangeCharacterAddressGroup(characterFromID("Knight"), "BB_Eden_office", "goto", "stay2");
			LAi_SetActorType(characterFromID("Knight"));
			LAi_ActorGoToLocator(characterFromID("Knight"), "goto", "knight_gov", "Eden_bribing_scene12_B", 8.0);
		break;

		case "Eden_bribing_scene12_B":
			ChangeCharacterAddressGroup(characterFromID("Knight"), "BB_Eden_office", "goto", "knight_gov");
		break;

		case "Eden_bribing_scene13":
			PlaySound("VOICE\ENGLISH\Eden_well.wav");
			ChangeCharacterAddressGroup(characterFromID("Eden"), "BB_Eden_office", "sit", "governor");
			LAi_SetActorType(characterFromID("Eden"));
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Eden"));
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorTurnToCharacter(characterFromID("Teach"), characterFromID("Eden"));
			LAi_SetActorType(characterFromID("Richards"));
			LAi_ActorTurnToCharacter(characterFromID("Richards"), characterFromID("Eden"));
			LAi_SetActorType(characterFromID("bb_crew5"));
			LAi_ActorTurnToCharacter(characterFromID("bb_crew5"), characterFromID("Eden"));
			LAi_SetActorType(characterFromID("bb_crew8"));
			LAi_ActorTurnToCharacter(characterFromID("bb_crew8"), characterFromID("Eden"));
			
			LAi_QuestDelay("Eden_bribing_scene14", 1.0);
		break;

		case "Eden_bribing_scene14":
			LAi_SetPlayerType(Pchar);		//temp
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorGoToLocator(characterFromID("Teach"), "goto", "teach", "Eden_bribing_scene15", 3.0);
			LAi_SetActorType(characterFromID("Richards"));
			LAi_ActorGoToLocator(characterFromID("Richards"), "goto", "richards", "_", "");
			LAi_SetActorType(characterFromID("bb_crew8"));
			LAi_ActorGoToLocator(characterFromID("bb_crew8"), "goto", "qm", "_", "");
		break;

		case "Eden_bribing_scene15":
			ChangeCharacterAddressGroup(characterFromID("Teach"), "BB_Eden_office", "goto", "teach");
			ChangeCharacterAddressGroup(characterFromID("Richards"), "BB_Eden_office", "goto", "richards");
			ChangeCharacterAddressGroup(characterFromID("bb_crew8"), "BB_Eden_office", "goto", "qm");

			LAi_SetActorType(characterFromID("bb_crew5"));
			LAi_ActorGoToLocator(characterFromID("bb_crew5"), "goto", "gunner", "Eden_bribing_scene16", 3.0);
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "hands1", "_", "");				//was hands
		break;

		case "Eden_bribing_scene16":
			ChangeCharacterAddressGroup(characterFromID("bb_crew5"), "BB_Eden_office", "goto", "gunner");
			ChangeCharacterAddressGroup(Pchar, "BB_Eden_office", "goto", "hands1");		//was hands
	
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorDialog(characterFromID("Teach"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Teach"));
			Characters[GetCharacterIndex("Teach")].dialog.CurrentNode  = "bribing";
		break;

		case "Eden_bribing_scene17":
			LAi_SetActorType(characterFromID("Eden"));
			LAi_ActorDialog(characterFromID("Eden"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Eden"));
			characters[GetCharacterIndex("Eden")].dialog.CurrentNode = "bribing1";
		break;

		case "Eden_bribing_scene18":
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorDialog(characterFromID("Teach"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Teach"));
			Characters[GetCharacterIndex("Teach")].dialog.CurrentNode  = "bribing2";
		break;

		case "Eden_bribing_scene19":
			LAi_SetActorType(characterFromID("Eden"));
			LAi_ActorDialog(characterFromID("Eden"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Eden"));
			characters[GetCharacterIndex("Eden")].dialog.CurrentNode = "bribing3";
		break;

		case "Eden_bribing_scene20":
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorDialog(characterFromID("Teach"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Teach"));
			Characters[GetCharacterIndex("Teach")].dialog.CurrentNode  = "bribing4";
		break;

		case "Eden_bribing_scene21":
			characters[GetCharacterIndex("Knight")].dialog.CurrentNode = "orwell";
			LAi_SetActorType(characterFromID("Knight"));
			LAi_ActorDialog(characterFromID("Knight"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Knight"));
		break;

		case "Eden_bribing_scene22":
			LAi_SetActorType(characterFromID("Eden"));
			LAi_ActorDialog(characterFromID("Eden"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Eden"));
			characters[GetCharacterIndex("Eden")].dialog.CurrentNode = "bribing5";
		break;

		case "Eden_bribing_scene23":
			PlaySound("OBJECTS\DUEL\man_attack5.wav");
		
			LAi_QuestDelay("Eden_bribing_scene24", 1.5);
		break;

		case "Eden_bribing_scene24":
			LAi_SetActorType(characterFromID("Eden"));
			LAi_ActorDialog(characterFromID("Eden"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Eden"));
			characters[GetCharacterIndex("Eden")].dialog.CurrentNode = "bribing6";
		break;

		case "Eden_bribing_scene25":
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorDialog(characterFromID("Teach"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Teach"));
			Characters[GetCharacterIndex("Teach")].dialog.CurrentNode  = "bribing7";
		break;

		case "Eden_bribing_scene26":
			LAi_SetActorType(characterFromID("Richards"));
			LAi_ActorDialog(characterFromID("Richards"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Richards"));
			Characters[GetCharacterIndex("Richards")].dialog.CurrentNode  = "more_dutch";
		break;

		case "Eden_bribing_scene27":
			LAi_SetActorType(characterFromID("bb_crew5"));
			LAi_ActorDialog(characterFromID("bb_crew5"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("bb_crew5"));
			Characters[GetCharacterIndex("bb_crew5")].dialog.CurrentNode  = "spanish_crew";
		break;

		case "Eden_bribing_scene28":
			LAi_SetActorType(characterFromID("Eden"));
			LAi_ActorTurnToCharacter(characterFromID("Eden"), characterFromID("bb_crew5"));			
			LAi_SetActorType(characterFromID("Knight"));
			LAi_ActorTurnToCharacter(characterFromID("Knight"), characterFromID("bb_crew5"));
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorTurnToCharacter(characterFromID("Teach"), characterFromID("bb_crew5"));
			LAi_SetActorType(characterFromID("Richards"));
			LAi_ActorTurnToCharacter(characterFromID("Richards"), characterFromID("bb_crew5"));
			LAi_SetActorType(characterFromID("bb_crew8"));
			LAi_ActorTurnToCharacter(characterFromID("bb_crew8"), characterFromID("bb_crew5"));
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("bb_crew5"));

			LAi_QuestDelay("Eden_bribing_scene28_A", 1.0);
		break;

		case "Eden_bribing_scene28_A":
			LAi_SetActorType(characterFromID("bb_crew8"));
			LAi_ActorDialog(characterFromID("bb_crew8"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("bb_crew8"));
			Characters[GetCharacterIndex("bb_crew8")].dialog.CurrentNode  = "no_crew";
		break;

		case "Eden_bribing_scene29":
			LAi_SetActorType(characterFromID("Eden"));
			LAi_ActorDialog(characterFromID("Eden"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Eden"));
			characters[GetCharacterIndex("Eden")].dialog.CurrentNode = "bribing8";
		break;

		case "Eden_bribing_scene30":
			LAi_SetActorType(characterFromID("Eden"));
			LAi_ActorTurnToCharacter(characterFromID("Eden"), characterFromID("Teach"));			
			LAi_SetActorType(characterFromID("Knight"));
			LAi_ActorTurnToCharacter(characterFromID("Knight"), characterFromID("Teach"));
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorTurnToCharacter(characterFromID("Teach"), characterFromID("Eden"));
			LAi_SetActorType(characterFromID("Richards"));
			LAi_ActorTurnToCharacter(characterFromID("Richards"), characterFromID("Eden"));
			LAi_SetActorType(characterFromID("bb_crew8"));
			LAi_ActorTurnToCharacter(characterFromID("bb_crew8"), characterFromID("Eden"));
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Eden"));

			LAi_QuestDelay("Eden_bribing_scene30_A", 1.0);
		break;
	
		case "Eden_bribing_scene30_A":
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorDialog(characterFromID("Teach"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Teach"));
			Characters[GetCharacterIndex("Teach")].dialog.CurrentNode  = "bribing9";
		break;

		case "Eden_bribing_scene31":
			LAi_SetActorType(characterFromID("Eden"));
			LAi_ActorDialog(characterFromID("Eden"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Eden"));
			characters[GetCharacterIndex("Eden")].dialog.CurrentNode = "bribing10";
		break;

		case "Eden_bribing_scene32":
			PlaySound("VOICE\ENGLISH\gr_Teach3.wav");
			LAi_SetPlayerType(CharacterFromID("Teach"));
			LAi_SetFightMode(CharacterFromID("Teach"), true);

			LAi_QuestDelay("Eden_bribing_scene33", 2.5);
		break;

		case "Eden_bribing_scene33":
			PlaySound("INTERFACE\paper.wav");
			RemoveCharacterEquip(characterFromID("Teach"), BLADE_ITEM_TYPE);
			EquipCharacterbyItem(characterFromID("Teach"), "bladeX4");
			TakenItems(characterFromID("Teach"), "bladeMap_Hgold", -1);

			GiveItem2Character(characterFromID("Eden"), "pistolMap_Hgold");		
			EquipCharacterbyItem(characterFromID("Eden"), "pistolMap_Hgold");

			LAi_QuestDelay("Eden_bribing_scene34", 1.0);
		break;

		case "Eden_bribing_scene34":
			LAi_SetFightMode(CharacterFromID("Teach"), false);
			LAi_SetStayType(CharacterFromID("Teach"));

			LAi_SetActorType(characterFromID("Eden"));
			LAi_ActorDialog(characterFromID("Eden"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Eden"));
			characters[GetCharacterIndex("Eden")].dialog.CurrentNode = "bribing11";
		break;

		case "Eden_bribing_scene35":
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorDialog(characterFromID("Teach"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Teach"));
			Characters[GetCharacterIndex("Teach")].dialog.CurrentNode  = "bribing12";
		break;

		case "Eden_bribing_scene36":
			LAi_SetActorType(characterFromID("Eden"));
			LAi_ActorDialog(characterFromID("Eden"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Eden"));
			characters[GetCharacterIndex("Eden")].dialog.CurrentNode = "bribing13";
		break;

		case "Eden_bribing_scene37":
			LAi_SetActorType(characterFromID("bb_crew8"));
			LAi_ActorDialog(characterFromID("bb_crew8"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("bb_crew8"));
			Characters[GetCharacterIndex("bb_crew8")].dialog.CurrentNode  = "cargo_sugar";
		break;

		case "Eden_bribing_scene38":
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorDialog(characterFromID("Teach"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Teach"));
			Characters[GetCharacterIndex("Teach")].dialog.CurrentNode  = "bribing14";
		break;

		case "Eden_bribing_scene39":
			PlaySound("AMBIENT\JAIL\cough.wav");

			LAi_QuestDelay("Eden_bribing_scene40", 1.0);
		break;

		case "Eden_bribing_scene40":
			LAi_SetActorType(characterFromID("Eden"));
			LAi_ActorTurnToCharacter(characterFromID("Eden"), characterFromID("Knight"));			
			LAi_SetActorType(characterFromID("bb_crew5"));
			LAi_ActorTurnToCharacter(characterFromID("bb_crew5"), characterFromID("Knight"));
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorTurnToCharacter(characterFromID("Teach"), characterFromID("Knight"));
			LAi_SetActorType(characterFromID("Richards"));
			LAi_ActorTurnToCharacter(characterFromID("Richards"), characterFromID("Knight"));
			LAi_SetActorType(characterFromID("bb_crew8"));
			LAi_ActorTurnToCharacter(characterFromID("bb_crew8"), characterFromID("Knight"));
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Knight"));

			LAi_QuestDelay("Eden_bribing_scene41", 0.5);
		break;

		case "Eden_bribing_scene41":
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorDialog(characterFromID("Teach"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Teach"));
			Characters[GetCharacterIndex("Teach")].dialog.CurrentNode  = "bribing15";
		break;

		case "Eden_bribing_scene42":
			LAi_SetActorType(characterFromID("Eden"));
			LAi_ActorDialog(characterFromID("Eden"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Eden"));
			characters[GetCharacterIndex("Eden")].dialog.CurrentNode = "bribing16";
		break;

		case "Eden_bribing_scene43":
			LAi_SetActorType(characterFromID("bb_crew5"));
			LAi_ActorTurnToCharacter(characterFromID("bb_crew5"), characterFromID("Eden"));
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorTurnToCharacter(characterFromID("Teach"), characterFromID("Eden"));
			LAi_SetActorType(characterFromID("Richards"));
			LAi_ActorTurnToCharacter(characterFromID("Richards"), characterFromID("Eden"));
			LAi_SetActorType(characterFromID("bb_crew8"));
			LAi_ActorTurnToCharacter(characterFromID("bb_crew8"), characterFromID("Eden"));
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Eden"));

			LAi_QuestDelay("Eden_bribing_scene43_A", 0.5);
		break;

		case "Eden_bribing_scene43_A":
			LAi_SetActorType(characterFromID("Knight"));
			LAi_ActorGoToLocator(characterFromID("Knight"), "reload", "reload1", "Eden_bribing_scene44", 5.0);

			LAi_QuestDelay("Eden_bribing_scene46", 2.0);
		break;

		case "Eden_bribing_scene44":
			PlaySound("INTERFACE\key_unlock.wav");
		break;
	
		case "Eden_bribing_scene46":
			ChangeCharacterAddressGroup(characterFromID("Knight"), "none", "", "");
			PlaySound("VOICE\ENGLISH\blaze_follow_you.wav");			
			LAi_SetActorType(characterFromID("bb_crew8"));
			LAi_ActorGoToLocator(characterFromID("bb_crew8"), "reload", "reload1", "Eden_bribing_scene47", 4.0);
		break;

		case "Eden_bribing_scene47":
			ChangeCharacterAddressGroup(characterFromID("bb_crew8"), "none", "", "");

			LAi_QuestDelay("Eden_bribing_scene47_A", 1.5);
			LAi_QuestDelay("Eden_bribing_scene48", 3.0);
		break;

		case "Eden_bribing_scene47_A":
			PlaySound("INTERFACE\closed_locked_door.wav");
		break;

		case "Eden_bribing_scene48":
			LAi_SetActorType(characterFromID("Eden"));
			LAi_ActorDialog(characterFromID("Eden"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Eden"));
			characters[GetCharacterIndex("Eden")].dialog.CurrentNode = "bribing17";
		break;
		
		case "Eden_bribing_scene49":
			ChangeCharacterAddressGroup(characterFromID("Eden"), "BB_Eden_office", "goto", "goto6");
			LAi_SetActorType(characterFromID("Eden"));
			LAi_ActorGoToLocator(characterFromID("Eden"), "reload", "reload2", "Eden_bribing_scene50", 9.0);
		break;

		case "Eden_bribing_scene50":
			PlaySound("INTERFACE\key_unlock.wav");
			ChangeCharacterAddressGroup(characterFromID("Eden"), "BB_Eden_office", "officers", "reload3_1");
			LAi_SetActorType(characterFromID("Eden"));
			LAi_ActorTurnToLocator(characterFromID("Eden"), "goto", "crew2");

			LAi_SetActorType(characterFromID("bb_crew5"));
			LAi_ActorTurnToCharacter(characterFromID("bb_crew5"), characterFromID("Eden"));
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorTurnToCharacter(characterFromID("Teach"), characterFromID("Eden"));
			LAi_SetActorType(characterFromID("Richards"));
			LAi_ActorTurnToCharacter(characterFromID("Richards"), characterFromID("Eden"));
			LAi_SetActorType(characterFromID("bb_crew8"));
			LAi_ActorTurnToCharacter(characterFromID("bb_crew8"), characterFromID("Eden"));
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Eden"));

			LAi_QuestDelay("Eden_bribing_scene51", 1.0);
		break;

		case "Eden_bribing_scene51":	
			LAi_ActorGoToLocator(characterFromID("Richards"), "reload", "reload2", "Eden_bribing_scene53", 5.0);

			LAi_QuestDelay("Eden_bribing_scene51_A", 1.5);	//was 1.0
		break;

		case "Eden_bribing_scene51_A":
			LAi_ActorGoToLocator(characterFromID("bb_crew5"), "reload", "reload2", "Eden_bribing_scene52", 5.0);
		break;

		case "Eden_bribing_scene52":
			ChangeCharacterAddressGroup(characterFromID("bb_crew5"), "BB_Eden_estate_wreck", "goto", "B_crew1");
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorGoToLocator(characterFromID("Teach"), "goto", "goto4", "Eden_bribing_scene55", 6.0);

			LAi_QuestDelay("Eden_bribing_scene54", 5.0);
		break;

		case "Eden_bribing_scene53":
			ChangeCharacterAddressGroup(characterFromID("Richards"), "BB_Eden_estate_wreck", "goto", "B_crew2");
		break;

		case "Eden_bribing_scene54":
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "crew2", "Eden_bribing_scene56", 4.0);
		break;

		case "Eden_bribing_scene55":	
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorTurnToLocator(characterFromID("Teach"), "officers", "reload3_1");
		break;

		case "Eden_bribing_scene56":	
			LAi_SetActorType(characterFromID("Eden"));
			LAi_ActorDialog(characterFromID("Eden"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Eden"));
			characters[GetCharacterIndex("Eden")].dialog.CurrentNode = "bribing19";
		break;

		case "Eden_bribing_scene57":
			PlaySound("VOICE\ENGLISH\Eden_yeah.wav");	
			LAi_SetPlayerType(CharacterFromID("Eden"));
			LAi_SetFightMode(CharacterFromID("Eden"), true);

			LAi_QuestDelay("Eden_bribing_scene58", 1.0);
		break;

		case "Eden_bribing_scene58":
			PlaySound("OBJECTS\DUEL\pistol_out1original.wav");
			RemoveCharacterEquip(characterFromID("Eden"), BLADE_ITEM_TYPE);
			EquipCharacterbyItem(characterFromID("Eden"), "bladeX4");
			TakenItems(characterFromID("Eden"), "bladep204", -1);

			GiveItem2Character(characterFromID("Teach"), "pistol204");		
			EquipCharacterbyItem(characterFromID("Teach"), "pistol204");

			LAi_QuestDelay("Eden_bribing_scene59", 1.0);
		break;

		case "Eden_bribing_scene59":
			PlaySound("VOICE\ENGLISH\gr_Teach4.wav");	
			LAi_SetFightMode(CharacterFromID("Eden"), false);
			LAi_SetStayType(CharacterFromID("Eden"));
			
			LAi_QuestDelay("Eden_bribing_scene60", 2.0);
		break;

		case "Eden_bribing_scene60":
			LAi_SetActorType(characterFromID("Eden"));
			LAi_ActorTurnToLocator(characterFromID("Eden"), "reload", "reload2");
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorGoToLocator(characterFromID("Teach"), "reload", "reload2", "Eden_bribing_scene61", 2.0);
		break;

		case "Eden_bribing_scene61":
			ChangeCharacterAddressGroup(characterFromID("Teach"), "BB_Eden_estate_wreck", "goto", "B_teach");

			LAi_SetActorType(characterFromID("Eden"));
			LAi_ActorGoToLocator(characterFromID("Eden"), "reload", "reload2", "Eden_bribing_scene62", 2.0);
		break;

		case "Eden_bribing_scene62":
			ChangeCharacterAddressGroup(characterFromID("Eden"), "BB_Eden_estate_wreck", "goto", "B_eden");
			Locations[FindLocation("BB_Eden_office")].reload.l2.disable = 0;
			Locations[FindLocation("BB_Eden_office")].reload.l2.go = "BB_Eden_estate_wreck";
			Locations[FindLocation("BB_Eden_office")].reload.l2.emerge = "B_hands";
			LAi_SetPlayerType(Pchar);
			SetCurrentTime(1, 0);
			SetNextWeather("Clear");

			pchar.quest.burning_ship.win_condition.l1 = "location";
			pchar.quest.burning_ship.win_condition.l1.location = "BB_Eden_estate_wreck";
			pchar.quest.burning_ship.win_condition = "burning_ship";
		break;

		case "burning_ship":
			LAi_SetActorType(characterFromID("Teach"));

			LAi_QuestDelay("burning_ship_sound", 0.1);
			LAi_QuestDelay("burning_ship1", 2.0);
			
		break;

		case "burning_ship_sound":
			if(Pchar.location == "BB_Eden_estate_wreck")
			{
				PlaySound3D("NATURE\fireplace3.wav", -371.0, 2.5, 227.0);
				PlaySound3D("NATURE\fireplace3.wav", -371.0, 2.5, 227.0);
				PlaySound3D("NATURE\fireplace4.wav", -371.0, 2.5, 227.0);

				LAi_QuestDelay("burning_ship_sound", 4.8);
			}
			else return;
		break;

		case "burning_ship1":
			PlaySound("VOICE\ENGLISH\Eden_take_care.wav");

			LAi_QuestDelay("burning_ship2", 2.0);
		break;

		case "burning_ship2":
			PlaySound("VOICE\ENGLISH\gr_Teach6.wav");

			LAi_QuestDelay("burning_ship3", 2.5);
		break;

		case "burning_ship3":
			PlaySound("VOICE\ENGLISH\Eden_why.wav");

			LAi_QuestDelay("burning_ship4", 1.0);
		break;

		case "burning_ship4":
			PlaySound("VOICE\ENGLISH\gr_Teach4.wav");

			LAi_QuestDelay("burning_ship5", 2.5);
		break;

		case "burning_ship5":
			PlaySound("VOICE\ENGLISH\Eden_well.wav");

			LAi_QuestDelay("burning_ship6", 1.0);
		break;

		case "burning_ship6":
			PlaySound("VOICE\ENGLISH\gr_Teach10.wav");

			LAi_QuestDelay("burning_ship7", 2.5);
		break;

		case "burning_ship7":
			PlaySound("VOICE\ENGLISH\Eden_so.wav");

			LAi_QuestDelay("burning_ship8", 1.0);
		break;

		case "burning_ship8":
			PlaySound("VOICE\ENGLISH\gr_Teach5.wav");

			LAi_QuestDelay("burning_ship9", 2.5);
		break;

		case "burning_ship9":
			PlaySound("VOICE\ENGLISH\Eden_twist_neck.wav");

			LAi_QuestDelay("burning_ship10", 4.5);
		break;

		case "burning_ship10":
			PlaySound("VOICE\ENGLISH\pir_capR3.wav");

			LAi_QuestDelay("burning_ship11", 2.0);
		break;

		case "burning_ship11":
			PlaySound("VOICE\ENGLISH\Eden_time_go.wav");

			LAi_QuestDelay("burning_ship12", 1.5);
		break;

		case "burning_ship12":
			PlaySound("VOICE\ENGLISH\gr_Hands1.wav");

			LAi_QuestDelay("burning_ship13", 1.0);
		break;

		case "burning_ship13":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box5");

			LAi_QuestDelay("pchar_playertype", 1.0);
			LAi_QuestDelay("burning_ship14", 2.0);
		break;

		case "burning_ship14":
			if(CheckAttribute(Pchar,"Pyle_model"))
			{
				switch(Pchar.Pyle_model)
				{
					case "3":
						SetModel(Pchar, "Howard_Pyle_3", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
					break;

					case "4":
						SetModel(Pchar, "Howard_Pyle_4", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);	
					break;

					case "5":
						SetModel(Pchar, "Howard_Pyle_5", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);		
					break;

					case "0":
						SetModel(Pchar, "Howard_Pyle", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);	
					break;
				}
			}

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			DeleteAttribute(Pchar, "items");
			
			if(CheckAttribute(characterFromID("Brthug1"), "items"))
			{
				makearef(ifrom, Characters[GetCharacterIndex("Brthug1")].items);
				Pchar.items = "";
				makearef(ito, Pchar.items);
				CopyAttributes(&ito, &ifrom);
				DeleteAttribute(Characters[GetCharacterIndex("Brthug1")], "items");
			}
		
		//	GiveItem2Character(Pchar, "bladeX4");						//pchar got 2 x fists
			EquipCharacterByItem(pchar, FindCharacterItemByGroup(pchar, BLADE_ITEM_TYPE));
			EquipCharacterByItem(pchar, FindCharacterItemByGroup(pchar, GUN_ITEM_TYPE));

			if(CheckAttribute(Pchar, "Hands_officer") && Pchar.Hands_officer == "yes")
			{
				AddPassenger(Pchar, characterFromID("Hands"), 0);
				SetOfficersIndex(Pchar, 1, getCharacterIndex("Hands"));
				LAi_SetOfficerType(characterFromID("Hands"));
			}	
			if(CheckAttribute(Pchar, "Pell_officer") && Pchar.Pell_officer == "yes")
			{
				AddPassenger(Pchar, characterFromID("Pell"), 0);
				SetOfficersIndex(Pchar, 2, getCharacterIndex("Pell"));
				LAi_SetOfficerType(characterFromID("Pell"));
			}

			Locations[FindLocation("BB_Eden_office")].image = "";			//change back here later on
			
			SetCurrentTime(12, 0);
			SetNextWeather("Clear");
			if(CheckAttribute(Pchar, "hands_dialogG") && Pchar.hands_dialogG == "yes")
			{
				DoQuestReloadToLocation("BB_Eden_estate", "reload", "reload11" ,"Margaret_Pough3A");
			}
			else DoQuestReloadToLocation("BB_Eden_estate", "reload", "reload6" ,"Margaret_Pough3AA");
		break;
//end burning ship
//-------------------------------------------------------------------------------------------------------
		case "Pough3_done_no_Hands":
			AddQuestRecord("Charles_Eden", "8");
			LAi_SetCitizenType(characterFromID("Margaret_Pough"));
			Characters[GetCharacterIndex("Margaret_Pough")].dialog.CurrentNode  = "neutral";
			Pchar.servants_info = "5";
		break;
//-------------------------------------------------------------------------------------------------------

		case "Margaret_Pough3AA":
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "dialogC", "Margaret_Pough3A", 2.0);
		break;

		case "Margaret_Pough3A":
			characters[GetCharacterIndex("Hands")].dialog.CurrentNode = "wine_cellar2";
			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorDialog(characterFromID("Hands"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hands"));
		break;

		case "Margaret_Pough4":
			LAi_SetActorType(characterFromID("Margaret_Pough"));
			LAi_ActorDialog(characterFromID("Margaret_Pough"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Margaret_Pough"));
			Characters[GetCharacterIndex("Margaret_Pough")].dialog.CurrentNode  = "Tobias_Knight";
		break;

		case "Pough4_done":
			characters[GetCharacterIndex("Hands")].dialog.CurrentNode = "wine_cellar3";
			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorDialog(characterFromID("Hands"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hands"));
		break;

		case "estate_wine_cellar1":
			AddQuestRecord("Charles_Eden", "7");
			LAi_SetStayType(characterFromID("Margaret_Pough"));
			Characters[GetCharacterIndex("Margaret_Pough")].dialog.CurrentNode  = "neutral";
			if(IsOfficer(CharacterFromID("Pell")))				
			{
				RemovePassenger(Pchar, characterFromID("Pell"));
				LAi_SetActorType(characterFromID("Pell"));
				LAi_ActorGoToLocator(characterFromID("Pell"), "reload", "reload5", "Pell_guard", 10.0);
				Pchar.Pell = "in_hall";
			}

			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorGoToLocator(characterFromID("Hands"), "box", "box1", "Hands_gone", 26.0);
			Pchar.estate_direction = "Teach_house";

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "servant");

			LAi_QuestDelay("pchar_staytype", 1.0);
			LAi_QuestDelay("pchar_playertype", 13.0);
		break;

		case "Pell_guard":
			ChangeCharacterAddressGroup(characterFromID("Pell"), "BB_Eden_estate", "reload", "reload5");
			LAi_SetStayType(characterFromID("Pell"));
		break;

		case "Hands_gone":
			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_Eden_estate", "box", "box24");

			pchar.quest.Hands_river.win_condition.l1 = "locator";
			pchar.quest.Hands_river.win_condition.l1.location = "BB_Eden_estate";
			pchar.quest.Hands_river.win_condition.l1.locator_group = "goto";
			pchar.quest.Hands_river.win_condition.l1.locator = "box5";
			pchar.quest.Hands_river.win_condition = "Hands_river";
		break;

		case "Hands_river":
			ChangeCharacterAddressGroup(characterFromID("Hands"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_Eden_estate", "box", "box6");

			LAi_QuestDelay("Eden_steplocks", 0.1);

			characters[GetCharacterIndex("Hands")].dialog.CurrentNode = "flood";
			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorDialog(characterFromID("Hands"), Pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hands"));	
		break;

		case "Estate_low_tide":
			Locations[FindLocation("BB_Eden_estate")].models.always.locators = "Estate_locators_Q2_lowtide";
			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_Teach_drawing_room", "goto", "goto7");
			locations[FindLocation("BB_Eden_estate")].environment.sea = "false";
			SetCurrentTime(12.00, 0);
			SetNextWeather("Clear");

			pchar.quest.Hands_door_where.win_condition.l1 = "locator";
			pchar.quest.Hands_door_where.win_condition.l1.location = "BB_Eden_tunnel";
			pchar.quest.Hands_door_where.win_condition.l1.locator_group = "goto";
			pchar.quest.Hands_door_where.win_condition.l1.locator = "door_where";
			pchar.quest.Hands_door_where.win_condition = "Hands_door_where";
		break;
	
		//------------------------------------------------------------------------------

		case "Cayman_turn_to_ri3":
			PlaySound("PEOPLE\grass_turn.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "randitem", "randitem3");

			LAi_QuestDelay("Cayman_turn_to_ri3_A", 1.0);
		break;

		case "Cayman_turn_to_ri3_A":
			Pchar.Cayman_box2 = "turned";
			LAi_SetPlayerType(Pchar);
		break;

		case "Estate_turn_to_box9":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box9");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "Estate_turn_to_box1":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box1");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "Estate_turn_to_box22":
			PlaySound("PEOPLE\grass_turn.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box22");

			LAi_QuestDelay("pchar_playertype", 1.0);
		break;

		case "Estate_turn_to_wall":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "wall");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "Estate_turn_to_box24":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box24");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "Estate_turn_to_box25":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box25");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "Estate_turn_to_box26":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box26");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "Estate_turn_to_box27":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box27");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "Estate_turn_to_box28":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box28");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "Estate_turn_to_box29":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box29");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "Estate_turn_to_box4":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box4");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "Hands_to_Teach_kitchen":
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_Teach_kitchen", "officers", "reload4_1");
			LAi_SetOfficerType(characterFromID("Hands"));
		break;

		case "Estate_turn_to_box7":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box7");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "Estate_turn_to_Teach_door":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "Teach_door");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "Estate_turn_to_box8":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box8");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "Estate_turn_to_box9":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box9");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "Estate_turn_to_box10":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box10");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;
		
		case "Estate_turn_to_box13":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box13");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "Hands_to_Eden_cellar":
			PlaySound("INTERFACE\metal_hatch_close.wav");
			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_Eden_tunnel", "officers", "reload2_1");
		break;

		case "Estate_turn_to_Teach_cellar":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "Teach_cellar");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "maze_gate1_down_check":
			pchar.quest.maze_gate1_down.win_condition.l1 = "locator";
			pchar.quest.maze_gate1_down.win_condition.l1.location = "BB_Eden_maze";
			pchar.quest.maze_gate1_down.win_condition.l1.locator_group = "goto";
			pchar.quest.maze_gate1_down.win_condition.l1.locator = "gate1";
			pchar.quest.maze_gate1_down.win_condition = "maze_gate1_down";
		break;

		case "maze_gate1_down":
			ChangeCharacterAddressGroup(Pchar, "BB_Eden_maze", "goto", "gate1_down");
			SetNextWeather("Clear");

			LAi_QuestDelay("maze_gate1_up_check", 0.5);
		break;

		case "maze_gate1_up_check":
			pchar.quest.maze_gate1_up.win_condition.l1 = "locator";
			pchar.quest.maze_gate1_up.win_condition.l1.location = "BB_Eden_maze";
			pchar.quest.maze_gate1_up.win_condition.l1.locator_group = "goto";
			pchar.quest.maze_gate1_up.win_condition.l1.locator = "gate1";
			pchar.quest.maze_gate1_up.win_condition = "maze_gate1_up";
		break;

		case "maze_gate1_up":
			ChangeCharacterAddressGroup(Pchar, "BB_Eden_maze", "goto", "gate1_up");
			LAi_SetActorType(characterFromID("Eden_ghost"));
			LAi_ActorTurnToLocator(characterFromID("Eden_ghost"), "quest", "turn");
			SetNextWeather("Clear");

			LAi_QuestDelay("maze_gate1_down_check", 0.5);
		break;

		//------------------------------------------------------------------------------

		case "maze_gate2_down_check":
			pchar.quest.maze_gate2_down.win_condition.l1 = "locator";
			pchar.quest.maze_gate2_down.win_condition.l1.location = "BB_Eden_maze";
			pchar.quest.maze_gate2_down.win_condition.l1.locator_group = "goto";
			pchar.quest.maze_gate2_down.win_condition.l1.locator = "gate2";
			pchar.quest.maze_gate2_down.win_condition = "maze_gate2_down";
		break;

		case "maze_gate2_down":
			ChangeCharacterAddressGroup(Pchar, "BB_Eden_maze", "goto", "gate2_down");
			SetNextWeather("Clear");

			LAi_QuestDelay("maze_gate2_up_check", 0.5);
		break;

		case "maze_gate2_up_check":
			pchar.quest.maze_gate2_up.win_condition.l1 = "locator";
			pchar.quest.maze_gate2_up.win_condition.l1.location = "BB_Eden_maze";
			pchar.quest.maze_gate2_up.win_condition.l1.locator_group = "goto";
			pchar.quest.maze_gate2_up.win_condition.l1.locator = "gate2";
			pchar.quest.maze_gate2_up.win_condition = "maze_gate2_up";
		break;

		case "maze_gate2_up":
			ChangeCharacterAddressGroup(Pchar, "BB_Eden_maze", "goto", "gate2_up");
			ChangeCharacterAddressGroup(characterFromID("Eden_ghost"), "BB_Eden_maze", "quest", "ghost");
			LAi_SetActorType(characterFromID("Eden_ghost"));
			LAi_ActorTurnToLocator(characterFromID("Eden_ghost"), "quest", "forward");
			SetNextWeather("Clear");

			Pchar.quest.Eden_ghost_gone.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.Eden_ghost_gone.win_condition.l1.location = "BB_Eden_maze";
			Pchar.quest.Eden_ghost_gone.win_condition = "Eden_ghost_gone";

			LAi_QuestDelay("maze_gate2_down_check", 0.5);
		break;

		case "Eden_ghost_gone":
			ChangeCharacterAddressGroup(characterFromID("Eden_ghost"), "none", "", "");
		break;
		//------------------------------------------------------------------------------
//maze fountain step-back
		case "maze_F1_check":
			pchar.quest.maze_F1_back.win_condition.l1 = "locator";
			pchar.quest.maze_F1_back.win_condition.l1.location = "BB_Eden_maze";
			pchar.quest.maze_F1_back.win_condition.l1.locator_group = "quest";
			pchar.quest.maze_F1_back.win_condition.l1.locator = "F1";
			pchar.quest.maze_F1_back.win_condition = "maze_F1_back";
		break;
		
		case "maze_F1_back":
			ChangeCharacterAddressGroup(Pchar, "BB_Eden_maze", "goto", "F1_back");

			LAi_QuestDelay("maze_F1_check", 0.5);
		break;

		case "maze_F2_check":
			pchar.quest.maze_F2_back.win_condition.l1 = "locator";
			pchar.quest.maze_F2_back.win_condition.l1.location = "BB_Eden_maze";
			pchar.quest.maze_F2_back.win_condition.l1.locator_group = "quest";
			pchar.quest.maze_F2_back.win_condition.l1.locator = "F2";
			pchar.quest.maze_F2_back.win_condition = "maze_F2_back";
		break;
		
		case "maze_F2_back":
			ChangeCharacterAddressGroup(Pchar, "BB_Eden_maze", "goto", "F2_back");

			LAi_QuestDelay("maze_F2_check", 0.5);
		break;

		case "maze_F3_check":
			pchar.quest.maze_F3_back.win_condition.l1 = "locator";
			pchar.quest.maze_F3_back.win_condition.l1.location = "BB_Eden_maze";
			pchar.quest.maze_F3_back.win_condition.l1.locator_group = "quest";
			pchar.quest.maze_F3_back.win_condition.l1.locator = "F3";
			pchar.quest.maze_F3_back.win_condition = "maze_F3_back";
		break;
		
		case "maze_F3_back":
			ChangeCharacterAddressGroup(Pchar, "BB_Eden_maze", "goto", "F3_back");

			LAi_QuestDelay("maze_F3_check", 0.5);
		break;

		case "maze_F4_check":
			pchar.quest.maze_F4_back.win_condition.l1 = "locator";
			pchar.quest.maze_F4_back.win_condition.l1.location = "BB_Eden_maze";
			pchar.quest.maze_F4_back.win_condition.l1.locator_group = "quest";
			pchar.quest.maze_F4_back.win_condition.l1.locator = "F4";
			pchar.quest.maze_F4_back.win_condition = "maze_F4_back";
		break;
		
		case "maze_F4_back":
			ChangeCharacterAddressGroup(Pchar, "BB_Eden_maze", "goto", "F4_back");

			LAi_QuestDelay("maze_F4_check", 0.5);
		break;

		//------------------------------------------------------------------------------

		case "estate_girder":
			Locations[FindLocation("BB_Eden_chapel")].image = "";
			DoQuestReloadToLocation("BB_Eden_chapel", "goto", "goto5" ,"estate_girder1");
		break;

		case "estate_girder1":
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload1", 1.0);
			Locations[FindLocation("BB_Eden_chapel")].locators_radius.reload.reload1 = 1.0;

			if(!IsOfficer(CharacterFromID("Hands"))) ChangeCharacterAddressGroup(CharacterFromID("Hands"), "none", "", "");

			Locations[FindLocation("BB_Eden_chapel")].image = "Inside_chapel.tga";

			pchar.quest.hands_dialogG.win_condition.l1 = "locator";
			pchar.quest.hands_dialogG.win_condition.l1.location = "BB_Eden_estate";
			pchar.quest.hands_dialogG.win_condition.l1.locator_group = "goto";
			pchar.quest.hands_dialogG.win_condition.l1.locator = "entre";
			pchar.quest.hands_dialogG.win_condition = "hands_dialogG";
		break;

		case "hands_dialogG":
			Pchar.hands_dialogG = "yes";
		break;

		//------------------------------------------------------------------------------

		case "Hands_mhm":
			if(locations[FindLocation("BB_Eden_estate")].environment.sea == "false")
			{
				PlaySound("VOICE\ENGLISH\gr_Hands1.wav");
			}
		break;

		case "Hands_door_where":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "door_where";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Hands_door_where1":
			characters[GetCharacterIndex("Hands")].dialog.CurrentNode = "door_where";
			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorDialog(characterFromID("Hands"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hands"));
		break;

		case "Hands_door_where_done":
			LAi_SetPlayerType(pchar);
			LAi_SetOfficerType(characterFromID("Hands"));
			AddQuestRecord("Charles_Eden", "9");
		break;

		//------------------------------------------------------------------------------

		case "Eden_steplocks":
			//starts Eden tunnel puzzle
		
			pchar.quest.Eden_elevator1.win_condition.l1 = "locator";
			pchar.quest.Eden_elevator1.win_condition.l1.location = "BB_Eden_tunnel";
			pchar.quest.Eden_elevator1.win_condition.l1.locator_group = "goto";
			pchar.quest.Eden_elevator1.win_condition.l1.locator = "elevator1";
			pchar.quest.Eden_elevator1.win_condition = "Eden_elevator_steplock1";

			pchar.quest.Eden_elevator2.win_condition.l1 = "locator";
			pchar.quest.Eden_elevator2.win_condition.l1.location = "BB_Eden_tunnel";
			pchar.quest.Eden_elevator2.win_condition.l1.locator_group = "goto";
			pchar.quest.Eden_elevator2.win_condition.l1.locator = "elevator2";
			pchar.quest.Eden_elevator2.win_condition = "Eden_elevator_steplock2";

			pchar.quest.Eden_gate_stop1.win_condition.l1 = "locator";
			pchar.quest.Eden_gate_stop1.win_condition.l1.location = "BB_Eden_tunnel";
			pchar.quest.Eden_gate_stop1.win_condition.l1.locator_group = "goto";
			pchar.quest.Eden_gate_stop1.win_condition.l1.locator = "gate_stop1";
			pchar.quest.Eden_gate_stop1.win_condition = "Eden_gate_stop1";

			pchar.quest.Eden_gate_stop2.win_condition.l1 = "locator";
			pchar.quest.Eden_gate_stop2.win_condition.l1.location = "BB_Eden_tunnel";
			pchar.quest.Eden_gate_stop2.win_condition.l1.locator_group = "goto";
			pchar.quest.Eden_gate_stop2.win_condition.l1.locator = "gate_stop2";
			pchar.quest.Eden_gate_stop2.win_condition = "Eden_gate_stop2";
		
			pchar.quest.Eden_gate2_stop.win_condition.l1 = "locator";
			pchar.quest.Eden_gate2_stop.win_condition.l1.location = "BB_Eden_tunnel";
			pchar.quest.Eden_gate2_stop.win_condition.l1.locator_group = "goto";
			pchar.quest.Eden_gate2_stop.win_condition.l1.locator = "gate2_stop";
			pchar.quest.Eden_gate2_stop.win_condition = "Eden_gate2_stop";
		break;

		//-----------------------------------------------------------------------------------------

		case "Eden_elevator_steplock1":
			if(Locations[FindLocation("BB_Eden_tunnel")].models.always.l4 == "bars_down") return;
			if(Locations[FindLocation("BB_Eden_tunnel")].models.always.l3 == "elevator_up") return;

			LAi_SetStayType(Pchar);
			PlaySound("INTERFACE\step_path.wav");

			Locations[FindLocation(Pchar.location)].models.always.l4 = "bars_down";
			Locations[FindLocation(Pchar.location)].locators_radius.goto.gate_stop1 = 0.5;
			Locations[FindLocation(Pchar.location)].models.always.l5 = "lever1_up";
			Locations[FindLocation(Pchar.location)].reload.l1.disable = 0;		//to Eden office

			LAi_QuestDelay("Eden_elevator_steplock1_A", 0.5);
		break;

		case "Eden_elevator_steplock1_A":
			Locations[FindLocation("BB_Eden_tunnel")].image = "";
			DoQuestReloadToLocation("BB_Eden_tunnel", "goto", "elevator1", "Eden_steplock_3"); //use same code from here
		break;

		//-----------------------------------------------------------------------------------------

		case "Eden_elevator_steplock2":
			if(Locations[FindLocation("BB_Eden_tunnel")].models.always.l4 == "bars_down") return;
			if(Locations[FindLocation("BB_Eden_tunnel")].models.always.l3 == "elevator_up") return;

			LAi_SetStayType(Pchar);
			PlaySound("INTERFACE\step_path.wav");

			Locations[FindLocation(Pchar.location)].models.always.l4 = "bars_down";
			Locations[FindLocation(Pchar.location)].locators_radius.goto.gate_stop1 = 0.5;
			Locations[FindLocation(Pchar.location)].models.always.l5 = "lever1_up";
			Locations[FindLocation(Pchar.location)].reload.l1.disable = 0;		//to Eden office

			LAi_QuestDelay("Eden_elevator_steplock2_A", 0.5);
		break;

		case "Eden_elevator_steplock2_A":
			Locations[FindLocation("BB_Eden_tunnel")].image = "";
			DoQuestReloadToLocation("BB_Eden_tunnel", "goto", "elevator2", "Eden_steplock_3"); //use same code from here
		break;

		//-----------------------------------------------------------------------------------------

		case "Eden_steplock":
			if(Locations[FindLocation("BB_Eden_tunnel")].models.always.l4 == "bars_down") return;
			if(Locations[FindLocation("BB_Eden_tunnel")].models.always.l3 == "elevator_down") return;

			LAi_SetStayType(Pchar);
			PlaySound("INTERFACE\step_path.wav");

			Locations[FindLocation(Pchar.location)].models.always.l4 = "bars_down";
			Locations[FindLocation(Pchar.location)].locators_radius.goto.gate_stop1 = 0.5;
			Locations[FindLocation(Pchar.location)].models.always.l5 = "lever1_up";
			Locations[FindLocation(Pchar.location)].reload.l1.disable = 0;		//to Eden office

			LAi_QuestDelay("Eden_steplock_2", 0.5);
		break;

		case "Eden_steplock_2":
			Locations[FindLocation("BB_Eden_tunnel")].image = "";
			DoQuestReloadToLocation("BB_Eden_tunnel", "goto", "steplock", "Eden_steplock_3");
		break;

		case "Eden_steplock_3":
			PlaySound("INTERFACE\rusty.wav");
			RemovePassenger(Pchar, characterFromID("Hands"));
			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_Eden_tunnel", "goto", "H_steplock");

			LAi_QuestDelay("Hands_reset_officer", 0.2);
			LAi_QuestDelay("Eden_steplock_4", 1.0);
		break;

		case "Hands_reset_officer":
			AddPassenger(Pchar, characterFromID("Hands"), 0);
			SetOfficersIndex(Pchar, 1, getCharacterIndex("Hands"));
			LAi_SetOfficerType(characterFromID("Hands"));
		break;

		case "Eden_steplock_4":
			Locations[FindLocation("BB_Eden_tunnel")].image = "church_wine_cellar.tga";	
			PlaySound("INTERFACE\key_unlock2.wav");
			LAi_SetPlayerType(Pchar);

			SetLocatorRadius(locations[FindLocation(Pchar.location)], "goto", "gate_stop1", 0.5);
			Locations[FindLocation("BB_Eden_tunnel")].locators_radius.goto.gate_stop1 = 0.5;
		break;

		//-----------------------------------------------------------------------------------

		case "Eden_gate_stop1":
			PlaySound("INTERFACE\locked_window.wav");
			LAi_SetStayType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_Eden_tunnel", "goto", "gate_back1");

			LAi_QuestDelay("Eden_gate_stop1A", 0.5);
		break;

		case "Eden_gate_stop1A":
			LAi_SetPlayerType(Pchar);

			pchar.quest.Eden_gate_stop1.win_condition.l1 = "locator";
			pchar.quest.Eden_gate_stop1.win_condition.l1.location = "BB_Eden_tunnel";
			pchar.quest.Eden_gate_stop1.win_condition.l1.locator_group = "goto";
			pchar.quest.Eden_gate_stop1.win_condition.l1.locator = "gate_stop1";
			pchar.quest.Eden_gate_stop1.win_condition = "Eden_gate_stop1";
		break;

		//-----------------------------------------------------------------------------------

		case "Eden_gate_stop2":
			PlaySound("INTERFACE\locked_window.wav");
			LAi_SetStayType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_Eden_tunnel", "goto", "gate_back2");

			LAi_QuestDelay("Eden_gate_stop2A", 0.5);
		break;

		case "Eden_gate_stop2A":
			LAi_SetPlayerType(Pchar);

			pchar.quest.Eden_gate_stop2.win_condition.l1 = "locator";
			pchar.quest.Eden_gate_stop2.win_condition.l1.location = "BB_Eden_tunnel";
			pchar.quest.Eden_gate_stop2.win_condition.l1.locator_group = "goto";
			pchar.quest.Eden_gate_stop2.win_condition.l1.locator = "gate_stop2";
			pchar.quest.Eden_gate_stop2.win_condition = "Eden_gate_stop2";
		break;

		//-----------------------------------------------------------------------------------

		case "Eden_gate2_stop":
			PlaySound("INTERFACE\locked_window.wav");
			LAi_SetStayType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_Eden_tunnel", "goto", "gate2_back");

			LAi_QuestDelay("Eden_gate2_stopA", 0.5);
		break;

		case "Eden_gate2_stopA":
			LAi_SetPlayerType(Pchar);

			pchar.quest.Eden_gate2_stop.win_condition.l1 = "locator";
			pchar.quest.Eden_gate2_stop.win_condition.l1.location = "BB_Eden_tunnel";
			pchar.quest.Eden_gate2_stop.win_condition.l1.locator_group = "goto";
			pchar.quest.Eden_gate2_stop.win_condition.l1.locator = "gate2_stop";
			pchar.quest.Eden_gate2_stop.win_condition = "Eden_gate2_stop";
		break;

		//-----------------------------------------------------------------------------------

		case "Eden_tunnel_gate_up":
			//from box6 Eden_tunnel
			
			Locations[FindLocation("BB_Eden_tunnel")].image = "";
			DoQuestReloadToLocation("BB_Eden_tunnel", "box", "box6", "Eden_tunnel_gate_up1");
		break;

		case "Eden_tunnel_gate_up1":
			PlaySound("INTERFACE\rusty.wav");
			RemovePassenger(Pchar, characterFromID("Hands"));
			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_Eden_tunnel", "goto", "H_lever6");
			Locations[FindLocation("BB_Eden_tunnel")].image = "church_wine_cellar.tga";
	
			LAi_QuestDelay("Hands_reset_officer", 0.2);
			LAi_QuestDelay("Eden_tunnel_gate_up2", 2.0);
		break;

		case "Eden_tunnel_gate_up2":
			PlaySound("INTERFACE\key_lock.wav");

			if(Locations[FindLocation("BB_Eden_tunnel")].models.always.l3 == "elevator_down")
			{
				pchar.quest.Eden_elevator1.win_condition.l1 = "locator";
				pchar.quest.Eden_elevator1.win_condition.l1.location = "BB_Eden_tunnel";
				pchar.quest.Eden_elevator1.win_condition.l1.locator_group = "goto";
				pchar.quest.Eden_elevator1.win_condition.l1.locator = "elevator1";
				pchar.quest.Eden_elevator1.win_condition = "Eden_elevator_steplock1";

				pchar.quest.Eden_elevator2.win_condition.l1 = "locator";
				pchar.quest.Eden_elevator2.win_condition.l1.location = "BB_Eden_tunnel";
				pchar.quest.Eden_elevator2.win_condition.l1.locator_group = "goto";
				pchar.quest.Eden_elevator2.win_condition.l1.locator = "elevator2";
				pchar.quest.Eden_elevator2.win_condition = "Eden_elevator_steplock2";
			}
			else
			{
				pchar.quest.Eden_steplock.win_condition.l1 = "locator";
				pchar.quest.Eden_steplock.win_condition.l1.location = "BB_Eden_tunnel";
				pchar.quest.Eden_steplock.win_condition.l1.locator_group = "goto";
				pchar.quest.Eden_steplock.win_condition.l1.locator = "steplock";
				pchar.quest.Eden_steplock.win_condition = "Eden_steplock";
			}
		break;

		//--------------------------------------------------------------------------------------

		case "Eden_tunnel_gate_down":
			//from box6 Eden_tunnel
			
			Locations[FindLocation("BB_Eden_tunnel")].image = "";
			DoQuestReloadToLocation("BB_Eden_tunnel", "box", "box6", "Eden_tunnel_gate_down1");
		break;

		case "Eden_tunnel_gate_down1":
			PlaySound("INTERFACE\rusty.wav");
			RemovePassenger(Pchar, characterFromID("Hands"));
			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_Eden_tunnel", "goto", "H_lever6");
			Locations[FindLocation("BB_Eden_tunnel")].image = "church_wine_cellar.tga";
	
			LAi_QuestDelay("Hands_reset_officer", 0.2);
			LAi_QuestDelay("Eden_tunnel_gate_down2", 2.0);
		break;

		case "Eden_tunnel_gate_down2":
			PlaySound("INTERFACE\key_unlock2.wav");
			LAi_SetPlayerType(Pchar);

			SetLocatorRadius(locations[FindLocation(Pchar.location)], "goto", "gate_stop1", 0.5);
			Locations[FindLocation("BB_Eden_tunnel")].locators_radius.goto.gate_stop1 = 0.5;
		break;

		//--------------------------------------------------------------------------------------

		case "Eden_tunnel_elevator_up":
			//from box7 Eden_tunnel
			
			Locations[FindLocation("BB_Eden_tunnel")].image = "";
			DoQuestReloadToLocation("BB_Eden_tunnel", "box", "box7", "Eden_tunnel_elevator_up1");
		break;

		case "Eden_tunnel_elevator_up1":
			PlaySound("INTERFACE\elevator_short.wav");
			RemovePassenger(Pchar, characterFromID("Hands"));
			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_Eden_tunnel", "goto", "H_lever7");
			Locations[FindLocation("BB_Eden_tunnel")].image = "church_wine_cellar.tga";

			LAi_QuestDelay("Hands_reset_officer", 0.2);

			pchar.quest.Eden_steplock.win_condition.l1 = "locator";
			pchar.quest.Eden_steplock.win_condition.l1.location = "BB_Eden_tunnel";
			pchar.quest.Eden_steplock.win_condition.l1.locator_group = "goto";
			pchar.quest.Eden_steplock.win_condition.l1.locator = "steplock";
			pchar.quest.Eden_steplock.win_condition = "Eden_steplock";
		break;

		case "Eden_tunnel_elevator_down":
			//from box7 Eden_tunnel
			
			if(CheckAttribute(Pchar,"wine_bottles") && Pchar.wine_bottles == "4")
			{
				Locations[FindLocation(Pchar.location)].models.always.l4 = "bars_down";
				Locations[FindLocation(Pchar.location)].locators_radius.goto.gate_stop2 = 0.5;	//obs gate_stop2
				Locations[FindLocation(Pchar.location)].models.always.l5 = "lever1_up";
				Locations[FindLocation(Pchar.location)].reload.l1.disable = 0;			//to Eden office
			}

			Locations[FindLocation("BB_Eden_tunnel")].image = "";
			DoQuestReloadToLocation("BB_Eden_tunnel", "box", "box7", "Eden_tunnel_elevator_down1");
		break;

		case "Eden_tunnel_elevator_down1":
			PlaySound("INTERFACE\elevator_short.wav");
			RemovePassenger(Pchar, characterFromID("Hands"));
			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_Eden_tunnel", "goto", "H_lever7");
			Locations[FindLocation("BB_Eden_tunnel")].image = "church_wine_cellar.tga";

			LAi_QuestDelay("Hands_reset_officer", 0.2);

			pchar.quest.Eden_elevator1.win_condition.l1 = "locator";
			pchar.quest.Eden_elevator1.win_condition.l1.location = "BB_Eden_tunnel";
			pchar.quest.Eden_elevator1.win_condition.l1.locator_group = "goto";
			pchar.quest.Eden_elevator1.win_condition.l1.locator = "elevator1";
			pchar.quest.Eden_elevator1.win_condition = "Eden_elevator_steplock1";

			pchar.quest.Eden_elevator2.win_condition.l1 = "locator";
			pchar.quest.Eden_elevator2.win_condition.l1.location = "BB_Eden_tunnel";
			pchar.quest.Eden_elevator2.win_condition.l1.locator_group = "goto";
			pchar.quest.Eden_elevator2.win_condition.l1.locator = "elevator2";
			pchar.quest.Eden_elevator2.win_condition = "Eden_elevator_steplock2";

			if(CheckAttribute(Pchar,"wine_bottles") && Pchar.wine_bottles == "5")
			{
				//do nothing
			} 			
			else
			{
				if(CheckAttribute(Pchar,"wine_bottles") && Pchar.wine_bottles == "4") 
				{
					LAi_QuestDelay("open_Eden_office_from_upper_floor", 4.0);
				}
			}	
			else LAi_QuestDelay("elevator_not_heavy_enough", 4.0);
			
		break;

		case "elevator_not_heavy_enough":
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
			Logit(LanguageConvertString(tmpLangFileID,"No, the elevator isn't heavy enough."));
		break;

		//--------------------------------------------------------------------------------------

		case "Eden_tunnel_too_heavy_barrel":
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
			Logit(LanguageConvertString(tmpLangFileID,"Not a chance - the Barrel is too heavy."));
			Logit(LanguageConvertString(tmpLangFileID,"But it's something under it!"));
			LAi_SetPlayerType(Pchar);
			AddQuestRecord("Charles_Eden", "10");
		break;

		case "Eden_tunnel_wine_out":
			Locations[FindLocation(Pchar.location)].models.always.l10 = "bottle_niche";
			Locations[FindLocation("BB_Eden_tunnel")].image = "";
			DoQuestReloadToLocation("BB_Eden_tunnel", "box", "box5", "Eden_tunnel_wine_out1");
		break;

		case "Eden_tunnel_wine_out1":
			LAi_SetStayType(Pchar);
			PlaySound("INTERFACE\running_water.wav");
			PlaySound("INTERFACE\running_water.wav");
			RemovePassenger(Pchar, characterFromID("Hands"));
			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_Eden_tunnel", "goto", "H_barrel");
			Locations[FindLocation("BB_Eden_tunnel")].image = "church_wine_cellar.tga";

			LAi_QuestDelay("Hands_reset_officer", 0.2);
			LAi_QuestDelay("Eden_tunnel_wine_out2", 3.0);
		break;

		case "Eden_tunnel_wine_out2":
			PlaySound("INTERFACE\running_water.wav");
			PlaySound("INTERFACE\running_water.wav");

			LAi_QuestDelay("Eden_tunnel_wine_out3", 3.0);
		break;

		case "Eden_tunnel_wine_out3":
			Pchar.Eden_tunnel_box5 = "off";
			LAi_SetPlayerType(Pchar);
		break;

		case "Eden_tunnel_take_empty_barrel":
			Locations[FindLocation(Pchar.location)].models.always.l9 = "";		//no barrel
			Locations[FindLocation(Pchar.location)].models.always.l10 = "";		//no bottle

			Locations[FindLocation(Pchar.location)].models.always.l11 = "bars2_up";
			locations[FindLocation(Pchar.location)].locators_radius.goto.gate2_stop = 0.001;

			Locations[FindLocation("BB_Eden_tunnel")].image = "";
			DoQuestReloadToLocation("BB_Eden_tunnel", "goto", "box5", "Eden_tunnel_take_empty_barrel0");
		break;

		case "Eden_tunnel_take_empty_barrel0":
			GiveItem2Character(Pchar, "bladebarrel3"); 
			EquipCharacterbyItem(Pchar, "bladebarrel3");
			LAi_SetPlayerType(Pchar);
			RemovePassenger(Pchar, characterFromID("Hands"));
			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_Eden_tunnel", "goto", "H_barrel");

			LAi_QuestDelay("Hands_reset_officer", 0.2);
			LAi_QuestDelay("Eden_tunnel_take_empty_barrel1", 1.0);
		break;

		case "Eden_tunnel_take_empty_barrel1":
			PlaySound("INTERFACE\step_path.wav");
			Locations[FindLocation("BB_Eden_tunnel")].image = "church_wine_cellar.tga";

			LAi_QuestDelay("Eden_tunnel_gate2_up", 1.0);
		break;

		case "Eden_tunnel_gate2_up":
			PlaySound("INTERFACE\girder_open.wav");

			LAi_QuestDelay("pchar_whatwasthat", 2.0);
		break;

		//--------------------------------------------------------------------------------------

		case "Eden_tunnel_place_empty_barrel":
			Locations[FindLocation("BB_Eden_tunnel")].image = "";
			DoQuestReloadToLocation("BB_Eden_tunnel", "box", "box3", "Eden_tunnel_place_empty_barrel1");
		break;

		case "Eden_tunnel_place_empty_barrel1":
			LAi_SetPlayerType(Pchar);
			RemovePassenger(Pchar, characterFromID("Hands"));
			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_Eden_tunnel", "goto", "H_elevator");
			Locations[FindLocation("BB_Eden_tunnel")].image = "church_wine_cellar.tga";

			LAi_QuestDelay("Hands_reset_officer", 0.2);
		break;

		case "equip_wine_bottles_box1":
			if(CheckCharacterItem(Pchar,"bladebottlew5")) EquipCharacterByItem(Pchar, "bladebottlew5");
			if(CheckCharacterItem(Pchar,"pistolbottlew5")) 
			{
				string weaponID13 = GetCharacterEquipByGroup(Pchar,BLADE_ITEM_TYPE);
				aref weapon13;
				Items_FindItem(weaponID13, &weapon13);

				if(weapon13.model == "")
				{
					if(!CheckCharacterItem(Pchar,"bladeX4")) 
					{
						GiveItem2Character(Pchar, "bladeX4");
					}
					if(!IsEquipCharacterByItem(Pchar, "bladeX4"))
					{					
						EquipCharacterByItem(Pchar, "bladeX4");
					}
				}
				EquipCharacterByItem(Pchar, "pistolbottlew5");
			}
		break;

		case "equip_wine_bottles_box2":
			if(CheckCharacterItem(Pchar,"bladebottlew5")) EquipCharacterByItem(Pchar, "bladebottlew5");
			if(CheckCharacterItem(Pchar,"pistolbottlew5")) 
			{
				weaponID13 = GetCharacterEquipByGroup(Pchar,BLADE_ITEM_TYPE);
				Items_FindItem(weaponID13, &weapon13);

				if(weapon13.model == "")
				{
					if(!CheckCharacterItem(Pchar,"bladeX4")) 
					{
						GiveItem2Character(Pchar, "bladeX4");	
					}				
					if(!IsEquipCharacterByItem(Pchar, "bladeX4"))
					{					
						EquipCharacterByItem(Pchar, "bladeX4");
					}
				}
				EquipCharacterByItem(Pchar, "pistolbottlew5");
			}
		break;

		case "crash_pistol_bottle":
			PlaySound("AMBIENT\TAVERN\tinkle4.wav");
			TakeItemFromCharacter(Pchar, "pistolbottlew5");
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("count_bottles", 0.5);
		break;

		case "crash_blade_bottle":
			PlaySound("AMBIENT\TAVERN\tinkle4.wav");
			TakeItemFromCharacter(Pchar, "bladebottlew5");
			if(!CheckCharacterItem(Pchar,"bladeX4"))
			{
				GiveItem2Character(Pchar, "bladeX4");
			}					
			EquipCharacterByItem(Pchar, "bladeX4");
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("count_bottles", 0.5);
		break;

		case "count_bottles":
			if(CheckAttribute(Pchar,"wine_bottles"))
			{
				switch(Pchar.wine_bottles)
				{
					case "1": 
						LAi_QuestDelay("pchar_1", 1.0); 
						LAi_QuestDelay("count_bottles1", 2.0);
					break;

					case "2": 
						LAi_QuestDelay("pchar_2", 1.0); 
						LAi_QuestDelay("count_bottles1", 2.0);
					break;

					case "3": 
						LAi_QuestDelay("pchar_3", 1.0); 
						LAi_QuestDelay("count_bottles1", 2.0);
					break;

					case "4": 
						EquipCharacterByItem(pchar, FindCharacterItemByGroup(pchar, BLADE_ITEM_TYPE));
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box3", 0.001);
						Locations[FindLocation("BB_Eden_tunnel")].locators_radius.box.box3 = 0.001;
						Locations[FindLocation("BB_Eden_office")].models.always.locators = "EstateOffice_locators_Q2";//reset to the old one

						LAi_QuestDelay("pchar_4", 1.0); 
						LAi_QuestDelay("count_bottles1", 2.0);
					break;
				}
			}
		break;

		case "count_bottles1":
			Pchar.Eden_tunnel_box3 = "off";
		break;

		case "open_Eden_office_from_upper_floor":
			PlaySound("INTERFACE\step_path.wav");

			LAi_QuestDelay("open_Eden_office_from_upper_floor1", 1.0);
		break;

		case "open_Eden_office_from_upper_floor1":
			PlaySound("INTERFACE\rusty.wav");

			LAi_QuestDelay("open_Eden_office_from_upper_floor2", 1.0);
		break;

		case "open_Eden_office_from_upper_floor2":
			PlaySound("INTERFACE\key_unlock2.wav");

			ChangeCharacterAddressGroup(characterFromID("Knight"), "BB_Eden_office", "goto", "goto3");
			ChangeCharacterAddressGroup(characterFromID("wr_bri"), "BB_Eden_office", "goto", "governor1");
			ChangeCharacterAddressGroup(characterFromID("wr_boc1"), "BB_Eden_office", "goto", "thug1");
			ChangeCharacterAddressGroup(characterFromID("wr_boc3"), "BB_Eden_office", "goto", "thug2");
			LAi_SetActorType(characterFromID("Knight"));
			LAi_SetActorType(characterFromID("wr_bri"));
			LAi_SetActorType(characterFromID("wr_boc1"));
			LAi_SetActorType(characterFromID("wr_boc3"));
			RemoveCharacterEquip(characterFromID("wr_boc1"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("wr_boc1"), BLADE_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("wr_boc3"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("wr_boc3"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("wr_boc1"), "items");
			DeleteAttribute(characterFromID("wr_boc3"), "items");
			AddMoneyToCharacter(characterFromID("wr_boc1"),-10000);
			AddMoneyToCharacter(characterFromID("wr_boc3"),-10000);
			GiveItem2Character(characterFromID("wr_boc1"), "blade4");
			EquipCharacterByItem(characterFromID("wr_boc1"), "blade4");
			GiveItem2Character(characterFromID("wr_boc1"), "pistol1");
			EquipCharacterByItem(characterFromID("wr_boc1"), "pistol1");
			GiveItem2Character(characterFromID("wr_boc3"), "blade4");
			EquipCharacterByItem(characterFromID("wr_boc3"), "blade4");
			GiveItem2Character(characterFromID("wr_boc3"), "pistol1");
			EquipCharacterByItem(characterFromID("wr_boc3"), "pistol1");
			TakenItems(characterFromID("wr_boc1"), "gunpowder", 2);
			TakenItems(characterFromID("wr_boc1"), "pistolbullets", 2);
			TakenItems(characterFromID("wr_boc3"), "gunpowder", 2);
			TakenItems(characterFromID("wr_boc3"), "pistolbullets", 2);

			LAi_SetImmortal(CharacterFromID("wr_bri"), false);
			RemoveCharacterEquip(characterFromID("wr_bri"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("wr_bri"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("wr_bri"), "items");
			AddMoneyToCharacter(characterFromID("wr_bri"),-10000);
			GiveItem2Character(characterFromID("wr_bri"), "bladeA5");
			EquipCharacterByItem(characterFromID("wr_bri"), "bladeA5");
			GiveItem2Character(characterFromID("wr_bri"), "spyglass3");

			if(CheckAttribute(Pchar, "killed_wr_officers"))
			{
				switch(Pchar.killed_wr_officers)
				{
					case "0":
						GiveItem2Character(characterFromID("wr_bri"), "pistol203");
						EquipCharacterByItem(characterFromID("wr_bri"), "pistol203");
						GiveItem2Character(characterFromID("wr_bri"), "ammobag1");
						TakenItems(characterFromID("wr_bri"), "gunpowder", 2);
						TakenItems(characterFromID("wr_bri"), "pistolbullets", 2);

						LAi_QuestDelay("Courtney_items0_check", 0.1);
					break;

					case "1":
						GiveItem2Character(characterFromID("wr_bri"), "pistol201");
						GiveItem2Character(characterFromID("wr_bri"), "pistol204");
						EquipCharacterByItem(characterFromID("wr_bri"), "pistol201");
						TakenItems(characterFromID("wr_bri"), "gunpowder", 2);
						TakenItems(characterFromID("wr_bri"), "pistolbullets", 2);

						LAi_QuestDelay("Courtney_items1_check", 0.1);
					break;

					case "2":
						GiveItem2Character(characterFromID("wr_bri"), "pistol205");
						GiveItem2Character(characterFromID("wr_bri"), "pistol202");
						EquipCharacterByItem(characterFromID("wr_bri"), "pistol205");
						TakenItems(characterFromID("wr_bri"), "gunpowder", 2);
						TakenItems(characterFromID("wr_bri"), "pistolbullets", 2);

						LAi_QuestDelay("Courtney_items2_check", 0.1);
					break;

					case "3":
						GiveItem2Character(characterFromID("wr_bri"), "pistol206");
						GiveItem2Character(characterFromID("wr_bri"), "pistolbelt");
						EquipCharacterByItem(characterFromID("wr_bri"), "pistol206");
						TakenItems(characterFromID("wr_bri"), "gunpowder", 2);
						TakenItems(characterFromID("wr_bri"), "pistolbullets", 2);

						LAi_QuestDelay("Courtney_items3_check", 0.1);
					break;
				}
			}
			
			LAi_QuestDelay("pchar_yah", 1.0);

			SetNextWeather("Clear");

			pchar.quest.enter_Eden_office.win_condition.l1 = "location";
			pchar.quest.enter_Eden_office.win_condition.l1.location = "BB_Eden_office";
			pchar.quest.enter_Eden_office.win_condition = "enter_Eden_office";
		break;

		case "Courtney_items0_check":
			if(CheckCharacterItem(Pchar,"pistol203") && CheckCharacterItem(Pchar,"ammobag1"))
			{
				LAi_QuestDelay("Courtney_looted", 0.1);
			}
			else LAi_QuestDelay("Courtney_items0_check", 0.5);//loop check
		break;

		case "Courtney_items1_check":
			if(CheckCharacterItem(Pchar,"pistol201") && CheckCharacterItem(Pchar,"pistol204"))
			{
				LAi_QuestDelay("Courtney_looted", 0.1);
			}
			else LAi_QuestDelay("Courtney_items1_check", 0.5);//loop check
		break;

		case "Courtney_items2_check":
			if(CheckCharacterItem(Pchar,"pistol205") && CheckCharacterItem(Pchar,"pistol202"))
			{
				LAi_QuestDelay("Courtney_looted", 0.1);
			}
			else LAi_QuestDelay("Courtney_items2_check", 0.5);//loop check
		break;

		case "Courtney_items3_check":
			if(CheckCharacterItem(Pchar,"pistol206") && CheckCharacterItem(Pchar,"pistolbelt"))
			{
				LAi_QuestDelay("Courtney_looted", 0.1);
			}
			else LAi_QuestDelay("Courtney_items3_check", 0.5);//loop check
		break;

//---------------------------------------------------------------------------------------------------------------------

		case "enter_Eden_office":
			LAi_SetStayType(Pchar);
			PlaySound("INTERFACE\key_lock.wav");
			LAi_ActorRunToLocator(characterFromID("Knight"), "reload", "reload1", "enter_Eden_office1", 5.0);
			LAi_ActorAttack(CharacterFromID("wr_bri"), characterFromID("Knight"), "");

			Pchar.eden_office_boxes = "open";

			if(CheckAttribute(Pchar,"model"))
			{
				switch(Pchar.model)
				{
					case "Howard_Pyle_3":
						locations[FindLocation(Pchar.location)].box4.items.socks_sewing = 1;	
					break;

					case "Howard_Pyle_4":
						locations[FindLocation(Pchar.location)].box4.items.waistcoat = 1;	
					break;

					case "Howard_Pyle_5":
						locations[FindLocation(Pchar.location)].box4.items.sash = 1;	
					break;
				}
			}

			LAi_QuestDelay("pchar_huh", 2.0);
		break;

		case "enter_Eden_office1":
			LAi_SetPlayerType(Pchar);
			LAi_SetHP(CharacterFromID("wr_bri"), 250.0, 250.0);
			LAi_SetHP(CharacterFromID("wr_boc1"), 100.0, 100.0);
			LAi_SetHP(CharacterFromID("wr_boc3"), 100.0, 100.0);

			PlaySound("INTERFACE\key_unlock2.wav");
			LAi_group_MoveCharacter(characterFromID("wr_bri"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("wr_boc1"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("wr_boc3"), "ROOF_THUGS_1");

			LAi_QuestDelay("enter_Eden_office2", 1.0);
		break;

		case "enter_Eden_office2":
			ChangeCharacterAddressGroup(characterFromID("Knight"), "none", "", "");
			PlaySound("INTERFACE\closed_locked_door.wav");
			LAi_group_Register("ROOF_THUGS_1");
			LAi_group_SetRelation(LAI_GROUP_PLAYER, "ROOF_THUGS_1", LAI_GROUP_ENEMY);
			LAi_group_FightGroups(LAI_GROUP_PLAYER, "ROOF_THUGS_1", true);

			LAi_QuestDelay("pchar_ohoh", 1.0);

			Pchar.quest.Courtney_dead.win_condition.l1 = "NPC_Death";
			Pchar.quest.Courtney_dead.win_condition.l1.character = "wr_bri";
			Pchar.quest.Courtney_dead.win_condition.l2 = "NPC_Death";
			Pchar.quest.Courtney_dead.win_condition.l2.character = "wr_boc1";
			Pchar.quest.Courtney_dead.win_condition.l3 = "NPC_Death";
			Pchar.quest.Courtney_dead.win_condition.l3.character = "wr_boc3";
			Pchar.quest.Courtney_dead.win_condition = "Courtney_dead";
		break;

		case "Courtney_dead":
			LAi_SetFightMode(CharacterFromID("Hands"), false);
			Pchar.killed_wr_officers = sti(Pchar.killed_wr_officers) + 1;
			
			//reset
			Locations[FindLocation("BB_Eden_estate")].models.always.locators = "Estate_locators_Q2";
			Locations[FindLocation("BB_Eden_estate")].environment.sea = "true";
		break;

//----------------------------------------------------------------------------------------------------------------------

		case "Courtney_looted":
			Pchar.Courtney.looted = "yes";

			LAi_QuestDelay("Eden_office_done", 0.1);
		break;

		case "return_Eden_books":
			if(CheckCharacterItem(Pchar,"book21") || CheckCharacterItem(Pchar,"book24") || CheckCharacterItem(Pchar,"book34"))
			{
				Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"No, I don't bother to take anything."));
				PlaySound("INTERFACE\book_close.wav");
				TakenItems(Pchar, "book21", -1); TakenItems(Pchar, "book24", -1); TakenItems(Pchar, "book34", -1);
				locations[FindLocation(Pchar.location)].box1.items.book21 = 0;
				locations[FindLocation(Pchar.location)].box1.items.book24 = 0;
				locations[FindLocation(Pchar.location)].box1.items.book34 = 0;
				locations[FindLocation(Pchar.location)].box1.items.book21 = 1;
				locations[FindLocation(Pchar.location)].box1.items.book24 = 1;
				locations[FindLocation(Pchar.location)].box1.items.book34 = 1;
			}
		break;

		case "return_Eden_pictures":
			if(CheckCharacterItem(Pchar,"picture1") || CheckCharacterItem(Pchar,"picture3") 
			|| CheckCharacterItem(Pchar,"picture5") || CheckCharacterItem(Pchar,"picture6"))
			{
				Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"No, I don't bother to take anything."));
				PlaySound("INTERFACE\paper_small.wav");
				TakenItems(Pchar, "picture1", -1); TakenItems(Pchar, "picture3", -1); 
				TakenItems(Pchar, "picture5", -1); TakenItems(Pchar, "picture6", -1);
				locations[FindLocation(Pchar.location)].box2.items.picture1 = 0;
				locations[FindLocation(Pchar.location)].box2.items.picture3 = 0;
				locations[FindLocation(Pchar.location)].box2.items.picture5 = 0;
				locations[FindLocation(Pchar.location)].box2.items.picture6 = 0;
				locations[FindLocation(Pchar.location)].box2.items.picture1 = 1;
				locations[FindLocation(Pchar.location)].box2.items.picture3 = 1;
				locations[FindLocation(Pchar.location)].box2.items.picture5 = 1;
				locations[FindLocation(Pchar.location)].box2.items.picture6 = 1;
			}
		break;

		case "empty_Eden_box4_check":
			if(IsOfficer(CharacterFromID("Hands")))				
			{
				ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_Eden_office", "box", "box5");
			}

			if(locations[FindLocation(Pchar.location)].box4.items.socks_sewing == 0 && locations[FindLocation(Pchar.location)].box4.items.waistcoat == 0
			&& locations[FindLocation(Pchar.location)].box4.items.sash == 0)
			{
				Pchar.Eden.Pyle_outfit = "yes";
				
				LAi_QuestDelay("Eden_office_done", 0.1);
			}
		break;

		case "Eden_office_done":
			if(CheckAttribute(Pchar,"Courtney.looted") && Pchar.Courtney.looted == "yes") 
			{
				if(CheckAttribute(Pchar,"Eden.Pyle_outfit") && Pchar.Eden.Pyle_outfit == "yes") 
				{
					PlaySound("INTERFACE\key_unlock.wav");
					Locations[FindLocation("BB_Eden_office")].reload.l1.disable = 0;
					Locations[FindLocation("BB_Eden_estate")].reload.l5.disable = 0;
					
					LAi_QuestDelay("Eden_office_done1", 1.0);
				}
			}
		break;

		case "Eden_office_done1":
			ChangeCharacterAddressGroup(characterFromID("black_servant1"), "BB_Eden_office", "reload", "reload1");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload1");

			if(CheckAttribute(Pchar,"Pell") && Pchar.Pell == "in_hall")
			{
				AddPassenger(Pchar, characterFromID("Pell"), 0);
				SetOfficersIndex(Pchar, 2, getCharacterIndex("Pell"));
				LAi_SetOfficerType(characterFromID("Pell"));
			}

			LAi_QuestDelay("Eden_office_done2", 1.0);
		break;

		case "Eden_office_done2":
			characters[GetCharacterIndex("black_servant1")].dialog.CurrentNode = "what_are_you_doing";
			LAi_SetActorType(characterFromID("black_servant1"));
			LAi_ActorDialog(characterFromID("black_servant1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("black_servant1"));
		break;

		case "Eden_office_done3":
			PlaySound("INTERFACE\closed_door.wav");
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(characterFromID("black_servant1"), "BB_Eden_estate", "goto", "Hton_end");
			ChangeCharacterAddressGroup(characterFromID("Knight"), "BB_Eden_estate", "goto", "goto5");
			ChangeCharacterAddressGroup(characterFromID("Margaret_Pough"), "BB_Eden_estate", "goto", "pough_end");
			ChangeCharacterAddressGroup(characterFromID("Caesar"), "BB_Eden_estate", "goto", "caesar_kill");
			LAi_SetPoorType(characterFromID("Knight"));
		
			pchar.quest.Estate_end.win_condition.l1 = "location";
			pchar.quest.Estate_end.win_condition.l1.location = "BB_Eden_estate";
			pchar.quest.Estate_end.win_condition = "Estate_end";
		break;

		case "Estate_end":
			LAi_SetStayType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_Eden_estate", "goto", "office_exit");
			GetCharacterPos(characterFromID("Knight"), &u, &v, &w);
			CreateParticleSystem("stars_short" , u, v+1, w, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("OBJECTS\VOICES\DEAD\male\dead7.wav");

			ChangeCharacterAddressGroup(characterFromID("wr_bri"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("wr_boc1"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("wr_boc3"), "none", "", "");

			LAi_QuestDelay("Estate_end1", 1.0);
		break;

		case "Estate_end1":
			LAi_SetActorType(characterFromID("Margaret_Pough"));
			LAi_ActorDialog(characterFromID("Margaret_Pough"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Margaret_Pough"));
			Characters[GetCharacterIndex("Margaret_Pough")].dialog.CurrentNode  = "Knight_hurt";
		break;

		case "Estate_end2":
			Characters[GetCharacterIndex("Caesar")].Dialog.Filename = "Caesar_dialog.c";
			characters[GetCharacterIndex("Caesar")].dialog.CurrentNode = "Knight_thief";
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorDialog(characterFromID("Caesar"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Caesar"));
		break;

		case "Estate_end3":
			Characters[GetCharacterIndex("black_servant1")].Dialog.Filename = "Eden servants_dialog.c";
			characters[GetCharacterIndex("black_servant1")].dialog.CurrentNode = "Caesar_pirate";
			LAi_SetActorType(characterFromID("black_servant1"));
			LAi_ActorDialog(characterFromID("black_servant1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("black_servant1"));
		break;

		case "Estate_end4":
			characters[GetCharacterIndex("Knight")].dialog.CurrentNode = "he_hit_me";
			LAi_SetActorType(characterFromID("Knight"));
			LAi_ActorDialog(characterFromID("Knight"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Knight"));
		break;

		case "Estate_end5":
			LAi_SetActorType(characterFromID("Margaret_Pough"));
			LAi_ActorDialog(characterFromID("Margaret_Pough"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Margaret_Pough"));
			Characters[GetCharacterIndex("Margaret_Pough")].dialog.CurrentNode  = "sell_the_slave";
		break;

		case "Estate_end6":
			characters[GetCharacterIndex("Caesar")].name = "Caesar";
			characters[GetCharacterIndex("Caesar")].dialog.CurrentNode = "leaving_as_servant";
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorDialog(characterFromID("Caesar"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Caesar"));
		break;

		case "Estate_end7":
			LAi_SetActorType(characterFromID("Margaret_Pough"));
			LAi_ActorDialog(characterFromID("Margaret_Pough"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Margaret_Pough"));
			Characters[GetCharacterIndex("Margaret_Pough")].dialog.CurrentNode  = "stop_them";
		break;

		case "Estate_end8":
			AddPassenger(Pchar, characterFromID("Caesar"), 0);
			if(IsOfficer(CharacterFromID("Pell")))				
			{
				SetOfficersIndex(Pchar, 3, getCharacterIndex("Caesar"));
			}
			else SetOfficersIndex(Pchar, 2, getCharacterIndex("Caesar"));
			LAi_SetOfficerType(characterFromID("Caesar"));
			characters[GetCharacterIndex("Caesar")].dialog.CurrentNode = "neutral";

			LAi_QuestDelay("Estate_end9", 1.0);
		break;

		case "Estate_end9":
			LAi_SetActorType(characterFromID("Knight"));
			LAi_ActorTurnToCharacter(characterFromID("Knight"), Pchar);
			LAi_SetActorType(characterFromID("Margaret_Pough"));
			LAi_ActorTurnToCharacter(characterFromID("Margaret_Pough"), Pchar);
			LAi_SetActorType(characterFromID("black_servant1"));
			LAi_ActorTurnToCharacter(characterFromID("black_servant1"), Pchar);
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorTurnToCharacter(characterFromID("Caesar"), characterFromID("Knight"));

			LAi_QuestDelay("Estate_end10", 1.0);
		break;

		case "Estate_end10":
			LAi_SetPlayerType(characterFromID("Knight"));
			LAi_SetPlayerType(characterFromID("Margaret_Pough"));
			LAi_SetPlayerType(characterFromID("black_servant1"));
			LAi_SetFightMode(CharacterFromID("Knight"), true);
			LAi_SetFightMode(CharacterFromID("Margaret_Pough"), true);
			LAi_SetFightMode(CharacterFromID("black_servant1"), true);

			LAi_QuestDelay("Estate_end11", 1.5);
		break;

		case "Estate_end11":
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(Pchar, true);
			LAi_SetPlayerType(characterFromID("Hands"));
			LAi_SetFightMode(CharacterFromID("Hands"), true);
			GiveItem2Character(characterFromID("Caesar"), "bladeX4");
			EquipCharacterByItem(characterFromID("Caesar"), "bladeX4");
			LAi_SetPlayerType(characterFromID("Caesar"));
			LAi_SetFightMode(CharacterFromID("Caesar"), true);
			if(IsOfficer(CharacterFromID("Pell"))) 
			{
				LAi_SetPlayerType(characterFromID("Pell"));
				LAi_SetFightMode(CharacterFromID("Pell"), true);
			}

			LAi_QuestDelay("Estate_end12", 1.5);
		break;

		case "Estate_end12":
			PlaySound("OBJECTS\VOICES\DEAD\female\dead_wom5.wav");
			LAi_SetFightMode(CharacterFromID("Knight"), false);
			LAi_SetFightMode(CharacterFromID("Margaret_Pough"), false);
			LAi_SetFightMode(CharacterFromID("black_servant1"), false);

			LAi_QuestDelay("Estate_end13", 1.5);
		break;

		case "Estate_end13":
			PlaySound("VOICE\ENGLISH\blaze_lets_go.wav");
			LAi_SetFightMode(Pchar, false);
			LAi_SetFightMode(CharacterFromID("Hands"), false);
			LAi_SetFightMode(CharacterFromID("Caesar"), false);
			if(IsOfficer(CharacterFromID("Pell"))) 
			{
				LAi_SetFightMode(CharacterFromID("Pell"), false);
				LAi_SetOfficerType(characterFromID("Pell"));
			}

			LAi_SetOfficerType(characterFromID("Hands"));
			LAi_SetOfficerType(characterFromID("Caesar"));

			Pchar.estate_direction = "Cayman_town";
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], true);
			Characters[GetCharacterIndex("Margaret_Pough")].dialog.CurrentNode  = "hostile";
			characters[GetCharacterIndex("black_servant1")].dialog.CurrentNode = "hostile";
			characters[GetCharacterIndex("Knight")].dialog.CurrentNode = "hostile";
			LAi_SetCitizenType(characterFromID("Knight"));
			LAi_SetCitizenType(characterFromID("Margaret_Pough"));
			LAi_SetCitizenType(characterFromID("black_servant1"));
			Pchar.Cayman_box1 = "locked";	//from townhall to Estate

			pchar.quest.Estate_end15.win_condition.l1 = "location";
			pchar.quest.Estate_end15.win_condition.l1.location = "Grand_Cayman_townhall";
			pchar.quest.Estate_end15.win_condition = "Estate_end15";
		break;

		case "Estate_end15":
			PlaySound("INTERFACE\key_lock.wav");
			Locations[FindLocation("Grand_Cayman_town")].locators_radius.goto.goto30 = 3.0;
			SetModel(characterFromID("Caesar"), "bb_Caesar", "man", "man", 1.8, false);
			LAi_SetOfficerType(characterFromID("Caesar"));
			Locations[FindLocation("Grand_Cayman_town")].reload.l9.disable = 1;	//town back to TH

			pchar.quest.Estate_end16.win_condition.l1 = "location";
			pchar.quest.Estate_end16.win_condition.l1.location = "Grand_Cayman_town";
			pchar.quest.Estate_end16.win_condition = "Estate_end16";
		break;

		case "Estate_end16":
			PlaySound("INTERFACE\closed_locked_door.wav");

			LAi_QuestDelay("Caesar_mapBB3", 1.5);
		break;
		
		case "Caesar_mapBB3":
			characters[GetCharacterIndex("Caesar")].dialog.CurrentNode = "mapBB3";
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorDialog(characterFromID("Caesar"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Caesar"));
		break;

		case "Caesar_mapBB3_done":
			LAi_SetPlayerType(pchar);
			LAi_SetOfficerType(characterFromID("Caesar"));
			PlaySound("INTERFACE\paper.wav");
			GiveItem2Character(Pchar, "mapBB3");
			AddQuestRecord("Charles_Eden", "5");

			if(!CheckCharacterItem(Pchar,"map")) {GiveItem2Character(Pchar, "map");}
		SetCurrentTime(11.00, 0);

			LAi_QuestDelay("closer_look", 1.0);

			pchar.quest.U2.win_condition.l1 = "locator";
			pchar.quest.U2.win_condition.l1.location = "Grand_Cayman_town";
			pchar.quest.U2.win_condition.l1.locator_group = "goto";
			pchar.quest.U2.win_condition.l1.locator = "goto30";
			pchar.quest.U2.win_condition = "U2";
		break;
//pär Cayman
		case "U2":
			if(CheckCharacterItem(Pchar,"mapBB3T"))
			{
				//you can't have all 5 maps in Cayman town as when you get mapBB3T (Eden's) you also get Caesar for the first time. 
				//But not his map.
			}
			else
			{
				ChangeCharacterAddressGroup(Pchar, "Grand_Cayman_town", "quest", "goto30_back");

				LAi_SetActorType(pchar);	
				characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "U2";
				LAi_ActorSelfDialog(pchar, "");
				//turn around included
			}
		break;

		case "U2_loop":
			LAi_SetPlayerType(pchar);

			pchar.quest.U2.win_condition.l1 = "locator";
			pchar.quest.U2.win_condition.l1.location = "Grand_Cayman_town";
			pchar.quest.U2.win_condition.l1.locator_group = "goto";
			pchar.quest.U2.win_condition.l1.locator = "goto30";
			pchar.quest.U2.win_condition = "U2";
		break;
//----------------------------------------------------------------------------------------------------------
		case "which_island":
			if(GetAttribute(pchar, "Eden_map") == "on1" || GetAttribute(pchar, "Defoe_map") == "on1")
			{
				//means if pchar goes direct from mapBB3 or mapBB6 to archpel map this is not needed and skipped

				LAi_SetActorType(pchar);	
				characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "which_island";
				LAi_ActorSelfDialog(pchar, "");
			}
		break;
	
		case "I_know_which_island":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "I_know_which_island";
			LAi_ActorSelfDialog(pchar, "");
		break;
//----------------------------------------------------------------------------------------------------------
		case "delay_Caesars_map":
			LAi_QuestDelay("Caesars_map", 0.3);
		break;

		case "Caesars_map":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "Caesars_map";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Caesars_map1":
			characters[GetCharacterIndex("Caesar")].dialog.CurrentNode = "Caesars_map1";
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorDialog(characterFromID("Caesar"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Caesar"));
		break;

		case "Caesar_info_given":
			//you have been to Citadel or more
			LAi_SetPlayerType(pchar);
			characters[GetCharacterIndex("Caesar")].dialog.CurrentNode = "neutral";
			LAi_SetOfficerType(characterFromID("Caesar"));
			AddQuestRecord("Caesar", "12");
			Pchar.Caesar_info = "yes";	//enables blade_gp_dry to be picked up in GPS Turks_wreck_hold
		break;

		case "Caesar_info_given2":
			//you have only talked to Odel
			LAi_SetPlayerType(pchar);
			characters[GetCharacterIndex("Caesar")].dialog.CurrentNode = "neutral";
			LAi_SetOfficerType(characterFromID("Caesar"));
			AddQuestRecord("Caesar", "13");
			Pchar.Caesar_info = "yes";	//enables blade_gp_dry to be picked up in GPS Turks_wreck_hold
		break;
	//--------------------------------------------------------------------------------------------------------------



		


//Q2 Caesar: Ocracoke Island scene
//_________________________________________________________________________________________________________________

		case "Odel_dialog":
			SetNextWeather("Clear");
			LAi_SetActorType(characterFromID("Odel"));
			LAi_ActorDialog(characterFromID("Odel"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Odel"));
		break;

		case "Teach_sloop":
			SetCurrentTime(12, 0);

			if(IsOfficer(CharacterFromID("Caesar"))) 
			{
				Pchar.Caesar_officer = "yes";
				RemovePassenger(Pchar, characterFromID("Caesar"));
				if(IsOfficer(CharacterFromID("Pell"))) 
				{
					Pchar.Pell_officer = "yes";
					RemovePassenger(Pchar, characterFromID("Pell"));
				}
			}

			ChangeCharacterAddressGroup(characterFromID("Teach"), "BB_sloop", "quest", "teach");
			ChangeCharacterAddressGroup(characterFromID("Caesar"), "BB_sloop", "quest", "caesar");
			LAi_SetActorType(characterFromID("Teach"));
			LAi_SetActorType(characterFromID("Caesar"));
			SetModel(characterFromID("Teach"), "bb_Teach3", "man", "man", 1.8, false);
			SetModel(Pchar, "Ragetti", "man", "man", 1.8, false);
			DeleteAttribute(characterFromID("Teach"), "items");
			DeleteAttribute(characterFromID("Caesar"), "items");
			GiveItem2Character(characterFromID("Teach"), "bladeMap_Hgold");
			EquipCharacterByItem(characterFromID("Teach"), "bladeMap_Hgold");
			GiveItem2Character(characterFromID("Caesar"), "bladep202");
			EquipCharacterByItem(characterFromID("Caesar"), "bladep202");
			GiveItem2Character(characterFromID("Caesar"), "pistol202");
			EquipCharacterByItem(characterFromID("Caesar"), "pistol202");
			Pchar.old.name = "Samuel";
			Pchar.old.lastname = "Odel";
			Pchar.name = TranslateString("","Samuel");
			Pchar.lastname = TranslateString("","Odel");

		//bb_crew in here
			ChangeCharacterAddressGroup(characterFromID("bb_crew1"), "BB_sloop", "quest", "swivel");
			ChangeCharacterAddressGroup(characterFromID("bb_crew2"), "BB_sloop", "quest", "odel");
			ChangeCharacterAddressGroup(characterFromID("bb_crew3"), "BB_sloop", "quest", "gun1L");
			ChangeCharacterAddressGroup(characterFromID("bb_crew4"), "BB_sloop", "quest", "gun1R");
			ChangeCharacterAddressGroup(characterFromID("bb_crew5"), "BB_sloop", "quest", "gun1C");
			ChangeCharacterAddressGroup(characterFromID("bb_crew6"), "BB_sloop", "quest", "gun2L");
			ChangeCharacterAddressGroup(characterFromID("bb_crew7"), "BB_sloop", "quest", "gun2R");
			ChangeCharacterAddressGroup(characterFromID("bb_crew8"), "BB_sloop", "quest", "gun2C");
			ChangeCharacterAddressGroup(characterFromID("bb_crew9"), "BB_sloop", "quest", "gun3L");
			ChangeCharacterAddressGroup(characterFromID("bb_crew10"), "BB_sloop", "quest", "gun3R");
			ChangeCharacterAddressGroup(characterFromID("bb_crew11"), "BB_sloop", "quest", "gun3C");
			ChangeCharacterAddressGroup(characterFromID("bb_crew12"), "BB_sloop", "quest", "gun4L");
			ChangeCharacterAddressGroup(characterFromID("bb_crew13"), "BB_sloop", "quest", "gun4R");
			ChangeCharacterAddressGroup(characterFromID("bb_crew14"), "BB_sloop", "quest", "gun4C");
			ChangeCharacterAddressGroup(characterFromID("bb_crew15"), "BB_sloop", "quest", "border1");
			ChangeCharacterAddressGroup(characterFromID("bb_crew16"), "BB_sloop", "quest", "bsw");
			ChangeCharacterAddressGroup(characterFromID("bb_crew17"), "BB_sloop", "quest", "border3");
			ChangeCharacterAddressGroup(characterFromID("bb_crew18"), "BB_sloop", "quest", "border4");
			ChangeCharacterAddressGroup(characterFromID("bb_crew19"), "BB_sloop", "quest", "border5");
			ChangeCharacterAddressGroup(characterFromID("bb_crew20"), "BB_sloop", "quest", "border6");
			ChangeCharacterAddressGroup(characterFromID("bb_crew21"), "BB_sloop", "quest", "ratline");
			
			GiveItem2Character(Pchar, "blade4");
			EquipCharacterByItem(Pchar, "blade4");
			GiveItem2Character(Pchar, "piratespistol");
			EquipCharacterByItem(Pchar, "piratespistol");

			gp = GetCharacterItem(pchar, "gunpowder");
			pb = GetCharacterItem(pchar, "pistolbullets");
			if(gp ==0) 
			{
				TakeNItems(Pchar,"gunpowder", 1); 
				pchar.extra_gp = "true";
			}
			if(pb ==0) 
			{
				TakeNItems(Pchar,"pistolbullets", 1); 
				pchar.extra_pb = "true";
			}

			pchar.quest.Teach_sloop24.win_condition.l1 = "locator";
			pchar.quest.Teach_sloop24.win_condition.l1.location = "BB_sloop";
			pchar.quest.Teach_sloop24.win_condition.l1.locator_group = "reload";
			pchar.quest.Teach_sloop24.win_condition.l1.locator = "loc0";
			pchar.quest.Teach_sloop24.win_condition = "Teach_sloop24";
			
			SetNextWeather("Clear");
			DoQuestReloadToLocation("BB_sloop", "quest", "helm" ,"Teach_sloop1");	//was odel
		break;

		case "Teach_sloop1":
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("Teach_sloop2", 3.0);
		break;

		case "Teach_sloop2":
			PlaySound("OBJECTS\DUEL\man_attack5.wav");
			
			LAi_QuestDelay("Teach_sloop3", 1.0);
		break;

		case "Teach_sloop3":
			PlaySound("VOICE\ENGLISH\gr_Teach5.wav");

			LAi_QuestDelay("Teach_sloop4", 2.0);
		break;

		case "Teach_sloop4":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("bb_crew15"));

			LAi_QuestDelay("Teach_sloop5", 1.0);
		break;

		case "Teach_sloop5":
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorDialog(characterFromID("Teach"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Teach"));
			Characters[GetCharacterIndex("Teach")].dialog.CurrentNode  = "Caesar1";
		break;

		case "Teach_sloop6":
			PlaySound("OBJECTS\DUEL\man_hit1.wav");

			LAi_QuestDelay("Teach_sloop7", 2.0);
		break;

		case "Teach_sloop7":
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorDialog(characterFromID("Teach"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Teach"));
			Characters[GetCharacterIndex("Teach")].dialog.CurrentNode  = "Caesar2";
		break;

		case "Teach_sloop8":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead0.wav");

			LAi_QuestDelay("Teach_sloop9", 2.0);
		break;

		case "Teach_sloop9":
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorDialog(characterFromID("Teach"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Teach"));
			Characters[GetCharacterIndex("Teach")].dialog.CurrentNode  = "Caesar3";
		break;

		case "Teach_sloop10":
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], false);//temp only
			PlaySound("OBJECTS\DUEL\man_attack1.wav");
			LAi_SetPlayerType(CharacterFromID("Caesar"));
			LAi_SetFightMode(CharacterFromID("Caesar"), true);

			LAi_QuestDelay("Teach_sloop11", 1.5);
		break;

		case "Teach_sloop11":
			RemoveCharacterEquip(CharacterFromID("Caesar"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(CharacterFromID("Caesar"), "bladep202");
			GiveItem2Character(CharacterFromID("Caesar"), "bladeX4");
			EquipCharacterByItem(CharacterFromID("Caesar"), "bladeX4");

			PlaySound("OBJECTS\DUEL\reload1.wav");
			GiveItem2Character(CharacterFromID("Teach"), "pistol202");
			EquipCharacterByItem(CharacterFromID("Teach"), "pistol202");

			LAi_QuestDelay("Teach_sloop12", 0.5);
		break;

		case "Teach_sloop12":
			LAi_SetFightMode(CharacterFromID("Caesar"), false);
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], true);//reset

			LAi_QuestDelay("Teach_sloop13", 1.0);
		break;

		case "Teach_sloop13":
			PlaySound("VOICE\ENGLISH\gr_Teach3.wav");

			LAi_QuestDelay("Teach_sloop14", 2.5);
		break;

		case "Teach_sloop14":
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], false);//temp only
			LAi_SetPlayerType(CharacterFromID("Teach"));
			LAi_SetFightMode(CharacterFromID("Teach"), true);

			LAi_QuestDelay("Teach_sloop15", 1.5);
		break;

		case "Teach_sloop15":
			RemoveCharacterEquip(CharacterFromID("Teach"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(CharacterFromID("Teach"), "bladeMap_Hgold");
			GiveItem2Character(CharacterFromID("Teach"), "bladeX4");
			EquipCharacterByItem(CharacterFromID("Teach"), "bladeX4");

			PlaySound("PEOPLE\step_sand.wav");
			GiveItem2Character(CharacterFromID("Caesar"), "bladeMap_Hgold");
			EquipCharacterByItem(CharacterFromID("Caesar"), "bladeMap_Hgold");

			LAi_QuestDelay("Teach_sloop16", 0.5);
			LAi_QuestDelay("pchar_yah", 2.0);
		break;

		case "Teach_sloop16":
			LAi_SetFightMode(CharacterFromID("Teach"), false);
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], true);//reset

			LAi_QuestDelay("Teach_sloop17", 2.5);
		break;

		case "Teach_sloop17":
			PlaySound("VOICE\ENGLISH\gr_Teach1.wav");

			LAi_QuestDelay("Teach_sloop18", 3.0);
		break;

		case "Teach_sloop18":
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorDialog(characterFromID("Teach"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Teach"));
			Characters[GetCharacterIndex("Teach")].dialog.CurrentNode  = "Caesar4";	//mission
		break;
	
		case "Teach_sloop19":
			PlaySound("OBJECTS\DUEL\man_attack5.wav");
			characters[GetCharacterIndex("wr_mummy8")].sailaway = true;
			characters[GetCharacterIndex("wr_mummy9")].sailaway = true;

			LAi_QuestDelay("Teach_sloop20", 1.0);
		break;

		case "Teach_sloop20":
			PlaySound("PEOPLE\Jump_roof.wav");
			ChangeCharacterAddressGroup(characterFromID("Caesar"), "BB_sloop", "quest", "jump");

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("bb_crew10"));

			LAi_QuestDelay("Teach_sloop22", 0.5);
		break;
	
		case "Teach_sloop22":
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorGoToLocator(characterFromID("Caesar"), "reload", "loc0", "Teach_sloop25", 12.0);
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorTurnToCharacter(characterFromID("Teach"), characterFromID("bb_crew15"));

			LAi_QuestDelay("Teach_sloop23", 6.0);
		break;

		case "Teach_sloop23":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "stop_Caesar";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Teach_sloop24":
			LAi_SetStayType(Pchar);
			PlaySound("INTERFACE\knock.wav");

			LAi_QuestDelay("pchar_oh", 1.0);
			LAi_QuestDelay("Teach_sloop24_A", 3.0);
		break;
	
		case "Teach_sloop24_A":
			PlaySound("INTERFACE\_EvShip0.wav");

			LAi_QuestDelay("Teach_sloop26", 1.5);
		break;

		case "Teach_sloop25":
			PlaySound("PEOPLE\counter_openclose.wav");
			ChangeCharacterAddressGroup(characterFromID("Caesar"), "none", "", "");
		break;

		case "Teach_sloop26":
			SetCurrentTime(12.00, 0);
			SetNextWeather("Clear");
			SetNextWind("W",30);
			Locations[FindLocation("BB_sloop")].image = "";
			locations[FindLocation("BB_sloop")].type = "silent_seashore";

			DoQuestReloadToLocation("BB_sloop", "quest", "broadside" ,"Teach_sloop28");
		break;

		case "Teach_sloop28":
			PlaySound("OBJECTS\SHIPCHARGE\gunner_fire.wav");
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorTurnToLocator(characterFromID("Teach"), "ships_other", "ship_1");

			LAi_QuestDelay("Teach_sloop29", 2.0);
		break;

		case "Teach_sloop29":
			PlaySound("OBJECTS\SHIPCHARGE\LG18J.wav");

			CreateParticleSystem("smoke_short" , 3.9, 1.6, 4.2, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 4.2, 1.6, 4.2, 4.5, 1.5, 0.0, sti(20) );

			CreateParticleSystem("gunfire" , 3.9, 1.6, 4.2, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 4.2, 1.6, 4.2, 0.0, 4.5, 0.0, sti(20) );

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("bb_crew6"));

			LAi_QuestDelay("Teach_sloop30", 0.8);
			LAi_QuestDelay("Teach_sloop29_A", 3.0);
		break;
		
		case "Teach_sloop29_A":
			CreateParticleSystem("gunfire" , 3.9, 1.6, 4.2, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 4.2, 1.6, 4.2, 0.0, 4.5, 0.0, sti(20) );
		break;

		case "Teach_sloop30":
			PlaySound("OBJECTS\SHIPCHARGE\LG18J.wav");
			
			CreateParticleSystem("smoke_short" , 4.1, 1.5, 0.9, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 4.4, 1.5, 0.9, 4.5, 1.5, 0.0, sti(20) );

			CreateParticleSystem("gunfire" , 4.1, 1.5, 0.9, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 4.4, 1.5, 0.9, 0.0, 4.5, 0.0, sti(20) );
			
			LAi_QuestDelay("Teach_sloop31", 0.6);
			LAi_QuestDelay("Teach_sloop30_A", 3.0);
		break;

		case "Teach_sloop30_A":
			CreateParticleSystem("gunfire" , 4.1, 1.5, 0.9, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 4.4, 1.5, 0.9, 0.0, 4.5, 0.0, sti(20) );
		break;

		case "Teach_sloop31":
			PlaySound("OBJECTS\SHIPCHARGE\LG18J.wav");

			CreateParticleSystem("smoke_short" , 3.9, 1.7, -2.2, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 4.2, 1.7, -2.2, 4.5, 1.5, 0.0, sti(20) );

			CreateParticleSystem("gunfire" , 3.9, 1.7, -2.2, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 4.2, 1.7, -2.2, 0.0, 4.5, 0.0, sti(20) );

			LAi_QuestDelay("Teach_sloop32", 0.4);
			LAi_QuestDelay("Teach_sloop31_A", 3.0);
		break;

		case "Teach_sloop31_A":
			CreateParticleSystem("gunfire" , 3.9, 1.7, -2.2, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 4.2, 1.7, -2.2, 0.0, 4.5, 0.0, sti(20) );
		break;

		case "Teach_sloop32":
			PlaySound("OBJECTS\SHIPCHARGE\LG18J.wav");

			CreateParticleSystem("smoke_short" , 3.8, 1.9, -5.1, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 4.1, 1.9, -5.1, 4.5, 1.5, 0.0, sti(20) );

			CreateParticleSystem("gunfire" , 3.8, 1.9, -5.1, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 4.1, 1.9, -5.1, 0.0, 4.5, 0.0, sti(20) );
			
			LAi_QuestDelay("Teach_sloop33", 0.4);
			LAi_QuestDelay("Teach_sloop32_A", 3.0);
		break;

		case "Teach_sloop32_A":
			CreateParticleSystem("gunfire" , 3.8, 1.9, -5.1, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 4.1, 1.9, -5.1, 0.0, 4.5, 0.0, sti(20) );
		break;
	
		case "Teach_sloop33":
			PlaySound("OBJECTS\SHIPCHARGE\CR12C.wav");

			CreateParticleSystem("smoke_short" , 2.9, 4.0, -8.0, 4.5, 1.5, 0.0, sti(20) );

			CreateParticleSystem("gunfire_red" , 3.1, 4.0, -8.0, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire_red" , 2.9, 4.0, -8.0, 0.0, 4.5, 0.0, sti(20) );

			CreateParticleSystem("gunfire" , 2.9, 4.0, -8.0, 0.0, 4.5, 0.0, sti(20) );
			
			LAi_QuestDelay("Teach_sloop34", 2.0);
			LAi_QuestDelay("Teach_sloop33_A", 3.0);
		break;

		case "Teach_sloop33_A":
			CreateParticleSystem("gunfire" , 2.9, 4.0, -8.0, 0.0, 4.5, 0.0, sti(20) );
		break;

		case "Teach_sloop34":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "ships_other", "ship_1");

			
			PlaySound("INTERFACE\_GTBoard3.wav");			//slaughter
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "ships_other", "ship_1");

			LAi_QuestDelay("Teach_sloop37", 2.5);
			
		break;

		case "Teach_sloop37":
			PlaySound("OBJECTS\SHIPCHARGE\hurrah.wav");
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], false);
			LAi_SetPlayerType(characterFromID("bb_crew1"));
			LAi_SetPlayerType(characterFromID("bb_crew2"));
			LAi_SetPlayerType(characterFromID("bb_crew3"));
			LAi_SetPlayerType(characterFromID("bb_crew4"));
			LAi_SetPlayerType(characterFromID("bb_crew5"));
			LAi_SetPlayerType(characterFromID("bb_crew6"));
			LAi_SetPlayerType(characterFromID("bb_crew7"));
			LAi_SetPlayerType(characterFromID("bb_crew8"));
			LAi_SetPlayerType(characterFromID("bb_crew9"));
			LAi_SetPlayerType(characterFromID("bb_crew10"));
			LAi_SetPlayerType(characterFromID("bb_crew11"));
			LAi_SetPlayerType(characterFromID("bb_crew12"));
			LAi_SetPlayerType(characterFromID("bb_crew13"));
			LAi_SetPlayerType(characterFromID("bb_crew14"));
			LAi_SetPlayerType(characterFromID("bb_crew15"));
			LAi_SetPlayerType(characterFromID("bb_crew16"));
			LAi_SetPlayerType(characterFromID("bb_crew17"));
			LAi_SetPlayerType(characterFromID("bb_crew18"));
			LAi_SetPlayerType(characterFromID("bb_crew19"));
			LAi_SetPlayerType(characterFromID("bb_crew20"));
			LAi_SetPlayerType(characterFromID("Teach"));
			LAi_SetFightMode(CharacterFromID("bb_crew1"), true);
			LAi_SetFightMode(CharacterFromID("bb_crew2"), true);
			LAi_SetFightMode(CharacterFromID("bb_crew3"), true);
			LAi_SetFightMode(CharacterFromID("bb_crew4"), true);
			LAi_SetFightMode(CharacterFromID("bb_crew5"), true);
			LAi_SetFightMode(CharacterFromID("bb_crew6"), true);
			LAi_SetFightMode(CharacterFromID("bb_crew7"), true);
			LAi_SetFightMode(CharacterFromID("bb_crew8"), true);
			LAi_SetFightMode(CharacterFromID("bb_crew9"), true);
			LAi_SetFightMode(CharacterFromID("bb_crew10"), true);
			LAi_SetFightMode(CharacterFromID("bb_crew11"), true);
			LAi_SetFightMode(CharacterFromID("bb_crew12"), true);
			LAi_SetFightMode(CharacterFromID("bb_crew13"), true);
			LAi_SetFightMode(CharacterFromID("bb_crew14"), true);
			LAi_SetFightMode(CharacterFromID("bb_crew15"), true);
			LAi_SetFightMode(CharacterFromID("bb_crew16"), true);
			LAi_SetFightMode(CharacterFromID("bb_crew17"), true);
			LAi_SetFightMode(CharacterFromID("bb_crew18"), true);
			LAi_SetFightMode(CharacterFromID("bb_crew19"), true);
			LAi_SetFightMode(CharacterFromID("bb_crew20"), true);
			LAi_SetFightMode(CharacterFromID("Teach"), true);

			LAi_QuestDelay("Teach_sloop38", 2.0);
		break;

		case "Teach_sloop38":
			//end scene here - teleport back to smugglers tavern
			DoQuestReloadToLocation("smugglers_tavern", "goto", "drunk" ,"Odel_dialog_end");
		break;

		case "Odel_dialog_end":
			SetModel(Pchar, "Howard_Pyle", "man", "man", 1.8, false);
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "piratespistol");
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "blade4");

			EquipCharacterByItem(Pchar, FindCharacterItemByGroup(Pchar, BLADE_ITEM_TYPE));
			EquipCharacterByItem(Pchar, FindCharacterItemByGroup(Pchar, GUN_ITEM_TYPE));

			if(CheckAttribute(Pchar, "extra_gp") && Pchar.extra_gp == "true")
			{
				TakeNItems(Pchar,"gunpowder", -1); 
			}
			if(CheckAttribute(Pchar, "extra_pb") && Pchar.extra_pb == "true")
			{
				TakeNItems(Pchar,"pistolbullets", -1); 
			}

			if(CheckAttribute(Pchar,"Caesar_officer") && Pchar.Caesar_officer == "yes")
			{
				AddPassenger(Pchar, characterFromID("Caesar"), 0);
				SetOfficersIndex(Pchar, 2, getCharacterIndex("Caesar"));
				LAi_SetOfficerType(characterFromID("Caesar"));

				if(CheckAttribute(Pchar,"Pell_officer") && Pchar.Pell_officer == "yes")
				{
					AddPassenger(Pchar, characterFromID("Pell"), 0);
					SetOfficersIndex(Pchar, 3, getCharacterIndex("Pell"));
					LAi_SetOfficerType(characterFromID("Pell"));
				}
			}

			Pchar.old.name = "Howard";
			Pchar.old.lastname = "Pyle";
			Pchar.name = TranslateString("","Howard");
			Pchar.lastname = TranslateString("","Pyle");

			LAi_SetActorType(characterFromID("Odel"));
			LAi_ActorDialog(characterFromID("Odel"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Odel"));
			Characters[GetCharacterIndex("Odel")].dialog.CurrentNode  = "end";
		break;

		case "Odel_dialog_end_done":
			Pchar.Odel_dialog = "done";
			LAi_SetStayType(characterFromID("Odel"));
			Characters[GetCharacterIndex("Odel")].dialog.CurrentNode  = "neutral";
			AddQuestRecord("Caesar", "4");
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("Citadel_rock_start", 0.1);
		break;


//Q2 Caesar: Citadel Rock
//_________________________________________________________________________________________________________________

		case "Citadel_rock_start":
			Locations[FindLocation("Eleuthera_shore")].models.always.locators = "Pass1_l_Eleuthera_F";	//neutral start WR quest
			Locations[FindLocation("Eleuthera_shore")].models.always.l1 = "";
			Locations[FindLocation("Eleuthera_shore")].models.always.l2 = "";
			Locations[FindLocation("Eleuthera_shore")].models.always.l3 = "";
			SetCharacterShipLocation(characterFromID("wr_mummy5"), "Eleuthera_shore");	//test for Citadel Rock
			Locations[FindLocation("Eleuthera_tavern_upstairs")].vcskip = true;	//enough with bad guys on Eleuthera_shore
			Locations[FindLocation("Eleuthera_shore")].vcskip = true;		//these are replaced with quest bad guys
			ChangeCharacterAddressGroup(characterFromID("Maynard"), "Eleuthera_shore", "quest", "quest6");
			Pchar.citadel_lever = "missing";
			Pchar.citadel_lever_first_time = "yes";
			GiveItem2Character(characterFromID("Citadel_thug5"), "bladelever");
			Locations[FindLocation("Eleuthera_shore")].locators_radius.monsters.monster1 = 3.0;
			Locations[FindLocation("Eleuthera_shore")].locators_radius.monsters.monster2 = 3.0;
			Locations[FindLocation("Eleuthera_shore")].locators_radius.monsters.monster3 = 3.0;
			Locations[FindLocation("Eleuthera_shore")].locators_radius.monsters.monster4 = 3.0;
			Locations[FindLocation("Eleuthera_shore")].reload.l3.disable = 1;	//locked back to tavern tunnel - ev officers left behind

			pchar.quest.Citadel_daytime.win_condition.l1 = "locator";
			pchar.quest.Citadel_daytime.win_condition.l1.location = "Eleuthera_tavern_upstairs";
			pchar.quest.Citadel_daytime.win_condition.l1.locator_group = "reload";
			pchar.quest.Citadel_daytime.win_condition.l1.locator = "reload3_back";
			pchar.quest.Citadel_daytime.win_condition = "Citadel_daytime";

			pchar.quest.Eleuthera_shore_locked.win_condition.l1 = "location";
			pchar.quest.Eleuthera_shore_locked.win_condition.l1.location = "Eleuthera_shore";
			pchar.quest.Eleuthera_shore_locked.win_condition = "Eleuthera_shore_locked";

			pchar.quest.maynard_start.win_condition.l1 = "locator";
			pchar.quest.maynard_start.win_condition.l1.location = "Eleuthera_shore";
			pchar.quest.maynard_start.win_condition.l1.locator_group = "quest";
			pchar.quest.maynard_start.win_condition.l1.locator = "quest11";
			pchar.quest.maynard_start.win_condition = "maynard_start";

			pchar.quest.Citadel_thug1.win_condition.l1 = "locator";
			pchar.quest.Citadel_thug1.win_condition.l1.location = "Eleuthera_shore";
			pchar.quest.Citadel_thug1.win_condition.l1.locator_group = "monsters";
			pchar.quest.Citadel_thug1.win_condition.l1.locator = "monster1";
			pchar.quest.Citadel_thug1.win_condition = "Citadel_thug1";

			pchar.quest.Citadel_thug2.win_condition.l1 = "locator";
			pchar.quest.Citadel_thug2.win_condition.l1.location = "Eleuthera_shore";
			pchar.quest.Citadel_thug2.win_condition.l1.locator_group = "monsters";
			pchar.quest.Citadel_thug2.win_condition.l1.locator = "monster2";
			pchar.quest.Citadel_thug2.win_condition = "Citadel_thug2";

			pchar.quest.Citadel_thug3.win_condition.l1 = "locator";
			pchar.quest.Citadel_thug3.win_condition.l1.location = "Eleuthera_shore";
			pchar.quest.Citadel_thug3.win_condition.l1.locator_group = "monsters";
			pchar.quest.Citadel_thug3.win_condition.l1.locator = "monster3";
			pchar.quest.Citadel_thug3.win_condition = "Citadel_thug3";

			pchar.quest.Citadel_thug4.win_condition.l1 = "locator";
			pchar.quest.Citadel_thug4.win_condition.l1.location = "Eleuthera_shore";
			pchar.quest.Citadel_thug4.win_condition.l1.locator_group = "monsters";
			pchar.quest.Citadel_thug4.win_condition.l1.locator = "monster4";
			pchar.quest.Citadel_thug4.win_condition = "Citadel_thug4";

			pchar.quest.Citadel_thug5_16.win_condition.l1 = "locator";
			pchar.quest.Citadel_thug5_16.win_condition.l1.location = "Eleuthera_shore";
			pchar.quest.Citadel_thug5_16.win_condition.l1.locator_group = "goto";
			pchar.quest.Citadel_thug5_16.win_condition.l1.locator = "goto16";
			pchar.quest.Citadel_thug5_16.win_condition = "Citadel_thug5";

			pchar.quest.Citadel_thug5_17.win_condition.l1 = "locator";
			pchar.quest.Citadel_thug5_17.win_condition.l1.location = "Eleuthera_shore";
			pchar.quest.Citadel_thug5_17.win_condition.l1.locator_group = "goto";
			pchar.quest.Citadel_thug5_17.win_condition.l1.locator = "goto17";
			pchar.quest.Citadel_thug5_17.win_condition = "Citadel_thug5";
		break;

		case "Citadel_daytime":
			SetCurrentTime(11.00, 0);
			SetNextWeather("Clear");
		break;

		case "Eleuthera_shore_locked":
			PlaySound("INTERFACE\girder_close.wav");

			LAi_QuestDelay("pchar_huh", 2.0);	
		break;

		case "maynard_start":
			LAi_SetActorType(characterFromID("Maynard"));
			LAi_ActorDialog(characterFromID("Maynard"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Maynard"));
			Characters[GetCharacterIndex("Maynard")].dialog.CurrentNode  = "start";
		break;

		case "maynard_start_done":
			AddQuestRecord("Caesar","14");
		break;

		case "Citadel_thug1":
			LAi_SetActorType(characterFromID("Citadel_thug1"));
			LAi_ActorAttack(CharacterFromID("Citadel_thug1"), Pchar, "");
		break;

		case "Citadel_thug2":
			LAi_SetActorType(characterFromID("Citadel_thug2"));
			LAi_ActorAttack(CharacterFromID("Citadel_thug2"), Pchar, "");
		break;

		case "Citadel_thug3":
			LAi_SetActorType(characterFromID("Citadel_thug3"));
			LAi_ActorAttack(CharacterFromID("Citadel_thug3"), Pchar, "");
		break;

		case "Citadel_thug4":
			LAi_SetActorType(characterFromID("Citadel_thug4"));
			LAi_ActorAttack(CharacterFromID("Citadel_thug4"), Pchar, "");
		break;

		case "Citadel_thug5":
			LAi_SetActorType(characterFromID("Citadel_thug5"));
			LAi_ActorAttack(CharacterFromID("Citadel_thug5"), Pchar, "");

			SetLocatorRadius(locations[FindLocation(Pchar.location)], "goto", "goto16", 0.001);
			Locations[FindLocation("Eleuthera_shore")].locators_radius.goto.goto16 = 0.001;
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "goto", "goto17", 0.001);
			Locations[FindLocation("Eleuthera_shore")].locators_radius.goto.goto17 = 0.001;

			LAi_QuestDelay("Citadel_bladelever_check", 0.5);
		break;

		case "Citadel_bladelever_check":
			if(CheckCharacterItem(Pchar,"bladelever"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladelever");

				pchar.quest.maynard_bridge.win_condition.l1 = "locator";
				pchar.quest.maynard_bridge.win_condition.l1.location = "Eleuthera_shore";
				pchar.quest.maynard_bridge.win_condition.l1.locator_group = "quest";
				pchar.quest.maynard_bridge.win_condition.l1.locator = "quest11";
				pchar.quest.maynard_bridge.win_condition = "maynard_bridge";
			}
			else
			{
				LAi_QuestDelay("Citadel_bladelever_check", 0.5);//loop check
			}
		break;

		case "maynard_bridge":
			LAi_SetActorType(characterFromID("Maynard"));
			LAi_ActorDialog(characterFromID("Maynard"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Maynard"));
			Characters[GetCharacterIndex("Maynard")].dialog.CurrentNode  = "bridge";
		break;
	
		case "maynard_bridge_done":
			AddQuestRecord("Caesar","15");
		break;	

		case "Citadel_to_box2":
			PlaySound("PEOPLE\recoil.wav");		
			ChangeCharacterAddressGroup(Pchar, "Eleuthera_shore", "box", "box2");

			LAi_QuestDelay("pchar_playertype", 0.25);
		break;

		case "Citadel_to_box1":
			PlaySound("PEOPLE\recoil.wav");		
			ChangeCharacterAddressGroup(Pchar, "Eleuthera_shore", "box", "box1");

			LAi_QuestDelay("pchar_playertype", 0.25);
		break;

		case "Citadel_to_quest5":
			PlaySound("PEOPLE\recoil.wav");		
			ChangeCharacterAddressGroup(Pchar, "Eleuthera_shore", "quest", "quest5");

			LAi_QuestDelay("Citadel_to_box29", 0.5);	
		break;

		case "Citadel_to_box29":
			PlaySound("PEOPLE\recoil.wav");		
			ChangeCharacterAddressGroup(Pchar, "Eleuthera_shore", "box", "box29");
		break;

		case "Citadel_to_reload6":
			LAi_SetPlayerType(Pchar);
			PlaySound("PEOPLE\recoil.wav");		
			ChangeCharacterAddressGroup(Pchar, "Eleuthera_shore", "reload", "reload6");			
		break;

		case "Citadel_to_box38":
			LAi_SetPlayerType(Pchar);
			PlaySound("PEOPLE\recoil.wav");		
			ChangeCharacterAddressGroup(Pchar, "Eleuthera_shore", "box", "box38");
		break;

		case "Citadel_to_box32":
			PlaySound("PEOPLE\recoil.wav");		
			ChangeCharacterAddressGroup(Pchar, "Eleuthera_shore", "box", "box32");
		break;

		case "Citadel_to_quest9":
			PlaySound("PEOPLE\recoil.wav");		
			ChangeCharacterAddressGroup(Pchar, "Eleuthera_shore", "quest", "quest9");

			LAi_QuestDelay("Citadel_to_box35", 0.5);	
		break;

		case "Citadel_to_box35":			
			PlaySound("PEOPLE\recoil.wav");		
			ChangeCharacterAddressGroup(Pchar, "Eleuthera_shore", "box", "box35");
		break;

		case "Citadel_to_box26":
			LAi_SetPlayerType(Pchar);
			PlaySound("PEOPLE\jump_roof.wav");		
			ChangeCharacterAddressGroup(Pchar, "Eleuthera_shore", "box", "box26");
		break;

		case "Citadel_to_box17":
			PlaySound("PEOPLE\creak2.wav");	
			ChangeCharacterAddressGroup(Pchar, "Eleuthera_shore", "box", "box17");
		break;

		case "Citadel_to_box21":			
			PlaySound("PEOPLE\run_stone.wav");	
			ChangeCharacterAddressGroup(Pchar, "Eleuthera_shore", "box", "box21");
		break;

		case "Citadel_turn_box5":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box5");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "Citadel_turn_box6":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box6");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;
		
		case "Citadel_turn_box10":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box10");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "Citadel_turn_box4":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box4");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "Citadel_turn_box3":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box3");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "Citadel_turn_box2":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box2");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "Citadel_place_lever":
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			if(!CheckCharacterItem(Pchar,"bladeX4")) GiveItem2Character(Pchar, "bladeX4");
			EquipCharacterByItem(Pchar, "bladeX4");
			TakeItemFromCharacter(pchar, "bladelever");

			PlaySound("INTERFACE\lever_placed.wav");
			Pchar.citadel_lever = "up";
			Locations[FindLocation("Eleuthera_shore")].models.always.l5 = "leverC_up";
			
			LAi_QuestDelay("Citadel_place_lever1", 0.5);
		break;

		case "Citadel_place_lever1":
			Locations[FindLocation("Eleuthera_shore")].image = "";
			DoQuestReloadToLocation("Eleuthera_shore", "box", "box16", "Citadel_place_lever2");
		break;

		case "Citadel_place_lever2":
			LAi_SetFightMode(Pchar, false);
			Locations[FindLocation("Eleuthera_shore")].image = "Outside_Passage1.tga";
		break;

		//....................................................................................

		case "Citadel_lever":
			Locations[FindLocation("Eleuthera_shore")].image = "";
			DoQuestReloadToLocation("Eleuthera_shore", "box", "box16", "Citadel_lever1");
		break;

		case "Citadel_lever1":
			LAi_SetFightMode(Pchar, false);
			Locations[FindLocation("Eleuthera_shore")].image = "Outside_Passage1.tga";

			if(CheckAttribute(Pchar, "citadel_bridge_sounds") && Pchar.citadel_bridge_sounds == "on")
			{
				PlaySound("INTERFACE\shelf_cogs.wav");
				PlaySound("INTERFACE\carpet_move.wav");

				LAi_QuestDelay("Citadel_door_sound_open", 1.0);
			}
			else LAi_QuestDelay("Citadel_door_sound_open", 0.001);
		break;

		case "Citadel_door_sound_open":
			PlaySound("INTERFACE\metal_hatch_open.wav");

			if(CheckAttribute(Pchar, "citadel_success") && Pchar.citadel_success == "yes")
			{
				Pchar.citadel_success = "no";
				LAi_QuestDelay("pchar_yah",1.0);
			}
		break;

		case "fall_Citadel_cave":
			LAi_SetSitType(Pchar);
			PlaySound("OBJECTS\VOICES\DEAD\male\dead6.wav");

			LAi_QuestDelay("fall_Citadel_cave1",1.0);
		break;

		case "fall_Citadel_cave1":
			Php = LAi_GetCharacterHP(Pchar);
			Php3 = Php/3;
			LAi_ApplyCharacterDamage(Pchar, Php3);
			PlaySound("PEOPLE\jump.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorSetLayMode(Pchar);

			LAi_QuestDelay("fall_Citadel_cave2",2);
		break;

		case "fall_Citadel_cave2":
			LAi_SetPoorType(Pchar);
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("stars_short" , u, v+1, w, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("OBJECTS\VOICES\DEAD\male\dead4.wav");

			LAi_QuestDelay("pchar_playertype",3);
		break;

		case "bladespade_check":
			if(CheckCharacterItem(Pchar,"bladespade"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladespade");
			}
			else
			{
				LAi_QuestDelay("bladespade_check", 0.5);//loop check
			}
		break;

		case "dig_sand":
			PlaySound("PEOPLE\dig_sand.wav");
		break;

		case "dig_anchor_Citadel":
			CreateParticleSystemX("blast_dirt", -5.6, 1.4, -72.7, -5.6, 1.4, -72.7, 10);
		break;

		case "dig_up_anchor_Citadel":
			Locations[FindLocation("Eleuthera_shore")].models.always.l6 = "anchor_big2";
			Locations[FindLocation("Eleuthera_shore")].image = "";
			DoQuestReloadToLocation("Eleuthera_shore", "goto", "anchor_shore", "dig_up_anchor_Citadel1");
		break;

		case "dig_up_anchor_Citadel1":
			LAi_SetFightMode(Pchar, false);
			Locations[FindLocation("Eleuthera_shore")].image = "Outside_Passage1.tga";
		break;

		case "dig_up_anchor_Citadel2":
			Locations[FindLocation("Eleuthera_shore")].models.always.l6 = "";
			Locations[FindLocation("Eleuthera_shore")].image = "";
			DoQuestReloadToLocation("Eleuthera_shore", "goto", "anchor_shore", "dig_up_anchor_Citadel3");
		break;

		case "dig_up_anchor_Citadel3":
			LAi_SetPlayerType(Pchar);
			GiveItem2Character(Pchar, "bladeanchor_big");
			EquipCharacterByItem(Pchar, "bladeanchor_big");
			TakeItemFromCharacter(pchar, "bladespade");
			Locations[FindLocation("Eleuthera_shore")].image = "Outside_Passage1.tga";

			LAi_QuestDelay("pchar_yah", 1.0);

			pchar.quest.maynard_anchor.win_condition.l1 = "locator";
			pchar.quest.maynard_anchor.win_condition.l1.location = "Eleuthera_shore";
			pchar.quest.maynard_anchor.win_condition.l1.locator_group = "quest";
			pchar.quest.maynard_anchor.win_condition.l1.locator = "quest11";
			pchar.quest.maynard_anchor.win_condition = "maynard_anchor";
		break;

		case "maynard_anchor":
			LAi_SetActorType(characterFromID("Maynard"));
			LAi_ActorDialog(characterFromID("Maynard"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Maynard"));
			Characters[GetCharacterIndex("Maynard")].dialog.CurrentNode  = "anchor";
		break;
	
		case "Citadel_place_anchor":
			Locations[FindLocation("Eleuthera_shore")].image = "";
			DoQuestReloadToLocation("Eleuthera_shore", "box", "box39", "Citadel_place_anchor1");
		break;

		case "Citadel_place_anchor1":
			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("Eleuthera_shore")].image = "Outside_Passage1.tga";

			if(CheckAttribute(Pchar, "citadel_extra_bridge_sound") && Pchar.citadel_extra_bridge_sound == "on")
			{
				PlaySound("INTERFACE\shelf_cogs.wav");
				PlaySound("INTERFACE\carpet_move.wav");
				Pchar.citadel_bridge_sound = "off";
			}
		break;

		case "maynard_tower":
			AddQuestRecord("Caesar","16");

			pchar.quest.maynard_tower_dialog.win_condition.l1 = "locator";
			pchar.quest.maynard_tower_dialog.win_condition.l1.location = "Eleuthera_shore";
			pchar.quest.maynard_tower_dialog.win_condition.l1.locator_group = "goto";
			pchar.quest.maynard_tower_dialog.win_condition.l1.locator = "quest3";
			pchar.quest.maynard_tower_dialog.win_condition = "maynard_tower_dialog";	
		break;

		case "maynard_tower_dialog":
			LAi_SetActorType(characterFromID("Maynard"));
			LAi_ActorDialog(characterFromID("Maynard"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Maynard"));
			Characters[GetCharacterIndex("Maynard")].dialog.CurrentNode  = "tower";
		break;

		case "maynard_tower_done":
			if(!CheckAttribute(Pchar,"Caesar_qbook5") || Pchar.Caesar_qbook5 != "done")
			{
				AddQuestRecord("Caesar","5");
				Pchar.Caesar_qbook5 = "done";
				ChangeCharacterAddressGroup(characterFromID("shipwreck_trader"), "Turks_Fort_Office", "sit", "sit1");
				Locations[FindLocation("Turks_Fort_Office")].locators_radius.sit.sit1 = 2.5;
			}

			Locations[FindLocation("Citadel_tower_bedroom")].locators_radius.box.box1 = 0.7;
			Locations[FindLocation("Citadel_tower_bedroom")].locators_radius.box.box2 = 0.7;
			Locations[FindLocation("Citadel_tower_bedroom")].locators_radius.box.box3 = 1.0;
			Locations[FindLocation("Citadel_tower_bedroom")].locators_radius.box.box4 = 1.0;
			Locations[FindLocation("Citadel_tower_bedroom")].locators_radius.box.box5 = 1.0;

			DoQuestReloadToLocation("Citadel_tower_bedroom", "reload", "reload2", "maynard_tower_done1");
		break;

		case "maynard_tower_done1":
			pchar.quest.maynard_repeat.win_condition.l1 = "locator";
			pchar.quest.maynard_repeat.win_condition.l1.location = "Eleuthera_shore";
			pchar.quest.maynard_repeat.win_condition.l1.locator_group = "goto";
			pchar.quest.maynard_repeat.win_condition.l1.locator = "quest3";
			pchar.quest.maynard_repeat.win_condition = "maynard_repeat";
		break;
	
		case "maynard_repeat":
			LAi_SetActorType(characterFromID("Maynard"));
			LAi_ActorDialog(characterFromID("Maynard"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Maynard"));
			Characters[GetCharacterIndex("Maynard")].dialog.CurrentNode  = "repeat";
		break;

		case "key30_check":
			if(CheckAttribute(Pchar,"key30") && Pchar.key30 == "done") return;

			if(CheckCharacterItem(Pchar,"key30"))
			{
				Pchar.key30 = "done";
				Locations[FindLocation("Eleuthera_shore")].locators_radius.reload.reload1_back = 0.0001;				
				Locations[FindLocation("Eleuthera_shore")].locators_radius.box.box40 = 0.8;	
			}
			else
			{
				LAi_QuestDelay("key30_check", 0.5);//loop check
			}
		break;

		case "unlock_citadel_tunnel":
			Locations[FindLocation("Eleuthera_shore")].locators_radius.reload.reload1_back = 1.5;				
			Locations[FindLocation("Eleuthera_shore")].locators_radius.box.box40 = 0.0001;
			TakeItemFromCharacter(Pchar, "key30");
			Locations[FindLocation("Eleuthera_shore")].reload.l3.disable = 0;
			DoQuestReloadToLocation("Eleuthera_tavern_upstairs", "reload", "reload3", "_");
		break;

//_________________________________________________________________________________________________________________
//Q2 Caesar: Turks

		case "Turks_armory":
			pchar.quest.Turks_shipwreck_trader.win_condition.l1 = "locator";
			pchar.quest.Turks_shipwreck_trader.win_condition.l1.location = "Turks_Fort_Office";
			pchar.quest.Turks_shipwreck_trader.win_condition.l1.locator_group = "sit";
			pchar.quest.Turks_shipwreck_trader.win_condition.l1.locator = "sit1";
			pchar.quest.Turks_shipwreck_trader.win_condition = "Turks_shipwreck_trader";
		break;

		case "Turks_shipwreck_trader":
			LAi_SetActorType(characterFromID("shipwreck_trader"));
			LAi_ActorDialog(characterFromID("shipwreck_trader"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("shipwreck_trader"));
		break;

		case "Turks_mistress":
			AddQuestRecord("Caesar", "7");
			AddQuestRecord("Caesar", "11");
			Locations[FindLocation("Turks_tavern_kitchen")].reload.l5.disable = 0;	//unlocked to bedroom
			LAi_SetSitType(characterFromID("shipwreck_trader"));
			ChangeCharacterAddressGroup(characterFromID("Mistress"), "Turks_Jungle_03", "goto", "barrels");
			LAi_SetActorType(characterFromID("Mistress"));
			LAi_SetImmortal(characterFromID("Mistress"), true);

			GiveItem2Character(characterFromID("Mistress"), "blade5");
			EquipCharacterByItem(characterFromID("Mistress"), "blade5");
			GiveItem2Character(characterFromID("Mistress"), "pistolbbuss");
			EquipCharacterByItem(characterFromID("Mistress"), "pistolbbuss");
			TakeNItems(characterFromID("Mistress"),"gunpowder", 2); 
			TakeNItems(characterFromID("Mistress"),"pistolgrapes", 2); 

			Locations[FindLocation("Turks_Jungle_03")].locators_radius.goto.barrels = 6.0;
			LAi_LocationFantomsGen(&locations[FindLocation("Turks_Jungle_03")], false);
			LAi_LocationMonstersGen(&locations[FindLocation("Turks_Jungle_03")], false);
			Locations[FindLocation("Turks_Jungle_03")].vcskip = true; // PB
			Locations[FindLocation("Turks_Jungle_03")].monsters = 0; // KK

			pchar.quest.Turks_mistress_attack.win_condition.l1 = "locator";
			pchar.quest.Turks_mistress_attack.win_condition.l1.location = "Turks_Jungle_03";
			pchar.quest.Turks_mistress_attack.win_condition.l1.locator_group = "goto";
			pchar.quest.Turks_mistress_attack.win_condition.l1.locator = "barrels";
			pchar.quest.Turks_mistress_attack.win_condition = "Turks_mistress_attack";
		break;

		case "Turks_mistress_attack":
			LAi_SetStayType(Pchar);
			PauseAllSounds();//stops music
			Locations[FindLocation("Turks_Jungle_03")].type = "silent_jungle";
			
			LAi_ActorTurnToCharacter(characterFromID("Mistress"), Pchar);
			PlaySound("VOICE\ENGLISH\gr_mistress2.wav");

			LAi_QuestDelay("Turks_mistress_attack1", 1.0);		//was 3

			pchar.quest.Turks_gate_locked.win_condition.l1 = "locator";
			pchar.quest.Turks_gate_locked.win_condition.l1.location = "Turks_Jungle_03";
			pchar.quest.Turks_gate_locked.win_condition.l1.locator_group = "reload";
			pchar.quest.Turks_gate_locked.win_condition.l1.locator = "reload2_back";
			pchar.quest.Turks_gate_locked.win_condition = "Turks_gate_locked";
		break;

		case "Turks_mistress_attack1":
			LAi_ActorAttack(CharacterFromID("Mistress"), Pchar, "");

			LAi_QuestDelay("pchar_playertype", 5.0);
			LAi_QuestDelay("Turks_mistress_attack2", 3.0);
			LAi_QuestDelay("pchar_aah", 3.0);
		break;

		case "Turks_mistress_attack2":
			LAi_SetFightMode(characterFromID("Mistress"), false);
			LAi_SetActorType(characterFromID("Mistress"));

			LAi_QuestDelay("Turks_mistress_attack3", 1.0);
		break;
	
		case "Turks_mistress_attack3":
			Locations[FindLocation("Turks_Jungle_03")].reload.l4.disable = 1;		//locked to port
			PlaySound("INTERFACE\shelf_close.wav");
			ChangeCharacterAddressGroup(characterFromID("Mistress"), "none", "", "");
		break;
	
		case "Turks_mistress_attack4":
			PlaySound("VOICE\ENGLISH\gr_mistress.wav");
		break;
	
		case "Turks_gate_locked":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "gate_locked";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Turks_gate_locked1":
			LAi_SetPlayerType(pchar);
			AddQuestRecord("Caesar", "6");
			ChangeCharacterAddressGroup(characterFromID("shipwreck_trader"), "Turks_old_Fort", "goto", "goto13");
			LAi_SetCitizenType(characterFromID("shipwreck_trader"));
			Locations[FindLocation("Turks_Fort_office")].locators_radius.box.box7 = 0.7;

			LAi_QuestDelay("Turks_mistress_attack4", 1.0);
		break;

		case "Turks_armory_turn_to_gpb":
			LAi_SetActorType(pchar);	
			LAi_ActorTurnToLocator(Pchar, "candles", "candle6");

			LAi_QuestDelay("pchar_playertype", 0.5);
			LAi_QuestDelay("Turks_bladebarrel_gpS_check", 0.01);
		break;

		case "Turks_bladebarrel_gpS_check":
			if(CheckCharacterItem(Pchar,"bladebarrel_gpS"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(pchar, "bladebarrel_gpS");
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem2", 0.001);
				Locations[FindLocation("Turks_Fort_Office")].locators_radius.randitem.randitem2 = 0.001;
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem1", 0.7);
				Locations[FindLocation("Turks_Fort_Office")].locators_radius.randitem.randitem1 = 0.7;

				LAi_QuestDelay("Turks_pistolbarrel_gpS_check", 0.5);//starts next loop
			}
			else
			{
				LAi_QuestDelay("Turks_bladebarrel_gpS_check", 0.5);//loop check
			}
		break;
		
		case "Turks_pistolbarrel_gpS_check":
			if(CheckCharacterItem(Pchar,"pistolbarrel_gpS"))
			{
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterByItem(pchar, "pistolbarrel_gpS");
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem1", 0.001);
				Locations[FindLocation("Turks_Fort_Office")].locators_radius.randitem.randitem1 = 0.001;
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box7", 0.001);
				Locations[FindLocation("Turks_Fort_Office")].locators_radius.box.box7 = 0.001;

				LAi_QuestDelay("Turks_barrels_picked_up", 1.0);
			}
			else
			{
				LAi_QuestDelay("Turks_pistolbarrel_gpS_check", 0.5);//loop check
			}
		break;

		case "Turks_barrels_picked_up":
			PlaySound("PEOPLE\run_stone.wav");
			ChangeCharacterAddressGroup(Pchar, "Turks_Fort_Office", "goto", "exit");
			Locations[FindLocation("Turks_Jungle_03")].locators_radius.reload.reload2_back = 0.001;
			Locations[FindLocation("Turks_Jungle_03")].locators_radius.box.box1 = 1.5;
		break;

		case "Turks_place_barrels":
			Locations[FindLocation("Turks_Jungle_03")].models.always.l5 = "gp_barrels";
			Locations[FindLocation("Turks_Jungle_03")].image = "";
			DoQuestReloadToLocation("Turks_Jungle_03", "goto", "barrels", "Turks_place_barrels1");
		break;

		case "Turks_place_barrels1":
			LAi_SetPlayerType(pchar);
			Locations[FindLocation("Turks_Jungle_03")].image = "Outside_Jungle_6.tga";

			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "gate_runaway";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Turks_gate_explosion":
			GetCharacterPos(Pchar, &u, &v, &w);
			float gate_dist = GetDistance2D(27.7, 1.1, u, w);
		//LogIt("gate_dist = " + gate_dist);

			if(gate_dist <= 20.0)
			{
				LAi_KillCharacter(Pchar);
			}
		
			if(gate_dist <= 25.0)
			{
				//survive but wounded
				Pchar.Turks_gate = "wounded";
				Php = LAi_GetCharacterHP(Pchar);
				Php2 = Php/2;
				LAi_ApplyCharacterDamage(Pchar, Php2);
				LAi_SetPoorType(pchar);
			}
			else LAi_SetStayType(pchar);

			CreateParticleSystem("canfire2" , 27.7, 0.6, 1.1, 5.1, 4.0, 0.0, sti(20) );		//19
			CreateParticleSystem("gunfire_revolver" , 27.7, 0.6, 1.1, 5.1, 4.0, 0.0, sti(20) );	//66
			CreateParticleSystem("smoke_inv" , 27.7, 0.4, 1.1, 5.1, 4.0, 0.0, sti(20) );		//4 black smoke
			CreateParticleSystemX("blast_dirt", 27.7, 0.9, 1.1, 27.7, 0.9, 1.1,10);
			CreateParticleSystemX("blast_dirt", 27.7, 0.4, 1.1, 27.7, 0.9, 1.1,10);
			
			PlaySound("OBJECTS\DUEL\pistol_musket.wav");
			PlaySound("OBJECTS\DUEL\pistol_musket.wav");
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire1.wav");
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire1.wav");
			PlaySound("OBJECTS\SHIPCHARGE\gunpowder_explosion.wav");

			if(!LAi_IsDead(Pchar)) LAi_QuestDelay("Turks_gate_explosion1", 2.0);
		break;

		case "Turks_gate_explosion1":	
			Locations[FindLocation("Turks_Jungle_03")].image = "";
			Locations[FindLocation("Turks_Jungle_03")].models.always.l5 = "";	//no barrels
			Locations[FindLocation("Turks_Jungle_03")].models.always.gate = "";
			Locations[FindLocation("Turks_Jungle_03")].models.always.gatebroken = "Margarita_gatebroken";
			Locations[FindLocation("Turks_Jungle_03")].locators_radius.reload.reload2_back = 2.5;
			Locations[FindLocation("Turks_Jungle_03")].locators_radius.box.box1 = 0.001;

			GetCharacterPos(Pchar, &x, &y, &z);
			nearloc = LAi_FindNearestFreeLocator("goto", x, y, z);
			DoQuestReloadToLocation("Turks_Jungle_03", "goto", nearloc, "Turks_gate_explosion2");
		break;

		case "Turks_gate_explosion2":
			if(CheckAttribute(Pchar,"Turks_gate") || Pchar.Turks_gate == "wounded")
			{
				LAi_QuestDelay("pchar_ooh", 0.001);

				LAi_QuestDelay("Turks_gate_explosion3", 3.0);
			}
			else
			{
				LAi_SetActorType(pchar);
				LAi_ActorTurnToLocator(Pchar, "goto", "barrels");

				LAi_QuestDelay("pchar_playertype", 1.0);
			}

			CreateParticleSystem("smoke_inv" , 27.7, 0.4, 0.6, 5.1, 4.0, 0.0, sti(20) );		//4 black smoke
			CreateParticleSystem("smoke_inv" , 27.7, 0.9, 1.1, 5.1, 4.0, 0.0, sti(20) );		//4 black smoke
			CreateParticleSystem("smoke_inv" , 27.7, 0.9, 1.6, 5.1, 4.0, 0.0, sti(20) );		//4 black smoke
			
			Locations[FindLocation("Turks_Jungle_03")].image = "Outside_Jungle_6.tga";
			Locations[FindLocation("Turks_port")].models.always.l9 = "Margarita_gatebroken";
			Locations[FindLocation("Turks_Jungle_03")].reload.l4.disable = 0;		//unlocked to port
			ChangeCharacterAddressGroup(characterFromID("Mistress"), "Turks_port", "quest", "quest2");
			LAi_SetActorType(characterFromID("Mistress"));
			LAi_ActorSetLayMode(characterFromID("Mistress"));

			pchar.quest.Turks_enemy0.win_condition.l1 = "locator";
			pchar.quest.Turks_enemy0.win_condition.l1.location = "Turks_port";
			pchar.quest.Turks_enemy0.win_condition.l1.locator_group = "quest";
			pchar.quest.Turks_enemy0.win_condition.l1.locator = "shot1";
			pchar.quest.Turks_enemy0.win_condition = "Turks_enemy0";

			LAi_QuestDelay("Turks_roofs", 0.1);
		break;

		case "Turks_gate_explosion3":
			Pchar.Turks_explosion = "done";
			LAi_SetActorType(pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "barrels");

			LAi_QuestDelay("pchar_playertype", 1.0);
		break;
	//...............................................................................................
		case "Turks_roofs":
			ChangeCharacterAddressGroup(CharacterFromID("wr_boc4"), "Turks_port", "quest", "fight1");
			ChangeCharacterAddressGroup(CharacterFromID("wr_blcor"), "Turks_port", "quest", "enemy3");
			ChangeCharacterAddressGroup(CharacterFromID("wr_kor"), "Turks_port", "quest", "enemy6");
			ChangeCharacterAddressGroup(CharacterFromID("wr_cor4"), "Turks_port", "quest", "enemy5");
			LAi_SetActorType(CharacterFromID("wr_cor4"));
			ChangeCharacterAddressGroup(CharacterFromID("wr_9SNat"), "Turks_port", "quest", "enemy9");
			LAi_SetPoorType(CharacterFromID("wr_9SNat"));

			LAi_NoRebirthEnable(CharacterFromID("wr_boc4"));
			LAi_NoRebirthEnable(CharacterFromID("wr_18_1"));
			LAi_NoRebirthEnable(CharacterFromID("wr_blcor"));
			LAi_NoRebirthEnable(CharacterFromID("wr_kor"));
			LAi_NoRebirthEnable(CharacterFromID("wr_cor4"));
			LAi_NoRebirthEnable(CharacterFromID("wr_blm"));
			LAi_NoRebirthEnable(CharacterFromID("wr_9SNat"));

			RemoveCharacterEquip(characterFromID("wr_boc4"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("wr_boc4"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("wr_boc4"), "items");
			GiveItem2Character(characterFromID("wr_boc4"), "blade4");
			EquipCharacterByItem(characterFromID("wr_boc4"), "blade4");

			RemoveCharacterEquip(characterFromID("wr_18_1"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("wr_18_1"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("wr_18_1"), "items");
			GiveItem2Character(characterFromID("wr_18_1"), "blade4");
			EquipCharacterByItem(characterFromID("wr_18_1"), "blade4");

			RemoveCharacterEquip(characterFromID("wr_blcor"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("wr_blcor"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("wr_blcor"), "items");
			GiveItem2Character(characterFromID("wr_blcor"), "blade4");
			EquipCharacterByItem(characterFromID("wr_blcor"), "blade4");

			RemoveCharacterEquip(characterFromID("wr_kor"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("wr_kor"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("wr_kor"), "items");
			GiveItem2Character(characterFromID("wr_kor"), "blade4");
			EquipCharacterByItem(characterFromID("wr_kor"), "blade4");

			RemoveCharacterEquip(characterFromID("wr_blm"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("wr_blm"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("wr_blm"), "items");
			GiveItem2Character(characterFromID("wr_blm"), "blade4");
			EquipCharacterByItem(characterFromID("wr_blm"), "blade4");

			RemoveCharacterEquip(characterFromID("wr_9SNat"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("wr_9SNat"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("wr_9SNat"), "items");
			GiveItem2Character(characterFromID("wr_9SNat"), "blade4");
			EquipCharacterByItem(characterFromID("wr_9SNat"), "blade4");

			RemoveCharacterEquip(characterFromID("wr_cor4"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("wr_cor4"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("wr_cor4"), "items");
			GiveItem2Character(characterFromID("wr_cor4"), "bladeA2");
			EquipCharacterByItem(characterFromID("wr_cor4"), "bladeA2");
			GiveItem2Character(characterFromID("wr_cor4"), "sextant");
		break;

		case "Turks_enemy0":
			LAi_SetHP(CharacterFromID("wr_boc4"), 100.0, 100.0);
			LAi_SetActorType(CharacterFromID("wr_boc4"));
			LAi_ActorAttack(CharacterFromID("wr_boc4"), Pchar, "");

			pchar.quest.Turks_enemy1.win_condition.l1 = "locator";
			pchar.quest.Turks_enemy1.win_condition.l1.location = "Turks_port";
			pchar.quest.Turks_enemy1.win_condition.l1.locator_group = "quest";
			pchar.quest.Turks_enemy1.win_condition.l1.locator = "fight1";
			pchar.quest.Turks_enemy1.win_condition = "Turks_enemy1";
		break;

		case "Turks_enemy1":
			LAi_SetHP(CharacterFromID("wr_18_1"), 100.0, 100.0);
			LAi_SetActorType(CharacterFromID("wr_18_1"));
			ChangeCharacterAddressGroup(CharacterFromID("wr_18_1"), "Turks_port", "quest", "enemy1");
			
			LAi_QuestDelay("Turks_enemy1_A", 0.5);
		break;

		case "Turks_enemy1_A":
			PlaySound("PEOPLE\recoil.wav");
			ChangeCharacterAddressGroup(CharacterFromID("wr_18_1"), "Turks_port", "quest", "enemy2");
			LAi_SetActorType(CharacterFromID("wr_18_1"));
			LAi_ActorAttack(CharacterFromID("wr_18_1"), Pchar, "");

			pchar.quest.Turks_musket.win_condition.l1 = "locator";
			pchar.quest.Turks_musket.win_condition.l1.location = "Turks_port";
			pchar.quest.Turks_musket.win_condition.l1.locator_group = "box";
			pchar.quest.Turks_musket.win_condition.l1.locator = "box8";
			pchar.quest.Turks_musket.win_condition = "Turks_musket";
		break;

		case "Turks_musket":
			LAi_QuestDelay("pchar_ohoh", 0.01);
			Logit(LanguageConvertString(tmpLangFileID,"It's a trap! I have to creep under the musket."));

			pchar.quest.Turks_musket_fire.win_condition.l1 = "locator";
			pchar.quest.Turks_musket_fire.win_condition.l1.location = "Turks_port";
			pchar.quest.Turks_musket_fire.win_condition.l1.locator_group = "quest";
			pchar.quest.Turks_musket_fire.win_condition.l1.locator = "fight2";
			pchar.quest.Turks_musket_fire.win_condition = "Turks_musket_fire";
		break;

		case "Turks_to_fight2":
			PlaySound("PEOPLE\grass_turn.wav");
			ChangeCharacterAddressGroup(Pchar, "Turks_port", "quest", "fight2");

			LAi_QuestDelay("Turks_to_musket", 1.0);
		break;

		case "Turks_to_musket":
			PlaySound("PEOPLE\grass_turn.wav");
			ChangeCharacterAddressGroup(Pchar, "Turks_port", "quest", "musket");

			LAi_QuestDelay("pchar_playertype", 1.0);
			LAi_QuestDelay("pchar_puh", 1.0);
			LAi_QuestDelay("pchar_puh", 1.0);
		break;

		case "Turks_musket_fire":
			PlaySound("OBJECTS\DUEL\pistol_bbus.wav");
			CreateParticleSystem("gunfire" , -2.3, 10.8, -50.1, -2.3, 10.8, -50.1, sti(20) );

			if(CheckAttribute(Pchar, "Turks_creep") && Pchar.Turks_creep == "yes")
			{
				pchar.quest.Turks_cannon.win_condition.l1 = "locator";
				pchar.quest.Turks_cannon.win_condition.l1.location = "Turks_port";
				pchar.quest.Turks_cannon.win_condition.l1.locator_group = "quest";
				pchar.quest.Turks_cannon.win_condition.l1.locator = "fight3";
				pchar.quest.Turks_cannon.win_condition = "Turks_cannon";
			}
			else LAi_KillCharacter(Pchar);
		break;

		case "Turks_cannon":
			if(CheckAttribute(Pchar, "killed_wr_officers"))
			{
				switch(Pchar.killed_wr_officers)
				{
					case "0":
						GiveItem2Character(characterFromID("wr_cor4"), "pistol203");
						EquipCharacterByItem(characterFromID("wr_cor4"), "pistol203");
						GiveItem2Character(characterFromID("wr_cor4"), "ammobag1");
						TakenItems(characterFromID("wr_cor4"), "gunpowder", 2);
						TakenItems(characterFromID("wr_cor4"), "pistolbullets", 2);

						LAi_QuestDelay("Dampier_items0_check", 0.1);
					break;

					case "1":
						GiveItem2Character(characterFromID("wr_cor4"), "pistol201");
						GiveItem2Character(characterFromID("wr_cor4"), "pistol204");
						EquipCharacterByItem(characterFromID("wr_cor4"), "pistol201");
						TakenItems(characterFromID("wr_cor4"), "gunpowder", 2);
						TakenItems(characterFromID("wr_cor4"), "pistolbullets", 2);

						LAi_QuestDelay("Dampier_items1_check", 0.1);
					break;

					case "2":
						GiveItem2Character(characterFromID("wr_cor4"), "pistol205");
						GiveItem2Character(characterFromID("wr_cor4"), "pistol202");
						EquipCharacterByItem(characterFromID("wr_cor4"), "pistol205");
						TakenItems(characterFromID("wr_cor4"), "gunpowder", 2);
						TakenItems(characterFromID("wr_cor4"), "pistolbullets", 2);

						LAi_QuestDelay("Dampier_items2_check", 0.1);
					break;

					case "3":
						GiveItem2Character(characterFromID("wr_cor4"), "pistol206");
						GiveItem2Character(characterFromID("wr_cor4"), "pistolbelt");
						EquipCharacterByItem(characterFromID("wr_cor4"), "pistol206");
						TakenItems(characterFromID("wr_cor4"), "gunpowder", 2);
						TakenItems(characterFromID("wr_cor4"), "pistolbullets", 2);

						LAi_QuestDelay("Dampier_items3_check", 0.1);
					break;
				}
			}

			LAi_QuestDelay("Turks_cannon_turn", 2.0);

			pchar.quest.Turks_cannon_escape.win_condition.l1 = "location";
			pchar.quest.Turks_cannon_escape.win_condition.l1.location = "Turks_balcony_room";
			pchar.quest.Turks_cannon_escape.win_condition = "Turks_cannon_escape";
		break;

		case "Dampier_items0_check":
			if(CheckCharacterItem(Pchar,"pistol203") && CheckCharacterItem(Pchar,"ammobag1"))
			{
				LAi_QuestDelay("Turks_jump_open", 0.1);
			}
			else LAi_QuestDelay("Dampier_items0_check", 0.5);//loop check
		break;

		case "Dampier_items1_check":
			if(CheckCharacterItem(Pchar,"pistol201") && CheckCharacterItem(Pchar,"pistol204"))
			{
				LAi_QuestDelay("Turks_jump_open", 0.1);
			}
			else LAi_QuestDelay("Dampier_items1_check", 0.5);//loop check
		break;

		case "Dampier_items2_check":
			if(CheckCharacterItem(Pchar,"pistol205") && CheckCharacterItem(Pchar,"pistol202"))
			{
				LAi_QuestDelay("Turks_jump_open", 0.1);
			}
			else LAi_QuestDelay("Dampier_items2_check", 0.5);//loop check
		break;

		case "Dampier_items3_check":
			if(CheckCharacterItem(Pchar,"pistol206") && CheckCharacterItem(Pchar,"pistolbelt"))
			{
				LAi_QuestDelay("Turks_jump_open", 0.1);
			}
			else LAi_QuestDelay("Dampier_items3_check", 0.5);//loop check
		break;

		case "Turks_jump_open":
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "quest", "jump", 0.001);
			Locations[FindLocation("Turks_port")].locators_radius.quest.jump = 0.001;

			pchar.quest.Turks_splash.win_condition.l1 = "locator";
			pchar.quest.Turks_splash.win_condition.l1.location = "Turks_port";
			pchar.quest.Turks_splash.win_condition.l1.locator_group = "quest";
			pchar.quest.Turks_splash.win_condition.l1.locator = "splash";
			pchar.quest.Turks_splash.win_condition = "Turks_splash";
		break;	

		case "Turks_cannon_turn":
			if(Pchar.location == "Turks_port") 
			{
				LAi_SetActorType(Pchar);
				LAi_ActorTurnToLocator(Pchar, "quest", "look1");

				LAi_QuestDelay("pchar_playertype", 1.0);
			}

			LAi_QuestDelay("Turks_cannon_fire", 2.0);
		break;

		case "Turks_cannon_fire":
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire_01.wav");
			CreateParticleSystem("gunfire" , 15.0, 6.3, -42.3, 15.0, 6.3, -42.3, sti(20) );

			CreateParticleSystem("canfire2" , 15.0, 6.3, -42.3, 5.1, 4.0, 0.0, sti(20) );		//19
			CreateParticleSystem("gunfire_revolver" , 15.0, 6.3, -42.3, 5.1, 4.0, 0.0, sti(20) );	//66
			CreateParticleSystem("smoke_inv" , 15.0, 6.3, -42.3, 5.1, 4.0, 0.0, sti(20) );	

			LAi_QuestDelay("Turks_cannon_fire1", 1.0);
		break;

		case "Turks_cannon_fire1":
			if(Pchar.location == "Turks_port") 
			{
				Locations[FindLocation("Turks_port")].reload.l17.disable = 1;
				LAi_KillCharacter(Pchar);
			}
		break;

		case "Turks_cannon_escape":
			pchar.quest.Turks_enemy2.win_condition.l1 = "location";
			pchar.quest.Turks_enemy2.win_condition.l1.location = "Turks_port";
			pchar.quest.Turks_enemy2.win_condition = "Turks_enemy2";
		break;

		case "Turks_enemy2":
			LAi_SetHP(CharacterFromID("wr_blcor"), 100.0, 100.0);
			LAi_SetActorType(CharacterFromID("wr_blcor"));
			LAi_ActorAttack(CharacterFromID("wr_blcor"), Pchar, "");

			pchar.quest.Turks_enemy3.win_condition.l1 = "locator";
			pchar.quest.Turks_enemy3.win_condition.l1.location = "Turks_port";
			pchar.quest.Turks_enemy3.win_condition.l1.locator_group = "quest";
			pchar.quest.Turks_enemy3.win_condition.l1.locator = "fight4";
			pchar.quest.Turks_enemy3.win_condition = "Turks_enemy3";
		break;

		case "Turks_enemy3":
			LAi_SetHP(CharacterFromID("wr_kor"), 100.0, 100.0);
			LAi_SetActorType(CharacterFromID("wr_kor"));
			LAi_ActorAttack(CharacterFromID("wr_kor"), Pchar, "");

			pchar.quest.Turks_enemy4.win_condition.l1 = "locator";
			pchar.quest.Turks_enemy4.win_condition.l1.location = "Turks_port";
			pchar.quest.Turks_enemy4.win_condition.l1.locator_group = "quest";
			pchar.quest.Turks_enemy4.win_condition.l1.locator = "fight5";
			pchar.quest.Turks_enemy4.win_condition = "Turks_enemy4";
		break;

		case "Turks_enemy4":
			LAi_SetHP(CharacterFromID("wr_9SNat"), 100.0, 100.0);
			PlaySound("PEOPLE\recoil.wav");
			LAi_SetActorType(CharacterFromID("wr_9SNat"));
			ChangeCharacterAddressGroup(CharacterFromID("wr_9SNat"), "Turks_port", "quest", "shot3");		

			LAi_QuestDelay("pchar_staytype", 1.0);
			LAi_QuestDelay("Turks_enemy5", 2.0);
		break;

		case "Turks_enemy5":
			PlaySound("PEOPLE\jump_roof.wav");
			ChangeCharacterAddressGroup(CharacterFromID("wr_blm"), "Turks_port", "quest", "enemy8");
			LAi_SetActorType(CharacterFromID("wr_blm"));
			LAi_SetHP(CharacterFromID("wr_blm"), 75.0, 75.0);
			
			LAi_QuestDelay("Turks_enemy5_1", 1.0);
		break;

		case "Turks_enemy5_1":
			LAi_QuestDelay("Pchar_huh", 0.001);
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "quest", "enemy8");

			LAi_QuestDelay("Turks_enemy5_2", 1.0);
		break;

		case "Turks_enemy5_2":
			LAi_SetPlayerType(Pchar);
			LAi_SetActorType(CharacterFromID("wr_blm"));
			LAi_SetActorType(CharacterFromID("wr_9SNat"));
			LAi_ActorAttack(CharacterFromID("wr_blm"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("wr_9SNat"), Pchar, "");

			pchar.quest.Turks_enemy6.win_condition.l1 = "locator";
			pchar.quest.Turks_enemy6.win_condition.l1.location = "Turks_port";
			pchar.quest.Turks_enemy6.win_condition.l1.locator_group = "quest";
			pchar.quest.Turks_enemy6.win_condition.l1.locator = "fight6";
			pchar.quest.Turks_enemy6.win_condition = "Turks_enemy6";
		break;

		case "Turks_enemy6":
			DoQuickSave();
			LAi_SetImmortal(characterFromID("wr_cor4"), false);
			LAi_SetHP(CharacterFromID("wr_cor4"), 250.0, 250.0);
			LAi_SetActorType(CharacterFromID("wr_cor4"));
			LAi_ActorAttack(CharacterFromID("wr_cor4"), Pchar, "");
			PlaySound("VOICE\ENGLISH\dampier_sailorboy.wav");

			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box3", 0.001);
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box4", 0.001);

			Pchar.quest.Turks_enemy6_dead.win_condition.l1 = "NPC_Death";
			Pchar.quest.Turks_enemy6_dead.win_condition.l1.character = "wr_cor4";
			Pchar.quest.Turks_enemy6_dead.win_condition = "Turks_enemy6_dead";

			LAi_QuestDelay("Turks_jump", 0.1);
		break;

		case "Turks_enemy6_dead":
			Pchar.killed_wr_officers = sti(Pchar.killed_wr_officers) + 1;
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box3", 0.5);
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box4", 0.5);

			LAi_QuestDelay("Turks_steplocks", 0.1);
		break;
	
		case "Turks_jump":
			pchar.quest.Turks_jump_back.win_condition.l1 = "locator";
			pchar.quest.Turks_jump_back.win_condition.l1.location = "Turks_port";
			pchar.quest.Turks_jump_back.win_condition.l1.locator_group = "quest";
			pchar.quest.Turks_jump_back.win_condition.l1.locator = "jump";
			pchar.quest.Turks_jump_back.win_condition = "Turks_jump_back";
		break;

		case "Turks_jump_back":
			LAi_QuestDelay("pchar_ohoh", 0.01);
			Logit(LanguageConvertString(tmpLangFileID,"I have not looted Dampier!"));
			ChangeCharacterAddressGroup(Pchar, "Turks_port", "quest", "jump_back");

			LAi_QuestDelay("Turks_jump", 0.5);
		break;
	
		case "Turks_splash":
			LAi_QuestDelay("Turks_splash1", 0.5);
		break;

		case "Turks_splash1":
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			CreateParticleSystemX("ball_splash", 41.2, -4.0, 18.4, 0.0, 0.0, 0.0, 0);
			if(IsEquipCharacterByItem(Pchar, "longrifle_W")) {RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);}
			TakeItemFromCharacter(pchar, "longrifle_W");
			if(IsEquipCharacterByItem(Pchar, "blade4") || IsEquipCharacterByItem(Pchar, "bladeA2")) {RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);}	
			TakenItems(Pchar, "blade4", -6);
		//	TakeItemFromCharacter(pchar, "bladeA2");
			Pchar.quest.hammer_gp = 0;
			Locations[FindLocation("Turks_port")].locators_radius.box.box10 = 0.7;
		break;

		case "Turks_to_step_up1":
			PlaySound("PEOPLE\recoil.wav");
			ChangeCharacterAddressGroup(Pchar, "Turks_port", "quest", "step_up1");
			LAi_SetPlayerType(pchar);
		break;

		case "Turks_to_box6":
			PlaySound("PEOPLE\recoil.wav");
			ChangeCharacterAddressGroup(Pchar, "Turks_port", "box", "box7");
			LAi_SetPlayerType(pchar);
		break;

		case "Turks_to_step_up3":
			PlaySound("PEOPLE\recoil.wav");
			ChangeCharacterAddressGroup(Pchar, "Turks_port", "quest", "step_up3");
			LAi_SetPlayerType(pchar);
		break;
	//...............................................................................................
		case "Turks_steplocks":
			pchar.quest.Turks_steplockM.win_condition.l1 = "locator";
			pchar.quest.Turks_steplockM.win_condition.l1.location = "Turks_port";
			pchar.quest.Turks_steplockM.win_condition.l1.locator_group = "goto";
			pchar.quest.Turks_steplockM.win_condition.l1.locator = "steplockM";
			pchar.quest.Turks_steplockM.win_condition = "Turks_steplockM_1";

			pchar.quest.Turks_steplockR.win_condition.l1 = "locator";
			pchar.quest.Turks_steplockR.win_condition.l1.location = "Turks_port";
			pchar.quest.Turks_steplockR.win_condition.l1.locator_group = "goto";
			pchar.quest.Turks_steplockR.win_condition.l1.locator = "steplockR";
			pchar.quest.Turks_steplockR.win_condition = "Turks_steplockR_1";

			pchar.quest.Turks_steplockL.win_condition.l1 = "locator";
			pchar.quest.Turks_steplockL.win_condition.l1.location = "Turks_port";
			pchar.quest.Turks_steplockL.win_condition.l1.locator_group = "goto";
			pchar.quest.Turks_steplockL.win_condition.l1.locator = "steplockL";
			pchar.quest.Turks_steplockL.win_condition = "Turks_steplockL_1";

			pchar.quest.Turks_watergate.win_condition.l1 = "locator";
			pchar.quest.Turks_watergate.win_condition.l1.location = "Turks_port";
			pchar.quest.Turks_watergate.win_condition.l1.locator_group = "goto";
			pchar.quest.Turks_watergate.win_condition.l1.locator = "waterstop";
			pchar.quest.Turks_watergate.win_condition = "Turks_watergate";

			pchar.quest.fall_to_sewer.win_condition.l1 = "location";
			pchar.quest.fall_to_sewer.win_condition.l1.location = "Turks_sewer";
			pchar.quest.fall_to_sewer.win_condition = "fall_to_sewer";
		break;
	//-------------------------------------------------------------------------------------
		case "Turks_steplockM_1":
			//WATERGATE

			if(Locations[FindLocation(Pchar.location)].environment.sea == "true")
			{
				if(Locations[FindLocation(Pchar.location)].models.always.l10 == "watergate")
				{
					LAi_SetStayType(Pchar);
					PlaySound("INTERFACE\step_path.wav");
					Locations[FindLocation(Pchar.location)].models.always.l10 = "";
					Locations[FindLocation(Pchar.location)].locators_radius.goto.waterstop = 0.0;
				}
				else
				{
					LAi_SetStayType(Pchar);
					PlaySound("INTERFACE\step_path.wav");
					Locations[FindLocation(Pchar.location)].models.always.l10 = "watergate";
					Locations[FindLocation(Pchar.location)].locators_radius.goto.waterstop = 0.5;
				}

				LAi_QuestDelay("Turks_steplockM_2", 0.5);
			}
			else
			{
				//disabled

				LAi_SetStayType(Pchar);
				PlaySound("INTERFACE\lever_stuck.wav");

				LAi_QuestDelay("Turks_steplockM_disabled", 1.0);
			}
		break;

		case "Turks_steplockM_2":
			Locations[FindLocation("Turks_port")].image = "";
			DoQuestReloadToLocation("Turks_port", "goto", "stepbackM", "Turks_steplockM_3");
		break;

		case "Turks_steplockM_3":
			if(Locations[FindLocation(Pchar.location)].models.always.l10 == "watergate")
			{
				PlaySound("OBJECTS\SHIPCHARGE\ball_splash1.wav");
				PlaySound("INTERFACE\rum_wheel.wav");
				PlaySound("INTERFACE\rum_wheel.wav");		
			}
			else 
			{
				PlaySound("OBJECTS\SHIPCHARGE\ball_splash1.wav");
				PlaySound("INTERFACE\shelf_close.wav");
			}

			LAi_QuestDelay("Turks_steplockM_4", 1.0);
		break;

		case "Turks_steplockM_4":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "ships_other", "ship1");
			Locations[FindLocation("Turks_port")].image = "Town_Grand_Turk.tga";	

			LAi_QuestDelay("pchar_playertype", 1.0);

			pchar.quest.Turks_steplockM.win_condition.l1 = "locator";
			pchar.quest.Turks_steplockM.win_condition.l1.location = "Turks_port";
			pchar.quest.Turks_steplockM.win_condition.l1.locator_group = "goto";
			pchar.quest.Turks_steplockM.win_condition.l1.locator = "steplockM";
			pchar.quest.Turks_steplockM.win_condition = "Turks_steplockM_1";
		break;

		case "Turks_steplockM_disabled":
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "Turks_port", "goto", "stepbackM");
			
			pchar.quest.Turks_steplockM.win_condition.l1 = "locator";
			pchar.quest.Turks_steplockM.win_condition.l1.location = "Turks_port";
			pchar.quest.Turks_steplockM.win_condition.l1.locator_group = "goto";
			pchar.quest.Turks_steplockM.win_condition.l1.locator = "steplockM";
			pchar.quest.Turks_steplockM.win_condition = "Turks_steplockM_1";
		break;
	//-------------------------------------------------------------------------------------
		case "Turks_steplockR_1":
			//WATER

			if(Locations[FindLocation(Pchar.location)].models.always.l10 == "watergate")
			{
				if(Locations[FindLocation(Pchar.location)].environment.sea == "true")
				{
					LAi_SetStayType(Pchar);
					PlaySound("INTERFACE\step_path.wav");
					Locations[FindLocation(Pchar.location)].environment.sea = "false";
					Locations[FindLocation(Pchar.location)].locators_radius.reload.reload_sewer = 1.0;

					LAi_QuestDelay("Turks_steplockR_2", 0.5);	
				}
				else
				{
					//hatch must be closed too
					if(Locations[FindLocation(Pchar.location)].models.always.locators == "Margarita_locators_KR_closed")
					{
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\step_path.wav");
						Locations[FindLocation(Pchar.location)].environment.sea = "true";
						Locations[FindLocation(Pchar.location)].locators_radius.reload.reload_sewer = 0.0;

						LAi_QuestDelay("Turks_steplockR_2", 0.5);	
					}
					else
					{
						//disabled

						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\lever_stuck.wav");

						LAi_QuestDelay("Turks_steplockR_disabled", 1.0);
					}
				}
			}
			else
			{
				//disabled

				LAi_SetStayType(Pchar);
				PlaySound("INTERFACE\lever_stuck.wav");

				LAi_QuestDelay("Turks_steplockR_disabled", 1.0);
			}
		break;

		case "Turks_steplockR_2":
			Locations[FindLocation("Turks_port")].image = "";
			DoQuestReloadToLocation("Turks_port", "goto", "stepbackR", "Turks_steplockR_3");
		break;

		case "Turks_steplockR_3":
			if(Locations[FindLocation(Pchar.location)].environment.sea == "true")
			{
				PlaySound("NATURE\water_in.wav");
			}
			else PlaySound("NATURE\water_out.wav");

			LAi_QuestDelay("Turks_steplockR_4", 1.0);
		break;

		case "Turks_steplockR_4":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "ships_other", "ship1");
			Locations[FindLocation("Turks_port")].image = "Town_Grand_Turk.tga";	

			LAi_QuestDelay("pchar_playertype", 1.0);
		
			pchar.quest.Turks_steplockR.win_condition.l1 = "locator";
			pchar.quest.Turks_steplockR.win_condition.l1.location = "Turks_port";
			pchar.quest.Turks_steplockR.win_condition.l1.locator_group = "goto";
			pchar.quest.Turks_steplockR.win_condition.l1.locator = "steplockR";
			pchar.quest.Turks_steplockR.win_condition = "Turks_steplockR_1";
		break;

		case "Turks_steplockR_disabled":
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "Turks_port", "goto", "stepbackR");
			
			pchar.quest.Turks_steplockR.win_condition.l1 = "locator";
			pchar.quest.Turks_steplockR.win_condition.l1.location = "Turks_port";
			pchar.quest.Turks_steplockR.win_condition.l1.locator_group = "goto";
			pchar.quest.Turks_steplockR.win_condition.l1.locator = "steplockR";
			pchar.quest.Turks_steplockR.win_condition = "Turks_steplockR_1";
		break;
	//-------------------------------------------------------------------------------------
		case "Turks_steplockL_1":
			//HATCH

			if(Locations[FindLocation(Pchar.location)].environment.sea == "false")
			{
				if(Locations[FindLocation(Pchar.location)].models.always.locators == "Margarita_locators_KR_closed")
				{
					SetNextWeather("Clear");
					LAi_SetStayType(Pchar);
					PlaySound("INTERFACE\step_path.wav");
					Locations[FindLocation(Pchar.location)].models.always.locators = "Margarita_locators_KR_open";
					Locations[FindLocation(Pchar.location)].reload.l16.disable = 0;
				}
				else
				{
					LAi_SetStayType(Pchar);
					PlaySound("INTERFACE\step_path.wav");
					Locations[FindLocation(Pchar.location)].models.always.locators = "Margarita_locators_KR_closed";
					Locations[FindLocation(Pchar.location)].reload.l16.disable = 1;
				}

				LAi_QuestDelay("Turks_steplockL_2", 0.5);
			}
			else
			{
				//disabled

				LAi_SetStayType(Pchar);
				PlaySound("INTERFACE\lever_stuck.wav");

				LAi_QuestDelay("Turks_steplockL_disabled", 1.0);
			}
		break;

		case "Turks_steplockL_2":
			Locations[FindLocation("Turks_port")].image = "";
			DoQuestReloadToLocation("Turks_port", "goto", "stepbackL", "Turks_steplockL_3");
		break;

		case "Turks_steplockL_3":
			if(Locations[FindLocation(Pchar.location)].models.always.locators == "Margarita_locators_KR_closed")
			{
				PlaySound("INTERFACE\closed_door.wav");	
			}
			else 
			{
				PlaySound("INTERFACE\closet_Open.wav");	
				SetCurrentTime(12, 0);			//brown sewer water looks best daytime
			}
			LAi_QuestDelay("Turks_steplockL_4", 1.0);
		break;

		case "Turks_steplockL_4":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "ships_other", "ship1");
			Locations[FindLocation("Turks_port")].image = "Town_Grand_Turk.tga";	

			LAi_QuestDelay("pchar_playertype", 1.0);
		
			pchar.quest.Turks_steplockL.win_condition.l1 = "locator";
			pchar.quest.Turks_steplockL.win_condition.l1.location = "Turks_port";
			pchar.quest.Turks_steplockL.win_condition.l1.locator_group = "goto";
			pchar.quest.Turks_steplockL.win_condition.l1.locator = "steplockL";
			pchar.quest.Turks_steplockL.win_condition = "Turks_steplockL_1";
		break;

		case "Turks_steplockL_disabled":
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "Turks_port", "goto", "stepbackL");
			
			pchar.quest.Turks_steplockL.win_condition.l1 = "locator";
			pchar.quest.Turks_steplockL.win_condition.l1.location = "Turks_port";
			pchar.quest.Turks_steplockL.win_condition.l1.locator_group = "goto";
			pchar.quest.Turks_steplockL.win_condition.l1.locator = "steplockL";
			pchar.quest.Turks_steplockL.win_condition = "Turks_steplockL_1";
		break;
	//-------------------------------------------------------------------------------------
		case "Turks_watergate":
			LAi_SetStayType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "Turks_port", "goto", "waterback");
			
			LAi_QuestDelay("Turks_watergate_1", 0.5);
		break;

		case "Turks_watergate_1":
			LAi_SetPlayerType(Pchar);

			pchar.quest.Turks_watergate.win_condition.l1 = "locator";
			pchar.quest.Turks_watergate.win_condition.l1.location = "Turks_port";
			pchar.quest.Turks_watergate.win_condition.l1.locator_group = "goto";
			pchar.quest.Turks_watergate.win_condition.l1.locator = "waterstop";
			pchar.quest.Turks_watergate.win_condition = "Turks_watergate";
		break;
	//-------------------------------------------------------------------------------------
		case "fall_to_sewer":
			LAi_SetSitType(Pchar);
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			CreateParticleSystemX("ball_splash", 22.7, 0.0, -13.5, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", 22.7, 0.0, -13.5, 0.0, 0.0, 0.0, 0);

			LAi_QuestDelay("fall_to_sewer1", 2.0);
		break;
		
		case "fall_to_sewer1":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead7.wav");

			LAi_QuestDelay("fall_to_sewer2", 1.0);
		break;

		case "fall_to_sewer2":
			LAi_SetplayerType(Pchar);
			PlaySound("PEOPLE\step_dpwater2.wav");
			PlaySound("PEOPLE\step_dpwater2.wav");

			LAi_QuestDelay("fall_to_sewer3", 1.0);
		break;

		case "fall_to_sewer3":
			SetNextWeather("Clear");
			PlaySound("OBJECTS\VOICES\DEAD\male\dead8.wav");
			Locations[FindLocation("Turks_port")].reload.l16.autoreload = "0";

			Pchar.quest.blade_gp_dry_check.win_condition.l1 = "item";
			Pchar.quest.blade_gp_dry_check.win_condition.l1.character = Pchar.id;
			Pchar.quest.blade_gp_dry_check.win_condition.l1.item = "blade_gp_dry";
			Pchar.quest.blade_gp_dry_check.win_condition = "blade_gp_dry_check";

			pchar.quest.bladebottle_CB2_check.win_condition.l1 = "location";
			pchar.quest.bladebottle_CB2_check.win_condition.l1.location = "Turks_wreck_shore";
			pchar.quest.bladebottle_CB2_check.win_condition = "bladebottle_CB2_check";
		break;

	//-------------------------------------------------------------------------------------
	// Turks_wreck_shore
		
		case "Turks_shore_turn_to_splash":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "quest", "splash");

			LAi_QuestDelay("pchar_playertype", 1.3);
		break;

		case "Turks_shore_to_box7":
			ChangeCharacterAddressGroup(Pchar, "Turks_wreck_shore", "box", "box7");
		break;

		case "Turks_shore_to_box10":
			ChangeCharacterAddressGroup(Pchar, "Turks_wreck_shore", "box", "box10");
		break;

		case "bladebottle_CB2_check":
			if(CheckCharacterItem(Pchar,"bladebottle_CB2"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(pchar, "bladebottle_CB2");
				PlaySound("INTERFACE\glass1.wav");
	
				LAi_QuestDelay("bladebottle_CB2_check2", 1.5);
			}
			else
			{
				LAi_QuestDelay("bladebottle_CB2_check", 0.5);	//loop check
			}
		break;

		case "bladebottle_CB2_check2":
			PlaySound("PEOPLE\creak2.wav");
			ChangeCharacterAddressGroup(Pchar, "Turks_wreck_shore", "box", "box9");
		break;

	// BB_sloop_wreck_hold

		case "blade_gp_dry_check":
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			EquipCharacterByItem(pchar, "blade_gp_dry");
			Locations[FindLocation("BB_sloop_wreck_cabin")].locators_radius.reload.reload2 = 0.001;	//to shore

			pchar.quest.blade_gp_dry_dialog.win_condition.l1 = "locator";
			pchar.quest.blade_gp_dry_dialog.win_condition.l1.location = "BB_sloop_wreck_hold";
			pchar.quest.blade_gp_dry_dialog.win_condition.l1.locator_group = "goto";
			pchar.quest.blade_gp_dry_dialog.win_condition.l1.locator = "goto3";
			pchar.quest.blade_gp_dry_dialog.win_condition = "blade_gp_dry_dialog";
		break;

		case "blade_gp_dry_dialog":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "gp_dry";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "dialog_gp_dry_done":
			LAi_QuestDelay("dialog_gp_dry_done1", 1.0);
		break;

		case "dialog_gp_dry_done1":
			AddQuestRecord("Caesar", "8");
			DoQuickSave();
		break;

	// BB_sloop_wreck_cabin

		case "place_gp_dry":
			Locations[FindLocation("BB_sloop_wreck_cabin")].locators_radius.reload.reload2 = 1.0;	//to shore
			Locations[FindLocation(Pchar.location)].models.always.l2 = "gp_dry";

			Locations[FindLocation("BB_sloop_wreck_cabin")].image = "";
			DoQuestReloadToLocation("BB_sloop_wreck_cabin", "goto", "free", "gpmap_free");
		break;

		case "gpmap_free":
			LAi_SetFightMode(pchar, false);
			LAi_SetPlayerType(Pchar);

			Locations[FindLocation("BB_sloop_wreck_cabin")].image = "Deck_Capsm.tga";
			LAi_LocationFightDisable(&Locations[FindLocation("BB_sloop_wreck_cabin")], true);

			if(CheckCharacterItem(Pchar,"bladebottle_CE0")) 
			{
				//LAi_QuestDelay("pchar_yah", 0.1);
				LAi_QuestDelay("pchar_huh", 0.1);

				LAi_QuestDelay("skip_empty_bottle", 1.0);
			}
			else LAi_QuestDelay("pchar_hah", 0.1);
		break;

		case "wine_on_gp_dry":
			PlaySound("AMBIENT\TAVERN\tinkle1.wav");

			LAi_QuestDelay("wine_on_gp_dry1", 3.0);
		break;

		case "wine_on_gp_dry1":
			Locations[FindLocation("BB_sloop_wreck_cabin")].models.always.l2 = "gp_wet";
			Locations[FindLocation("BB_sloop_wreck_cabin")].models.always.locators = "capsm_l_KR_map1";

			Locations[FindLocation("BB_sloop_wreck_cabin")].image = "";
			DoQuestReloadToLocation("BB_sloop_wreck_cabin", "goto", "free", "gpmap_free");
		break;

		case "skip_empty_bottle":
			PlaySound("AMBIENT\TAVERN\tinkle4.wav");
			TakeItemFromCharacter(Pchar, "bladebottle_CE0");
			EquipCharacterByItem(Pchar, "bladeX4");
		break;

		case "hand_on_gp_wet":
	/*
			Pchar.quest.map_piece_Caesar.win_condition.l1 = "item";
			Pchar.quest.map_piece_Caesar.win_condition.l1.character = Pchar.id;
			Pchar.quest.map_piece_Caesar.win_condition.l1.item = "gpmap";
			Pchar.quest.map_piece_Caesar.win_condition = "map_piece_Caesar";
	*/
			LAi_QuestDelay("gpmap_check", 0.01);

			Locations[FindLocation("BB_sloop_wreck_cabin")].models.always.locators = "capsm_l_KR_map2";
			Locations[FindLocation("BB_sloop_wreck_cabin")].locators_radius.randitem.randitem1 = 1.0;	//enable map-piece
			Locations[FindLocation("BB_sloop_wreck_cabin")].locators_radius.box.box2 = 0.0001;

			Locations[FindLocation("BB_sloop_wreck_cabin")].image = "";
			DoQuestReloadToLocation("BB_sloop_wreck_cabin", "goto", "free", "gpmap_free");
		break;

		case "stuck_at_gpmap":
			//from itemlogic BB_sloop_wreck_cabin
			if(!LAi_IsFightMode(Pchar))
			{
				ChangeCharacterAddressGroup(Pchar, "BB_sloop_wreck_cabin", "goto", "free");
				LAi_LocationFightDisable(&Locations[FindLocation("BB_sloop_wreck_cabin")], true);
			}
			else LAi_QuestDelay("stuck_at_gpmap", 1.0);//loops until not fightmode
		break;

		case "gpmap_check":
			if(CheckCharacterItem(Pchar,"gpmap"))
			{
				PlaySound("INTERFACE\paper_small.wav");
				TakeItemFromCharacter(pchar, "gpmap");
			
				GiveItem2Character(Pchar, "mapBB2A");
			SetCurrentTime(11.00, 0);
				Pchar.Caesar_map = "picked_up";
				AddQuestRecord("Caesar", "9");

				if(!CheckCharacterItem(Pchar,"map")) {GiveItem2Character(Pchar, "map");}
				
				LAi_QuestDelay("closer_look", 1.0);

				if(CheckCharacterItem(Pchar,"mapBB1") && CheckCharacterItem(Pchar,"mapBB3T") && CheckCharacterItem(Pchar,"mapBB4C"))
				{
					if(CheckCharacterItem(Pchar,"mapBB2A") || CheckCharacterItem(Pchar,"mapBB2B"))
					{
						if(CheckCharacterItem(Pchar,"mapBB5A") || CheckCharacterItem(Pchar,"mapBB5B"))
						{
							ChangeCharacterAddressGroup(CharacterFromID("Defoe"), "Turks_old_fort", "quest", "defoe");
							LAi_SetSitType(CharacterFromID("Defoe"));
							Characters[GetCharacterIndex("Defoe")].dialog.CurrentNode  = "neutral";//if spoken to before the auto dialog starts
							locations[FindLocation("Turks_old_fort")].type = "silent_seashore";

							ChangeCharacterAddressGroup(CharacterFromID("gm_crew8"), "Turks_port", "rld", "loc0");
							Locations[FindLocation("Turks_port")].locators_radius.rld.loc0 = 3.0;

							pchar.quest.defoe_letter.win_condition.l1 = "locator";
							pchar.quest.defoe_letter.win_condition.l1.location = "Turks_port";
							pchar.quest.defoe_letter.win_condition.l1.locator_group = "rld";
							pchar.quest.defoe_letter.win_condition.l1.locator = "loc0";
							pchar.quest.defoe_letter.win_condition = "defoe_letter";

							pchar.quest.defoe_sit_down.win_condition.l1 = "locator";
							pchar.quest.defoe_sit_down.win_condition.l1.location = "Turks_old_fort";
							pchar.quest.defoe_sit_down.win_condition.l1.locator_group = "quest";
							pchar.quest.defoe_sit_down.win_condition.l1.locator = "defoe";
							pchar.quest.defoe_sit_down.win_condition = "defoe_sit_down";
						}
					}
				}
			}
			else
			{
				LAi_QuestDelay("gpmap_check", 0.5);	//loop check
			}
		break;
//pär Turks
		case "closer_look":
			//when mapBB2A (Caesar) or mapBB5A (Hands) found
			
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "closer_look";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "clean_up_map":
			//from examine mapBB2A
			//or restarted after blow map attempt

			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "clean_up_map";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "spoiled_map":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead1.wav");	//ohoh
			PlaySound("PEOPLE\grass_turn.wav");
			
			LAi_QuestDelay("spoiled_map_done", 1.0);
		break;

		case "spoiled_map_done":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "spoiled_map_done";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "spoiled_map_end":
			logit("VIDEO");
	//		PostVideoAndQuest("common\Blaze_mutiny_dead",1, "the_very_end2");
		break;

		case "cleaned_map":
			PlaySound("INTERFACE\paper.wav");
			if(GetAttribute(Pchar, "Hands_map") == "cleaning")
			{
				TakeItemFromCharacter(pchar, "mapBB5A");
				GiveItem2Character(Pchar, "mapBB5B");
				Pchar.Hands_map = "done";
			}
			else
			{
				TakeItemFromCharacter(pchar, "mapBB2A");
				GiveItem2Character(Pchar, "mapBB2B");
				Pchar.Caesar_map = "done";
			}

			LAi_QuestDelay("clean_up_map_done", 2.0);
		break;

		case "clean_up_map_done":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "clean_up_map_done";
			LAi_ActorSelfDialog(pchar, "");
		break;
		
		case "blow_map":
			Pchar.blow_map = "tried";
			LAi_QuestDelay("pchar_puh", 0.1);
			LAi_QuestDelay("pchar_puh", 0.1);
			LAi_QuestDelay("pchar_puh", 1.1);
			LAi_QuestDelay("pchar_puh", 1.1);

			LAi_QuestDelay("clean_up_map", 2.1);
		break;







//_________________________________________________________________________________________________________________
		
		case "start_Hands_Willemstad":
			//from book read (in items.c) or StartStoryline.c
			ChangeCharacterAddressGroup(CharacterFromID("WR_beggar1"), "Willemstad_port", "goto", "goto10");
			ChangeCharacterAddressGroup(CharacterFromID("WR_beggar2"), "Willemstad_port", "goto", "goto15");
			ChangeCharacterAddressGroup(CharacterFromID("WR_beggar3"), "Willemstad_port", "goto", "goto19");
			
			ChangeCharacterAddressGroup(CharacterFromID("WR_beggar4"), "Willemstad_town", "goto", "goto9");
			ChangeCharacterAddressGroup(CharacterFromID("WR_beggar5"), "Willemstad_town", "goto", "goto27");
			ChangeCharacterAddressGroup(CharacterFromID("WR_beggar6"), "Willemstad_town", "goto", "goto37");

			ChangeCharacterAddressGroup(CharacterFromID("WR_beggar7"), "Willemstad_town_3", "officers", "reload18_1");
			ChangeCharacterAddressGroup(CharacterFromID("WR_beggar8"), "Willemstad_town_3", "goto", "goto18");
		break;

		case "are_you_Hands":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "are_you_Hands";
			LAi_ActorSelfDialog(pchar, "");
		break; 

		case "are_you_Hands_yes_delay":
			LAi_QuestDelay("are_you_Hands_yes", 0.2);
		break; 

		case "are_you_Hands_yes":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "are_you_hands_yes";
			LAi_ActorSelfDialog(pchar, "");
		break;
		
		case "beggar_is_Hands_prepare":
			Characters[GetCharacterIndex("Hands")].name = TranslateString("","Israel");
			Characters[GetCharacterIndex("Hands")].lastname = TranslateString("","Hands");

			LAi_QuestDelay("beggar_is_Hands", 0.5);
		break;

		case "beggar_is_Hands":
			characters[GetCharacterIndex("Hands")].dialog.CurrentNode = "beggar_is_Hands";
			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorDialog(characterFromID("Hands"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hands"));
		break;
//pär hands shot
		case "Hands_shot_scene":
			float Php_CUR;
			Php_CUR = LAi_GetCharacterHP(Pchar);

			if(CheckAttribute(Pchar,"model"))
			{
				switch(Pchar.model)
				{
					case "Howard_Pyle_3":
						Pchar.Pyle_model = "3";	
					break;

					case "Howard_Pyle_4":
						Pchar.Pyle_model = "4";		
					break;

					case "Howard_Pyle_5":
						Pchar.Pyle_model = "5";		
					break;

					case "Howard_Pyle":
						Pchar.Pyle_model = "0";		
					break;
				}
			}

			SetModel(Pchar, "bb_Hands1", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);

			DeleteAttribute(characterFromID("Brthug1"), "items");
			
			if(CheckAttribute(Pchar, "items"))
			{
				makearef(ifrom, Pchar.items);
				Characters[GetCharacterIndex("Brthug1")].items = "";
				makearef(ito, Characters[GetCharacterIndex("Brthug1")].items);
				CopyAttributes(&ito, &ifrom);
				DeleteAttribute(Pchar, "items");
			}
		
			GiveItem2Character(Pchar, "bladeX4");
			GiveItem2Character(Pchar, "blade1");	
			EquipCharacterByItem(Pchar, "blade1");
			GiveItem2Character(Pchar, "pistol206");
			EquipCharacterByItem(Pchar, "pistol206");
			TakenItems(Pchar, "gunpowder", 6);
			TakenItems(Pchar, "pistolbullets", 6);

			pchar.old.name = "Israel";
			pchar.old.lastname = "Hands";
			pchar.name = TranslateString("","Israel");
			pchar.lastname = TranslateString("","Hands");

			SetModel(characterFromID("Teach"), "bb_Teach3", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
			ChangeCharacterAddressGroup(CharacterFromID("Teach"), "BB_QAR_cabinH", "sit", "sit1");
			//LAi_SetSitType(characterFromID("Teach"));
		LAi_SetStayType(characterFromID("Teach"));
			ChangeCharacterAddressGroup(CharacterFromID("Bonnet"), "BB_QAR_cabinH", "sit", "sit5");
			LAi_SetSitType(characterFromID("Bonnet"));
		
			RemoveCharacterEquip(characterFromID("Teach"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Teach"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Teach"), "items");
			GiveItem2Character(characterFromID("Teach"), "bladeX4");
			GiveItem2Character(characterFromID("Teach"), "bladep0");
			EquipCharacterbyItem(characterFromID("Teach"), "bladep0");
			GiveItem2Character(characterFromID("Teach"), "pistol0");
			EquipCharacterbyItem(characterFromID("Teach"), "pistol0");

			SetCurrentTime(21.00, 0);
			SetNextWind("N",30);

			LAi_SetPlayerType(pchar);

			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Clear";
			DoQuestReloadToLocation("BB_QAR_cabinH", "sit", "teach", "Hands_shot_scene1");
		break;

		case "Hands_shot_scene1":
			LAi_SetSitType(pchar);

		//	LAi_QuestDelay("Hands_shot_scene2", 4.0);
			LAi_QuestDelay("Hands_shot_sceneA", 2.0);
		break;
	//------------------------------------------------------------------------------------
		case "Hands_shot_sceneA":
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorDialog(characterFromID("Teach"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Teach"));
			Characters[GetCharacterIndex("Teach")].dialog.CurrentNode  = "babble_or_drink";
		break;

		case "Hands_shot_sceneB":
			PlaySound("PEOPLE\creak2.wav");
			ChangeCharacterAddressGroup(CharacterFromID("Teach"), "BB_QAR_cabinH", "sit", "sit1");
			LAi_SetSitType(characterFromID("Teach"));

			LAi_QuestDelay("Hands_shot_sceneC", 1.0);
		break;

		case "Hands_shot_sceneC":
			PlaySound("AMBIENT\TAVERN\Tavern_002.wav");
			PlaySound("AMBIENT\TAVERN\Tavern_002.wav");
			PlaySound("AMBIENT\TAVERN\Tavern_002.wav");

			LAi_QuestDelay("Hands_shot_scene2", 5.0);
		break;
	//------------------------------------------------------------------------------------
		case "Hands_shot_scene2":
			logit("PILOT");
			PlaySound("VOICE\ENGLISH\windem_drunk.wav");

			LAi_QuestDelay("Hands_shot_scene3", 5.0);
		break;

		case "Hands_shot_scene3":
			logit("EDWARD TEACH");
			PlaySound("VOICE\ENGLISH\gr_Teach7.wav");

			LAi_QuestDelay("Hands_shot_scene4", 4.0);
		break;

		case "Hands_shot_scene4":
			logit("MERCHANT");
			PlaySound("VOICE\ENGLISH\Poe_ok.wav");

			LAi_QuestDelay("Hands_shot_scene5", 2.5);	
		break;

		case "Hands_shot_scene5":
			logit("ISRAEL HANDS");
			PlaySound("VOICE\ENGLISH\Odel_otherwise.wav");

			LAi_QuestDelay("Hands_shot_scene6", 2.5);
		break;

		case "Hands_shot_scene6":
			logit("STEDE BONNET");
			PlaySound("VOICE\ENGLISH\Dave_Edna_4.wav");

			LAi_QuestDelay("Hands_shot_scene7", 3.0);
		break;

		case "Hands_shot_scene7":
			logit("EDWARD TEACH");
			PlaySound("VOICE\ENGLISH\gr_Teach4.wav");

			LAi_QuestDelay("Hands_shot_scene8", 4.0);
		break;

		case "Hands_shot_scene8":
			logit("MERCHANT");
			PlaySound("VOICE\ENGLISH\Poe_and.wav");

			LAi_QuestDelay("Hands_shot_scene9", 2.5);
		break;

		case "Hands_shot_scene9":
			logit("EDWARD TEACH");
			PlaySound("VOICE\ENGLISH\gr_Teach12.wav");

			LAi_QuestDelay("Hands_shot_scene10", 3.5);
		break;

		case "Hands_shot_scene10":
			logit("STEDE BONNET");
			PlaySound("VOICE\ENGLISH\Dave_Edna_2.wav");

			LAi_QuestDelay("Hands_shot_scene11", 5.0);
		break;

		case "Hands_shot_scene11":
			logit("ISRAEL HANDS");
			PlaySound("VOICE\ENGLISH\gr_Hands1.wav");

			LAi_QuestDelay("Hands_shot_scene12", 2.0);
		break;

		case "Hands_shot_scene12":
			logit("PILOT");
			PlaySound("VOICE\ENGLISH\Maynard_big_swindel.wav");

			LAi_QuestDelay("Hands_shot_scene13", 4.5);		
		break;

		case "Hands_shot_scene13":
			logit("EDWARD TEACH");
			PlaySound("VOICE\ENGLISH\pir_capR3.wav");

			LAi_QuestDelay("Hands_shot_scene14", 3.0);
			LAi_QuestDelay("Hands_shot_scene14", 3.5);
			LAi_QuestDelay("Hands_shot_scene15", 4.5);
		break;

		case "Hands_shot_scene14":
			PlaySound("OBJECTS\DUEL\reload1.wav");
		break;
	//______________________________________RELOAD SOUNDS__________________________________________________
		case "Hands_shot_scene15":
			PauseAllSounds();//stops music
			Locations[FindLocation("BB_QAR_cabinH")].type = "party";

			LAi_QuestDelay("Hands_shot_scene15_A", 0.5);	
			LAi_QuestDelay("Hands_shot_scene16", 1.5);
		break;

		case "Hands_shot_scene15_A":
			logit("ISRAEL HANDS");
			LAi_QuestDelay("pchar_ohoh", 0.001);
		break;

		case "Hands_shot_scene16":
			logit("MERCHANT");
			PlaySound("VOICE\ENGLISH\Poe_smoke.wav");
			PlaySound("PEOPLE\creak2.wav");
			LAi_SetActorType(characterFromID("QAR_guest_merchant"));
			ChangeCharacterAddressGroup(characterFromID("QAR_guest_merchant"),"BB_QAR_cabinH","goto","merch_stay");
			
			LAi_QuestDelay("Hands_shot_scene18", 2.0);
			LAi_QuestDelay("Hands_shot_scene19", 5.0);
		break;
	
		case "Hands_shot_scene18":
			LAi_ActorGoToLocator(characterFromID("QAR_guest_merchant"), "reload", "reload1_back", "Hands_shot_scene18_A", 6.0);
		break;

		case "Hands_shot_scene18_A":
			ChangeCharacterAddressGroup(characterFromID("QAR_guest_merchant"), "none", "", "");
			PlaySound("INTERFACE\closed_door.wav");
		break;

		case "Hands_shot_scene19":
			logit("PILOT");
			PlaySound("VOICE\ENGLISH\Maynard_steady_there.wav");

			LAi_QuestDelay("Hands_shot_scene20", 3.0);		
		break;

		case "Hands_shot_scene20":
			logit("EDWARD TEACH");
			PlaySound("VOICE\ENGLISH\pir_capR5.wav");

			LAi_QuestDelay("Hands_shot_scene21", 5.5);
		break;
	
		case "Hands_shot_scene21":
			logit("STEDE BONNET");
			PlaySound("VOICE\ENGLISH\Dave_Edna_3.wav");

			LAi_QuestDelay("Hands_shot_scene22", 2.5);
		break;

		case "Hands_shot_scene22":
			logit("EDWARD TEACH");
			PlaySound("VOICE\ENGLISH\pir_capR4.wav");

			LAi_QuestDelay("Hands_shot_scene23", 5.0);
		break;

		case "Hands_shot_scene23":
			LAi_SetStayType(characterFromID("Teach"));
			PlaySound("OBJECTS\DUEL\censer.wav");
			PlaySound("OBJECTS\DUEL\censer.wav");
			LAi_QuestDelay("pchar_puh", 0.01);
			LAi_QuestDelay("pchar_puh", 0.01);

			LAi_QuestDelay("Hands_shot_scene23_A", 0.35);
			LAi_QuestDelay("Hands_shot_scene24", 1.0);
		break;

		case "Hands_shot_scene23_A":
			LAi_SetSitType(characterFromID("Teach"));
		break;

		case "Hands_shot_scene24":
			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Clear";
			Locations[FindLocation("BB_QAR_cabinH")].models.always.l1 = "Cabin01_dark";
			Locations[FindLocation("BB_QAR_cabinH")].models.always.locators = "Cabin01_l_Q2H_2";
			SetNextWind("N",30);
			Locations[FindLocation("BB_QAR_cabinH")].type = "silent_cave_seashore";
			Locations[FindLocation("BB_QAR_cabinH")].image = "";			

			DoQuestReloadToLocation("BB_QAR_cabinH", "sit", "teach", "Hands_shot_scene26");
		break;
	//______________________________________LIGHTS OUT_____________________________________________________

		case "Hands_shot_scene26":
			logit("STEDE BONNET");
			PlaySound("VOICE\ENGLISH\Dave_Edna_5.wav");

			LAi_QuestDelay("Hands_shot_scene27", 4.0);
		break;

		case "Hands_shot_scene27":
			logit("PILOT");
			PlaySound("PEOPLE\creak2.wav");
			PlaySound("VOICE\ENGLISH\blaze_drunk2.wav");
			LAi_SetActorType(characterFromID("QAR_guest_pilot"));
			ChangeCharacterAddressGroup(characterFromID("QAR_guest_pilot"),"BB_QAR_cabinH","goto","pilot_stay");

			LAi_QuestDelay("Hands_shot_scene28", 2.0);
			LAi_QuestDelay("Hands_shot_scene28_B", 2.0);
			LAi_QuestDelay("Hands_shot_scene28_B", 3.0);
			LAi_QuestDelay("Hands_shot_scene28_B", 4.0);
			LAi_QuestDelay("Hands_shot_scene29", 5.0);		
		break;

		case "Hands_shot_scene28":
			LAi_ActorGoToLocator(characterFromID("QAR_guest_pilot"), "reload", "reload1_back", "Hands_shot_scene28_A", 6.0);
		break;

		case "Hands_shot_scene28_A":
			ChangeCharacterAddressGroup(characterFromID("QAR_guest_pilot"), "none", "", "");
			PlaySound("INTERFACE\closed_door.wav");
		break;

		case "Hands_shot_scene28_B":
			ChangeCharacterAddressGroup(Pchar,"BB_QAR_cabinH","sit","teach");	//reset Hands being pushed by the pilot
		break;

		case "Hands_shot_scene29":
			logit("ISRAEL HANDS");
			PlaySound("VOICE\ENGLISH\blaze_hah.wav");

			LAi_QuestDelay("Hands_shot_scene30", 2.5);
		break;

		case "Hands_shot_scene30":
			logit("EDWARD TEACH");
			PlaySound("VOICE\ENGLISH\pir_capR2.wav");

			LAi_QuestDelay("Hands_shot_scene31", 3.5);
		break;

		case "Hands_shot_scene31":
			GetCharacterPos(characterFromID("Teach"), &u, &v, &w);
			CreateParticleSystem("gunfire" , u+0.5, v+0.8, w, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("OBJECTS\DUEL\pistol_pocket2.wav");

			LAi_QuestDelay("Hands_shot_scene32", 1.0);
			LAi_QuestDelay("Hands_shot_scene_gunsmoke", 0.5);
		break;

		case "Hands_shot_scene_gunsmoke":
			GetCharacterPos(characterFromID("Teach"), &u, &v, &w);
			CreateParticleSystem("gunfire" , u+0.5, v+0.8, w, 0.0, 0.0, 0.0, sti(20) );
		break;

		case "Hands_shot_scene32":
			Locations[FindLocation("BB_QAR_cabinH")].models.always.chair4 = "chair4_fallen";

			DoQuestReloadToLocation("BB_QAR_cabinH", "sit", "teach", "Hands_shot_scene33");
		break;
	//______________________________________2 SHOTS________________________________________________________
		case "Hands_shot_scene33":
			PlaySound("OBJECTS\VOICES\body_fallen2.wav");

			GetCharacterPos(characterFromID("Teach"), &u, &v, &w);
			CreateParticleSystem("gunfire" , u+0.5, v+0.8, w, 0.0, 0.0, 0.0, sti(20) );

			LAi_SetStayType(characterFromID("Bonnet"));
			ChangeCharacterAddressGroup(characterFromID("Bonnet"),"BB_QAR_cabinH","goto","bonnet_stay");
			
			Php = LAi_GetCharacterHP(Pchar);
			Php2 = Php/2;
			LAi_ApplyCharacterDamage(Pchar, Php2);
			LAi_SetPoorType(Pchar);

			LAi_QuestDelay("Hands_shot_scene34", 1.0);
		break;

		case "Hands_shot_scene34":
			logit("ISRAEL HANDS");
			PlaySound("OBJECTS\VOICES\DEAD\male\dead6.wav");

			LAi_QuestDelay("Hands_shot_scene35", 2.5);
		break;

		case "Hands_shot_scene35":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "whats_the meaning";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Hands_shot_scene36":
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorDialog(characterFromID("Teach"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Teach"));
			Characters[GetCharacterIndex("Teach")].dialog.CurrentNode  = "I_shot_you";
		break;
	
		case "Hands_shot_scene37":
			logit("ISRAEL HANDS");
			PlaySound("VOICE\ENGLISH\Odel_yourself_again.wav");

			LAi_QuestDelay("Hands_shot_scene38", 3.5);
		break;

		case "Hands_shot_scene38":
			Php = LAi_GetCharacterHP(Pchar);
			Php2 = Php/2;
			LAi_ApplyCharacterDamage(Pchar, Php2);
			PlaySound("PEOPLE\jump.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorSetLayMode(Pchar);
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("stars_short" , u, v+1, w, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("Hands_shot_scene39", 2.0);
		break;

		case "Hands_shot_scene39":
			LAi_SetActorType(characterFromID("Bonnet"));
			LAi_ActorDialog(characterFromID("Bonnet"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Bonnet"));
			Characters[GetCharacterIndex("Bonnet")].dialog.CurrentNode  = "Passed_out";
		break;

		case "Hands_shot_scene40":
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorDialog(characterFromID("Teach"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Teach"));
			Characters[GetCharacterIndex("Teach")].dialog.CurrentNode  = "You_help_him";
		break;

		case "Hands_shot_scene41":
			LAi_SetActorType(characterFromID("Teach"));	
			LAi_ActorTurnToLocator(characterFromID("Teach"), "goto", "teach_door");

			LAi_QuestDelay("Hands_shot_scene41_A", 1.5);
		break;

		case "Hands_shot_scene41_A":
			PlaySound("PEOPLE\run_wood.wav");
			ChangeCharacterAddressGroup(characterFromID("Teach"),"BB_QAR_cabinH","goto","teach_door");

			LAi_QuestDelay("Hands_shot_scene42", 1.5);
		break;

		case "Hands_shot_scene42":
			PlaySound("INTERFACE\chart_move.wav");
			PlaySound("INTERFACE\chart_move.wav");

			LAi_QuestDelay("Hands_shot_scene43", 1.5);
		break;

		case "Hands_shot_scene43":
			PauseAllSounds();//stops music
			Locations[FindLocation("BB_QAR_cabinH")].type = "silent_seashore";
			PostEvent("LoadSceneSound", 0);
			PlaySound("PEOPLE\recoil.wav");
			ChangeCharacterAddressGroup(characterFromID("Teach"),"BB_QAR_cabinH","goto","teach_out");

			LAi_QuestDelay("Hands_shot_scene44", 1.5);
		break;

		case "Hands_shot_scene44":
			PlaySound("PEOPLE\run_wood.wav");
			ChangeCharacterAddressGroup(characterFromID("Teach"),"BB_QAR_cabinH","goto","teach_railing");
			LAi_SetActorType(characterFromID("Teach"));
			LAi_ActorTurnToLocator(characterFromID("Teach"), "ships_other", "ship_4");

			LAi_QuestDelay("Hands_shot_scene45", 1.5);
		break;

		case "Hands_shot_scene45":
			PlaySound("VOICE\ENGLISH\G_hey_now.wav");
			LAi_SetActorType(characterFromID("Bonnet"));
			LAi_ActorTurnToLocator(characterFromID("Bonnet"), "goto", "looting");

			LAi_QuestDelay("Hands_shot_scene45_A", 1.5);
		break;
	
		case "Hands_shot_scene45_A":
			LAi_SetActorType(characterFromID("Bonnet"));
			LAi_ActorGoToLocator(characterFromID("Bonnet"), "goto", "pilot_stay", "Hands_shot_scene46", 3.0);
		break;

		case "Hands_shot_scene46":
			PlaySound("PEOPLE\recoil.wav");
			ChangeCharacterAddressGroup(characterFromID("Bonnet"),"BB_QAR_cabinH","goto","looting");
			LAi_SetPoorType(characterFromID("Bonnet"));
			
			LAi_QuestDelay("Hands_shot_scene47_A", 2.0);
		break;

		case "Hands_shot_scene47_A":
			PlaySound("PEOPLE\clothes1.wav");
			
			LAi_QuestDelay("Hands_shot_scene47_B", 1.5);
		break;

		case "Hands_shot_scene47_B":
			PlaySound("INTERFACE\clock_small.wav");
			
			LAi_QuestDelay("Hands_shot_scene47_C", 3.0);
		break;

		case "Hands_shot_scene47_C":
			logit("A small clock that's something.");
			PlaySound("VOICE\ENGLISH\Dave_Edna_6.wav");
			
			LAi_QuestDelay("Hands_shot_scene48_A", 3.0);
		break;

		case "Hands_shot_scene48_A":
			PlaySound("PEOPLE\clothes1.wav");
			
			LAi_QuestDelay("Hands_shot_scene48_B", 1.5);
		break;

		case "Hands_shot_scene48_B":
			PlaySound("INTERFACE\coins8.wav");
			
			LAi_QuestDelay("Hands_shot_scene48_C", 2.5);
		break;

		case "Hands_shot_scene48_C":
			logit("A purse with a lot of coins - that's better!");
			PlaySound("VOICE\ENGLISH\G_good_work.wav");
			
			LAi_QuestDelay("Hands_shot_scene49_A", 1.5);
		break;

		case "Hands_shot_scene49_A":
			PlaySound("PEOPLE\clothes2.wav");
			
			LAi_QuestDelay("Hands_shot_scene49_B", 3.0);
		break;

		case "Hands_shot_scene49_B":
			PlaySound("INTERFACE\paper.wav");
			GiveItem2Character(characterFromID("Bonnet"), "pistolmap_Hgold");
			EquipCharacterbyItem(characterFromID("Bonnet"), "pistolmap_Hgold");
			
			LAi_QuestDelay("pchar_yah", 1.5);
			LAi_QuestDelay("Hands_shot_scene49_C", 1.5);
		break;

		case "Hands_shot_scene49_C":
			logit("I found his map!!!");

			LAi_QuestDelay("Hands_shot_scene50", 1.5);
		break;

		case "Hands_shot_scene50":
			LAi_SetStayType(characterFromID("Bonnet"));

			LAi_QuestDelay("Hands_shot_scene51", 1.5);
		break;

		case "Hands_shot_scene51":
			PlaySound("VOICE\ENGLISH\blaze_help.wav");
			logit("STEDE BONNET");
			LAi_SetActorType(characterFromID("Bonnet"));
			LAi_ActorTurnToLocator(characterFromID("Bonnet"), "reload", "reload1_back");
			
	//		LAi_QuestDelay("Hands_shot_scene52_A", 2.5);
			LAi_QuestDelay("Hands_shot_scene_over", 2.5);	//test skip surgeons
		break;

		case "Hands_shot_scene52_A":
			PlaySound("INTERFACE\knock2.wav");

			LAi_QuestDelay("Hands_shot_scene52_B", 1.5);
		break;

		case "Hands_shot_scene52_B":
			PlaySound("PEOPLE\counter_openclose.wav");

			LAi_QuestDelay("Hands_shot_scene53_A", 2.0);
		break;

		case "Hands_shot_scene53_A":
			logit("SURGEON MAJOR");
			PlaySound("VOICE\ENGLISH\Fre_m_c_011.wav");

			LAi_QuestDelay("Hands_shot_scene53_B", 3.0);
		break;

		case "Hands_shot_scene53_B":
			logit("STEDE BONNET");
			PlaySound("VOICE\ENGLISH\G_tell_you_what.wav");

			LAi_QuestDelay("Hands_shot_scene54_A", 2.0);
		break;

		case "Hands_shot_scene54_A":
			logit("SECOND SURGEON");
			PlaySound("VOICE\ENGLISH\Fre_m_a_001.wav");
			LAi_ActorTurnToLocator(characterFromID("Bonnet"), "goto", "S2");

			LAi_QuestDelay("Hands_shot_scene54_B", 2.5);
		break;

		case "Hands_shot_scene54_B":
			logit("STEDE BONNET");
			PlaySound("VOICE\ENGLISH\G_have_to_try.wav");

			LAi_QuestDelay("Hands_shot_scene55_A", 2.5);
		break;

		case "Hands_shot_scene55_A":
			logit("GUNSMITH OR THIRD SURGEON");
			PlaySound("VOICE\ENGLISH\Fre_m_b_020.wav");
			LAi_ActorTurnToLocator(characterFromID("Bonnet"), "goto", "S3");

			LAi_QuestDelay("Hands_shot_scene55_B", 3.5);
		break;

		case "Hands_shot_scene55_B":
			logit("STEDE BONNET");
			PlaySound("VOICE\ENGLISH\G_you_could.wav");

			LAi_QuestDelay("Hands_shot_scene56_A", 2.5);
		break;

		case "Hands_shot_scene56_A":
			logit("SURGEON'S AIDE");
			PlaySound("VOICE\ENGLISH\Dupin_help.wav");
			LAi_ActorTurnToLocator(characterFromID("Bonnet"), "goto", "S4");

			LAi_QuestDelay("Hands_shot_scene56_B", 1.5);
		break;

		case "Hands_shot_scene56_B":
			logit("STEDE BONNET");
			PlaySound("VOICE\ENGLISH\Herrick2.wav");

			LAi_QuestDelay("Hands_shot_scene_over", 3.5);	//was 2.5
		break;

		case "Hands_shot_scene_over":
			if(CheckAttribute(Pchar,"Pyle_model"))
			{
				switch(Pchar.Pyle_model)
				{
					case "3":
						SetModel(Pchar, "Howard_Pyle_3", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
					break;

					case "4":
						SetModel(Pchar, "Howard_Pyle_4", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);	
					break;

					case "5":
						SetModel(Pchar, "Howard_Pyle_5", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);		
					break;

					case "0":
						SetModel(Pchar, "Howard_Pyle", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);	
					break;
				}
			}

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			DeleteAttribute(Pchar, "items");
			
			if(CheckAttribute(characterFromID("Brthug1"), "items"))
			{
				makearef(ifrom, Characters[GetCharacterIndex("Brthug1")].items);
				Pchar.items = "";
				makearef(ito, Pchar.items);
				CopyAttributes(&ito, &ifrom);
				DeleteAttribute(Characters[GetCharacterIndex("Brthug1")], "items");
			}
		
			EquipCharacterByItem(pchar, FindCharacterItemByGroup(pchar, BLADE_ITEM_TYPE));
			EquipCharacterByItem(pchar, FindCharacterItemByGroup(pchar, GUN_ITEM_TYPE));

			LAi_SetHP(Pchar, Php_CUR, Php_CUR);
			LAi_SetPlayerType(Pchar);

			Pchar.old.name = "Howard";
			Pchar.old.lastname = "Pyle";
			Pchar.name = TranslateString("","Howard");
			Pchar.lastname = TranslateString("","Pyle");

			SetCurrentTime(12.00, 0);

			DoQuestReloadToLocation("Willemstad_town_3", "quest", "jrh1", "back_to_Wstad");
		break;

		case "back_to_Wstad":
			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorTurnToCharacter(characterFromID("Hands"), Pchar);

			LAi_QuestDelay("back_to_Wstad1", 2.0);
		break;

		case "back_to_Wstad1":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "Teach_saved_you";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "back_to_Wstad2":
			characters[GetCharacterIndex("Hands")].dialog.CurrentNode = "I_am_alive";
			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorDialog(characterFromID("Hands"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hands"));
		break;

		case "back_to_Wstad3":
			LAi_SetPlayerType(pchar);
			AddQuestRecord("Israel_Hands","4");
			
			AddPassenger(Pchar, characterFromID("Hands"), 0);
			SetOfficersIndex(Pchar, 1, getCharacterIndex("Hands"));
			LAi_SetOfficerType(characterFromID("Hands"));
			characters[GetCharacterIndex("Hands")].dialog.CurrentNode = "neutral";

			LAi_QuestDelay("pchar_lets_go", 1.0);
			LAi_QuestDelay("start_Maltains", 1.0);
		break;

//--------------------------------------------------------------------------------------------------------------
		case "start_Maltains":
			locations[FindLocation("Charlestown_port")].reload.l17.disable = 0;
			Locations[FindLocation("Charlestown_port")].reload.l17.close_for_day = 1;	//after info from Hands	

			ChangeCharacterAddressGroup(characterFromID("Thomas Modiford"), "none", "", "");	//governor gone
			ChangeCharacterAddressGroup(characterFromID("Anne_Russel"), "Charlestown_Residence", "goto", "goto6");
			ChangeCharacterAddressGroup(characterFromID("Maltese_soldier3"), "Charlestown_port", "quest", "quest2");
			ChangeCharacterAddressGroup(characterFromID("Maltese_soldier4"), "Charlestown_port", "quest", "quest3");

			Pchar.unlocked_cells = "0";
			Pchar.cell9 = "locked"; Pchar.cell7 = "locked"; Pchar.cell3 = "locked"; 
			Pchar.cell1 = "locked"; Pchar.cell17 = "locked"; Pchar.cell15 = "locked";
			Pchar.cell5 = "locked"; Pchar.cell19 = "locked"; Pchar.cell2 = "locked"; 
		
			pchar.quest.start_Maltains_dialog.win_condition.l1 = "locator";
			pchar.quest.start_Maltains_dialog.win_condition.l1.location = "bb_Maltains";
			pchar.quest.start_Maltains_dialog.win_condition.l1.locator_group = "quest";
			pchar.quest.start_Maltains_dialog.win_condition.l1.locator = "quest4";
			pchar.quest.start_Maltains_dialog.win_condition = "start_Maltains_dialog";
		break;

		case "start_Maltains_dialog":
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "quest", "quest2", "start_Maltains_dialog1", 2.0);
		break;

		case "start_Maltains_dialog1":
			LAi_SetActorType(characterFromID("Maltese_red1"));
			LAi_ActorDialog(characterFromID("Maltese_red1"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Maltese_red1"));
			Characters[GetCharacterIndex("Maltese_red1")].dialog.CurrentNode  = "start_mission";
		break;

		case "start_Maltains_dialog_done":
			Characters[GetCharacterIndex("Maltese_red1")].dialog.CurrentNode  = "got_all_books";
		break;

		//------------------------------------------------------------------------------

		case "Malta_items1":
			AddQuestRecord("Malta_items","1");
			Pchar.malta_items = 0;	

			LAi_QuestDelay("book63_check", 0.5);
			LAi_QuestDelay("book64_check", 0.5);
			LAi_QuestDelay("book65_check", 0.5);
			LAi_QuestDelay("book66_check", 0.5);
			LAi_QuestDelay("book67_check", 0.5);
			LAi_QuestDelay("book68_check", 0.5);
		break;

		case "book63_check":
			//med book in wine cellar
			if(CheckCharacterItem(Pchar,"book63"))
			{
				Pchar.malta_items = sti(Pchar.malta_items) + 1;
				PlaySound("INTERFACE\book_close.wav");

				LAi_QuestDelay("count_malta_items", 0.5);
			}
			else LAi_QuestDelay("book63_check", 0.5);//loop check
		break;

		case "book64_check":
			//french book on top of boxes
			if(CheckCharacterItem(Pchar,"book64"))
			{
				Pchar.malta_items = sti(Pchar.malta_items) + 1;
				PlaySound("INTERFACE\book_close.wav");

				LAi_QuestDelay("count_malta_items", 0.5);
			}
			else LAi_QuestDelay("book64_check", 0.5);//loop check
		break;

		case "book65_check":
			//bibble in counter
			if(CheckCharacterItem(Pchar,"book65"))
			{
				Pchar.malta_items = sti(Pchar.malta_items) + 1;
				PlaySound("INTERFACE\book_close.wav");

				LAi_QuestDelay("count_malta_items", 0.5);
			}
			else LAi_QuestDelay("book65_check", 0.5);//loop check
		break;

		case "book66_check":
			//pile of sheets in last cell
			if(CheckCharacterItem(Pchar,"book66"))
			{
				Pchar.malta_items = sti(Pchar.malta_items) + 1;
				PlaySound("INTERFACE\paper.wav");

				LAi_QuestDelay("count_malta_items", 0.5);
			}
			else LAi_QuestDelay("book66_check", 0.5);//loop check
		break;

		case "book67_check":
			//document under pillow in a cell
			if(CheckCharacterItem(Pchar,"book67"))
			{
				Pchar.malta_items = sti(Pchar.malta_items) + 1;
				PlaySound("INTERFACE\paper_small.wav");

				LAi_QuestDelay("count_malta_items", 0.5);
			}
			else LAi_QuestDelay("book67_check", 0.5);//loop check
		break;

		case "book68_check":
			//scroll in chapel
			if(CheckCharacterItem(Pchar,"book68"))
			{
				Pchar.malta_items = sti(Pchar.malta_items) + 1;
				PlaySound("INTERFACE\carpet_move.wav");

				LAi_QuestDelay("count_malta_items", 0.5);
			}
			else LAi_QuestDelay("book68_check", 0.5);//loop check
		break;


		case "count_malta_items":
			if(CheckAttribute(Pchar, "malta_items"))
			{
				switch (Pchar.malta_items)
				{
					case "1":
						Logit("I have got 1 Malta Document.");
						ChangeCharacterAddressGroup(characterFromID("Maltese_soldier7"), "bb_maltains", "goto", "goto2");

						LAi_QuestDelay("pchar_sigh", 1.0);
					break;

					case "2":
						Logit("I have got 2 Malta Documents.");
						ChangeCharacterAddressGroup(characterFromID("Maltese_red2"), "bb_maltains", "goto", "goto5");

						LAi_QuestDelay("pchar_puh", 1.0);
					break;

					case "3":
						Logit("I have got 3 Malta Documents.");
						ChangeCharacterAddressGroup(characterFromID("Maltese_green"), "bb_maltains", "goto", "goto12");

						LAi_QuestDelay("pchar_hah", 1.0);
					break;

					case "4":
						Logit("I have got 4 Malta Documents.");
						ChangeCharacterAddressGroup(characterFromID("Maltese_black"), "bb_maltains", "goto", "goto8");

						LAi_QuestDelay("pchar_mhm", 1.0);
					break;

					case "5":
						Logit("I have got 5 Malta Documents.");
						ChangeCharacterAddressGroup(characterFromID("Maltese_knight"), "bb_maltains", "goto", "goto16");

						LAi_QuestDelay("pchar_lets_go", 1.0);
					break;

					case "6":
						Logit("I have got all 6 Malta Documents!");
						AddQuestRecord("Malta_items","2");
						CloseQuestHeader("Malta_items");

						LAi_QuestDelay("6_malta_books", 1.0);
					break;
				}
			}
		break;	

		case "6_malta_books":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "6_malta_books";
			LAi_ActorSelfDialog(pchar, "");
		break;	

		//------------------------------------------------------------------------------

		case "reset_cells":
			PlaySound("INTERFACE\step_reset.wav");
			Pchar.unlocked_cells = "0";
			Pchar.cell9 = "locked"; Pchar.cell7 = "locked"; Pchar.cell3 = "locked"; 
			Pchar.cell1 = "locked"; Pchar.cell17 = "locked"; Pchar.cell15 = "locked";
			Pchar.cell5 = "locked"; Pchar.cell19 = "locked"; Pchar.cell2 = "locked"; 

			Pchar.cell17_blocked = "no"; Pchar.cell15_blocked = "no"; 
			Pchar.cell19_blocked = "no"; Pchar.cell2_blocked = "no";

			LAi_QuestDelay("reset_cells1", 2.0);
		break;

		case "reset_cells1":
			int wrong_cell = rand(4);
			switch (wrong_cell)
			{
				case 0:
					PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
				break;

				case 1:
					PlaySound("OBJECTS\VOICES\DEAD\male\dead5.wav");
				break;

				case 2:
					PlaySound("OBJECTS\DUEL\man_attack5.wav");
				break;

				case 3:
					PlaySound("OBJECTS\VOICES\DEAD\male\dead0.wav");
				break;

				case 4:
					PlaySound("OBJECTS\VOICES\DEAD\male\dead1.wav");
				break;
			}
		break;

		case "maltains_to_box8":
			PlaySound("PEOPLE\run_stone.wav");
			ChangeCharacterAddressGroup(Pchar, "bb_Maltains", "box", "box8");
		break;

		case "maltains_to_box10":
			PlaySound("PEOPLE\run_stone.wav");
			ChangeCharacterAddressGroup(Pchar, "bb_Maltains", "box", "box10");
		break;
		
		case "maltains_to_box14":
			PlaySound("PEOPLE\run_stone.wav");
			ChangeCharacterAddressGroup(Pchar, "bb_Maltains", "box", "box14");

			if(CheckCharacterItem(Pchar,"Malta_relic")) LAi_QuestDelay("maltains_sudden_death", 0.5);
		break;

		case "maltains_sudden_death":
			GetCharacterPos(Pchar, &u, &v, &w);		
			PlaySound("OBJECTS\DUEL\electricity.wav");
			PlaySound("NATURE\thunder1.wav");
			CreateParticleSystem("blast" , u, v+1.2, w, 0.0, 0.0, 0.0, sti(20) );	
			CreateParticleSystem("canfire2" , u, v+2.0, w, 5.1, v+1.2, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , u, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
			LAi_KillCharacter(Pchar);

			LAi_SetActorType(characterFromID("Maltese_red1"));
			LAi_ActorTurnToCharacter(characterFromID("Maltese_red1"), Pchar);

			LAi_QuestDelay("maltains_sudden_death1", 3.0);
		break;

		case "maltains_sudden_death1":
			PlaySound("VOICE\ENGLISH\Fre_m_b_054.wav");
		break;

		case "maltains_to_box26":
			PlaySound("PEOPLE\jump_stone.wav");
			ChangeCharacterAddressGroup(Pchar, "bb_Maltains", "box", "box26");

			LAi_QuestDelay("maltains_to_box26_1", 0.25);
		break;

		case "maltains_to_box26_1":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box27");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "maltains_to_box27":
			PlaySound("PEOPLE\jump_stone.wav");
			ChangeCharacterAddressGroup(Pchar, "bb_Maltains", "box", "box27");

			LAi_QuestDelay("pchar_playertype", 0.25);
		break;

		case "maltains_to_box28":
			PlaySound("OBJECTS\DUEL\man_attack1.wav");
			LAi_SetSitType(Pchar);
			
			LAi_QuestDelay("maltains_to_box28_1", 0.5);
		break;
		
		case "maltains_to_box28_1":
			PlaySound("PEOPLE\jump_stone.wav");
			ChangeCharacterAddressGroup(Pchar, "bb_Maltains", "box", "box28");

			LAi_QuestDelay("maltains_to_box28_2", 0.25);
		break;
		
		case "maltains_to_box28_2":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box29");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "maltains_turn_to_box30":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box30");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "maltains_to_box30":
			PlaySound("PEOPLE\jump_stone.wav");
			ChangeCharacterAddressGroup(Pchar, "bb_Maltains", "box", "box30");

			LAi_QuestDelay("maltains_to_box30_1", 0.25);
		break;

		case "maltains_to_box30_1":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "randitem", "randitem3");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "maltains_to_box32":
			PlaySound("PEOPLE\run_wood.wav");
			ChangeCharacterAddressGroup(Pchar, "bb_Maltains", "box", "box32");
		break;

		case "maltains_turn_to_quest3":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "quest", "quest3");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "maltains_turn_to_box9":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box9");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		//-------------------------------------------------------------------------------

		case "pillow_check":
			if(CheckCharacterItem(Pchar,"pillow"))
			{
				PlaySound("PEOPLE\clothes1.wav");
				TakeItemFromCharacter(pchar, "pillow");
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem2", 0.0001);
				Locations[FindLocation("bb_Maltains")].locators_radius.randitem.randitem2 = 0.0001;
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem4", 1.0);
				Locations[FindLocation("bb_Maltains")].locators_radius.randitem.randitem4 = 1.0;
			}
			else
			{
				LAi_QuestDelay("pillow_check", 0.5);//loop check
			}
		break;
	
		case "Deliver_6_malta_books":
			LAi_SetPlayerType(pchar);
		break;
		
		//-------------------------------------------------------------------------------
		
		case "maltains_bars_up":
			Locations[FindLocation("bb_maltains")].image = "";
			DoQuestReloadToLocation("bb_maltains", "box", "box34", "maltains_bars_up1");
		break;

		case "maltains_bars_up1":
			PlaySound("INTERFACE\girder_open.wav");
			Locations[FindLocation("bb_maltains")].image = "Inside_Maltains.tga";
		break;

		case "maltains_bars_down":
			Locations[FindLocation("bb_maltains")].image = "";
			DoQuestReloadToLocation("bb_maltains", "box", "box35", "maltains_bars_down1");
		break;

		case "maltains_bars_down1":
			PlaySound("INTERFACE\girder_close.wav");
			Locations[FindLocation("bb_maltains")].image = "Inside_Maltains.tga";
		break;

		case "got_all_books_done":
			DeleteQuestHeader("Malta_items");
			PlaySound("INTERFACE\took_item.wav");
			GiveItem2Character(Pchar, "key34");
			Characters[GetCharacterIndex("Maltese_red1")].dialog.CurrentNode  = "neutral_clerk";
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box21", 1.0);
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload2", 0.0001);
			Locations[FindLocation("bb_Maltains")].locators_radius.box.box21 = 1.0;
			Locations[FindLocation("bb_Maltains")].locators_radius.reload.reload2 = 0.0001;

			ChangeCharacterAddressGroup(characterFromID("Maltese_soldier7"), "bb_maltains_office", "reload", "locator2");
			ChangeCharacterAddressGroup(characterFromID("Maltese_red2"), "bb_maltains_office", "goto", "stay2");
			ChangeCharacterAddressGroup(characterFromID("Maltese_green"), "bb_maltains_office", "goto", "stay1");
			ChangeCharacterAddressGroup(characterFromID("Maltese_black"), "bb_maltains_office", "goto", "stay4");
			ChangeCharacterAddressGroup(characterFromID("Maltese_knight"), "bb_maltains_office", "goto", "stay3");
			LAi_SetStayType(characterFromID("Maltese_red2")); LAi_SetStayType(characterFromID("Maltese_green"));
			LAi_SetStayType(characterFromID("Maltese_black")); LAi_SetStayType(characterFromID("Maltese_knight"));
			LAi_SetStayType(characterFromID("Maltese_soldier7"));
		break;

		case "unlock_Malta_secret":
			//from SL_utils
			Locations[FindLocation("bb_Maltains")].locators_radius.box.box21 = 0.0001;
			Locations[FindLocation("bb_Maltains")].locators_radius.reload.reload2 = 1.0;
			
			TakenItems(Pchar, "key34", -1);
			Pchar.quest.malta_box21 = "off";
			
			DoQuestReloadToLocation("bb_maltains_office", "goto", "arrive", "unlock_Malta_secret1");
		break;

		case "unlock_Malta_secret1":
			PlaySound("INTERFACE\closed_door.wav");

			pchar.quest.final_Maltains_dialog.win_condition.l1 = "locator";
			pchar.quest.final_Maltains_dialog.win_condition.l1.location = "bb_Maltains_office";
			pchar.quest.final_Maltains_dialog.win_condition.l1.locator_group = "sit";
			pchar.quest.final_Maltains_dialog.win_condition.l1.locator = "sit3";
			pchar.quest.final_Maltains_dialog.win_condition = "final_Maltains_dialog";
		break;

		case "final_Maltains_dialog":
			PlaySound("VOICE\ENGLISH\Dupin_help.wav"); 
			LAi_SetActorType(pchar);	
			LAi_ActorTurnToLocator(Pchar, "goto", "stay2");

			LAi_SetActorType(characterFromID("Maltese_red2"));
			LAi_ActorTurnToCharacter(characterFromID("Maltese_red2"), Pchar);
			LAi_SetActorType(characterFromID("Maltese_green"));
			LAi_ActorTurnToCharacter(characterFromID("Maltese_green"), Pchar);
			LAi_SetActorType(characterFromID("Maltese_black"));
			LAi_ActorTurnToCharacter(characterFromID("Maltese_black"), Pchar);
			LAi_SetActorType(characterFromID("Maltese_knight"));
			LAi_ActorTurnToCharacter(characterFromID("Maltese_knight"), Pchar);

			LAi_QuestDelay("final_Maltains_dialog1", 1.5);
		break;

		case "final_Maltains_dialog1":
			PlaySound("VOICE\ENGLISH\pir_capKK.wav"); 
			LAi_SetActorType(pchar);	
			LAi_ActorTurnToLocator(Pchar, "goto", "stay1");

			LAi_QuestDelay("final_Maltains_dialog2", 2.5);
		break;
	
		case "final_Maltains_dialog2":
			LAi_SetActorType(characterFromID("Maltese_governor"));
			LAi_ActorDialog(characterFromID("Maltese_governor"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Maltese_governor"));
			Characters[GetCharacterIndex("Maltese_governor")].dialog.CurrentNode  = "prison_info";
		break;	

		case "prison_info_done":
			GiveItem2Character(Pchar, "doc61");
			AddQuestRecord("Israel_Hands","5");

			LAi_QuestDelay("prison_info_done0", 1.0);
		break;

		case "prison_info_done0":
			Characters[GetCharacterIndex("Maltese_governor")].dialog.CurrentNode  = "neutral_governor";

			PlaySound("VOICE\ENGLISH\pir_capLL.wav"); 
			LAi_SetActorType(pchar);	
			LAi_ActorTurnToLocator(Pchar, "goto", "stay4");

			LAi_QuestDelay("prison_info_done1", 2.0);
		break;

		case "prison_info_done1":
			PlaySound("VOICE\ENGLISH\gr_Richards.wav"); 
			LAi_SetActorType(pchar);	
			LAi_ActorTurnToLocator(Pchar, "goto", "stay3");

			LAi_QuestDelay("prison_info_done2", 1.0);
		break;

		case "prison_info_done2":
			LAi_SetActorType(pchar);	
			LAi_ActorTurnToLocator(Pchar, "reload", "locator2");

			LAi_QuestDelay("prison_info_done3", 1.0);
		break;

		case "prison_info_done3":
			PlaySound("INTERFACE\key_unlock.wav");
			Locations[FindLocation("bb_Maltains_office")].reload.l1.disable = 0;	//to store

			LAi_QuestDelay("prison_info_done4", 1.0);
		break;

		case "prison_info_done4":
			PlaySound("PEOPLE\recoil.wav");	
			ChangeCharacterAddressGroup(characterFromID("Maltese_soldier7"), "bb_maltains_office", "goto", "guard1");
			LAi_SetPlayerType(pchar);

			LAi_SetStayType(characterFromID("Maltese_red2"));
			LAi_SetStayType(characterFromID("Maltese_green"));
			LAi_SetStayType(characterFromID("Maltese_black"));
			LAi_SetStayType(characterFromID("Maltese_knight"));

			//this enables the prison tour
			locations[FindLocation("Antigua_port")].models.always.locators = "StJohns_locators_JRH";
			
			pchar.quest.prison_info_done5.win_condition.l1 = "location";
			pchar.quest.prison_info_done5.win_condition.l1.location = "Charlestown_store";
			pchar.quest.prison_info_done5.win_condition = "prison_info_done5";
		break;

		case "prison_info_done5":
			PlaySound("INTERFACE\key_lock.wav");

			//this enables the prison tour
			Locations[FindLocation("Antigua_fakefort1")].reload.l4.name = "reloadc1";
			Locations[FindLocation("Antigua_fakefort1")].reload.l4.go = "bb_prison_port";
			Locations[FindLocation("Antigua_fakefort1")].reload.l4.emerge = "reload2";
			locations[FindLocation("Antigua_port")].reload.l23.disable = 1;	//Antigua port to fort
			
			Pchar.quest.prison_pier = "phase0";
			Pchar.quest.prison_elevator = "down";
			Pchar.quest.prison_opening = "stairs";
			Pchar.quest.prison_opening2 = "prison";
			Pchar.prison2.water = "fast";
			Pchar.P2_ambush = "not_yet";
			SetLocatorRadius(locations[FindLocation("Antigua_port")], "reload", "reload7_back", 0.001);	//box6 instead first time
			Locations[FindLocation("Antigua_port")].locators_radius.reload.reload7_back = 0.001;

			LAi_QuestDelay("prison_alcove", 0.1);

			pchar.quest.bb_prison_opening.win_condition.l1 = "locator";
			pchar.quest.bb_prison_opening.win_condition.l1.location = "bb_prison2";
			pchar.quest.bb_prison_opening.win_condition.l1.locator_group = "goto";
			pchar.quest.bb_prison_opening.win_condition.l1.locator = "opening";
			pchar.quest.bb_prison_opening.win_condition = "bb_prison_opening";

			pchar.quest.bb_prison_opening2.win_condition.l1 = "locator";
			pchar.quest.bb_prison_opening2.win_condition.l1.location = "bb_prison2";
			pchar.quest.bb_prison_opening2.win_condition.l1.locator_group = "goto";
			pchar.quest.bb_prison_opening2.win_condition.l1.locator = "opening2";
			pchar.quest.bb_prison_opening2.win_condition = "bb_prison_opening2";
	
		break;

		case "neutral_clerk_repeat":
			Characters[GetCharacterIndex("Maltese_red1")].dialog.CurrentNode  = "neutral_clerk";
		break;

		case "neutral_governor_repeat":
			Characters[GetCharacterIndex("Maltese_governor")].dialog.CurrentNode  = "neutral_governor";
		break;
		
//malta end
//_________________________________________________________________________________________________________________
//prison start

		case "Antigua_fort":
			LAi_SetActorType(characterFromID("Antigua_guard1"));
			LAi_ActorDialog(characterFromID("Antigua_guard1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Antigua_guard1"));
			Characters[GetCharacterIndex("Antigua_guard1")].dialog.CurrentNode  = "halt";
		break;

		case "Antigua_fort1":
			LAi_SetActorType(characterFromID("Antigua_guard2"));
			LAi_ActorDialog(characterFromID("Antigua_guard2"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Antigua_guard2"));
			Characters[GetCharacterIndex("Antigua_guard2")].dialog.CurrentNode  = "pass";
		break;

		case "Antigua_fort2":
			PlaySound("INTERFACE\key_unlock2.wav");
			locations[FindLocation("Antigua_port")].reload.l23.disable = 0;	//Antigua port to fort
			LAi_SetStayType(characterFromID("Antigua_guard1"));
			Characters[GetCharacterIndex("Antigua_guard1")].dialog.CurrentNode  = "First time";
			LAi_SetStayType(characterFromID("Antigua_guard2"));
			Characters[GetCharacterIndex("Antigua_guard2")].dialog.CurrentNode  = "First time";

			LAi_QuestDelay("Antigua_fort3", 1.0);
		break;

		case "Antigua_fort3":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "quest", "look_gate");

			if(IsOfficer(CharacterFromID("Hands"))) 
			{
				RemoveOfficersIndex(pchar, GetCharacterIndex("Hands"));
				RemovePassenger(pchar, characterFromID("Hands"));
				Pchar.Hands_officer = "yes";
			}
			if(IsOfficer(CharacterFromID("Caesar")))  
			{
				RemoveOfficersIndex(pchar, GetCharacterIndex("Caesar"));
				RemovePassenger(pchar, characterFromID("Caesar"));
				Pchar.Caesar_officer = "yes";
			}

			LAi_QuestDelay("pchar_playertype", 1.0);
		break;

		case "arrive_prison_pier":
			ChangeCharacterAddressGroup(characterFromID("ferryman"), "bb_prison_port", "goto", "ferryman2");

			LAi_QuestDelay("turn_prison_port_guards", 0.1);

			pchar.quest.arrive_prison_pier1.win_condition.l1 = "locator";
			pchar.quest.arrive_prison_pier1.win_condition.l1.location = "bb_prison_port";
			pchar.quest.arrive_prison_pier1.win_condition.l1.locator_group = "goto";
			pchar.quest.arrive_prison_pier1.win_condition.l1.locator = "prison_entre";
			pchar.quest.arrive_prison_pier1.win_condition = "arrive_prison_pier1";

			pchar.quest.arrive_prison_pier2.win_condition.l1 = "locator";
			pchar.quest.arrive_prison_pier2.win_condition.l1.location = "bb_prison_port";
			pchar.quest.arrive_prison_pier2.win_condition.l1.locator_group = "reload";
			pchar.quest.arrive_prison_pier2.win_condition.l1.locator = "prison_door";
			pchar.quest.arrive_prison_pier2.win_condition = "arrive_prison_pier2";

			pchar.quest.prison_alcove.win_condition.l1 = "location";
			pchar.quest.prison_alcove.win_condition.l1.location = "bb_prison_alcove";
			pchar.quest.prison_alcove.win_condition = "prison_alcove";
		break;

		case "arrive_prison_pier1":
			LAi_QuestDelay("arrive_prison_pier1_A", 2.0);
		break;

		case "arrive_prison_pier1_A":
			if(CheckAttribute(Pchar, "quest.prison_pier") && Pchar.quest.prison_pier == "phase7")
			{
				LAi_SetActorType(Pchar);
				LAi_ActorTurnToLocator(Pchar, "reload", "prison_door");
					
				LAi_QuestDelay("prison_pier_phase6", 1.0);

				pchar.quest.pchar_playertype.win_condition.l1 = "location";
				pchar.quest.pchar_playertype.win_condition.l1.location = "bb_prison_elevator";
				pchar.quest.pchar_playertype.win_condition = "pchar_playertype";
			}

			if(CheckAttribute(Pchar, "quest.prison_pier") && Pchar.quest.prison_pier == "phase0")
			{
				//first time

				LAi_SetActorType(Pchar);
				LAi_ActorTurnToLocator(Pchar, "ships_other", "ship_2");

				LAi_QuestDelay("prison_pier_phase2", 1.0);
			}
		break;

		case "arrive_prison_pier2":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "see_door");

			pchar.quest.pchar_playertype.win_condition.l1 = "location";
			pchar.quest.pchar_playertype.win_condition.l1.location = "bb_prison_elevator";
			pchar.quest.pchar_playertype.win_condition = "pchar_playertype";	
		break;

		case "prison_pier_phase6":
			Pchar.quest.prison_pier = "phase6";
		break;

		case "prison_pier_phase5":
			Pchar.quest.prison_pier = "phase5";
		break;
	
		case "prison_pier_phase3":
			Pchar.quest.prison_pier = "phase4";
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
		break;

		case "prison_pier_phase2":
			Pchar.quest.prison_pier = "phase2";
		break;

		case "return_prison_pier":
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(characterFromID("ferryman"), "bb_prison_port", "goto", "ferryman1");
			LAi_SetStayType(characterFromID("ferryman")); 
		break;

		case "turn_prison_port_guards":
			LAi_SetActorType(characterFromID("ferryman")); 
			LAi_SetActorType(characterFromID("P2_guard_gate1")); 
			LAi_SetActorType(characterFromID("P2_guard_gate2"));
			LAi_ActorTurnToLocator(characterFromID("ferryman"), "goto", "turn1");
			LAi_ActorTurnToLocator(characterFromID("P2_guard_gate1"), "goto", "prison_entre");
			LAi_ActorTurnToLocator(characterFromID("P2_guard_gate2"), "goto", "prison_entre");
		break;
//---------------------------------------------------------------------------------------------------
		case "bb_prison_elevator_up":
			Pchar.quest.prison_elevator = "up";
			Locations[FindLocation("bb_prison_elevator")].reload.l2.disable = 0;
		break;

		case "bb_prison_elevator_down":
			Pchar.quest.prison_elevator = "down";
			Locations[FindLocation("bb_prison_elevator")].reload.l1.disable = 0;
		break;

		case "bb_prison_elevator_already_up":
			Logit(LanguageConvertString(tmpLangFileID,"The elevator is already up!"));
			PlaySound("VOICE\ENGLISH\blaze_hah.wav");
		break;

		case "bb_prison_elevator_already_down":
			Logit(LanguageConvertString(tmpLangFileID,"The elevator is already down!"));
			PlaySound("VOICE\ENGLISH\blaze_hah.wav");
		break;

//---------------------------------------------------------------------------------------------------
		case "prison_bridge_extra_turn":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "randitem", "randitem5");
		break;

		case "prison_bridge_start_turn":
			Pchar.quest.prison_bridge = "start";
			PlaySound("OBJECTS\VOICES\DEAD\male\dead1.wav");
		break;
	
		case "prison_bridge_end_turn":
			Pchar.quest.prison_bridge = "end";			
		break;
//---------------------------------------------------------------------------------------------------	
		case "swing_alcove_rope":
			PlaySound("PEOPLE\step_echo.wav");
			LAi_SetPlayerType(Pchar);
		break;

		case "prison_alcove":
			pchar.quest.alcove_box5.win_condition.l1 = "locator";
			pchar.quest.alcove_box5.win_condition.l1.location = "bb_prison_alcove";
			pchar.quest.alcove_box5.win_condition.l1.locator_group = "box";
			pchar.quest.alcove_box5.win_condition.l1.locator = "box5";
			pchar.quest.alcove_box5.win_condition = "alcove_box5";

			pchar.quest.alcove_stop1.win_condition.l1 = "locator";
			pchar.quest.alcove_stop1.win_condition.l1.location = "bb_prison_alcove";
			pchar.quest.alcove_stop1.win_condition.l1.locator_group = "goto";
			pchar.quest.alcove_stop1.win_condition.l1.locator = "stop1";
			pchar.quest.alcove_stop1.win_condition = "alcove_stop1";

			pchar.quest.alcove_stop2.win_condition.l1 = "locator";
			pchar.quest.alcove_stop2.win_condition.l1.location = "bb_prison_alcove";
			pchar.quest.alcove_stop2.win_condition.l1.locator_group = "goto";
			pchar.quest.alcove_stop2.win_condition.l1.locator = "stop2";
			pchar.quest.alcove_stop2.win_condition = "alcove_stop2";

			pchar.quest.alcove_stop3.win_condition.l1 = "locator";
			pchar.quest.alcove_stop3.win_condition.l1.location = "bb_prison_alcove";
			pchar.quest.alcove_stop3.win_condition.l1.locator_group = "goto";
			pchar.quest.alcove_stop3.win_condition.l1.locator = "stop3";
			pchar.quest.alcove_stop3.win_condition = "alcove_stop3";

			pchar.quest.alcove_stop4.win_condition.l1 = "locator";
			pchar.quest.alcove_stop4.win_condition.l1.location = "bb_prison_alcove";
			pchar.quest.alcove_stop4.win_condition.l1.locator_group = "goto";
			pchar.quest.alcove_stop4.win_condition.l1.locator = "stop4";
			pchar.quest.alcove_stop4.win_condition = "alcove_stop4";

			pchar.quest.alcove_stop5.win_condition.l1 = "locator";
			pchar.quest.alcove_stop5.win_condition.l1.location = "bb_prison_alcove";
			pchar.quest.alcove_stop5.win_condition.l1.locator_group = "goto";
			pchar.quest.alcove_stop5.win_condition.l1.locator = "stop5";
			pchar.quest.alcove_stop5.win_condition = "alcove_stop5";

			pchar.quest.alcove_stop6.win_condition.l1 = "locator";
			pchar.quest.alcove_stop6.win_condition.l1.location = "bb_prison_alcove";
			pchar.quest.alcove_stop6.win_condition.l1.locator_group = "goto";
			pchar.quest.alcove_stop6.win_condition.l1.locator = "stop6";
			pchar.quest.alcove_stop6.win_condition = "alcove_stop6";
		break;

		case "alcove_box5":
			LAi_SetStayType(Pchar);
		break;

		case "alcove_box6":
			LAi_SetStayType(Pchar);
		break;

		case "alcove_box5_jump":
			//from SL_utils

			PlaySound("PEOPLE\step_echo2.wav");

			LAi_QuestDelay("pchar_playertype", 0.5);

			pchar.quest.alcove_box6.win_condition.l1 = "locator";
			pchar.quest.alcove_box6.win_condition.l1.location = "bb_prison_alcove";
			pchar.quest.alcove_box6.win_condition.l1.locator_group = "box";
			pchar.quest.alcove_box6.win_condition.l1.locator = "box6";
			pchar.quest.alcove_box6.win_condition = "alcove_box6";
		break;

		case "alcove_box6_jump":
			//from SL_utils

			PlaySound("PEOPLE\step_echo2.wav");

			LAi_QuestDelay("pchar_playertype", 0.5);

			pchar.quest.alcove_box5.win_condition.l1 = "locator";
			pchar.quest.alcove_box5.win_condition.l1.location = "bb_prison_alcove";
			pchar.quest.alcove_box5.win_condition.l1.locator_group = "box";
			pchar.quest.alcove_box5.win_condition.l1.locator = "box5";
			pchar.quest.alcove_box5.win_condition = "alcove_box5";
		break;
//---------------------------------------------------------------------------------------------------	
		case "alcove_stop1":
			LAi_SetStayType(Pchar);
			Logit(LanguageConvertString(tmpLangFileID,"West crescent"));
			PlaySound("INTERFACE\locked_window.wav");
			ChangeCharacterAddressGroup(Pchar, "bb_prison_alcove", "goto", "back1");

			LAi_QuestDelay("alcove_stop1_1", 0.5);
		break;

		case "alcove_stop1_1":
			LAi_SetPlayerType(Pchar);

			pchar.quest.alcove_stop1.win_condition.l1 = "locator";
			pchar.quest.alcove_stop1.win_condition.l1.location = "bb_prison_alcove";
			pchar.quest.alcove_stop1.win_condition.l1.locator_group = "goto";
			pchar.quest.alcove_stop1.win_condition.l1.locator = "stop1";
			pchar.quest.alcove_stop1.win_condition = "alcove_stop1";
		break;

		case "alcove_stop2":
			LAi_SetStayType(Pchar);
			Logit(LanguageConvertString(tmpLangFileID,"East crescent"));
			PlaySound("INTERFACE\locked_window.wav");
			ChangeCharacterAddressGroup(Pchar, "bb_prison_alcove", "goto", "back2");

			LAi_QuestDelay("alcove_stop2_1", 0.5);
		break;

		case "alcove_stop2_1":
			LAi_SetPlayerType(Pchar);

			pchar.quest.alcove_stop2.win_condition.l1 = "locator";
			pchar.quest.alcove_stop2.win_condition.l1.location = "bb_prison_alcove";
			pchar.quest.alcove_stop2.win_condition.l1.locator_group = "goto";
			pchar.quest.alcove_stop2.win_condition.l1.locator = "stop2";
			pchar.quest.alcove_stop2.win_condition = "alcove_stop2";
		break;

		case "alcove_stop3":
			LAi_SetStayType(Pchar);
			Logit(LanguageConvertString(tmpLangFileID,"Rotunda middle levels"));
			PlaySound("INTERFACE\locked_window.wav");
			ChangeCharacterAddressGroup(Pchar, "bb_prison_alcove", "goto", "back3");

			LAi_QuestDelay("alcove_stop3_1", 0.5);
		break;

		case "alcove_stop3_1":
			LAi_SetPlayerType(Pchar);

			pchar.quest.alcove_stop3.win_condition.l1 = "locator";
			pchar.quest.alcove_stop3.win_condition.l1.location = "bb_prison_alcove";
			pchar.quest.alcove_stop3.win_condition.l1.locator_group = "goto";
			pchar.quest.alcove_stop3.win_condition.l1.locator = "stop3";
			pchar.quest.alcove_stop3.win_condition = "alcove_stop3";
		break;

		case "alcove_stop4":
			LAi_SetStayType(Pchar);
			Logit(LanguageConvertString(tmpLangFileID,"Rotunda upper levels"));
			PlaySound("INTERFACE\locked_window.wav");
			ChangeCharacterAddressGroup(Pchar, "bb_prison_alcove", "goto", "back4");

			LAi_QuestDelay("alcove_stop4_1", 0.5);
		break;

		case "alcove_stop4_1":
			LAi_SetPlayerType(Pchar);

			pchar.quest.alcove_stop4.win_condition.l1 = "locator";
			pchar.quest.alcove_stop4.win_condition.l1.location = "bb_prison_alcove";
			pchar.quest.alcove_stop4.win_condition.l1.locator_group = "goto";
			pchar.quest.alcove_stop4.win_condition.l1.locator = "stop4";
			pchar.quest.alcove_stop4.win_condition = "alcove_stop4";
		break;

		case "alcove_stop5":
			LAi_SetStayType(Pchar);
			Logit(LanguageConvertString(tmpLangFileID,"West wing"));
			PlaySound("INTERFACE\locked_window.wav");
			ChangeCharacterAddressGroup(Pchar, "bb_prison_alcove", "goto", "back5");

			LAi_QuestDelay("alcove_stop5_1", 0.5);
		break;

		case "alcove_stop5_1":
			LAi_SetPlayerType(Pchar);

			pchar.quest.alcove_stop5.win_condition.l1 = "locator";
			pchar.quest.alcove_stop5.win_condition.l1.location = "bb_prison_alcove";
			pchar.quest.alcove_stop5.win_condition.l1.locator_group = "goto";
			pchar.quest.alcove_stop5.win_condition.l1.locator = "stop5";
			pchar.quest.alcove_stop5.win_condition = "alcove_stop5";
		break;

		case "alcove_stop6":
			LAi_SetStayType(Pchar);
			Logit(LanguageConvertString(tmpLangFileID,"East wing"));
			PlaySound("INTERFACE\locked_window.wav");
			ChangeCharacterAddressGroup(Pchar, "bb_prison_alcove", "goto", "back6");

			LAi_QuestDelay("alcove_stop6_1", 0.5);
		break;

		case "alcove_stop6_1":
			LAi_SetPlayerType(Pchar);

			pchar.quest.alcove_stop6.win_condition.l1 = "locator";
			pchar.quest.alcove_stop6.win_condition.l1.location = "bb_prison_alcove";
			pchar.quest.alcove_stop6.win_condition.l1.locator_group = "goto";
			pchar.quest.alcove_stop6.win_condition.l1.locator = "stop6";
			pchar.quest.alcove_stop6.win_condition = "alcove_stop6";
		break;
//---------------------------------------------------------------------------------------------------	
//JRH alcove
		case "place_alcove_rope":
			Locations[FindLocation("bb_prison_alcove")].image = "";
			DoQuestReloadToLocation("bb_prison_alcove", "goto", "rope", "place_alcove_rope1");
		break;

		case "place_alcove_rope1":
			LAi_SetFightMode(Pchar, false);
			Pchar.alcove.rope = "at_gibbet";
			Locations[FindLocation("BB_prison_alcove")].image = "wr_prison_alcove.tga";

			LAi_QuestDelay("pick_up_alcove_boom", 0.1);
		break;

		case "pick_up_alcove_boom":
			if(CheckCharacterItem(Pchar,"boom_item"))
			{
				TakeItemFromCharacter(pchar, "boom_item");
				GiveItem2Character(Pchar, "bladeboom");
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladeboom");
			}
			else
			{
				LAi_QuestDelay("pick_up_alcove_boom", 0.5);//loop check
			}
		break;

		case "push_alcove_crate":
			PlaySound("OBJECTS\DUEL\sword_broken.wav");
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladeboom");
			EquipCharacterByItem(Pchar, "bladeX4");

			LAi_QuestDelay("push_alcove_crate1", 0.5);
		break;

		case "push_alcove_crate1":
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box1", 0.7);
			Locations[FindLocation("BB_prison_alcove")].locators_radius.box.box1 = 0.7;
			Locations[FindLocation(Pchar.location)].models.always.locators = "Alcove_l_JRH2";	//crate down

			Locations[FindLocation("bb_prison_alcove")].image = "";
			DoQuestReloadToLocation("bb_prison_alcove", "goto", "crate", "push_alcove_crate2");
		break;

		case "push_alcove_crate2":
			PlaySound("PEOPLE\derrick_fall.wav");
			LAi_SetFightMode(Pchar, false);
			LAi_SetStayType(Pchar);
			Pchar.alcove.crate = "fallen_down";
			Locations[FindLocation("BB_prison_alcove")].image = "wr_prison_alcove.tga";
		break;

		case "unlock_bb_prison":
			TakeItemFromCharacter(pchar, "key3");
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box8", 0.001);
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload2", 1.0);

			Locations[FindLocation("BB_prison_alcove")].locators_radius.box.box8 = 0.001;
			Locations[FindLocation("BB_prison_alcove")].locators_radius.reload.reload2 = 1.0;
	
			DoQuestReloadToLocation("bb_prison_stairs1", "reload", "reload1", "arrive_bb_prison_stairs1");
		break;

		case "arrive_bb_prison_stairs1":
			pchar.quest.arrive_bb_prison.win_condition.l1 = "location";
			pchar.quest.arrive_bb_prison.win_condition.l1.location = "bb_prison";
			pchar.quest.arrive_bb_prison.win_condition = "arrive_bb_prison";
		break;

		case "arrive_bb_prison":
			PlaySound("INTERFACE\closed_locked_door.wav");
			Locations[FindLocation("BB_prison_port")].image = "wr_prison_port.tga";

			LAi_QuestDelay("pchar_ohoh", 2.0);

			pchar.quest.bb_prison_alarm.win_condition.l1 = "locator";
			pchar.quest.bb_prison_alarm.win_condition.l1.location = "bb_prison";
			pchar.quest.bb_prison_alarm.win_condition.l1.locator_group = "quest";
			pchar.quest.bb_prison_alarm.win_condition.l1.locator = "alarm";
			pchar.quest.bb_prison_alarm.win_condition = "bb_prison_alarm";
		break;

		case "prisoner1_stay": LAi_SetStayType(characterFromID("bb_prisoner1")); break;
		case "prisoner2_stay": LAi_SetStayType(characterFromID("bb_prisoner2")); break;
		case "prisoner3_stay": LAi_SetStayType(characterFromID("bb_prisoner3")); break;
		case "prisoner4_stay": LAi_SetStayType(characterFromID("bb_prisoner4")); break;
		case "prisoner5_stay": LAi_SetStayType(characterFromID("bb_prisoner5")); break;
		case "prisoner6_stay": LAi_SetStayType(characterFromID("bb_prisoner6")); break;
		case "prisoner7_stay": LAi_SetStayType(characterFromID("bb_prisoner7")); break;
		case "prisoner8_stay": LAi_SetStayType(characterFromID("bb_prisoner8")); break;
		case "prisoner9_stay": LAi_SetStayType(characterFromID("bb_prisoner9")); break;
		case "prisoner10_stay": LAi_SetStayType(characterFromID("bb_prisoner10")); break;
	//------------------------------------------------------------------------------------------------------------
		case "bb_prison_alarm":
			DoQuickSave();
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(characterFromID("wr_voy"), "bb_prison", "quest", "dover");
			LAi_SetImmortal(CharacterFromID("wr_voy"), false);
			RemoveCharacterEquip(characterFromID("wr_voy"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("wr_voy"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("wr_voy"), "items");
			AddMoneyToCharacter(characterFromID("wr_voy"),-10000);
			GiveItem2Character(characterFromID("wr_voy"), "bladeA4");
			EquipCharacterByItem(characterFromID("wr_voy"), "bladeA4");
			GiveItem2Character(characterFromID("wr_voy"), "doctortoolkit");
			TakenItems(characterFromID("wr_voy"), "cognac", 2);
			
			LAi_QuestDelay("bb_prison_alarm0", 0.5);
		break;
		
		case "bb_prison_alarm0":
			PlaySound("VOICE\ENGLISH\alarm1.wav");
			LAi_SetStayType(Pchar);

			if(CheckAttribute(Pchar, "killed_wr_officers"))
			{
				switch(Pchar.killed_wr_officers)
				{
					case "0":
						GiveItem2Character(characterFromID("wr_voy"), "pistol203");
						EquipCharacterByItem(characterFromID("wr_voy"), "pistol203");
						GiveItem2Character(characterFromID("wr_voy"), "ammobag1");
						TakenItems(characterFromID("wr_voy"), "gunpowder", 2);
						TakenItems(characterFromID("wr_voy"), "pistolbullets", 2);

						LAi_QuestDelay("Dover_items0_check", 0.1);
					break;

					case "1":
						GiveItem2Character(characterFromID("wr_voy"), "pistol201");
						GiveItem2Character(characterFromID("wr_voy"), "pistol204");
						EquipCharacterByItem(characterFromID("wr_voy"), "pistol201");
						TakenItems(characterFromID("wr_voy"), "gunpowder", 2);
						TakenItems(characterFromID("wr_voy"), "pistolbullets", 2);

						LAi_QuestDelay("Dover_items1_check", 0.1);
					break;

					case "2":
						GiveItem2Character(characterFromID("wr_voy"), "pistol205");
						GiveItem2Character(characterFromID("wr_voy"), "pistol202");
						EquipCharacterByItem(characterFromID("wr_voy"), "pistol205");
						TakenItems(characterFromID("wr_voy"), "gunpowder", 2);
						TakenItems(characterFromID("wr_voy"), "pistolbullets", 2);

						LAi_QuestDelay("Dover_items2_check", 0.1);
					break;

					case "3":
						GiveItem2Character(characterFromID("wr_voy"), "pistol206");
						GiveItem2Character(characterFromID("wr_voy"), "pistolbelt");
						EquipCharacterByItem(characterFromID("wr_voy"), "pistol206");
						TakenItems(characterFromID("wr_voy"), "gunpowder", 2);
						TakenItems(characterFromID("wr_voy"), "pistolbullets", 2);

						LAi_QuestDelay("Dover_items3_check", 0.1);
					break;
				}
			}

			LAi_QuestDelay("bb_prison_alarm1", 1.5);
		break;

		case "bb_prison_alarm1":
			LAi_QuestDelay("pchar_huh", 0.1);
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box15");
			LAi_SetActorType(CharacterFromID("wr_voy"));
			LAi_ActorAttack(CharacterFromID("wr_voy"), Pchar, "");
	
		//ev Dovers crewmembers dead check too
			Pchar.quest.Dover_dead.win_condition.l1 = "NPC_Death";
			Pchar.quest.Dover_dead.win_condition.l1.character = "wr_voy";
			Pchar.quest.Dover_dead.win_condition = "Dover_dead";

			LAi_QuestDelay("bb_prison_alarm2", 1.0);
		break;

		case "bb_prison_alarm2":
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(Pchar, true);
			PlaySound("VOICE\ENGLISH\Eng_m_a_056.wav");
			ChangeCharacterAddressGroup(characterFromID("bb_prison_officer"), "bb_prison", "quest", "officer");
			LAi_SetActorType(characterFromID("bb_prison_officer"));

			LAi_QuestDelay("bb_prison_alarm3", 2.0);
		break;

		case "bb_prison_alarm3":
			PlaySound("AMBIENT\c_brothers_long.wav");
			ChangeCharacterAddressGroup(characterFromID("bb_prisoner1"), "bb_prison", "box", "box22");
			ChangeCharacterAddressGroup(characterFromID("bb_prisoner4"), "bb_prison", "box", "box11");
			ChangeCharacterAddressGroup(characterFromID("bb_prisoner5"), "bb_prison", "box", "box10");
			ChangeCharacterAddressGroup(characterFromID("bb_prisoner6"), "bb_prison", "box", "box9");
			ChangeCharacterAddressGroup(characterFromID("bb_prisoner7"), "bb_prison", "box", "box8");
			ChangeCharacterAddressGroup(characterFromID("bb_prisoner8"), "bb_prison", "box", "box12");
			ChangeCharacterAddressGroup(characterFromID("bb_prisoner9"), "bb_prison", "box", "box13");
		break;

		case "Dover_dead":
			PauseAllSounds();//stops music
			PlaySound("AMBIENT\pirate_captains.wav");
			PostEvent("LoadSceneSound", 0);

			Pchar.killed_wr_officers = sti(Pchar.killed_wr_officers) + 1;

			Pchar.quest.remove_Dover_corpse.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.remove_Dover_corpse.win_condition.l1.location = "bb_prison";
			Pchar.quest.remove_Dover_corpse.win_condition = "remove_Dover_corpse";
		break;

		case "remove_Dover_corpse":
			ChangeCharacterAddressGroup(characterFromID("wr_voy"), "none", "", "");
		break;

		case "Dover_items0_check":
			cog = GetCharacterItem(Pchar, "cognac");

			if(CheckCharacterItem(Pchar,"pistol203") && CheckCharacterItem(Pchar,"ammobag1") && cog >= 2)
			{
				LAi_QuestDelay("Dover_looted", 0.1);
			}
			else LAi_QuestDelay("Dover_items0_check", 0.5);//loop check
		break;

		case "Dover_items1_check":
			cog = GetCharacterItem(Pchar, "cognac");

			if(CheckCharacterItem(Pchar,"pistol201") && CheckCharacterItem(Pchar,"pistol204") && cog >= 2)
			{
				LAi_QuestDelay("Dover_looted", 0.1);
			}
			else LAi_QuestDelay("Dover_items1_check", 0.5);//loop check
		break;

		case "Dover_items2_check":
			cog = GetCharacterItem(Pchar, "cognac");

			if(CheckCharacterItem(Pchar,"pistol205") && CheckCharacterItem(Pchar,"pistol202") && cog >= 2)
			{
				LAi_QuestDelay("Dover_looted", 0.1);
			}
			else LAi_QuestDelay("Dover_items2_check", 0.5);//loop check
		break;

		case "Dover_items3_check":
			cog = GetCharacterItem(Pchar, "cognac");

			if(CheckCharacterItem(Pchar,"pistol206") && CheckCharacterItem(Pchar,"pistolbelt") && cog >= 2)
			{
				LAi_QuestDelay("Dover_looted", 0.1);
			}
			else LAi_QuestDelay("Dover_items3_check", 0.5);//loop check
		break;

		case "Dover_looted":
			ChangeCharacterAddressGroup(characterFromID("bb_prison_officer"), "bb_prison", "sit", "sit1");
			LAi_SetSitType(characterFromID("bb_prison_officer"));
			Pchar.Dover.looted = "yes";

			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			if(CheckCharacterItem(Pchar,"bladeA4"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladeA4");
			}
			if(CheckCharacterItem(Pchar,"pistol203")) {EquipCharacterByItem(Pchar, "pistol203");}
			if(CheckCharacterItem(Pchar,"pistol204")) {EquipCharacterByItem(Pchar, "pistol204");}
			if(CheckCharacterItem(Pchar,"pistol205")) {EquipCharacterByItem(Pchar, "pistol205");}
			if(CheckCharacterItem(Pchar,"pistol206")) {EquipCharacterByItem(Pchar, "pistol206");}
			
			pchar.quest.bb_prison_stop.win_condition.l1 = "locator";
			pchar.quest.bb_prison_stop.win_condition.l1.location = "bb_prison";
			pchar.quest.bb_prison_stop.win_condition.l1.locator_group = "quest";
			pchar.quest.bb_prison_stop.win_condition.l1.locator = "stop";
			pchar.quest.bb_prison_stop.win_condition = "bb_prison_stop";
		break;
	//------------------------------------------------------------------------------------------------------------
		case "bb_prison_stop":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead0.wav");

			Characters[GetCharacterIndex("bb_prison_officer")].dialog.CurrentNode  = "bb_prison_stop";
			LAi_SetActorType(characterFromID("bb_prison_officer"));
			LAi_ActorDialogNow(characterFromID("bb_prison_officer"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("bb_prison_officer"));
		break;

		case "bb_prison_stop1":
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "quest", "document", "bb_prison_stop2", 2.0);
		break;

		case "bb_prison_stop2":
			TakeItemFromCharacter(pchar, "doc61");
			PlaySound("INTERFACE\paper.wav");
			ChangeCharacterAddressGroup(Pchar, "bb_prison", "quest", "document");

			LAi_QuestDelay("bb_prison_stop3", 3.0);
		break;

		case "bb_prison_stop3":
			Characters[GetCharacterIndex("bb_prison_officer")].dialog.CurrentNode  = "bb_prison_stop3";
			LAi_SetActorType(characterFromID("bb_prison_officer"));
			LAi_ActorDialogNow(characterFromID("bb_prison_officer"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("bb_prison_officer"));
		break;

		case "bb_prison_stop7":
			Locations[FindLocation("bb_prison")].reload.l1.disable = 0;

			LAi_SetSitType(characterFromID("bb_prison_officer"));
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
			LAi_SetPlayerType(Pchar);
			Characters[GetCharacterIndex("bb_prison_officer")].dialog.CurrentNode  = "First time";

			LAi_QuestDelay("prison2_tools3_check", 0.5);
		break;
//---------------------------------------------------------------------------------------------------	


		case "prison2_tools3_check":
			if(CheckCharacterItem(Pchar,"bladesaw") || CheckCharacterItem(Pchar,"bladeaxe4") || CheckCharacterItem(Pchar,"bladehammer"))
			{
				if( LAi_IsDead(characterFromID("P2_guard1")) && LAi_IsDead(characterFromID("P2_guard2"))   
				&& LAi_IsDead(characterFromID("P2_guard3")) && LAi_IsDead(characterFromID("P2_guard4")) ) 
				{
					
				}
				else LAi_QuestDelay("P2_guards_attack_tools", 0.1);
			}
			else LAi_QuestDelay("prison2_tools3_check", 0.5);//loop check
		break;

		case "P2_guards_attack_tools":
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "goto", "opening", 0.0001);
			Locations[FindLocation("bb_prison2")].locators_radius.goto.opening = 0.0001;
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], false);
			LAi_SetActorType(characterFromID("P2_guard1")); LAi_SetActorType(characterFromID("P2_guard2"));
			LAi_SetActorType(characterFromID("P2_guard3")); LAi_SetActorType(characterFromID("P2_guard4"));
			LAi_ActorAttack(CharacterFromID("P2_guard1"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("P2_guard2"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("P2_guard3"), Pchar, "");
			LAi_ActorAttack(CharacterFromID("P2_guard4"), Pchar, "");
		break;
//---------------------------------------------------------------------------------------------------	
		case "bb_prison2_tools_done":
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(characterFromID("P2_guard2"), "bb_prison2", "quest", "guard2");
			LAi_SetStayType(characterFromID("P2_guard2"));
			Characters[GetCharacterIndex("P2_guard2")].dialog.CurrentNode  = "First time";
		break;
//---------------------------------------------------------------------------------------------------
//unlock to cell1 (4 maroons)	
		case "cell1_step_back":
			PlaySound("PEOPLE\recoil.wav");	
			ChangeCharacterAddressGroup(Pchar, "bb_prison2", "goto", "step_back1");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("bb_maroon4_out", 0.01);
			LAi_QuestDelay("bb_maroon2_out", 2.0);
			LAi_QuestDelay("bb_maroon3_out", 4.0);
			LAi_QuestDelay("bb_maroon1_out", 6.0);
		break;
	//.............................................................................................................
		case "bb_maroon4_out":
			LAi_SetActorType(characterFromID("bb_maroon4"));
			LAi_ActorGoToLocator(characterFromID("bb_maroon4"), "goto", "goto2", "bb_maroon4_out1", 2.0);
		break;

		case "bb_maroon4_out1":
			PlaySound("INTERFACE\small_door.wav");
			ChangeCharacterAddressGroup(characterFromID("bb_maroon4"), "bb_prison2", "goto", "goto1");
			LAi_ActorGoToLocator(characterFromID("bb_maroon4"), "goto", "freeRR", "bb_maroon4_out2", 2.0);
		break;

		case "bb_maroon4_out2":
			ChangeCharacterAddressGroup(characterFromID("bb_maroon4"), "bb_prison2", "goto", "freeRR");
			LAi_SetOfficerType(characterFromID("bb_maroon4"));
		break;
	//.............................................................................................................
		case "bb_maroon2_out":
			LAi_SetActorType(characterFromID("bb_maroon2"));
			LAi_ActorGoToLocator(characterFromID("bb_maroon2"), "goto", "goto2", "bb_maroon2_out1", 2.0);
		break;

		case "bb_maroon2_out1":
			PlaySound("INTERFACE\small_door.wav");
			ChangeCharacterAddressGroup(characterFromID("bb_maroon2"), "bb_prison2", "goto", "goto1");
			LAi_ActorGoToLocator(characterFromID("bb_maroon2"), "goto", "freeL", "bb_maroon2_out2", 2.0);
		break;

		case "bb_maroon2_out2":
			ChangeCharacterAddressGroup(characterFromID("bb_maroon2"), "bb_prison2", "goto", "freeL");
			LAi_SetOfficerType(characterFromID("bb_maroon2"));
		break;
	//.............................................................................................................
		case "bb_maroon3_out":
			LAi_SetActorType(characterFromID("bb_maroon3"));
			LAi_ActorGoToLocator(characterFromID("bb_maroon3"), "goto", "goto2", "bb_maroon3_out1", 2.0);
		break;

		case "bb_maroon3_out1":
			PlaySound("INTERFACE\small_door.wav");
			ChangeCharacterAddressGroup(characterFromID("bb_maroon3"), "bb_prison2", "goto", "goto1");
			LAi_ActorGoToLocator(characterFromID("bb_maroon3"), "goto", "freeR", "bb_maroon3_out2", 2.0);
		break;

		case "bb_maroon3_out2":
			ChangeCharacterAddressGroup(characterFromID("bb_maroon3"), "bb_prison2", "goto", "freeR");
			LAi_SetOfficerType(characterFromID("bb_maroon3"));
		break;
	//.............................................................................................................
		case "bb_maroon1_out":
			LAi_SetActorType(characterFromID("bb_maroon1"));
			LAi_ActorGoToLocator(characterFromID("bb_maroon1"), "goto", "goto2", "bb_maroon1_out1", 2.0);
		break;

		case "bb_maroon1_out1":
			PlaySound("INTERFACE\small_door.wav");
			ChangeCharacterAddressGroup(characterFromID("bb_maroon1"), "bb_prison2", "goto", "goto1");
			LAi_SetOfficerType(characterFromID("bb_maroon1"));
			LAi_SetPlayerType(Pchar);
			Pchar.P2_maroons = "free";

			LAi_QuestDelay("maroons_weapons", 2.0);
		break;

		case "maroons_weapons":
			LAi_SetActorType(pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "mar5");	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "maroons_weapons";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "maroons_weapons_done":
			PlaySound("OBJECTS\DUEL\sword_out.wav");
			GiveItem2Character(characterFromID("bb_maroon1"), "bladeclub");
			EquipCharacterByItem(characterFromID("bb_maroon1"), "bladeclub");
			if(CheckCharacterItem(Pchar,"pistolwhip"))
			{
				GiveItem2Character(characterFromID("bb_maroon1"), "pistolwhip");
				EquipCharacterByItem(characterFromID("bb_maroon1"), "pistolwhip");
				TakenItems(Pchar, "pistolwhip", -1);
			}
			GiveItem2Character(characterFromID("bb_maroon2"), "bladeclub");
			EquipCharacterByItem(characterFromID("bb_maroon2"), "bladeclub");
			GiveItem2Character(characterFromID("bb_maroon3"), "bladeclub");
			EquipCharacterByItem(characterFromID("bb_maroon3"), "bladeclub");
			GiveItem2Character(characterFromID("bb_maroon4"), "bladeclub");
			EquipCharacterByItem(characterFromID("bb_maroon4"), "bladeclub");
			TakenItems(Pchar, "bladeclub", -4);
			
			characters[GetCharacterIndex("bb_maroon1")].dialog.CurrentNode = "maroons_free";
			characters[GetCharacterIndex("bb_maroon2")].dialog.CurrentNode = "maroons_free";
			characters[GetCharacterIndex("bb_maroon3")].dialog.CurrentNode = "maroons_free";
			characters[GetCharacterIndex("bb_maroon4")].dialog.CurrentNode = "maroons_free";

			LAi_QuestDelay("maroons_weapons_done1", 1.0);
		break;

		case "maroons_weapons_done1":
			PlaySound("PEOPLE\clothes2.wav");

			LAi_QuestDelay("maroons_weapons_done2", 1.0);
		break;

		case "maroons_weapons_done2":
			PlaySound("OBJECTS\DUEL\whip.wav");

			LAi_SetPlayerType(pchar);
			LAi_SetOfficerType(characterFromID("bb_maroon1"));
			LAi_SetOfficerType(characterFromID("bb_maroon2"));
			LAi_SetOfficerType(characterFromID("bb_maroon3"));
			LAi_SetOfficerType(characterFromID("bb_maroon4"));

			if(CheckAttribute(Pchar, "P2_Pell") && Pchar.P2_Pell == "free")
			{
				LAi_QuestDelay("guard_2_doors", 1.0);
			}
		break;
	//.............................................................................................................
		case "cell2_step_back":
			PlaySound("PEOPLE\recoil.wav");	
			ChangeCharacterAddressGroup(Pchar, "bb_prison2", "goto", "step_back2");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("bb_pell_out", 2.0);
		break;

		case "bb_pell_out":
			PlaySound("INTERFACE\small_door.wav");
			ChangeCharacterAddressGroup(characterFromID("Pell"), "bb_prison2", "goto", "goto3");
			AddPassenger(Pchar, characterFromID("Pell"), 0);
			SetOfficersIndex(Pchar, 2, getCharacterIndex("Pell"));
			LAi_SetOfficerType(characterFromID("Pell"));
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("bb_pell_out1", 1.0);
		break;

		case "bb_pell_out1":
			Characters[GetCharacterIndex("Pell")].dialog.CurrentNode  = "pell_out";
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorDialogNow(characterFromID("Pell"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Pell"));
		break;

		case "Pell_out_done":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Pell"));

			Characters[GetCharacterIndex("Pell")].dialog.CurrentNode  = "neutral";
			LAi_SetOfficerType(characterFromID("Pell"));
			LAi_SetStayType(Pchar);
			Pchar.P2_Pell = "free";

			LAi_QuestDelay("Pell_blade_check", 1.0);
		break;

		case "Pell_blade_check":
			weaponID7 = GetCharacterEquipByGroup(characterFromID("Pell"),BLADE_ITEM_TYPE);
			if(weaponID7 != "")
			{
				LAi_SetPlayerType(Pchar);

				if(CheckAttribute(Pchar, "P2_maroons") && Pchar.P2_maroons == "free")
				{
					LAi_QuestDelay("guard_2_doors", 0.1);
				}
			}
			else LAi_QuestDelay("Pell_blade_check", 1.0);
		break;
	//.............................................................................................................
		case "guard_2_doors":
			LAi_SetActorType(pchar);
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "guard_2_doors";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "guard_2_doors_done":
			Pchar.P2_ambush = "on";
			LAi_SetPlayerType(Pchar);
			PlaySound("VOICE\ENGLISH\gm_crew21A.wav");

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "randitem", "randitem9");

			LAi_SetActorType(characterFromID("bb_maroon3"));
			LAi_ActorRunToLocator(characterFromID("bb_maroon3"), "quest", "door1", "mar3_d1", 6.0);
			LAi_SetActorType(characterFromID("bb_maroon4"));
			LAi_ActorRunToLocator(characterFromID("bb_maroon4"), "box", "box5", "mar4_b6", 6.0);

			SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload1", 0.0001);
			Locations[FindLocation("bb_prison2")].locators_radius.reload.reload1 = 0.0001;
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload2", 0.0001);
			Locations[FindLocation("bb_prison2")].locators_radius.reload.reload2 = 0.0001;
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box12", 1.0);
			Locations[FindLocation("bb_prison2")].locators_radius.box.box12 = 1.0;
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box13", 1.0);
			Locations[FindLocation("bb_prison2")].locators_radius.box.box13 = 1.0;
		break;

		case "mar3_d1":
			ChangeCharacterAddressGroup(characterFromID("bb_maroon3"), "bb_prison2", "quest", "door1");
		break;

		case "mar4_b6":
			PlaySound("PEOPLE\counter_openclose.wav");
			ChangeCharacterAddressGroup(characterFromID("bb_maroon4"), "bb_prison2", "box", "box6");
			LAi_SetActorType(characterFromID("bb_maroon4"));
			LAi_ActorRunToLocator(characterFromID("bb_maroon4"), "quest", "door2", "mar4_d2", 5.0);
		break;

		case "mar4_d2":
			ChangeCharacterAddressGroup(characterFromID("bb_maroon4"), "bb_prison2", "quest", "door2");

			LAi_SetActorType(Pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "plan_ambush";
			LAi_ActorSelfDialog(Pchar, "");
		break;

		case "plan_ambush_done":
			LAi_SetPlayerType(Pchar);

			pchar.quest.P2_prepare_ambush.win_condition.l1 = "locator";
			pchar.quest.P2_prepare_ambush.win_condition.l1.location = "bb_prison2";
			pchar.quest.P2_prepare_ambush.win_condition.l1.locator_group = "box";
			pchar.quest.P2_prepare_ambush.win_condition.l1.locator = "box6";
			pchar.quest.P2_prepare_ambush.win_condition = "P2_prepare_ambush";
		break;

		case "P2_prepare_ambush":
			LAi_SetStayType(Pchar);

			LAi_SetActorType(characterFromID("bb_maroon2"));
			LAi_ActorRunToLocator(characterFromID("bb_maroon2"), "quest", "amb2", "mar2_amb", 4.0);
			LAi_SetActorType(characterFromID("bb_maroon1"));
			LAi_ActorRunToLocator(characterFromID("bb_maroon1"), "quest", "amb1", "mar1_amb", 4.0);
			
			pchar.quest.P2_ambush_trick.win_condition.l1 = "locator";
			pchar.quest.P2_ambush_trick.win_condition.l1.location = "bb_prison2";
			pchar.quest.P2_ambush_trick.win_condition.l1.locator_group = "quest";
			pchar.quest.P2_ambush_trick.win_condition.l1.locator = "trick";
			pchar.quest.P2_ambush_trick.win_condition = "P2_ambush_trick";

			LAi_QuestDelay("Pell_to_ambP", 2.0);
			LAi_QuestDelay("pchar_playertype", 4.0);
		break;

		case "Pell_to_ambP":
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorRunToLocator(characterFromID("Pell"), "quest", "ambP", "Pell_amb", 3.0);
		break;

		case "mar2_amb":
			ChangeCharacterAddressGroup(characterFromID("bb_maroon2"), "bb_prison2", "quest", "amb2");
		break;

		case "mar1_amb":
			ChangeCharacterAddressGroup(characterFromID("bb_maroon1"), "bb_prison2", "quest", "amb1");
		break;

		case "Pell_amb":
			ChangeCharacterAddressGroup(characterFromID("Pell"), "bb_prison2", "quest", "ambP");
		break;

		case "P2_ambush_trick":
			LAi_SetActorType(pchar);
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "ambush_trick";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Took_finds_out":
			LAi_SetActorType(characterFromID("P2_guard1")); LAi_SetActorType(characterFromID("P2_guard2"));
			LAi_SetActorType(characterFromID("P2_guard3")); LAi_SetActorType(characterFromID("P2_guard4"));

			Characters[GetCharacterIndex("P2_guard2")].dialog.CurrentNode  = "Took_finds_out";
			LAi_SetActorType(characterFromID("P2_guard2"));
			LAi_ActorDialogNow(characterFromID("P2_guard2"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("P2_guard2"));
		break;

		case "P2_guards_move":
			PlaySound("AMBIENT\UnHappy-001.wav");
			LAi_SetActorType(pchar);
			LAi_ActorGoToLocator(Pchar, "quest", "trick2", "P2_guards_up", 4.0);
			
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "goto", "opening", 0.0001);
			Locations[FindLocation("bb_prison2")].locators_radius.goto.opening = 0.0001;
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], false);
		break;

		case "P2_guards_up":
			ChangeCharacterAddressGroup(Pchar, "bb_prison2", "quest", "trick2");
			ChangeCharacterAddressGroup(characterFromID("P2_guard2"), "bb_prison2", "quest", "stairs1");
			ChangeCharacterAddressGroup(characterFromID("P2_guard1"), "bb_prison2", "quest", "stairs2");
			ChangeCharacterAddressGroup(characterFromID("P2_guard3"), "bb_prison2", "quest", "trick");
			ChangeCharacterAddressGroup(characterFromID("P2_guard4"), "bb_prison2", "goto", "stairs");
			LAi_SetOfficerType(characterFromID("P2_guard1")); LAi_SetOfficerType(characterFromID("P2_guard2"));
			LAi_SetOfficerType(characterFromID("P2_guard3")); LAi_SetOfficerType(characterFromID("P2_guard4"));

			LAi_QuestDelay("P2_ambush_fight", 2.0);
		break;

		case "P2_ambush_fight":
			LAi_SetPlayerType(pchar);
			LAi_SetOfficerType(characterFromID("Pell"));

			LAi_SetActorType(characterFromID("P2_guard1")); LAi_SetActorType(characterFromID("P2_guard2"));
			LAi_SetActorType(characterFromID("P2_guard3")); LAi_SetActorType(characterFromID("P2_guard4"));

			LAi_group_MoveCharacter(characterFromID("Pell"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("bb_maroon1"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("bb_maroon2"), LAI_GROUP_PLAYER);
			
			LAi_group_MoveCharacter(characterFromID("P2_guard1"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("P2_guard2"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("P2_guard3"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("P2_guard4"), "ROOF_THUGS_1");
			
			LAi_group_Register("ROOF_THUGS_1");
			LAi_group_SetRelation(LAI_GROUP_PLAYER, "ROOF_THUGS_1", LAI_GROUP_ENEMY);
			LAi_group_FightGroups(LAI_GROUP_PLAYER, "ROOF_THUGS_1", true);

			LAi_QuestDelay("P2_guards_mortal", 5.0);

			Pchar.quest.P2_guards_dead.win_condition.l1 = "NPC_Death";
			Pchar.quest.P2_guards_dead.win_condition.l1.character = "P2_guard1";
			Pchar.quest.P2_guards_dead.win_condition.l2 = "NPC_Death";
			Pchar.quest.P2_guards_dead.win_condition.l2.character = "P2_guard2";
			Pchar.quest.P2_guards_dead.win_condition.l3 = "NPC_Death";
			Pchar.quest.P2_guards_dead.win_condition.l3.character = "P2_guard3";
			Pchar.quest.P2_guards_dead.win_condition.l4 = "NPC_Death";
			Pchar.quest.P2_guards_dead.win_condition.l4.character = "P2_guard4";
			Pchar.quest.P2_guards_dead.win_condition = "P2_guards_dead";
		break;

		case "P2_guards_mortal":
			LAi_SetImmortal(CharacterFromID("P2_guard1"), false);
			LAi_SetImmortal(CharacterFromID("P2_guard2"), false);
			LAi_SetImmortal(CharacterFromID("P2_guard3"), false);
			LAi_SetImmortal(CharacterFromID("P2_guard4"), false);
		break;

		case "P2_guards_dead":
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], true);
			if(LAi_IsFightMode(Pchar))
			{
				LAi_SetPlayerType(Pchar);
				LAi_SetFightMode(PChar, false);
			}
			if(LAi_IsFightMode(characterFromID("Pell")))
			{
				LAi_SetActorType(characterFromID("Pell"));
				LAi_SetFightMode(characterFromID("Pell"), false);
			}

			Pchar.P2_ambush = "corpse";
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "goto", "opening", 0.5);
			Locations[FindLocation("bb_prison2")].locators_radius.goto.opening = 0.5;

			SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload2", 1.5);
			Locations[FindLocation("bb_prison2")].locators_radius.reload.reload2 = 1.5;
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box13", 0.001);
			Locations[FindLocation("bb_prison2")].locators_radius.box.box13 = 0.001;

			if(CheckCharacterItem(Pchar,"bladeclub")) TakeItemFromCharacter(Pchar, "bladeclub");

			LAi_QuestDelay("hide_corpses", 2.0);
		break;

		case "hide_corpses":
			LAi_SetActorType(pchar);
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "hide_corpses";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "hide_corpses_done":
			LAi_SetActorType(pchar);
			LAi_ActorGoToLocator(Pchar, "quest", "trick", "pchar_playertype", 5.0);

			Pchar.saw_sewer = 0;			//start value
			Pchar.axe_sewer = 0;			//start value
			Pchar.hammer_sewer = 0;			//start value

			pchar.quest.P2_corpse_trick.win_condition.l1 = "locator";
			pchar.quest.P2_corpse_trick.win_condition.l1.location = "bb_prison2";
			pchar.quest.P2_corpse_trick.win_condition.l1.locator_group = "quest";
			pchar.quest.P2_corpse_trick.win_condition.l1.locator = "trick";
			pchar.quest.P2_corpse_trick.win_condition = "P2_corpse_trick";
		break;

		case "P2_corpse_trick":
			//move corpses to maroon cell etc
					
			Pchar.P2_ambush = "sewer";
			ChangeCharacterAddressGroup(characterFromID("P2_guard1"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("P2_guard2"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("P2_guard3"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("P2_guard4"), "none", "", "");

			ChangeCharacterAddressGroup(characterFromID("P2_guard1_dead"), "bb_prison2", "goto", "mar2");
			ChangeCharacterAddressGroup(characterFromID("P2_guard2_dead"), "bb_prison2", "goto", "mar3");
			ChangeCharacterAddressGroup(characterFromID("P2_guard3_dead"), "bb_prison2", "goto", "mar4");
			ChangeCharacterAddressGroup(characterFromID("P2_guard4_dead"), "bb_prison2", "goto", "mar5");
					
			ChangeCharacterAddressGroup(characterFromID("Pell"), "bb_prison2", "goto", "step_back1");
			ChangeCharacterAddressGroup(characterFromID("bb_maroon1"), "bb_prison2", "goto", "goto1");
			ChangeCharacterAddressGroup(characterFromID("bb_maroon2"), "bb_prison2", "goto", "freeL");
			ChangeCharacterAddressGroup(characterFromID("bb_maroon3"), "bb_prison2", "goto", "freeR");
			ChangeCharacterAddressGroup(characterFromID("bb_maroon4"), "bb_prison2", "goto", "freeRR");
			LAi_SetOfficerType(characterFromID("Pell"));
			LAi_SetOfficerType(characterFromID("bb_maroon1"));
			LAi_SetOfficerType(characterFromID("bb_maroon2"));
			LAi_SetOfficerType(characterFromID("bb_maroon3"));
			LAi_SetOfficerType(characterFromID("bb_maroon4"));

			RemoveCharacterEquip(characterFromID("bb_maroon1"), BLADE_ITEM_TYPE); TakeItemFromCharacter(characterFromID("bb_maroon1"), "bladeckub");
			GiveItem2Character(characterFromID("bb_maroon1"), "machete"); EquipCharacterByItem(characterFromID("bb_maroon1"), "machete");
			RemoveCharacterEquip(characterFromID("bb_maroon1"), GUN_ITEM_TYPE); TakeItemFromCharacter(characterFromID("bb_maroon1"), "pistolwhip");
			GiveItem2Character(characterFromID("bb_maroon1"), "pistolbbuss"); EquipCharacterByItem(characterFromID("bb_maroon1"), "pistolbbuss");
			TakenItems(characterFromID("bb_maroon1"), "gunpowder", 2); TakenItems(characterFromID("bb_maroon1"), "pistolgrapes", 2);

			RemoveCharacterEquip(characterFromID("bb_maroon2"), BLADE_ITEM_TYPE); TakeItemFromCharacter(characterFromID("bb_maroon2"), "bladeckub");
			GiveItem2Character(characterFromID("bb_maroon2"), "machete"); EquipCharacterByItem(characterFromID("bb_maroon2"), "machete");
			GiveItem2Character(characterFromID("bb_maroon2"), "pistolbbuss"); EquipCharacterByItem(characterFromID("bb_maroon2"), "pistolbbuss");
			TakenItems(characterFromID("bb_maroon2"), "gunpowder", 2); TakenItems(characterFromID("bb_maroon2"), "pistolgrapes", 2);

			RemoveCharacterEquip(characterFromID("bb_maroon3"), BLADE_ITEM_TYPE); TakeItemFromCharacter(characterFromID("bb_maroon3"), "bladeckub");
			GiveItem2Character(characterFromID("bb_maroon3"), "machete"); EquipCharacterByItem(characterFromID("bb_maroon3"), "machete");
			GiveItem2Character(characterFromID("bb_maroon3"), "pistolbbuss"); EquipCharacterByItem(characterFromID("bb_maroon3"), "pistolbbuss");
			TakenItems(characterFromID("bb_maroon3"), "gunpowder", 2); TakenItems(characterFromID("bb_maroon2"), "pistolgrapes", 3);

			RemoveCharacterEquip(characterFromID("bb_maroon4"), BLADE_ITEM_TYPE); TakeItemFromCharacter(characterFromID("bb_maroon4"), "bladeckub");
			GiveItem2Character(characterFromID("bb_maroon4"), "machete"); EquipCharacterByItem(characterFromID("bb_maroon4"), "machete");
			GiveItem2Character(characterFromID("bb_maroon4"), "pistolbbuss"); EquipCharacterByItem(characterFromID("bb_maroon4"), "pistolbbuss");
			TakenItems(characterFromID("bb_maroon4"), "gunpowder", 2); TakenItems(characterFromID("bb_maroon4"), "pistolgrapes", 2);

			LAi_QuestDelay("P2_bladesaw_check", 0.1);
			LAi_QuestDelay("P2_bladeaxe4_check", 0.1);
			LAi_QuestDelay("P2_bladehammer_check", 0.1);
		break;

		case "P2_bladesaw_check":
			if(CheckCharacterItem(Pchar,"bladesaw"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladesaw");
				PlaySound("PEOPLE\spyglass.wav");
			}
			else
			{
				LAi_QuestDelay("P2_bladesaw_check", 0.5);//loop check
			}
		break;

		case "P2_bladeaxe4_check":
			if(CheckCharacterItem(Pchar,"bladeaxe4"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladeaxe4");
				PlaySound("INTERFACE\pinion_take.wav");
			}
			else
			{
				LAi_QuestDelay("P2_bladeaxe4_check", 0.5);//loop check
			}
		break;

		case "P2_bladehammer_check":
			if(CheckCharacterItem(Pchar,"bladehammer"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladehammer");
				PlaySound("PEOPLE\step_iron.wav");
			}
			else
			{
				LAi_QuestDelay("P2_bladehammer_check", 0.5);//loop check
			}
		break;

		case "saw_blunt":
			Logit(LanguageConvertString(tmpLangFileID,"It's blunt. It's worthless!"));
			PlaySound("OBJECTS\DUEL\man_attack5.wav");
			if(LAi_IsFightMode(Pchar)) LAi_SetFightMode(Pchar, false);
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], true);
			
			LAi_QuestDelay("saw_blunt1", 1.0);
		break;

		case "saw_blunt1":
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladesaw");
			EquipCharacterByItem(Pchar, "bladeX4");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
		break;
		
		case "Took_returns":
			PlaySound("VOICE\ENGLISH\gr_WR_host9.wav");

			ChangeCharacterAddressGroup(characterFromID("Tookerman"), "bb_prison2", "quest", "Took_last");
			LAi_SetActorType(characterFromID("Tookerman"));	
			ChangeCharacterAddressGroup(characterFromID("Pell"), "bb_prison2", "goto", "sewer_pell");		
			
			ChangeCharacterAddressGroup(characterFromID("bb_maroon1"), "bb_prison2", "quest", "m1_back");
			ChangeCharacterAddressGroup(characterFromID("bb_maroon2"), "bb_prison2", "quest", "m2_back");
			ChangeCharacterAddressGroup(characterFromID("bb_maroon3"), "bb_prison2", "quest", "m3_back");
			ChangeCharacterAddressGroup(characterFromID("bb_maroon4"), "bb_prison2", "quest", "m4_back");

			LAi_QuestDelay("Took_returns0", 1.0);
			LAi_QuestDelay("Took_returns1", 5.0);
		break;

		case "Took_returns0":
			if(LAi_IsFightMode(Pchar)) LAi_SetFightMode(Pchar, false);
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], true);

			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladehammer");		
			if(CheckCharacterItem(Pchar,"bladeA4"))
			{
				EquipCharacterByItem(Pchar, "bladeA4");
			}
			else EquipCharacterByItem(Pchar, "bladeX4");

			LAi_SetActorType(pchar);
			LAi_ActorTurnToLocator(Pchar, "quest", "Took_last");
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorTurnToLocator(characterFromID("Pell"), "quest", "Took_last");
		break;

		case "Took_returns1":
			LAi_SetActorType(pchar);
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "Took_to_cell";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Took_returns2":
			LAi_SetOfficerType(characterFromID("Pell"));
			
			LAi_SetActorType(characterFromID("bb_maroon1"));
			LAi_SetActorType(characterFromID("bb_maroon2"));
			LAi_SetActorType(characterFromID("Tookerman"));	
			LAi_ActorRunToLocatorJRH(characterFromID("bb_maroon1"), "goto", "box3_pell", 5.0);
			LAi_ActorRunToLocatorJRH(characterFromID("bb_maroon2"), "goto", "step_back2", 5.0);
			LAi_ActorRunToLocatorJRH(characterFromID("Tookerman"), "box", "box3", 5.0);
			
			LAi_QuestDelay("Pchar_playertype", 4.0);

			pchar.quest.Took_in_cell.win_condition.l1 = "locator";
			pchar.quest.Took_in_cell.win_condition.l1.location = "bb_prison2";
			pchar.quest.Took_in_cell.win_condition.l1.locator_group = "goto";
			pchar.quest.Took_in_cell.win_condition.l1.locator = "prison";
			pchar.quest.Took_in_cell.win_condition = "Took_in_cell";	
		break;

		case "Took_in_cell":
			LAi_SetActorType(pchar);
			LAi_ActorGoToLocator(Pchar, "box", "box3", "Took_in_cell1", 7.0);
			Pchar.P2_ambush = "cell";

			ChangeCharacterAddressGroup(characterFromID("bb_maroon1"), "bb_prison2", "goto", "box3_pell");
			ChangeCharacterAddressGroup(characterFromID("bb_maroon2"), "bb_prison2", "goto", "step_back2");
			ChangeCharacterAddressGroup(characterFromID("Tookerman"), "bb_prison2", "goto", "Pell_cell");
		break;

		case "Took_in_cell1":
			ChangeCharacterAddressGroup(Pchar, "bb_prison2", "box", "box3");
			LAi_SetActorType(pchar);
		break;

		case "Took_in_cell2":
			//from SL_utils lock Pell cell for ever

			PlaySound("VOICE\ENGLISH\gr_WR_host6.wav");

			Locations[FindLocation("bb_prison_officer")].locators_radius.box.box13 = 0.001;
			Locations[FindLocation("bb_prison_officer")].locators_radius.box.box10 = 0.5;

			LAi_QuestDelay("Took_in_cell3", 1.5);
		break;

		case "Took_in_cell3":
			LAi_SetActorType(pchar);
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "search_Took_room";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Took_in_cell4":
			LAi_SetPlayerType(pchar);
			AddQuestRecord("Israel_Hands", "12");
		break;

		case "mapBB5A_check":
			DoQuickSave();
			LAi_QuestDelay("Pchar_mhm", 0.1);
			AddQuestRecord("Israel_Hands", "8");
			Pchar.mapBB5 = "picked_up";

			if(!CheckCharacterItem(Pchar,"map")) {GiveItem2Character(Pchar, "map");}

			LAi_QuestDelay("prison2_last_fight", 0.1);
			LAi_QuestDelay("closer_look", 1.0);
		break;

		case "prison2_last_fight":
			ChangeCharacterAddressGroup(characterFromID("bb_prison_officer"), "bb_prison2", "goto", "attack6");
			ChangeCharacterAddressGroup(characterFromID("P2_guard_gate1"), "bb_prison2", "goto", "attack1");
			ChangeCharacterAddressGroup(characterFromID("P2_guard_gate2"), "bb_prison2", "goto", "attack2");
			ChangeCharacterAddressGroup(characterFromID("P2_guard_bridge1"), "bb_prison2", "goto", "attack3");
			ChangeCharacterAddressGroup(characterFromID("P2_guard_bridge2"), "bb_prison2", "goto", "attack4");
			ChangeCharacterAddressGroup(characterFromID("P1_guard1"), "bb_prison2", "goto", "attack5");
			ChangeCharacterAddressGroup(characterFromID("P2_guard_alcove1"), "bb_prison2", "goto", "attack7");
			ChangeCharacterAddressGroup(characterFromID("P2_guard_alcove2"), "bb_prison2", "quest", "door1");
			ChangeCharacterAddressGroup(characterFromID("P2_guard_alcove3"), "bb_prison2", "reload", "reload1");
			LAi_SetActorType(characterFromID("bb_prison_officer"));
			LAi_SetActorType(characterFromID("P2_guard_gate1"));
			LAi_SetActorType(characterFromID("P2_guard_gate2"));
			LAi_SetActorType(characterFromID("P2_guard_bridge1"));
			LAi_SetActorType(characterFromID("P2_guard_bridge2"));
			LAi_SetActorType(characterFromID("P1_guard1"));
			LAi_SetActorType(characterFromID("P2_guard_alcove1"));
			LAi_SetActorType(characterFromID("P2_guard_alcove2"));
			LAi_SetActorType(characterFromID("P2_guard_alcove3"));
			LAi_SetImmortal(CharacterFromID("bb_prison_officer"), false);
			LAi_SetImmortal(CharacterFromID("P2_guard_gate1"), false);
			LAi_SetImmortal(CharacterFromID("P2_guard_gate2"), false);
			LAi_SetImmortal(CharacterFromID("P2_guard_bridge1"), false);
			LAi_SetImmortal(CharacterFromID("P2_guard_bridge2"), false);
			LAi_SetImmortal(CharacterFromID("P1_guard1"), false);
			LAi_SetImmortal(CharacterFromID("P2_guard_alcove1"), false);
			LAi_SetImmortal(CharacterFromID("P2_guard_alcove2"), false);
			LAi_SetImmortal(CharacterFromID("P2_guard_alcove3"), false);

			LAi_QuestDelay("prison2_last_fight1", 1.0);
		break;

		case "prison2_last_fight1":
			if(IsOfficer(CharacterFromID("Pell"))) { RemovePassenger(Pchar, characterFromID("Pell")); }

			ChangeCharacterAddressGroup(characterFromID("Pell"), "bb_prison2", "goto", "prison");		
			ChangeCharacterAddressGroup(characterFromID("bb_maroon1"), "bb_prison2", "quest", "m1_back");
			ChangeCharacterAddressGroup(characterFromID("bb_maroon2"), "bb_prison2", "quest", "m2_back");
			ChangeCharacterAddressGroup(characterFromID("bb_maroon3"), "bb_prison2", "quest", "m3_back");
			ChangeCharacterAddressGroup(characterFromID("bb_maroon4"), "bb_prison2", "quest", "m4_back");
			
			LAi_SetActorType(characterFromID("Pell"));
			LAi_SetActorType(characterFromID("bb_maroon1"));
			LAi_SetActorType(characterFromID("bb_maroon2"));
			LAi_SetActorType(characterFromID("bb_maroon3"));
			LAi_SetActorType(characterFromID("bb_maroon4"));
		
			pchar.quest.prison2_last_fight2.win_condition.l1 = "location";
			pchar.quest.prison2_last_fight2.win_condition.l1.location = "bb_prison2";
			pchar.quest.prison2_last_fight2.win_condition = "prison2_last_fight2";
		break;

		case "prison2_last_fight2":
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], false);

			LAi_group_MoveCharacter(characterFromID("Pell"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("bb_maroon1"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("bb_maroon2"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("bb_maroon3"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("bb_maroon4"), LAI_GROUP_PLAYER);

			LAi_group_MoveCharacter(characterFromID("bb_prison_officer"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("P2_guard_gate1"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("P2_guard_gate2"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("P2_guard_bridge1"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("P2_guard_bridge2"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("P1_guard1"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("P2_guard_alcove1"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("P2_guard_alcove2"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("P2_guard_alcove3"), "ROOF_THUGS_1");

			LAi_group_Register("ROOF_THUGS_1");
			LAi_group_SetRelation(LAI_GROUP_PLAYER, "ROOF_THUGS_1", LAI_GROUP_ENEMY);
			LAi_group_FightGroups(LAI_GROUP_PLAYER, "ROOF_THUGS_1", true);

			LAi_QuestDelay("abordage_sound", 1.0);
			LAi_QuestDelay("prison2_last_fight3", 7.0);
	
			Pchar.quest.P2_guards2_dead.win_condition.l1 = "NPC_Death";
			Pchar.quest.P2_guards2_dead.win_condition.l1.character = "bb_prison_officer";
			Pchar.quest.P2_guards2_dead.win_condition.l2 = "NPC_Death";
			Pchar.quest.P2_guards2_dead.win_condition.l2.character = "P2_guard_gate1";
			Pchar.quest.P2_guards2_dead.win_condition.l3 = "NPC_Death";
			Pchar.quest.P2_guards2_dead.win_condition.l3.character = "P2_guard_gate2";
			Pchar.quest.P2_guards2_dead.win_condition.l4 = "NPC_Death";
			Pchar.quest.P2_guards2_dead.win_condition.l4.character = "P2_guard_bridge1";
			Pchar.quest.P2_guards2_dead.win_condition.l5 = "NPC_Death";
			Pchar.quest.P2_guards2_dead.win_condition.l5.character = "P2_guard_bridge2";
			Pchar.quest.P2_guards2_dead.win_condition.l6 = "NPC_Death";
			Pchar.quest.P2_guards2_dead.win_condition.l6.character = "P1_guard1";
			Pchar.quest.P2_guards2_dead.win_condition.l7 = "NPC_Death";
			Pchar.quest.P2_guards2_dead.win_condition.l7.character = "P2_guard_alcove1";
			Pchar.quest.P2_guards2_dead.win_condition.l8 = "NPC_Death";
			Pchar.quest.P2_guards2_dead.win_condition.l8.character = "P2_guard_alcove2";
			Pchar.quest.P2_guards2_dead.win_condition.l9 = "NPC_Death";
			Pchar.quest.P2_guards2_dead.win_condition.l9.character = "P2_guard_alcove3";
			Pchar.quest.P2_guards2_dead.win_condition = "P2_guards2_dead";
		break;

		case "abordage_sound":
			PlaySound("OBJECTS\ABORDAGE\abordage1.wav");
		break;

		case "prison2_last_fight3":	
			LAi_SetImmortal(CharacterFromID("bb_maroon1"), false);
			LAi_SetImmortal(CharacterFromID("bb_maroon2"), false);
			LAi_SetImmortal(CharacterFromID("bb_maroon3"), false);
			LAi_SetImmortal(CharacterFromID("bb_maroon4"), false);
		break;

		case "P2_guards2_dead":
			AddPassenger(Pchar, characterFromID("Pell"), 0);
			SetOfficersIndex(Pchar, 2, getCharacterIndex("Pell"));
			LAi_SetOfficerType(characterFromID("Pell"));

			if(CheckAttribute(Pchar, "Hands_officer") && Pchar.Hands_officer == "yes")
			{
				AddPassenger(Pchar, characterFromID("Hands"), 0);
				SetOfficersIndex(Pchar, 1, getCharacterIndex("Hands"));
				LAi_SetOfficerType(characterFromID("Hands"));
			}	
			if(CheckAttribute(Pchar, "Caesar_officer") && Pchar.Caesar_officer == "yes")
			{
				AddPassenger(Pchar, characterFromID("Caesar"), 0);
				SetOfficersIndex(Pchar, 2, getCharacterIndex("Caesar"));
				LAi_SetOfficerType(characterFromID("Caesar"));
			}

			if(LAi_IsDead(characterFromID("bb_maroon1"))) 
			{
				DeleteAttribute(characterFromID("bb_maroon1"), "items");
			}
			else LAi_SetOfficerType(characterFromID("bb_maroon1"));

			if(LAi_IsDead(characterFromID("bb_maroon2"))) 
			{
				DeleteAttribute(characterFromID("bb_maroon2"), "items");
			}
			else LAi_SetOfficerType(characterFromID("bb_maroon2"));

			if(LAi_IsDead(characterFromID("bb_maroon3"))) 
			{
				DeleteAttribute(characterFromID("bb_maroon3"), "items");
			}
			else LAi_SetOfficerType(characterFromID("bb_maroon3"));

			if(LAi_IsDead(characterFromID("bb_maroon4"))) 
			{
				DeleteAttribute(characterFromID("bb_maroon4"), "items");
			}
			else LAi_SetOfficerType(characterFromID("bb_maroon4"));

		SetCurrentTime(11.00, 0);

			DeleteAttribute(characterFromID("bb_prison_officer"), "items");
			DeleteAttribute(characterFromID("P2_guard_gate1"), "items");
			DeleteAttribute(characterFromID("P2_guard_gate2"), "items");
			DeleteAttribute(characterFromID("P2_guard_bridge1"), "items");
			DeleteAttribute(characterFromID("P2_guard_bridge2"), "items");
			DeleteAttribute(characterFromID("P1_guard1"), "items");
			DeleteAttribute(characterFromID("P2_guard_alcove1"), "items");
			DeleteAttribute(characterFromID("P2_guard_alcove2"), "items");
			DeleteAttribute(characterFromID("P2_guard_alcove3"), "items");

			pchar.quest.prison2_escape.win_condition.l1 = "location";
			pchar.quest.prison2_escape.win_condition.l1.location = "bb_prison_port";
			pchar.quest.prison2_escape.win_condition = "prison2_escape";
		break;
//prison end
		case "prison2_escape":
			PlaySound("INTERFACE\closed_locked_door.wav");
			LAi_SetStayType(Pchar);
			TakeItemFromCharacter(Pchar, "key38");
			TakeItemFromCharacter(Pchar, "bladeclub");

			if(IsEquipCharacterByItem(Pchar, "bladeaxe4") || IsEquipCharacterByItem(Pchar, "bladesaw"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				if(CheckCharacterItem(Pchar,"bladeA4"))
				{
					EquipCharacterByItem(Pchar, "bladeA4");
				}
				else EquipCharacterByItem(Pchar, "bladeX4");
			}
			TakeItemFromCharacter(Pchar, "bladeaxe4"); TakeItemFromCharacter(Pchar, "bladesaw");

			LAi_QuestDelay("prison2_escape1", 2.0);
		break;

		case "prison2_escape1":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "quest", "Pyle_look_hatch");

			LAi_QuestDelay("prison2_escape3", 1.5);
		break;

		case "prison2_escape3":
			PlaySound("VOICE\ENGLISH\pir_capFF.wav");

			LAi_QuestDelay("prison2_escape4", 2.5);
		break;

		case "prison2_escape4":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "quest", "Pyle_look_front");

			LAi_QuestDelay("pchar_lets_go", 2.0);
			LAi_QuestDelay("prison2_escape5", 2.0);
		break;

		case "prison2_escape5":
			Characters[GetCharacterIndex("Maltese_soldier2")].Ship.Type = "obj_Boat2";
			locations[FindLocation("Antigua_port")].models.always.locators = "StJohns_locators_JRH2";
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload4", 0.5);
		break;

		case "prison_2_escape6":
			Pchar.prison_escape = "phase2";
		break;

		case "prison_2_escape7":
			//from SL_utils box7 Antigua_port

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "randitem", "randitem1");

			LAi_QuestDelay("pchar_playertype", 1.0);
		break;

		case "prison_2_escape8":
			PlaySound("INTERFACE\closed_locked_door.wav");

			if(CheckCharacterItem(Pchar,"mapBB1") && CheckCharacterItem(Pchar,"mapBB3T") && CheckCharacterItem(Pchar,"mapBB4C"))
			{
				if(CheckCharacterItem(Pchar,"mapBB2A") || CheckCharacterItem(Pchar,"mapBB2B"))
				{
					if(CheckCharacterItem(Pchar,"mapBB5A") || CheckCharacterItem(Pchar,"mapBB5B"))
					{
					//	ChangeCharacterAddressGroup(CharacterFromID("Defoe"), "Antigua_port", "quest", "defoe");
					//	LAi_SetSitType(CharacterFromID("Defoe"));

						ChangeCharacterAddressGroup(CharacterFromID("Defoe"), "Antigua_port", "goto", "defoe_stay");
						LAi_SetStayType(CharacterFromID("Defoe"));

						Characters[GetCharacterIndex("Defoe")].dialog.CurrentNode  = "neutral";//if spoken to before the auto dialog starts
					//	locations[FindLocation("Turks_old_fort")].type = "silent_seashore";
				
						pchar.quest.defoe_whistle.win_condition.l1 = "locator";
						pchar.quest.defoe_whistle.win_condition.l1.location = "Antigua_port";
						pchar.quest.defoe_whistle.win_condition.l1.locator_group = "quest";
						pchar.quest.defoe_whistle.win_condition.l1.locator = "whistle";
						pchar.quest.defoe_whistle.win_condition = "defoe_whistle";

						pchar.quest.defoe_sit_down.win_condition.l1 = "locator";
						pchar.quest.defoe_sit_down.win_condition.l1.location = "Antigua_port";
						pchar.quest.defoe_sit_down.win_condition.l1.locator_group = "quest";
						pchar.quest.defoe_sit_down.win_condition.l1.locator = "defoe";
						pchar.quest.defoe_sit_down.win_condition = "defoe_sit_down";
					}
				}
			}
		break;

		case "defoe_whistle":
			PlaySound("VOICE\ENGLISH\gm_crew21A.wav");
			PlaySound("VOICE\ENGLISH\gm_crew21A.wav");
			PlaySound("VOICE\ENGLISH\gm_crew21A.wav");

			LAi_SetStayType(Pchar);
			if(IsOfficer(CharacterFromID("Hands"))) {LAi_SetStayType(CharacterFromID("Hands"));}
			if(IsOfficer(CharacterFromID("Caesar"))) {LAi_SetStayType(CharacterFromID("Caesar"));}
			LAi_SetStayType(CharacterFromID("Pell"));

			LAi_QuestDelay("pchar_huh", 1.0);
			LAi_QuestDelay("defoe_whistle1", 1.0);
		break;

		case "defoe_whistle1":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "defoe_stay");

			LAi_QuestDelay("defoe_whistle2", 1.0);
		break;

		case "defoe_whistle2":
			LAi_SetActorType(pchar);
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "is_it_defoe";
			LAi_ActorSelfDialog(pchar, "");
		break;
			
		



//pär Antigua
//---------------------------------------------------------------------------------------------------
		case "bb_prison_opening_start":
			pchar.quest.bb_prison_opening.win_condition.l1 = "locator";
			pchar.quest.bb_prison_opening.win_condition.l1.location = "bb_prison2";
			pchar.quest.bb_prison_opening.win_condition.l1.locator_group = "goto";
			pchar.quest.bb_prison_opening.win_condition.l1.locator = "opening";
			pchar.quest.bb_prison_opening.win_condition = "bb_prison_opening";
		break;

		case "bb_prison_opening":
			if(CheckAttribute(Pchar, "quest.prison_opening") && Pchar.quest.prison_opening == "stairs")
			{
				ChangeCharacterAddressGroup(Pchar, "bb_prison2", "goto", "floor");
				Pchar.quest.prison_opening = "floor";

				if(CheckAttribute(Pchar, "P2_warning") && Pchar.P2_warning == "done")
				{

				}
				else
				{
					if(LAi_IsDead(characterFromID("P2_guard2")))
					{

					}
					else
					{
						DoQuickSave();
						PlaySound("VOICE\ENGLISH\Eng_m_b_059.wav");
						Pchar.P2_warning = "done";
						LAi_SetStayType(Pchar);
						Characters[GetCharacterIndex("P2_guard2")].dialog.CurrentNode  = "bb_prison2_tools";
						LAi_SetActorType(characterFromID("P2_guard2"));
						LAi_ActorDialogNow(characterFromID("P2_guard2"), pchar, "", 0.01);
						LAi_ActorWaitDialog(Pchar, characterFromID("P2_guard2"));
					}
				}
			}
			else
			{
				ChangeCharacterAddressGroup(Pchar, "bb_prison2", "goto", "stairs");
				Pchar.quest.prison_opening = "stairs";
			}

			LAi_QuestDelay("bb_prison_opening_start", 0.1);
		break;
	//--------------------------------------------------------------------------------------
		case "bb_prison_opening2_start":
			pchar.quest.bb_prison_opening2.win_condition.l1 = "locator";
			pchar.quest.bb_prison_opening2.win_condition.l1.location = "bb_prison2";
			pchar.quest.bb_prison_opening2.win_condition.l1.locator_group = "goto";
			pchar.quest.bb_prison_opening2.win_condition.l1.locator = "opening2";
			pchar.quest.bb_prison_opening2.win_condition = "bb_prison_opening2";
		break;

		case "bb_prison_opening2":
			if(CheckAttribute(Pchar, "quest.prison_opening2") && Pchar.quest.prison_opening2 == "prison")
			{
				if(CheckAttribute(Pchar, "prison2.water") && Pchar.prison2.water == "empty")
				{

				}
				else PlaySound("PEOPLE\step_water.wav");

				ChangeCharacterAddressGroup(Pchar, "bb_prison2", "goto", "river");
				Pchar.quest.prison_opening2 = "river";

				if(IsOfficerType(characterFromID("Pell"))) 
				{ ChangeCharacterAddressGroup(characterFromID("Pell"), "bb_prison2", "goto", "river_pell"); }
				if(CheckAttribute(Pchar, "P2_maroons") && Pchar.P2_maroons == "free")
				{
					if(!LAi_IsDead(characterFromID("bb_maroon1")))
					{
						LAi_SetStayType(characterFromID("bb_maroon1"));
						ChangeCharacterAddressGroup(characterFromID("bb_maroon1"), "bb_prison2", "quest", "m1");
					}
					if(!LAi_IsDead(characterFromID("bb_maroon2")))
					{
						LAi_SetStayType(characterFromID("bb_maroon2"));
						ChangeCharacterAddressGroup(characterFromID("bb_maroon2"), "bb_prison2", "quest", "m2");
					}
					
					if(CheckAttribute(Pchar, "P2_ambush") && Pchar.P2_ambush != "on")
					{
						if(!LAi_IsDead(characterFromID("bb_maroon3")))
						{
							LAi_SetStayType(characterFromID("bb_maroon3"));
							ChangeCharacterAddressGroup(characterFromID("bb_maroon3"), "bb_prison2", "quest", "m3");
						}
						if(!LAi_IsDead(characterFromID("bb_maroon4")))
						{
							LAi_SetStayType(characterFromID("bb_maroon4"));
							ChangeCharacterAddressGroup(characterFromID("bb_maroon4"), "bb_prison2", "quest", "m4");
						}
					}
				}
			}
			else
			{
				if(CheckAttribute(Pchar, "prison2.water") && Pchar.prison2.water == "empty")
				{

				}
				else PlaySound("PEOPLE\step_water1.wav");

				ChangeCharacterAddressGroup(Pchar, "bb_prison2", "goto", "prison");
				Pchar.quest.prison_opening2 = "prison";
				if(IsOfficerType(characterFromID("Pell"))) 
				{ ChangeCharacterAddressGroup(characterFromID("Pell"), "bb_prison2", "goto", "prison_pell"); }
				if(CheckAttribute(Pchar, "P2_maroons") && Pchar.P2_maroons == "free")
				{
					if(CheckAttribute(Pchar, "P2_ambush") && Pchar.P2_ambush != "sewer")
					{
						if(!LAi_IsDead(characterFromID("bb_maroon1")))
						{
							ChangeCharacterAddressGroup(characterFromID("bb_maroon1"), "bb_prison2", "quest", "m1_back");
							LAi_SetOfficerType(characterFromID("bb_maroon1"));
						}
						if(!LAi_IsDead(characterFromID("bb_maroon2")))
						{
							ChangeCharacterAddressGroup(characterFromID("bb_maroon2"), "bb_prison2", "quest", "m2_back");
							LAi_SetOfficerType(characterFromID("bb_maroon2"));
						}
					}

					if(CheckAttribute(Pchar, "P2_ambush") && Pchar.P2_ambush != "on")
					{
						if(!LAi_IsDead(characterFromID("bb_maroon3")))
						{
							ChangeCharacterAddressGroup(characterFromID("bb_maroon3"), "bb_prison2", "quest", "m3_back");
							LAi_SetOfficerType(characterFromID("bb_maroon3"));
						}
						if(!LAi_IsDead(characterFromID("bb_maroon4")))
						{
							ChangeCharacterAddressGroup(characterFromID("bb_maroon4"), "bb_prison2", "quest", "m4_back");
							LAi_SetOfficerType(characterFromID("bb_maroon4"));
						}
					}
				}				
			}

			LAi_QuestDelay("bb_prison_opening2_start", 0.1);
		break;

		case "prison2_rope12":
			//fast/slow

			if(CheckAttribute(Pchar, "prison2.water"))
			{
				switch(Pchar.prison2.water)
				{
					case "empty":
						//no effect
						LAi_QuestDelay("pchar_huh", 0.1);
					break;

					case "slow":
						Pchar.prison2.water = "fast";
				//		LogIt("water = " + Pchar.prison2.water);
						PlaySound("NATURE\water_in.wav");
						Locations[FindLocation("bb_prison2")].models.always.l1 = "a5";
						Locations[FindLocation("bb_prison2")].models.always.river.uvslide.v0 = -0.1;		
					break;

					case "fast":
						Pchar.prison2.water = "slow";
				//		LogIt("water = " + Pchar.prison2.water);
						PlaySound("NATURE\water_out.wav");
						Locations[FindLocation("bb_prison2")].models.always.l1 = "";
						Locations[FindLocation("bb_prison2")].models.always.river.uvslide.v0 = -0.05;
						Locations[FindLocation("bb_prison2")].locators_radius.box.box7 = 0.7;
					break;
				}
			}
			return;
		break;

		case "prison2_rope11":
			//slow/empty

			if(CheckAttribute(Pchar, "prison2.water"))
			{
				switch(Pchar.prison2.water)
				{
					case "empty":
						Pchar.prison2.water = "slow";
				//		LogIt("water = " + Pchar.prison2.water);
						PlaySound("NATURE\water_in.wav");
						Locations[FindLocation("bb_prison2")].models.always.l1 = "";
						Locations[FindLocation("bb_prison2")].models.always.river = "a5";
						Locations[FindLocation("bb_prison2")].models.always.river.uvslide.v0 = -0.05;
					//Locations[FindLocation("bb_prison2")].locators_radius.box.box7 = 0.001;

						LAi_QuestDelay("prison_officer_back", 2.5);
					break;

					case "slow":
						Pchar.prison2.water = "empty";
				//		LogIt("water = " + Pchar.prison2.water);
						PlaySound("NATURE\water_out.wav");
						Locations[FindLocation("bb_prison2")].models.always.l1 = "";
						Locations[FindLocation("bb_prison2")].models.always.river = "";
						Locations[FindLocation("bb_prison2")].locators_radius.box.box7 = 0.7;

						LAi_QuestDelay("prison_officer_back", 3.5);
					break;

					case "fast":
						//no effect
						LAi_QuestDelay("pchar_huh", 0.1);

						LAi_QuestDelay("prison_officer_back", 1.5);
					break;
				}
			}
			return;
		break;

		case "prison_officer_back":
			Pchar.rope2_Tooks = "off";

			PlaySound("PEOPLE\run_wood.wav");
			ChangeCharacterAddressGroup(Pchar, "bb_prison_officer", "goto", "back");
		break;
//---------------------------------------------------------------------------------------------------	
		case "IronMaiden":
			Locations[FindLocation("bb_prison2")].image = "";
			DoQuestReloadToLocation("bb_prison2", "box", "box10", "IronMaiden1");
		break;

		case "IronMaiden1":
			PlaySound("INTERFACE\metal_hatch_open.wav");
			LAi_KillCharacter(Pchar);
		break;
//---------------------------------------------------------------------------------------------------	

		case "Pell_story":
			ChangeCharacterAddressGroup(characterFromID("Pell"), "bb_prison2", "box", "box4");

			Characters[GetCharacterIndex("Pell")].dialog.CurrentNode  = "story";
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorDialogNow(characterFromID("Pell"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Pell"));
		break;

		case "Pell_story_interrupted":
			ChangeCharacterAddressGroup(characterFromID("Tookerman"), "bb_prison2", "goto", "T-man");

			Characters[GetCharacterIndex("Tookerman")].dialog.CurrentNode  = "interrupt";
			LAi_SetActorType(characterFromID("Tookerman"));
			LAi_ActorDialogNow(characterFromID("Tookerman"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Tookerman"));
		break;

		case "Pell_story_interrupted_done":
			PlaySound("INTERFACE\glass1.wav");
			TakeNItems(Pchar,"cognac", -1);
			
			LAi_QuestDelay("Pell_story_interrupted_done0", 0.5);
			LAi_QuestDelay("Pell_story_interrupted_done1", 1.0);
		break;

		case "Pell_story_interrupted_done0":
			PlaySound("INTERFACE\glass1.wav");
			TakeNItems(Pchar,"cognac", -1);
		break;

		case "Pell_story_interrupted_done1":
			PlaySound("VOICE\ENGLISH\gr_WR_offer1.wav");
			LAi_SetActorType(characterFromID("Tookerman"));
			LAi_ActorGoToLocator(characterFromID("Tookerman"), "box", "box5", "Pell_story_interrupted_done2", 5.0);
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "prison_pell");

			LAi_QuestDelay("Pell_story5", 7.0);
		break;

		case "Pell_story_interrupted_done2":
			PlaySound("PEOPLE\counter_openclose.wav");
			ChangeCharacterAddressGroup(characterFromID("Tookerman"), "bb_prison_officer", "sit", "sit2");
			LAi_SetSitType(characterFromID("Tookerman"));
			Locations[FindLocation("bb_prison2")].reload.l2.disable = 0;	//open to officer

			pchar.quest.Took_sober.win_condition.l1 = "location";
			pchar.quest.Took_sober.win_condition.l1.location = "bb_prison_officer";
			pchar.quest.Took_sober.win_condition = "Took_sober";
		break;
	//----------------------------------------------------------------------------------------------

		case "Took_sober":
			if(CheckAttribute(Pchar, "Pell_story") && Pchar.Pell_story == "done")
			{
				if(CheckAttribute(Pchar, "P2_sewer") && Pchar.P2_sewer == "checked")
				{
					return;
				}
			}

			PlaySound("VOICE\ENGLISH\gr_WR_host8.wav");
			LAi_SetStayType(Pchar);
			LAi_SetStayType(characterFromID("Tookerman"));
			ChangeCharacterAddressGroup(characterFromID("Tookerman"), "bb_prison_officer", "goto", "stay1");
					
			LAi_QuestDelay("Took_sit_office", 4.5);

			pchar.quest.Took_soberX.win_condition.l1 = "location";
			pchar.quest.Took_soberX.win_condition.l1.location = "bb_prison2";
			pchar.quest.Took_soberX.win_condition = "Took_soberX";
		break;

		case "Took_sit_office":
			PlaySound("PEOPLE\creak2.wav");
			ChangeCharacterAddressGroup(characterFromID("Tookerman"), "bb_prison_officer", "sit", "sit2");
			LAi_SetSitType(characterFromID("Tookerman"));
		break;

		case "Took_soberX":
			LAi_SetPlayerType(Pchar);

			pchar.quest.Took_sober.win_condition.l1 = "location";
			pchar.quest.Took_sober.win_condition.l1.location = "bb_prison_officer";
			pchar.quest.Took_sober.win_condition = "Took_sober";
		break;
	//----------------------------------------------------------------------------------------------
		case "Pell_story5":
			Characters[GetCharacterIndex("Pell")].dialog.CurrentNode  = "story5";
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorDialogNow(characterFromID("Pell"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Pell"));
		break;

		case "Pell_story_told":
			AddQuestRecord("Israel_Hands", "6");
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");

			LAi_QuestDelay("Pell_exit", 3.0);
		break;

		case "Pell_exit":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "Pell_exit";
			LAi_ActorSelfDialog(pchar, "");
		break;	

		case "Pell_exit_done":
			AddQuestRecord("Israel_Hands", "7");
			LAi_SetPlayerType(Pchar);
			Pchar.P2_box3 = "off";
			Pchar.Pell_story = "done";
			LAi_SetStayType(characterFromID("Pell"));
			Characters[GetCharacterIndex("Pell")].dialog.CurrentNode  = "neutral_cell";

			LAi_QuestDelay("Took_drunk_check", 0.1);//also done from SL_utils P2 box9 sewer
		break;
	//---------------------------------------------------------------------------------------------------
		case "need_tools":
			AddQuestRecord("Israel_Hands", "10");
			LAi_SetPlayerType(Pchar);
		break;
	//---------------------------------------------------------------------------------------------------
		case "Took_drunk_check":
			if(CheckAttribute(Pchar, "Pell_story") && Pchar.Pell_story == "done")
			{
				if(CheckAttribute(Pchar, "P2_sewer") && Pchar.P2_sewer == "checked")
				{	
					ChangeCharacterAddressGroup(characterFromID("Tookerman"), "bb_prison_officer", "goto", "back");
					LAi_SetActorType(characterFromID("Tookerman"));
					LAi_ActorSetLayMode(characterFromID("Tookerman"));
					RemoveCharacterEquip(characterFromID("Tookerman"), GUN_ITEM_TYPE);
					RemoveCharacterEquip(characterFromID("Tookerman"), BLADE_ITEM_TYPE);
					DeleteAttribute(characterFromID("Tookerman"), "items");

					pchar.quest.Took_snoring.win_condition.l1 = "location";
					pchar.quest.Took_snoring.win_condition.l1.location = "bb_prison_officer";
					pchar.quest.Took_snoring.win_condition = "Took_snoring";
				}
			}
		break;

		case "Took_snoring":
			if(CheckAttribute(Pchar,"Took_Pyle_outfit") && Pchar.Took_Pyle_outfit == "placed") 
			{
				//do nothing
			}
			else
			{
				//place pchar outfit upgrades here (once)
				Pchar.Took_Pyle_outfit = "placed";
				
				if(CheckAttribute(Pchar,"model"))
				{
					switch(Pchar.model)
					{
						case "Howard_Pyle_3":
							locations[FindLocation(Pchar.location)].box6.items.socks_sewing = 1;	
						break;

						case "Howard_Pyle_4":
							locations[FindLocation(Pchar.location)].box6.items.waistcoat = 1;	
						break;

						case "Howard_Pyle_5":
							locations[FindLocation(Pchar.location)].box6.items.sash = 1;	
						break;
					}
				}
			}

			if(CheckAttribute(Pchar, "P2_ambush") && Pchar.P2_ambush == "cell") return;	//brakes the snoring loop

			if(Pchar.location == "bb_prison_officer")
			{
				PlaySound("PEOPLE\snoring.wav");

				LAi_QuestDelay("Took_snoring", 3.5);
			}
			else
			{
				//no snoring please

				pchar.quest.Took_snoring.win_condition.l1 = "location";
				pchar.quest.Took_snoring.win_condition.l1.location = "bb_prison_officer";
				pchar.quest.Took_snoring.win_condition = "Took_snoring";
			}
		break;

//---------------------------------------------------------------------------------------------------	
//JRH Vane about Richards

		case "Vane_Richards_from game":
			Pchar.quest.disable_rebirth = true;
			Locations[FindLocation("wr_cave_shore")].models.always.locators = "Shore04_l_JRHsea";

			Locations[FindLocation("wr_cave_shore")].locators_radius.reload.reload1 = 0.0001;
			locations[FindLocation("wr_cave_shore")].reload.l2.disable = 1;
			locations[FindLocation("wr_cave_shore")].reload.l33.disable = 1;
			locations[FindLocation("wr_cave_shore")].reload.l11.disable = 0;
			locations[FindLocation("wr_cave_shore")].reload.l111.disable = 0;

			GiveShip2Character(characterFromID("pir_cap2"),"obj_invisible","",-1,PIRATE,true,true);
			GiveShip2Character(characterFromID("pir_cap3"),"obj_invisible","",-1,PIRATE,true,true);
			GiveShip2Character(characterFromID("pir_cap4"),"obj_invisible","",-1,PIRATE,true,true);
			GiveShip2Character(characterFromID("pir_cap5"),"obj_invisible","",-1,PIRATE,true,true);
			GiveShip2Character(characterFromID("pir_cap6"),"obj_invisible","",-1,PIRATE,true,true);
			GiveShip2Character(characterFromID("pir_cap7"),"obj_invisible","",-1,PIRATE,true,true);
			GiveShip2Character(characterFromID("pir_cap8"),"obj_invisible","",-1,PIRATE,true,true);
			GiveShip2Character(characterFromID("pir_cap9"),"obj_invisible","",-1,PIRATE,true,true);
			GiveShip2Character(characterFromID("pir_cap10"),"obj_invisible","",-1,PIRATE,true,true);
			GiveShip2Character(characterFromID("pir_cap12"),"obj_invisible","",-1,PIRATE,true,true);
			GiveShip2Character(characterFromID("pir_cap13"),"obj_invisible","",-1,PIRATE,true,true);
			GiveShip2Character(characterFromID("pir_cap14"),"obj_invisible","",-1,PIRATE,true,true);
			GiveShip2Character(characterFromID("pir_cap15"),"obj_invisible","",-1,PIRATE,true,true);
			GiveShip2Character(characterFromID("pir_cap17"),"obj_invisible","",-1,PIRATE,true,true);
			GiveShip2Character(characterFromID("pir_cap18"),"obj_invisible","",-1,PIRATE,true,true);
			GiveShip2Character(characterFromID("pir_cap21"),"obj_invisible","",-1,PIRATE,true,true);

			SetCharacterShipLocation(characterFromID("pir_cap1"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap2"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap3"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap4"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap5"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap6"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap7"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap8"), "wr_cave_shore");
			
			SetCharacterShipLocation(characterFromID("pir_cap9"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap10"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap11"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap12"), "wr_cave_shore");
		
			SetCharacterShipLocation(characterFromID("pir_cap13"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap14"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap15"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap16"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap17"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap18"), "wr_cave_shore");
		
			SetCharacterShipLocation(characterFromID("pir_cap19"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap20"), "wr_cave_shore");
			SetCharacterShipLocation(characterFromID("pir_cap21"), "wr_cave_shore");
			
			ChangeCharacterAddressGroup(characterFromID("pir_cap2"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap3"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap4"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap5"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap6"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap7"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap8"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap9"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap10"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap11"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap14"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap15"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap16"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap17"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap20"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap21"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap22"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap23"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap24"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap27"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap28"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap29"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap30"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap31"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap32"), "none", "", "");
		break;

		case "Vane_Richards_from_jumpstart_and_game":
			Locations[FindLocation("wr_cavern")].models.always.locators = "cavern_l_JRH_air_closed";
			Locations[FindLocation("wr_church_outside")].models.always.locators = "Pirl_l_JRH_outside_rum2";
			locations[FindLocation("wr_Cavern")].reload.l1.disable = 0;
			locations[FindLocation("wr_Cavern")].reload.l2.disable = 0;
			Locations[FindLocation("wr_Cavern")].locators_radius.box.box1 = 0.001;

			Locations[FindLocation("wr_church_inside")].reload.l2.disable = 1;
			Locations[FindLocation("wr_church_inside")].reload.l3.disable = 1;
			Locations[FindLocation("wr_church_inside")].reload.l8.disable = 1;
			Locations[FindLocation("wr_church_inside")].reload.l1.emerge = "richards";
			Locations[FindLocation("wr_church_outside")].locators_radius.box.box1 = 0.5;

			locations[FindLocation("wr_chapel_stairs")].id.label = "Chapel stairs";

			ChangeCharacterAddressGroup(characterFromID("pir_cap1"), "wr_church_outside", "goto", "taylor");
			ChangeCharacterAddressGroup(characterFromID("pir_cap18"), "wr_church_outside", "goto", "rackham");
			ChangeCharacterAddressGroup(characterFromID("pir_cap26"), "wr_church_outside", "goto", "read");
			ChangeCharacterAddressGroup(characterFromID("pir_cap25"), "wr_cave_shore", "goto", "flag_pole");

			ChangeCharacterAddressGroup(characterFromID("pir_cap13"), "wr_cave_shore", "goto", "guard");
			ChangeCharacterAddressGroup(characterFromID("pir_cap19"), "wr_cave_shore", "goto", "guard2");
			ChangeCharacterAddressGroup(characterFromID("pir_cap12"), "wr_church_outside", "officers", "reload2_2");


			LAi_SetPoorType(characterFromID("pir_cap1"));
			LAi_SetStayType(characterFromID("pir_cap18"));
			LAi_SetPoorType(characterFromID("pir_cap26"));
			LAi_SetStayType(characterFromID("pir_cap12"));
			LAi_SetStayType(characterFromID("pir_cap13"));
			LAi_SetStayType(characterFromID("pir_cap19"));
			LAi_SetStayType(characterFromID("pir_cap25"));

			pchar.quest.Vane_Richards0.win_condition.l1 = "locator";
			pchar.quest.Vane_Richards0.win_condition.l1.location = "wr_church_outside";
			pchar.quest.Vane_Richards0.win_condition.l1.locator_group = "goto";
			pchar.quest.Vane_Richards0.win_condition.l1.locator = "richards";
			pchar.quest.Vane_Richards0.win_condition = "Vane_Richards0";
		break;

		case "Vane_Richards0":
			LAi_SetStayType(Pchar);

			PauseAllSounds();//stops music
			locations[FindLocation("wr_church_outside")].type = "silent_jungle";
			PostEvent("LoadSceneSound", 0.1);

			LAi_QuestDelay("Vane_Richards1", 2.0);
			LAi_QuestDelay("Vane_boiling_loop", 0.2);
		break;

		case "Vane_Richards1":
			Characters[GetCharacterIndex("pir_cap18")].dialog.CurrentNode  = "about_Richards";
			LAi_SetActorType(characterFromID("pir_cap18"));
			LAi_ActorTurnToCharacter(characterFromID("pir_cap18"), PChar);
			LAi_ActorDialogNow(characterFromID("pir_cap18"), pchar, "", 2.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap18"));
		break;

		case "Vane_Richards2":
			PlaySound("VOICE\ENGLISH\pir_capR4.wav");

			LAi_QuestDelay("Vane_Richards3", 3.0);
		break;

		case "Vane_Richards3":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(PChar, characterFromID("pir_cap1"));

			LAi_QuestDelay("Vane_Richards4", 1.0);
		break;
		
		case "Vane_Richards4":
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "about_Richards4";
			LAi_SetActorType(characterFromID("pir_cap1"));
			LAi_ActorTurnToCharacter(characterFromID("pir_cap1"), PChar);
			LAi_ActorDialogNow(characterFromID("pir_cap1"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
		break;
	
		case "Vane_Richards5":
			PlaySound("VOICE\ENGLISH\pir_capR10.wav");

			LAi_QuestDelay("Vane_Richards6", 2.5);
		break;

		case "Vane_Richards6":
			Characters[GetCharacterIndex("pir_cap26")].dialog.CurrentNode  = "about_Richards6";
			LAi_SetActorType(characterFromID("pir_cap26"));
			LAi_ActorTurnToCharacter(characterFromID("pir_cap26"), PChar);
			LAi_ActorDialogNow(characterFromID("pir_cap26"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap26"));
		break;
	
		case "Vane_Richards8":
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "about_Richards8";
			LAi_SetActorType(characterFromID("pir_cap1"));
			LAi_ActorDialogNow(characterFromID("pir_cap1"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
		break;

		case "Vane_Richards9":
			Characters[GetCharacterIndex("pir_cap18")].dialog.CurrentNode  = "about_Richards9";
			LAi_SetActorType(characterFromID("pir_cap18"));
			LAi_ActorTurnToCharacter(characterFromID("pir_cap18"), PChar);
			LAi_ActorDialogNow(characterFromID("pir_cap18"), pchar, "", 2.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap18"));
		break;

		case "Vane_Richards10":
			Characters[GetCharacterIndex("pir_cap26")].dialog.CurrentNode  = "about_Richards10";
			LAi_SetActorType(characterFromID("pir_cap26"));
			LAi_ActorTurnToCharacter(characterFromID("pir_cap26"), PChar);
			LAi_ActorDialogNow(characterFromID("pir_cap26"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap26"));
		break;

		case "Vane_Richards11":
			PlaySound("VOICE\ENGLISH\Eng_f_c_007.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_church_outside", "reload", "reload9");
			LAi_SetPlayerType(Pchar);
			PlaySound3D("INTERFACE\steam2.wav", 24.0, 2.7, -9.0);

			LAi_QuestDelay("Vane_Richards12", 3.0);
			LAi_QuestDelay("Vane_rum_explosion", 4.0);
		break;

		case "Vane_Richards12":
			if(Pchar.location == "wr_church_outside")
			{
				PlaySound("OBJECTS\VOICES\DEAD\male\dead1.wav");
			}
		break;

		case "Vane_rum_explosion":
			if(Pchar.location == "wr_church_inside")
			{
				//you survive

				PlayStereoSound("OBJECTS\SHIPCHARGE\gunpowder_explosion.wav");
				PlaySound("OBJECTS\SHIPCHARGE\cannon_fire1.wav");

				Locations[FindLocation("wr_church_inside")].reload.l1.disable = 1;

				Locations[FindLocation("wr_church_outside")].models.always.locators = "Pirl_l_JRH_outside_explosion";
				ChangeCharacterAddressGroup(characterFromID("pir_cap18"), "wr_church_outside", "goto", "richards");

				LAi_SetActorType(characterFromID("pir_cap1"));
				LAi_SetActorType(characterFromID("pir_cap18"));
				LAi_SetActorType(characterFromID("pir_cap26"));
				LAi_ActorSetLayMode(characterFromID("pir_cap1"));
				LAi_ActorSetLayMode(characterFromID("pir_cap18"));
				LAi_ActorSetLayMode(characterFromID("pir_cap26"));

				LAi_QuestDelay("pchar_puh", 2.0);

				Pchar.quest.Vane_rum_explosion1.win_condition.l1 = "Location";
				Pchar.quest.Vane_rum_explosion1.win_condition.l1.location = "wr_church_outside";
				Pchar.quest.Vane_rum_explosion1.win_condition = "Vane_rum_explosion1";
			}
			else
			{
				//you die

				PauseAllSounds();
				PlaySound("OBJECTS\DUEL\pistol_musket.wav");
				PlaySound("OBJECTS\SHIPCHARGE\cannon_fire1.wav");
				PlaySound("OBJECTS\SHIPCHARGE\LG42H.wav");
				PlayStereoSound("OBJECTS\SHIPCHARGE\gunpowder_explosion.wav");
				PlaySound("PEOPLE\roof_broken2.wav");

				u = 23.9; v = 3.9; w = -5.4;

				CreateParticleSystem("fort_fire" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("fort_fire" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("fort_fire" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("fort_fire" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("fort_fire" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

				CreateParticleSystem("canfire" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("canfire" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("canfire" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("canfire" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("canfire" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

				CreateParticleSystem("gunfire_red" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("gunfire_red" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("gunfire_red" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("gunfire_red" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("gunfire_red" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

				CreateParticleSystem("stars_fire" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("stars_fire" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("stars_fire" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("stars_fire" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("stars_fire" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

				CreateParticleSystem("cancloud" , u-0.5, v, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("cancloud" , u-0.1, v+1.8, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("cancloud" , u-0.3, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("cancloud" , u-0.2, v+1.0, w-0.5, 0.0, 0.0, 0.0, sti(20) );
				CreateParticleSystem("cancloud" , u, v+1.0, w+0.5, 0.0, 0.0, 0.0, sti(20) );

				CreateParticleSystem("splinters", u, v+1.8, W, 0.0, 0.0, 0.0, 0);
				CreateParticleSystem("splinters", u-0.5, v+1.0, W, 0.0, 0.0, 0.0, 0);
				CreateParticleSystem("splinters2", u, v+1.8, w, 0.0, 0.0, 0.0, 0);
				CreateParticleSystem("splinters2", u-0.5, v+1.0, w, 0.0, 0.0, 0.0, 0);

				LAi_QuestDelay("Vane_black_smoke", 0.1);

				LAi_KillCharacter(Pchar);
				LAi_KillCharacter(characterFromID("pir_cap1"));
				LAi_KillCharacter(characterFromID("pir_cap18"));
				LAi_KillCharacter(characterFromID("pir_cap26"));
			}

			Pchar.Vane_black_smoke = "yes";
		break;

		case "Vane_rum_explosion1":
			LAi_QuestDelay("Vane_black_smoke", 0.1);
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "quest", "quest1", "Vane_rum_explosion2", 6.0);

			LAi_SetActorType(characterFromID("pir_cap12"));
			LAi_ActorTurnToCharacter(characterFromID("pir_cap12"), characterFromID("pir_cap18"));

			ChangeCharacterAddressGroup(characterFromID("pir_cap13"), "wr_church_outside", "reload", "reload1");
			ChangeCharacterAddressGroup(characterFromID("pir_cap19"), "wr_church_outside", "reload", "reload1");
			LAi_SetOfficerType(characterFromID("pir_cap13"));
			LAi_SetOfficerType(characterFromID("pir_cap19"));
		break;

		case "Vane_rum_explosion2":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead0.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_church_outside", "quest", "quest1");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("Vane_rum_explosion3A", 2.0);
		break;

		case "Vane_rum_explosion3A":
			LAi_SetPoorType(characterFromID("pir_cap26"));
			PlaySound("OBJECTS\VOICES\DEAD\female\dead_wom5.wav");

			LAi_QuestDelay("Vane_rum_explosion3B", 2.0);
		break;

		case "Vane_rum_explosion3B":
			LAi_SetStayType(characterFromID("pir_cap26"));
			PlaySound("VOICE\ENGLISH\Eng_f_c_020.wav");

			LAi_QuestDelay("Vane_rum_explosion4A", 3.0);
		break;

		case "Vane_rum_explosion4A":
			LAi_SetPoorType(characterFromID("pir_cap1"));
			PlaySound("OBJECTS\VOICES\DEAD\male\dead3.wav");

			LAi_QuestDelay("Vane_rum_explosion4B", 2.0);
		break;

		case "Vane_rum_explosion4B":
			LAi_SetStayType(characterFromID("pir_cap1"));
			PlaySound("VOICE\ENGLISH\pir_capR11.wav");

			LAi_QuestDelay("Vane_rum_explosion5", 3.0);
		break;

		case "Vane_rum_explosion5":
			Characters[GetCharacterIndex("pir_cap26")].dialog.CurrentNode  = "Rackham1";
			LAi_SetActorType(characterFromID("pir_cap26"));
			LAi_ActorDialogNow(characterFromID("pir_cap26"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap26"));
		break;

		case "Vane_rum_explosion6":
			PlaySound("VOICE\ENGLISH\pir_capR7.wav");

			LAi_QuestDelay("Vane_rum_explosion7", 3.0);
		break;

		case "Vane_rum_explosion7":
			LAi_SetPoorType(characterFromID("pir_cap18"));
			PlaySound("OBJECTS\VOICES\DEAD\male\dead7.wav");

			LAi_QuestDelay("Vane_rum_explosion8", 2.0);
		break;

		case "Vane_rum_explosion8":
			LAi_SetActorType(characterFromID("pir_cap18"));
			LAi_ActorTurnToLocator(characterFromID("pir_cap18"), "reload", "reload9");
			PlaySound("VOICE\ENGLISH\pir_capP.wav");

			LAi_QuestDelay("Vane_rum_explosion9", 2.5);
		break;

		case "Vane_rum_explosion9":
			PlaySound("VOICE\ENGLISH\pir_capR1.wav");
			LAi_SetActorType(characterFromID("pir_cap1"));
			LAi_ActorTurnToCharacter(characterFromID("pir_cap1"), characterFromID("pir_cap18"));

			LAi_QuestDelay("Vane_rum_explosion10", 2.5);
		break;

		case "Vane_rum_explosion10":			
			Characters[GetCharacterIndex("pir_cap18")].dialog.CurrentNode  = "I_am";
			LAi_SetActorType(characterFromID("pir_cap18"));
			LAi_ActorDialogNow(characterFromID("pir_cap18"), pchar, "", 2.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap18"));
		break;

		case "Vane_rum_explosion11":			
			PlaySound("VOICE\ENGLISH\pir_capR2.wav");

			LAi_QuestDelay("Vane_rum_explosion12", 2.5);
		break;

		case "Vane_rum_explosion12":
			Characters[GetCharacterIndex("pir_cap26")].dialog.CurrentNode  = "Rackham2";
			LAi_SetActorType(characterFromID("pir_cap26"));
			LAi_ActorDialogNow(characterFromID("pir_cap26"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap26"));
		break;

		case "Vane_rum_explosion13":
			PlaySound("VOICE\ENGLISH\pir_capR4.wav");

			LAi_QuestDelay("Vane_rum_explosion14", 3.5);
		break;

		case "Vane_rum_explosion14":
			PlaySound("VOICE\ENGLISH\pir_capFFF.wav");

			LAi_QuestDelay("Vane_rum_explosion15", 3.5);
		break;

		case "Vane_rum_explosion15":
			Characters[GetCharacterIndex("pir_cap26")].dialog.CurrentNode  = "Rackham3";
			LAi_SetActorType(characterFromID("pir_cap26"));
			LAi_ActorDialogNow(characterFromID("pir_cap26"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap26"));
		break;

		case "Vane_rum_explosion16":
			PlaySound("VOICE\ENGLISH\pir_capB.wav");

			LAi_QuestDelay("Vane_rum_explosion17", 2.5);
		break;

		case "Vane_rum_explosion17":
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "Rackham_sail";
			LAi_SetActorType(characterFromID("pir_cap1"));
			LAi_ActorDialogNow(characterFromID("pir_cap1"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
		break;

		case "Vane_rum_explosion18":
			PlaySound("VOICE\ENGLISH\pir_capMMM.wav");

			LAi_QuestDelay("Vane_rum_explosion19", 2.5);
		break;

		case "Vane_rum_explosion19":
			PlaySound("VOICE\ENGLISH\Eng_f_c_018.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("pir_cap26"));

			LAi_QuestDelay("Vane_rum_explosion20", 2.5);
		break;

		case "Vane_rum_explosion20":
			PlaySound("VOICE\ENGLISH\pir_capCC.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("pir_cap18"));

			LAi_QuestDelay("Vane_rum_explosion21", 2.5);
		break;

		case "Vane_rum_explosion21":
			PlaySound("AMBIENT\cheer2.wav");
			LAi_SetPlayerType(Pchar);
			Pchar.Vane_black_smoke = "no";

			LAi_QuestDelay("Vane_rum_explosion22", 5.0);
		break;

		case "Vane_rum_explosion22":
			Characters[GetCharacterIndex("pir_cap1")].dialog.CurrentNode  = "back_to_posts";
			LAi_SetActorType(characterFromID("pir_cap1"));
			LAi_ActorTurnToCharacter(characterFromID("pir_cap1"), PChar);
			LAi_ActorDialogNow(characterFromID("pir_cap1"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("pir_cap1"));
		break;

		case "Vane_rum_explosion23":
			locations[FindLocation("wr_church_outside")].type = "Vane_jungle";
			PostEvent("LoadSceneSound", 0);

			ChangeCharacterAddressGroup(characterFromID("pir_cap12"), "wr_church_outside", "officers", "reload2_2");
			LAi_SetStayType(characterFromID("pir_cap12"));
			LAi_SetActorType(characterFromID("pir_cap13"));
			LAi_SetActorType(characterFromID("pir_cap19"));
			LAi_ActorRunToLocator(characterFromID("pir_cap13"), "reload", "reload1", "Vane_rum_explosion24", 10.0);
			LAi_ActorRunToLocator(characterFromID("pir_cap19"), "reload", "reload1", "Vane_rum_explosion24", 10.0);
		break;

		case "Vane_rum_explosion24":
			ChangeCharacterAddressGroup(characterFromID("pir_cap13"), "wr_cave_shore", "goto", "guard");
			ChangeCharacterAddressGroup(characterFromID("pir_cap19"), "wr_cave_shore", "goto", "guard2");
			LAi_SetStayType(characterFromID("pir_cap13"));
			LAi_SetStayType(characterFromID("pir_cap19"));

			Pchar.quest.Vane_rum_explosion25.win_condition.l1 = "Location";
			Pchar.quest.Vane_rum_explosion25.win_condition.l1.location = "wr_cavern";
			Pchar.quest.Vane_rum_explosion25.win_condition = "Vane_rum_explosion25";
		break;

		case "Vane_rum_explosion25":
			ChangeCharacterAddressGroup(characterFromID("pir_cap1"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap18"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("pir_cap26"), "none", "", "");
		break;

	//---------------------------------------------------------------------------
		case "Vane_boiling_loop":
			if(Pchar.location == "wr_church_outside")
			{
				PlaySound3D("INTERFACE\rumble1.wav", 24.0, 2.7, -6.0);		//z was -3
				if(CheckAttribute(Pchar,"Vane_boiling_bubbles") && Pchar.Vane_boiling_bubbles == "yes")
				{
					PlaySound3D("INTERFACE\bubbles2.wav", 24.0, 2.7, 0.0);	
				}
				if(CheckAttribute(Pchar,"Vane_boiling_steam") && Pchar.Vane_boiling_steam == "yes")
				{
					PlaySound3D("INTERFACE\steam1.wav", 24.0, 2.7, -9.0);
					PlaySound3D("INTERFACE\steam1.wav", 24.0, 2.7, -9.0);
				}
				
				LAi_QuestDelay("Vane_boiling_loop", 4.7);
			}
			else return;
		break;

		case "Vane_black_smoke":
			CreateParticleSystem("smoke_inv" , 24.8, 2.7, -4.0, 5.1, 4.0, 0.0, sti(20) );

			if(CheckAttribute(Pchar,"Vane_black_smoke") && Pchar.Vane_black_smoke == "yes")
			{
				LAi_QuestDelay("Vane_black_smoke", 5.0);
			}
		break;

//---------------------------------------------------------------------------------------------------	
//JRH surgeons
		case "Tortuga_surgeons_start":
			Pchar.Tsurgeon = "yes";	//for citizens dialog hint

			//next 2 lines must be read before you arrive to Tortuga
			Locations[FindLocation("Tortuga_port")].models.day.locators = "Tortuga_l_day_JRH";
			Locations[FindLocation("Tortuga_port")].models.night.locators = "Tortuga_l_night_JRH";

			pchar.quest.french_surgeon2.win_condition.l1 = "locator";
			pchar.quest.french_surgeon2.win_condition.l1.location = "Tortuga_surgeon2";
			pchar.quest.french_surgeon2.win_condition.l1.locator_group = "goto";
			pchar.quest.french_surgeon2.win_condition.l1.locator = "gotoQ2";
			pchar.quest.french_surgeon2.win_condition = "french_surgeon2";

			pchar.quest.french_surgeon3.win_condition.l1 = "locator";
			pchar.quest.french_surgeon3.win_condition.l1.location = "Tortuga_gunsmith_workshop";
			pchar.quest.french_surgeon3.win_condition.l1.locator_group = "goto";
			pchar.quest.french_surgeon3.win_condition.l1.locator = "gunsmith2";
			pchar.quest.french_surgeon3.win_condition = "french_surgeon3";

			pchar.quest.french_surgeon1.win_condition.l1 = "locator";
			pchar.quest.french_surgeon1.win_condition.l1.location = "Tortuga_surgeon1";
			pchar.quest.french_surgeon1.win_condition.l1.locator_group = "goto";
			pchar.quest.french_surgeon1.win_condition.l1.locator = "goto4";
			pchar.quest.french_surgeon1.win_condition = "french_surgeon1";
		break;
	//.................................................................................................
		case "french_surgeon2":
			LAi_SetActorType(characterFromID("french_surgeon2"));
			LAi_ActorDialog(characterFromID("french_surgeon2"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("french_surgeon2"));
		break;

		case "leave_french_surgeon2":
			if(!CheckAttribute(Pchar,"qbook.richards5") || Pchar.qbook.richards5 != "done")
			{
				AddQuestRecord("Richards","5");
				Pchar.qbook.richards5 = "done";
			}

			Pchar.Tgunsmith = "yes";
			
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload4");

			LAi_QuestDelay("leave_french_surgeon2_A", 1.5);
		break;

		case "leave_french_surgeon2_A":
			PlaySound("PEOPLE\run_wood.wav");
			ChangeCharacterAddressGroup(Pchar, "Tortuga_surgeon2", "reload", "reload4");
			LAi_SetPlayerType(Pchar);

			pchar.quest.leave_french_surgeon2_B.win_condition.l1 = "location";
			pchar.quest.leave_french_surgeon2_B.win_condition.l1.location = "Tortuga_port";
			pchar.quest.leave_french_surgeon2_B.win_condition = "leave_french_surgeon2_B";
		break;

		case "leave_french_surgeon2_B":
		//	Characters[GetCharacterIndex("french_surgeon2")].dialog.CurrentNode  = "french_surgeon2_E";

			pchar.quest.french_surgeon2.win_condition.l1 = "locator";
			pchar.quest.french_surgeon2.win_condition.l1.location = "Tortuga_surgeon2";
			pchar.quest.french_surgeon2.win_condition.l1.locator_group = "goto";
			pchar.quest.french_surgeon2.win_condition.l1.locator = "gotoQ2";
			pchar.quest.french_surgeon2.win_condition = "french_surgeon2";
		break;
	//.................................................................................................
		case "french_surgeon3":
			LAi_SetActorType(characterFromID("french_surgeon3"));
			LAi_ActorDialog(characterFromID("french_surgeon3"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("french_surgeon3"));
		break;

		case "leave_french_surgeon3":
			if(!CheckAttribute(Pchar,"qbook.richards7") || Pchar.qbook.richards7 != "done")
			{
				AddQuestRecord("Richards","7");
				Pchar.qbook.richards7 = "done";
			}

			Pchar.Tsailmaker = "yes";
			
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload3");

			LAi_QuestDelay("leave_french_surgeon3_A", 1.5);
		break;

		case "leave_french_surgeon3_A":
			PlaySound("PEOPLE\run_stone.wav");
			ChangeCharacterAddressGroup(Pchar, "Tortuga_gunsmith_workshop", "reload", "reload3");
			LAi_SetPlayerType(Pchar);

			pchar.quest.leave_french_surgeon3_B.win_condition.l1 = "location";
			pchar.quest.leave_french_surgeon3_B.win_condition.l1.location = "Tortuga_gunsmith_kitchen";
			pchar.quest.leave_french_surgeon3_B.win_condition = "leave_french_surgeon3_B";
		break;

		case "leave_french_surgeon3_B":
		//	Characters[GetCharacterIndex("french_surgeon3")].dialog.CurrentNode  = "french_surgeon3_F";

			pchar.quest.french_surgeon3.win_condition.l1 = "locator";
			pchar.quest.french_surgeon3.win_condition.l1.location = "Tortuga_gunsmith_workshop";
			pchar.quest.french_surgeon3.win_condition.l1.locator_group = "goto";
			pchar.quest.french_surgeon3.win_condition.l1.locator = "gunsmith2";
			pchar.quest.french_surgeon3.win_condition = "french_surgeon3";
		break;
	//.................................................................................................
		case "french_surgeon1":
			LAi_SetActorType(characterFromID("french_surgeon1"));
			LAi_ActorDialog(characterFromID("french_surgeon1"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("french_surgeon1"));
		break;

		case "leave_french_surgeon1":
			if(!CheckAttribute(Pchar,"qbook.richards9") || Pchar.qbook.richards9 != "done")
			{
				AddQuestRecord("Richards","9");
				Pchar.qbook.richards9 = "done";
			}

			Pchar.Tassistent = "yes";
			LAi_SetStayType(characterFromID("french_surgeon1"));
			
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload1");
	
			Locations[FindLocation("Tortuga_port")].locators_radius.box.box9 = 1.5;	

			LAi_QuestDelay("pchar_playertype", 1.5);
		break;
	//.................................................................................................
//Pär wagon girl
		case "Tortuga_carriage":
			if (makeint(environment.time) > 22.0 || makeint(environment.time) < 6.0)
			{
				PlaySound("PEOPLE\snoring.wav");

				LAi_QuestDelay("Tortuga_carriage_leave", 2.0);
			}
			else
			{
				SetNextWeather("Clear");
				Pchar.quest.JRH_rain = "Clear";
				Locations[FindLocation("Tortuga_port")].lockCamAngle = 0.0;
				ChangeCharacterAddressGroup(characterFromID("carriage_girl"), "Tortuga_port", "merchant", "carriage_girl");
		//		Locations[FindLocation("Tortuga_port")].image = "";
				Locations[FindLocation("Tortuga_port")].image = "wr_Tortuga_carriage.tga";
				DoQuestReloadToLocation("Tortuga_port", "merchant", "carriage_pyle", "Tortuga_carriage_inside");
			}
		break;

		case "Tortuga_carriage_inside":
			LAi_SetStayType(Pchar);
			Locations[FindLocation("Tortuga_port")].image = "Town_Tortuga.tga";		//reset

			LAi_QuestDelay("carriage_girl", 1.0);
		break;

		case "carriage_girl":
			LAi_SetActorType(characterFromID("carriage_girl"));
			LAi_ActorDialog(characterFromID("carriage_girl"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("carriage_girl"));
		break;

		case "carriage_girl_end":
			if(!CheckAttribute(Pchar,"qbook.richards11") || Pchar.qbook.richards11 != "done")
			{
				AddQuestRecord("Richards","11");
				Pchar.qbook.richards11 = "done";

				LAi_SetActorType(CharacterFromID("wr_pir13"));
				LAi_NoRebirthEnable(CharacterFromID("wr_pir13"));
				RemoveCharacterEquip(characterFromID("wr_pir13"), GUN_ITEM_TYPE);
				RemoveCharacterEquip(characterFromID("wr_pir13"), BLADE_ITEM_TYPE);
				DeleteAttribute(characterFromID("wr_pir13"), "items");
				GiveItem2Character(characterFromID("wr_pir13"), "bladeA17");
				EquipCharacterByItem(characterFromID("wr_pir13"), "bladeA17");
				GiveItem2Character(characterFromID("wr_pir13"), "bladekit");

				if(CheckAttribute(Pchar, "killed_wr_officers"))
				{
					switch(Pchar.killed_wr_officers)
					{
						case "0":
							GiveItem2Character(characterFromID("wr_pir13"), "pistol203");
							EquipCharacterByItem(characterFromID("wr_pir13"), "pistol203");
							GiveItem2Character(characterFromID("wr_pir13"), "ammobag1");
							TakenItems(characterFromID("wr_pir13"), "gunpowder", 2);
							TakenItems(characterFromID("wr_pir13"), "pistolbullets", 2);

							LAi_QuestDelay("Cook_items0_check", 0.1);
						break;

						case "1":
							GiveItem2Character(characterFromID("wr_pir13"), "pistol201");
							GiveItem2Character(characterFromID("wr_pir13"), "pistol204");
							EquipCharacterByItem(characterFromID("wr_pir13"), "pistol201");
							TakenItems(characterFromID("wr_pir13"), "gunpowder", 2);
							TakenItems(characterFromID("wr_pir13"), "pistolbullets", 2);

							LAi_QuestDelay("Cook_items1_check", 0.1);
						break;

						case "2":
							GiveItem2Character(characterFromID("wr_pir13"), "pistol205");
							GiveItem2Character(characterFromID("wr_pir13"), "pistol202");
							EquipCharacterByItem(characterFromID("wr_pir13"), "pistol205");
							TakenItems(characterFromID("wr_pir13"), "gunpowder", 2);
							TakenItems(characterFromID("wr_pir13"), "pistolbullets", 2);

							LAi_QuestDelay("Cook_items2_check", 0.1);
						break;

						case "3":
							GiveItem2Character(characterFromID("wr_pir13"), "pistol206");
							GiveItem2Character(characterFromID("wr_pir13"), "pistolbelt");
							EquipCharacterByItem(characterFromID("wr_pir13"), "pistol206");
							TakenItems(characterFromID("wr_pir13"), "gunpowder", 2);
							TakenItems(characterFromID("wr_pir13"), "pistolbullets", 2);

							LAi_QuestDelay("Cook_items3_check", 0.1);
						break;
					}
				}
			}

			Pchar.Ttower = "yes";
			port = &Locations[FindLocation("Tortuga_port")]; 
			if(CheckAttribute(port,"lockCamAngle") ) DeleteAttribute(port,"lockCamAngle"); 	
			SetNextWeather("Clear");
	 		DeleteAttribute(Pchar, "quest.JRH_rain");
	//Locations[FindLocation("Tortuga_port")].image = "Tortuga_port.tga";
			//RESET

			LAi_QuestDelay("no_rain_in_tower", 0.1);
		
			DoQuestReloadToLocation("Tortuga_port", "box", "box9", "carriage_girl_end2");
		break;

		case "carriage_girl_end2":
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(characterFromID("carriage_girl"), "none", "", "");
		break;
	
		//only if carriage is closed for night
		case "Tortuga_carriage_leave":
			PlaySound("PEOPLE\run_stone.wav");
			ChangeCharacterAddressGroup(Pchar, "Tortuga_port", "box", "box9");
		break;
//---------------------------------------------------------------------------------------------------	
		case "Tortuga_Cook_fight":
			PlaySound("PEOPLE\run_stone.wav");
			ChangeCharacterAddressGroup(CharacterFromID("wr_pir13"), "Tortuga_port", "quest", "fight2");
			DoQuickSave();
			LAi_SetImmortal(characterFromID("wr_pir13"), false);
			LAi_SetHP(CharacterFromID("wr_pir13"), 250.0, 250.0);
			
			LAi_QuestDelay("Tortuga_Cook_fight1", 0.7);
		break;

		case "Tortuga_Cook_fight1":
			PlaySound("VOICE\ENGLISH\Eng_m_c_012.wav");
			LAi_SetActorType(CharacterFromID("wr_pir13"));
			LAi_ActorAttack(CharacterFromID("wr_pir13"), Pchar, "");

			Pchar.quest.Tortuga_Cook_dead.win_condition.l1 = "NPC_Death";
			Pchar.quest.Tortuga_Cook_dead.win_condition.l1.character = "wr_pir13";
			Pchar.quest.Tortuga_Cook_dead.win_condition = "Tortuga_Cook_dead";
		break;

		case "Tortuga_Cook_dead":
			Pchar.Cook_dead = "yes";
			
			LAi_QuestDelay("Tortuga_Cook_dead1", 1.0);	
		break;

		case "Tortuga_Cook_dead1":
			if(LAi_IsFightMode(Pchar)) LAi_SetFightMode(PChar, false);

			LAi_QuestDelay("Tortuga_Cook_dead2", 2.0);	
		break;

		case "Tortuga_Cook_dead2":
			PlaySound("PEOPLE\run_stone.wav");
			ChangeCharacterAddressGroup(Pchar, "Tortuga_port", "quest", "fight2");	
		break;

		case "Cook_items0_check":
			if(CheckCharacterItem(Pchar,"pistol203") && CheckCharacterItem(Pchar,"ammobag1"))
			{
				LAi_QuestDelay("Tortuga_Cook_dead3", 0.1);
			}
			else LAi_QuestDelay("Cook_items0_check", 0.5);//loop check
		break;

		case "Cook_items1_check":
			if(CheckCharacterItem(Pchar,"pistol201") && CheckCharacterItem(Pchar,"pistol204"))
			{
				LAi_QuestDelay("Tortuga_Cook_dead3", 0.1);
			}
			else LAi_QuestDelay("Cook_items1_check", 0.5);//loop check
		break;

		case "Cook_items2_check":
			if(CheckCharacterItem(Pchar,"pistol205") && CheckCharacterItem(Pchar,"pistol202"))
			{
				LAi_QuestDelay("Tortuga_Cook_dead3", 0.1);
			}
			else LAi_QuestDelay("Cook_items2_check", 0.5);//loop check
		break;

		case "Cook_items3_check":
			if(CheckCharacterItem(Pchar,"pistol206") && CheckCharacterItem(Pchar,"pistolbelt"))
			{
				LAi_QuestDelay("Tortuga_Cook_dead3", 0.1);
			}
			else LAi_QuestDelay("Cook_items3_check", 0.5);//loop check
		break;

		case "Tortuga_Cook_dead3":
			PlaySound("PEOPLE\run_stone.wav");
			ChangeCharacterAddressGroup(Pchar, "Tortuga_port", "box", "box15");

			LAi_QuestDelay("TT_turn_box16", 0.5);	
		break;
//---------------------------------------------------------------------------------------------------	
	//TOWER TOUR START
		case "no_rain_in_tower":
			ChangeCharacterAddressGroup(characterFromID("Bertrand Ogeron"), "none", "", "");
			Locations[FindLocation("Tortuga_townhall")].reload.l3.disable = 0;	//tower passage	
			locations[FindLocation("Tortuga_tower_passage")].id.label = "Tower passage";

			pchar.quest.no_rain_in_tower.win_condition.l1 = "location";
			pchar.quest.no_rain_in_tower.win_condition.l1.location = "Tortuga_tower_passage";
			pchar.quest.no_rain_in_tower.win_condition = "no_rain_in_tower1";
		break;

		case "no_rain_in_tower1":
			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Clear";
		//logit("NO RAIN INSIDE");

			pchar.quest.no_rain_in_tower2.win_condition.l1 = "location";
			pchar.quest.no_rain_in_tower2.win_condition.l1.location = "Tortuga_townhall";
			pchar.quest.no_rain_in_tower2.win_condition = "no_rain_in_tower2";
		break;

		case "no_rain_in_tower2":
			SetNextWeather("Clear");
	 		DeleteAttribute(Pchar, "quest.JRH_rain");	
		//logit("RESET");
			pchar.quest.no_rain_in_tower.win_condition.l1 = "location";
			pchar.quest.no_rain_in_tower.win_condition.l1.location = "Tortuga_tower_passage";
			pchar.quest.no_rain_in_tower.win_condition = "no_rain_in_tower1";
		break;

	//WAY UP
		case "TT_turn_box12":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box12");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "TT_turn_box13":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box13");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "TT_turn_box14":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box14");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "TT_turn_box15":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box15");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "TT_turn_box16":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box16");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "TT_turn_box23":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box23");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "TT_turn_box30":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box30");

			LAi_QuestDelay("pchar_playertype", 1.0);
		break;

		case "TT_turn_tower_window":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "tower_window");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "Tortuga_dovecote_turn_to_ship5":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "ships_other", "ship5");

			Pchar.quest.Tortuga_dovecote_turn_to_ship5_A.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.Tortuga_dovecote_turn_to_ship5_A.win_condition.l1.location = "Tortuga_port";
			Pchar.quest.Tortuga_dovecote_turn_to_ship5_A.win_condition = "Tortuga_dovecote_turn_to_ship5_A";
		break;

		case "Tortuga_dovecote_turn_to_ship5_A":
			Pchar.quest.Tortuga_dovecote_turn_to_ship5.win_condition.l1 = "locator";
			Pchar.quest.Tortuga_dovecote_turn_to_ship5.win_condition.l1.location = "Tortuga_port";
			Pchar.quest.Tortuga_dovecote_turn_to_ship5.win_condition.l1.locator_group = "goto";
			Pchar.quest.Tortuga_dovecote_turn_to_ship5.win_condition.l1.locator = "dovecote1";
			Pchar.quest.Tortuga_dovecote_turn_to_ship5.win_condition = "Tortuga_dovecote_turn_to_ship5";
		break;

		case "Tortuga_dovecote_to_box12":
			PlaySound("PEOPLE\recoil.wav");		
			ChangeCharacterAddressGroup(Pchar, "Tortuga_port", "box", "box12");

			LAi_QuestDelay("pchar_playertype", 0.25);
		break;

		case "Tortuga_dovecote_to_box17":
			PlaySound("PEOPLE\recoil.wav");		
			ChangeCharacterAddressGroup(Pchar, "Tortuga_port", "box", "box17");

			LAi_QuestDelay("pchar_playertype", 0.25);
		break;

		case "Tortuga_dovecote_to_box25":
			PlaySound("PEOPLE\recoil.wav");		
			ChangeCharacterAddressGroup(Pchar, "Tortuga_port", "box", "box25");

			LAi_QuestDelay("pchar_playertype", 0.25);
		break;

		case "Tortuga_dovecote_to_dc4":
			PlaySound("PEOPLE\run_stone.wav");
			ChangeCharacterAddressGroup(Pchar, "Tortuga_port", "merchant", "dovecote4");
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("Ogeron_dovecote", 0.1);
		break;

		case "Ogeron_dovecote":
			LAi_SetActorType(characterFromID("fake_Ogeron"));
			LAi_ActorDialogNow(characterFromID("fake_Ogeron"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("fake_Ogeron"));
		break;

		case "Ogeron_done":
			LAi_SetActorType(characterFromID("french_surgeon4"));
			LAi_ActorDialog(characterFromID("french_surgeon4"), pchar, "", 1.5, 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("french_surgeon4"));
		break;
	//--------------------------------------------------------------------------------------------------
	//switch loading image Tortuga_port

		case "image_dovecote":
			Locations[FindLocation("Tortuga_port")].image = "wr_dovecote.tga";

			pchar.quest.image_outside.win_condition.l1 = "location";
			pchar.quest.image_outside.win_condition.l1.location = "Tortuga_tower_stairs_A";
			pchar.quest.image_outside.win_condition = "image_outside";
		break;

		case "image_outside":
			Locations[FindLocation("Tortuga_port")].image = "wr_Tortuga_tower_outside.tga";

			pchar.quest.image_dovecote.win_condition.l1 = "location";
			pchar.quest.image_dovecote.win_condition.l1.location = "Tortuga_tower_stairs_B";
			pchar.quest.image_dovecote.win_condition = "image_dovecote";
		break;
	//--------------------------------------------------------------------------------------------------
//monastary start
		case "leave_french_surgeon4":
			if(!CheckAttribute(Pchar,"qbook.richards13") || Pchar.qbook.richards13 != "done")
			{
				AddQuestRecord("Richards","13");
				Pchar.qbook.richards13 = "done";
				Locations[FindLocation("cloister_exit")].locators_radius.box.box1 = 2.0;	//opens WoodesRogers part
				Pchar.monastary = "Sister_Richards";
		
				pchar.quest.monastary_no_officers.win_condition.l1 = "location";
				pchar.quest.monastary_no_officers.win_condition.l1.location = "cloister_exit";
				pchar.quest.monastary_no_officers.win_condition = "monastary_no_officers";

				Pchar.quest.tape_found.win_condition.l1 = "item";
				Pchar.quest.tape_found.win_condition.l1.character = Pchar.id;
				Pchar.quest.tape_found.win_condition.l1.item = "tape";
				Pchar.quest.tape_found.win_condition = "tape_found";
			}

			Pchar.Tgovernor = "yes";

			LAi_QuestDelay("leave_french_surgeon4_A", 1.0);
		break;
		
		case "leave_french_surgeon4_A":
			PlaySound("PEOPLE\run_stone.wav");
			ChangeCharacterAddressGroup(Pchar, "Tortuga_port", "reload", "reloadQ7");

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "merchant", "dovecote3");

			LAi_QuestDelay("pchar_playertype", 1.0);
		break;

	//WAY DOWN	
		case "TT_turn_box21":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box21");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "TT_turn_box20":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box20");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "TT_turn_box19":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box19");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "TT_turn_box18":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box18");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "TT_turn_box17":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box17");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "Tortuga_gunsmith_closed":
			PlaySound("PEOPLE\run_wood.wav");
			ChangeCharacterAddressGroup(Pchar, "Tortuga_port", "goto", "box8");
		break;
//---------------------------------------------------------------------------------------------------
//monastary start
		case "monastary_no_officers":
			Pchar.Hands_officer = "no";	//if old things atill are on
			Pchar.Caesar_officer = "no";
			Pchar.Pell_officer = "no";

			if(IsOfficer(CharacterFromID("Hands"))) 
			{
				RemoveOfficersIndex(pchar, GetCharacterIndex("Hands"));
				RemovePassenger(pchar, characterFromID("Hands"));
				Pchar.Hands_officer = "yes";
			}
			if(IsOfficer(CharacterFromID("Caesar")))  
			{
				RemoveOfficersIndex(pchar, GetCharacterIndex("Caesar"));
				RemovePassenger(pchar, characterFromID("Caesar"));
				Pchar.Caesar_officer = "yes";
			}
			if(IsOfficer(CharacterFromID("Pell")))  
			{
				RemoveOfficersIndex(pchar, GetCharacterIndex("Pell"));
				RemovePassenger(pchar, characterFromID("Pell"));
				Pchar.Pell_officer = "yes";
			}
		break;

		case "Sister_Richards_in_bell_tower":
			Pchar.monastary = "repeat_Sister_Richards";
			AddQuestRecord("Richards","16");
			Locations[FindLocation("BB_graveyard")].reload.l6.disable = 0;
			Locations[FindLocation("BB_graveyard")].locators_radius.reload.reload6 = 0.001;		//large after Sister Richards dialog
			ChangeCharacterAddressGroup(characterFromID("bb_nun1"), "BB_graveyard", "reload", "reload6");
		break;
//---------------------------------------------------------------------------------------------------	
//Charleston blockade scene

		case "Charleston_blockade_start":
			SetCurrentTime(12, 0);
			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Clear";

			SetNextWind("SE",30);			//was S
			Pchar.quest.disable_rebirth = true;

			if(CheckAttribute(Pchar,"model"))
			{
				switch(Pchar.model)
				{
					case "Howard_Pyle_3":
						pchar.uniform = "H_P_3";	
					break;

					case "Howard_Pyle_4":
						pchar.uniform = "H_P_4";	
					break;

					case "Howard_Pyle_5":
						pchar.uniform = "H_P_5";
					break;
				}
			}

			SetModel(PChar, "bb_Teach2", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);
		
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
		
		//	aref ito, ifrom;
			DeleteAttribute(characterFromID("Brthug1"), "items");
			
			if(CheckAttribute(Pchar, "items"))
			{
				makearef(ifrom, Pchar.items);
				Characters[GetCharacterIndex("Brthug1")].items = "";
				makearef(ito, Characters[GetCharacterIndex("Brthug1")].items);
				CopyAttributes(&ito, &ifrom);
				DeleteAttribute(Pchar, "items");
			}
		
			GiveItem2Character(Pchar, "bladeX4");
			GiveItem2Character(Pchar, "blade27");	
			EquipCharacterByItem(Pchar, "blade27");

			pchar.old.name = "Edward";
			pchar.old.lastname = "Teach";
			pchar.name = TranslateString("","Edward");
			pchar.lastname = TranslateString("","Teach");	

			DoQuestReloadToLocation("BB_QAR_cabin", "goto", "window" ,"Charleston_blockade1");
		break;

		case "Charleston_blockade1":
			LAi_SetStayType(pchar);

			ChangeCharacterAddressGroup(characterFromID("bb_crew1"), "BB_qar_deck", "goto", "qar1");
			ChangeCharacterAddressGroup(characterFromID("bb_crew2"), "BB_qar_deck", "goto", "qar2");
			ChangeCharacterAddressGroup(characterFromID("bb_crew3"), "BB_qar_deck", "goto", "qar3");
			ChangeCharacterAddressGroup(characterFromID("bb_crew4"), "BB_qar_deck", "goto", "qar4");
			ChangeCharacterAddressGroup(characterFromID("bb_crew5"), "BB_qar_deck", "goto", "qar5");
			ChangeCharacterAddressGroup(characterFromID("bb_crew6"), "BB_qar_deck", "goto", "qar6");
			ChangeCharacterAddressGroup(characterFromID("bb_crew7"), "BB_qar_deck", "goto", "qar7");
			ChangeCharacterAddressGroup(characterFromID("bb_crew8"), "BB_qar_deck", "quest", "bridge");
			ChangeCharacterAddressGroup(characterFromID("bb_crew9"), "BB_qar_deck", "goto", "sloop1");
			ChangeCharacterAddressGroup(characterFromID("bb_crew10"), "BB_qar_deck", "goto", "sloop2");
			ChangeCharacterAddressGroup(characterFromID("bb_crew11"), "BB_qar_deck", "goto", "sloop3");
			ChangeCharacterAddressGroup(characterFromID("bb_crew12"), "BB_qar_deck", "goto", "sloop4");
			ChangeCharacterAddressGroup(characterFromID("bb_crew13"), "BB_qar_deck", "goto", "sloop5");
			ChangeCharacterAddressGroup(characterFromID("bb_crew14"), "BB_qar_deck", "goto", "sloop6");
			ChangeCharacterAddressGroup(characterFromID("bb_crew15"), "BB_qar_deck", "goto", "sloop7");
			ChangeCharacterAddressGroup(characterFromID("Bonnet"), "BB_qar_deck", "goto", "revenge1");
			ChangeCharacterAddressGroup(characterFromID("Herriot"), "BB_qar_deck", "goto", "revenge2");
			ChangeCharacterAddressGroup(characterFromID("Pell"), "BB_qar_deck", "goto", "revenge3");
			ChangeCharacterAddressGroup(characterFromID("bb_crew16"), "BB_qar_deck", "goto", "adventure1");
			ChangeCharacterAddressGroup(characterFromID("bb_crew17"), "BB_qar_deck", "goto", "qar8");
			ChangeCharacterAddressGroup(characterFromID("bb_crew18"), "BB_qar_deck", "goto", "qar12");
			ChangeCharacterAddressGroup(characterFromID("bb_crew19"), "BB_qar_deck", "goto", "qar9");
			ChangeCharacterAddressGroup(characterFromID("postman"), "BB_qar_deck", "goto", "qar10");
			ChangeCharacterAddressGroup(characterFromID("bb_crew20"), "BB_qar_deck", "goto", "qar13");
			ChangeCharacterAddressGroup(characterFromID("bb_crew21"), "BB_qar_deck", "goto", "qar11");
			ChangeCharacterAddressGroup(characterFromID("Louis_Arot"), "BB_qar_deck", "goto", "revenge4");
		
			Characters[GetCharacterIndex("bb_crew5")].Dialog.Filename = "bb_crew_dialog.c";
			Characters[GetCharacterIndex("bb_crew8")].Dialog.Filename = "bb_crew_dialog.c";
			Characters[GetCharacterIndex("Richards")].Dialog.Filename = "bb_crew2_dialog.c";
			Characters[GetCharacterIndex("Richards")].dialog.CurrentNode  = "First time";

			Locations[FindLocation("BB_QAR_cabin")].image = "deck_cabin1.tga";

			LAi_QuestDelay("wait_for_Richards", 2.0);
		break;

		case "wait_for_Richards":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "wait_for_Richards";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "wait_for_Richards_done":
			LAi_QuestDelay("Charleston_gp_explosion", 2.0);
		break;

		case "Charleston_gp_explosion":
			PauseAllSounds();
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire1.wav");
			PlaySound("OBJECTS\SHIPCHARGE\LG42H.wav");
			PlaySound("OBJECTS\SHIPCHARGE\gunpowder_explosion.wav");
			PlaySound("PEOPLE\roof_broken2.wav");
		/*
			ref cmdr = CharacterFromID("Dante Siciliano");
			CaptureTownForNation("Grand Turk", GUEST1_NATION);
			cmdr.nation = GUEST1_NATION; pchar.tower.flag = "pir2";
		*/

			Pchar.special_flag = "on";
			ref cmdr = CharacterFromID("Dante Siciliano");
			CaptureTownForNation("Grand_Turk", PIRATE);
			cmdr.nation = PIRATE; pchar.tower.flag = "pir2";
			cmdr.Flags.Pirate = 6; cmdr.Flags.Pirate.texture = 2;

			LAi_QuestDelay("Charleston_gp_explosion1", 7.0);	
		break;

		case "Charleston_gp_explosion1":
			PlaySound("OBJECTS\SHIPCHARGE\hurrah.wav");
			LAi_SetPlayerType(pchar);
			SetNextWind("SE",30);	

			LAi_QuestDelay("Charleston_gp_explosion1_A", 1.5);		//was 3.5

			pchar.quest.turn_Bonnet.win_condition.l1 = "location";
			pchar.quest.turn_Bonnet.win_condition.l1.location = "BB_qar_deck";
			pchar.quest.turn_Bonnet.win_condition = "turn_Bonnet";
		break;

		case "Charleston_gp_explosion1_A":
			PlaySound("VOICE\ENGLISH\pir_capR3.wav");
		break;

		case "turn_Bonnet":
			LAi_SetActorType(CharacterFromID("Bonnet"));	
			LAi_ActorTurnToLocator(CharacterFromID("Bonnet"), "quest", "hole");
			LAi_SetActorType(CharacterFromID("Herriot"));	
			LAi_ActorTurnToLocator(CharacterFromID("Herriot"), "quest", "hole");
			LAi_SetActorType(CharacterFromID("Pell"));	
			LAi_ActorTurnToLocator(CharacterFromID("Pell"), "quest", "hole");
			LAi_SetActorType(CharacterFromID("bb_crew16"));	
			LAi_ActorTurnToLocator(CharacterFromID("bb_crew16"), "quest", "hole");
			LAi_SetActorType(CharacterFromID("bb_crew17"));	
			LAi_ActorTurnToLocator(CharacterFromID("bb_crew17"), "quest", "hole");
			LAi_SetActorType(CharacterFromID("Louis_Arot"));	
			LAi_ActorTurnToLocator(CharacterFromID("Louis_Arot"), "quest", "hole");
		
			pchar.quest.Charleston_gp_explosion2.win_condition.l1 = "locator";
			pchar.quest.Charleston_gp_explosion2.win_condition.l1.location = "BB_qar_deck";
			pchar.quest.Charleston_gp_explosion2.win_condition.l1.locator_group = "quest";
			pchar.quest.Charleston_gp_explosion2.win_condition.l1.locator = "hole";
			pchar.quest.Charleston_gp_explosion2.win_condition = "Charleston_gp_explosion2";
		break;

		case "Charleston_gp_explosion2":
			PlaySound("VOICE\ENGLISH\gr_Teach2.wav");
			ChangeCharacterAddressGroup(Pchar, "BB_qar_deck", "quest", "hole");
			LAi_SetStayType(pchar);

			LAi_SetActorType(CharacterFromID("Bonnet"));	
			LAi_ActorTurnToLocator(CharacterFromID("Bonnet"), "quest", "hole");
			LAi_SetActorType(CharacterFromID("Herriot"));	
			LAi_ActorTurnToLocator(CharacterFromID("Herriot"), "quest", "hole");
			LAi_SetActorType(CharacterFromID("Pell"));	
			LAi_ActorTurnToLocator(CharacterFromID("Pell"), "quest", "hole");
			LAi_SetActorType(CharacterFromID("bb_crew16"));	
			LAi_ActorTurnToLocator(CharacterFromID("bb_crew16"), "quest", "hole");
			LAi_SetActorType(CharacterFromID("bb_crew17"));	
			LAi_ActorTurnToLocator(CharacterFromID("bb_crew17"), "quest", "hole");
			LAi_SetActorType(CharacterFromID("Louis_Arot"));	
			LAi_ActorTurnToLocator(CharacterFromID("Louis_Arot"), "quest", "hole");

			LAi_QuestDelay("Charleston_gp_explosion3", 1.5);
		break;

		case "Charleston_gp_explosion3":
			Characters[GetCharacterIndex("bb_crew8")].Dialog.Filename = "bb_crew2_dialog.c";

			LAi_SetActorType(characterFromID("bb_crew8"));
			LAi_ActorDialog(characterFromID("bb_crew8"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("bb_crew8"));
		break;

		case "Charleston_gp_explosion4":
			PlaySound("VOICE\ENGLISH\gr_Teach1.wav");
			LAi_SetActorType(CharacterFromID("bb_crew8"));	
			LAi_ActorTurnToLocator(CharacterFromID("bb_crew8"), "blacksmoke", "bsmoke1");
			
			LAi_QuestDelay("Charleston_gp_explosion5", 1.0);
		break;

		case "Charleston_gp_explosion5":
			LAi_SetStayType(characterFromID("bb_crew8"));
			Characters[GetCharacterIndex("bb_crew8")].Dialog.Filename = "bb_crew_dialog.c";

			LAi_QuestDelay("Charleston_gp_explosion6", 1.0);
		break;

		case "Charleston_gp_explosion6":
			Characters[GetCharacterIndex("bb_crew5")].Dialog.Filename = "bb_crew2_dialog.c";

			LAi_SetActorType(characterFromID("bb_crew5"));
			LAi_ActorDialog(characterFromID("bb_crew5"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("bb_crew5"));
		break;

		case "Charleston_gp_explosion7":
			PlaySound("VOICE\ENGLISH\gr_Teach7.wav");
			LAi_SetActorType(CharacterFromID("bb_crew5"));	
			LAi_ActorTurnToLocator(CharacterFromID("bb_crew5"), "blacksmoke", "bsmoke1");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "blacksmoke", "bsmoke1");
			
			Locations[FindLocation("BB_QAR_cabin")].locators_radius.box.box1 = 1.5;
			
			LAi_QuestDelay("pchar_playertype", 0.5);
			LAi_QuestDelay("Charleston_gp_explosion8", 1.0);
		break;

		case "Charleston_gp_explosion8":
			LAi_SetStayType(characterFromID("bb_crew5"));
			Characters[GetCharacterIndex("bb_crew5")].Dialog.Filename = "bb_crew_dialog.c";
		break;

		case "Richards_back":
			PlaySound("INTERFACE\knock2.wav");

			LAi_QuestDelay("Richards_back1", 4.0);
		break;

		case "Richards_back1":
			PlaySound("INTERFACE\knock2.wav");

			LAi_QuestDelay("Richards_back2", 4.0);
		break;

		case "Richards_back2":
			PlaySound("INTERFACE\knock.wav");

			LAi_QuestDelay("Richards_back3", 2.0);
		break;

		case "Richards_back3":
			PlaySound("PEOPLE\recoil.wav");
			LAi_SetPlayerType(pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_qar_cabin", "goto", "wakeup");
			LAi_LocationFightDisable(&Locations[FindLocation("BB_qar_cabin")], false);

			LAi_QuestDelay("Richards_back4", 0.5);
		break;

		case "Richards_back4":
			LAi_SetFightMode(Pchar, true);
			PlaySound("VOICE\ENGLISH\gm_crew16B.wav");
			PlaySound("VOICE\ENGLISH\gm_crew16B.wav");

			LAi_QuestDelay("Richards_back5", 1.5);
		break;

		case "Richards_back5":
			LAi_LocationFightDisable(&Locations[FindLocation("BB_qar_cabin")], true);
			if(LAi_IsFightMode(Pchar)) {LAi_SetFightMode(Pchar, false);}
			Characters[GetCharacterIndex("BB_nun1")].Ship.Type = "boat";
			Characters[GetCharacterIndex("crypt_skeleton5")].Ship.Type = "obj_invisible";
			Characters[GetCharacterIndex("crypt_skeleton6")].Ship.Type = "obj_invisible";

			ChangeCharacterAddressGroup(characterFromID("Caesar"), "BB_qar_deck", "goto", "adventure2");
			ChangeCharacterAddressGroup(characterFromID("Hornigold"), "BB_qar_deck", "goto", "adventure3");
			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_qar_deck", "goto", "adventure4");
			ChangeCharacterAddressGroup(characterFromID("Odel"), "BB_qar_deck", "goto", "adventure5");
			LAi_SetStayType(CharacterFromID("Hands"));
			LAi_SetStayType(CharacterFromID("Caesar"));	
			SetNextWind("SE",30);	
		
			LAi_QuestDelay("pchar_hah", 1.0);
			LAi_QuestDelay("pchar_playertype", 1.0);

			pchar.quest.turn_Hands.win_condition.l1 = "location";
			pchar.quest.turn_Hands.win_condition.l1.location = "BB_qar_deck";
			pchar.quest.turn_Hands.win_condition = "turn_Hands";
		break;

		case "turn_Hands":
			LAi_SetActorType(CharacterFromID("Hands"));	
			LAi_ActorTurnToLocator(CharacterFromID("Hands"), "quest", "hole");
			LAi_SetActorType(CharacterFromID("Hornigold"));	
			LAi_ActorTurnToLocator(CharacterFromID("Hornigold"), "quest", "hole");
			LAi_SetActorType(CharacterFromID("Odel"));	
			LAi_ActorTurnToLocator(CharacterFromID("Odel"), "quest", "hole");
			LAi_SetActorType(CharacterFromID("Caesar"));	
			LAi_ActorTurnToLocator(CharacterFromID("Caesar"), "quest", "hole");
	
			LAi_SetActorType(CharacterFromID("Bonnet"));	
			LAi_ActorTurnToLocator(CharacterFromID("Bonnet"), "quest", "hole");
			LAi_SetActorType(CharacterFromID("Herriot"));	
			LAi_ActorTurnToLocator(CharacterFromID("Herriot"), "quest", "hole");
			LAi_SetActorType(CharacterFromID("Pell"));	
			LAi_ActorTurnToLocator(CharacterFromID("Pell"), "quest", "hole");
			LAi_SetActorType(CharacterFromID("bb_crew16"));	
			LAi_ActorTurnToLocator(CharacterFromID("bb_crew16"), "quest", "hole");
			LAi_SetActorType(CharacterFromID("bb_crew17"));	
			LAi_ActorTurnToLocator(CharacterFromID("bb_crew17"), "quest", "hole");
			LAi_SetActorType(CharacterFromID("Louis_Arot"));	
			LAi_ActorTurnToLocator(CharacterFromID("Louis_Arot"), "quest", "hole");

			pchar.quest.Richards_back6.win_condition.l1 = "locator";
			pchar.quest.Richards_back6.win_condition.l1.location = "BB_qar_deck";
			pchar.quest.Richards_back6.win_condition.l1.locator_group = "quest";
			pchar.quest.Richards_back6.win_condition.l1.locator = "hole";
			pchar.quest.Richards_back6.win_condition = "Richards_back6";
		break;

		case "Richards_back6":
			LAi_QuestDelay("pchar_huh", 0.01);
			ChangeCharacterAddressGroup(Pchar, "BB_qar_deck", "quest", "hole2");
			LAi_SetStayType(pchar);

			LAi_SetActorType(CharacterFromID("Hands"));	
			LAi_ActorTurnToLocator(CharacterFromID("Hands"), "quest", "hole");
			LAi_SetActorType(CharacterFromID("Hornigold"));	
			LAi_ActorTurnToLocator(CharacterFromID("Hornigold"), "quest", "hole");
			LAi_SetActorType(CharacterFromID("Odel"));	
			LAi_ActorTurnToLocator(CharacterFromID("Odel"), "quest", "hole");
			LAi_SetActorType(CharacterFromID("Caesar"));	
			LAi_ActorTurnToLocator(CharacterFromID("Caesar"), "quest", "hole");
	
			LAi_SetActorType(CharacterFromID("Bonnet"));	
			LAi_ActorTurnToLocator(CharacterFromID("Bonnet"), "quest", "hole");
			LAi_SetActorType(CharacterFromID("Herriot"));	
			LAi_ActorTurnToLocator(CharacterFromID("Herriot"), "quest", "hole");
			LAi_SetActorType(CharacterFromID("Pell"));	
			LAi_ActorTurnToLocator(CharacterFromID("Pell"), "quest", "hole");
			LAi_SetActorType(CharacterFromID("bb_crew16"));	
			LAi_ActorTurnToLocator(CharacterFromID("bb_crew16"), "quest", "hole");
			LAi_SetActorType(CharacterFromID("bb_crew17"));	
			LAi_ActorTurnToLocator(CharacterFromID("bb_crew17"), "quest", "hole");
			LAi_SetActorType(CharacterFromID("Louis_Arot"));	
			LAi_ActorTurnToLocator(CharacterFromID("Louis_Arot"), "quest", "hole");

			DeleteAttribute(CharacterFromID("Richards"), "items");
			GiveItem2Character(CharacterFromID("Richards"),"bladep205");
			EquipCharacterByItem(characterFromID("Richards"), "bladep205");
			GiveItem2Character(CharacterFromID("Richards"),"pistolmdchest_F1");
			EquipCharacterByItem(characterFromID("Richards"), "pistolmdchest_F1");
			
			LAi_QuestDelay("Richards_back7", 2.0);
		break;

		case "Richards_back7":
			PlaySound("PEOPLE\creak2.wav");
			LAi_SetStayType(CharacterFromID("Richards"));
			ChangeCharacterAddressGroup(characterFromID("Richards"), "BB_qar_deck", "quest", "richards1");
		for(i = 1; i < 22; i++) {LAi_SetActorType(characterFromID("bb_crew"+i));}	//no more dialogs

			LAi_QuestDelay("Richards_back8", 1.0);
		break;

		case "Richards_back8":
			PlaySound("VOICE\ENGLISH\gr_Teach5.wav");
		
			LAi_QuestDelay("Richards_back9", 2.0);
		break;

		case "Richards_back9":
			LAi_SetPlayerType(pchar);
			PlaySound("PEOPLE\recoil.wav");
			LAi_SetStayType(CharacterFromID("Richards"));
			ChangeCharacterAddressGroup(characterFromID("Richards"), "BB_qar_deck", "quest", "richards2");

			pchar.quest.Richards_back10.win_condition.l1 = "locator";
			pchar.quest.Richards_back10.win_condition.l1.location = "BB_qar_deck";
			pchar.quest.Richards_back10.win_condition.l1.locator_group = "quest";
			pchar.quest.Richards_back10.win_condition.l1.locator = "richards2";
			pchar.quest.Richards_back10.win_condition = "Richards_back10";
		break;
	
		case "Richards_back10":
			LAi_SetStayType(pchar);

			LAi_SetActorType(characterFromID("Richards"));
			LAi_ActorDialog(characterFromID("Richards"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Richards"));
		break;

		case "Richards_back11":	
			PlaySound("PEOPLE\clothes1.wav");
			RemoveCharacterEquip(characterFromID("Richards"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("Richards"), "pistolmdchest_F1");
			GiveItem2Character(Pchar, "pistolmdchest_F1");
			EquipCharacterByItem(Pchar, "pistolmdchest_F1");
			
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			GiveItem2Character(Pchar, "bladeMap_Hgold");
			EquipCharacterByItem(Pchar, "bladeMap_Hgold");

			LAi_QuestDelay("Richards_back12", 1.0);
		break;

		case "Richards_back12":
			PlaySound("VOICE\ENGLISH\gr_Teach3.wav");
			LAi_SetPlayerType(pchar);
			LAi_SetFightMode(Pchar, true);

			LAi_QuestDelay("Richards_back13", 2.5);
		break;

		case "Richards_back13":
			LAi_LocationFightDisable(&Locations[FindLocation("BB_qar_deck")], true);
			if(LAi_IsFightMode(Pchar)) {LAi_SetFightMode(Pchar, false);}

			PlaySound("INTERFACE\paper.wav");
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladeMap_Hgold");					
			EquipCharacterByItem(Pchar, "bladeX4");
			GiveItem2Character(characterFromID("Richards"), "pistolMap_Hgold");
			EquipCharacterByItem(characterFromID("Richards"), "pistolMap_Hgold");

			LAi_QuestDelay("Richards_back14", 1.5);
		break;

		case "Richards_back14":
			characters[GetCharacterIndex("Richards")].dialog.CurrentNode = "Richards_huh";
			LAi_SetActorType(characterFromID("Richards"));
			LAi_ActorDialog(characterFromID("Richards"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Richards"));
		break;

		case "Richards_back15":
			LAi_SetStayType(pchar);
			Characters[GetCharacterIndex("Richards")].Dialog.Filename = "bb_crew_dialog.c";
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");
	
			LAi_QuestDelay("Richards_back16", 1.5);
		break;

		case "Richards_back16":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "Richards_pistol";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Richards_back17":
			PlaySound("OBJECTS\DUEL\man_hit1.wav");
			LAi_LocationFightDisable(&Locations[FindLocation("BB_qar_deck")], false);
			LAi_SetPlayerType(characterFromID("Richards"));
			LAi_SetFightMode(characterFromID("Richards"), true);

			LAi_QuestDelay("Richards_back18", 1.5);
		break;

		case "Richards_back18":
			LAi_LocationFightDisable(&Locations[FindLocation("BB_qar_deck")], true);
			if(LAi_IsFightMode(characterFromID("Richards"))) {LAi_SetFightMode(characterFromID("Richards"), false);}
			PlaySound("OBJECTS\DUEL\pistol_out1original.wav");
			RemoveCharacterEquip(characterFromID("Richards"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("Richards"), "bladep205");					
			EquipCharacterByItem(characterFromID("Richards"), "bladeX4");
			GiveItem2Character(Pchar, "bladep205");
			EquipCharacterByItem(Pchar, "bladep205");

			LAi_QuestDelay("Richards_back19", 1.0);
		break;

		case "Richards_back19":
			LAi_SetPlayerType(pchar);
		LAi_SetActorType(characterFromID("Richards"));		//no more dialog

			pchar.quest.QAR_broadside.win_condition.l1 = "locator";
			pchar.quest.QAR_broadside.win_condition.l1.location = "BB_qar_deck";
			pchar.quest.QAR_broadside.win_condition.l1.locator_group = "quest";
			pchar.quest.QAR_broadside.win_condition.l1.locator = "hole";
			pchar.quest.QAR_broadside.win_condition = "QAR_broadside";
		break;

		case "QAR_broadside":
			LAi_SetStayType(pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_qar_deck", "quest", "bell");

			LAi_QuestDelay("QAR_broadside1", 1.0);
		break;

		case "QAR_broadside1":
			PlaySound("OBJECTS\SHIPCHARGE\gunner_fire.wav");
	
			LAi_QuestDelay("QAR_broadside1_A", 1.0);
		LAi_QuestDelay("QAR_silent", 1.5);
			LAi_QuestDelay("QAR_broadside2", 2.0);
		break;

		case "QAR_silent":
			PauseAllSounds();//stops music
			locations[FindLocation("BB_QAR_deck")].type = "silent_seashore";
			PostEvent("LoadSceneSound", 0.1);
		break;

		case "QAR_broadside1_A":
			LAi_LocationFightDisable(&Locations[FindLocation("BB_qar_deck")], false);
			LAi_SetPlayerType(characterFromID("bb_crew18"));
			LAi_SetFightMode(characterFromID("bb_crew18"), true);
		break;

		case "QAR_broadside2":
			PlaySound("INTERFACE\bell2.wav");

			ChangeCharacterAddressGroup(characterFromID("Louis_Arot"), "BB_qar_deck", "quest", "r_gunner1");
			ChangeCharacterAddressGroup(characterFromID("Pell"), "BB_qar_deck", "quest", "r_gunner2");
			ChangeCharacterAddressGroup(characterFromID("Herriot"), "BB_qar_deck", "quest", "r_gunner3");
			ChangeCharacterAddressGroup(characterFromID("Bonnet"), "BB_qar_deck", "quest", "r_gunner4");

			LAi_QuestDelay("QAR_broadside3", 1.5);
		break;

		case "QAR_broadside3":
			PlaySound("INTERFACE\bell2.wav");
	
			ChangeCharacterAddressGroup(characterFromID("bb_crew16"), "BB_qar_deck", "quest", "a_gunner1");
			ChangeCharacterAddressGroup(characterFromID("Odel"), "BB_qar_deck", "quest", "a_gunner2");
			ChangeCharacterAddressGroup(characterFromID("Caesar"), "BB_qar_deck", "quest", "a_gunner3");
			ChangeCharacterAddressGroup(characterFromID("Hornigold"), "BB_qar_deck", "quest", "a_gunner4");
			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_qar_deck", "quest", "a_gunner5");

			LAi_QuestDelay("QAR_broadside4", 1.5);
		break;

		case "QAR_broadside4":
			LAi_SetActorType(Pchar);	
			LAi_ActorTurnToLocator(Pchar, "quest", "a_gunner1");

	//	LAi_QuestDelay("pchar_playertype", 1.5);	//temp
			LAi_QuestDelay("QAR_broadsideR", 1.0);
		break;

		case "QAR_broadsideR":
			CreateParticleSystem("smoke_short" , 34.4, 2.0, 29.45, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 34.4, 2.0, 29.75, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 34.4, 2.0, 29.45, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 34.4, 2.0, 29.75, 0.0, 4.5, 0.0, sti(20) );

			CreateParticleSystem("smoke_short" , 37.9, 2.0, 29.35, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 37.9, 2.0, 29.65, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 37.9, 2.0, 29.35, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 37.9, 2.0, 29.65, 0.0, 4.5, 0.0, sti(20) );

			CreateParticleSystem("smoke_short" , 41.3, 2.1, 29.15, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 41.3, 2.1, 29.45, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 34.4, 2.1, 29.15, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 34.4, 2.1, 29.45, 0.0, 4.5, 0.0, sti(20) );

			CreateParticleSystem("smoke_short" , 44.8, 2.2, 28.95, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 44.8, 2.2, 29.25, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 44.8, 2.2, 28.95, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 44.8, 2.2, 29.25, 0.0, 4.5, 0.0, sti(20) );

			CreateParticleSystem("smoke_short" , 48.3, 2.2, 28.95, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 48.3, 2.2, 29.25, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 48.3, 2.2, 28.95, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 48.3, 2.2, 29.25, 0.0, 4.5, 0.0, sti(20) );

			LAi_QuestDelay("LG12J", 0.01);
			LAi_QuestDelay("LG12J", 0.5);
			LAi_QuestDelay("LG12J", 0.7);
			LAi_QuestDelay("LG12J", 1.0);
			LAi_QuestDelay("LG12J", 1.5);

			LAi_QuestDelay("LG18J", 3.0);
			LAi_QuestDelay("LG18J", 4.0);
			LAi_QuestDelay("LG18J", 5.0);
			LAi_QuestDelay("LG18J", 5.5);
			LAi_QuestDelay("LG18J", 5.8);
			LAi_QuestDelay("LG18J", 6.0);

			LAi_QuestDelay("LG24J", 7.5);
			LAi_QuestDelay("LG24J", 8.5);

			LAi_QuestDelay("QAR_broadsideR_1", 3.0);
			LAi_QuestDelay("QAR_broadsideR_1", 6.0);
			LAi_QuestDelay("QAR_broadsideR_1", 9.0);
			LAi_QuestDelay("QAR_broadsideA", 3.0);

			LAi_QuestDelay("QAR_broadsideQ", 7.5);
			LAi_QuestDelay("QAR_broadsideQ_1", 10.5);
			LAi_QuestDelay("QAR_broadsideQ_1", 13.5);
		break;

		case "LG12J":
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire2.wav");
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire2.wav");
		break;

		case "LG18J":
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire3.wav");
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire3.wav");
		break;

		case "LG24J":
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire1.wav");
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire1.wav");
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire1.wav");
		break;

		case "QAR_broadsideR_1":
			CreateParticleSystem("gunfire" , 34.4, 2.0, 29.45, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 34.4, 2.0, 29.75, 0.0, 4.5, 0.0, sti(20) );

			CreateParticleSystem("gunfire" , 37.9, 2.0, 29.35, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 37.9, 2.0, 29.65, 0.0, 4.5, 0.0, sti(20) );

			CreateParticleSystem("gunfire" , 34.4, 2.1, 29.15, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 34.4, 2.1, 29.45, 0.0, 4.5, 0.0, sti(20) );

			CreateParticleSystem("gunfire" , 44.8, 2.2, 28.95, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 44.8, 2.2, 29.25, 0.0, 4.5, 0.0, sti(20) );

			CreateParticleSystem("gunfire" , 48.3, 2.2, 28.95, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 48.3, 2.2, 29.25, 0.0, 4.5, 0.0, sti(20) );
		break;

		case "QAR_broadsideA":
			CreateParticleSystem("smoke_short" , 62.4, 2.7, 18.25, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 62.4, 2.7, 18.55, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 62.4, 2.7, 18.25, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 62.4, 2.7, 18.55, 0.0, 4.5, 0.0, sti(20) );

			CreateParticleSystem("smoke_short" , 65.6, 2.7, 18.25, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 65.6, 2.7, 18.55, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 65.6, 2.7, 18.25, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 65.6, 2.7, 18.55, 0.0, 4.5, 0.0, sti(20) );

			CreateParticleSystem("smoke_short" , 68.7, 2.7, 18.25, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 68.7, 2.7, 18.55, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 68.7, 2.7, 18.25, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 68.7, 2.7, 18.55, 0.0, 4.5, 0.0, sti(20) );

			CreateParticleSystem("smoke_short" , 71.9, 2.85, 18.35, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 71.9, 2.85, 18.65, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 71.9, 2.85, 18.35, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 71.9, 2.85, 18.65, 0.0, 4.5, 0.0, sti(20) );

			CreateParticleSystem("smoke_short" , 74.9, 2.4, 18.15, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 74.9, 2.4, 18.45, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 74.9, 2.4, 18.45, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 74.9, 2.4, 18.45, 0.0, 4.5, 0.0, sti(20) );

			CreateParticleSystem("smoke_short" , 78.1, 2.5, 17.75, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 78.1, 2.5, 18.05, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 78.1, 2.5, 17.75, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 78.1, 2.5, 18.05, 0.0, 4.5, 0.0, sti(20) );
		
			LAi_QuestDelay("QAR_broadsideA_1", 3.0);
			LAi_QuestDelay("QAR_broadsideA_1", 6.0);
			LAi_QuestDelay("QAR_broadsideA_1", 9.0);
			LAi_QuestDelay("QAR_broadside5", 7.0);
		break;

		case "QAR_broadsideA_1":
			CreateParticleSystem("gunfire" , 62.4, 2.7, 18.25, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 62.4, 2.7, 18.55, 0.0, 4.5, 0.0, sti(20) );

			CreateParticleSystem("gunfire" , 65.6, 2.7, 18.25, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 65.6, 2.7, 18.55, 0.0, 4.5, 0.0, sti(20) );

			CreateParticleSystem("gunfire" , 68.7, 2.7, 18.25, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 68.7, 2.7, 18.55, 0.0, 4.5, 0.0, sti(20) );

			CreateParticleSystem("gunfire" , 71.9, 2.85, 18.35, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 71.9, 2.85, 18.65, 0.0, 4.5, 0.0, sti(20) );

			CreateParticleSystem("gunfire" , 74.9, 2.4, 18.45, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 74.9, 2.4, 18.45, 0.0, 4.5, 0.0, sti(20) );

			CreateParticleSystem("gunfire" , 78.1, 2.5, 17.75, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 78.1, 2.5, 18.05, 0.0, 4.5, 0.0, sti(20) );
		break;

		case "QAR_broadsideQ":
			LAi_SetActorType(Pchar);	
			LAi_ActorTurnToLocator(Pchar, "quest", "teach_turn");

			CreateParticleSystem("smoke_short" , 4.1, 4.1, 27.0, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("smoke_short" , 4.1, 4.1, 27.0, 4.5, 1.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 4.1, 4.1, 27.0, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 4.1, 4.1, 27.0, 0.0, 4.5, 0.0, sti(20) );
		break;

		case "QAR_broadsideQ_1":
			CreateParticleSystem("gunfire" , 4.1, 4.1, 27.0, 0.0, 4.5, 0.0, sti(20) );
			CreateParticleSystem("gunfire" , 4.1, 4.1, 27.0, 0.0, 4.5, 0.0, sti(20) );
		break;

		case "QAR_broadside5":
			PlaySound("OBJECTS\ABORDAGE\abordage_wining.wav");

			LAi_QuestDelay("return_to_monastary", 3.0);
		break;

		case "return_to_monastary":
			if(CheckAttribute(Pchar,"uniform"))
			{
				switch(Pchar.uniform)
				{
					case "H_P_3":
						SetModel(PChar, "Howard_Pyle_3", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);	
					break;

					case "H_P_4":
						SetModel(PChar, "Howard_Pyle_4", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);
					break;

					case "H_P_5":
						SetModel(PChar, "Howard_Pyle_5", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);
					break;
				}
			}

			pchar.old.name = "Howard";
			pchar.old.lastname = "Pyle";
			pchar.name = TranslateString("","Howard");
			pchar.lastname = TranslateString("","Pyle");		
		
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
		

			DeleteAttribute(Pchar, "items");

			if(CheckAttribute(characterFromID("Brthug1"), "items"))
			{	
				makearef(ifrom, Characters[GetCharacterIndex("Brthug1")].items);
				Pchar.items = "";
				makearef(ito, Pchar.items);
				CopyAttributes(&ito, &ifrom);
			}
		
			DoQuestReloadToLocation("BB_graveyard", "goto", "richards", "abbess_info");
		break;

//---------------------------------------------------------------------------------------------------	
//monastary after BB scene

		case "abbess_info":
			characters[GetCharacterIndex("bb_nun1")].dialog.CurrentNode = "Richards9";
			LAi_SetActorType(characterFromID("bb_nun1"));
			LAi_ActorDialog(characterFromID("bb_nun1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("bb_nun1"));
		break;

		case "abbess_info_done":
			LAi_SetPlayerType(Pchar);
			AddQuestRecord("Richards","17");
			LAi_SetCitizenType(characterFromID("bb_nun1"));
			Pchar.monastary = "repeat_abbess";
			characters[GetCharacterIndex("bb_nun1")].Dialog.Filename = "monastary_dialog.c";
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload6", 1.0);
			Locations[FindLocation("BB_graveyard")].locators_radius.reload.reload6 = 1.0;	
			Locations[FindLocation("BB_refectory")].reload.l4.disable = 0;		//to abbess

			Pchar.quest.move_nun1.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.move_nun1.win_condition.l1.location = "BB_graveyard";
			Pchar.quest.move_nun1.win_condition = "move_nun1";
		break;

		case "move_nun1":
			ChangeCharacterAddressGroup(characterFromID("bb_nun1"), "BB_graveyard", "goto", "goto1");

			Pchar.quest.abbess_arrives.win_condition.l1 = "item";
			Pchar.quest.abbess_arrives.win_condition.l1.character = Pchar.id;
			Pchar.quest.abbess_arrives.win_condition.l1.item = "mapBB4A";
			Pchar.quest.abbess_arrives.win_condition = "abbess_arrives";
		break;

		case "abbess_arrives":
			PlaySound("PEOPLE\counter_close.wav");
			ChangeCharacterAddressGroup(characterFromID("bb_nun8"), "BB_abbess", "reload", "reload1");
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload1", 0.001);

			LAi_QuestDelay("abbess_arrives1", 1.0);
		break;

		case "abbess_arrives1":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "randitem", "randitem1");

			LAi_QuestDelay("pchar_playertype", 1.0);
		break;

		case "abbess_quest_given":
			PlaySound("PEOPLE\counter_close.wav");
			ChangeCharacterAddressGroup(characterFromID("bb_nun8"), "none", "", "");
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload1", 1.0);
			AddQuestRecord("Richards","21");
			
			LAi_QuestDelay("abbess_quest_given1", 1.0);
		break;

		case "abbess_quest_given1":
			AddQuestRecord("Richards","18");
			Pchar.monastary = "repeat_abbess_quest";
			Locations[FindLocation("BB_graveyard")].locators_radius.box.box3 = 1.5;
			Pchar.abbess_items = 0;			//start value

			pchar.quest.chapel_window_hint.win_condition.l1 = "locator";
			pchar.quest.chapel_window_hint.win_condition.l1.location = "BB_graveyard";
			pchar.quest.chapel_window_hint.win_condition.l1.locator_group = "reload";
			pchar.quest.chapel_window_hint.win_condition.l1.locator = "reload3";
			pchar.quest.chapel_window_hint.win_condition = "chapel_window_hint";
		break;

		case "chapel_window_hint":
			Pchar.monastary = "repeat_abbess_quest_window_hint";
		break;

//---------------------------------------------------------------------------------------------------
		case "enter_chapel":
			LAi_SetSitType(Pchar);
			LAi_ApplyCharacterDamage(Pchar, 10);
			PlaySound("PEOPLE\jump_roof.wav");
			PlaySound("AMBIENT\TAVERN\tinkle4.wav");
			Pchar.monastary = "repeat_abbess_quest";	//reset to no window hint

			LAi_QuestDelay("pchar_playertype", 0.5);
			LAi_QuestDelay("book62_check", 0.1);
		break;

		case "book62_check":
			if(CheckCharacterItem(Pchar,"book62"))
			{
				Pchar.abbess_items = sti(Pchar.abbess_items) + 1;
				PlaySound("INTERFACE\book_close.wav");

				LAi_QuestDelay("count_abbess_items", 0.5);
			}
			else LAi_QuestDelay("book62_check", 0.5);//loop check
		break;

		case "count_abbess_items":
			if(CheckAttribute(Pchar, "abbess_items"))
			{
				switch (Pchar.abbess_items)
				{
					case "1":
						LAi_QuestDelay("pchar_1", 1.0);
					break;

					case "2":
						LAi_QuestDelay("pchar_2", 1.0);
					break;

					case "3":
						LAi_QuestDelay("pchar_3", 1.0);
					break;

					case "4":
						LAi_QuestDelay("pchar_4", 1.0);
					break;

					case "5":
						LAi_QuestDelay("pchar_5", 1.0);
					break;

					case "6":
						LAi_QuestDelay("pchar_6", 1.0);
					break;

					case "7":
						LAi_QuestDelay("pchar_7", 1.0);
					break;

					case "8":
						Locations[FindLocation("BB_refectory")].reload.l5.disable = 0;	//to chapel
						AddQuestRecord("Richards","19");					

						LAi_QuestDelay("pchar_8", 1.0);
						LAi_QuestDelay("all_abbess_items", 2.0);
					break;
				}
			}
		break;	

		case "unlock_church_room":
			//from SL_utils

			Pchar.church_room_box2 = "off";
			Locations[FindLocation("BB_church_room")].locators_radius.box.box2 = 0.0001;
			Locations[FindLocation("BB_church_room")].locators_radius.reload.reload1 = 1.0;
			Locations[FindLocation("BB_graveyard")].reload.l3.disable = 0;	//small chapel
			
			DoQuestReloadToLocation("BB_graveyard", "reload", "reload3", "_");
		break;

		case "hammer_check_chapel":
			if(CheckCharacterItem(Pchar,"bladehammer"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladehammer");
			}
		break;

		case "graveyard_no_bell":
			DoQuestReloadToLocation("BB_graveyard", "reload", "reload6", "graveyard_no_bell1");
		break;

		case "graveyard_no_bell1":
			Pchar.graveyard_box1 = "enabled";
		break;

		case "graveyard_bell":
			if(CheckAttribute(Pchar,"nun_out") && Pchar.nun_out == "done")
			{
				DoQuestReloadToLocation("BB_graveyard", "reload", "reload6", "graveyard_no_bell1");
			}
			else 
			{
				Pchar.graveyard_box1 = "enabled";
				PlaySound("PEOPLE\run_wood.wav");
				ChangeCharacterAddressGroup(Pchar, "BB_bell_tower", "goto", "view");

				LAi_QuestDelay("graveyard_bell1", 2.0);
			}
		break;

		case "graveyard_bell1":
			Pchar.nun_out = "done";
			PlaySound("INTERFACE\closet_open.wav");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun2"), "BB_bell_tower", "reload", "reload4");
			Locations[FindLocation("BB_graveyard")].reload.l4.disable = 0;

			LAi_QuestDelay("wax_candles_check", 0.1);
			LAi_QuestDelay("graveyard_bell2", 2.0);
		break;

		case "wax_candles_check":
			if(CheckCharacterItem(Pchar,"wax_candles"))
			{
				Pchar.abbess_items = sti(Pchar.abbess_items) + 1;
				PlaySound("PEOPLE\step_grass1.wav");

				LAi_QuestDelay("count_abbess_items", 0.5);
			}
			else LAi_QuestDelay("wax_candles_check", 0.5);//loop check
		break;

		case "graveyard_bell2":
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun2"), "BB_graveyard", "reload", "reload4");
			DoQuestReloadToLocation("BB_graveyard", "reload", "reload6", "graveyard_bell3");
		break;

		case "graveyard_bell3":
			LAi_SetActorType(CharacterFromID("bb_nun2"));
			LAi_ActorGoToLocator(CharacterFromID("bb_nun2"), "goto", "goto4", "graveyard_bell4", 5.0);

			LAi_QuestDelay("key33_check", 0.1);
		break;

		case "graveyard_bell4":
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun2"), "BB_graveyard", "goto", "goto4");
			LAi_SetStayType(CharacterFromID("bb_nun2"));
		break;
//---------------------------------------------------------------------------------------------------	
		case "key33_check":
			if(CheckCharacterItem(Pchar,"key33"))
			{
				PlaySound("INTERFACE\took_item.wav");
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box2", 1.0);
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload2", 0.0001);

				Locations[FindLocation("BB_crypt2_1")].locators_radius.box.box2 = 1.0;
				Locations[FindLocation("BB_crypt2_1")].locators_radius.reload.reload2 = 0.0001;

				LAi_QuestDelay("altar_bread_check", 0.5);
				LAi_QuestDelay("pistolcenser_check", 1.0);
			}
			else
			{
				LAi_QuestDelay("key33_check", 0.5);//loop check
			}
		break;

		case "altar_bread_check":
			if(CheckCharacterItem(Pchar,"altar_bread"))
			{
				Pchar.abbess_items = sti(Pchar.abbess_items) + 1;
				PlaySound("INTERFACE\chewing.wav");

				LAi_QuestDelay("count_abbess_items", 1.0);
			}
			else LAi_QuestDelay("altar_bread_check", 0.5);//loop check
		break;

		case "pistolcenser_check":
			if(CheckCharacterItem(Pchar,"pistolcenser"))
			{
				Pchar.abbess_items = sti(Pchar.abbess_items) + 1;
				PlaySound("OBJECTS\DUEL\censer.wav");

				LAi_QuestDelay("count_abbess_items", 1.0);
			}
			else LAi_QuestDelay("pistolcenser_check", 0.5);//loop check
		break;

//---------------------------------------------------------------------------------------------------	
		case "unlock_crypt2_2":
			//from SL_utils

			Pchar.crypt2_1_box2 = "off";
			Locations[FindLocation("BB_crypt2_1")].locators_radius.box.box2 = 0.0001;
			Locations[FindLocation("BB_crypt2_1")].locators_radius.reload.reload2 = 1.0;
			Locations[FindLocation("BB_crypt2_1")].reload.l2.disable = 0;
			
			TakenItems(Pchar, "key33", -1);
			Pchar.coffins_sequence = "0";		//start value for coffin sequence
			
			DoQuestReloadToLocation("BB_crypt2_2", "reload", "reload1", "_");
		break;
//---------------------------------------------------------------------------------------------------	
		case "crypt2_2_box5_off":
			Pchar.crypt2_2_box5 = "off";
		break;
		
		case "crypt2_2_box6_off":
			Pchar.crypt2_2_box6 = "off";
		break;

		case "crypt2_2_box7_off":
			Pchar.crypt2_2_box7 = "off";
		break;

		case "crypt2_2_box8_off":
			Pchar.crypt2_2_box8 = "off";
		break;

		case "crypt2_2_box5_reset_pchar":
			ChangeCharacterAddressGroup(Pchar, "BB_crypt2_2", "box", "box5");
		break;

		case "crypt2_2_box6_reset_pchar":
			ChangeCharacterAddressGroup(Pchar, "BB_crypt2_2", "box", "box6");
		break;

		case "crypt2_2_box7_reset_pchar":
			ChangeCharacterAddressGroup(Pchar, "BB_crypt2_2", "box", "box7");
		break;

		case "crypt2_2_box8_reset_pchar":
			ChangeCharacterAddressGroup(Pchar, "BB_crypt2_2", "box", "box8");
		break;
//---------------------------------------------------------------------------------------------------	
		case "crypt_skeletons_reset":
			PlaySound("INTERFACE\shelf_close.wav");			

			LAi_LocationFightDisable(&Locations[FindLocation("BB_crypt2_2")], true);		//reset
			ChangeCharacterAddressGroup(characterFromID("crypt_skeleton5"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("crypt_skeleton6"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("crypt_skeleton7"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("crypt_skeleton8"), "none", "", "");

			LAi_QuestDelay("crypt_coffins_reset", 3.0);
		break;

		case "crypt_coffins_reset":
			//LogIt("coffins_sequence = " + Pchar.coffins_sequence);

			if(CheckAttribute(Pchar,"coffins_sequence") && Pchar.coffins_sequence != "0")
			{
				PlaySound("INTERFACE\step_reset.wav");
				Pchar.coffins_sequence = "0";
			}

			Pchar.crypt2_coffin5 = "closed";
			Pchar.crypt2_coffin6 = "closed";
			Pchar.crypt2_coffin7 = "closed";
			Pchar.crypt2_coffin8 = "closed";

			if(Locations[FindLocation("BB_crypt2_2")].reload.l2.disable == 0)
			{
				LAi_QuestDelay("lock_again_to_misericord", 2.0);
			}
		break;

		case "lock_again_to_misericord":
			PlaySound("INTERFACE\closed_locked_door.wav");
			Locations[FindLocation("BB_crypt2_2")].reload.l2.disable = 1;
		break;
//---------------------------------------------------------------------------------------------------	
		case "unlock_misericord":
			//from SL_utils

			PlaySound("INTERFACE\step_path.wav");
	
			LAi_QuestDelay("unlock_misericord1", 1.0);
		break;

		case "unlock_misericord1":
			PlaySound("INTERFACE\closet_open.wav");
			Locations[FindLocation("BB_crypt2_2")].reload.l2.disable = 0;
			Pchar.crypt2_2_box5 = "off";

			LAi_QuestDelay("pchar_yah", 1.5);
		break;

		case "pistolcenser_check_misericord":
			if(CheckCharacterItem(Pchar,"pistolcenser"))
			{
				if(!IsEquipCharacterByItem(Pchar, "pistolcenser"))
				{
					weaponID13 = GetCharacterEquipByGroup(Pchar,BLADE_ITEM_TYPE);
					Items_FindItem(weaponID13, &weapon13);

					if(weapon13.model == "")
					{
						if(!CheckCharacterItem(Pchar,"bladeX4"))
						{
							GiveItem2Character(Pchar, "bladeX4");
						}					
						EquipCharacterByItem(Pchar, "bladeX4");
					}

					RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
					EquipCharacterByItem(Pchar, "pistolcenser");
				}
			}
		break;
//------------------------------------------------------------------------------------------------------------
		case "unlock_crypt1":
			LAi_SetActorType(CharacterFromID("bb_nun2"));
			LAi_ActorGoToLocator(CharacterFromID("bb_nun2"), "goto", "nun1", "unlock_crypt1_A", 7.0);
		break;

		case "unlock_crypt1_A":
			PlaySound("INTERFACE\key_unlock.wav");
			Locations[FindLocation("BB_graveyard")].reload.l5.disable = 0;

			LAi_QuestDelay("unlock_crypt1_B", 1.5);

			LAi_QuestDelay("silvercross_check", 0.5);
			LAi_QuestDelay("rosary_check", 1.0);
			LAi_QuestDelay("icon_check", 1.5);
		break;

		case "silvercross_check":
			if(CheckCharacterItem(Pchar,"silvercross"))
			{
				Pchar.abbess_items = sti(Pchar.abbess_items) + 1;
				PlaySound("INTERFACE\took_item.wav");

				LAi_QuestDelay("count_abbess_items", 0.5);
			}
			else LAi_QuestDelay("silvercross_check", 0.5);//loop check
		break;

		case "rosary_check":
			if(CheckCharacterItem(Pchar,"rosary"))
			{
				Pchar.abbess_items = sti(Pchar.abbess_items) + 1;
				PlaySound("INTERFACE\button3.wav");

				LAi_QuestDelay("count_abbess_items", 0.5);
			}
			else LAi_QuestDelay("rosary_check", 0.5);//loop check
		break;

		case "icon_check":
			if(CheckCharacterItem(Pchar,"icon"))
			{
				Pchar.abbess_items = sti(Pchar.abbess_items) + 1;
				PlaySound("PEOPLE\step_stairway2.wav");

				LAi_QuestDelay("count_abbess_items", 0.5);
			}
			else LAi_QuestDelay("icon_check", 0.5);//loop check
		break;

		case "unlock_crypt1_B":
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun2"), "BB_crypt1", "goto", "altar");
			LAi_SetStayType(CharacterFromID("bb_nun2"));
		break;

		case "close_crypt1_box":
			PlaySound("INTERFACE\shelf_close.wav");
			Pchar.crypt1_coffin = "closed";
			LAi_LocationFightDisable(&Locations[FindLocation("BB_crypt1")], true);
			LAi_SetFightMode(Pchar, false);
			LAi_SetPlayerType(Pchar);
		break;

		case "broom_check_box4":
			if(CheckCharacterItem(Pchar,"bladebroom"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladebroom");
				locations[FindLocation(Pchar.location)].box5.items.bladebroom = 0;

				ChangeCharacterAddressGroup(CharacterFromID("bb_nun2"), "BB_crypt1", "goto", "altar");
				LAi_SetStayType(CharacterFromID("bb_nun2"));

				if(CheckAttribute(Pchar,"abbess_relic_check") && Pchar.abbess_relic_check == "started")
				{

				}
				else LAi_QuestDelay("treasure7_check", 0.5);
			}
		break;

		case "broom_check_box5":
			if(CheckCharacterItem(Pchar,"bladebroom"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladebroom");
				locations[FindLocation(Pchar.location)].box4.items.bladebroom = 0;

				ChangeCharacterAddressGroup(CharacterFromID("bb_nun2"), "BB_crypt1", "goto", "altar");
				LAi_SetStayType(CharacterFromID("bb_nun2"));

				if(CheckAttribute(Pchar,"abbess_relic_check") && Pchar.abbess_relic_check == "started")
				{

				}
				else LAi_QuestDelay("treasure7_check", 0.5);
			}
		break;

		case "treasure7_check":
			Pchar.abbess_relic_check = "started";

			if(CheckCharacterItem(Pchar,"treasure7"))
			{
				Pchar.abbess_items = sti(Pchar.abbess_items) + 1;
				PlaySound("PEOPLE\teleport.wav");
				
				LAi_QuestDelay("count_abbess_items", 0.5);
			}
			else LAi_QuestDelay("treasure7_check", 0.5);//loop check
		break;
	
//------------------------------------------------------------------------------------------------------------
		case "broom_in_misericord_free":
			Pchar.misericord_box3 = "off";
		break;

		case "broom_in_misericord":
			Pchar.misericord_box3 = "off";
			Locations[FindLocation(Pchar.location)].models.always.l2 = "";
			Locations[FindLocation("BB_abbey_cell")].image = "";
			DoQuestReloadToLocation("BB_abbey_cell", "goto", "broom", "broom_in_misericord1");
		break;

		case "broom_in_misericord1":
			LAi_LocationFightDisable(&Locations[FindLocation("BB_abbey_cell")], true);
			LAi_SetPlayerType(Pchar);
			if(LAi_IsFightMode(Pchar)) {LAi_SetFightMode(Pchar, false);}
			Locations[FindLocation("BB_abbey_cell")].image = "Incas_Temple_Alcove.tga";
		break;
//------------------------------------------------------------------------------------------------------------
		case "all_abbess_items":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "all_abbess_items";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "all_abbess_items_done":
			LAi_SetPlayerType(pchar);
			locations[FindLocation("BB_refectory")].type = "silent_residence";
			Locations[FindLocation("BB_refectory")].reload.l4.disable = 1;		//to abbess
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun8"), "BB_monastary_chapel", "goto", "goto11");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun1"), "BB_monastary_chapel", "sit", "sit3");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun2"), "BB_monastary_chapel", "sit", "sit5");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun3"), "BB_monastary_chapel", "sit", "sit6");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun4"), "BB_monastary_chapel", "sit", "sit13");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun5"), "BB_monastary_chapel", "sit", "sit14");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun6"), "BB_monastary_chapel", "sit", "sit15");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun7"), "BB_monastary_chapel", "sit", "sit16");
			LAi_SetSitType(CharacterFromID("bb_nun1"));
			LAi_SetSitType(CharacterFromID("bb_nun2"));
			LAi_SetSitType(CharacterFromID("bb_nun3"));
			LAi_SetSitType(CharacterFromID("bb_nun4"));
			LAi_SetSitType(CharacterFromID("bb_nun5"));
			LAi_SetSitType(CharacterFromID("bb_nun6"));
			LAi_SetSitType(CharacterFromID("bb_nun7"));

			Pchar.monastary = "dont_disturb";

			pchar.quest.abbess_chapel.win_condition.l1 = "locator";
			pchar.quest.abbess_chapel.win_condition.l1.location = "BB_monastary_chapel";
			pchar.quest.abbess_chapel.win_condition.l1.locator_group = "goto";
			pchar.quest.abbess_chapel.win_condition.l1.locator = "goto11";
			pchar.quest.abbess_chapel.win_condition = "abbess_chapel";
		break;

		case "abbess_chapel":
			characters[GetCharacterIndex("bb_nun8")].dialog.CurrentNode = "precious_items";
			LAi_SetActorType(characterFromID("bb_nun8"));
			LAi_ActorDialog(characterFromID("bb_nun8"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("bb_nun8"));
		break;

		case "precious_items_done":
			LAi_SetStayType(pchar);	
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "wax_candles");
			TakeItemFromCharacter(Pchar, "altar_bread");
			TakeItemFromCharacter(Pchar, "book62");
			TakeItemFromCharacter(Pchar, "treasure7");
			TakeItemFromCharacter(Pchar, "silvercross");
			TakeItemFromCharacter(Pchar, "rosary");
			TakeItemFromCharacter(Pchar, "icon");
			TakeItemFromCharacter(Pchar, "pistolcenser");

			TakeItemFromCharacter(Pchar, "crypt_sketch");
			TakeItemFromCharacter(Pchar, "bladehammer");
			TakeItemFromCharacter(Pchar, "bladebroom");

			LAi_QuestDelay("abbess_map", 2.0);
		break;

		case "abbess_map":
			characters[GetCharacterIndex("bb_nun8")].dialog.CurrentNode = "map";
			LAi_SetActorType(characterFromID("bb_nun8"));
			LAi_ActorDialog(characterFromID("bb_nun8"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("bb_nun8"));
		break;

		case "abbess_map_given":
			PlaySound("INTERFACE\paper.wav");
			GiveItem2Character(Pchar, "mapBB4B");
			if(CheckCharacterItem(Pchar,"mapBB4A_back"))
			{
				TakeItemFromCharacter(pchar, "mapBB4A_back");
				GiveItem2Character(pchar,"mapBB4A");
			}
			LAi_SetPlayerType(pchar);
			Pchar.abbess = "dont_disturb";
			characters[GetCharacterIndex("bb_nun8")].dialog.CurrentNode = "First time";
			LAi_SetStayType(characterFromID("bb_nun8"));

			LAi_QuestDelay("abbess_map_given1", 1.0);
		break;

		case "abbess_map_given1":
			AddQuestRecord("Richards","20");
	//CloseQuestHeader("Richards");

			Locations[FindLocation("cloister_exit")].locators_radius.box.box1 = 0.0001;
			Locations[FindLocation("cloister_exit")].reload.l1.disable = 1;		//to town
			Locations[FindLocation("cloister_inside")].reload.l1.disable = 1;	//to exit	
			DoQuickSave();
			
			Pchar.cloister = "bandits";

			ChangeCharacterAddressGroup(CharacterFromID("BB_monk1"), "cloister_passage", "quest", "m1");
			ChangeCharacterAddressGroup(CharacterFromID("BB_monk2"), "cloister_passage", "quest", "m2");
			ChangeCharacterAddressGroup(CharacterFromID("BB_monk3"), "cloister_passage", "quest", "m3");
			ChangeCharacterAddressGroup(CharacterFromID("BB_monk4"), "cloister_passage", "quest", "m4");
			ChangeCharacterAddressGroup(CharacterFromID("BB_monk5"), "cloister_exit", "quest", "m5");
			LAi_SetActorType(characterFromID("BB_monk1"));
			LAi_SetActorType(characterFromID("BB_monk2"));
			LAi_SetActorType(characterFromID("BB_monk3"));
			LAi_SetActorType(characterFromID("BB_monk4"));
			LAi_SetActorType(characterFromID("BB_monk5"));

			ChangeCharacterAddressGroup(CharacterFromID("Brthug1"), "cloister_passage", "quest", "b1");
			ChangeCharacterAddressGroup(CharacterFromID("Brthug2"), "cloister_passage", "quest", "b2");
			ChangeCharacterAddressGroup(CharacterFromID("Brthug5"), "cloister_passage", "quest", "b3");
			ChangeCharacterAddressGroup(CharacterFromID("Brthug4"), "cloister_passage", "quest", "b4");
			ChangeCharacterAddressGroup(CharacterFromID("Brthug3"), "cloister_passage", "quest", "b5");
			ChangeCharacterAddressGroup(CharacterFromID("Brthug6"), "cloister_passage", "quest", "b6");
			ChangeCharacterAddressGroup(CharacterFromID("Brthug7"), "cloister_passage", "quest", "b7");
			LAi_SetActorType(characterFromID("Brthug1"));
			LAi_SetActorType(characterFromID("Brthug2"));
			LAi_SetActorType(characterFromID("Brthug3"));
			LAi_SetActorType(characterFromID("Brthug4"));	
			LAi_SetActorType(characterFromID("Brthug5"));
			LAi_SetActorType(characterFromID("Brthug6"));
			LAi_SetActorType(characterFromID("Brthug7"));

			Pchar.quest.abbess_map_given2.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.abbess_map_given2.win_condition.l1.location = "BB_monastary_chapel";
			Pchar.quest.abbess_map_given2.win_condition = "abbess_map_given2";
		break;

		case "abbess_map_given2":
			//selfdialog, 2 cases tape or not
		
			if(CheckCharacterItem(Pchar,"tape"))
			{
				LAi_SetActorType(pchar);	
				characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "repair_Richards_map";
				LAi_ActorSelfDialog(pchar, "");
			}
			else
			{ 
				LAi_SetActorType(pchar);	
				characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "search_for_glue";
				LAi_ActorSelfDialog(pchar, "");
			}
		break;

		case "repair_Richards_map":
			//from selfdialog

			LAi_SetPlayerType(pchar);
			PlaySound("INTERFACE\writing.wav");
			PlaySound("INTERFACE\writing.wav");

			LAi_QuestDelay("repair_Richards_map1", 1.0);
		break;

		case "repair_Richards_map1":
			PlaySound("INTERFACE\writing.wav");
			PlaySound("INTERFACE\writing.wav");

			LAi_QuestDelay("repair_Richards_map2", 1.0);
		break;

		case "repair_Richards_map2":
			PlaySound("INTERFACE\paper.wav");
			TakeItemFromCharacter(pchar, "mapBB4A_back");		//just to be sure
			TakeItemFromCharacter(pchar, "mapBB4A");
			TakeItemFromCharacter(pchar, "mapBB4B");
			GiveItem2Character(pchar,"mapBB4C");
			TakeItemFromCharacter(pchar, "tape");
			TakeNItems(pchar, "medical1", 2);

			pchar.quest.cloister_monk.win_condition.l1 = "locator";
			pchar.quest.cloister_monk.win_condition.l1.location = "cloister_exit";
			pchar.quest.cloister_monk.win_condition.l1.locator_group = "goto";
			pchar.quest.cloister_monk.win_condition.l1.locator = "goto5";
			pchar.quest.cloister_monk.win_condition = "cloister_monk";

			PostEvent("LaunchIAfterFrame",1,"sl", "I_ITEMS", 2);
			InterfaceStack.SelectMenu_node = "I_ITEMS";
			interfaceResultCommand = RC_INTERFACE_ITEMS_EXIT;
			EndCancelInterface(false);
		break;

		case "search_for_glue":
			//from selfdialog

			LAi_SetPlayerType(pchar);
			AddQuestRecord("Richards","22");
		break;

		case "tape_found":
			if(CheckCharacterItem(Pchar,"mapBB4B"))
			{
				if(CheckCharacterItem(Pchar,"mapBB4A_back"))
				{
					TakeItemFromCharacter(pchar, "mapBB4A_back");
					GiveItem2Character(pchar,"mapBB4A");
				}

				if(!CheckCharacterItem(Pchar,"map")) {GiveItem2Character(Pchar, "map");}

				LAi_SetActorType(pchar);	
				characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "repair_Richards_map";
				LAi_ActorSelfDialog(pchar, "");
			}
		break;
		
	//------------------------------------------------------------------------------
	//cloister attack

		case "cloister_monk":
			LAi_SetStayType(pchar);

			LAi_QuestDelay("cloister_monk1", 0.5);
		break;

		case "cloister_monk1":
			LAi_SetActorType(characterFromID("BB_monk5"));
			LAi_ActorDialog(characterFromID("BB_monk5"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("BB_monk5"));
		break;

		case "cloister_ambush":
			LAi_SetPlayerType(pchar);
			LAi_SetOfficerType(characterFromID("BB_monk5"));
			Pchar.cloister = "neutral";		//reset

			pchar.quest.cloister_ambush1.win_condition.l1 = "location";
			pchar.quest.cloister_ambush1.win_condition.l1.location = "cloister_inside";
			pchar.quest.cloister_ambush1.win_condition = "cloister_ambush1";
		break;

		case "cloister_ambush1":
			PlaySound("INTERFACE\closed_locked_door.wav");
			LAi_SetActorType(characterFromID("BB_monk5"));
			ChangeCharacterAddressGroup(CharacterFromID("BB_monk5"), "cloister_inside", "quest", "m5");
			LAi_SetActorType(characterFromID("BB_monk5"));
			LAi_group_MoveCharacter(characterFromID("BB_monk5"), LAI_GROUP_PLAYER);

			ChangeCharacterAddressGroup(CharacterFromID("BB_monk3_copy"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("BB_monk4_copy"), "none", "", "");

			ChangeCharacterAddressGroup(CharacterFromID("BB_monk1"), "cloister_inside", "quest", "m1");
			ChangeCharacterAddressGroup(CharacterFromID("BB_monk2"), "cloister_inside", "quest", "m2");
			ChangeCharacterAddressGroup(CharacterFromID("BB_monk3"), "cloister_inside", "quest", "m3");
			ChangeCharacterAddressGroup(CharacterFromID("BB_monk4"), "cloister_inside", "quest", "m4");
	
			LAi_SetActorType(characterFromID("BB_monk1"));
			LAi_SetActorType(characterFromID("BB_monk2"));
			LAi_SetActorType(characterFromID("BB_monk3"));
			LAi_SetActorType(characterFromID("BB_monk4"));

			LAi_group_MoveCharacter(characterFromID("BB_monk1"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("BB_monk2"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("BB_monk3"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("BB_monk4"), LAI_GROUP_PLAYER);

			//place bad guys attacking cloister here
			ChangeCharacterAddressGroup(CharacterFromID("Brthug1"), "cloister_inside", "quest", "b1");
			ChangeCharacterAddressGroup(CharacterFromID("Brthug2"), "cloister_inside", "quest", "b2");
			ChangeCharacterAddressGroup(CharacterFromID("Brthug5"), "cloister_inside", "quest", "b3");
			ChangeCharacterAddressGroup(CharacterFromID("Brthug4"), "cloister_inside", "quest", "b4");
			ChangeCharacterAddressGroup(CharacterFromID("Brthug3"), "cloister_inside", "quest", "b5");
			ChangeCharacterAddressGroup(CharacterFromID("Brthug6"), "cloister_inside", "quest", "b6");
			ChangeCharacterAddressGroup(CharacterFromID("Brthug7"), "cloister_inside", "quest", "b7");
			LAi_SetActorType(characterFromID("Brthug1"));
			LAi_SetActorType(characterFromID("Brthug2"));
			LAi_SetActorType(characterFromID("Brthug3"));
			LAi_SetActorType(characterFromID("Brthug4"));	
			LAi_SetActorType(characterFromID("Brthug5"));
			LAi_SetActorType(characterFromID("Brthug6"));
			LAi_SetActorType(characterFromID("Brthug7"));			
			LAi_SetImmortal(characterFromID("Brthug4"), false);
			LAi_SetImmortal(characterFromID("Brthug6"), false);
			DeleteAttribute(characterFromID("Brthug3"), "items");
			GiveItem2Character(characterFromID("Brthug3"), "blade5");
			EquipCharacterByItem(characterFromID("Brthug3"), "blade5");
			GiveItem2Character(characterFromID("Brthug1"), "bladeX2");
			EquipCharacterByItem(characterFromID("Brthug1"), "bladeX2");
		
			LAi_SetHP(characterFromID("Brthug1"), 120.0, 120.0);
			LAi_SetHP(characterFromID("Brthug2"), 120.0, 120.0);
			LAi_SetHP(characterFromID("Brthug3"), 75.0, 75.0);
			LAi_SetHP(characterFromID("Brthug4"), 90.0, 90.0);
			LAi_SetHP(characterFromID("Brthug5"), 105.0, 105.0);
			LAi_SetHP(characterFromID("Brthug6"), 90.0, 90.0);
			LAi_SetHP(characterFromID("Brthug7"), 90.0, 90.0);
		
			LAi_group_MoveCharacter(characterFromID("Brthug1"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("Brthug2"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("Brthug3"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("Brthug4"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("Brthug5"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("Brthug6"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("Brthug7"), "ROOF_THUGS_1");

			LAi_group_Register("ROOF_THUGS_1");
			LAi_group_SetRelation(LAI_GROUP_PLAYER, "ROOF_THUGS_1", LAI_GROUP_ENEMY);
			LAi_group_FightGroups(LAI_GROUP_PLAYER, "ROOF_THUGS_1", true);

			ChangeCharacterAddressGroup(CharacterFromID("inq_priest"), "cloister_inside", "quest", "inq_A1");
			ChangeCharacterAddressGroup(CharacterFromID("inq_monk1"), "cloister_inside", "quest", "inq_A2");
			ChangeCharacterAddressGroup(CharacterFromID("inq_monk2"), "cloister_inside", "quest", "inq_A3");
			ChangeCharacterAddressGroup(CharacterFromID("inq_monk3"), "cloister_inside", "quest", "inq_A4");
			ChangeCharacterAddressGroup(CharacterFromID("inq_monk4"), "cloister_inside", "quest", "inq_A5");
			
			Pchar.quest.7thugs_dead_yes.win_condition.l1 = "NPC_Death";
			Pchar.quest.7thugs_dead_yes.win_condition.l1.character = "Brthug1";
			Pchar.quest.7thugs_dead_yes.win_condition.l2 = "NPC_Death";
			Pchar.quest.7thugs_dead_yes.win_condition.l2.character = "Brthug2";
			Pchar.quest.7thugs_dead_yes.win_condition.l3 = "NPC_Death";
			Pchar.quest.7thugs_dead_yes.win_condition.l3.character = "Brthug3";
			Pchar.quest.7thugs_dead_yes.win_condition.l4 = "NPC_Death";
			Pchar.quest.7thugs_dead_yes.win_condition.l4.character = "Brthug4";
			Pchar.quest.7thugs_dead_yes.win_condition.l5 = "NPC_Death";
			Pchar.quest.7thugs_dead_yes.win_condition.l5.character = "Brthug5";
			Pchar.quest.7thugs_dead_yes.win_condition.l6 = "NPC_Death";
			Pchar.quest.7thugs_dead_yes.win_condition.l6.character = "Brthug6";
			Pchar.quest.7thugs_dead_yes.win_condition.l7 = "NPC_Death";
			Pchar.quest.7thugs_dead_yes.win_condition.l7.character = "Brthug7";
			Pchar.quest.7thugs_dead_yes.win_condition = "7thugs_dead_yes";
		break;

		case "7thugs_dead_yes":
			PlaySound("INTERFACE\key_unlock2.wav");

			LAi_SetActorType(characterFromID("BB_monk1"));
			LAi_ActorRunToLocator(characterFromID("BB_monk1"), "quest", "m1", "", 4.0);
			LAi_SetActorType(characterFromID("BB_monk2"));
			LAi_ActorRunToLocator(characterFromID("BB_monk2"), "quest", "m2", "", 4.0);
			LAi_SetActorType(characterFromID("BB_monk3"));
			LAi_ActorRunToLocator(characterFromID("BB_monk3"), "quest", "m3", "", 4.0);
			LAi_SetActorType(characterFromID("BB_monk4"));
			LAi_ActorRunToLocator(characterFromID("BB_monk4"), "quest", "m4", "", 4.0);
			LAi_SetActorType(characterFromID("BB_monk5"));
			LAi_ActorRunToLocator(characterFromID("BB_monk5"), "quest", "m5_2", "inquisition3", 4.0);

			ChangeCharacterAddressGroup(CharacterFromID("inq_priest"), "cloister_inside", "reload", "reload1");

			LAi_QuestDelay("inquisition1", 1.0);
		break;

		case "inquisition1":
			PlaySound("VOICE\ENGLISH\c_brother21.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload1");

			LAi_QuestDelay("inquisition2", 1.0);
		break;

		case "inquisition2":
			PlaySound("AMBIENT\TAVERN\tinkle4.wav");
			PlaySound("AMBIENT\TAVERN\tinkle4.wav");
			PlaySound("PEOPLE\recoil.wav");
			ChangeCharacterAddressGroup(CharacterFromID("inq_monk1"), "cloister_inside", "quest", "inq_B2");
			ChangeCharacterAddressGroup(CharacterFromID("inq_monk2"), "cloister_inside", "quest", "inq_B3");
			ChangeCharacterAddressGroup(CharacterFromID("inq_monk3"), "cloister_inside", "quest", "inq_B4");
			ChangeCharacterAddressGroup(CharacterFromID("inq_monk4"), "cloister_inside", "quest", "inq_B5");
			LAi_SetActorType(characterFromID("inq_priest"));
			LAi_SetActorType(characterFromID("inq_monk1"));
			LAi_SetActorType(characterFromID("inq_monk2"));
			LAi_SetActorType(characterFromID("inq_monk3"));
			LAi_SetActorType(characterFromID("inq_monk4"));
			LAi_group_MoveCharacter(characterFromID("inq_priest"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("inq_monk1"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("inq_monk2"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("inq_monk3"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("inq_monk4"), "ROOF_THUGS_1");
		break; 

		case "inquisition3":
			LAi_SetPlayerType(Pchar);

			ChangeCharacterAddressGroup(CharacterFromID("bb_nun1"), "cloister_inside", "quest", "nuns_standby");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun2"), "cloister_inside", "quest", "nuns_standby");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun3"), "cloister_inside", "quest", "nuns_standby");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun4"), "cloister_inside", "quest", "nuns_standby");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun5"), "cloister_inside", "quest", "nuns_standby");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun6"), "cloister_inside", "quest", "nuns_standby");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun7"), "cloister_inside", "quest", "nuns_standby");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun8"), "cloister_inside", "quest", "nuns_standby");

			GiveItem2Character(CharacterFromID("bb_nun1"), "bladekeyring");
			EquipCharacterByItem(characterFromID("bb_nun1"), "bladekeyring");
			GiveItem2Character(CharacterFromID("bb_nun2"), "bladecandelabre");
			EquipCharacterByItem(characterFromID("bb_nun2"), "bladecandelabre");
			GiveItem2Character(CharacterFromID("bb_nun3"), "bladechalice");
			EquipCharacterByItem(characterFromID("bb_nun3"), "bladechalice");
			GiveItem2Character(CharacterFromID("bb_nun4"), "bladereliquary");
			EquipCharacterByItem(characterFromID("bb_nun4"), "bladereliquary");
			GiveItem2Character(CharacterFromID("bb_nun5"), "bladecenser");
			EquipCharacterByItem(characterFromID("bb_nun5"), "bladecenser");
			GiveItem2Character(CharacterFromID("bb_nun6"), "bladehammer");
			EquipCharacterByItem(characterFromID("bb_nun6"), "bladehammer");
			GiveItem2Character(CharacterFromID("bb_nun7"), "bladebroom");
			EquipCharacterByItem(characterFromID("bb_nun7"), "bladebroom");
			GiveItem2Character(CharacterFromID("bb_nun8"), "bladeX4");
			EquipCharacterByItem(characterFromID("bb_nun8"), "bladeX4");
			GiveItem2Character(CharacterFromID("bb_nun8"), "pistolmaquahuitl");
			EquipCharacterByItem(characterFromID("bb_nun8"), "pistolmaquahuitl");

			LAi_SetActorType(characterFromID("BB_nun1"));
			LAi_SetActorType(characterFromID("BB_nun2"));
			LAi_SetActorType(characterFromID("BB_nun3"));
			LAi_SetActorType(characterFromID("BB_nun4"));
			LAi_SetActorType(characterFromID("BB_nun5"));
			LAi_SetActorType(characterFromID("BB_nun6"));
			LAi_SetActorType(characterFromID("BB_nun7"));
			LAi_SetActorType(characterFromID("BB_nun8"));
			LAi_group_MoveCharacter(characterFromID("BB_nun1"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("BB_nun2"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("BB_nun3"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("BB_nun4"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("BB_nun5"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("BB_nun6"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("BB_nun7"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("BB_nun8"), LAI_GROUP_PLAYER);

			ChangeCharacterAddressGroup(CharacterFromID("BB_monk1"), "cloister_inside", "quest", "m1");
			ChangeCharacterAddressGroup(CharacterFromID("BB_monk2"), "cloister_inside", "quest", "m2");
			ChangeCharacterAddressGroup(CharacterFromID("BB_monk3"), "cloister_inside", "quest", "m3");
			ChangeCharacterAddressGroup(CharacterFromID("BB_monk4"), "cloister_inside", "quest", "m4");
			ChangeCharacterAddressGroup(CharacterFromID("BB_monk5"), "cloister_inside", "quest", "m5_2");
			LAi_SetActorType(characterFromID("BB_monk1"));
			LAi_SetActorType(characterFromID("BB_monk2"));
			LAi_SetActorType(characterFromID("BB_monk3"));
			LAi_SetActorType(characterFromID("BB_monk4"));
			LAi_SetActorType(characterFromID("BB_monk5"));
			LAi_group_MoveCharacter(characterFromID("BB_monk1"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("BB_monk2"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("BB_monk3"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("BB_monk4"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("BB_monk5"), LAI_GROUP_PLAYER);

			LAi_group_Register("ROOF_THUGS_1");
			LAi_group_SetRelation(LAI_GROUP_PLAYER, "ROOF_THUGS_1", LAI_GROUP_ENEMY);
			LAi_group_FightGroups(LAI_GROUP_PLAYER, "ROOF_THUGS_1", true);

			LAi_QuestDelay("inquisition4", 5.0);
			LAi_QuestDelay("inquisition5", 10.0);
		break; 
	
		case "inquisition4":
			PlaySound("VOICE\ENGLISH\gr_wench3_angry.wav");
			PlaySound("VOICE\ENGLISH\gr_wench3_angry.wav");

			ChangeCharacterAddressGroup(CharacterFromID("bb_nun1"), "cloister_inside", "quest", "inq_A2");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun2"), "cloister_inside", "quest", "inq_A3");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun3"), "cloister_inside", "quest", "inq_A4");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun4"), "cloister_inside", "quest", "inq_A5");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun8"), "cloister_inside", "quest", "inq_A1");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun5"), "cloister_inside", "quest", "nunB_1");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun6"), "cloister_inside", "quest", "nunC_1");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun7"), "cloister_inside", "quest", "nunD_1");
		break; 

		case "inquisition5":
			PlaySound("VOICE\ENGLISH\Fre_f_a_012.wav");
			PlaySound("VOICE\ENGLISH\Fre_f_a_012.wav");

			LAi_SetImmortal(characterFromID("inq_priest"), false);
			LAi_SetImmortal(characterFromID("inq_monk1"), false);
			LAi_SetImmortal(characterFromID("inq_monk2"), false);
			LAi_SetImmortal(characterFromID("inq_monk3"), false);
			LAi_SetImmortal(characterFromID("inq_monk4"), false);
		
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun1"), "cloister_inside", "quest", "inq_B2");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun2"), "cloister_inside", "quest", "inq_B3");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun3"), "cloister_inside", "quest", "inq_B4");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun4"), "cloister_inside", "quest", "inq_B5");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun8"), "cloister_inside", "quest", "nunA");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun5"), "cloister_inside", "quest", "nunB");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun6"), "cloister_inside", "quest", "nunC");
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun7"), "cloister_inside", "quest", "nunD");

			Pchar.quest.7thugs_dead_yes.win_condition.l1 = "NPC_Death";
			Pchar.quest.7thugs_dead_yes.win_condition.l1.character = "inq_priest";
			Pchar.quest.7thugs_dead_yes.win_condition.l2 = "NPC_Death";
			Pchar.quest.7thugs_dead_yes.win_condition.l2.character = "inq_monk1";
			Pchar.quest.7thugs_dead_yes.win_condition.l3 = "NPC_Death";
			Pchar.quest.7thugs_dead_yes.win_condition.l3.character = "inq_monk2";
			Pchar.quest.7thugs_dead_yes.win_condition.l4 = "NPC_Death";
			Pchar.quest.7thugs_dead_yes.win_condition.l4.character = "inq_monk3";
			Pchar.quest.7thugs_dead_yes.win_condition.l5 = "NPC_Death";
			Pchar.quest.7thugs_dead_yes.win_condition.l5.character = "inq_monk4";
			Pchar.quest.7thugs_dead_yes.win_condition = "5inq_dead_yes";
		break;

		case "5inq_dead_yes":
			if(LAi_IsFightMode(Pchar)) {LAi_SetFightMode(Pchar, false);}

			LAi_QuestDelay("5inq_dead_yes1", 1.0);			
		break;

		case "5inq_dead_yes1":
			characters[GetCharacterIndex("bb_nun8")].dialog.CurrentNode = "thank_you";
			LAi_SetActorType(characterFromID("bb_nun8"));
			LAi_ActorDialog(characterFromID("bb_nun8"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("bb_nun8"));
		break;

		case "Sister_Richards_leaves":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload1");

			LAi_SetActorType(CharacterFromID("bb_nun1"));
			LAi_ActorGoToLocator(CharacterFromID("bb_nun1"), "reload", "reload1", "Sister_Richards_leaves1", 5.0);

			LAi_SetStayType(characterFromID("BB_monk1"));
			LAi_SetStayType(characterFromID("BB_monk2"));
			LAi_SetStayType(characterFromID("BB_monk3"));
			LAi_SetStayType(characterFromID("BB_monk4"));
			LAi_SetStayType(characterFromID("BB_monk5"));

			LAi_SetStayType(characterFromID("BB_nun2"));
			LAi_SetStayType(characterFromID("BB_nun3"));
			LAi_SetStayType(characterFromID("BB_nun4"));
			LAi_SetStayType(characterFromID("BB_nun5"));
			LAi_SetStayType(characterFromID("BB_nun6"));
			LAi_SetStayType(characterFromID("BB_nun7"));
			LAi_SetStayType(characterFromID("BB_nun8"));

			Pchar.cloister = "neutral";
			Pchar.monastary = "dont_disturb";
			Pchar.abbess = "dont_disturb";
			characters[GetCharacterIndex("bb_nun8")].dialog.CurrentNode = "First time";
		break;

		case "Sister_Richards_leaves1":
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun1"), "cloister_exit", "reload", "reload1");
			Locations[FindLocation("cloister_inside")].reload.l1.disable = 0;	//to exit
			Locations[FindLocation("cloister_exit")].locators_radius.goto.goto7 = 3.0;
			Locations[FindLocation("cloister_exit")].locators_radius.box.box1 = 2.0;

			Pchar.quest.Sister_Richards_leaves2.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.Sister_Richards_leaves2.win_condition.l1.location = "cloister_inside";
			Pchar.quest.Sister_Richards_leaves2.win_condition = "Sister_Richards_leaves2";
		break;

		case "Sister_Richards_leaves2":
			LAi_SetCitizenType(characterFromID("BB_monk1"));
			LAi_SetCitizenType(characterFromID("BB_monk2"));
			LAi_SetCitizenType(characterFromID("BB_monk3"));
			LAi_SetCitizenType(characterFromID("BB_monk4"));
			LAi_SetCitizenType(characterFromID("BB_monk5"));

			LAi_SetCitizenType(characterFromID("BB_nun2"));
			LAi_SetCitizenType(characterFromID("BB_nun3"));
			LAi_SetCitizenType(characterFromID("BB_nun4"));
			LAi_SetCitizenType(characterFromID("BB_nun5"));
			LAi_SetCitizenType(characterFromID("BB_nun6"));
			LAi_SetCitizenType(characterFromID("BB_nun7"));
			LAi_SetCitizenType(characterFromID("BB_nun8"));

			pchar.quest.Sister_Richards_leaves3.win_condition.l1 = "locator";
			pchar.quest.Sister_Richards_leaves3.win_condition.l1.location = "Cloister_exit";
			pchar.quest.Sister_Richards_leaves3.win_condition.l1.locator_group = "goto";
			pchar.quest.Sister_Richards_leaves3.win_condition.l1.locator = "goto7";
			pchar.quest.Sister_Richards_leaves3.win_condition = "Sister_Richards_leaves3";
		break;

		case "Sister_Richards_leaves3":
			characters[GetCharacterIndex("bb_nun1")].Dialog.Filename = "Sister Richards_dialog.c";

			characters[GetCharacterIndex("bb_nun1")].dialog.CurrentNode = "unlock_to_town";
			LAi_SetActorType(characterFromID("bb_nun1"));
			LAi_ActorDialog(characterFromID("bb_nun1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("bb_nun1"));
		break;

		case "Sister_Richards_leaves4":

			if(CheckAttribute(Pchar,"model"))
			{
				switch(Pchar.model)
				{
					case "Howard_Pyle_3":
						PlaySound("PEOPLE\clothes1.wav");
						GiveItem2Character(Pchar, "socks_sewing");	
					break;

					case "Howard_Pyle_4":
						PlaySound("PEOPLE\clothes1.wav");
						GiveItem2Character(Pchar, "waistcoat");	
					break;

					case "Howard_Pyle_5":
						PlaySound("PEOPLE\clothes1.wav");
						GiveItem2Character(Pchar, "sash");
					break;
				}
			}

			LAi_SetActorType(CharacterFromID("bb_nun1"));
			LAi_ActorTurnToLocator(CharacterFromID("bb_nun1"), "randitem", "randitem9");

			LAi_QuestDelay("Sister_Richards_leaves5", 1.0);	
		break;

		case "Sister_Richards_leaves5":
			PlaySound("INTERFACE\key_unlock2.wav");
			Locations[FindLocation("cloister_exit")].reload.l1.disable = 0;		//to town
		SetCurrentTime(11.00, 0);

			if(CheckAttribute(Pchar, "Hands_officer") && Pchar.Hands_officer == "yes")
			{
				AddPassenger(Pchar, characterFromID("Hands"), 0);
				SetOfficersIndex(Pchar, 1, getCharacterIndex("Hands"));
				SetModel(characterFromID("Hands"), "bb_Hands2", "man", "man", 1.8, false);
				characters[GetCharacterIndex("Hands")].dialog.CurrentNode = "neutral";
				LAi_SetOfficerType(characterFromID("Hands"));
			}
			if(CheckAttribute(Pchar, "Caesar_officer") && Pchar.Caesar_officer == "yes")
			{
				AddPassenger(Pchar, characterFromID("Caesar"), 0);
				SetOfficersIndex(Pchar, 2, getCharacterIndex("Caesar"));
				characters[GetCharacterIndex("Caesar")].dialog.CurrentNode = "neutral";
				LAi_SetOfficerType(characterFromID("Caesar"));
			}
			if(CheckAttribute(Pchar, "Pell_officer") && Pchar.Pell_officer == "yes")
			{
				AddPassenger(Pchar, characterFromID("Pell"), 0);
				SetOfficersIndex(Pchar, 3, getCharacterIndex("Pell"));
				characters[GetCharacterIndex("Pell")].dialog.CurrentNode = "neutral";
				LAi_SetOfficerType(characterFromID("Pell"));
			}

			LAi_QuestDelay("Sister_Richards_leaves6", 1.0);	

			Pchar.quest.monastary_reset.win_condition.l1 = "Location";
			Pchar.quest.monastary_reset.win_condition.l1.location = "Cartagena_town_02";
			Pchar.quest.monastary_reset.win_condition = "monastary_reset";
		break;

		case "Sister_Richards_leaves6":
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun1"), "none", "", "");
		break;

		case "monastary_reset":
			ChangeCharacterAddressGroup(characterFromID("BB_monk3_copy"), "cloister_passage", "goto", "stay1");
			LAi_SetStayType(CharacterFromID("BB_monk3_copy"));
			ChangeCharacterAddressGroup(characterFromID("BB_monk4_copy"), "cloister_passage", "sit", "sit1");
			LAi_SetSitType(CharacterFromID("BB_monk4_copy"));

			ChangeCharacterAddressGroup(characterFromID("BB_monk1"), "cloister_exit", "goto", "goto4");
			LAi_SetCitizenType(CharacterFromID("BB_monk1"));
			ChangeCharacterAddressGroup(characterFromID("BB_monk2"), "cloister_exit", "goto", "goto1");
			LAi_SetCitizenType(CharacterFromID("BB_monk2"));
			ChangeCharacterAddressGroup(characterFromID("BB_monk3"), "cloister_inside", "goto", "goto2");
			LAi_SetStayType(CharacterFromID("BB_monk3"));
			ChangeCharacterAddressGroup(characterFromID("BB_monk4"), "cloister_inside", "sit", "sit1");
			LAi_SetSitType(CharacterFromID("BB_monk4"));
			ChangeCharacterAddressGroup(characterFromID("BB_monk5"), "cloister_passage", "goto", "chapel");
			LAi_SetStayType(CharacterFromID("BB_monk5"));

			ChangeCharacterAddressGroup(characterFromID("bb_nun1"), "BB_graveyard", "goto", "goto1");
			LAi_SetCitizenType(CharacterFromID("bb_nun1"));
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun2"), "BB_crypt1", "goto", "altar");
			LAi_SetStayType(CharacterFromID("bb_nun2"));
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun3"), "BB_refectory", "sit", "sit17");
			LAi_SetSitType(CharacterFromID("bb_nun3"));
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun4"), "BB_refectory", "merchant", "goto1");
			LAi_SetBarmanType(CharacterFromID("bb_nun4"));
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun5"), "BB_refectory", "tables", "table4");
			LAi_SetCitizenType(CharacterFromID("bb_nun5"));
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun6"), "BB_refectory", "sit", "sit14");
			LAi_SetSitType(CharacterFromID("bb_nun6"));
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun7"), "BB_refectory", "sit", "sit16");
			LAi_SetSitType(CharacterFromID("bb_nun7"));
			ChangeCharacterAddressGroup(CharacterFromID("bb_nun8"), "BB_church_room", "barmen", "bar1");
			LAi_SetStayType(CharacterFromID("bb_nun8"));

			DeleteAttribute(characterFromID("bb_nun1"), "items");
			DeleteAttribute(characterFromID("bb_nun2"), "items");
			DeleteAttribute(characterFromID("bb_nun3"), "items");
			DeleteAttribute(characterFromID("bb_nun4"), "items");
			DeleteAttribute(characterFromID("bb_nun5"), "items");
			DeleteAttribute(characterFromID("bb_nun6"), "items");
			DeleteAttribute(characterFromID("bb_nun7"), "items");
			DeleteAttribute(characterFromID("bb_nun8"), "items");
//pär Cartagena
	
			if(CheckCharacterItem(Pchar,"mapBB1") && CheckCharacterItem(Pchar,"mapBB3T") && CheckCharacterItem(Pchar,"mapBB4C"))
			{
				if(CheckCharacterItem(Pchar,"mapBB2A") || CheckCharacterItem(Pchar,"mapBB2B"))
				{
					if(CheckCharacterItem(Pchar,"mapBB5A") || CheckCharacterItem(Pchar,"mapBB5B"))
					{
						ChangeCharacterAddressGroup(CharacterFromID("Defoe"), "new_cloister_garden", "quest", "defoe");
						LAi_SetSitType(CharacterFromID("Defoe"));
						Characters[GetCharacterIndex("Defoe")].dialog.CurrentNode  = "neutral";//if spoken to before the auto dialog starts
		
						ChangeCharacterAddressGroup(CharacterFromID("gm_crew8"), "Cartagena_town_02", "officers", "falaise_de_fleur_location_02_perechod_3");
						Locations[FindLocation("Cartagena_town_02")].locators_radius.officers.falaise_de_fleur_location_02_perechod_3 = 3.0;
						SetLocatorRadius(locations[FindLocation(Pchar.location)], "officers", "falaise_de_fleur_location_02_perechod_3", 3.0);

						pchar.quest.defoe_letter.win_condition.l1 = "locator";
						pchar.quest.defoe_letter.win_condition.l1.location = "Cartagena_town_02";
						pchar.quest.defoe_letter.win_condition.l1.locator_group = "officers";
						pchar.quest.defoe_letter.win_condition.l1.locator = "falaise_de_fleur_location_02_perechod_3";
						pchar.quest.defoe_letter.win_condition = "defoe_letter";

						pchar.quest.defoe_sit_down.win_condition.l1 = "locator";
						pchar.quest.defoe_sit_down.win_condition.l1.location = "new_cloister_garden";
						pchar.quest.defoe_sit_down.win_condition.l1.locator_group = "quest";
						pchar.quest.defoe_sit_down.win_condition.l1.locator = "defoe";
						pchar.quest.defoe_sit_down.win_condition = "defoe_sit_down";
					}
				}
			}
		break;
//......................................................................................................................................................
//pär common for all 4 stories

		case "defoe_letter":
			DeleteQuestHeader("Blackbeards_crew");

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("gm_crew8"));

			Characters[GetCharacterIndex("gm_crew8")].dialog.CurrentNode  = "defoe_letter";
			LAi_SetActorType(CharacterFromID("gm_crew8"));
			LAi_ActorDialog(characterFromID("gm_crew8"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("gm_crew8"));
		break;

		case "defoe_letter_given":
			PlaySound("VOICE\ENGLISH\gm_crew8B.wav");

			if(Checkattribute(Pchar, "location"))
			{
				switch(Pchar.location)
				{
					case "Cartagena_town_02":
						GiveItem2Character(Pchar, "letter_Cartagena");
						LAi_SetActorType(characterFromID("gm_crew8"));
						LAi_ActorRunToLocator(characterFromID("gm_crew8"), "reload", "locator22", "King_gone", 11.0);
						
						LAi_QuestDelay("pchar_playertype", 5.0);
					break;

					case "Turks_port":
						GiveItem2Character(Pchar, "letter_Turks");
						LAi_SetActorType(characterFromID("gm_crew8"));
						LAi_ActorRunToLocator(characterFromID("gm_crew8"), "patrol", "patrol4", "King_gone", 10.0);
						
						LAi_QuestDelay("pchar_playertype", 5.0);	
					break;
				

				}
			}
		break;

		case "King_gone":
			ChangeCharacterAddressGroup(CharacterFromID("gm_crew8"), "none", "", "");
		break;

		case "defoe_sit_down":
			Characters[GetCharacterIndex("Defoe")].dialog.CurrentNode  = "sit_down";
			LAi_SetActorType(CharacterFromID("Defoe"));
			LAi_ActorDialog(characterFromID("Defoe"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Defoe"));
		break;

		case "defoe_sit_down1":
			PlaySound("PEOPLE\creak2.wav");
			ChangeCharacterAddressGroup(Pchar, pchar.location, "quest", "pyle");
			LAi_SetSitType(Pchar);
			ChangeCharacterAddressGroup(CharacterFromID("Defoe"), pchar.location, "quest", "defoe");
			LAi_SetSitType(CharacterFromID("Defoe"));

			//check for later switch back
			if(CheckAttribute(Pchar,"model"))
			{
				switch(Pchar.model)
				{
					case "Howard_Pyle_3":
						Pchar.Pyle_model = "3";	
					break;

					case "Howard_Pyle_4":
						Pchar.Pyle_model = "4";		
					break;

					case "Howard_Pyle_5":
						Pchar.Pyle_model = "5";		
					break;

					case "Howard_Pyle":
						Pchar.Pyle_model = "0";		
					break;
				}
			}

			if(Checkattribute(Pchar, "location"))
			{
				switch(Pchar.location)
				{
					case "new_cloister_garden":
						Pchar.Pyle_loc = "new_cloister_garden";	
					break;

					case "Turks_old_fort":
						Pchar.Pyle_loc = "Turks_old_fort";	
					break;

					case "Antigua_port":
						Pchar.Pyle_loc = "Antigua_port";	
					break;
				}
			}

			SetModel(characterFromID("Knight"), "Huber_Hol2_17", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
			SetModel(characterFromID("Bonnet"), "huber_Hol1_17", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
		
			ChangeCharacterAddressGroup(CharacterFromID("Knight"), "Bath_tavern", "sit", "sit9L");
			LAi_SetSitType(CharacterFromID("Knight"));
			ChangeCharacterAddressGroup(CharacterFromID("Bonnet"), "Bath_tavern", "sit", "sit9R");
			LAi_SetSitType(CharacterFromID("Bonnet"));

			LAi_QuestDelay("defoe_map", 2.0);
		break;

		case "defoe_map":
			Pchar.defoe_merge_maps = "on";

			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "how_did_you_know";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "defoe_map1":
			Characters[GetCharacterIndex("Defoe")].dialog.CurrentNode  = "Claire_told_me";
			LAi_SetActorType(CharacterFromID("Defoe"));
			LAi_ActorDialog(characterFromID("Defoe"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Defoe"));
		break;

		case "defoe_map2":
			//start defoe - teach tavern scene

			SetModel(Pchar, "Daniel_Defoe", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
			SetModel(characterFromID("Teach"), "bb_Teach3", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
			RemoveCharacterEquip(characterFromID("Teach"), BLADE_ITEM_TYPE); 
			GiveItem2Character(characterFromID("Teach"),"bladeX4");
			GiveItem2Character(characterFromID("Teach"),"bladeMap_Hgold");
			EquipCharacterByItem(characterFromID("Teach"), "bladeMap_Hgold");
			ChangeCharacterAddressGroup(CharacterFromID("Teach"), "Bath_tavern", "sit", "sit10");
			LAi_SetSitType(CharacterFromID("Teach"));
			LAi_SetStayType(pchar);

			pchar.old.name = "Daniel";
			pchar.old.lastname = "De Foe";
			pchar.name = TranslateString("","Daniel");
			pchar.lastname = TranslateString("","De Foe");	

			DoQuestReloadToLocation("Bath_tavern", "quest", "defoe" ,"_");
		break;

		case "defoe_map3":
			//from swift dialog

			LAi_SetActorType(pchar);
			PlaySound("PEOPLE\creak2.wav");
			LAi_SetActorType(CharacterFromID("Swift"));
			
			LAi_QuestDelay("defoe_map4", 1.0);
		break;

		case "defoe_map4":
			PlaySound("VOICE\ENGLISH\Poe_smoke.wav");
			PlaySound("VOICE\ENGLISH\Poe_smoke.wav");

			LAi_QuestDelay("defoe_map5", 3.5);
		break;

		case "defoe_map5":
			//swift goes to ...

			PlaySound("VOICE\ENGLISH\defoe_again.wav");

			LAi_QuestDelay("defoe_map6", 4.0);
			LAi_ActorGoToLocator(CharacterFromID("swift"), "reload", "reload1", "Swift_leaves", 6.0);
		break;

		case "Swift_leaves":
			ChangeCharacterAddressGroup(CharacterFromID("Swift"), "none", "", "");
			PlaySound("INTERFACE\closed_door.wav");
		break;

		case "defoe_map6":
			//selfdialog		

			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "Lilliput";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "defoe_map7":
			//from selfdialog

			PlaySound("PEOPLE\run_wood.wav");
			LAi_SetActorType(CharacterFromID("Caesar"));
			ChangeCharacterAddressGroup(CharacterFromID("Caesar"), "Bath_tavern", "tables", "table3");
			
			LAi_QuestDelay("defoe_map8", 1.0);
		break;

		case "defoe_map8":
			PlaySound("VOICE\ENGLISH\defoe_psst.wav");
	
			LAi_QuestDelay("defoe_map9", 1.0);
		break;

		case "defoe_map9":
			PlaySound("AMBIENT\RESIDENCE\some2.wav");
			LAi_SetActorType(CharacterFromID("Teach"));
			LAi_ActorTurnToLocator(CharacterFromID("Teach"), "tables", "table3");
			
			LAi_QuestDelay("defoe_map10", 0.5);
		break;

		case "defoe_map10":
			PlaySound("VOICE\ENGLISH\Eden_so.wav");

			LAi_QuestDelay("defoe_map11", 1.0);
		break;

		case "defoe_map11":
			PlaySound("VOICE\ENGLISH\gm_crew7.wav");
			LAi_SetActorType(CharacterFromID("Caesar"));
			LAi_ActorTurnToLocator(CharacterFromID("Caesar"), "quest", "defoe");

			LAi_QuestDelay("defoe_map12", 0.5);
		break;

		case "defoe_map12":
			LAi_SetActorType(CharacterFromID("Teach"));
			LAi_ActorTurnToLocator(CharacterFromID("Teach"), "sit", "sit12");

			LAi_QuestDelay("defoe_map12A", 0.5);
		break;

		case "defoe_map12A":
			PlaySound("VOICE\ENGLISH\gr_teach5.wav");

			LAi_QuestDelay("defoe_map13", 2.5);
		break;

		case "defoe_map13":
			PlaySound("AMBIENT\RESIDENCE\some2.wav");
			LAi_SetSitType(CharacterFromID("Teach"));
			characters[GetCharacterIndex("Teach")].dialog.CurrentNode = "Teach_tavern";
			
			LAi_QuestDelay("defoe_map14", 1.0);
		break;

		case "defoe_map14":
			LAi_SetStayType(pchar);
		break;

		case "defoe_map15":
			//from Teach's dialog

			PlaySound("AMBIENT\RESIDENCE\some2.wav");
			LAi_SetStayType(CharacterFromID("Teach"));
			LAi_SetActorType(Pchar);			//until next time pchar should activate Teach dialog

			LAi_QuestDelay("defoe_map16", 1.0);
		break;

		case "defoe_map16":
			PlaySound("VOICE\ENGLISH\gr_teach3.wav");
			LAi_SetPlayerType(characterFromID("Teach"));
			LAi_SetFightMode(characterFromID("Teach"), true);

			LAi_QuestDelay("defoe_map17", 2.5);
		break;

		case "defoe_map17":
			PlaySound("INTERFACE\paper.wav");
			RemoveCharacterEquip(characterFromID("Teach"), BLADE_ITEM_TYPE); 
			TakeItemFromCharacter(characterFromID("Teach"), "bladeMap_Hgold" );
			EquipCharacterByItem(characterFromID("Teach"), "bladeX4");

			LAi_QuestDelay("defoe_map18", 1.5);
		break;

		case "defoe_map18":
			LAi_SetFightMode(characterFromID("Teach"), false);

			LAi_QuestDelay("defoe_map19", 1.0);
		break;

		case "defoe_map19":
			Characters[GetCharacterIndex("Teach")].dialog.CurrentNode  = "Teach_tavern10";

			LAi_SetActorType(CharacterFromID("Teach"));
			LAi_ActorDialog(characterFromID("Teach"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Teach"));
		break;

		case "defoe_map20":
			//from Teach dialog

			PlaySound("PEOPLE\creak2.wav");
			ChangeCharacterAddressGroup(Pchar, "Bath_tavern", "quest", "defoe_close");			

			LAi_QuestDelay("defoe_map21", 1.0);
		break;

		case "defoe_map21":
			PlaySound("OBJECTS\DUEL\pistol_out1original.wav");
			GiveItem2Character(characterFromID("Teach"),"pistol201");
			EquipCharacterByItem(characterFromID("Teach"), "pistol201");

			LAi_QuestDelay("defoe_map22", 1.0);
		break;

		case "defoe_map22":
			PlaySound("PEOPLE\creak2.wav");
			ChangeCharacterAddressGroup(Pchar, "Bath_tavern", "quest", "defoe");

			LAi_QuestDelay("defoe_map23", 1.0);
		break;

		case "defoe_map23":
			PlaySound("AMBIENT\RESIDENCE\some2.wav");
			LAi_SetSitType(CharacterFromID("Teach"));

			LAi_QuestDelay("defoe_map24", 1.0);
		break;

		case "defoe_map24":
			Characters[GetCharacterIndex("Teach")].dialog.CurrentNode  = "Teach_tavern11";
			LAi_SetStayType(pchar);
		break;

		case "defoe_map25":
			//from Teach dialog

			PlaySound("VOICE\ENGLISH\pir_capR4.wav");
			PlaySound("VOICE\ENGLISH\pir_capR4.wav");
			LAi_SetActorType(Pchar);

			LAi_QuestDelay("defoe_map26", 3.0);			
		break;

		case "defoe_map26":
			pchar.old.name = "Howard";
			pchar.old.lastname = "Pyle";
			pchar.name = TranslateString("","Howard");
			pchar.lastname = TranslateString("","Pyle");

			if(CheckAttribute(Pchar,"Pyle_model"))
			{
				switch(Pchar.Pyle_model)
				{
					case "3":
						SetModel(Pchar, "Howard_Pyle_3", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);
					break;

					case "4":
						SetModel(Pchar, "Howard_Pyle_4", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);		
					break;

					case "5":
						SetModel(Pchar, "Howard_Pyle_5", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);		
					break;

					case "0":
						SetModel(Pchar, "Howard_Pyle", Pchar.model.animation, Pchar.sex, stf(Pchar.model.height), true);	
					break;
				}
			}

			LAi_QuestDelay("defoe_map27", 1.0);
		break;

		case "defoe_map27":
			LAi_SetSitType(Pchar);

			if(Checkattribute(Pchar, "Pyle_loc"))
			{
				switch(Pchar.Pyle_loc)
				{
					case "new_cloister_garden":
						DoQuestReloadToLocation("new_cloister_garden", "quest", "pyle" ,"return_to_defoe");	
					break;

					case "Turks_old_fort":
						DoQuestReloadToLocation("Turks_old_fort", "quest", "pyle" ,"return_to_defoe");	
					break;

					case "Antigua_port":
						DoQuestReloadToLocation("Antigua_port", "quest", "pyle" ,"return_to_defoe");	
					break;
				}
			}
		break;

		case "return_to_defoe":
			//selfdialog

			AddQuestRecord("Johnson", "3");
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "Defoe_Johnson";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "return_to_defoe1":
			//from selfdialog

			Characters[GetCharacterIndex("Defoe")].dialog.CurrentNode  = "make_a_deal";
			LAi_SetActorType(CharacterFromID("Defoe"));
			LAi_ActorDialog(characterFromID("Defoe"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Defoe"));
		break;

		case "return_to_defoe2":
			//from defoe dialog

			PlaySound("AMBIENT\SHOP\paper.wav");
			PlaySound("AMBIENT\SHOP\paper.wav");

			LAi_QuestDelay("return_to_defoe3", 2.5);
		break;

		case "return_to_defoe3":
			Characters[GetCharacterIndex("Defoe")].dialog.CurrentNode  = "defoe_checks_maps";
			LAi_SetActorType(CharacterFromID("Defoe"));
			LAi_ActorDialog(characterFromID("Defoe"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Defoe"));
		break;

		case "3_map_problems_check":
			if(GetAttribute(Pchar, "mapBB4C") == "info" && GetAttribute(Pchar, "mapBB2B") == "info" && GetAttribute(Pchar, "mapBB5B") == "info")
			{
				LAi_QuestDelay("return_to_defoe3", 1.0);
			}
			else LAi_QuestDelay("3_map_problems_check", 1.0);
		break;

		case "return_to_defoe4":
			//from defoe dialog

			PlaySound("INTERFACE\paper.wav");
			GiveItem2Character(Pchar, "mapBB6");
			AddQuestRecord("Johnson", "4");
		break;

		case "return_to_defoe5":
			//from self dialog

			LAi_QuestDelay("pchar_ooh", 0.1);
			LAi_QuestDelay("return_to_defoe6", 1.5);
		break;

		case "return_to_defoe6":
			Characters[GetCharacterIndex("Defoe")].dialog.CurrentNode  = "merge_map_info";
			LAi_SetActorType(CharacterFromID("Defoe"));
			LAi_ActorDialog(characterFromID("Defoe"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Defoe"));
		break;

		case "return_to_defoe7":
			//from defoe dialog, he now takes all maps

			PlaySound("AMBIENT\SHOP\paper.wav");
			PlaySound("AMBIENT\SHOP\paper.wav");

			TakeItemFromCharacter(Pchar, "mapBB1");
			TakeItemFromCharacter(Pchar, "mapBB2B");
			TakeItemFromCharacter(Pchar, "mapBB3T");
			TakeItemFromCharacter(Pchar, "mapBB4C");
			TakeItemFromCharacter(Pchar, "mapBB5B");
			TakeItemFromCharacter(Pchar, "mapBB6T");
			TakeItemFromCharacter(Pchar, "map");
			
			LAi_QuestDelay("return_to_defoe8", 2.5);
		break;

		case "return_to_defoe8":
			PlaySound("AMBIENT\RESIDENCE\some1.wav");
			PlaySound("AMBIENT\RESIDENCE\some1.wav");

			LAi_QuestDelay("return_to_defoe9", 4.5);
		break;

		case "return_to_defoe9":
			Characters[GetCharacterIndex("Defoe")].dialog.CurrentNode  = "all_names_on_one_map";
			LAi_SetActorType(CharacterFromID("Defoe"));
			LAi_ActorDialog(characterFromID("Defoe"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Defoe"));
		break;

		case "return_to_defoe10":
			//from defoe dialog

			PlaySound("INTERFACE\paper.wav");
			GiveItem2Character(Pchar, "mapWR1");
		break;

		case "return_to_defoe11":
			//from examine mapWR1 (letters) 1st time

			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "Saint_X";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "return_to_defoe12":
			//from examine mapWR1 (letters) 2nd time

			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "Kristiania";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "return_to_defoe13":
			PlaySound("INTERFACE\paper.wav");
			TakeItemFromCharacter(Pchar, "mapWR1");

			LAi_QuestDelay("return_to_defoe14", 1.0);
		break;

		case "return_to_defoe14":
			PlaySound("AMBIENT\RESIDENCE\some1.wav");
			PlaySound("AMBIENT\RESIDENCE\some1.wav");

			LAi_QuestDelay("return_to_defoe14_A", 4.5);
		break;

		case "return_to_defoe14_A":
			PlaySound("VOICE\ENGLISH\defoe_psst.wav");

			LAi_QuestDelay("return_to_defoe15", 1.0);
		break;

		case "return_to_defoe15":
			PlaySound("INTERFACE\paper.wav");
			GiveItem2Character(Pchar, "mapWR2");

			DeleteQuestHeader("Benjamin_Hornigold");
			DeleteQuestHeader("Caesar");
			DeleteQuestHeader("Charles_Eden");
			DeleteQuestHeader("Richards");
			DeleteQuestHeader("Israel_Hands");
			DeleteQuestHeader("Johnson");
		break;

		case "return_to_defoe16":
			//from examine WR2

			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "draw_lines";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "return_to_defoe17":
			//from self dialog

			PlaySound("INTERFACE\paper.wav");
			TakeItemFromCharacter(Pchar, "mapWR2");

			LAi_QuestDelay("return_to_defoe18", 1.0);
		break;

		case "return_to_defoe18":
			PlaySound("AMBIENT\RESIDENCE\some1.wav");
			PlaySound("AMBIENT\RESIDENCE\some1.wav");

			LAi_QuestDelay("return_to_defoe19", 4.5);
		break;

		case "return_to_defoe19":
			PlaySound("INTERFACE\paper.wav");
			GiveItem2Character(Pchar, "mapWR3");
		break;

		case "return_to_defoe20":
			//from examine WR3

			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "wrong_lines1";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "return_to_defoe21":
			//from self dialog

			PlaySound("INTERFACE\paper.wav");
			TakeItemFromCharacter(Pchar, "mapWR3");

			LAi_QuestDelay("return_to_defoe22", 1.0);
		break;

		case "return_to_defoe22":
			PlaySound("AMBIENT\RESIDENCE\some1.wav");
			PlaySound("AMBIENT\RESIDENCE\some1.wav");

			LAi_QuestDelay("return_to_defoe23", 4.5);
		break;

		case "return_to_defoe23":
			PlaySound("INTERFACE\paper.wav");
			GiveItem2Character(Pchar, "mapWR4");
		break;

		case "return_to_defoe24":
			//from examine WR4

			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "wrong_lines2";
			LAi_ActorSelfDialog(pchar, "");
		break;
		
		case "return_to_defoe25":
			//from self dialog

			PlaySound("INTERFACE\paper.wav");
			TakeItemFromCharacter(Pchar, "mapWR4");

			LAi_QuestDelay("return_to_defoe26", 1.0);
		break;

		case "return_to_defoe26":
			PlaySound("AMBIENT\SHOP\sigh2.wav");
			PlaySound("AMBIENT\SHOP\sigh2.wav");
			PlaySound("AMBIENT\RESIDENCE\some1.wav");
			PlaySound("AMBIENT\RESIDENCE\some1.wav");

			LAi_QuestDelay("return_to_defoe27", 4.5);
		break;

		case "return_to_defoe27":
			Characters[GetCharacterIndex("Defoe")].dialog.CurrentNode  = "right_lines";
			LAi_SetActorType(CharacterFromID("Defoe"));
			LAi_ActorDialog(characterFromID("Defoe"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Defoe"));
		break;

		case "return_to_defoe28":
			//from defoe dialog

			PlaySound("INTERFACE\paper.wav");
			GiveItem2Character(Pchar, "mapWR5");
		break;

		case "return_to_defoe29":
			//from examine WR5

			PauseAllSounds();//stops music
			PlaySound("AMBIENT\SEASHORE\fanfare.wav");

			LAi_QuestDelay("return_to_defoe30", 13.0);
		break;

		case "return_to_defoe30":
			PostEvent("LoadSceneSound", 0);

			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "right_island";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "return_to_defoe31":
			//from self dialog

			PlaySound("PEOPLE\creak2.wav");
			LAi_SetActorType(pchar);
			ChangeCharacterAddressGroup(pchar, pchar.location, "goto", "pyle_stay");

			LAi_QuestDelay("return_to_defoe32", 1.0);
		break;

		case "return_to_defoe32":
			PlaySound("AMBIENT\RESIDENCE\some2.wav");
			LAi_SetStayType(CharacterFromID("Defoe"));
			ChangeCharacterAddressGroup(CharacterFromID("Defoe"), pchar.location, "goto", "defoe_stay");

			LAi_QuestDelay("return_to_defoe33", 0.1);
		break;

		case "return_to_defoe33":
			Characters[GetCharacterIndex("Defoe")].dialog.CurrentNode  = "Pyle_to_IslaMona";
			LAi_SetActorType(CharacterFromID("Defoe"));
			LAi_ActorDialog(characterFromID("Defoe"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Defoe"));
		break;

		case "return_to_defoe34":
			//from defoe dialog

			PlaySound("VOICE\ENGLISH\defoe_again.wav");

			LAi_QuestDelay("return_to_defoe35", 2.0);
		break;

		case "return_to_defoe35":
			Characters[GetCharacterIndex("Defoe")].dialog.CurrentNode  = "my_share";

			PlaySound("AMBIENT\RESIDENCE\some2.wav");
			ChangeCharacterAddressGroup(CharacterFromID("Defoe"), pchar.location, "quest", "defoe");
			LAi_SetSitType(CharacterFromID("Defoe"));

			LAi_SetPlayerType(pchar);
			LAi_SetOfficerType(CharacterFromID("Hands"));
			LAi_SetOfficerType(CharacterFromID("Pell"));
			if(IsOfficer(CharacterFromID("Caesar")))  {LAi_SetOfficerType(CharacterFromID("Caesar"));}
			
			LAi_QuestDelay("pchar_lets_go", 1.0);

			Island_SetReloadEnableLocal("IslaMona", "reload_1", true);	
			Islands[FindIsland("IslaMona")].reload.l1.goto_enable = true;
		break;




			




//pär common for all 4 stories
//......................................................................................................................................................

//_________________________________________________________________________________________________________________

		case "start_Kristiania":
			SetNextWeather("Clear");
			Pchar.Kr_quest = "BB_tower";

			LAi_QuestDelay("KR_center_backloop1", 0.1);
			LAi_QuestDelay("KR_center_backloop2", 0.1);
			LAi_QuestDelay("KR_lower_backloop", 0.1);
			LAi_QuestDelay("NS_locked_shipyard_start", 0.1);

			Pchar.quest.Kr_citizens.win_condition.l1 = "Location";
			Pchar.quest.Kr_citizens.win_condition.l1.location = "Kristiania_entre";
			Pchar.quest.Kr_citizens.win_condition = "start_Kristiania1";
		break;

		case "start_Kristiania1":
		//	ChangeCharacterAddressGroup(characterFromID("Kr_cit1"), "Kristiania_entre", "quest", "stay1");
			ChangeCharacterAddressGroup(characterFromID("Kr_cit2"), "Kristiania_entre", "quest", "sit3");
			ChangeCharacterAddressGroup(characterFromID("Kr_cit3"), "Kristiania_entre", "quest", "sit5");
			ChangeCharacterAddressGroup(characterFromID("Kr_cit4"), "Kristiania_entre", "quest", "stay3");
			ChangeCharacterAddressGroup(characterFromID("Kr_cit5"), "Kristiania_entre", "quest", "sit6");
			ChangeCharacterAddressGroup(characterFromID("Kr_cit6"), "Kristiania_entre", "quest", "stay5");
			ChangeCharacterAddressGroup(characterFromID("Kr_cit7"), "Kristiania_entre", "quest", "stay9");
			ChangeCharacterAddressGroup(characterFromID("Kr_cit8"), "Kristiania_entre", "quest", "sit1");
			ChangeCharacterAddressGroup(characterFromID("Kr_cit9"), "Kristiania_entre", "quest", "sit7");
			ChangeCharacterAddressGroup(characterFromID("Kr_cit10"), "Kristiania_entre", "quest", "sit12");
			ChangeCharacterAddressGroup(characterFromID("Kr_cit11"), "Kristiania_entre", "quest", "sit2");
		//	ChangeCharacterAddressGroup(characterFromID("Kr_cit12"), "Kristiania_entre", "quest", "stay2");
			ChangeCharacterAddressGroup(characterFromID("Kr_cit13"), "Kristiania_entre", "quest", "sit9");
			ChangeCharacterAddressGroup(characterFromID("Kr_cit14"), "Kristiania_entre", "quest", "sit11");
			ChangeCharacterAddressGroup(characterFromID("Kr_cit15"), "Kristiania_entre", "quest", "sit13");
			ChangeCharacterAddressGroup(characterFromID("Kr_cit16"), "Kristiania_entre", "quest", "sit14");

			ChangeCharacterAddressGroup(characterFromID("Kr_cit17"), "Kristiania_entre", "quest", "stay4");
			ChangeCharacterAddressGroup(characterFromID("Kr_cit18"), "Kristiania_entre", "quest", "stay6");
			ChangeCharacterAddressGroup(characterFromID("Kr_cit19"), "Kristiania_entre", "quest", "sit8");
			ChangeCharacterAddressGroup(characterFromID("Kr_cit20"), "Kristiania_entre", "quest", "stay7");
			ChangeCharacterAddressGroup(characterFromID("Kr_cit21"), "Kristiania_entre", "quest", "stay8");
			ChangeCharacterAddressGroup(characterFromID("Kr_cit22"), "Kristiania_entre", "quest", "sit4");
			ChangeCharacterAddressGroup(characterFromID("Kr_cit23"), "Kristiania_entre", "quest", "stay10");
			ChangeCharacterAddressGroup(characterFromID("Kr_cit24"), "Kristiania_entre", "quest", "stay11");
			ChangeCharacterAddressGroup(characterFromID("Kr_cit25"), "Kristiania_entre", "quest", "stay12");
			ChangeCharacterAddressGroup(characterFromID("Kr_cit26"), "Kristiania_entre", "quest", "auctionist");
			ChangeCharacterAddressGroup(characterFromID("Kr_cit27"), "Kristiania_entre", "quest", "sit10");
			ChangeCharacterAddressGroup(characterFromID("Kr_cit28"), "Kristiania_entre", "quest", "stay13");
		//	ChangeCharacterAddressGroup(characterFromID("Kr_cit29"), "Kristiania_entre", "quest", "poor1");
		//	ChangeCharacterAddressGroup(characterFromID("Kr_cit30"), "Kristiania_entre", "quest", "goto6");
		//	ChangeCharacterAddressGroup(characterFromID("Kr_cit31"), "Kristiania_entre", "quest", "stay14");
		//	ChangeCharacterAddressGroup(characterFromID("Kr_cit32"), "Kristiania_entre", "quest", "stay14");
	
			pchar.quest.end_auction.win_condition.l1 = "locator";
			pchar.quest.end_auction.win_condition.l1.location = "Kristiania_entre";
			pchar.quest.end_auction.win_condition.l1.locator_group = "quest";
			pchar.quest.end_auction.win_condition.l1.locator = "sit4";
			pchar.quest.end_auction.win_condition = "end_auction";
		break;

		case "end_auction":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "quest", "auctionist");

			LAi_QuestDelay("pchar_1", 0.1);
			LAi_QuestDelay("pchar_2", 1.1);
			LAi_QuestDelay("pchar_3", 2.1);
			LAi_QuestDelay("end_auction1", 3.1);
		break;

		case "end_auction1":
			LAi_SetStayType(Pchar);
			PlaySound("PEOPLE\wood1.wav");
			
			LAi_QuestDelay("end_auction2", 0.5);
		break;

		case "end_auction2":
			PlaySound("AMBIENT\cheer2.wav");

			LAi_QuestDelay("end_auction3", 4.0);
		break;

		case "end_auction3":
			LAi_SetActorType(characterFromID("Kr_cit26"));
			LAi_ActorDialog(characterFromID("Kr_cit26"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Kr_cit26"));
			Characters[GetCharacterIndex("Kr_cit26")].dialog.CurrentNode  = "end_auction";
		break;

		case "end_auction_done":
			LAi_SetPlayerType(Pchar);
			PlaySound("AMBIENT\cheer.wav");
			PlaySound("AMBIENT\silent_talk.wav");

			Characters[GetCharacterIndex("Kr_cit22")].dialog.CurrentNode  = "auction_over";
			LAi_SetStayType(characterFromID("Kr_cit26"));
			Characters[GetCharacterIndex("Kr_cit26")].dialog.CurrentNode  = "auction_over";

			LAi_SetCitizenType(characterFromID("Kr_cit1")); LAi_SetCitizenType(characterFromID("Kr_cit4"));
			LAi_SetCitizenType(characterFromID("Kr_cit6")); LAi_SetCitizenType(characterFromID("Kr_cit7"));
			LAi_SetCitizenType(characterFromID("Kr_cit12")); LAi_SetCitizenType(characterFromID("Kr_cit17"));
			LAi_SetCitizenType(characterFromID("Kr_cit18")); LAi_SetCitizenType(characterFromID("Kr_cit20"));
			LAi_SetCitizenType(characterFromID("Kr_cit21")); LAi_SetCitizenType(characterFromID("Kr_cit23"));
			LAi_SetCitizenType(characterFromID("Kr_cit24")); LAi_SetCitizenType(characterFromID("Kr_cit25"));
			LAi_SetCitizenType(characterFromID("Kr_cit28"));

			LAi_SetStayType(characterFromID("Kr_cit2")); LAi_SetStayType(characterFromID("Kr_cit8"));
			LAi_SetStayType(characterFromID("Kr_cit10")); LAi_SetStayType(characterFromID("Kr_cit11"));
			LAi_SetStayType(characterFromID("Kr_cit14")); LAi_SetStayType(characterFromID("Kr_cit15"));
			LAi_SetStayType(characterFromID("Kr_cit16"));

			locations[FindLocation("Kristiania_entre")].type = "silent_repair_town";
			PostEvent("LoadSceneSound", 0);	

			Pchar.quest.Kr_characters_split_group.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.Kr_characters_split_group.win_condition.l1.location = "Kristiania_entre";
			Pchar.quest.Kr_characters_split_group.win_condition = "Kr_characters_split_group";

			LAi_QuestDelay("end_auction_done1", 5.0);
		break;

		case "end_auction_done1":
			if(pchar.location == "Kristiania_entre")
			{
				LAi_SetCitizenType(characterFromID("Kr_cit2")); LAi_SetCitizenType(characterFromID("Kr_cit8"));
				LAi_SetCitizenType(characterFromID("Kr_cit10")); LAi_SetCitizenType(characterFromID("Kr_cit11"));
				LAi_SetCitizenType(characterFromID("Kr_cit14")); LAi_SetCitizenType(characterFromID("Kr_cit15"));
				LAi_SetCitizenType(characterFromID("Kr_cit16"));

				LAi_SetStayType(characterFromID("Kr_cit3")); LAi_SetStayType(characterFromID("Kr_cit5"));
				LAi_SetStayType(characterFromID("Kr_cit9")); LAi_SetStayType(characterFromID("Kr_cit13"));
				LAi_SetStayType(characterFromID("Kr_cit19")); LAi_SetStayType(characterFromID("Kr_cit27"));
				LAi_SetStayType(characterFromID("Kr_cit29"));

				LAi_QuestDelay("end_auction_done2", 5.0);
			}
		break;

		case "end_auction_done2":
			if(pchar.location == "Kristiania_entre")
			{
				LAi_SetCitizenType(characterFromID("Kr_cit3")); LAi_SetCitizenType(characterFromID("Kr_cit5"));
				LAi_SetCitizenType(characterFromID("Kr_cit9")); LAi_SetCitizenType(characterFromID("Kr_cit13"));
				LAi_SetCitizenType(characterFromID("Kr_cit19")); LAi_SetCitizenType(characterFromID("Kr_cit27"));
				LAi_SetCitizenType(characterFromID("Kr_cit29"));
			}
		break;
	
		case "Kr_characters_split_group":
			Locations[FindLocation("Kristiania_entre")].models.always.locators = "FF01_l_JRH_stop1";
			LAi_LocationFantomsGen(&locations[FindLocation("Kristiania_entre")], true);
			LAi_LocationMonstersGen(&locations[FindLocation("Kristiania_entre")], true);
			locations[FindLocation("Kristiania_entre")].vcskip = false;

			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit1"), "Kristiania_entre", "goto", "citizen010");
			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit8"), "Kristiania_entre", "reload", "locator22");
			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit9"), "Kristiania_entre", "goto", "citizen06");
			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit10"), "Kristiania_entre", "goto", "locator11");

			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit2"), "Kristiania_center", "reload", "reload28");
			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit11"), "Kristiania_center", "goto", "goto37");
			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit12"), "Kristiania_center", "goto", "goto52");
			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit13"), "Kristiania_center", "reload", "reload13");

			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit3"), "Kristiania_downhill", "goto", "locator13");
			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit14"), "Kristiania_downhill", "goto", "citizen04");
			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit15"), "Kristiania_downhill", "reload", "home");

			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit4"), "Kristiania_suburb", "goto", "citizen01");
			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit16"), "Kristiania_suburb", "reload", "locator21");
			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit17"), "Kristiania_suburb", "goto", "locator9");

			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit5"), "Nueva_Suecia_lower_town", "reload", "reload27");
			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit18"), "Nueva_Suecia_lower_town", "reload", "reload25");
			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit19"), "Nueva_Suecia_lower_town", "goto", "goto90");

			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit20"), "Nueva_Suecia_hidden_town", "goto", "goto2");
			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit21"), "Nueva_Suecia_hidden_town", "goto", "goto61");

			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit6"), "Nueva_Suecia_upper_town", "goto", "goto5");
			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit23"), "Nueva_Suecia_upper_town", "reload", "reload8");
			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit24"), "Nueva_Suecia_upper_town", "goto", "character4");

			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit7"), "Kristiania_port", "goto", "goto1");
			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit25"), "Kristiania_port", "goto", "goto4");
			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit27"), "Kristiania_port", "goto", "goto3");

			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit28"), "Kristiania_swamp_exit", "goto", "citizen02");
			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit29"), "Kristiania_swamp_exit", "goto", "citizen04");

			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit30"), "Kristiania_jungle_exit", "goto", "citizen011");
			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit31"), "Kristiania_jungle_exit", "goto", "citizen013");
			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit32"), "Kristiania_jungle_exit", "goto", "citizen03");

			LAi_SetCitizenType(characterFromID("Kr_cit1")); LAi_SetCitizenType(characterFromID("Kr_cit4"));
			LAi_SetCitizenType(characterFromID("Kr_cit6")); LAi_SetCitizenType(characterFromID("Kr_cit7"));
			LAi_SetCitizenType(characterFromID("Kr_cit12")); LAi_SetCitizenType(characterFromID("Kr_cit17"));
			LAi_SetCitizenType(characterFromID("Kr_cit18")); LAi_SetCitizenType(characterFromID("Kr_cit20"));
			LAi_SetCitizenType(characterFromID("Kr_cit21")); LAi_SetCitizenType(characterFromID("Kr_cit23"));
			LAi_SetCitizenType(characterFromID("Kr_cit24")); LAi_SetCitizenType(characterFromID("Kr_cit25"));

			LAi_SetCitizenType(characterFromID("Kr_cit2")); LAi_SetCitizenType(characterFromID("Kr_cit8"));
			LAi_SetCitizenType(characterFromID("Kr_cit10")); LAi_SetCitizenType(characterFromID("Kr_cit11"));
			LAi_SetCitizenType(characterFromID("Kr_cit14")); LAi_SetCitizenType(characterFromID("Kr_cit15"));
			LAi_SetCitizenType(characterFromID("Kr_cit16"));

			LAi_SetCitizenType(characterFromID("Kr_cit3")); LAi_SetCitizenType(characterFromID("Kr_cit5"));
			LAi_SetCitizenType(characterFromID("Kr_cit9")); LAi_SetCitizenType(characterFromID("Kr_cit13"));
			LAi_SetCitizenType(characterFromID("Kr_cit19")); LAi_SetCitizenType(characterFromID("Kr_cit27"));
			LAi_SetCitizenType(characterFromID("Kr_cit29"));

			LAi_SetCitizenType(characterFromID("Kr_cit28")); LAi_SetCitizenType(characterFromID("Kr_cit30"));
			LAi_SetCitizenType(characterFromID("Kr_cit31")); LAi_SetCitizenType(characterFromID("Kr_cit32"));

			Pchar.quest.BB_tower_found.win_condition.l1 = "Location";
			Pchar.quest.BB_tower_found.win_condition.l1.location = "BB_island2";
			Pchar.quest.BB_tower_found.win_condition = "BB_tower_found";

			Pchar.quest.jungle_path.win_condition.l1 = "Location";
			Pchar.quest.jungle_path.win_condition.l1.location = "Kristiania_jungle_exit";
			Pchar.quest.jungle_path.win_condition = "jungle_path";

			pchar.quest.TH_knowledge.win_condition.l1 = "locator";
			pchar.quest.TH_knowledge.win_condition.l1.location = "Kristiania_center";
			pchar.quest.TH_knowledge.win_condition.l1.locator_group = "reload";
			pchar.quest.TH_knowledge.win_condition.l1.locator = "reload27";
			pchar.quest.TH_knowledge.win_condition = "TH_knowledge";

			Pchar.quest.KR_chapel.win_condition.l1 = "Location";
			Pchar.quest.KR_chapel.win_condition.l1.location = "Kristiania_chapel";
			Pchar.quest.KR_chapel.win_condition = "KR_chapel";
		break;

		case "BB_tower_info1":
			AddQuestRecord("Blackbeards_tower","1");
		break;

		case "BB_tower_info2":
			AddQuestRecord("Blackbeards_tower","2");
		break;

		case "BB_tower_info3":
			AddQuestRecord("Blackbeards_tower","3");
		break;

		case "BB_tower_info5":
			AddQuestRecord("Blackbeards_tower","5");
		break;

		case "start_6_KR_items":
			SetQuestHeader("KR_logbook");
			AddQuestRecord("KR_logbook","3");
			SetQuestHeader("KR_tricorn");
			AddQuestRecord("KR_tricorn","3");
			SetQuestHeader("KR_amulet");
			AddQuestRecord("KR_amulet","3");
			SetQuestHeader("KR_flagchest");
			AddQuestRecord("KR_flagchest","3");
			SetQuestHeader("KR_cutlasses");
			AddQuestRecord("KR_cutlasses","3");
			SetQuestHeader("KR_letter");
			AddQuestRecord("KR_letter","3");
			Pchar.KR_6loc = "knowledge";
			Pchar.auction_items = 0;			//start value

			if(CheckAttribute(Pchar, "BB_chapel") && Pchar.BB_chapel == "knowledge")
			{
				AddQuestRecord("KR_amulet","1");
			}	
		break;

		case "KR_letter_info1":
			AddQuestRecord("KR_letter","1");
		break;

		case "KR_letter_info2":
			AddQuestRecord("KR_letter","2");
		break;

		case "KR_letter_info4":
			AddQuestRecord("KR_letter","4");
			CloseQuestHeader("KR_letter");
			Pchar.auction_items = sti(Pchar.auction_items) + 1;

			LAi_QuestDelay("count_auction_items", 0.5);
		break;

		case "TH_knowledge":
			Pchar.BB_TH = "knowledge";
		break;

		case "Fort_knowledge":
			Pchar.BB_fort = "knowledge";
		break;

		case "RH_exit_knowledge":
			Pchar.BB_RH_exit = "knowledge";
		break;

		case "BB_tower_found":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "BB_tower_found";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "jungle_path":
			LAi_SetActorType(characterFromID("Kri_soldier_13"));
			LAi_ActorDialog(characterFromID("Kri_soldier_13"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Kri_soldier_13"));
			Characters[GetCharacterIndex("Kri_soldier_13")].dialog.CurrentNode  = "jungle_path";
		break;

		case "jungle_path_done":
			ChangeCharacterAddressGroup(CharacterFromID("Kri_soldier_13"), "Kristiania_jungle_exit", "goto", "citizen010");
			LAi_SetStayType(characterFromID("Kri_soldier_13"));
			Characters[GetCharacterIndex("Kri_soldier_13")].dialog.CurrentNode  = "First time";

			Pchar.quest.jungle_path1.win_condition.l1 = "Location";
			Pchar.quest.jungle_path1.win_condition.l1.location = "Kristiania_center_stairs";
			Pchar.quest.jungle_path1.win_condition = "jungle_path1";
		break;

		case "jungle_path1":
			Pchar.quest.jungle_path.win_condition.l1 = "Location";
			Pchar.quest.jungle_path.win_condition.l1.location = "Kristiania_jungle_exit";
			Pchar.quest.jungle_path.win_condition = "jungle_path";
		break;

		case "jungle_path_known":
			PlaySound("VOICE\ENGLISH\gm_crew1C.wav");
			ChangeCharacterAddressGroup(CharacterFromID("Kri_soldier_13"), "Kristiania_jungle_exit", "goto", "citizen010");
			LAi_SetStayType(characterFromID("Kri_soldier_13"));
			Characters[GetCharacterIndex("Kri_soldier_13")].dialog.CurrentNode  = "First time";
		break;
	
		case "KR_chapel":
			Pchar.BB_chapel = "knowledge";

			if(CheckAttribute(Pchar, "KR_6loc") && Pchar.KR_6loc == "knowledge")
			{
				AddQuestRecord("KR_amulet","1");
			}
		break;

		case "chapel_monk_done":
			Characters[GetCharacterIndex("Kr_chapel_monk")].dialog.CurrentNode  = "chapel_monk_neutral";
		break;

		case "items_list_no_noney":
			PlaySound("VOICE\ENGLISH\Dut_m_a_070.wav");
		break;

		case "items_list_done":
			PlaySound("INTERFACE\coins7.wav");
			LAi_SetStayType(characterFromID("Kr_cit22"));
			Characters[GetCharacterIndex("Kr_cit22")].dialog.CurrentNode  = "auction_over";

			LAi_QuestDelay("items_list_done1", 2.0);
		break;

		case "items_list_done1":
			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit22"), "Kristiania_entre", "quest", "auctionist3");
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem14", 2.5);
			Locations[FindLocation("Nueva_Suecia_lower_town")].locators_radius.randitem.randitem14 = 2.5;

			LAi_QuestDelay("Axel_W_leaves", 2.0);
			LAi_QuestDelay("auction_list_check", 0.1);
		break;

		case "Axel_W_leaves":
			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit22"), "Kristiania_entre", "quest", "auctionist4");

			LAi_QuestDelay("Axel_W_leaves1", 2.0);
		break;

		case "Axel_W_leaves1":
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit22"), "Kristiania_townhall_entre", "sit", "sit2");
			ChangeCharacterAddressGroup(CharacterFromID("Kr_cit26"), "Kristiania_townhall_entre", "sit", "sit3");
			LAi_SetSitType(characterFromID("Kr_cit22"));
			LAi_SetSitType(characterFromID("Kr_cit26"));
			Characters[GetCharacterIndex("Kr_cit22")].dialog.CurrentNode  = "townhall_neutral";
			Characters[GetCharacterIndex("Kr_cit26")].dialog.CurrentNode  = "townhall_neutral";
		break;

		case "auction_list_check":
			if(CheckCharacterItem(Pchar,"auction_list_roll"))
			{
				Pchar.Kr_quest = "salute";
				LAi_QuestDelay("salute", 1.0);
				LAi_QuestDelay("salute", 2.0);
				LAi_QuestDelay("hurrah", 3.0);
				LAi_QuestDelay("salute1", 1.5);
				LAi_QuestDelay("salute2", 5.0);

				pchar.quest.letter_check.win_condition.l1 = "location";
				pchar.quest.letter_check.win_condition.l1.location = "Kristiania_townhall";
				pchar.quest.letter_check.win_condition = "letter_check";
			}
			else
			{
				LAi_QuestDelay("auction_list_check", 0.5);//loop check
			}
		break;

		case "salute":
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire1.wav");
		break;

		case "hurrah":
			PlaySound("OBJECTS\SHIPCHARGE\hurrah.wav");
		break;

		case "salute1":
			LAi_SetActorType(pchar);	
			LAi_ActorTurnToLocator(Pchar, "quest", "stay6");	//was reload2
		break;

		case "salute2":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "salute";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "count_auction_items":
			if(CheckAttribute(Pchar, "auction_items"))
			{
				switch (Pchar.auction_items)
				{
					case "1":
						LAi_QuestDelay("pchar_1", 1.0);
					break;

					case "2":
						LAi_QuestDelay("pchar_2", 1.0);
					break;

					case "3":
						LAi_QuestDelay("pchar_3", 1.0);
					break;

					case "4":
						LAi_QuestDelay("pchar_4", 1.0);
					break;

					case "5":
						LAi_QuestDelay("pchar_5", 1.0);
					break;

					case "6":
						AddQuestRecord("Blackbeards_tower","6");
						TakeItemFromCharacter(Pchar, "auction_list_open");
						TakeItemFromCharacter(Pchar, "auction_list_roll");

						LAi_QuestDelay("pchar_6", 1.0);
					break;
				}
			}
		break;

		case "letter_check":
			if(CheckCharacterItem(Pchar,"doc60A"))
			{
		//		PlaySound("INTERFACE\closed_door.wav");
		//		ChangeCharacterAddressGroup(CharacterFromID("Trafvenfeldt"), "Kristiania_townhall", "reload", "reload2");				

				LAi_QuestDelay("Anna_Helena", 2.0);			//was 0.5
				LAi_QuestDelay("KR_letter_info4", 0.01);		//was 2.0
			}
			else
			{
				LAi_QuestDelay("letter_check", 0.5);//loop check
			}
		break;

		case "Anna_Helena":
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(CharacterFromID("Trafvenfeldt"), "Kristiania_townhall", "reload", "reload2");

			LAi_SetActorType(pchar);	
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");

			LAi_QuestDelay("pchar_ohoh", 1.0);
			LAi_QuestDelay("Anna_Helena_thief", 4.0);
		break;

		case "Anna_Helena_thief":
			LAi_SetActorType(characterFromID("Trafvenfeldt"));
			LAi_ActorDialog(characterFromID("Trafvenfeldt"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Trafvenfeldt"));
			Characters[GetCharacterIndex("Trafvenfeldt")].dialog.CurrentNode  = "thief";
		break;

		case "thief_done":
			LAi_SetPlayerType(pchar);

			LAi_QuestDelay("Anna_Helena_password", 4.0);
		break;

		case "Anna_Helena_password":
			LAi_SetActorType(characterFromID("Trafvenfeldt"));
			LAi_ActorDialog(characterFromID("Trafvenfeldt"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Trafvenfeldt"));
			Characters[GetCharacterIndex("Trafvenfeldt")].dialog.CurrentNode  = "password";
		break;

		case "password_done":
			Characters[GetCharacterIndex("Trafvenfeldt")].dialog.CurrentNode  = "anna_helena_neutral";
			LAi_SetPlayerType(pchar);
			LAi_SetStayType(characterFromID("Trafvenfeldt"));
			Pchar.Kr_password = "known";
		break;

		case "Kristiania_fort_password":
			LAi_SetActorType(characterFromID("Kri_dragoon_4"));
			LAi_ActorDialog(characterFromID("Kri_dragoon_4"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Kri_dragoon_4"));
			Characters[GetCharacterIndex("Kri_dragoon_4")].dialog.CurrentNode  = "password";
		break;

		case "fort_no_password_done":
			LAi_SetPlayerType(pchar);
			Characters[GetCharacterIndex("Kri_dragoon_4")].dialog.CurrentNode  = "First time";
			ChangeCharacterAddressGroup(CharacterFromID("Kri_dragoon_4"), "Kristiania_center", "goto", "goto35");
			LAi_SetStayType(characterFromID("Kri_dragoon_4"));
		break;

		case "fort_password_done":
			PlaySound("VOICE\ENGLISH\black_witch_yah.wav");
			Characters[GetCharacterIndex("Kri_dragoon_4")].dialog.CurrentNode  = "First time";
			ChangeCharacterAddressGroup(CharacterFromID("Kri_dragoon_4"), "Kristiania_center", "goto", "goto35");
			LAi_SetStayType(characterFromID("Kri_dragoon_4"));

			LAi_QuestDelay("fort_unlock", 1.0);
		break;

		case "fort_unlock":
			PlaySound("VOICE\ENGLISH\gm_crew1A.wav");
			LAi_SetActorType(pchar);	
			LAi_ActorTurnToLocator(Pchar, "goto", "goto36");
			LAi_SetActorType(CharacterFromID("Kri_dragoon_5"));	
			LAi_ActorTurnToLocator(CharacterFromID("Kri_dragoon_5"), "box", "box1");

			LAi_QuestDelay("fort_unlock1", 1.0);
		break;

		case "fort_unlock1":
			PlaySound("INTERFACE\key_unlock2.wav");
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box1", 0.0001);
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload19", 1.0);

			Locations[FindLocation("Kristiania_center")].locators_radius.box.box1 = 0.0001;
			Locations[FindLocation("Kristiania_center")].locators_radius.reload.reload19 = 1.0;

			LAi_QuestDelay("fort_unlock2", 1.0);
		break;

		case "fort_unlock2":
			ChangeCharacterAddressGroup(CharacterFromID("Kri_dragoon_5"), "Kristiania_center", "goto", "goto36");
			LAi_SetStayType(characterFromID("Kri_dragoon_5"));
			PlaySound("VOICE\ENGLISH\gm_crew1B.wav");
			LAi_SetActorType(pchar);	
			LAi_ActorTurnToLocator(Pchar, "reload", "reload19");

			LAi_QuestDelay("pchar_playertype", 0.5);
			
			LAi_QuestDelay("BB_tower_top_backloop", 0.1);
			LAi_QuestDelay("BB_upper_cave_backloop", 0.1);
			LAi_QuestDelay("BB_lower_cave_backloop", 0.1);
			LAi_QuestDelay("start_BB_flag", 0.1);
			LAi_QuestDelay("pick_up_grotto_boom", 0.1);
			LAi_QuestDelay("BB_lower_cave_steplock", 0.1);
			LAi_QuestDelay("BB_lower_cave_deathtrap", 0.1);
			LAi_QuestDelay("BB_tower_backloop", 0.1);	//no, always "on", only locator changes in size


			pchar.quest.KRF_change1.win_condition.l1 = "locator";
			pchar.quest.KRF_change1.win_condition.l1.location = "Kristiania_fort";
			pchar.quest.KRF_change1.win_condition.l1.locator_group = "quest";
			pchar.quest.KRF_change1.win_condition.l1.locator = "change1";
			pchar.quest.KRF_change1.win_condition = "KRF_change1";

			pchar.quest.KRF_change2A.win_condition.l1 = "locator";
			pchar.quest.KRF_change2A.win_condition.l1.location = "Kristiania_fort";
			pchar.quest.KRF_change2A.win_condition.l1.locator_group = "quest";
			pchar.quest.KRF_change2A.win_condition.l1.locator = "change2A";
			pchar.quest.KRF_change2A.win_condition = "KRF_change2A";

			pchar.quest.KRF_change2B.win_condition.l1 = "locator";
			pchar.quest.KRF_change2B.win_condition.l1.location = "Kristiania_fort";
			pchar.quest.KRF_change2B.win_condition.l1.locator_group = "quest";
			pchar.quest.KRF_change2B.win_condition.l1.locator = "change2B";
			pchar.quest.KRF_change2B.win_condition = "KRF_change2B";	

			pchar.quest.at_fort_tower.win_condition.l1 = "locator";
			pchar.quest.at_fort_tower.win_condition.l1.location = "Kristiania_fort";
			pchar.quest.at_fort_tower.win_condition.l1.locator_group = "goto";
			pchar.quest.at_fort_tower.win_condition.l1.locator = "guard1";
			pchar.quest.at_fort_tower.win_condition = "at_fort_tower";

			pchar.quest.info_exit_cathedral.win_condition.l1 = "locator";
			pchar.quest.info_exit_cathedral.win_condition.l1.location = "Kristiania_cathedral";
			pchar.quest.info_exit_cathedral.win_condition.l1.locator_group = "reload";
			pchar.quest.info_exit_cathedral.win_condition.l1.locator = "reload2";
			pchar.quest.info_exit_cathedral.win_condition = "info_exit_cathedral";
		break;

		case "info_exit_cathedral":
			AddQuestRecord("KR_amulet","6");
		break;
//---------------------------------------------------------------------------------------------------
		case "KRF_changes":
			LAi_SetPlayerType(Pchar);

			pchar.quest.KRF_change1.win_condition.l1 = "locator";
			pchar.quest.KRF_change1.win_condition.l1.location = "Kristiania_fort";
			pchar.quest.KRF_change1.win_condition.l1.locator_group = "quest";
			pchar.quest.KRF_change1.win_condition.l1.locator = "change1";
			pchar.quest.KRF_change1.win_condition = "KRF_change1";

			pchar.quest.KRF_change2A.win_condition.l1 = "locator";
			pchar.quest.KRF_change2A.win_condition.l1.location = "Kristiania_fort";
			pchar.quest.KRF_change2A.win_condition.l1.locator_group = "quest";
			pchar.quest.KRF_change2A.win_condition.l1.locator = "change2A";
			pchar.quest.KRF_change2A.win_condition = "KRF_change2A";

			pchar.quest.KRF_change2B.win_condition.l1 = "locator";
			pchar.quest.KRF_change2B.win_condition.l1.location = "Kristiania_fort";
			pchar.quest.KRF_change2B.win_condition.l1.locator_group = "quest";
			pchar.quest.KRF_change2B.win_condition.l1.locator = "change2B";
			pchar.quest.KRF_change2B.win_condition = "KRF_change2B";	
		break;

		case "KRF_change1":
			if(Locations[FindLocation(Pchar.location)].type == "Vane_silent_temple")
			{
				PauseAllSounds();
				Locations[FindLocation(Pchar.location)].type = "silent_cave_seashore";
				PostEvent("LoadSceneSound", 0);

				LAi_SetActorType(Pchar);
				LAi_ActorGoToLocator(Pchar, "quest", "change1_up", "KRF_change1_up", 1.5);
			}
			else
			{
				PauseAllSounds();
				Locations[FindLocation(Pchar.location)].type = "Vane_silent_temple";
				PostEvent("LoadSceneSound", 0);

				LAi_SetActorType(Pchar);
				LAi_ActorGoToLocator(Pchar, "quest", "change1_down", "KRF_change1_down", 1.5);
			}
		break;

		case "KRF_change1_up":
			ChangeCharacterAddressGroup(Pchar, "Kristiania_fort", "quest", "change1_up");
			
			LAi_QuestDelay("KRF_changes", 0.01);
		break;

		case "KRF_change1_down":
			ChangeCharacterAddressGroup(Pchar, "Kristiania_fort", "quest", "change1_down");
			
			LAi_QuestDelay("KRF_changes", 0.01);
		break;

		case "KRF_change2A":
			if(Locations[FindLocation(Pchar.location)].type == "silent_cave_seashore")
			{
				PauseAllSounds();
				Locations[FindLocation(Pchar.location)].type = "silent_seashore";
				PostEvent("LoadSceneSound", 0);

				LAi_ActorTurnToLocator(CharacterFromID("Hilphershausen"), "goto", "goto7");
				LAi_SetActorType(Pchar);
				LAi_ActorGoToLocator(Pchar, "quest", "change2A_up", "KRF_change2A_up", 1.5);
			}
			else
			{
				PauseAllSounds();
				Locations[FindLocation(Pchar.location)].type = "silent_cave_seashore";
				PostEvent("LoadSceneSound", 0);

				LAi_SetActorType(Pchar);
				LAi_ActorGoToLocator(Pchar, "quest", "change2A_down", "KRF_change2A_down", 1.5);
			}
		break;

		case "KRF_change2A_up":
			ChangeCharacterAddressGroup(Pchar, "Kristiania_fort", "quest", "change2A_up");
			
			LAi_QuestDelay("KRF_changes", 0.01);
		break;

		case "KRF_change2A_down":
			ChangeCharacterAddressGroup(Pchar, "Kristiania_fort", "quest", "change2A_down");
			
			LAi_QuestDelay("KRF_changes", 0.01);
		break;

		case "KRF_change2B":
			if(Locations[FindLocation(Pchar.location)].type == "silent_cave_seashore")
			{
				PauseAllSounds();
				Locations[FindLocation(Pchar.location)].type = "silent_seashore";
				PostEvent("LoadSceneSound", 0);

				LAi_ActorTurnToLocator(CharacterFromID("Hilphershausen"), "goto", "goto7");
				LAi_SetActorType(Pchar);
				LAi_ActorGoToLocator(Pchar, "quest", "change2B_up", "KRF_change2B_up", 1.5);
			}
			else
			{
				PauseAllSounds();
				Locations[FindLocation(Pchar.location)].type = "silent_cave_seashore";
				PostEvent("LoadSceneSound", 0);

				LAi_SetActorType(Pchar);
				LAi_ActorGoToLocator(Pchar, "quest", "change2B_down", "KRF_change2B_down", 1.5);
			}
		break;

		case "KRF_change2B_up":
			ChangeCharacterAddressGroup(Pchar, "Kristiania_fort", "quest", "change2B_up");
			
			LAi_QuestDelay("KRF_changes", 0.01);
		break;

		case "KRF_change2B_down":
			ChangeCharacterAddressGroup(Pchar, "Kristiania_fort", "quest", "change2B_down");
			
			LAi_QuestDelay("KRF_changes", 0.01);
		break;
//---------------------------------------------------------------------------------------------------
		case "at_fort_tower":
			LAi_SetActorType(characterFromID("Kri_gunner_7"));
			LAi_ActorDialog(characterFromID("Kri_gunner_7"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Kri_gunner_7"));
			Characters[GetCharacterIndex("Kri_gunner_7")].dialog.CurrentNode  = "no_commander";
		break;

		case "no_commander_done":
			Characters[GetCharacterIndex("Kri_gunner_7")].dialog.CurrentNode  = "First time";
			LAi_SetStayType(characterFromID("Kri_gunner_7"));
		break;

//---------------------------------------------------------------------------------------------------
		case "KR_center_backloop1":
			pchar.quest.KR_center_backloop1A.win_condition.l1 = "locator";
			pchar.quest.KR_center_backloop1A.win_condition.l1.location = "Kristiania_center";
			pchar.quest.KR_center_backloop1A.win_condition.l1.locator_group = "reload";
			pchar.quest.KR_center_backloop1A.win_condition.l1.locator = "reload43";
			pchar.quest.KR_center_backloop1A.win_condition = "KR_center_backloop1A";
		break;

		case "KR_center_backloop1A":
			ChangeCharacterAddressGroup(Pchar, "Kristiania_center", "goto", "goto43");
			
			LAi_QuestDelay("KR_center_backloop1", 0.1);
		break;
//---------------------------------------------------------------------------------------------------
		case "KR_center_backloop2":
			pchar.quest.KR_center_backloop2A.win_condition.l1 = "locator";
			pchar.quest.KR_center_backloop2A.win_condition.l1.location = "Kristiania_center";
			pchar.quest.KR_center_backloop2A.win_condition.l1.locator_group = "reload";
			pchar.quest.KR_center_backloop2A.win_condition.l1.locator = "reload44";
			pchar.quest.KR_center_backloop2A.win_condition = "KR_center_backloop2A";
		break;

		case "KR_center_backloop2A":
			ChangeCharacterAddressGroup(Pchar, "Kristiania_center", "goto", "goto44");
			
			LAi_QuestDelay("KR_center_backloop2", 0.1);
		break;
//---------------------------------------------------------------------------------------------------
		case "KR_lower_backloop":
			pchar.quest.KR_lower_backloopA.win_condition.l1 = "locator";
			pchar.quest.KR_lower_backloopA.win_condition.l1.location = "Nueva_Suecia_lower_town";
			pchar.quest.KR_lower_backloopA.win_condition.l1.locator_group = "reload";
			pchar.quest.KR_lower_backloopA.win_condition.l1.locator = "reload33";
			pchar.quest.KR_lower_backloopA.win_condition = "KR_lower_backloopA";
		break;

		case "KR_lower_backloopA":
			ChangeCharacterAddressGroup(Pchar, "Nueva_Suecia_lower_town", "goto", "goto202");
			
			LAi_QuestDelay("KR_lower_backloop", 0.1);
		break;
//---------------------------------------------------------------------------------------------------
		case "switch_auction_lists":
			if(!CheckCharacterItem(Pchar,"auction_list_roll"))
			{
				PlaySound("INTERFACE\carpet_move.wav");
				TakeItemFromCharacter(Pchar, "auction_list_open");
				GiveItem2Character(Pchar, "auction_list_roll");
				LAi_QuestDelay("start_6_KR_items", 1.0);
			}
		break;

		case "equip_BB_blades":
			if(CheckCharacterItem(Pchar,"bladeBB"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladeBB");
			}
			if(CheckCharacterItem(Pchar,"pistolbladeBB"))
			{
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);

				if(IsEquipCharacterByItem(Pchar, "ammobag2"))
				{
					RemoveCharacterEquip(Pchar, POUCH_ITEM_TYPE);
					TakeItemFromCharacter(Pchar, "ammobag2");
				}
				if(!CheckCharacterItem(Pchar,"ammobag1"))
				{
					GiveItem2Character(Pchar, "ammobag1");
				}
				SetModel(PChar, "Howard_Pyle", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

				EquipCharacterByItem(Pchar, "pistolbladeBB");
			}
		break;

		case "Fort_ship_disappear":
			if(CheckCharacterItem(Pchar,"bladeBB") && CheckCharacterItem(Pchar,"pistolbladeBB"))
			{
				Pchar.fort_ship = "gone";
				AddQuestRecord("KR_cutlasses","4");
				CloseQuestHeader("KR_cutlasses");
				Pchar.auction_items = sti(Pchar.auction_items) + 1;

				Characters[GetCharacterIndex("KR_indian_2")].Ship.Type = "obj_invisible";	//pos 1
				Characters[GetCharacterIndex("KR_indian_3")].Ship.Type = "Brig_20_Gun1_181";	//pos 2

				LAi_QuestDelay("count_auction_items", 0.5);

				pchar.quest.Fort_ship_disappear1.win_condition.l1 = "location";
				pchar.quest.Fort_ship_disappear1.win_condition.l1.location = "Kristiania_fort";
				pchar.quest.Fort_ship_disappear1.win_condition = "Fort_ship_disappear1";
			}
		break;

		case "Fort_ship_disappear1":
			Pchar.quest.Fort_ship_disappear2.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.Fort_ship_disappear2.win_condition.l1.location = "Kristiania_fort";
			Pchar.quest.Fort_ship_disappear2.win_condition = "Fort_ship_disappear2";
		break;

		case "Fort_ship_disappear2":
			Characters[GetCharacterIndex("KR_indian_3")].Ship.Type = "obj_invisible";		//no visible ship
		break;
//---------------------------------------------------------------------------------------------------
//shya
		case "NS_locked_shipyard_start":
			pchar.quest.NS_locked_shipyard.win_condition.l1 = "locator";
			pchar.quest.NS_locked_shipyard.win_condition.l1.location = "Nueva_Suecia_lower_town";
			pchar.quest.NS_locked_shipyard.win_condition.l1.locator_group = "quest";
			pchar.quest.NS_locked_shipyard.win_condition.l1.locator = "shipyard";
			pchar.quest.NS_locked_shipyard.win_condition = "NS_locked_shipyard";
		break;

		case "NS_locked_shipyard":
			LAi_SetStayType(Pchar);
			PlaySound("INTERFACE\knock.wav");
			ChangeCharacterAddressGroup(CharacterFromID("Kristiania_shipyard_owner"), "Nueva_Suecia_lower_town", "quest", "lodbrok");
			Pchar.BB_shya = "knowledge";
			AddQuestRecord("KR_flagchest","1");
	
			LAi_SetActorType(characterFromID("Kristiania_shipyard_owner"));
			LAi_ActorDialog(characterFromID("Kristiania_shipyard_owner"), pchar, "", 1.5, 1.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Kristiania_shipyard_owner"));
			Characters[GetCharacterIndex("Kristiania_shipyard_owner")].dialog.CurrentNode  = "locked_shipyard";
		break;

		case "NS_locked_shipyard_done":
			LAi_SetActorType(pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "goto89", "NS_locked_shipyard_done1", 4.0);

			ChangeCharacterAddressGroup(CharacterFromID("Kristiania_shipyard_owner"), "none", "", "");	
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box8", 0.0001);
			Locations[FindLocation("Nueva_Suecia_lower_town")].locators_radius.box.box8 = 0.0001;
		break;

		case "NS_locked_shipyard_done1":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "bell");

			LAi_QuestDelay("NS_locked_shipyard_done2", 1.0);
		break;

		case "NS_locked_shipyard_done2":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "locked_shipyard";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "NS_low_turn_to_bell":
			Pchar.NS_low_bell = "ready";
			LAi_SetPlayerType(Pchar);
		break;
	
		case "NS_low_bell_sound":
			PlaySound("INTERFACE\bell2.wav");
		break;

		case "NS_open_shipyard":
			PlaySound("PEOPLE\counter_open.wav");
			ChangeCharacterAddressGroup(CharacterFromID("Kristiania_shipyard_owner"), "Nueva_Suecia_lower_town", "reload", "reload17");
			LAi_SetActorType(characterFromID("Kristiania_shipyard_owner"));
			LAi_ActorRunToLocator(characterFromID("Kristiania_shipyard_owner"), "goto", "goto89", "NS_open_shipyard1", 4.0);
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto89");
			Locations[FindLocation("Nueva_Suecia_lower_town")].reload.l17.disable = 0;	//to shipyard	
		break;

		case "NS_open_shipyard1":
			PlaySound("VOICE\ENGLISH\Dut_m_a_053.wav");
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("NS_open_shipyard2", 2.0);
		break;

		case "NS_open_shipyard2":
			LAi_SetStayType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "Nueva_Suecia_lower_town", "quest", "shipyard");
			PlaySound("PEOPLE\jump.wav");	
			
			LAi_QuestDelay("shipyard_owner_attacks", 1.0);

			pchar.quest.NS_open_shipyard3.win_condition.l1 = "location";
			pchar.quest.NS_open_shipyard3.win_condition.l1.location = "Kristiania_shipyard";
			pchar.quest.NS_open_shipyard3.win_condition = "NS_open_shipyard3";
		break;
	
		case "shipyard_owner_attacks":
			ChangeCharacterAddressGroup(CharacterFromID("Kristiania_shipyard_owner"), "Nueva_Suecia_lower_town", "quest", "attack");
			LAi_ActorAttack(CharacterFromID("Kristiania_shipyard_owner"), Pchar, "");
		break;

		case "shipyard_owner_disappears":
			ChangeCharacterAddressGroup(CharacterFromID("Kristiania_shipyard_owner"), "none", "", "");
		break;

		case "shipyard_owner_sounds":
			PlaySound("VOICE\ENGLISH\Dut_m_a_051.wav");
			PlaySound("INTERFACE\knock.wav");
		break;

		case "shipyard_owner_outside":
			ChangeCharacterAddressGroup(CharacterFromID("Kristiania_shipyard_owner"), "Kristiania_shipyard", "goto", "outside");
			LAi_SetActorType(CharacterFromID("Kristiania_shipyard_owner"));	
			LAi_ActorTurnToLocator(CharacterFromID("Kristiania_shipyard_owner"), "goto", "goto1");
		break;

		case "NS_open_shipyard3":
			PlaySound("INTERFACE\key_lock.wav");
			if(!LAi_IsDead(Pchar)) 
			{ 
				LAi_SetPlayerType(Pchar); 
			}
			Locations[FindLocation("Nueva_Suecia_lower_town")].reload.l17.disable = 1;
			Pchar.cardinal = "start";
			Pchar.BB_shya = "knowledge";
		//	ChangeCharacterAddressGroup(CharacterFromID("Kristiania_shipyard_owner"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("Kristiania_shipyard_owner"), "Kristiania_shipyard", "goto", "outside");
			Characters[GetCharacterIndex("Kristiania_shipyard_owner")].dialog.CurrentNode  = "outside_shipyard";

		//	LAi_QuestDelay("shipyard_owner_disappears", 1.0);
		//	LAi_QuestDelay("shipyard_owner_disappears", 2.0);
			LAi_QuestDelay("shipyard_owner_sounds", 1.0);
			LAi_QuestDelay("shipyard_owner_outside", 1.0);
			LAi_QuestDelay("shipyard_owner_outside", 2.0);

			Pchar.quest.flagchest_found.win_condition.l1 = "item";
			Pchar.quest.flagchest_found.win_condition.l1.character = Pchar.id;
			Pchar.quest.flagchest_found.win_condition.l1.item = "flagchest_closed";
			Pchar.quest.flagchest_found.win_condition = "flagchest_found";
		break;

		case "flagchest_found":
			AddQuestRecord("KR_flagchest","4");
			CloseQuestHeader("KR_flagchest");
			Pchar.auction_items = sti(Pchar.auction_items) + 1;

			LAi_QuestDelay("count_auction_items", 0.5);
		break;

		case "cardinal_start":	
			LAi_SetActorType(characterFromID("Kr_cardinal"));
			LAi_ActorDialog(characterFromID("Kr_cardinal"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Kr_cardinal"));
			Characters[GetCharacterIndex("Kr_cardinal")].dialog.CurrentNode  = "where_is_he";
		break;	

		case "where_is_he_done":
			LAi_SetStayType(Pchar);
			locations[FindLocation("Kristiania_cathedral")].type = "Turks_church";
			Characters[GetCharacterIndex("Kr_cardinal")].dialog.CurrentNode  = "cardinal_neutral";

			LAi_SetActorType(characterFromID("Kr_priest3"));
			LAi_SetActorType(characterFromID("Kr_priest4"));
			LAi_SetActorType(characterFromID("Kr_priest1"));
			LAi_SetActorType(characterFromID("Kr_priest2"));
			LAi_SetActorType(characterFromID("Kr_cardinal"));
			LAi_ActorGoToLocator(CharacterFromID("Kr_priest3"), "quest", "church_inside", "_", 4.0);
			LAi_ActorGoToLocator(CharacterFromID("Kr_priest4"), "quest", "church_inside", "_", 4.0);
			LAi_ActorGoToLocator(CharacterFromID("Kr_priest1"), "quest", "church_inside", "_", 4.0);
			LAi_ActorGoToLocator(CharacterFromID("Kr_priest2"), "quest", "church_inside", "_", 4.0);
			LAi_ActorGoToLocator(CharacterFromID("Kr_cardinal"), "quest", "church_inside", "_", 4.0);
		
			AddQuestRecord("KR_amulet","6");
			AddQuestRecord("KR_amulet","7");

			LAi_QuestDelay("pchar_playertype", 3.0);
			LAi_QuestDelay("cardinal_to_church", 4.0);
		break;	

		case "cardinal_to_church":
			ChangeCharacterAddressGroup(CharacterFromID("KR_cardinal"), "Kristiania_cathedral", "goto", "goto12");
			ChangeCharacterAddressGroup(CharacterFromID("KR_priest1"), "Kristiania_cathedral", "goto", "goto11");
			ChangeCharacterAddressGroup(CharacterFromID("KR_priest2"), "Kristiania_cathedral", "goto", "goto7");
			ChangeCharacterAddressGroup(CharacterFromID("KR_priest3"), "Kristiania_cathedral", "goto", "window2");
			ChangeCharacterAddressGroup(CharacterFromID("KR_priest4"), "Kristiania_cathedral", "goto", "goto1");
			LAi_SetStayType(characterFromID("Kr_cardinal"));
			LAi_SetStayType(characterFromID("Kr_priest1"));
			LAi_SetCitizenType(characterFromID("Kr_priest2"));
			LAi_SetCitizenType(characterFromID("Kr_priest3"));
			LAi_SetStayType(characterFromID("Kr_priest4"));
		break;

//cardinal

//---------------------------------------------------------------------------------------------------
//church
		case "reset_Pyle_model": 
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("gunfire_black" , u, v+1.5, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("gunfire_black" , u, v+1.3, w, 0.0, 0.0, 0.0, sti(20) );
			SetModel(PChar, "Howard_Pyle", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);
			PlaySound("OBJECTS\VOICES\DEAD\male\dead6.wav");

			LAi_QuestDelay("reset_Pyle_model1", 0.5);
		break;

		case "reset_Pyle_model1": 
			LAi_SetPoorType(Pchar);
			PlaySound("PEOPLE\jump.wav");
			PlaySound("PEOPLE\step_echo1.wav");
			PlaySound("PEOPLE\step_echo1.wav");

			LAi_QuestDelay("pchar_playertype", 3.0);
			LAi_QuestDelay("pchar_whatwasthat", 3.0);
		break;

		case "place_switch_button":
			Locations[FindLocation(Pchar.location)].models.always.l1 = "door_button";
			Locations[FindLocation(Pchar.location)].models.always.l2 = "";

			Locations[FindLocation("Kristiania_cathedral")].image = "";
			DoQuestReloadToLocation("Kristiania_cathedral", "goto", "see_button", "place_switch_button1");	
		break;
	
		case "place_switch_button1":
			Locations[FindLocation("Kristiania_cathedral")].image = "Inside_Church_3.tga";

			pchar.quest.remove_cardinal.win_condition.l1 = "location";
			pchar.quest.remove_cardinal.win_condition.l1.location = "NS_hidden_town_priest";
			pchar.quest.remove_cardinal.win_condition = "remove_cardinal";

			pchar.quest.see_oriel.win_condition.l1 = "locator";
			pchar.quest.see_oriel.win_condition.l1.location = "Nueva_Suecia_upper_town";
			pchar.quest.see_oriel.win_condition.l1.locator_group = "quest";
			pchar.quest.see_oriel.win_condition.l1.locator = "see_oriel";
			pchar.quest.see_oriel.win_condition = "see_oriel";
		break;		
//see oriel
		case "remove_cardinal":
			locations[FindLocation("Kristiania_cathedral")].type = "Kristiania_church";
			ChangeCharacterAddressGroup(CharacterFromID("KR_cardinal"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("KR_priest1"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("KR_priest2"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("KR_priest3"), "none", "", "");
			ChangeCharacterAddressGroup(CharacterFromID("KR_priest4"), "none", "", "");
		break;

		case "see_oriel":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "oriel");

			LAi_QuestDelay("see_oriel1", 0.7);
		break;	

		case "see_oriel1":
			AddQuestRecord("KR_tricorn","2");

			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "see_oriel";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "KR_church_close_door":
			//from SL_utils
			Locations[FindLocation("Kristiania_cathedral")].image = "";
			DoQuestReloadToLocation("Kristiania_cathedral", "goto", "see_button", "KR_church_close_door1");			
		break;

		case "KR_church_close_door1":
			Locations[FindLocation("Kristiania_cathedral")].image = "Inside_Church_3.tga";
			PlaySound("INTERFACE\shelf_close.wav");
		break;

		case "KR_church_open_door":
			//from SL_utils
			Locations[FindLocation("Kristiania_cathedral")].image = "";
			DoQuestReloadToLocation("Kristiania_cathedral", "goto", "see_button", "KR_church_open_door1");			
		break;

		case "KR_church_open_door1":
			Locations[FindLocation("Kristiania_cathedral")].image = "Inside_Church_3.tga";
			PlaySound("INTERFACE\shelf_open.wav");
		break;

		case "KR_church_lever_down":
			//from SL_utils
			Locations[FindLocation("Kristiania_cathedral")].image = "";
			DoQuestReloadToLocation("Kristiania_cathedral", "goto", "lever3", "KR_church_lever_down1");
		break;

		case "KR_church_lever_down1":
			Locations[FindLocation("Kristiania_cathedral")].image = "Inside_Church_3.tga";
			PlaySound("INTERFACE\el_on.wav");
		break;

		case "KR_church_lever_up":
			//from SL_utils
			Locations[FindLocation("Kristiania_cathedral")].image = "";
			DoQuestReloadToLocation("Kristiania_cathedral", "goto", "lever3", "KR_church_lever_up1");
		break;

		case "KR_church_lever_up1":
			Locations[FindLocation("Kristiania_cathedral")].image = "Inside_Church_3.tga";
			PlaySound("INTERFACE\gas_off2.wav");
		break;

		case "lock_door_sound":
			PlaySound("INTERFACE\closed_locked_door.wav");
		break;

		case "visit_tailor":
			AddQuestRecord("KR_tricorn","1");
		break;

		case "use_paper_clip":
			PlaySound("INTERFACE\took_item.wav");
			GiveItem2Character(Pchar, "BB_coin");
			TakeItemFromCharacter(pchar, "paper_clip2");
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box6", 0.0001);
			Locations[FindLocation("Kristiania_cathedral")].locators_radius.box.box6 = 0.0001;

			LAi_QuestDelay("amulet_found", 2.0);
			LAi_QuestDelay("pchar_yah", 1.0);
		break;

		case "amulet_found":
			AddQuestRecord("KR_amulet","9");
			CloseQuestHeader("KR_amulet");
			Pchar.auction_items = sti(Pchar.auction_items) + 1;
			
			LAi_QuestDelay("count_auction_items", 0.5);
		break;

		case "check_logbook":
			if(CheckCharacterItem(Pchar,"book69A") || CheckCharacterItem(Pchar,"book69B") || CheckCharacterItem(Pchar,"book69C"))
			{
				ChangeCharacterAddressGroup(CharacterFromID("JRH"), "Kristiania_jungle_house", "goto", "jrh");
				Characters[GetCharacterIndex("JRH")].dialog.CurrentNode  = "red_house";
				
				AddQuestRecord("KR_logbook","6");
				CloseQuestHeader("KR_logbook");
				Pchar.auction_items = sti(Pchar.auction_items) + 1;

				LAi_QuestDelay("count_auction_items", 0.5);

				pchar.quest.delete_orderbook.win_condition.l1 = "location";
				pchar.quest.delete_orderbook.win_condition.l1.location = "Kristiania_jungle_exit";
				pchar.quest.delete_orderbook.win_condition = "delete_orderbook";
			}
			else LAi_QuestDelay("check_logbook", 0.5);//loop check
		break;

		case "delete_orderbook":
			TakeItemFromCharacter(pchar, "tailors_book");
			TakeItemFromCharacter(pchar, "tailors_note");
		break;

//---------------------------------------------------------------------------------------------------
//NS lever
		case "NS_upper_town_lever_down":
			//from SL_utils
			Locations[FindLocation("Nueva_Suecia_upper_town")].image = "";
			DoQuestReloadToLocation("Nueva_Suecia_upper_town", "quest", "lever", "NS_upper_town_lever_down1");
		break;

		case "NS_upper_town_lever_down1":
			Locations[FindLocation("Nueva_Suecia_upper_town")].image = "Town_IslaMuelle_Town_03.tga";
			PlaySound("INTERFACE\girder_open.wav");

			LAi_QuestDelay("NS_upper_town_officers", 0.1);
		break;

		case "NS_upper_town_lever_up":
			//from SL_utils
			Locations[FindLocation("Nueva_Suecia_upper_town")].image = "";
			DoQuestReloadToLocation("Nueva_Suecia_upper_town", "quest", "lever", "NS_upper_town_lever_up1");
		break;

		case "NS_upper_town_lever_up1":
			Locations[FindLocation("Nueva_Suecia_upper_town")].image = "Town_IslaMuelle_Town_03.tga";
			PlaySound("INTERFACE\girder_close.wav");

			LAi_QuestDelay("NS_upper_town_officers", 0.1);
		break;

		case "NS_upper_town_officers":
			if(IsOfficer(CharacterFromID("Hands")))			
			{
			//	AddPassenger(chr, characterFromID("Hands"), 0);
			//	SetOfficersIndex(chr, 1, getCharacterIndex("Hands"));
				ChangeCharacterAddressGroup(characterFromID("Hands"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("Hands"), "Nueva_Suecia_upper_town", "officers", "reload6_1");
				LAi_SetOfficerType(characterFromID("Hands"));
			}
			if(IsOfficer(CharacterFromID("Caesar")))
			{
			//	AddPassenger(chr, characterFromID("Caesar"), 0);
			//	SetOfficersIndex(chr, 2, getCharacterIndex("Caesar"));
				ChangeCharacterAddressGroup(characterFromID("Caesar"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("Caesar"), "Nueva_Suecia_upper_town", "officers", "reload6_2");
				LAi_SetOfficerType(characterFromID("Caesar"));
			}
			if(IsOfficer(CharacterFromID("Pell")))
			{
			//	AddPassenger(chr, characterFromID("Pell"), 0);
			//	SetOfficersIndex(chr, 3, getCharacterIndex("Pell"));
				ChangeCharacterAddressGroup(characterFromID("Pell"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("Pell"), "Nueva_Suecia_upper_town", "officers", "reload6_3");
				LAi_SetOfficerType(characterFromID("Pell"));
			}
		break;

//---------------------------------------------------------------------------------------------------
//NS roofs
		case "NS_up_to_box4":
			LAi_SetSitType(Pchar);
			PlaySound("PEOPLE\recoil.wav");
			ChangeCharacterAddressGroup(Pchar, "Nueva_Suecia_upper_town", "box", "box4");
			
			LAi_QuestDelay("pchar_playertype", 0.25);
		break;

		case "NS_up_to_box5":
			LAi_SetSitType(Pchar);
			PlaySound("PEOPLE\jump_roof.wav");
			ChangeCharacterAddressGroup(Pchar, "Nueva_Suecia_upper_town", "box", "box5");
			
			LAi_QuestDelay("pchar_playertype", 0.25);
			LAi_QuestDelay("NS_up_turn_to_box6", 0.5);
		break;

		case "NS_up_turn_to_box6":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box6");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "NS_up_to_box8":
			LAi_SetSitType(Pchar);
			PlaySound("PEOPLE\recoil.wav");
			ChangeCharacterAddressGroup(Pchar, "Nueva_Suecia_upper_town", "box", "box8");
			
			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "NS_up_to_box9":
			PlaySound("PEOPLE\run_stone.wav");
			ChangeCharacterAddressGroup(Pchar, "Nueva_Suecia_upper_town", "box", "box9");

			LAi_QuestDelay("NS_up_turn_to_box10", 0.5);
		break;

		case "NS_up_turn_to_box10":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box10");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "shutter_selfdialog":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "NS_up_shutter";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "NS_up_fall_to_ground":
			if(CheckAttribute(Pchar, "NS_up_shutter") && Pchar.NS_up_shutter == "saved")
			{
				return;
			}
			else 
			{
				PlaySound("PEOPLE\jump.wav");
				LAi_SetActorType(Pchar);
				LAi_ActorSetLayMode(Pchar);

				GetCharacterPos(Pchar, &u, &v, &w);
				CreateParticleSystem("blast_dirt" , u, v+1, w, 0.0, 0.0, 0.0, sti(20) );

				Php = LAi_GetCharacterHP(Pchar);
				Php3 = Php/3;
				LAi_ApplyCharacterDamage(Pchar, Php3);

				LAi_QuestDelay("NS_up_fall_to_ground1",2);
			}
		break;

		case "NS_up_fall_to_ground1":
			LAi_SetPoorType(Pchar);
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("stars_short" , u, v+1, w, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("OBJECTS\VOICES\DEAD\male\dead4.wav");

			LAi_QuestDelay("pchar_playertype",3);
		break;

		case "beam_selfdialog":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "NS_up_beam";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "NS_up_turn_to_camera9":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "camera", "camera9");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "NS_up_turn_to_box24":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box24");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "NS_up_turn_to_box28":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box28");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;
		
		case "NS_up_turn_to_box32":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box32");

			LAi_QuestDelay("pchar_playertype", 1.5);
			LAi_QuestDelay("NS_up_to_box32", 1.0);
		break;

		case "NS_up_to_box32":
			ChangeCharacterAddressGroup(Pchar, "Nueva_Suecia_upper_town", "box", "box32");
		break;

		case "NS_up_to_box38":
			ChangeCharacterAddressGroup(Pchar, "Nueva_Suecia_upper_town", "box", "box38");
			PlaySound("PEOPLE\jump_stone.wav");
			LAi_SetSitType(Pchar);

			LAi_QuestDelay("pchar_playertype", 0.25);
		break;

		case "NS_up_to_box40":
			ChangeCharacterAddressGroup(Pchar, "Nueva_Suecia_upper_town", "box", "box40");
			PlaySound("PEOPLE\jump_stone.wav");
			LAi_SetSitType(Pchar);

			LAi_QuestDelay("pchar_playertype", 0.25);
		break;

		case "unlock_NS_up":
			TakeItemFromCharacter(pchar, "key35");
			Locations[FindLocation("Nueva_Suecia_upper_town")].reload.l3.disable = false;
			Pchar.tailor_passage = "open";

			DoQuestReloadToLocation("Nueva_Suecia_upper_town", "reload", "reload3", "_");
		break;
	
		case "check_Teach_hat":
			if(CheckCharacterItem(Pchar,"BB_hatA1"))
			{
				AddQuestRecord("KR_tricorn","4");
				CloseQuestHeader("KR_tricorn");
				Pchar.auction_items = sti(Pchar.auction_items) + 1;

				LAi_QuestDelay("count_auction_items", 0.5);
			}
			else LAi_QuestDelay("check_Teach_hat", 0.5);//loop check
		break;

		case "check_Pyle_hat":
			if(IsEquipCharacterByItem(Pchar, "BB_hatA2"))
			{
				PlaySound("VOICE\ENGLISH\blaze_mhm.wav");
			}
			else PlaySound("VOICE\ENGLISH\blaze_puh.wav");
		break;

//---------------------------------------------------------------------------------------------------
//indian ambush

		case "KR_indian_ambush_start":
			pchar.quest.KR_indian_ambush.win_condition.l1 = "locator";
			pchar.quest.KR_indian_ambush.win_condition.l1.location = "KR_jungle_9";
			pchar.quest.KR_indian_ambush.win_condition.l1.locator_group = "goto";
			pchar.quest.KR_indian_ambush.win_condition.l1.locator = "box9";
			pchar.quest.KR_indian_ambush.win_condition = "KR_indian_ambush";
		break;

		case "KR_indian_ambush":
			LAi_SetStayType(Pchar);

			PauseAllSounds();//stops music
			locations[FindLocation("KR_jungle_9")].type = "very_silent_jungle";
			PostEvent("LoadSceneSound", 0.1);

			ChangeCharacterAddressGroup(CharacterFromID("KR_indian_1"), "KR_jungle_9", "quest", "attack1");
			ChangeCharacterAddressGroup(CharacterFromID("KR_indian_2"), "KR_jungle_9", "quest", "attack2");
			ChangeCharacterAddressGroup(CharacterFromID("KR_indian_3"), "KR_jungle_9", "quest", "attack3");
			ChangeCharacterAddressGroup(CharacterFromID("KR_indian_4"), "KR_jungle_9", "quest", "attack4");
			ChangeCharacterAddressGroup(CharacterFromID("KR_indian_5"), "KR_jungle_9", "quest", "attack5");
			ChangeCharacterAddressGroup(CharacterFromID("KR_indian_6"), "KR_jungle_9", "quest", "attack6");

			LAi_QuestDelay("pchar_huh", 3.0);
			LAi_QuestDelay("KR_indian_ambush1", 4.0);
		break;

		case "KR_indian_ambush1":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "quest", "attack3");

			LAi_QuestDelay("pchar_playertype", 1.0);
			LAi_QuestDelay("pchar_oh", 1.0);
			LAi_QuestDelay("KR_indian_ambush2", 2.0);
		break;

		case "KR_indian_ambush2":
			PlaySound("OBJECTS\ABORDAGE\abordage.wav");
			PlaySound("OBJECTS\ABORDAGE\abordage_wining.wav");
			LAi_group_FightGroups("JUNGLE_INDIANS", LAI_GROUP_PLAYER, true);
		break;
//---------------------------------------------------------------------------------------------------
		case "BB_island1_ladder_up":
			//from itemlogic
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "turn");

			LAi_QuestDelay("BB_island1_ladder_up1", 1.0);
		break;

		case "BB_island1_ladder_up1":
			LAi_SetPlayerType(Pchar);
			Pchar.quest.BB_isl1_ladder = "way_up";
			Pchar.BB_isl1_box4 = "off";
		break;
//---------------------------------------------------------------------------------------------------
		case "BB_island1_ladder_down":
			//from itemlogic
			pchar.quest.BB_island1_ladder_down0.win_condition.l1 = "locator";
			pchar.quest.BB_island1_ladder_down0.win_condition.l1.location = "BB_island1";
			pchar.quest.BB_island1_ladder_down0.win_condition.l1.locator_group = "goto";
			pchar.quest.BB_island1_ladder_down0.win_condition.l1.locator = "box3";
			pchar.quest.BB_island1_ladder_down0.win_condition = "BB_island1_ladder_down0";
		break;

		case "BB_island1_ladder_down0":
			Pchar.quest.BB_isl1_ladder = "temp_off";
			LAi_QuestDelay("BB_island1_ladder_down1", 2.0);			//was 1.0
		break;

		case "BB_island1_ladder_down1":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "turn");

			LAi_QuestDelay("BB_island1_ladder_down2", 1.0);
		break;

		case "BB_island1_ladder_down2":
			LAi_SetPlayerType(Pchar);
			Pchar.quest.BB_isl1_ladder = "way_down";
		break;

		case "BB_island1_ladder_down_to_box2":
			Pchar.quest.BB_isl1_ladder = "way_down";
			PlaySound("PEOPLE\creak2.wav");
			ChangeCharacterAddressGroup(Pchar, "BB_island1", "goto", "box2");
			Pchar.BB_isl1_box4 = "off";
		break;

		case "BB_island1_ground_turn_around":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "citizen010");

			LAi_QuestDelay("BB_island1_ground_turn_around1", 1.0);
		break;

		case "BB_island1_ground_turn_around1":
			LAi_SetPlayerType(Pchar);

			if(Pchar.model == "Skel4" || Pchar.model == "SkelZ") 
			{
				if(CheckAttribute(Pchar, "officers_running") && Pchar.officers_running == "done")
				{

				}
				else
				{
					Pchar.officers_running = "done";
					PlaySound("OBJECTS\VOICES\DEAD\male\dead0.wav");

					LAi_QuestDelay("pchar_aah", 1.0);	
					LAi_QuestDelay("pchar_lets_go", 2.0);
					LAi_QuestDelay("officers_run", 2.5);
				}
			}
		break;

		case "BB_isl1_box4_off":
			Pchar.BB_isl1_box4 = "off";
		break;

		case "key_unlock2":
			PlaySound("INTERFACE\key_unlock2.wav");
		break;
		
		case "BB_island1_unlock_tunnel":
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(pchar, "bladeBB");
			if(!CheckCharacterItem(Pchar,"bladeX4")) GiveItem2Character(Pchar, "bladeX4");
			EquipCharacterByItem(Pchar, "bladeX4");
			Locations[FindLocation("BB_island1")].models.always.l1 = "blade1";
		Locations[FindLocation(Pchar.location)].models.always.locators = "jungle07_l_JRH_open";
			Locations[FindLocation("BB_island1")].image = "";
			DoQuestReloadToLocation("BB_island1", "goto", "box3", "BB_island1_unlock_tunnel1");
		break;

		case "BB_island1_unlock_tunnel1":
			LAi_SetFightMode(Pchar, false);
			Locations[FindLocation("BB_island1")].image = "Outside_Jungle_7.tga";
			Pchar.BB_isl1_box4 = "off";
			Pchar.BB_isl1_tunnel = "open";
	
			LAi_QuestDelay("BB_island1_unlock_tunnel2", 1.5);
		break;
	
		case "BB_island1_unlock_tunnel2":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "turn");

			LAi_QuestDelay("BB_island1_unlock_tunnel3", 1.5);
		break;

		case "BB_island1_unlock_tunnel3":
			Pchar.quest.BB_isl1_ladder = "way_up";		//access now to tunnel
			LAi_SetPlayerType(Pchar);

			pchar.quest.equip_pistolbladeBB.win_condition.l1 = "location";
			pchar.quest.equip_pistolbladeBB.win_condition.l1.location = "BB_island2";
			pchar.quest.equip_pistolbladeBB.win_condition = "equip_pistolbladeBB";
		break;

		case "equip_pistolbladeBB":
			if(CheckCharacterItem(Pchar,"pistolbladeBB"))
			{
				if(!IsEquipCharacterByItem(Pchar, "pistolbladeBB"))
				{
					RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
					RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
					EquipCharacterByItem(Pchar, "bladeX4");
					EquipCharacterByItem(Pchar, "pistolbladeBB");
				}	
			}
		break;
	//--------------------------------------------------------------------------------------------
		case "BB_island2_still_locked":
			PlaySound("PEOPLE\run_stone.wav");
			PlaySound("PEOPLE\creak2.wav");
			ChangeCharacterAddressGroup(Pchar, "BB_island2", "goto", "box2");
		break;

		case "BB_isl2_box7_off":
			Pchar.BB_isl2_box7 = "off";
		break;

		case "BB_island2_unlock_tower":
			Locations[FindLocation("BB_island2")].models.always.l1 = "blade2";
			Locations[FindLocation("BB_island2")].image = "";
			DoQuestReloadToLocation("BB_island2", "goto", "box7", "BB_island2_unlock_tower1");
		break;

		case "BB_island2_unlock_tower1":
			LAi_SetFightMode(Pchar, false);
			Locations[FindLocation("BB_island2")].image = "Outside_Jungle_7.tga";
		//	Pchar.BB_isl2_box7 = "off";		//no should still be "on"
			Pchar.BB_tower_entrance = "open";
	
			LAi_QuestDelay("pchar_playertype", 1.5);
			LAi_QuestDelay("BB_island2_unlock_tower2", 1.5);
		break;

		case "BB_island2_unlock_tower2":
			ChangeCharacterAddressGroup(Pchar, "BB_island2", "reload", "reload4");
		break;


//---------------------------------------------------------------------------------------------------
		case "BB_tower_top_backloop":
			pchar.quest.BB_tower_top_backloop_A.win_condition.l1 = "locator";
			pchar.quest.BB_tower_top_backloop_A.win_condition.l1.location = "BB_tower";
			pchar.quest.BB_tower_top_backloop_A.win_condition.l1.locator_group = "reload";
			pchar.quest.BB_tower_top_backloop_A.win_condition.l1.locator = "reload6";
			pchar.quest.BB_tower_top_backloop_A.win_condition = "BB_tower_top_backloop_A";
		break;

		case "BB_tower_top_backloop_A":
			ChangeCharacterAddressGroup(Pchar, "BB_tower", "goto", "reload4");
			
			LAi_QuestDelay("BB_tower_top_backloop", 0.1);
		break;
//---------------------------------------------------------------------------------------------------
		case "BB_tower_backloop":
			//only if door to upper_cave is locked
			pchar.quest.BB_tower_backloop_A.win_condition.l1 = "locator";
			pchar.quest.BB_tower_backloop_A.win_condition.l1.location = "BB_tower";
			pchar.quest.BB_tower_backloop_A.win_condition.l1.locator_group = "goto";
			pchar.quest.BB_tower_backloop_A.win_condition.l1.locator = "goto2";
			pchar.quest.BB_tower_backloop_A.win_condition = "BB_tower_backloop_A";
		break;

		case "BB_tower_backloop_A":
			PlaySound("INTERFACE\door_locked2.wav");
			ChangeCharacterAddressGroup(Pchar, "BB_tower", "goto", "stop");			//was goto3
			
			LAi_QuestDelay("BB_tower_backloop", 0.1);
		break;
//---------------------------------------------------------------------------------------------------
		case "BB_upper_cave_backloop":
			pchar.quest.BB_upper_cave_backloop_A.win_condition.l1 = "locator";
			pchar.quest.BB_upper_cave_backloop_A.win_condition.l1.location = "BB_upper_cave";
			pchar.quest.BB_upper_cave_backloop_A.win_condition.l1.locator_group = "reload";
			pchar.quest.BB_upper_cave_backloop_A.win_condition.l1.locator = "reload3";
			pchar.quest.BB_upper_cave_backloop_A.win_condition = "BB_upper_cave_backloop_A";
		break;

		case "BB_upper_cave_backloop_A":
			ChangeCharacterAddressGroup(Pchar, "BB_upper_cave", "goto", "goto3");
			
			LAi_QuestDelay("BB_upper_cave_backloop", 0.1);
		break;
//---------------------------------------------------------------------------------------------------
		case "BB_lower_cave_backloop":
			pchar.quest.BB_lower_cave_backloop_A.win_condition.l1 = "locator";
			pchar.quest.BB_lower_cave_backloop_A.win_condition.l1.location = "BB_lower_cave";
			pchar.quest.BB_lower_cave_backloop_A.win_condition.l1.locator_group = "reload";
			pchar.quest.BB_lower_cave_backloop_A.win_condition.l1.locator = "reload3";
			pchar.quest.BB_lower_cave_backloop_A.win_condition = "BB_lower_cave_backloop_A";
		break;

		case "BB_lower_cave_backloop_A":
			PlaySound("INTERFACE\locked_window.wav");
			ChangeCharacterAddressGroup(Pchar, "BB_lower_cave", "goto", "goto3");
			
			LAi_QuestDelay("BB_lower_cave_backloop", 0.1);
		break;
//---------------------------------------------------------------------------------------------------
		case "BB_lower_cave_deathtrap":
			pchar.quest.BB_lower_cave_deathtrap1.win_condition.l1 = "locator";
			pchar.quest.BB_lower_cave_deathtrap1.win_condition.l1.location = "BB_lower_cave";
			pchar.quest.BB_lower_cave_deathtrap1.win_condition.l1.locator_group = "goto";
			pchar.quest.BB_lower_cave_deathtrap1.win_condition.l1.locator = "goto2";
			pchar.quest.BB_lower_cave_deathtrap1.win_condition = "BB_lower_cave_deathtrap1";
		break;

		case "BB_lower_cave_deathtrap1":
			PlaySound("PEOPLE\recoil.wav");
			
			LAi_QuestDelay("BB_lower_cave_deathtrap2", 0.5);
		break;

		case "BB_lower_cave_deathtrap2":
			PlaySound("OBJECTS\DUEL\reload1.wav");

			LAi_QuestDelay("BB_lower_cave_deathtrap3", 0.5);
		break;

		case "BB_lower_cave_deathtrap3":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead1.wav");

			LAi_QuestDelay("BB_lower_cave_deathtrap4", 0.5);			
		break;

		case "BB_lower_cave_deathtrap4":
			PlaySound("OBJECTS\DUEL\pistol_bbus.wav");
			CreateParticleSystem("gunfire" , -5.7, 1.9, -4.5, -5.7, 1.9, -4.5, sti(20) );

			LAi_QuestDelay("BB_lower_cave_deathtrap5", 0.3);			
		break;

		case "BB_lower_cave_deathtrap5":
			PlaySound("OBJECTS\DUEL\pistol_bbus.wav");
			CreateParticleSystem("gunfire" , -4.0, 1.9, -4.5, -4.0, 1.9, -4.5, sti(20) );
			
			if(CheckAttribute(Pchar, "quest.escape_trap") && Pchar.quest.escape_trap == "yes")
			{
				Pchar.quest.escape_trap = "no_escape";
			}
			else
			{
				if(Pchar.model == "Skel4" || Pchar.model == "SkelZ") 
				{
					//you are immortal already
				}
				else LAi_KillCharacter(Pchar);
			}			
		break; 

		case "trap_box14_enabled":
			Pchar.trap_box14 = "enabled";

			LAi_QuestDelay("pchar_oh", 0.5);
		break;
//---------------------------------------------------------------------------------------------------
		case "BB_uppercave_leverturn":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "randitem", "randitem4");

			LAi_QuestDelay("pchar_playertype", 1.0);
		break;

		case "BB_uppercave_caveturn":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box4");

			LAi_QuestDelay("pchar_playertype", 1.0);
		break;
//------------------------------------------------------------------------------------------------------------------------
		case "close_grotto_hatch":
			Locations[FindLocation("BB_upper_cave")].image = "";
			DoQuestReloadToLocation("BB_upper_cave", "goto", "pole", "close_grotto_hatch0");
		break;

		case "close_grotto_hatch0":
			locations[FindLocation("BB_upper_cave")].image = "loading\inside\cave.tga";
			PlaySound("INTERFACE\chart_move.wav");
			PlaySound("INTERFACE\chart_move.wav");

			LAi_QuestDelay("close_grotto_hatch1", 1.5);
		break;

		case "close_grotto_hatch1":
			PlaySound("PEOPLE\counter_close.wav");

			LAi_QuestDelay("close_grotto_hatch2", 1.0);
		break;

		case "close_grotto_hatch2":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");

			LAi_QuestDelay("close_grotto_hatch3", 1.0);
		break;

		case "close_grotto_hatch3":
			LAi_SetPlayerType(Pchar);
		break;
//------------------------------------------------------------------------------------------------------------------------
		case "open_grotto_hatch":
			Locations[FindLocation("BB_upper_cave")].image = "";
			DoQuestReloadToLocation("BB_upper_cave", "goto", "pole", "open_grotto_hatch0");
		break;

		case "open_grotto_hatch0":
			locations[FindLocation("BB_upper_cave")].image = "loading\inside\cave.tga";
			PlaySound("PEOPLE\counter_open.wav");

			LAi_QuestDelay("open_grotto_hatch1", 1.5);
		break;

		case "open_grotto_hatch1":
			PlaySound("PEOPLE\wood3.wav");

			LAi_QuestDelay("open_grotto_hatch2", 1.0);
		break;

		case "open_grotto_hatch2":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");

			LAi_QuestDelay("open_grotto_hatch3", 1.0);
		break;

		case "open_grotto_hatch3":
			LAi_SetPlayerType(Pchar);
		break;
//------------------------------------------------------------------------------------------------------------------------
		case "pick_up_grotto_boom":
			pchar.quest.pick_up_grotto_boom1.win_condition.l1 = "location";
			pchar.quest.pick_up_grotto_boom1.win_condition.l1.location = "BB_lower_cave";
			pchar.quest.pick_up_grotto_boom1.win_condition = "pick_up_grotto_boom1";
		break;

		case "pick_up_grotto_boom1":
			if(CheckCharacterItem(Pchar,"boom_item"))
			{
				TakeItemFromCharacter(pchar, "boom_item");
				GiveItem2Character(Pchar, "bladeboom");
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladeboom");

				SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box1", 0.7);
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem32", 0.0001);

				Locations[FindLocation("BB_lower_cave")].locators_radius.box.box1 = 0.7;
				Locations[FindLocation("BB_lower_cave")].locators_radius.randitem.randitem32 = 0.0001;
			}
			else
			{
				LAi_QuestDelay("pick_up_grotto_boom1", 0.5);//loop check
			}
		break;
//------------------------------------------------------------------------------------------------------------------------
		case "place_grotto_boom":
			ChangeCharacterAddressGroup(Pchar, "BB_upper_cave", "goto", "pole");
		
			LAi_QuestDelay("place_grotto_boom0", 0.5);
		break;

		case "place_grotto_boom0":
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(Pchar, true);
		
			LAi_QuestDelay("place_grotto_boom1", 1.0);
		break;

		case "place_grotto_boom1":
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			EquipCharacterByItem(Pchar, "bladeX4");

			TakeItemFromCharacter(pchar, "bladeboom");
			PlaySound("PEOPLE\creak2.wav");
		
			LAi_QuestDelay("place_grotto_boom2", 0.5);
		break;

		case "place_grotto_boom2":
			Locations[FindLocation("BB_upper_cave")].image = "";
			Locations[FindLocation(Pchar.location)].models.always.locators = "grotto1_l_Hup";
			DoQuestReloadToLocation("BB_upper_cave", "goto", "pole", "place_grotto_boom3");	
		break;

		case "place_grotto_boom3":
			LAi_SetFightMode(Pchar, false);
			Locations[FindLocation("BB_upper_cave")].image = "loading\inside\cave.tga";
		break;
//------------------------------------------------------------------------------------------------------------------------
		case "place_upper_cave_lever":
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			EquipCharacterByItem(Pchar, "bladeX4");

			TakeItemFromCharacter(pchar, "bladelever3");

			PlaySound("INTERFACE\lever_placed.wav");
			Pchar.quest.grotto_lever = "up";
			Locations[FindLocation("BB_upper_cave")].models.always.locators = "grotto1_l_Hdo_Lup";
			
			LAi_QuestDelay("place_upper_cave_lever2", 0.5);
		break;

		case "place_upper_cave_lever2":
			Locations[FindLocation("BB_upper_cave")].image = "";
			DoQuestReloadToLocation("BB_upper_cave", "goto", "box7", "place_upper_cave_lever3");	
		break;

		case "place_upper_cave_lever3":
			LAi_SetFightMode(Pchar, false);
			Locations[FindLocation("BB_upper_cave")].image = "loading\inside\cave.tga";

			LAi_QuestDelay("BB_uppercave_leverturn", 1.0);
		break;
//------------------------------------------------------------------------------------------------------------------------
		case "lower_cave_water_out":
			//from itemlogic
			Locations[FindLocation("BB_upper_cave")].image = "";
			DoQuestReloadToLocation("BB_upper_cave", "goto", "box7", "lower_cave_water_out1");
		break;

		case "lower_cave_water_out1":
			Locations[FindLocation("BB_upper_cave")].image = "loading\inside\cave.tga";
			PlaySound("NATURE\water_out.wav");

			LAi_QuestDelay("BB_uppercave_leverturn", 0.01);
			LAi_QuestDelay("return_to_uppercave", 2.0);

			if(characters[GetCharacterIndex("Louis_Arot")].location == "BB_upper_cave")
			{
				LAi_QuestDelay("au_revoir", 4.0);
			}
		break;

		case "au_revoir":
			PlaySound("VOICE\ENGLISH\Fre_m_c_049.wav");
		break;
		
//------------------------------------------------------------------------------------------------------------------------
		case "lower_cave_water_in":
			//from itemlogic
			Locations[FindLocation("BB_upper_cave")].image = "";
			DoQuestReloadToLocation("BB_upper_cave", "goto", "box7", "lower_cave_water_in1");
		break;

		case "lower_cave_water_in1":
			Locations[FindLocation("BB_upper_cave")].image = "loading\inside\cave.tga";
			PlaySound("NATURE\water_in.wav");

			LAi_QuestDelay("BB_uppercave_leverturn", 0.01);
			LAi_QuestDelay("return_to_uppercave", 2.0);
		break;
//------------------------------------------------------------------------------------------------------------------------
		case "return_to_uppercave":
			PlaySound("PEOPLE\Run_wood.wav");
			ChangeCharacterAddressGroup(Pchar, "BB_upper_cave", "goto", "box8");

			LAi_QuestDelay("return_to_uppercave1", 1.0);
		break;

		case "return_to_uppercave1":
			if(Locations[FindLocation("BB_upper_cave")].models.always.l3 == "girder_block2")
			{
				PlaySound("INTERFACE\girder_close.wav");
			}
			else PlaySound("INTERFACE\girder_open.wav");

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "box4");

			LAi_QuestDelay("return_to_uppercave2", 1.0);
		break;
	
		case "return_to_uppercave2":
			LAi_SetPlayerType(Pchar);
		break;
//------------------------------------------------------------------------------------------------------------------------
		case "BB_lower_cave_steplock":
			pchar.quest.BB_lower_cave_steplock1.win_condition.l1 = "locator";
			pchar.quest.BB_lower_cave_steplock1.win_condition.l1.location = "BB_lower_cave";
			pchar.quest.BB_lower_cave_steplock1.win_condition.l1.locator_group = "goto";
			pchar.quest.BB_lower_cave_steplock1.win_condition.l1.locator = "steplock";
			pchar.quest.BB_lower_cave_steplock1.win_condition = "BB_lower_cave_steplock1";
		break;

		case "BB_lower_cave_steplock1":
			PlaySound("INTERFACE\step_path.wav");

			if(Locations[FindLocation("BB_lower_cave")].models.always.l1 == "bars_down")
			{
				Locations[FindLocation("BB_lower_cave")].models.always.l1 = "bars_up";
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload3", 0.0001);
				Locations[FindLocation("BB_lower_cave")].locators_radius.reload.reload3 = 0.0001;

				Locations[FindLocation("BB_upper_cave")].models.always.l1 = "bars_up";
				Locations[FindLocation("BB_upper_cave")].reload.l1.disable = 1;
			}
			else
			{
				if(Locations[FindLocation("BB_lower_cave")].models.always.l1 == "bars_up")
				{
					Locations[FindLocation("BB_lower_cave")].models.always.l1 = "bars_down";
					SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload3", 1.0);
					Locations[FindLocation("BB_lower_cave")].locators_radius.reload.reload3 = 1.0;

					Locations[FindLocation("BB_upper_cave")].models.always.l1 = "bars_down";
					if(Locations[FindLocation("BB_upper_cave")].models.always.l3 == "girder_free2")
					{
						Locations[FindLocation("BB_upper_cave")].reload.l1.disable = 0;
					}
				}
			}

			LAi_QuestDelay("BB_lower_cave_steplock2", 0.5);
		break;

		case "BB_lower_cave_steplock2":
			Locations[FindLocation("BB_lower_cave")].image = "";
			DoQuestReloadToLocation("BB_lower_cave", "goto", "beside", "BB_lower_cave_steplock3");
		break;

		case "BB_lower_cave_steplock3":
			Locations[FindLocation("BB_lower_cave")].image = "loading\inside\cave.tga";

			if(Locations[FindLocation("BB_lower_cave")].models.always.l1 == "bars_down")
			{
				PlaySound("INTERFACE\elevator_gate.wav");
			}
			
			if(Locations[FindLocation("BB_lower_cave")].models.always.l1 == "bars_up")
			{
				PlaySound("INTERFACE\rusty.wav");


				if(CheckAttribute(Pchar, "fanfare_check") && Pchar.fanfare_check == "on")
				{
					//check only first time
				}
				else
				{
					pchar.quest.BB_lower_cave_fanfare.win_condition.l1 = "locator";
					pchar.quest.BB_lower_cave_fanfare.win_condition.l1.location = "BB_lower_cave";
					pchar.quest.BB_lower_cave_fanfare.win_condition.l1.locator_group = "goto";
					pchar.quest.BB_lower_cave_fanfare.win_condition.l1.locator = "fanfare";
					pchar.quest.BB_lower_cave_fanfare.win_condition = "BB_lower_cave_fanfare";
				}

				if(CheckAttribute(Pchar, "book73_check") && Pchar.book73_check == "on")
				{
					//check only first time
				}
				else
				{
					LAi_QuestDelay("book73_check", 0.1);
				}

				if(CheckAttribute(Pchar, "snakewand_check") && Pchar.snakewand_check == "on")
				{
					//check only first time
				}
				else
				{
					LAi_QuestDelay("snakewand_check", 0.1);
				}

				if(CheckAttribute(Pchar, "censer_check") && Pchar.censer_check == "on")
				{
					//check only first time
				}
				else
				{
					LAi_QuestDelay("censer_check", 0.1);
				}
			}

			pchar.quest.BB_lower_cave_steplock1.win_condition.l1 = "locator";
			pchar.quest.BB_lower_cave_steplock1.win_condition.l1.location = "BB_lower_cave";
			pchar.quest.BB_lower_cave_steplock1.win_condition.l1.locator_group = "goto";
			pchar.quest.BB_lower_cave_steplock1.win_condition.l1.locator = "steplock";
			pchar.quest.BB_lower_cave_steplock1.win_condition = "BB_lower_cave_steplock1";
		break;

		case "BB_lower_cave_fanfare":
			ChangeCharacterAddressGroup(Pchar, "BB_lower_cave", "goto", "see_treasure");
			Pchar.fanfare_check = "on";
			PlaySound("AMBIENT\SEASHORE\fanfare.wav");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("BB_lower_cave_fanfare1", 2.0);
			LAi_QuestDelay("BB_lower_cave_fanfare2", 5.0);
			LAi_QuestDelay("BB_lower_cave_fanfare3", 8.0);
			LAi_QuestDelay("BB_lower_cave_fanfare4", 11.0);
			LAi_QuestDelay("pchar_playertype", 12.0);
		break;

		case "BB_lower_cave_fanfare1":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "randitem", "randitem35");
		break;

		case "BB_lower_cave_fanfare2":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "randitem", "randitem9");
		break;

		case "BB_lower_cave_fanfare3":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "randitem", "randitem14");
		break;

		case "BB_lower_cave_fanfare4":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "randitem", "randitem13");
		break;

		case "book73_check":
			Pchar.book73_check = "on";
		
			if(CheckCharacterItem(Pchar,"book73_closed"))
			{
				PlaySound("INTERFACE\important_item.wav");
				PlaySound("INTERFACE\paper.wav");
			}
			else LAi_QuestDelay("book73_check", 0.5);//loop check
		break;

		case "snakewand_check":
			Pchar.snakewand_check = "on";

			if(CheckCharacterItem(Pchar,"snakewand"))
			{
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "snakewand");
				GetCharacterPos(Pchar, &u, &v, &w);
				CreateParticleSystem("artifact_very_short" , u, v+1.2, w, 0.0, 0.0, 0.0, sti(20) );
				PlaySound("OBJECTS\DUEL\snakewand.wav");

				SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box10", 0.9);			//idol
				Locations[FindLocation("BB_lower_cave")].locators_radius.box.box10 = 0.9;
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem37", 0.001);	//wand
				Locations[FindLocation("BB_lower_cave")].locators_radius.randitem.randitem37 = 0.001;

				LAi_QuestDelay("wand_and_censer_check", 1.0);
			}
			else
			{
				LAi_QuestDelay("snakewand_check", 0.5);//loop check
			}
		break;

		case "censer_check":
			Pchar.censer_check = "on";

			if(CheckCharacterItem(Pchar,"censer_item"))
			{
				PlaySound("INTERFACE\important_item.wav");
				TakeItemFromCharacter(pchar, "censer_item");
				if(CheckCharacterItem(Pchar,"incense"))
				{
					GiveItem2Character(Pchar, "pistolcenserD");
					RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
					EquipCharacterByItem(Pchar, "pistolcenserD");
					PlaySound("OBJECTS\DUEL\censer.wav");
					PlaySound("OBJECTS\DUEL\censer.wav");
					GetCharacterPos(pchar, &u, &v, &w);
					CreateParticleSystem("gunfire" , u, v+1.2, w, 0.0, 0.0, 0.0, sti(20) );
				}
				else
				{
					GiveItem2Character(Pchar, "pistolcenserE");
					RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
					EquipCharacterByItem(Pchar, "pistolcenserE");
				}

				LAi_QuestDelay("wand_and_censer_check", 1.0);
			}
			else
			{
				LAi_QuestDelay("censer_check", 0.5);//loop check
			}
		break;

		case "wand_and_censer_check":
			if(CheckCharacterItem(Pchar,"snakewand"))
			{
				if(CheckCharacterItem(Pchar,"pistolcenserD") || CheckCharacterItem(Pchar,"pistolcenserE"))
				{
					if(CheckAttribute(Pchar, "treasure_painting") && Pchar.treasure_painting == "checked")
					{
						PlaySound("PEOPLE\counter_close.wav");
						locations[FindLocation("BB_lower_cave")].reload.l1.disable = 1;	//to upper cave
					
						LAi_QuestDelay("wand_and_censer_check1", 1.0);
					}
				}
			}
		break;

		case "wand_and_censer_check1":
			PlaySound("VOICE\ENGLISH\blaze_what_was_that.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload3");

			LAi_QuestDelay("wand_and_censer_check2", 1.5);
		break;

		case "wand_and_censer_check2":
			LAi_SetPlayerType(Pchar);
			locations[FindLocation("BB_lower_cave")].models.always.locators = "grotto2_l_dry_H";
			Locations[FindLocation("BB_lower_cave")].image = "";
			DoQuestReloadToLocation("BB_lower_cave", "quest", "see_doors", "wand_and_censer_check3");
		break;

		case "wand_and_censer_check3":
			PlaySound("INTERFACE\stone_mandala.wav");
			CreateParticleSystem("blast_dirt" , 7.5, 0.7, 14.4, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 7.0, 0.4, 14.0, 0.0, 0.0, 0.0, sti(20) );
			Locations[FindLocation("BB_lower_cave")].image = "loading\inside\cave.tga";
			
			LAi_QuestDelay("wand_and_censer_check4", 1.0);

				Pchar.hell_cave = "locked";	//mummies
				Pchar.hell_gate3 = "locked";	//templars
				Pchar.hell_gate1 = "locked";	//to guillotine
				Pchar.hell_gate2 = "locked";	//to 'church'
				Pchar.hell_gate4 = "locked";	//priests, hole
				Pchar.hell_gate5 = "locked";	//irongate

				pchar.quest.burning_cave_start.win_condition.l1 = "location";
				pchar.quest.burning_cave_start.win_condition.l1.location = "BB_burning_cave";
				pchar.quest.burning_cave_start.win_condition = "burning_cave_start";
		break;

		case "wand_and_censer_check4":
			PlaySound("INTERFACE\stone_mandala.wav");

			LAi_QuestDelay("pchar_huh", 2.0);
		break;

		case "burning_cave_start":
			locations[FindLocation(Pchar.location)].box1.items.indian1 = 1;
			locations[FindLocation(Pchar.location)].box1.items.indian10 = 1;

			locations[FindLocation(Pchar.location)].box4.items.icollection = 1;
			locations[FindLocation(Pchar.location)].box4.items.idol = 1;
			
			locations[FindLocation(Pchar.location)].box6.items.animists_amulet = 1;
			locations[FindLocation(Pchar.location)].box6.items.book62 = 1;
		
			//MUMMIES
			pchar.quest.hell_cave10.win_condition.l1 = "locator";
			pchar.quest.hell_cave10.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_cave10.win_condition.l1.locator_group = "goto";
			pchar.quest.hell_cave10.win_condition.l1.locator = "guard10";
			pchar.quest.hell_cave10.win_condition = "hell_cave10";

			pchar.quest.hell_cave11.win_condition.l1 = "locator";
			pchar.quest.hell_cave11.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_cave11.win_condition.l1.locator_group = "goto";
			pchar.quest.hell_cave11.win_condition.l1.locator = "guard11";
			pchar.quest.hell_cave11.win_condition = "hell_cave11";

			pchar.quest.hell_caveMC.win_condition.l1 = "locator";
			pchar.quest.hell_caveMC.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_caveMC.win_condition.l1.locator_group = "goto";
			pchar.quest.hell_caveMC.win_condition.l1.locator = "mummyC";
			pchar.quest.hell_caveMC.win_condition = "hell_caveMC";

			pchar.quest.hell_caveMS.win_condition.l1 = "locator";
			pchar.quest.hell_caveMS.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_caveMS.win_condition.l1.locator_group = "goto";
			pchar.quest.hell_caveMS.win_condition.l1.locator = "mummyS";
			pchar.quest.hell_caveMS.win_condition = "hell_caveMS";
		break;

		case "burning_cave_start2":
			//TEMPLARS
			pchar.quest.hell_gate3M.win_condition.l1 = "locator";
			pchar.quest.hell_gate3M.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate3M.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate3M.win_condition.l1.locator = "gate3M";
			pchar.quest.hell_gate3M.win_condition = "hell_gate3M";

			pchar.quest.hell_gate3L.win_condition.l1 = "locator";
			pchar.quest.hell_gate3L.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate3L.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate3L.win_condition.l1.locator = "gate3L";
			pchar.quest.hell_gate3L.win_condition = "hell_gate3L";

			pchar.quest.hell_gate3R.win_condition.l1 = "locator";
			pchar.quest.hell_gate3R.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate3R.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate3R.win_condition.l1.locator = "gate3R";
			pchar.quest.hell_gate3R.win_condition = "hell_gate3R";
		break;

		case "burning_cave_start3":
			//CONQUISTADORES to guillotine
			
			LAi_SetStayType(Pchar);

			if(CheckCharacterItem(Pchar,"potion1") || CheckCharacterItem(Pchar,"potion2") || CheckCharacterItem(Pchar,"potion3") || CheckCharacterItem(Pchar,"potion4")
		        || CheckCharacterItem(Pchar,"potionrum") || CheckCharacterItem(Pchar,"potionwine")
			|| CheckCharacterItem(Pchar,"potionwine2") || CheckCharacterItem(Pchar,"cognac")) PlaySound("INTERFACE\glass2.wav");

			if(CheckCharacterItem(Pchar,"medical1") || CheckCharacterItem(Pchar,"medical2") 
		        || CheckCharacterItem(Pchar,"tobacco") || CheckCharacterItem(Pchar,"sewing_kit")) PlaySound("PEOPLE\clothes4.wav");

			if(CheckCharacterItem(Pchar,"potion1") || CheckCharacterItem(Pchar,"potion2") || CheckCharacterItem(Pchar,"potion3") || CheckCharacterItem(Pchar,"potion4")
			|| CheckCharacterItem(Pchar,"medical1") || CheckCharacterItem(Pchar,"medical2") || CheckCharacterItem(Pchar,"potionrum") || CheckCharacterItem(Pchar,"potionwine")
			|| CheckCharacterItem(Pchar,"potionwine2") || CheckCharacterItem(Pchar,"tobacco") || CheckCharacterItem(Pchar,"sewing_kit") || CheckCharacterItem(Pchar,"cognac"))
			{
				TakeNItems(Pchar, "potion1", -100); TakeNItems(Pchar, "potion2", -100); TakeNItems(Pchar, "potion3", -100); TakeNItems(Pchar, "potion4", -100);
				TakeNItems(Pchar, "medical1", -100); TakeNItems(Pchar, "medical2", -100); TakeNItems(Pchar, "potionrum", -100); TakeNItems(Pchar, "potionwine", -100);
				TakeNItems(Pchar, "potionwine2", -100); TakeNItems(Pchar, "tobacco", -100); TakeNItems(Pchar, "sewing_kit", -100); TakeNItems(Pchar, "cognac", -100);
			}

			LAi_QuestDelay("burning_cave_start3_A", 1.0);

			pchar.quest.hell_gate1M.win_condition.l1 = "locator";
			pchar.quest.hell_gate1M.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate1M.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate1M.win_condition.l1.locator = "gate1M";
			pchar.quest.hell_gate1M.win_condition = "hell_gate1M";

			pchar.quest.hell_gate1L.win_condition.l1 = "locator";
			pchar.quest.hell_gate1L.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate1L.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate1L.win_condition.l1.locator = "gate1L";
			pchar.quest.hell_gate1L.win_condition = "hell_gate1L";

			pchar.quest.hell_gate1R.win_condition.l1 = "locator";
			pchar.quest.hell_gate1R.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate1R.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate1R.win_condition.l1.locator = "gate1R";
			pchar.quest.hell_gate1R.win_condition = "hell_gate1R";
		
		//----------------------------------------------------------------------------------

			pchar.quest.hell_gate2M.win_condition.l1 = "locator";
			pchar.quest.hell_gate2M.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate2M.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate2M.win_condition.l1.locator = "gate2M";
			pchar.quest.hell_gate2M.win_condition = "hell_gate2M";

			pchar.quest.hell_gate2L.win_condition.l1 = "locator";
			pchar.quest.hell_gate2L.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate2L.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate2L.win_condition.l1.locator = "gate2L";
			pchar.quest.hell_gate2L.win_condition = "hell_gate2L";

			pchar.quest.hell_gate2R.win_condition.l1 = "locator";
			pchar.quest.hell_gate2R.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate2R.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate2R.win_condition.l1.locator = "gate2R";
			pchar.quest.hell_gate2R.win_condition = "hell_gate2R";
		break;

		case "burning_cave_start3_A":
			PlaySound("INTERFACE\key_unlock2.wav");
			LAi_SetPlayerType(Pchar);
		break;

		case "burning_cave_start4":
			//PRIESTS

			pchar.quest.hell_gate4M.win_condition.l1 = "locator";
			pchar.quest.hell_gate4M.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate4M.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate4M.win_condition.l1.locator = "gate4M";
			pchar.quest.hell_gate4M.win_condition = "hell_gate4M";

			pchar.quest.hell_gate4L.win_condition.l1 = "locator";
			pchar.quest.hell_gate4L.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate4L.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate4L.win_condition.l1.locator = "gate4L";
			pchar.quest.hell_gate4L.win_condition = "hell_gate4L";

			pchar.quest.hell_gate4R.win_condition.l1 = "locator";
			pchar.quest.hell_gate4R.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate4R.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate4R.win_condition.l1.locator = "gate4R";
			pchar.quest.hell_gate4R.win_condition = "hell_gate4R";

		//----------------------------------------------------------------------------------
			pchar.quest.hell_backL1.win_condition.l1 = "locator";
			pchar.quest.hell_backL1.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_backL1.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_backL1.win_condition.l1.locator = "holeL1";
			pchar.quest.hell_backL1.win_condition = "hell_backL1";

			pchar.quest.hell_backR1.win_condition.l1 = "locator";
			pchar.quest.hell_backR1.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_backR1.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_backR1.win_condition.l1.locator = "holeR1";
			pchar.quest.hell_backR1.win_condition = "hell_backR1";

			pchar.quest.hell_backL2.win_condition.l1 = "locator";
			pchar.quest.hell_backL2.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_backL2.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_backL2.win_condition.l1.locator = "holeL2";
			pchar.quest.hell_backL2.win_condition = "hell_backL2";

			pchar.quest.hell_backR2.win_condition.l1 = "locator";
			pchar.quest.hell_backR2.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_backR2.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_backR2.win_condition.l1.locator = "holeR2";
			pchar.quest.hell_backR2.win_condition = "hell_backR2";
		break;

		case "hell_gate5_hole1":
			//from dialog & from q_r below
	
			pchar.quest.burning_cave_start5.win_condition.l1 = "locator";
			pchar.quest.burning_cave_start5.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.burning_cave_start5.win_condition.l1.locator_group = "goto";
			pchar.quest.burning_cave_start5.win_condition.l1.locator = "hole1";
			pchar.quest.burning_cave_start5.win_condition = "burning_cave_start5";
		break;

		case "burning_cave_start5":
			//DEMONS

			LAi_QuestDelay("gate5_large_radius", 0.001);
	
			pchar.quest.hell_gate5M.win_condition.l1 = "locator";
			pchar.quest.hell_gate5M.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate5M.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate5M.win_condition.l1.locator = "gate5M";
			pchar.quest.hell_gate5M.win_condition = "hell_gate5M";

			pchar.quest.hell_gate5L.win_condition.l1 = "locator";
			pchar.quest.hell_gate5L.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate5L.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate5L.win_condition.l1.locator = "gate5L";
			pchar.quest.hell_gate5L.win_condition = "hell_gate5L";

			pchar.quest.hell_gate5LL.win_condition.l1 = "locator";
			pchar.quest.hell_gate5LL.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate5LL.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate5LL.win_condition.l1.locator = "gate5LL";
			pchar.quest.hell_gate5LL.win_condition = "hell_gate5LL";

			pchar.quest.hell_gate5R.win_condition.l1 = "locator";
			pchar.quest.hell_gate5R.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate5R.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate5R.win_condition.l1.locator = "gate5R";
			pchar.quest.hell_gate5R.win_condition = "hell_gate5R";

			pchar.quest.hell_gate5RR.win_condition.l1 = "locator";
			pchar.quest.hell_gate5RR.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate5RR.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate5RR.win_condition.l1.locator = "gate5RR";
			pchar.quest.hell_gate5RR.win_condition = "hell_gate5RR";
		break;

		case "gate5_small_radius":
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "quest", "gate5M", 0.0001);
			Locations[FindLocation("BB_burning_cave")].locators_radius.quest.gate5M = 0.0001;
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "quest", "gate5L", 0.0001);
			Locations[FindLocation("BB_burning_cave")].locators_radius.quest.gate5L = 0.0001;
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "quest", "gate5LL", 0.0001);
			Locations[FindLocation("BB_burning_cave")].locators_radius.quest.gate5LL = 0.0001;
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "quest", "gate5R", 0.0001);
			Locations[FindLocation("BB_burning_cave")].locators_radius.quest.gate5R = 0.0001;
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "quest", "gate5RR", 0.0001);
			Locations[FindLocation("BB_burning_cave")].locators_radius.quest.gate5RR = 0.0001;
		break;

		case "gate5_large_radius":
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "quest", "gate5M", 0.5);
			Locations[FindLocation("BB_burning_cave")].locators_radius.quest.gate5M = 0.5;
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "quest", "gate5L", 0.5);
			Locations[FindLocation("BB_burning_cave")].locators_radius.quest.gate5L = 0.5;
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "quest", "gate5LL", 0.5);
			Locations[FindLocation("BB_burning_cave")].locators_radius.quest.gate5LL = 0.5;
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "quest", "gate5R", 0.5);
			Locations[FindLocation("BB_burning_cave")].locators_radius.quest.gate5R = 0.5;
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "quest", "gate5RR", 0.5);
			Locations[FindLocation("BB_burning_cave")].locators_radius.quest.gate5RR = 0.5;
		break;

//------------------------------------------------------------------------------------------------------------------------
	
		case "BB_gold_dust":
			LAi_SetPlayerType(Pchar);
			PlaySound("PEOPLE\clothes1.wav");
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("blast_dirt_small", u, v, w, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("BB_gold_dust1", 1.0);
		break;
		
		case "BB_gold_dust1":
			PlaySound("VOICE\ENGLISH\blaze_puh.wav");
			Logit(TranslateString("","No, the six Sacks with Gold Dust are too heavy - the crew will take them to the ship."));
		break;

		case "BB_cherub":
			LAi_SetPlayerType(Pchar);
			PlaySound("PEOPLE\step_echo.wav");
			PlaySound("PEOPLE\step_carpet.wav");

			LAi_QuestDelay("BB_cherub1", 0.5);
		break;
		
		case "BB_cherub1":
			PlaySound("VOICE\ENGLISH\blaze_puh.wav");
			Logit(TranslateString("","No, the Idol is too heavy - the crew will take it to the ship."));
		break;

		case "prepare_FH_painting_check":
			SetLocatorRadius(locations[FindLocation(pchar.location)], "randitem", "randitem23", 1.3);
			Locations[FindLocation(pchar.location)].locators_radius.randitem.randitem23 = 1.3;

			LAi_QuestDelay("FH_painting_check", 0.1);
		break;

		case "FH_painting_check":
			if(CheckCharacterItem(Pchar,"FransHals_45"))
			{
				PlaySound("INTERFACE\carpet_move.wav");
				TakeItemFromCharacter(Pchar, "FransHals_45");
				GiveItem2Character(Pchar, "bladepainting");
				EquipCharacterByItem(Pchar, "bladepainting");
				SetLocatorRadius(locations[FindLocation(pchar.location)], "randitem", "randitem23", 0.01);
				Locations[FindLocation(pchar.location)].locators_radius.randitem.randitem23 = 0.01;
				
				LAi_QuestDelay("book71_enabled", 1.0);
				LAi_QuestDelay("pchar_oh", 1.0);
			}
			else
			{
				LAi_QuestDelay("FH_painting_check", 0.5);//loop check
			}
		break;

		case "book71_enabled":

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "diagonal");
			SetLocatorRadius(locations[FindLocation(pchar.location)], "randitem", "randitem24", 2.0);
			Locations[FindLocation(pchar.location)].locators_radius.randitem.randitem24 = 2.0;

			LAi_QuestDelay("book71_check", 0.1);
			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "book71_check":
			if(CheckCharacterItem(Pchar,"book71_9_start"))
			{
				PlaySound("INTERFACE\book_close.wav");
				PlaySound("INTERFACE\book_close.wav");
				TakeItemFromCharacter(Pchar, "book71_9_start");
				GiveItem2Character(Pchar, "pistolbook71");
				EquipCharacterByItem(Pchar, "pistolbook71");
			}
			else LAi_QuestDelay("book71_check", 0.5);
		break;
//------------------------------------------------------------------------------------------------------------------------
		case "hell_cave10_start":
			pchar.quest.hell_cave10.win_condition.l1 = "locator";
			pchar.quest.hell_cave10.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_cave10.win_condition.l1.locator_group = "goto";
			pchar.quest.hell_cave10.win_condition.l1.locator = "guard10";
			pchar.quest.hell_cave10.win_condition = "hell_cave10";
		break;

		case "hell_cave10":
			if(CheckAttribute(Pchar, "hell_cave") && Pchar.hell_cave == "locked")
			{
				LAi_SetStayType(Pchar);
				ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "quest", "guard10_back");

				LAi_QuestDelay("hell_cave10_start", 0.1);
				LAi_QuestDelay("to_guard10_back", 0.2);	
			}
		break;

		case "to_guard10_back":
			LAi_SetActorType(characterFromID("devil_guard10"));
			LAi_ActorDialog(characterFromID("devil_guard10"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("devil_guard10"));
			Characters[GetCharacterIndex("devil_guard10")].dialog.CurrentNode  = "password";
		break;

		case "hell_cave11_start":
			pchar.quest.hell_cave11.win_condition.l1 = "locator";
			pchar.quest.hell_cave11.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_cave11.win_condition.l1.locator_group = "goto";
			pchar.quest.hell_cave11.win_condition.l1.locator = "guard11";
			pchar.quest.hell_cave11.win_condition = "hell_cave11";
		break;

		case "hell_cave11":
			if(CheckAttribute(Pchar, "hell_cave") && Pchar.hell_cave == "locked")
			{
				LAi_SetStayType(Pchar);
				ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "quest", "guard11_back");

				LAi_QuestDelay("hell_cave11_start", 0.1);
				LAi_QuestDelay("to_guard11_back", 0.2);	
			}
		break;

		case "to_guard11_back":
			LAi_SetActorType(characterFromID("devil_guard11"));
			LAi_ActorDialog(characterFromID("devil_guard11"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("devil_guard11"));
			Characters[GetCharacterIndex("devil_guard11")].dialog.CurrentNode  = "password";
		break;

		case "hell_caveMC_start":
			pchar.quest.hell_caveMC.win_condition.l1 = "locator";
			pchar.quest.hell_caveMC.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_caveMC.win_condition.l1.locator_group = "goto";
			pchar.quest.hell_caveMC.win_condition.l1.locator = "mummyC";
			pchar.quest.hell_caveMC.win_condition = "hell_caveMC";
		break;

		case "hell_caveMC":
			if(CheckAttribute(Pchar, "hell_cave") && Pchar.hell_cave == "locked")
			{
				LAi_SetStayType(Pchar);
				ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "quest", "mummyC_back");

				LAi_QuestDelay("hell_caveMC_start", 0.1);
				LAi_QuestDelay("to_guard11_back", 0.2);		//11: dialog
			}
		break;

		case "hell_caveMS_start":
			pchar.quest.hell_caveMS.win_condition.l1 = "locator";
			pchar.quest.hell_caveMS.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_caveMS.win_condition.l1.locator_group = "goto";
			pchar.quest.hell_caveMS.win_condition.l1.locator = "mummyS";
			pchar.quest.hell_caveMS.win_condition = "hell_caveMS";
		break;

		case "hell_caveMS":
			if(CheckAttribute(Pchar, "hell_cave") && Pchar.hell_cave == "locked")
			{
				LAi_SetStayType(Pchar);
				ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "quest", "mummyS_back");
				
				LAi_QuestDelay("hell_caveMS_start", 0.1);
				LAi_QuestDelay("to_guard10_back", 0.2);		//10: dialog	
			}
		break;

	//.................................................................................................

		case "hell_gate1M_start":
			pchar.quest.hell_gate1M.win_condition.l1 = "locator";
			pchar.quest.hell_gate1M.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate1M.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate1M.win_condition.l1.locator = "gate1M";
			pchar.quest.hell_gate1M.win_condition = "hell_gate1M";
		break;

		case "hell_gate1M":
			if(CheckAttribute(Pchar, "hell_gate1"))
			{
				switch(Pchar.hell_gate1)
				{
					case "locked":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate1M_start", 0.1);
						LAi_QuestDelay("to_gate1M_back", 0.2);
					break;

					case "password":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate1M_start", 0.1);
						LAi_QuestDelay("to_gate1M_back", 0.2);
					break;

					case "search_gift":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate1M_start", 0.1);
						LAi_QuestDelay("to_gate1M_back", 0.2);
					break;

					case "outside":
						ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "goto", "1M_in");
						Pchar.hell_gate1 = "inside";
						PlaySound("PEOPLE\counter_openclose.wav");

						if(Characters[GetCharacterIndex("devil_guard14")].location == "bb_burning_cave")
						{
							ChangeCharacterAddressGroup(characterFromID("devil_guard13"), "none", "", "");
							ChangeCharacterAddressGroup(characterFromID("devil_guard14"), "none", "", "");
							ChangeCharacterAddressGroup(characterFromID("devil_guard1"), "bb_burning_cave", "goto", "guard1");
							ChangeCharacterAddressGroup(characterFromID("devil_guard2"), "bb_burning_cave", "goto", "guard2");
						}

						LAi_QuestDelay("hell_gate1M_start", 0.1);
					break;

					case "inside":
						ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "goto", "1M_out");
						Pchar.hell_gate1 = "outside";
						PlaySound("PEOPLE\counter_openclose.wav");

						LAi_QuestDelay("hell_gate1M_start", 0.1);
					break;
				}
			}	
		break;

		case "to_gate1M_back":
			ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "quest", "gate1M_back");
			
			LAi_SetActorType(characterFromID("devil_guard13"));
			LAi_ActorDialog(characterFromID("devil_guard13"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("devil_guard13"));

			if(CheckAttribute(Pchar, "hell_gate1"))
			{
				switch(Pchar.hell_gate1)
				{
					case "locked": Characters[GetCharacterIndex("devil_guard13")].dialog.CurrentNode  = "password"; break;
					case "password": Characters[GetCharacterIndex("devil_guard13")].dialog.CurrentNode  = "bribing"; break;
					case "search_gift": Characters[GetCharacterIndex("devil_guard13")].dialog.CurrentNode  = "inca_1"; break;
				}
			}
		break;

		case "hell_gate1L_start":
			pchar.quest.hell_gate1L.win_condition.l1 = "locator";
			pchar.quest.hell_gate1L.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate1L.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate1L.win_condition.l1.locator = "gate1L";
			pchar.quest.hell_gate1L.win_condition = "hell_gate1L";
		break;

		case "hell_gate1L":
			if(CheckAttribute(Pchar, "hell_gate1"))
			{
				switch(Pchar.hell_gate1)
				{
					case "locked":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate1L_start", 0.1);
						LAi_QuestDelay("to_gate1L_back", 0.2);
					break;

					case "password":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate1L_start", 0.1);
						LAi_QuestDelay("to_gate1L_back", 0.2);
					break;

					case "search_gift":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate1L_start", 0.1);
						LAi_QuestDelay("to_gate1L_back", 0.2);
					break;

					case "outside":
						ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "goto", "1L_in");
						Pchar.hell_gate1 = "inside";
						PlaySound("PEOPLE\counter_openclose.wav");

						if(Characters[GetCharacterIndex("devil_guard14")].location == "bb_burning_cave")
						{
							ChangeCharacterAddressGroup(characterFromID("devil_guard13"), "none", "", "");
							ChangeCharacterAddressGroup(characterFromID("devil_guard14"), "none", "", "");
							ChangeCharacterAddressGroup(characterFromID("devil_guard1"), "bb_burning_cave", "goto", "guard1");
							ChangeCharacterAddressGroup(characterFromID("devil_guard2"), "bb_burning_cave", "goto", "guard2");
						}

						LAi_QuestDelay("hell_gate1L_start", 0.1);
					break;

					case "inside":
						ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "goto", "1L_out");
						Pchar.hell_gate1 = "outside";
						PlaySound("PEOPLE\counter_openclose.wav");

						LAi_QuestDelay("hell_gate1L_start", 0.1);
					break;
				}
			}	
		break;

		case "to_gate1L_back":
			ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "quest", "gate1L_back");
			
			LAi_SetActorType(characterFromID("devil_guard13"));
			LAi_ActorDialog(characterFromID("devil_guard13"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("devil_guard13"));

			if(CheckAttribute(Pchar, "hell_gate1"))
			{
				switch(Pchar.hell_gate1)
				{
					case "locked": Characters[GetCharacterIndex("devil_guard13")].dialog.CurrentNode  = "password"; break;
					case "password": Characters[GetCharacterIndex("devil_guard13")].dialog.CurrentNode  = "bribing"; break;
					case "search_gift": Characters[GetCharacterIndex("devil_guard13")].dialog.CurrentNode  = "inca_1"; break;
				}
			}
		break;

		case "hell_gate1R_start":
			pchar.quest.hell_gate1R.win_condition.l1 = "locator";
			pchar.quest.hell_gate1R.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate1R.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate1R.win_condition.l1.locator = "gate1R";
			pchar.quest.hell_gate1R.win_condition = "hell_gate1R";
		break;

		case "hell_gate1R":
			if(CheckAttribute(Pchar, "hell_gate1"))
			{
				switch(Pchar.hell_gate1)
				{
					case "locked":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate1R_start", 0.1);
						LAi_QuestDelay("to_gate1R_back", 0.2);
					break;

					case "password":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate1R_start", 0.1);
						LAi_QuestDelay("to_gate1R_back", 0.2);
					break;

					case "search_gift":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate1R_start", 0.1);
						LAi_QuestDelay("to_gate1R_back", 0.2);
					break;

					case "outside":
						ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "goto", "1R_in");
						Pchar.hell_gate1 = "inside";
						PlaySound("PEOPLE\counter_openclose.wav");

						if(Characters[GetCharacterIndex("devil_guard14")].location == "bb_burning_cave")
						{
							ChangeCharacterAddressGroup(characterFromID("devil_guard13"), "none", "", "");
							ChangeCharacterAddressGroup(characterFromID("devil_guard14"), "none", "", "");
							ChangeCharacterAddressGroup(characterFromID("devil_guard1"), "bb_burning_cave", "goto", "guard1");
							ChangeCharacterAddressGroup(characterFromID("devil_guard2"), "bb_burning_cave", "goto", "guard2");
						}

						LAi_QuestDelay("hell_gate1R_start", 0.1);
					break;

					case "inside":
						ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "goto", "1R_out");
						Pchar.hell_gate1 = "outside";
						PlaySound("PEOPLE\counter_openclose.wav");

						LAi_QuestDelay("hell_gate1R_start", 0.1);
					break;
				}
			}	
		break;

		case "to_gate1R_back":
			ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "quest", "gate1R_back");

			LAi_SetActorType(characterFromID("devil_guard14"));
			LAi_ActorDialog(characterFromID("devil_guard14"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("devil_guard14"));

			if(CheckAttribute(Pchar, "hell_gate1"))
			{
				switch(Pchar.hell_gate1)
				{
					case "locked": Characters[GetCharacterIndex("devil_guard14")].dialog.CurrentNode  = "password"; break;
					case "password": Characters[GetCharacterIndex("devil_guard14")].dialog.CurrentNode  = "bribing"; break;
					case "search_gift": Characters[GetCharacterIndex("devil_guard14")].dialog.CurrentNode  = "inca_1"; break;
				}
			}
		break;

		case "gift_inca_1":
			LAi_SetStayType(Pchar);
			PlaySound("PEOPLE\key_box.wav");
			TakeItemFromCharacter(Pchar, "indian1"); TakeItemFromCharacter(Pchar, "indian10");

			LAi_QuestDelay("gift_inca_1A", 1.0);
		break;

		case "gift_inca_1A":
			PlaySound("INTERFACE\key_unlock2.wav");
			LAi_SetPlayerType(Pchar);
			Pchar.hell_gate1 = "outside";

			LAi_QuestDelay("bladechair_check", 0.5);
		break;

	//.................................................................................................

		case "hell_gate2M_start":
			pchar.quest.hell_gate2M.win_condition.l1 = "locator";
			pchar.quest.hell_gate2M.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate2M.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate2M.win_condition.l1.locator = "gate2M";
			pchar.quest.hell_gate2M.win_condition = "hell_gate2M";
		break;

		case "hell_gate2M":
			if(CheckAttribute(Pchar, "hell_gate2"))
			{
				switch(Pchar.hell_gate2)
				{
					case "locked":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate2M_start", 0.1);

						if(Characters[GetCharacterIndex("devil_guard1")].location == "bb_burning_cave")
						{
							LAi_QuestDelay("to_gate2M_back", 0.2);
						}
						else LAi_QuestDelay("to_gate2M_back", 1.0);
					break;

					case "password":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate2M_start", 0.1);
						LAi_QuestDelay("to_gate2M_back", 0.2);		//dialog
					break;

					case "search_gift":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate2M_start", 0.1);
						LAi_QuestDelay("to_gate2M_back", 0.2);
					break;

					case "outside":
						ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "goto", "2M_in");
						Pchar.hell_gate2 = "inside";
						PlaySound("AMBIENT\JAIL\jail_door2.wav");

						LAi_QuestDelay("hell_gate2M_start", 0.1);
					break;

					case "inside":
						ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "goto", "2M_out");
						Pchar.hell_gate2 = "outside";
						PlaySound("AMBIENT\JAIL\jail_door2.wav");

						LAi_QuestDelay("hell_gate2M_start", 0.1);
					break;
				}
			}
		break;

		case "to_gate2M_back":
			ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "quest", "gate2M_back");
			
			if(Characters[GetCharacterIndex("devil_guard1")].location == "bb_burning_cave")
			{
				LAi_SetActorType(characterFromID("devil_guard2"));
				LAi_ActorDialog(characterFromID("devil_guard2"), pchar, "", 0.0, 0.0);
				LAi_ActorWaitDialog(Pchar, characterFromID("devil_guard2"));

				if(CheckAttribute(Pchar, "hell_gate2"))
				{
					switch(Pchar.hell_gate2)
					{
						case "locked": Characters[GetCharacterIndex("devil_guard2")].dialog.CurrentNode  = "password"; break;
						case "password": Characters[GetCharacterIndex("devil_guard2")].dialog.CurrentNode  = "bribing"; break;
						case "search_gift": Characters[GetCharacterIndex("devil_guard2")].dialog.CurrentNode  = "inca_2"; break;
					}
				}
			}
			else 
			{
				PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
				LAi_SetPlayerType(Pchar);
			}
		break;

		case "hell_gate2L_start":
			pchar.quest.hell_gate2L.win_condition.l1 = "locator";
			pchar.quest.hell_gate2L.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate2L.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate2L.win_condition.l1.locator = "gate2L";
			pchar.quest.hell_gate2L.win_condition = "hell_gate2L";
		break;

		case "hell_gate2L":
			if(CheckAttribute(Pchar, "hell_gate2"))
			{
				switch(Pchar.hell_gate2)
				{
					case "locked":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate2L_start", 0.1);

						if(Characters[GetCharacterIndex("devil_guard1")].location == "bb_burning_cave")
						{
							LAi_QuestDelay("to_gate2L_back", 0.2);		//dialog
						}
						else LAi_QuestDelay("to_gate2L_back", 1.0);		//just sigh
					break;

					case "password":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate2L_start", 0.1);
						LAi_QuestDelay("to_gate2L_back", 0.2);		//dialog
					break;

					case "search_gift":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate2L_start", 0.1);
						LAi_QuestDelay("to_gate2L_back", 0.2);
					break;

					case "outside":
						ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "goto", "2L_in");
						Pchar.hell_gate2 = "inside";
						PlaySound("AMBIENT\JAIL\jail_door2.wav");

						LAi_QuestDelay("hell_gate2L_start", 0.1);
					break;

					case "inside":
						ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "goto", "2L_out");
						Pchar.hell_gate2 = "outside";
						PlaySound("AMBIENT\JAIL\jail_door2.wav");

						LAi_QuestDelay("hell_gate2L_start", 0.1);
					break;
				}
			}
		break;

		case "to_gate2L_back":
			ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "quest", "gate2L_back");

			if(Characters[GetCharacterIndex("devil_guard1")].location == "bb_burning_cave")
			{
				LAi_SetActorType(characterFromID("devil_guard1"));
				LAi_ActorDialog(characterFromID("devil_guard1"), pchar, "", 0.0, 0.0);
				LAi_ActorWaitDialog(Pchar, characterFromID("devil_guard1"));

				if(CheckAttribute(Pchar, "hell_gate2"))
				{
					switch(Pchar.hell_gate2)
					{
						case "locked": Characters[GetCharacterIndex("devil_guard1")].dialog.CurrentNode  = "password"; break;
						case "password": Characters[GetCharacterIndex("devil_guard1")].dialog.CurrentNode  = "bribing"; break;
						case "search_gift": Characters[GetCharacterIndex("devil_guard1")].dialog.CurrentNode  = "inca_2"; break;
					}
				}
			}
			else 
			{
				PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
				LAi_SetPlayerType(Pchar);
			}
		break;

		case "hell_gate2R_start":
			pchar.quest.hell_gate2R.win_condition.l1 = "locator";
			pchar.quest.hell_gate2R.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate2R.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate2R.win_condition.l1.locator = "gate2R";
			pchar.quest.hell_gate2R.win_condition = "hell_gate2R";
		break;

		case "hell_gate2R":
			if(CheckAttribute(Pchar, "hell_gate2"))
			{
				switch(Pchar.hell_gate2)
				{
					case "locked":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate2R_start", 0.1);

						if(Characters[GetCharacterIndex("devil_guard1")].location == "bb_burning_cave")
						{
							LAi_QuestDelay("to_gate2R_back", 0.2);
						}
						else LAi_QuestDelay("to_gate2R_back", 1.0);
					break;

					case "password":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate2R_start", 0.1);
						LAi_QuestDelay("to_gate2R_back", 0.2);		//dialog
					break;

					case "search_gift":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate2R_start", 0.1);
						LAi_QuestDelay("to_gate2R_back", 0.2);
					break;

					case "outside":
						ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "goto", "2R_in");
						Pchar.hell_gate2 = "inside";
						PlaySound("AMBIENT\JAIL\jail_door2.wav");

						LAi_QuestDelay("hell_gate2R_start", 0.1);
					break;

					case "inside":
						ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "goto", "2R_out");
						Pchar.hell_gate2 = "outside";
						PlaySound("AMBIENT\JAIL\jail_door2.wav");

						LAi_QuestDelay("hell_gate2R_start", 0.1);
					break;
				}
			}
		break;

		case "to_gate2R_back":
			ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "quest", "gate2R_back");

			if(Characters[GetCharacterIndex("devil_guard1")].location == "bb_burning_cave")
			{
				LAi_SetActorType(characterFromID("devil_guard2"));
				LAi_ActorDialog(characterFromID("devil_guard2"), pchar, "", 0.0, 0.0);
				LAi_ActorWaitDialog(Pchar, characterFromID("devil_guard2"));

				if(CheckAttribute(Pchar, "hell_gate2"))
				{
					switch(Pchar.hell_gate2)
					{
						case "locked": Characters[GetCharacterIndex("devil_guard2")].dialog.CurrentNode  = "password"; break;
						case "password": Characters[GetCharacterIndex("devil_guard2")].dialog.CurrentNode  = "bribing"; break;
						case "search_gift": Characters[GetCharacterIndex("devil_guard2")].dialog.CurrentNode  = "inca_2"; break;
					}
				}
			}
			else 
			{
				PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
				LAi_SetPlayerType(Pchar);
			}		
		break;

		case "gift_inca_2":
			LAi_SetStayType(Pchar);
			PlaySound("INTERFACE\wheel_take.wav");
			TakeItemFromCharacter(Pchar, "icollection"); TakeItemFromCharacter(Pchar, "idol");

			LAi_QuestDelay("gift_inca_2A", 1.0);
		break;

		case "gift_inca_2A":
			PlaySound("INTERFACE\key_unlock2.wav");
			LAi_SetPlayerType(Pchar);
			Pchar.hell_gate2 = "outside";

			LAi_QuestDelay("toolbox_check", 0.5);
		break;

		case "toolbox_check":
			if(CheckCharacterItem(Pchar,"toolbox_item"))
			{
				PlaySound("PEOPLE\basket.wav");
				PlaySound("PEOPLE\wood1.wav");
				GiveItem2Character(Pchar, "toolbox_filled");
				TakeItemFromCharacter(Pchar, "toolbox_item");
			}
			else
			{
				LAi_QuestDelay("toolbox_check", 0.5);//loop check
			}
		break;

	//.................................................................................................

		case "hell_gate3M_start":
			pchar.quest.hell_gate3M.win_condition.l1 = "locator";
			pchar.quest.hell_gate3M.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate3M.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate3M.win_condition.l1.locator = "gate3M";
			pchar.quest.hell_gate3M.win_condition = "hell_gate3M";
		break;

		case "hell_gate3M":
			if(CheckAttribute(Pchar, "hell_gate3"))
			{
				switch(Pchar.hell_gate3)
				{
					case "locked":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate3M_start", 0.1);
						LAi_QuestDelay("to_gate3M_back", 0.2);
					break;

					case "outside":
						ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "goto", "3M_in");
						Pchar.hell_gate3 = "inside";

						PauseAllSounds();//stops music
						locations[FindLocation("BB_burning_cave")].type = "burning_cave";
						PostEvent("LoadSceneSound", 0.1);
						PlaySound("AMBIENT\JAIL\jail_door2.wav");

						LAi_QuestDelay("hell_gate3M_start", 0.1);
					break;

					case "inside":
						ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "goto", "3M_out");
						Pchar.hell_gate3 = "outside";

						PauseAllSounds();//stops music
						locations[FindLocation("BB_burning_cave")].type = "silent_burning_cave";
						PostEvent("LoadSceneSound", 0.1);
						PlaySound("AMBIENT\JAIL\jail_door2.wav");

						LAi_QuestDelay("hell_gate3M_start", 0.1);
					break;
				}
			}
		break;

		case "to_gate3M_back":
			ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "quest", "gate3M_back");

			LAi_SetActorType(characterFromID("devil_guard6"));
			LAi_ActorDialog(characterFromID("devil_guard6"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("devil_guard6"));
			Characters[GetCharacterIndex("devil_guard6")].dialog.CurrentNode  = "password";
		break;

		case "hell_gate3L_start":
			pchar.quest.hell_gate3L.win_condition.l1 = "locator";
			pchar.quest.hell_gate3L.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate3L.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate3L.win_condition.l1.locator = "gate3L";
			pchar.quest.hell_gate3L.win_condition = "hell_gate3L";
		break;

		case "hell_gate3L":
			if(CheckAttribute(Pchar, "hell_gate3"))
			{
				switch(Pchar.hell_gate3)
				{
					case "locked":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate3L_start", 0.1);
						LAi_QuestDelay("to_gate3L_back", 0.2);
					break;

					case "outside":
						ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "goto", "3L_in");
						Pchar.hell_gate3 = "inside";

						PauseAllSounds();//stops music
						locations[FindLocation("BB_burning_cave")].type = "burning_cave";
						PostEvent("LoadSceneSound", 0.1);
						PlaySound("AMBIENT\JAIL\jail_door2.wav");
	
						LAi_QuestDelay("hell_gate3L_start", 0.1);
					break;

					case "inside":
						ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "goto", "3L_out");
						Pchar.hell_gate3 = "outside";

						PauseAllSounds();//stops music
						locations[FindLocation("BB_burning_cave")].type = "silent_burning_cave";
						PostEvent("LoadSceneSound", 0.1);
						PlaySound("AMBIENT\JAIL\jail_door2.wav");

						LAi_QuestDelay("hell_gate3L_start", 0.1);
					break;
				}
			}
		break;

		case "to_gate3L_back":
			ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "quest", "gate3L_back");
			
			LAi_SetActorType(characterFromID("devil_guard6"));
			LAi_ActorDialog(characterFromID("devil_guard6"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("devil_guard6"));
			Characters[GetCharacterIndex("devil_guard6")].dialog.CurrentNode  = "password";			
		break;

		case "hell_gate3R_start":
			pchar.quest.hell_gate3R.win_condition.l1 = "locator";
			pchar.quest.hell_gate3R.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate3R.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate3R.win_condition.l1.locator = "gate3R";
			pchar.quest.hell_gate3R.win_condition = "hell_gate3R";
		break;

		case "hell_gate3R":
			if(CheckAttribute(Pchar, "hell_gate3"))
			{
				switch(Pchar.hell_gate3)
				{
					case "locked":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate3R_start", 0.1);
						LAi_QuestDelay("to_gate3R_back", 0.2);
					break;

					case "outside":
						ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "goto", "3R_in");
						Pchar.hell_gate3 = "inside";

						PauseAllSounds();//stops music
						locations[FindLocation("BB_burning_cave")].type = "burning_cave";
						PostEvent("LoadSceneSound", 0.1);
						PlaySound("AMBIENT\JAIL\jail_door2.wav");

						LAi_QuestDelay("hell_gate3R_start", 0.1);
					break;

					case "inside":
						ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "goto", "3R_out");
						Pchar.hell_gate3 = "outside";

						PauseAllSounds();//stops music
						locations[FindLocation("BB_burning_cave")].type = "silent_burning_cave";
						PostEvent("LoadSceneSound", 0.1);
						PlaySound("AMBIENT\JAIL\jail_door2.wav");

						LAi_QuestDelay("hell_gate3R_start", 0.1);
					break;
				}
			}	
		break;

		case "to_gate3R_back":
			ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "quest", "gate3R_back");
			
			LAi_SetActorType(characterFromID("devil_guard5"));
			LAi_ActorDialog(characterFromID("devil_guard5"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("devil_guard5"));
			Characters[GetCharacterIndex("devil_guard5")].dialog.CurrentNode  = "password";
		break;
	
	//.................................................................................................

		case "hell_gate4M_start":
			pchar.quest.hell_gate4M.win_condition.l1 = "locator";
			pchar.quest.hell_gate4M.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate4M.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate4M.win_condition.l1.locator = "gate4M";
			pchar.quest.hell_gate4M.win_condition = "hell_gate4M";
		break;

		case "hell_gate4M":
			if(CheckAttribute(Pchar, "hell_gate4"))
			{
				switch(Pchar.hell_gate4)
				{
					case "locked":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate4M_start", 0.1);
						LAi_QuestDelay("to_gate4M_back", 0.2);
					break;

					case "password":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate4M_start", 0.1);
						LAi_QuestDelay("to_gate4M_back", 0.2);		//dialog
					break;

					case "search_gift":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate4M_start", 0.1);
						LAi_QuestDelay("to_gate4M_back", 0.2);
					break;

					case "done":
						//nothing happens, no more checkpoints
					break;
				}
			}
		break;

		case "to_gate4M_back":
			ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "quest", "gate4M_back");

			LAi_SetActorType(characterFromID("devil_guard4"));
			LAi_ActorDialog(characterFromID("devil_guard4"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("devil_guard4"));
			if(CheckAttribute(Pchar, "hell_gate4"))
			{
				switch(Pchar.hell_gate4)
				{
					case "locked": Characters[GetCharacterIndex("devil_guard4")].dialog.CurrentNode  = "password"; break;
					case "password": Characters[GetCharacterIndex("devil_guard4")].dialog.CurrentNode  = "bribing"; break;
					case "search_gift": Characters[GetCharacterIndex("devil_guard4")].dialog.CurrentNode  = "black_magic"; break;
				}
			}
		break;

		case "hell_gate4L_start":
			pchar.quest.hell_gate4L.win_condition.l1 = "locator";
			pchar.quest.hell_gate4L.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate4L.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate4L.win_condition.l1.locator = "gate4L";
			pchar.quest.hell_gate4L.win_condition = "hell_gate4L";
		break;

		case "hell_gate4L":
			if(CheckAttribute(Pchar, "hell_gate4"))
			{
				switch(Pchar.hell_gate4)
				{
					case "locked":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate4L_start", 0.1);
						LAi_QuestDelay("to_gate4L_back", 0.2);
					break;

					case "password":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate4L_start", 0.1);
						LAi_QuestDelay("to_gate4L_back", 0.2);		//dialog
					break;

					case "search_gift":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate4L_start", 0.1);
						LAi_QuestDelay("to_gate4L_back", 0.2);
					break;

					case "done":
						//nothing happens, no more checkpoints
					break;
				}
			}
		break;

		case "to_gate4L_back":
			ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "quest", "gate4L_back");
			
			LAi_SetActorType(characterFromID("devil_guard3"));
			LAi_ActorDialog(characterFromID("devil_guard3"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("devil_guard3"));
			if(CheckAttribute(Pchar, "hell_gate4"))
			{
				switch(Pchar.hell_gate4)
				{
					case "locked": Characters[GetCharacterIndex("devil_guard3")].dialog.CurrentNode  = "password"; break;
					case "password": Characters[GetCharacterIndex("devil_guard3")].dialog.CurrentNode  = "bribing"; break;
					case "search_gift": Characters[GetCharacterIndex("devil_guard3")].dialog.CurrentNode  = "black_magic"; break;
				}
			}		
		break;

		case "hell_gate4R_start":
			pchar.quest.hell_gate4R.win_condition.l1 = "locator";
			pchar.quest.hell_gate4R.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_gate4R.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_gate4R.win_condition.l1.locator = "gate4R";
			pchar.quest.hell_gate4R.win_condition = "hell_gate4R";
		break;

		case "hell_gate4R":
			if(CheckAttribute(Pchar, "hell_gate4"))
			{
				switch(Pchar.hell_gate4)
				{
					case "locked":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate4R_start", 0.1);
						LAi_QuestDelay("to_gate4R_back", 0.2);
					break;

					case "password":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate4R_start", 0.1);
						LAi_QuestDelay("to_gate4R_back", 0.2);		//dialog
					break;

					case "search_gift":
						LAi_SetStayType(Pchar);
						PlaySound("INTERFACE\knock.wav");
						PlaySound("PEOPLE\step_echo.wav");

						LAi_QuestDelay("hell_gate4R_start", 0.1);
						LAi_QuestDelay("to_gate4R_back", 0.2);
					break;

					case "done":
						//nothing happens, no more checkpoints
					break;
				}
			}	
		break;

		case "to_gate4R_back":
			ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "quest", "gate4R_back");
			
			LAi_SetActorType(characterFromID("devil_guard4"));
			LAi_ActorDialog(characterFromID("devil_guard4"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("devil_guard4"));
			if(CheckAttribute(Pchar, "hell_gate4"))
			{
				switch(Pchar.hell_gate4)
				{
					case "locked": Characters[GetCharacterIndex("devil_guard4")].dialog.CurrentNode  = "password"; break;
					case "password": Characters[GetCharacterIndex("devil_guard4")].dialog.CurrentNode  = "bribing"; break;
					case "search_gift": Characters[GetCharacterIndex("devil_guard4")].dialog.CurrentNode  = "black_magic"; break;
				}
			}
		break;

		case "gift_black_magic":
			LAi_SetStayType(Pchar);
			PlaySound("INTERFACE\book_close.wav");
			TakeItemFromCharacter(Pchar, "animists_amulet"); TakeItemFromCharacter(Pchar, "book62");

			LAi_QuestDelay("gift_black_magicA", 1.0);
		break;

		case "gift_black_magicA":
			PlaySound("INTERFACE\key_unlock2.wav");
			LAi_SetStayType(Pchar);
			Pchar.hell_gate4 = "done";
		
			Locations[FindLocation("BB_burning_cave")].models.always.locators = "locator3_GD_open";
			locations[FindLocation("BB_burning_cave")].models.day.charactersPatch = "walk_patch_LONG";
			locations[FindLocation("BB_burning_cave")].models.night.charactersPatch = "walk_patch_LONG";

			LAi_QuestDelay("gift_black_magicB", 1.0);
		break;

		case "gift_black_magicB":
			Locations[FindLocation("BB_burning_cave")].image = "";
			DoQuestReloadToLocation("BB_burning_cave", "quest", "gate4M_back", "gift_black_magicC");
		break;

		case "gift_black_magicC":
			PlaySound("INTERFACE\shelf_open.wav");
			LAi_SetPlayerType(Pchar);
		break;

	//.................................................................................................

		case "hell_gate5M":
			LAi_QuestDelay("gate5_small_radius", 0.001);

			pchar.quest.burning_cave_start5.win_condition.l1 = "locator";
			pchar.quest.burning_cave_start5.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.burning_cave_start5.win_condition.l1.locator_group = "goto";
			pchar.quest.burning_cave_start5.win_condition.l1.locator = "hole1";
			pchar.quest.burning_cave_start5.win_condition = "burning_cave_start5";

			if(CheckAttribute(Pchar, "hell_gate5"))
			{
				switch(Pchar.hell_gate5)
				{
					case "locked":
						LAi_SetStayType(Pchar);
		
						LAi_QuestDelay("to_gate5M_back", 0.2);
					break;

					case "password":
						LAi_SetStayType(Pchar);

						LAi_QuestDelay("to_gate5M_back", 0.2);		//dialog
					break;

					case "search_gift":
						LAi_SetStayType(Pchar);

						LAi_QuestDelay("to_gate5M_back", 0.2);
					break;

					case "done":
						//nothing happens, no more checkpoints
					break;
				}
			}
		break;

		case "to_gate5M_back":
			LAi_SetActorType(characterFromID("devil_guard12"));
			LAi_ActorDialog(characterFromID("devil_guard12"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("devil_guard12"));
			if(CheckAttribute(Pchar, "hell_gate5"))
			{
				switch(Pchar.hell_gate5)
				{
					case "locked": Characters[GetCharacterIndex("devil_guard12")].dialog.CurrentNode  = "password"; break;
					case "password": Characters[GetCharacterIndex("devil_guard12")].dialog.CurrentNode  = "bribing"; break;
					case "search_gift": Characters[GetCharacterIndex("devil_guard12")].dialog.CurrentNode  = "contracts"; break;
				}
			}
		break;

		case "hell_gate5L":
			LAi_QuestDelay("gate5_small_radius", 0.001);

			pchar.quest.burning_cave_start5.win_condition.l1 = "locator";
			pchar.quest.burning_cave_start5.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.burning_cave_start5.win_condition.l1.locator_group = "goto";
			pchar.quest.burning_cave_start5.win_condition.l1.locator = "hole1";
			pchar.quest.burning_cave_start5.win_condition = "burning_cave_start5";

			if(CheckAttribute(Pchar, "hell_gate5"))
			{
				switch(Pchar.hell_gate5)
				{
					case "locked":
						LAi_SetStayType(Pchar);
			
						LAi_QuestDelay("to_gate5L_back", 0.2);
					break;

					case "password":
						LAi_SetStayType(Pchar);

						LAi_QuestDelay("to_gate5L_back", 0.2);		//dialog
					break;

					case "search_gift":
						LAi_SetStayType(Pchar);

						LAi_QuestDelay("to_gate5L_back", 0.2);
					break;

					case "done":
						//nothing happens, no more checkpoints
					break;
				}
			}
		break;

		case "to_gate5L_back":
			LAi_SetActorType(characterFromID("devil_guard7"));
			LAi_ActorDialog(characterFromID("devil_guard7"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("devil_guard7"));
			if(CheckAttribute(Pchar, "hell_gate5"))
			{
				switch(Pchar.hell_gate5)
				{
					case "locked": Characters[GetCharacterIndex("devil_guard7")].dialog.CurrentNode  = "password"; break;
					case "password": Characters[GetCharacterIndex("devil_guard7")].dialog.CurrentNode  = "bribing"; break;
					case "search_gift": Characters[GetCharacterIndex("devil_guard7")].dialog.CurrentNode  = "contracts"; break;
				}
			}		
		break;

		case "hell_gate5LL":
			LAi_QuestDelay("gate5_small_radius", 0.001);

			pchar.quest.burning_cave_start5.win_condition.l1 = "locator";
			pchar.quest.burning_cave_start5.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.burning_cave_start5.win_condition.l1.locator_group = "goto";
			pchar.quest.burning_cave_start5.win_condition.l1.locator = "hole1";
			pchar.quest.burning_cave_start5.win_condition = "burning_cave_start5";

			if(CheckAttribute(Pchar, "hell_gate5"))
			{
				switch(Pchar.hell_gate5)
				{
					case "locked":
						LAi_SetStayType(Pchar);
			
						LAi_QuestDelay("to_gate5LL_back", 0.2);
					break;

					case "password":
						LAi_SetStayType(Pchar);

						LAi_QuestDelay("to_gate5LL_back", 0.2);		//dialog
					break;

					case "search_gift":
						LAi_SetStayType(Pchar);
						
						LAi_QuestDelay("to_gate5LL_back", 0.2);
					break;

					case "done":
						//nothing happens, no more checkpoints
					break;
				}
			}
		break;

		case "to_gate5LL_back":
			LAi_SetActorType(characterFromID("devil_guard7"));
			LAi_ActorDialog(characterFromID("devil_guard7"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("devil_guard7"));
			if(CheckAttribute(Pchar, "hell_gate5"))
			{
				switch(Pchar.hell_gate5)
				{
					case "locked": Characters[GetCharacterIndex("devil_guard7")].dialog.CurrentNode  = "password"; break;
					case "password": Characters[GetCharacterIndex("devil_guard7")].dialog.CurrentNode  = "bribing"; break;
					case "search_gift": Characters[GetCharacterIndex("devil_guard7")].dialog.CurrentNode  = "contracts"; break;
				}
			}		
		break;

		case "hell_gate5R":
			LAi_QuestDelay("gate5_small_radius", 0.001);

			pchar.quest.burning_cave_start5.win_condition.l1 = "locator";
			pchar.quest.burning_cave_start5.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.burning_cave_start5.win_condition.l1.locator_group = "goto";
			pchar.quest.burning_cave_start5.win_condition.l1.locator = "hole1";
			pchar.quest.burning_cave_start5.win_condition = "burning_cave_start5";

			if(CheckAttribute(Pchar, "hell_gate5"))
			{
				switch(Pchar.hell_gate5)
				{
					case "locked":
						LAi_SetStayType(Pchar);
				
						LAi_QuestDelay("to_gate5R_back", 0.2);
					break;

					case "password":
						LAi_SetStayType(Pchar);

						LAi_QuestDelay("to_gate5R_back", 0.2);		//dialog
					break;

					case "search_gift":
						LAi_SetStayType(Pchar);
					
						LAi_QuestDelay("to_gate5R_back", 0.2);
					break;

					case "done":
						//nothing happens, no more checkpoints
					break;
				}
			}	
		break;

		case "to_gate5R_back":
			LAi_SetActorType(characterFromID("devil_guard12"));
			LAi_ActorDialog(characterFromID("devil_guard12"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("devil_guard12"));
			if(CheckAttribute(Pchar, "hell_gate5"))
			{
				switch(Pchar.hell_gate5)
				{
					case "locked": Characters[GetCharacterIndex("devil_guard12")].dialog.CurrentNode  = "password"; break;
					case "password": Characters[GetCharacterIndex("devil_guard12")].dialog.CurrentNode  = "bribing"; break;
					case "search_gift": Characters[GetCharacterIndex("devil_guard12")].dialog.CurrentNode  = "contracts"; break;
				}
			}
		break;

		case "hell_gate5RR":
			LAi_QuestDelay("gate5_small_radius", 0.001);

			pchar.quest.burning_cave_start5.win_condition.l1 = "locator";
			pchar.quest.burning_cave_start5.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.burning_cave_start5.win_condition.l1.locator_group = "goto";
			pchar.quest.burning_cave_start5.win_condition.l1.locator = "hole1";
			pchar.quest.burning_cave_start5.win_condition = "burning_cave_start5";

			if(CheckAttribute(Pchar, "hell_gate5"))
			{
				switch(Pchar.hell_gate5)
				{
					case "locked":
						LAi_SetStayType(Pchar);
				
						LAi_QuestDelay("to_gate5RR_back", 0.2);
					break;

					case "password":
						LAi_SetStayType(Pchar);

						LAi_QuestDelay("to_gate5RR_back", 0.2);		//dialog
					break;

					case "search_gift":
						LAi_SetStayType(Pchar);

						LAi_QuestDelay("to_gate5RR_back", 0.2);
					break;

					case "done":
						//nothing happens, no more checkpoints
					break;
				}
			}	
		break;

		case "to_gate5RR_back":
			LAi_SetActorType(characterFromID("devil_guard12"));
			LAi_ActorDialog(characterFromID("devil_guard12"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("devil_guard12"));
			if(CheckAttribute(Pchar, "hell_gate5"))
			{
				switch(Pchar.hell_gate5)
				{
					case "locked": Characters[GetCharacterIndex("devil_guard12")].dialog.CurrentNode  = "password"; break;
					case "password": Characters[GetCharacterIndex("devil_guard12")].dialog.CurrentNode  = "bribing"; break;
					case "search_gift": Characters[GetCharacterIndex("devil_guard12")].dialog.CurrentNode  = "contracts"; break;
				}
			}
		break;
	
		case "gift_contracts1":
			LAi_SetActorType(CharacterFromID("devil_guard12"));	
			LAi_ActorTurnToLocator(CharacterFromID("devil_guard12"), "goto", "stairs1");

			LAi_QuestDelay("gift_contracts2", 1.0);
		break;

		case "gift_contracts2":
			PlaySound("INTERFACE\key_unlock2.wav");

			LAi_QuestDelay("gift_contracts3", 1.0);
		break;

		case "gift_contracts3":
			PlaySound("PEOPLE\teleport.wav");
			ChangeCharacterAddressGroup(characterFromID("devil_guard7"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("devil_guard8"), "none", "", "");

			LAi_QuestDelay("gift_contracts4", 0.5);
		break;

		case "gift_contracts4":
			PlaySound("PEOPLE\teleport.wav");
			ChangeCharacterAddressGroup(characterFromID("devil_guard12"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("devil_guard9"), "none", "", "");

			LAi_QuestDelay("gift_contracts5", 1.0);
		break;

		case "gift_contracts5":
			Locations[FindLocation("BB_burning_cave")].models.always.locators = "locator_high";
			locations[FindLocation("BB_burning_cave")].models.day.charactersPatch = "walk_patch_HIGH";
			locations[FindLocation("BB_burning_cave")].models.night.charactersPatch = "walk_patch_HIGH";

			Locations[FindLocation("BB_burning_cave")].image = "";
			DoQuestReloadToLocation("BB_burning_cave", "goto", "high1", "hell_high");
		break;

		case "hell_high":
			ChangeCharacterAddressGroup(characterFromID("devil"), "bb_burning_cave", "goto", "test");
			EquipCharacterByItem(pchar, "snakewand");
			EquipCharacterByItem(pchar, "pistolcenserD");

			PauseAllSounds();//stops music
			locations[FindLocation("BB_burning_cave")].type = "silent_burning_cave";
			PostEvent("LoadSceneSound", 0.1);
	
			LAi_QuestDelay("pchar_ohoh", 0.2);
			LAi_QuestDelay("hell_high1", 2.0);
			LAi_QuestDelay("bc_loading", 3.0);
		break;

		case "hell_high1":
			Php = LAi_GetCharacterHP(Pchar);
			if(Php < 80.0) LAi_SetHP(Pchar, 80.0, 80.0);

			DoQuickSave();

			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "high2", "hell_high2", 8.0);
		break;

		case "hell_high2":
			LAi_LocationFightDisable(&Locations[FindLocation("BB_burning_cave")], false);
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(Pchar, true);
			
			PlaySound("VOICE\ENGLISH\zombie_die.wav");
			PlaySound("VOICE\ENGLISH\zombie_die.wav");
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("hell_high3", 1.0);
		break;

		case "hell_high3":
			LAi_SetActorType(characterFromID("devil"));
			LAi_ActorAttack(CharacterFromID("devil"), Pchar, "");

			LAi_QuestDelay("Pyle_dead_check", 0.5);
		break;

		case "Pyle_dead_check":
			if(Locations[FindLocation("BB_burning_cave")].models.always.locators == "locator_high")
			{
				Php = LAi_GetCharacterHP(Pchar);
				if(Php == 0) 
				{
					LAi_KillCharacter(Pchar);
				}
				else LAi_QuestDelay("Pyle_dead_check", 0.5);
			}
		break;

	//.................................................................................................

		case "hell_backL1_start":
			LAi_SetPlayerType(Pchar);

			pchar.quest.hell_backL1.win_condition.l1 = "locator";
			pchar.quest.hell_backL1.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_backL1.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_backL1.win_condition.l1.locator = "holeL1";
			pchar.quest.hell_backL1.win_condition = "hell_backL1";
		break;

		case "hell_backL1":
			ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "goto", "backL1");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("hell_backL1_start", 0.2);
		break;

		case "hell_backR1_start":
			LAi_SetPlayerType(Pchar);

			pchar.quest.hell_backR1.win_condition.l1 = "locator";
			pchar.quest.hell_backR1.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_backR1.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_backR1.win_condition.l1.locator = "holeR1";
			pchar.quest.hell_backR1.win_condition = "hell_backR1";
		break;

		case "hell_backR1":
			ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "goto", "backR1");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("hell_backR1_start", 0.1);
		break;

		case "hell_backL2_start":
			pchar.quest.hell_backL2.win_condition.l1 = "locator";
			pchar.quest.hell_backL2.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_backL2.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_backL2.win_condition.l1.locator = "holeL2";
			pchar.quest.hell_backL2.win_condition = "hell_backL2";
		break;

		case "hell_backL2":
			ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "goto", "hole2");

			LAi_QuestDelay("hell_backL2_start", 0.1);
		break;

		case "hell_backR2_start":
			pchar.quest.hell_backR2.win_condition.l1 = "locator";
			pchar.quest.hell_backR2.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.hell_backR2.win_condition.l1.locator_group = "quest";
			pchar.quest.hell_backR2.win_condition.l1.locator = "holeR2";
			pchar.quest.hell_backR2.win_condition = "hell_backR2";
		break;

		case "hell_backR2":
			ChangeCharacterAddressGroup(Pchar, "bb_burning_cave", "goto", "hole2");

			LAi_QuestDelay("hell_backR2_start", 0.1);
		break;

	//.................................................................................................
		
		case "bc_ladder_stuck":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "bc_ladder_stuck";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "bc_ladder_enabled":
			PlaySound("PEOPLE\hammer_creak.wav");
			PlaySound("PEOPLE\hammer_creak.wav");
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box2", 0.0001);
			Locations[FindLocation("BB_burning_cave")].locators_radius.box.box2 = 0.0001;

			LAi_QuestDelay("bc_ladder_enabled1", 0.5);
		break;

		case "bc_ladder_enabled1":
			if(LAi_IsFightMode(Pchar))
			{
				LAi_SetPlayerType(Pchar);
				LAi_SetFightMode(PChar, false);
			}
			LAi_LocationFightDisable(&Locations[FindLocation("BB_burning_cave")], true);

			SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem4", 2.0);
			Locations[FindLocation("BB_burning_cave")].locators_radius.randitem.randitem4 = 2.0;

			LAi_QuestDelay("bc_ladder_check", 0.1);
		break;

		case "bc_ladder_check":
			if(CheckCharacterItem(Pchar,"ladder_very_big"))
			{
				PlaySound("PEOPLE\wood1.wav");
				GiveItem2Character(Pchar, "bladeladder2");
				EquipCharacterByItem(Pchar, "bladeladder2");
				TakeItemFromCharacter(Pchar, "ladder_very_big");
			}
			else
			{
				LAi_QuestDelay("bc_ladder_check", 0.5);//loop check
			}
		break;

		case "bc_ladder_check2":
			if(CheckCharacterItem(Pchar,"ladder_very_big"))
			{
				PlaySound("PEOPLE\wood1.wav");
				GiveItem2Character(Pchar, "bladeladder2");
				TakeItemFromCharacter(Pchar, "ladder_very_big");

				SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem11", 1.5);
				Locations[FindLocation("BB_burning_cave")].locators_radius.randitem.randitem11 = 1.5;
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box3", 0.0001);
				Locations[FindLocation("BB_burning_cave")].locators_radius.box.box3 = 0.0001;

				LAi_QuestDelay("bladechair_check2", 0.5);
			}
			else
			{
				LAi_QuestDelay("bc_ladder_check2", 0.5);//loop check
			}
		break;

		case "bc_cage_too_high":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "bc_cage_too_high";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "bc_cage_too_high_wrong":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "bc_cage_too_high_wrong";
			LAi_ActorSelfDialog(pchar, "");
		break;
	
		case "bc_loading":
			Locations[FindLocation("BB_burning_cave")].image = "loading\inside\cave.tga";
		break;

		case "bc_loading2":
			EquipCharacterByItem(Pchar, "bladeladder2");
			Locations[FindLocation("BB_burning_cave")].image = "loading\inside\cave.tga";
		break;

		case "bc_loading_topchest":
			locations[FindLocation(Pchar.location)].box9.items.contract1 = 1;
			locations[FindLocation(Pchar.location)].box9.items.contract2 = 1;
			locations[FindLocation(Pchar.location)].box9.items.contract3 = 1;
			locations[FindLocation(Pchar.location)].box9.items.BBDagger = 1;
			Locations[FindLocation("BB_burning_cave")].image = "loading\inside\cave.tga";
		break;

		case "bc_down_from_chair":
			PlaySound("PEOPLE\step_echo.wav");
			ChangeCharacterAddressGroup(Pchar, "BB_burning_cave", "goto", "at_box3");
		break;

		case "bc_down_from_ladder":
			PlaySound("PEOPLE\step_echo.wav");
			ChangeCharacterAddressGroup(Pchar, "BB_burning_cave", "goto", "at_box5");
		break;

		case "bc_down_from_wrong_ladder":
			PlaySound("PEOPLE\step_echo.wav");
			ChangeCharacterAddressGroup(Pchar, "BB_burning_cave", "goto", "at_box7");
			LAi_LocationFightDisable(&Locations[FindLocation("BB_burning_cave")], true);

			SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem19", 2.0);
			Locations[FindLocation("BB_burning_cave")].locators_radius.randitem.randitem19 = 2.0;
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box7", 0.0001);
			Locations[FindLocation("BB_burning_cave")].locators_radius.box.box7 = 0.0001;

			LAi_QuestDelay("bc_ladder_check2", 0.1);
		break;

		case "bc_down_from_top_chest":
			PlaySound("PEOPLE\step_echo.wav");
			ChangeCharacterAddressGroup(Pchar, "BB_burning_cave", "goto", "at_box7");
		break;

		case "turn_bc_box6":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "look_box6");

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "bc_ladder_enabled_again":
			if(GetAttribute(Pchar, "ladder_check") == "only_once")
			{
				//logit("STOPPED!!!");
				return;
			}
			else
			{
				//logit("FIRST TIME...");
				Pchar.ladder_check = "only_once";

				SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem15", 2.0);
				Locations[FindLocation("BB_burning_cave")].locators_radius.randitem.randitem15 = 2.0;
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box5", 0.0001);
				Locations[FindLocation("BB_burning_cave")].locators_radius.box.box5 = 0.0001;

				LAi_QuestDelay("bc_ladder_check", 0.1);
			}
		break;

		case "bladechair_check":
			if(CheckCharacterItem(Pchar,"chair"))
			{
				PlaySound("OBJECTS\DUEL\boom.wav");
				GiveItem2Character(Pchar, "bladechair");
				EquipCharacterByItem(Pchar, "bladechair");
				TakeItemFromCharacter(Pchar, "chair");
			}
			else
			{
				LAi_QuestDelay("bladechair_check", 0.5);//loop check
			}
		break;

		case "bladechair_check2":
			if(CheckCharacterItem(Pchar,"chair"))
			{
				PlaySound("OBJECTS\DUEL\boom.wav");
				GiveItem2Character(Pchar, "bladechair");
				EquipCharacterByItem(Pchar, "bladechair");
				TakeItemFromCharacter(Pchar, "chair");

				SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box7", 1.5);
				Locations[FindLocation("BB_burning_cave")].locators_radius.box.box7 = 1.5;
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem19", 0.0001);
				Locations[FindLocation("BB_burning_cave")].locators_radius.randitem.randitem19 = 0.0001;
			}
			else
			{
				LAi_QuestDelay("bladechair_check2", 0.5);//loop check
			}
		break;

	//.................................................................................................
		case "pchar_protection_off":
			pchar.protection = "off";
			logit("OFF");
			//PlaySound("OBJECTS\duel\shield.wav");
		break;

		case "count_snakewand_hits":
			if(CheckAttribute(Pchar, "snakewand_hits"))
			{
				switch (Pchar.snakewand_hits)
				{
					case "1":
						LAi_QuestDelay("pchar_1", 0.5);
					break;

					case "2":
						LAi_QuestDelay("pchar_2", 0.5);
					break;

					case "3":
						LAi_QuestDelay("pchar_3", 0.5);
					break;

					case "4":
						LAi_QuestDelay("pchar_4", 0.5);
					break;

					case "5":
						LAi_QuestDelay("pchar_5", 0.5);
					break;

					case "6":
						LAi_QuestDelay("pchar_6", 0.5);
					break;

					case "7":
						LAi_QuestDelay("pchar_7", 0.5);
					break;

					case "8":
						LAi_QuestDelay("pchar_8", 0.5);
					break;

					case "9":
						LAi_QuestDelay("devil_gives_up", 0.5);
						LAi_QuestDelay("pchar_9", 0.5);
					break;
				}
			}
		break;	

		case "devil_gives_up":
			LAi_SetFightMode(characterFromID("devil"), false);	
			LAi_SetActorType(characterFromID("devil"));
			LAi_ActorAfraid(CharacterFromID("devil"), CharacterFromID("devil"), false);
			LAi_LocationFightDisable(&Locations[FindLocation(Pchar.location)], true);	
	
			LAi_QuestDelay("devil_gives_up1", 1.0 );
		break;

		case "devil_gives_up1":
			LAi_SetFightMode(pchar, false);
			LAi_SetPlayerType(Pchar);

			GetCharacterPos(characterFromID("devil"), &u, &v, &w);
		
			PlaySound("OBJECTS\DUEL\rocket.wav");
			PlaySound("OBJECTS\DUEL\rocket.wav");
			PlaySound("OBJECTS\DUEL\wet_gunpowder.wav");
			PlaySound("OBJECTS\DUEL\wet_gunpowder.wav");
		
			CreateParticleSystem("fire_medium", u, v+1.5, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("waterfog_light", u, v+1.5, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("waterfog_light", u, v+1.5, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("waterfog_light", u, v+1.5, w, 0.0, 0.0, 0.0, sti(20) );

			Php = LAi_GetCharacterHP(Pchar);
			if(Php == 0) LAi_SetHP(Pchar, 5.0, 5.0);

			LAi_QuestDelay("devil_disappears", 0.4);
		break;

		case "devil_disappears":
			ChangeCharacterAddressGroup(CharacterFromID("devil"), "none", "", "");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("pchar_huh", 5.0);
			LAi_QuestDelay("pchar_yah", 8.0);
			LAi_QuestDelay("devil_disappears1", 12.0);
		break;
	
		case "devil_disappears1":
			PlaySound("VOICE\ENGLISH\c_brother21.wav");
			
			LAi_QuestDelay("devil_disappears2", 3.0);
		break;

		case "devil_disappears2":
			PlaySound("PEOPLE\transform.wav");

			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("stars_short" , u, v+1.5, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("stars_short" , u, v+1.0, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("stars_short" , u, v+0.5, w, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("stars_short" , u, v, w, 0.0, 0.0, 0.0, sti(20) );

			SetModel(PChar, "Skel4", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);
			LAi_SetImmortal(pchar, true);
			if(IsEquipCharacterByItem(Pchar, "ammobag2"))
			{
				RemoveCharacterEquip(Pchar, POUCH_ITEM_TYPE);
				TakeItemFromCharacter(Pchar, "ammobag2");
			}
			if(!CheckCharacterItem(Pchar,"ammobag1"))
			{
				GiveItem2Character(Pchar, "ammobag1");
			}
			RemoveCharacterEquip(Pchar, EQUIP3_ITEM_TYPE);	//bb_hatA2

			LAi_QuestDelay("devil_disappears3", 2.5);
		break;

		case "devil_disappears3":
			PlaySound("VOICE\ENGLISH\blaze_scream.wav");
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("devil_disappears4", 2.0);

			pchar.quest.Pyle_skelZ.win_condition.l1 = "locator";
			pchar.quest.Pyle_skelZ.win_condition.l1.location = "bb_burning_cave";
			pchar.quest.Pyle_skelZ.win_condition.l1.locator_group = "quest";
			pchar.quest.Pyle_skelZ.win_condition.l1.locator = "hell_fire";
			pchar.quest.Pyle_skelZ.win_condition = "Pyle_skelZ";
		break;

		case "devil_disappears4":
			PlaySound("AMBIENT\CRYPT\daemon2.wav");
			PlaySound("AMBIENT\CRYPT\daemon2.wav");

			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box10", 1.0);
			Locations[FindLocation("BB_burning_cave")].locators_radius.box.box10 = 1.0;

			Locations[FindLocation("BB_island1")].locators_radius.box.box1 = 0.0001;
			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Clear";

			SetCurrentTime(11.00, 0);
		break;

		case "Pyle_skelZ":
			LAi_SetStayType(Pchar);
			PlaySound("INTERFACE\fire_off.wav");
			PlaySound("INTERFACE\fire_off.wav");
			PlaySound("OBJECTS\SHIPCHARGE\bomb_lit.wav");
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("fort_fire" , u, v+0.5, w, 5.1, 4.0, 0.0, sti(20) );

			LAi_QuestDelay("Pyle_skelZ_1", 3.0);
			LAi_QuestDelay("Pchar_ooh", 3.0);
		break;

		case "Pyle_skelZ_1":
			SetModel(PChar, "SkelZ", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);


			LAi_SetPlayerType(Pchar);
		break;
//------------------------------------------------------------------------------------------------------------------------

		case "Pyle_skeleton":
			//LAi_QuestDelay("Pyle_skeleton1", 2.0);

		break;

//------------------------------------------------------------------------------------------------------------------------
		case "move_to_BB_hatch":
			PlaySound("VOICE\ENGLISH\blaze_hah.wav");

			LAi_QuestDelay("move_to_BB_hatch1", 1.5);
		break;

		case "move_to_BB_hatch1":
			PlaySound("PEOPLE\run_stone.wav");
			ChangeCharacterAddressGroup(Pchar, "BB_island2", "goto", "reload6");
			Pchar.BB_spyglass = "off";
			DoQuickSave();
		break;

		case "place_coin_BB_spyglass":
			if(Pchar.new.flag.sequence == 6) 
			{
				DeleteQuestHeader("KR_amulet");
				Locations[FindLocation("BB_island2")].image = "zoom_islet.tga";
				Pchar.boat.islet = "ready";
			}
			else Locations[FindLocation("BB_island2")].image = "zoom_archipelago.tga";

			DoQuestReloadToLocation("BB_island2", "goto", "spyglass", "place_coin_BB_spyglass1");
		break;

		case "place_coin_BB_spyglass1":
			if(Pchar.new.flag.sequence == 6) 
			{
				PlaySound("VOICE\ENGLISH\blaze_hah.wav");
			}
			else PlaySound("VOICE\ENGLISH\blaze_sigh.wav");

			Locations[FindLocation("BB_island2")].image = "Outside_Jungle_1.tga";	

			LAi_QuestDelay("place_coin_BB_spyglass2", 1.0);
		break;

		case "place_coin_BB_spyglass2":
			PlaySound("INTERFACE\took_item.wav");	

			LAi_QuestDelay("move_to_BB_hatch1", 1.0);
		break;

//------------------------------------------------------------------------------------------------------------------------

		case "start_BB_flag":
			Pchar.old.flag.sequence = 0;
			Pchar.new.flag.sequence = 0;
			pchar.tower.flag = "none";

	//LogIt("old_flag_sequence = " + Pchar.old.flag.sequence);
	//LogIt("new_flag_sequence = " + Pchar.new.flag.sequence);
		break;

		case "raise_BBflag":
		//	ref cmdr = CharacterFromID("Dante Siciliano");
			cmdr = CharacterFromID("Dante Siciliano");

			pchar_blade = GetCharacterEquipByGroup(PCHAR, BLADE_ITEM_TYPE);
			switch (pchar_blade)
			{
				case "bladeflag_pir":
					Pchar.special_flag = "off";
					CaptureTownForNation("Grand Turk", PIRATE);
					cmdr.nation = PIRATE; pchar.tower.flag = "pir";
					DeleteQuestHeader("KR_flagchest");
				break;

				case "bladeflag_pir2":
					Pchar.special_flag = "on";
					CaptureTownForNation("Grand_Turk", PIRATE);
					cmdr.nation = PIRATE; pchar.tower.flag = "pir2";
					cmdr.Flags.Pirate = 6; cmdr.Flags.Pirate.texture = 2;
					DeleteQuestHeader("KR_flagchest");
				break;

				case "bladeflag_HOL":
					Pchar.special_flag = "off";
					CaptureTownForNation("Grand Turk", HOLLAND);
					cmdr.nation = HOLLAND; pchar.tower.flag = "HOL";
					DeleteQuestHeader("KR_flagchest");
				break;

				case "bladeflag_ENG":
					Pchar.special_flag = "off";
					CaptureTownForNation("Grand Turk", ENGLAND);
					cmdr.nation = ENGLAND; pchar.tower.flag = "ENG";
					DeleteQuestHeader("KR_flagchest");
				break;

				case "bladeflag_FRA":
					Pchar.special_flag = "off";
					CaptureTownForNation("Grand Turk", FRANCE);
					cmdr.nation = FRANCE; pchar.tower.flag = "FRA";
					DeleteQuestHeader("KR_flagchest");
				break;

				case "bladeflag_POR":
					Pchar.special_flag = "off";
					CaptureTownForNation("Grand Turk", PORTUGAL);
					cmdr.nation = PORTUGAL; pchar.tower.flag = "POR";
					DeleteQuestHeader("KR_flagchest");

					if(Pchar.old.flag.sequence == 0) Pchar.new.flag.sequence = 1;
				break;
				
				case "bladeflag_SPA":
					Pchar.special_flag = "off";
					CaptureTownForNation("Grand Turk", SPAIN);
					cmdr.nation = SPAIN; pchar.tower.flag = "SPA";
					DeleteQuestHeader("KR_flagchest");
				break;

				case "bladeflag_PRE":
					Pchar.special_flag = "off";
					CaptureTownForNation("Grand Turk", PERSONAL_NATION);
					cmdr.nation = PERSONAL_NATION; pchar.tower.flag = "PRE";
					cmdr.Flags.Personal = 1; cmdr.Flags.Personal.texture = 4;
					DeleteQuestHeader("KR_flagchest");

					if(Pchar.old.flag.sequence == 0) Pchar.new.flag.sequence = 1;
				break;
		
				case "bladeflag_IRE":
					Pchar.special_flag = "off";
					CaptureTownForNation("Grand Turk", PERSONAL_NATION);
					cmdr.nation = PERSONAL_NATION; pchar.tower.flag = "IRE";
					cmdr.Flags.Personal = 2; cmdr.Flags.Personal.texture = 4;
					DeleteQuestHeader("KR_flagchest");
				break;
		
				case "bladeflag_SWE":
					CaptureTownForNation("Grand Turk", PERSONAL_NATION);
					cmdr.nation = PERSONAL_NATION; pchar.tower.flag = "SWE";
					cmdr.Flags.Personal = 3; cmdr.Flags.Personal.texture = 4;	
					DeleteQuestHeader("KR_flagchest");
				break;

				case "bladeflag_HOL2":
					Pchar.special_flag = "off";
					CaptureTownForNation("Grand Turk", PERSONAL_NATION);
					cmdr.nation = PERSONAL_NATION; pchar.tower.flag = "HO2";
					cmdr.Flags.Personal = 4; cmdr.Flags.Personal.texture = 4;
					DeleteQuestHeader("KR_flagchest");	
				break;

				case "bladeflag_AME":
					Pchar.special_flag = "off";
					CaptureTownForNation("Grand Turk", PERSONAL_NATION);
					cmdr.nation = PERSONAL_NATION; pchar.tower.flag = "AME";
					cmdr.Flags.Personal = 5; cmdr.Flags.Personal.texture = 4;
					DeleteQuestHeader("KR_flagchest");
				break;
			
				case "bladeflag_SPA2":
					Pchar.special_flag = "off";
					CaptureTownForNation("Grand Turk", PERSONAL_NATION);
					cmdr.nation = PERSONAL_NATION; pchar.tower.flag = "SP2";
					cmdr.Flags.Personal = 6; cmdr.Flags.Personal.texture = 4;
					DeleteQuestHeader("KR_flagchest");
				break;
			}

			Towns[GetTownIndex("Grand Turk")].gov = "Dante Siciliano";
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);

			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "pir") TakeItemFromCharacter(Pchar, "bladeflag_pir");
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "pir2") TakeItemFromCharacter(Pchar, "bladeflag_pir2");
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "HOL") TakeItemFromCharacter(Pchar, "bladeflag_HOL");
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "ENG") TakeItemFromCharacter(Pchar, "bladeflag_ENG");
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "FRA") TakeItemFromCharacter(Pchar, "bladeflag_FRA");
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "POR") TakeItemFromCharacter(Pchar, "bladeflag_POR");
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "SPA") TakeItemFromCharacter(Pchar, "bladeflag_SPA");
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "PRE") TakeItemFromCharacter(Pchar, "bladeflag_PRE");
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "IRE") TakeItemFromCharacter(Pchar, "bladeflag_IRE");
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "SWE") TakeItemFromCharacter(Pchar, "bladeflag_SWE");
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "HO2") TakeItemFromCharacter(Pchar, "bladeflag_HOL2");
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "AME") TakeItemFromCharacter(Pchar, "bladeflag_AME");
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "SP2") TakeItemFromCharacter(Pchar, "bladeflag_SPA2");

			if(!CheckCharacterItem(Pchar,"bladeX4")) GiveItem2Character(Pchar, "bladeX4");
			EquipCharacterByItem(Pchar, "bladeX4");

			Locations[FindLocation("BB_island2")].image = "";
			Locations[FindLocation(Pchar.location)].models.always.locators = "jungle01_l_JRH_F";
			
			DoQuestReloadToLocation("BB_island2", "goto", "flagpole", "change_BBflag_A");
		break;
//------------------------------------------------------------------------------------------------------------------------
		case "change_BBflag":
			cmdr = CharacterFromID("Dante Siciliano");

			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "pir") Pchar.BB_old_flag = "pir";
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "pir2") Pchar.BB_old_flag = "pir2";
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "HOL") Pchar.BB_old_flag = "HOL";
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "ENG") Pchar.BB_old_flag = "ENG";
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "FRA") Pchar.BB_old_flag = "FRA";
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "POR") Pchar.BB_old_flag = "POR";
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "SPA") Pchar.BB_old_flag = "SPA";
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "PRE") Pchar.BB_old_flag = "PRE";
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "IRE") Pchar.BB_old_flag = "IRE";
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "SWE") Pchar.BB_old_flag = "SWE";
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "HO2") Pchar.BB_old_flag = "HO2";
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "AME") Pchar.BB_old_flag = "AME";
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "SP2") Pchar.BB_old_flag = "SP2";
		
			pchar_blade = GetCharacterEquipByGroup(PCHAR, BLADE_ITEM_TYPE);
			switch (pchar_blade)
			{
				case "bladeflag_pir":
					Pchar.special_flag = "off";
					CaptureTownForNation("Grand Turk", PIRATE);
					cmdr.nation = PIRATE; pchar.tower.flag = "pir";

					if(Pchar.old.flag.sequence == 2) 
					{
						Pchar.new.flag.sequence = 3;
					}
					else 
					{
						Pchar.old.flag.sequence = 0;
						Pchar.new.flag.sequence = 0;
					}
				break;
			
				case "bladeflag_pir2":
					//needed as a reset when personal is going down & teach is going up
					Pchar.special_flag = "off";
					CaptureTownForNation("Grand Turk", PIRATE);
					cmdr.nation = PIRATE; pchar.tower.flag = "pir";

					Pchar.special_flag = "on";
					CaptureTownForNation("Grand_Turk", PIRATE);
					cmdr.nation = PIRATE; pchar.tower.flag = "pir2";
					cmdr.Flags.Pirate = 6; cmdr.Flags.Pirate.texture = 2;

					if(Pchar.old.flag.sequence == 4) 
					{
						Pchar.new.flag.sequence = 5;
					}
					else 
					{
						Pchar.old.flag.sequence = 0;
						Pchar.new.flag.sequence = 0;
					}
				break;

				case "bladeflag_HOL":
					Pchar.special_flag = "off";
					CaptureTownForNation("Grand Turk", HOLLAND);
					cmdr.nation = HOLLAND; pchar.tower.flag = "HOL";

					Pchar.old.flag.sequence = 0;
					Pchar.new.flag.sequence = 0;
				break;

				case "bladeflag_ENG":
					Pchar.special_flag = "off";
					CaptureTownForNation("Grand Turk", ENGLAND);
					cmdr.nation = ENGLAND; pchar.tower.flag = "ENG";

					if(Pchar.old.flag.sequence == 5) 
					{
						Pchar.new.flag.sequence = 6;
					}
					else 
					{
						Pchar.old.flag.sequence = 0;
						Pchar.new.flag.sequence = 0;
					}
				break;

				case "bladeflag_FRA":
					Pchar.special_flag = "off";
					CaptureTownForNation("Grand Turk", FRANCE);
					cmdr.nation = FRANCE; pchar.tower.flag = "FRA";

					Pchar.old.flag.sequence = 0;
					Pchar.new.flag.sequence = 0;
				break;

				case "bladeflag_POR":
					Pchar.special_flag = "off";
					CaptureTownForNation("Grand Turk", PORTUGAL);
					cmdr.nation = PORTUGAL; pchar.tower.flag = "POR";

					if(Pchar.old.flag.sequence == 0) 
					{
						Pchar.new.flag.sequence = 1;
					}
					else 
					{
						Pchar.old.flag.sequence = 0;
						Pchar.new.flag.sequence = 0;
					}
				break;
				
				case "bladeflag_SPA":
					Pchar.special_flag = "off";
					CaptureTownForNation("Grand Turk", SPAIN);
					cmdr.nation = SPAIN; pchar.tower.flag = "SPA";

					Pchar.old.flag.sequence = 0;
					Pchar.new.flag.sequence = 0;
				break;

				case "bladeflag_PRE":
					Pchar.special_flag = "off";
					CaptureTownForNation("Grand Turk", PERSONAL_NATION);
					cmdr.nation = PERSONAL_NATION; pchar.tower.flag = "PRE";
					cmdr.Flags.Personal = 1; cmdr.Flags.Personal.texture = 4;

					if(Pchar.old.flag.sequence == 0) 
					{
						Pchar.new.flag.sequence = 1;
					}
					else 
					{
						Pchar.old.flag.sequence = 0;
						Pchar.new.flag.sequence = 0;
					}
				break;

				case "bladeflag_IRE":
					Pchar.special_flag = "off";
					CaptureTownForNation("Grand Turk", PERSONAL_NATION);
					cmdr.nation = PERSONAL_NATION; pchar.tower.flag = "IRE";
					cmdr.Flags.Personal = 2; cmdr.Flags.Personal.texture = 4;

					if(Pchar.old.flag.sequence == 1) 
					{
						Pchar.new.flag.sequence = 2;
					}
					else 
					{
						Pchar.old.flag.sequence = 0;
						Pchar.new.flag.sequence = 0;
					}	
				break;

				case "bladeflag_SWE":
					Pchar.special_flag = "off";
					CaptureTownForNation("Grand Turk", PERSONAL_NATION);
					cmdr.nation = PERSONAL_NATION; pchar.tower.flag = "SWE";
					cmdr.Flags.Personal = 3; cmdr.Flags.Personal.texture = 4;

					Pchar.old.flag.sequence = 0;
					Pchar.new.flag.sequence = 0;	
				break;

				case "bladeflag_HOL2":
					Pchar.special_flag = "off";
					CaptureTownForNation("Grand Turk", PERSONAL_NATION);
					cmdr.nation = PERSONAL_NATION; pchar.tower.flag = "HO2";
					cmdr.Flags.Personal = 4; cmdr.Flags.Personal.texture = 4;

					Pchar.old.flag.sequence = 0;
					Pchar.new.flag.sequence = 0;	
				break;

				case "bladeflag_AME":
					Pchar.special_flag = "off";
					CaptureTownForNation("Grand Turk", PERSONAL_NATION);
					cmdr.nation = PERSONAL_NATION; pchar.tower.flag = "AME";
					cmdr.Flags.Personal = 5; cmdr.Flags.Personal.texture = 4;

					if(Pchar.old.flag.sequence == 3) 
					{
						Pchar.new.flag.sequence = 4;
					}
					else 
					{
						Pchar.old.flag.sequence = 0;
						Pchar.new.flag.sequence = 0;
					}	
				break;
			
				case "bladeflag_SPA2":
					Pchar.special_flag = "off";
					CaptureTownForNation("Grand Turk", PERSONAL_NATION);
					cmdr.nation = PERSONAL_NATION; pchar.tower.flag = "SP2";
					cmdr.Flags.Personal = 6; cmdr.Flags.Personal.texture = 4;
				
					Pchar.old.flag.sequence = 0;
					Pchar.new.flag.sequence = 0;
				break;
			}

			Towns[GetTownIndex("Grand Turk")].gov = "Dante Siciliano";
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);

			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "pir") TakeItemFromCharacter(Pchar, "bladeflag_pir");
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "pir2") TakeItemFromCharacter(Pchar, "bladeflag_pir2");
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "HOL") TakeItemFromCharacter(Pchar, "bladeflag_HOL");
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "ENG") TakeItemFromCharacter(Pchar, "bladeflag_ENG");
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "FRA") TakeItemFromCharacter(Pchar, "bladeflag_FRA");
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "POR") TakeItemFromCharacter(Pchar, "bladeflag_POR");
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "SPA") TakeItemFromCharacter(Pchar, "bladeflag_SPA");
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "PRE") TakeItemFromCharacter(Pchar, "bladeflag_PRE");
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "IRE") TakeItemFromCharacter(Pchar, "bladeflag_IRE");
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "SWE") TakeItemFromCharacter(Pchar, "bladeflag_SWE");
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "HO2") TakeItemFromCharacter(Pchar, "bladeflag_HOL2");
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "AME") TakeItemFromCharacter(Pchar, "bladeflag_AME");
			if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "SP2") TakeItemFromCharacter(Pchar, "bladeflag_SPA2");

			if(CheckAttribute(Pchar, "BB_old_flag") && Pchar.BB_old_flag == "pir") 
			{ Pchar.BB_old_flag = "none"; GiveItem2Character(Pchar, "bladeflag_pir"); EquipCharacterByItem(Pchar, "bladeflag_pir"); }

			if(CheckAttribute(Pchar, "BB_old_flag") && Pchar.BB_old_flag == "pir2") 
			{ Pchar.BB_old_flag = "none"; GiveItem2Character(Pchar, "bladeflag_pir2"); EquipCharacterByItem(Pchar, "bladeflag_pir2"); }

			if(CheckAttribute(Pchar, "BB_old_flag") && Pchar.BB_old_flag == "HOL") 
			{ Pchar.BB_old_flag = "none"; GiveItem2Character(Pchar, "bladeflag_HOL"); EquipCharacterByItem(Pchar, "bladeflag_HOL"); }

			if(CheckAttribute(Pchar, "BB_old_flag") && Pchar.BB_old_flag == "ENG") 
			{ Pchar.BB_old_flag = "none"; GiveItem2Character(Pchar, "bladeflag_ENG"); EquipCharacterByItem(Pchar, "bladeflag_ENG"); }

			if(CheckAttribute(Pchar, "BB_old_flag") && Pchar.BB_old_flag == "FRA") 
			{ Pchar.BB_old_flag = "none"; GiveItem2Character(Pchar, "bladeflag_FRA"); EquipCharacterByItem(Pchar, "bladeflag_FRA"); }

			if(CheckAttribute(Pchar, "BB_old_flag") && Pchar.BB_old_flag == "POR") 
			{ Pchar.BB_old_flag = "none"; GiveItem2Character(Pchar, "bladeflag_POR"); EquipCharacterByItem(Pchar, "bladeflag_POR"); }

			if(CheckAttribute(Pchar, "BB_old_flag") && Pchar.BB_old_flag == "SPA") 
			{ Pchar.BB_old_flag = "none"; GiveItem2Character(Pchar, "bladeflag_SPA"); EquipCharacterByItem(Pchar, "bladeflag_SPA"); }

			if(CheckAttribute(Pchar, "BB_old_flag") && Pchar.BB_old_flag == "PRE") 
			{ Pchar.BB_old_flag = "none"; GiveItem2Character(Pchar, "bladeflag_PRE"); EquipCharacterByItem(Pchar, "bladeflag_PRE"); }

			if(CheckAttribute(Pchar, "BB_old_flag") && Pchar.BB_old_flag == "IRE") 
			{ Pchar.BB_old_flag = "none"; GiveItem2Character(Pchar, "bladeflag_IRE"); EquipCharacterByItem(Pchar, "bladeflag_IRE"); }

			if(CheckAttribute(Pchar, "BB_old_flag") && Pchar.BB_old_flag == "SWE") 
			{ Pchar.BB_old_flag = "none"; GiveItem2Character(Pchar, "bladeflag_SWE"); EquipCharacterByItem(Pchar, "bladeflag_SWE"); }

			if(CheckAttribute(Pchar, "BB_old_flag") && Pchar.BB_old_flag == "HO2") 
			{ Pchar.BB_old_flag = "none"; GiveItem2Character(Pchar, "bladeflag_HOL2"); EquipCharacterByItem(Pchar, "bladeflag_HOL2"); }

			if(CheckAttribute(Pchar, "BB_old_flag") && Pchar.BB_old_flag == "AME") 
			{ Pchar.BB_old_flag = "none"; GiveItem2Character(Pchar, "bladeflag_AME"); EquipCharacterByItem(Pchar, "bladeflag_AME"); }

			if(CheckAttribute(Pchar, "BB_old_flag") && Pchar.BB_old_flag == "SP2") 
			{ Pchar.BB_old_flag = "none"; GiveItem2Character(Pchar, "bladeflag_SPA2"); EquipCharacterByItem(Pchar, "bladeflag_SPA2"); }
		
			Locations[FindLocation("BB_island2")].image = "";
			Locations[FindLocation(Pchar.location)].models.always.locators = "jungle01_l_JRH_F";
			
			DoQuestReloadToLocation("BB_island2", "goto", "flagpole", "change_BBflag_A");
		break;

		case "change_BBflag_A":
			Locations[FindLocation("BB_island2")].image = "Outside_Jungle_1.tga";
			PlaySound("PEOPLE\clothes1.wav");
			LAi_SetFightMode(Pchar, false);
			LAi_SetStayType(Pchar);

	//LogIt("old_flag_sequence = " + Pchar.old.flag.sequence);
	//LogIt("new_flag_sequence = " + Pchar.new.flag.sequence);

			if(sti(Pchar.new.flag.sequence) > sti(Pchar.old.flag.sequence)) 
			{
				LAi_QuestDelay("confirm_BBflag", 2.0);
			}
			else
			{
				if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "pir") LogIt("R");
				if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "pir2") LogIt("T");
				if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "HOL") LogIt("D");
				if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "ENG") LogIt("E");
				if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "FRA") LogIt("F");
				if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "POR") LogIt("P");
				if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "SPA") LogIt("S");
				if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "PRE") LogIt("P");
				if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "IRE") LogIt("I");
				if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "SWE") LogIt("S");
				if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "HO2") LogIt("D");
				if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "AME") LogIt("A");
				if(CheckAttribute(Pchar, "tower.flag") && Pchar.tower.flag == "SP2") LogIt("U");

				LAi_QuestDelay("Pchar_sigh", 2.0);
				LAi_QuestDelay("BB_isl2_box4_off", 2.0);
			}
		break;

		case "confirm_BBflag":
		//	PlaySound("OBJECTS\SHIPCHARGE\cannon_fire_01.wav");
			Pchar.old.flag.sequence = Pchar.new.flag.sequence;

	//LogIt("old_flag_sequence = " + Pchar.old.flag.sequence);
	//LogIt("new_flag_sequence = " + Pchar.new.flag.sequence);

			if(Pchar.new.flag.sequence == 1) 
			{
				LogIt("P");
				LAi_QuestDelay("BB_isl2_box4_off", 2.0);
			}
			if(Pchar.new.flag.sequence == 2)
			{
				LogIt("P");
				LogIt("I");
				LAi_QuestDelay("BB_isl2_box4_off", 2.0);
			}
			if(Pchar.new.flag.sequence == 3)
			{
				LogIt("P");
				LogIt("I");
				LogIt("R");
				LAi_QuestDelay("BB_isl2_box4_off", 2.0);
			}
			if(Pchar.new.flag.sequence == 4)
			{
				LogIt("P");
				LogIt("I");
				LogIt("R");
				LogIt("A");
				LAi_QuestDelay("BB_isl2_box4_off", 2.0);
			}
			if(Pchar.new.flag.sequence == 5)
			{
				LogIt("P");
				LogIt("I");
				LogIt("R");
				LogIt("A");
				LogIt("T");
				LAi_QuestDelay("BB_isl2_box4_off", 2.0);
			}

			if(Pchar.new.flag.sequence == 6) 
			{
				LogIt("P");
				LogIt("I");
				LogIt("R");
				LogIt("A");
				LogIt("T");
				LogIt("E");
			PlaySound("OBJECTS\SHIPCHARGE\cannon_fire_01.wav");
				DeleteQuestHeader("KR_letter");
				
				LAi_QuestDelay("confirm_BBflag_end", 2.0);
			}
		break;

		case "confirm_BBflag_end":
			PlaySound("AMBIENT\SEASHORE\fanfare.wav");
			TakeItemFromCharacter(Pchar, "doc60A");
			TakeItemFromCharacter(Pchar, "doc60B");
			TakeItemFromCharacter(Pchar, "doc60C");
			TakeItemFromCharacter(Pchar, "doc60D");
		
			LAi_QuestDelay("confirm_BBflag_end1", 13.0);
		break;

		case "confirm_BBflag_end1":
			PlaySound("PEOPLE\run_stone.wav");
			ChangeCharacterAddressGroup(Pchar, "BB_island2", "goto", "spyglass");
		break;

		case "BB_isl2_box4_off":
			Pchar.BB_isl2_box4 = "off";
			//LogIt("OFF");
		break;

//------------------------------------------------------------------------------------------------------------------------
//isle
		case "chimney_dialog":
			ChangeCharacterAddressGroup(CharacterFromID("Louis_Arot"), "BB_isle", "reload", "reload1");

			LAi_SetActorType(characterFromID("Louis_Arot"));
			LAi_ActorDialog(characterFromID("Louis_Arot"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Louis_Arot"));
		break;

		case "chimney_done":
			LAi_SetStayType(Pchar);
			Pchar.isle.chimney = "logbook";
		break;

		case "logbook_down_chimney":
			LAi_QuestDelay("quest_item", 0.01);

			LAi_QuestDelay("logbook_down_chimney1", 1.0);
		break;

		case "logbook_down_chimney1":
			LAi_SetActorType(characterFromID("Louis_Arot"));
			LAi_ActorDialog(characterFromID("Louis_Arot"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Louis_Arot"));
			Characters[GetCharacterIndex("Louis_Arot")].dialog.CurrentNode  = "open_hut";
		break;

		case "open_hut_done":
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(CharacterFromID("Louis_Arot"), "BB_isle_hut", "goto", "Arot");

			LAi_QuestDelay("open_hut_done1", 3.0);
		break;

		case "open_hut_done1":
			PlaySound("INTERFACE\key_unlock2.wav");
			Locations[FindLocation("BB_isle")].reload.l1.disable = 0;
			LAi_SetStayType(characterFromID("Louis_Arot"));
			Characters[GetCharacterIndex("Louis_Arot")].dialog.CurrentNode  = "inside_hut";
		break;

		case "inside_hut_done":
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box2", 1.0);
			Locations[FindLocation("BB_isle_hut")].locators_radius.box.box2 = 1.0;

			TakeItemFromCharacter(pchar, "flagchest_closed"); TakeItemFromCharacter(pchar, "flagchest_open");
			TakeItemFromCharacter(pchar, "flagchest_empty"); TakeItemFromCharacter(pchar, "bladeflag_pir");
			TakeItemFromCharacter(pchar, "bladeflag_pir2"); TakeItemFromCharacter(pchar, "bladeflag_HOL");
			TakeItemFromCharacter(pchar, "bladeflag_FRA"); TakeItemFromCharacter(pchar, "bladeflag_POR");
			TakeItemFromCharacter(pchar, "bladeflag_SPA"); TakeItemFromCharacter(pchar, "bladeflag_PRE");
			TakeItemFromCharacter(pchar, "bladeflag_IRE"); TakeItemFromCharacter(pchar, "bladeflag_SWE");
			TakeItemFromCharacter(pchar, "bladeflag_HOL2"); TakeItemFromCharacter(pchar, "bladeflag_AME");
			TakeItemFromCharacter(pchar, "bladeflag_SPA2");   

			if(IsEquipCharacterByItem(Pchar, "bladeflag_pir") || IsEquipCharacterByItem(Pchar, "bladeflag_pir2") || IsEquipCharacterByItem(Pchar, "bladeflag_HOL")
			|| IsEquipCharacterByItem(Pchar, "bladeflag_FRA") || IsEquipCharacterByItem(Pchar, "bladeflag_POR") || IsEquipCharacterByItem(Pchar, "bladeflag_SPA")
			|| IsEquipCharacterByItem(Pchar, "bladeflag_PRE") || IsEquipCharacterByItem(Pchar, "bladeflag_IRE") || IsEquipCharacterByItem(Pchar, "bladeflag_SWE")
			|| IsEquipCharacterByItem(Pchar, "bladeflag_HOL2") || IsEquipCharacterByItem(Pchar, "bladeflag_AME") || IsEquipCharacterByItem(Pchar, "bladeflag_SPA2"))
			{ RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE); } 
			

			LAi_SetStayType(characterFromID("Louis_Arot"));
			Characters[GetCharacterIndex("Louis_Arot")].dialog.CurrentNode  = "neutral_inside";

			LAi_QuestDelay("quest_item", 0.01);
			LAi_QuestDelay("bladelever3_check", 0.5);
		break;

		case "neutral_inside_repeat":
			LAi_SetStayType(characterFromID("Louis_Arot"));
			Characters[GetCharacterIndex("Louis_Arot")].dialog.CurrentNode  = "neutral_inside";
		break;

		case "Arot_gone":
			ChangeCharacterAddressGroup(CharacterFromID("Louis_Arot"), "none", "", "");
		break;

		case "unlock_isle_chest":
			TakeItemFromCharacter(pchar, "BB_key");
			Pchar.isle.chest = "open";
			DeleteQuestHeader("KR_tricorn");
		break;

		case "BB_isle_hut_jump":
			LAi_SetSitType(Pchar);
			PlaySound("PEOPLE\jump_roof.wav");
			PlaySound("PEOPLE\jump_roof.wav");
			CreateParticleSystem("blast_dirt_small" , 1.7, 0.0, 0.7, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "BB_isle_hut_jump_locked":
			ChangeCharacterAddressGroup(Pchar, "BB_isle_hut", "goto", "jump");

			LAi_QuestDelay("BB_isle_hut_jump", 0.7);
		break;

		case "bladelever3_check":
			if(CheckCharacterItem(Pchar,"bladelever3"))
			{
				PlaySound("INTERFACE\cancel.wav");
				RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "bladelever3");

				LAi_QuestDelay("Arot_tartane", 0.1);
				//return;
			}
			else LAi_QuestDelay("bladelever3_check", 0.5);	//loops until item picked up
		break;

		case "Arot_tartane":
			Characters[GetCharacterIndex("Louis_Arot")].dialog.CurrentNode  = "neutral_islet";
			ChangeCharacterAddressGroup(CharacterFromID("Louis_Arot"), "BB_isle", "goto", "arrive");

			SetCharacterShipLocation(characterFromID("gm_crew12"), "none");
			SetCharacterShipLocation(characterFromID("gm_crew14"), "none");

			SetCharacterShipLocation(characterFromID("wr_mummy6"), "BB_upper_cave");
			SetCharacterShipLocation(characterFromID("wr_mummy7"), "BB_isle");

			pchar.quest.Arot_tartane_cave.win_condition.l1 = "location";
			pchar.quest.Arot_tartane_cave.win_condition.l1.location = "BB_upper_cave";
			pchar.quest.Arot_tartane_cave.win_condition = "Arot_tartane_cave";
		break;

		case "neutral_islet_repeat":
			LAi_SetStayType(characterFromID("Louis_Arot"));
			Characters[GetCharacterIndex("Louis_Arot")].dialog.CurrentNode  = "neutral_islet";
		break;

		case "Arot_tartane_cave":
			ChangeCharacterAddressGroup(CharacterFromID("Louis_Arot"), "BB_upper_cave", "box", "box9");

			pchar.quest.Arot_tartane_sailing.win_condition.l1 = "location";
			pchar.quest.Arot_tartane_sailing.win_condition.l1.location = "BB_lower_cave";
			pchar.quest.Arot_tartane_sailing.win_condition = "Arot_tartane_sailing";
		break;

		case "Arot_tartane_sailing":
			ChangeCharacterAddressGroup(CharacterFromID("Louis_Arot"), "none", "", "");
			characters[GetCharacterIndex("wr_mummy6")].sailaway = true;
			Pchar.Arot_sailing = "yes";
		//	SetNextWind("W",30);
		break;

//------------------------------------------------------------------------------------------------------------------------


	/*	
		case "reset_box2_lowercave":
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box2", 0.7);
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "randitem", "randitem28", 0.0001);

			Locations[FindLocation("BB_lower_cave")].locators_radius.box.box2 = 0.7;
			Locations[FindLocation("BB_lower_cave")].locators_radius.randitem.randitem28 = 0.0001;
		break;
	*/

		case "KR_port_turn_to_ship05":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "Ships_other", "ship05");

			LAi_QuestDelay("player_back", 1.0);
		break;
//------------------------------------------------------------------------------------------------------------------------

		case "officers_run":
			LAi_SetStayType(Pchar);
			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorRunToLocator(characterFromID("Hands"), "goto", "citizen06", "Hands_scared", 10.0);
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorRunToLocator(characterFromID("Caesar"), "officers", "reload2_3", "Caesar_scared", 10.0);
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorRunToLocator(characterFromID("Pell"), "goto", "citizen010", "Pell_scared", 10.0);
			
			LAi_QuestDelay("pchar_sigh", 5.0);
			LAi_QuestDelay("Pyle_transformation", 6.5);
		break;

		case "Hands_scared":
			RemovePassenger(Pchar, characterFromID("Hands"));
			ChangeCharacterAddressGroup(CharacterFromID("Hands"), "BB_island1", "goto", "citizen06");
			LAi_SetStayType(CharacterFromID("Hands"));
		break;
		
		case "Caesar_scared":
			RemovePassenger(Pchar, characterFromID("Caesar"));
			ChangeCharacterAddressGroup(CharacterFromID("Caesar"), "BB_island1", "officers", "reload2_3");
			LAi_SetStayType(CharacterFromID("Caesar"));
		break;
		
		case "Pell_scared":
			RemovePassenger(Pchar, characterFromID("Pell"));
			ChangeCharacterAddressGroup(CharacterFromID("Pell"), "BB_island1", "goto", "citizen010");
			LAi_SetStayType(CharacterFromID("Pell"));
		break;

		case "Pyle_transformation":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "I_skeleton";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Pyle_transformation1":
			ChangeCharacterAddressGroup(CharacterFromID("Claire Voyant"), "BB_island1", "goto", "citizen012");

			Characters[GetCharacterIndex("Claire Voyant")].dialog.CurrentNode  = "meditation";
			LAi_SetActorType(CharacterFromID("Claire Voyant"));
			LAi_ActorDialog(characterFromID("Claire Voyant"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Claire Voyant"));
		break;

		case "Pyle_transformation2":
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			SetModel(PChar, "invisible", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			ChangeCharacterAddressGroup(CharacterFromID("Claire Voyant"), "BB_mountain_tunnel", "goto", "goto1");

			locations[FindLocation("BB_mountain_tunnel")].type = "Claire_outside";
			Locations[FindLocation("BB_mountain_tunnel")].image = "";
			DoQuestReloadToLocation("BB_mountain_tunnel", "goto", "black" ,"Pyle_transformation3");
		break;

		case "Pyle_transformation3":
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			Locations[FindLocation("BB_mountain_tunnel")].image = "later.tga";
			
			LAi_QuestDelay("Pyle_transformation4", 5.0);
		break;

		case "Pyle_transformation4":
			Characters[GetCharacterIndex("Claire Voyant")].dialog.CurrentNode  = "meditation3";
			LAi_SetActorType(CharacterFromID("Claire Voyant"));
			LAi_ActorDialog(characterFromID("Claire Voyant"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Claire Voyant"));
		break;
	//.........................
		case "Pyle_transformation5":
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			SetCurrentTime(20.00, 0);
			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Clear";

			DoQuestReloadToLocation("meditation_path", "reload", "reload2" ,"Pyle_transformation6");
		break;

		case "Pyle_transformation6":
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
		
			LAi_SetActorType(pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "goto4", "Pyle_transformation6A", 18.0);		//means run
		break;

		case "Pyle_transformation6A":
			LAi_ActorGoToLocator(Pchar, "reload", "reload1", "Pyle_transformation7", 18.0);		//means run
		break;

		case "Pyle_transformation7":
			EquipCharacterByItem(Pchar, "bladeX4");
		//	locations[FindLocation("BB_mountain_tunnel")].type = "silent_distant_seashore";		//test keep the med music on
			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Clear";

			DoQuestReloadToLocation("BB_mountain_tunnel", "goto", "black" ,"Pyle_transformation8");
		break;

		case "Pyle_transformation8":
			LAi_QuestDelay("Pyle_transformation9", 3.0);
		break;

		case "Pyle_transformation9":
			Characters[GetCharacterIndex("Claire Voyant")].dialog.CurrentNode  = "meditation_end";
			LAi_SetActorType(CharacterFromID("Claire Voyant"));
			LAi_ActorDialog(characterFromID("Claire Voyant"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Claire Voyant"));
		break;

		case "Pyle_transformation10":
			SetCurrentTime(12.00, 0);
			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Clear";

			Locations[FindLocation("BB_island1")].image = "";		//black
			DoQuestReloadToLocation("BB_island1", "quest", "quest1" ,"Pyle_transformation11");
		break;

		case "Pyle_transformation11":
			SetModel(PChar, "Howard_Pyle", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);
			EquipCharacterByItem(Pchar, "BB_coin");

			EquipCharacterByItem(Pchar, "bladepainting");
			EquipCharacterByItem(Pchar, "pistolbook71");

			LAi_SetStayType(pchar);
			Locations[FindLocation("BB_island1")].image = "Outside_Jungle_7.tga";
			Locations[FindLocation("BB_mountain_tunnel")].image = "wr_dungeon3_left.tga";

			LAi_QuestDelay("Pyle_transformation12", 1.0);
		break;

		case "Pyle_transformation12":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "I_body_again";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Pyle_transformation13":
			ChangeCharacterAddressGroup(CharacterFromID("Claire Voyant"), "BB_island1", "goto", "citizen012");

			Characters[GetCharacterIndex("Claire Voyant")].dialog.CurrentNode  = "magic_items";
			LAi_SetActorType(CharacterFromID("Claire Voyant"));
			LAi_ActorDialog(characterFromID("Claire Voyant"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Claire Voyant"));
		break;

		case "Pyle_transformation14":
			PlaySound("OBJECTS\DUEL\sword_fallen.wav");
			TakeNItems(Pchar,"snakewand", -1);
			TakeNItems(Pchar,"pistolcenserD", -1);
			TakeNItems(Pchar,"incense", -12);
			TakeNItems(Pchar,"myrrh", -4);
			ChangeCharacterAddressGroup(CharacterFromID("Claire Voyant"), "none", "", "");

			LAi_QuestDelay("Pyle_transformation15", 2.0);
		break;

		case "Pyle_transformation15":
			LAi_ActorRunToLocatorJRH(Pchar, "quest", "quest2", 13.0);
		break;

		case "Pyle_transformation16":
			//from yelling at box5

			AddPassenger(Pchar, characterFromID("Hands"), 0);
			SetOfficersIndex(Pchar, 1, getCharacterIndex("Hands"));
			SetModel(characterFromID("Hands"), "bb_Hands2", "man", "man", 1.8, false);
			characters[GetCharacterIndex("Hands")].dialog.CurrentNode = "neutral";
			LAi_SetOfficerType(characterFromID("Hands"));

			AddPassenger(Pchar, characterFromID("Caesar"), 0);
			SetOfficersIndex(Pchar, 2, getCharacterIndex("Caesar"));
			characters[GetCharacterIndex("Caesar")].dialog.CurrentNode = "neutral";
			LAi_SetOfficerType(characterFromID("Caesar"));

			AddPassenger(Pchar, characterFromID("Pell"), 0);
			SetOfficersIndex(Pchar, 3, getCharacterIndex("Pell"));
			SetModel(characterFromID("Pell"), "bb_Pell", "man", "man", 1.8, false);
			characters[GetCharacterIndex("Pell")].dialog.CurrentNode = "neutral";
			LAi_SetOfficerType(characterFromID("Pell"));

			LAi_QuestDelay("Pyle_transformation17", 11.0);
		break;

		case "Pyle_transformation17":
			Characters[GetCharacterIndex("Pell")].dialog.CurrentNode  = "what_happened";
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorDialogNow(characterFromID("Pell"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Pell"));
		break;

		case "Pyle_transformation18":
			characters[GetCharacterIndex("Hands")].dialog.CurrentNode = "and_the_treasure";
			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorDialog(characterFromID("Hands"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hands"));
		break;

		case "Pyle_transformation19":
			LAi_QuestDelay("pchar_sigh", 1.0);
			LAi_QuestDelay("Pyle_transformation20", 3.0);
		break;

		case "Pyle_transformation20":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "I_found_the_treasure";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Pyle_transformation21":
			LAi_QuestDelay("hurrah", 0.01);
			LAi_QuestDelay("hurrah", 0.8);
			LAi_QuestDelay("hurrah", 1.6);
			LAi_QuestDelay("Pyle_transformation22", 2.6);
		break;

		case "Pyle_transformation22":
			PlaySound("AMBIENT\cheer.wav");

			LAi_QuestDelay("Pyle_transformation23", 5.0);
		break;

		case "Pyle_transformation23":
			characters[GetCharacterIndex("Caesar")].dialog.CurrentNode = "show_the_way";
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorDialog(characterFromID("Caesar"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Caesar"));
		break;

		case "Pyle_transformation24":
			characters[GetCharacterIndex("Hands")].dialog.CurrentNode = "bad_weather";
			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorDialog(characterFromID("Hands"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hands"));
		break;

		case "Pyle_transformation_end":
			//from Hands dialog

			LAi_SetPlayerType(Pchar);
			AddQuestRecord("Blackbeards_tower","7");
			CloseQuestHeader("Blackbeards_tower");

			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Clear";
			Pchar.quest.JRH_sky = "C_Cl3";

			LAi_QuestDelay("pchar_lets_go", 0.01);
			
		characters[GetCharacterIndex("Pell")].dialog.CurrentNode = "neutral";
			LAi_SetOfficerType(characterFromID("Hands"));
			LAi_SetOfficerType(characterFromID("Caesar"));
			LAi_SetOfficerType(characterFromID("Pell"));

			Locations[FindLocation("Kristiania_center")].models.always.locators = "GrTown_l_JRH";
			locations[FindLocation("Kristiania_center")].type = "town";
			Locations[FindLocation("Kristiania_center")].reload.l3.disable = 0;		//to entre

			Locations[FindLocation("Kristiania_entre")].models.always.locators = "FF01_l_JRH";
			locations[FindLocation("Kristiania_entre")].type = "town";
			Locations[FindLocation("Kristiania_entre")].reload.l3.disable = 0;		//to center

			Locations[FindLocation("IslaMona_port")].reload.l2.go = "BB_upper_cave";
			Locations[FindLocation("IslaMona_port")].reload.l2.emerge = "pole";

			locations[FindLocation("BB_upper_cave")].id.label = "Ship.";
			Pchar.treasure_removed = "yes";
			Pchar.C_dialog = "on";

			Locations[FindLocation("BB_upper_cave")].reload.l2.disable = 1;
			Locations[FindLocation("BB_upper_cave")].models.always.window = "grotto1_w_up";
			locations[FindLocation("BB_upper_cave")].type = "silent_seashore";
			Locations[FindLocation("BB_upper_cave")].models.always.locators = "grotto1_l_Hdo_Ldo_end";

			pchar.quest.Pyle_transformation_end0.win_condition.l1 = "location";
			pchar.quest.Pyle_transformation_end0.win_condition.l1.location = "Kristiania_center";
			pchar.quest.Pyle_transformation_end0.win_condition = "Pyle_transformation_end0";
		break;

		case "Pyle_transformation_end0":
			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Clear";
			Pchar.quest.JRH_sky = "C_Ov1";

			pchar.quest.Pyle_transformation_end1.win_condition.l1 = "location";
			pchar.quest.Pyle_transformation_end1.win_condition.l1.location = "Kristiania_canyon";
			pchar.quest.Pyle_transformation_end1.win_condition = "Pyle_transformation_end1";
		break;

		case "Pyle_transformation_end1":
			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Clear";
			Pchar.quest.JRH_sky = "7_Gr";

			SetCharacterShipLocation(characterFromID("gm_crew12"), "none");			//tartane50
			SetCharacterShipLocation(characterFromID("wr_mummy6"), "none");			//tartane50 swedish flag

			pchar.quest.Pyle_transformation_end2.win_condition.l1 = "location";
			pchar.quest.Pyle_transformation_end2.win_condition.l1.location = "IslaMona_port";
			pchar.quest.Pyle_transformation_end2.win_condition = "Pyle_transformation_end2";
		break;
		
		case "Pyle_transformation_end2":
			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Clear";
			Pchar.quest.JRH_sky = "C_Ni2";

			SetCharacterShipLocation(Pchar, "BB_upper_cave");
			SetLocatorRadius(locations[FindLocation("BB_upper_cave")], "randitem", "randitem2", 0.0001);
			Locations[FindLocation("BB_upper_cave")].image = "loading\inside\cave.tga";
  
			pchar.quest.with_treasure_to_sea.win_condition.l1 = "location";
			pchar.quest.with_treasure_to_sea.win_condition.l1.location = "BB_upper_cave";
			pchar.quest.with_treasure_to_sea.win_condition = "with_treasure_to_sea";
		break;

		case "with_treasure_to_sea":
			LAi_QuestDelay("close_grotto_hatch2", 1.0);

			ChangeCharacterAddressGroup(CharacterFromID("Caesar"), "BB_upper_cave", "goto", "box4");
			ChangeCharacterAddressGroup(CharacterFromID("Pell"), "BB_upper_cave", "goto", "Pell");
			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_upper_cave", "goto", "Hands");
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_SetActorType(characterFromID("Pell"));
			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorTurnToLocator(characterFromID("Caesar"), "randitem", "randitem20");
			LAi_ActorTurnToLocator(characterFromID("Pell"), "reload", "boat");
			LAi_ActorTurnToLocator(characterFromID("Hands"), "goto", "box8");

			DeleteQuestHeader("Blackbeards_tower");

			Locations[FindLocation("IslaMona_port")].reload.l2.go = "IslaMona";		//reset
			Locations[FindLocation("IslaMona_port")].reload.l2.emerge = "Reload1";		//reset
			locations[FindLocation("BB_upper_cave")].id.label = "Grot";			//reset

			LAi_QuestDelay("with_treasure_to_sea1", 1.0);
		break;

		case "with_treasure_to_sea1":
			LAi_SetSitType(characterFromID("Pell"));

		ChangeCharacterAddressGroup(CharacterFromID("Mutineer_1"), "BB_careen_shore", "quest", "mut");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_2"), "BB_careen_shore", "quest", "mut");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_3"), "BB_careen_shore", "quest", "mut");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_4"), "BB_careen_shore", "quest", "mut");
		break;

		case "with_treasure_to_sea2":
			characters[GetCharacterIndex("Caesar")].dialog.CurrentNode = "treasure_aboard";
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorDialog(characterFromID("Caesar"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Caesar"));
		break;

		case "with_treasure_to_sea3":
			//from Caesar dialog

			PlaySound("PEOPLE\creak2.wav");
			ChangeCharacterAddressGroup(CharacterFromID("Caesar"), "BB_upper_cave", "goto", "tartane");
			LAi_ActorTurnToLocator(characterFromID("Caesar"), "reload", "boat");

		ChangeCharacterAddressGroup(CharacterFromID("Mutineer_5"), "BB_careen_shore", "quest", "mut");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_6"), "BB_careen_shore", "quest", "mut");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_7"), "BB_careen_shore", "quest", "mut");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_8"), "BB_careen_shore", "quest", "mut");

			LAi_QuestDelay("with_treasure_to_sea4", 1.0);
		break;

		case "with_treasure_to_sea4":
			Pchar.C_dialog = "off";
			PlaySound("PEOPLE\step_stairway.wav");
			PlaySound("PEOPLE\step_stairway.wav");

		ChangeCharacterAddressGroup(CharacterFromID("Mutineer_9"), "BB_careen_shore", "quest", "mut");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_10"), "BB_careen_shore", "quest", "mut");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_11"), "BB_careen_shore", "quest", "mut");
		break;

		case "with_treasure_to_sea5":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "ships", "ship_1");

		ChangeCharacterAddressGroup(CharacterFromID("Mutineer_12"), "BB_careen_shore", "quest", "mut");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_13"), "BB_careen_shore", "quest", "mut");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_14"), "BB_careen_shore", "quest", "mut");

			LAi_QuestDelay("with_treasure_to_sea6", 0.1);
		break;

		case "with_treasure_to_sea6":
			LAi_SetPlayerType(Pchar);
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box14", 3.0);
			SetCurrentTime(12, 0);
			Pchar.quest.JRH_sky = "";
			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Clear";
			SetNextWind("N",30);
	
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			DeleteAttribute(Pchar, "items");//takes all incl fists
			AddMoneyToCharacter(Pchar, -10000);
			GiveItem2Character(Pchar, "bladeX4");
			EquipCharacterByItem(Pchar, "bladeX4");
		break;

//------------------------------------------------------------------------------------------------------------------------
//careen start
	
		case "storm_careen":
			SetModel(PChar, "Howard_Pyle", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);
			LAi_SetActorType(Pchar);
			LAi_ActorSetLayMode(Pchar);

			RemoveOfficersIndex(pchar, GetCharacterIndex("Hands"));
			RemovePassenger(pchar, characterFromID("Hands"));
			RemoveOfficersIndex(pchar, GetCharacterIndex("Caesar"));
			RemovePassenger(Pchar, characterFromID("Caesar"));
			RemoveOfficersIndex(pchar, GetCharacterIndex("Pell"));
			RemovePassenger(pchar, characterFromID("Pell"));

			PostVideoAndQuest("common\Storm",1, "to_careen_shore");
		break;

		case "to_careen_shore":
			DoQuestReloadToLocation("BB_careen_shore", "goto", "arrive" ,"careen_shore_start");
		break;
	
		case "careen_shore_start":
	//ChangeCharacterAddressGroup(CharacterFromID("Teach"), "BB_careen_shore", "quest", "ghost");

			if(!CheckCharacterItem(CharacterFromID("Fletcher Christian"),"blade1")) 
			{
				GiveItem2Character(CharacterFromID("Fletcher Christian"), "blade1");
			}
			EquipCharacterByItem(characterFromID("Fletcher Christian"), "blade1");	
			if(!CheckCharacterItem(CharacterFromID("Fletcher Christian"),"pistolbbuss")) 
			{
				GiveItem2Character(CharacterFromID("Fletcher Christian"), "pistolbbuss");
			}
			EquipCharacterByItem(characterFromID("Fletcher Christian"), "pistolbbuss");
			TakenItems(characterFromID("Fletcher Christian"), "gunpowder", 4);
			TakenItems(characterFromID("Fletcher Christian"), "pistolgrapes", 4);	

			DeleteAttribute(Pchar,"Ship");	

			LAi_QuestDelay("careen_shore_start1", 5.0);
			LAi_QuestDelay("careen_shore_start2", 10.0);
		break;

		case "careen_shore_start1":
			PlaySound("PEOPLE\step_water1.wav");
			LAi_QuestDelay("pchar_poortype", 0.01);

			Php = LAi_GetCharacterHP(Pchar);
			LAi_SetHP(CharacterFromID("Fletcher Christian"), Php+80.0, Php+80.0);
			LAi_SetHP(CharacterFromID("Midshipman Young"), Php+80.0, Php+80.0);
			LAi_SetHP(CharacterFromID("Constable Mills"), Php+80.0, Php+80.0);

			LAi_QuestDelay("careen_shore_start1A", 1.0);
		break;

		case "careen_shore_start1A":
			PlaySound("AMBIENT\TAVERN\man2.wav");
			PlaySound("AMBIENT\TAVERN\man2.wav");

		LAi_SetPoorType(CharacterFromID("Mutineer_1"));
			LAi_SetPoorType(CharacterFromID("Mutineer_2"));
			LAi_SetPoorType(CharacterFromID("Mutineer_3"));
			LAi_SetPoorType(CharacterFromID("Mutineer_4"));
			LAi_SetPoorType(CharacterFromID("Mutineer_5"));
			LAi_SetPoorType(CharacterFromID("Mutineer_6"));
			LAi_SetPoorType(CharacterFromID("Mutineer_7"));
			LAi_SetPoorType(CharacterFromID("Mutineer_8"));
			LAi_SetPoorType(CharacterFromID("Mutineer_9"));
			LAi_SetPoorType(CharacterFromID("Mutineer_10"));
			LAi_SetPoorType(CharacterFromID("Mutineer_11"));
			LAi_SetPoorType(CharacterFromID("Mutineer_12"));
			LAi_SetPoorType(CharacterFromID("Mutineer_13"));
		LAi_SetPoorType(CharacterFromID("Mutineer_14"));
		break;

		case "careen_shore_start2":
			LAi_QuestDelay("pchar_actortype", 0.01);

		ChangeCharacterAddressGroup(CharacterFromID("Mutineer_15"), "BB_careen_shore", "quest", "mut");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_16"), "BB_careen_shore", "quest", "mut");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_17"), "BB_careen_shore", "quest", "mut");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_18"), "BB_careen_shore", "quest", "mut");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_19"), "BB_careen_shore", "quest", "mut");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_20"), "BB_careen_shore", "quest", "mut");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_21"), "BB_careen_shore", "quest", "mut");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_22"), "BB_careen_shore", "quest", "mut");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_32"), "BB_careen_shore", "quest", "mut");//obs 32 instead of 23
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_24"), "BB_careen_shore", "quest", "mut");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_25"), "BB_careen_shore", "quest", "mut");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_26"), "BB_careen_shore", "quest", "mut");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_27"), "BB_careen_shore", "quest", "mut");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_31"), "BB_careen_shore", "quest", "mut");

			LAi_QuestDelay("careen_shore_start2A", 1.0);
		break;

		case "careen_shore_start2A":
			PlaySound("AMBIENT\TAVERN\man1.wav");
			PlaySound("AMBIENT\TAVERN\man1.wav");

		
		pchar.quest.careen_back1_A.win_condition.l1 = "locator";
			pchar.quest.careen_back1_A.win_condition.l1.location = "BB_careen_shore";
			pchar.quest.careen_back1_A.win_condition.l1.locator_group = "quest";
			pchar.quest.careen_back1_A.win_condition.l1.locator = "1";
			pchar.quest.careen_back1_A.win_condition = "careen_back1_A";

			pchar.quest.careen_back2_A.win_condition.l1 = "locator";
			pchar.quest.careen_back2_A.win_condition.l1.location = "BB_careen_shore";
			pchar.quest.careen_back2_A.win_condition.l1.locator_group = "quest";
			pchar.quest.careen_back2_A.win_condition.l1.locator = "2";
			pchar.quest.careen_back2_A.win_condition = "careen_back2_A";

			pchar.quest.careen_back3_A.win_condition.l1 = "locator";
			pchar.quest.careen_back3_A.win_condition.l1.location = "BB_careen_shore";
			pchar.quest.careen_back3_A.win_condition.l1.locator_group = "quest";
			pchar.quest.careen_back3_A.win_condition.l1.locator = "3";
			pchar.quest.careen_back3_A.win_condition = "careen_back3_A";
		
			pchar.quest.careen_back4_A.win_condition.l1 = "locator";
			pchar.quest.careen_back4_A.win_condition.l1.location = "BB_careen_shore";
			pchar.quest.careen_back4_A.win_condition.l1.locator_group = "quest";
			pchar.quest.careen_back4_A.win_condition.l1.locator = "4";
			pchar.quest.careen_back4_A.win_condition = "careen_back4_A";

			pchar.quest.careen_back5_A.win_condition.l1 = "locator";
			pchar.quest.careen_back5_A.win_condition.l1.location = "BB_careen_shore";
			pchar.quest.careen_back5_A.win_condition.l1.locator_group = "quest";
			pchar.quest.careen_back5_A.win_condition.l1.locator = "5";
			pchar.quest.careen_back5_A.win_condition = "careen_back5_A";

			pchar.quest.careen_back6_A.win_condition.l1 = "locator";
			pchar.quest.careen_back6_A.win_condition.l1.location = "BB_careen_shore";
			pchar.quest.careen_back6_A.win_condition.l1.locator_group = "quest";
			pchar.quest.careen_back6_A.win_condition.l1.locator = "6";
			pchar.quest.careen_back6_A.win_condition = "careen_back6_A";

			pchar.quest.careen_back7_A.win_condition.l1 = "locator";
			pchar.quest.careen_back7_A.win_condition.l1.location = "BB_careen_shore";
			pchar.quest.careen_back7_A.win_condition.l1.locator_group = "barmen";
			pchar.quest.careen_back7_A.win_condition.l1.locator = "7";
			pchar.quest.careen_back7_A.win_condition = "careen_back7_A";

			pchar.quest.careen_back8_A.win_condition.l1 = "locator";
			pchar.quest.careen_back8_A.win_condition.l1.location = "BB_careen_shore";
			pchar.quest.careen_back8_A.win_condition.l1.locator_group = "barmen";
			pchar.quest.careen_back8_A.win_condition.l1.locator = "8";
			pchar.quest.careen_back8_A.win_condition = "careen_back8_A";

			pchar.quest.careen_back9_A.win_condition.l1 = "locator";
			pchar.quest.careen_back9_A.win_condition.l1.location = "BB_careen_shore";
			pchar.quest.careen_back9_A.win_condition.l1.locator_group = "barmen";
			pchar.quest.careen_back9_A.win_condition.l1.locator = "9";
			pchar.quest.careen_back9_A.win_condition = "careen_back9_A";

			pchar.quest.careen_back10_A.win_condition.l1 = "locator";
			pchar.quest.careen_back10_A.win_condition.l1.location = "BB_careen_shore";
			pchar.quest.careen_back10_A.win_condition.l1.locator_group = "quest";
			pchar.quest.careen_back10_A.win_condition.l1.locator = "10";
		pchar.quest.careen_back10_A.win_condition = "careen_back10_A";

			LAi_QuestDelay("careen_shore_start3A", 2.0);
		break;

		case "careen_shore_start3A":
			LAi_ActorTurnToLocator(Pchar, "goto", "locator11");

			LAi_QuestDelay("careen_shore_start3B", 1.0);
		break;

		case "careen_shore_start3B":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "thats_my_flag";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "rum_check1":
			//from self dialog
			
			if(CheckCharacterItem(Pchar,"potionrum"))
			{
				PlaySound("INTERFACE\glass1.wav");

				LAi_QuestDelay("rum_check1_A", 0.5);
			}
			else LAi_QuestDelay("rum_check1", 0.5);
		break;

		case "rum_check1_A":
			rum = GetCharacterItem(Pchar, "potionrum");

			if(rum == 2)
			{
				PlaySound("INTERFACE\glass2.wav");
				return;
			}
			else LAi_QuestDelay("rum_check1_A", 0.5);
		break;
	//.........................................................................................
	//careen_tower
		case "careen_tower_down":
			LAi_ActorTurnToLocator(Pchar, "goto", "citizen05");

			LAi_QuestDelay("pchar_playertype", 1.5);
		break;
	//.........................................................................................
	//meeting mutineers
		case "careen_mutineers1":
			Characters[GetCharacterIndex("Fletcher Christian")].dialog.CurrentNode  = "careen_mutineers1";
			LAi_SetActorType(characterFromID("Fletcher Christian"));
			LAi_ActorDialogNow(characterFromID("Fletcher Christian"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Fletcher Christian"));
		break;

		case "careen_mutineers2":
			Characters[GetCharacterIndex("Constable Mills")].dialog.CurrentNode  = "careen_mutineers2";
			LAi_SetActorType(characterFromID("Constable Mills"));
			LAi_ActorDialogNow(characterFromID("Constable Mills"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Constable Mills"));
		break;

		case "careen_mutineers3":
			Characters[GetCharacterIndex("Midshipman Young")].dialog.CurrentNode  = "careen_mutineers3";
			LAi_SetActorType(characterFromID("Midshipman Young"));
			LAi_ActorDialogNow(characterFromID("Midshipman Young"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Midshipman Young"));
		break;

		case "careen_mutineers5":
			Characters[GetCharacterIndex("Fletcher Christian")].dialog.CurrentNode  = "careen_mutineers5";
			LAi_SetActorType(characterFromID("Fletcher Christian"));
			LAi_ActorDialogNow(characterFromID("Fletcher Christian"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Fletcher Christian"));
		break;

		case "careen_mutineers6":
			Characters[GetCharacterIndex("Constable Mills")].dialog.CurrentNode  = "careen_mutineers6";
			LAi_SetActorType(characterFromID("Constable Mills"));
			LAi_ActorDialogNow(characterFromID("Constable Mills"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Constable Mills"));
		break;

		case "careen_mutineers7":
			Characters[GetCharacterIndex("Midshipman Young")].dialog.CurrentNode  = "careen_mutineers7";
			LAi_SetActorType(characterFromID("Midshipman Young"));
			LAi_ActorDialogNow(characterFromID("Midshipman Young"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Midshipman Young"));
		break;

		case "careen_mutineers8":
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box6", 0.5);
			Locations[FindLocation("BB_careen_shore")].locators_radius.box.box6 = 0.5;
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box2", 0.001);
			Locations[FindLocation("BB_careen_shore")].locators_radius.box.box2 = 0.001;
		break;

		case "careen_turn_back":
			Pchar.careen_passage = "back";
			LAi_SetPlayerType(Pchar);
		break;

		case "careen_mutineers9":
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "quest", "duel_pyle", "careen_mutineers9_A", 9.0);

			LAi_QuestDelay("careen_mutineers10", 1.5);
			LAi_QuestDelay("careen_mutineers11", 1.5);
			LAi_QuestDelay("careen_mutineers12", 1.5);

			LAi_QuestDelay("careen_mutineers13", 2.0);
			LAi_QuestDelay("careen_mutineers14", 2.5);
		
			LAi_QuestDelay("careen_mutineers9_0", 11.0);
		break;

		case "careen_mutineers9_0":
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_1"), "BB_careen_shore", "quest", "duel_m1");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_2"), "BB_careen_shore", "quest", "duel_m2");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_3"), "BB_careen_shore", "quest", "duel_m3");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_4"), "BB_careen_shore", "quest", "duel_m4");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_5"), "BB_careen_shore", "quest", "duel_m5");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_6"), "BB_careen_shore", "quest", "duel_m6");

			LAi_SetStayType(characterFromID("Mutineer_1"));
			LAi_SetStayType(characterFromID("Mutineer_2"));
			LAi_SetStayType(characterFromID("Mutineer_3"));
			LAi_SetStayType(characterFromID("Mutineer_4"));
			LAi_SetStayType(characterFromID("Mutineer_5"));
			LAi_SetStayType(characterFromID("Mutineer_6"));
		break;

		case "careen_mutineers9_A":
			ChangeCharacterAddressGroup(Pchar, "BB_careen_shore", "quest", "duel_pyle");
			LAi_SetStayType(Pchar);

			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_15"), "BB_careen_shore", "quest", "duel_m15");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_16"), "BB_careen_shore", "quest", "duel_m16");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_17"), "BB_careen_shore", "quest", "duel_m17");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_18"), "BB_careen_shore", "quest", "duel_m18");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_19"), "BB_careen_shore", "quest", "duel_m19");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_20"), "BB_careen_shore", "quest", "duel_m20");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_21"), "BB_careen_shore", "quest", "duel_m21");

			LAi_SetStayType(characterFromID("Mutineer_15"));
			LAi_SetStayType(characterFromID("Mutineer_16"));
			LAi_SetStayType(characterFromID("Mutineer_17"));
			LAi_SetStayType(characterFromID("Mutineer_18"));
			LAi_SetStayType(characterFromID("Mutineer_19"));
			LAi_SetStayType(characterFromID("Mutineer_20"));
			LAi_SetStayType(characterFromID("Mutineer_21"));

			RemoveCharacterEquip(characterFromID("Mutineer_15"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("Mutineer_15"), "blade5");
			GiveItem2Character(CharacterFromID("Mutineer_15"), "blade4");
			EquipCharacterByItem(characterFromID("Mutineer_15"), "blade4");
			
			RemoveCharacterEquip(characterFromID("Mutineer_20"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("Mutineer_20"), "blade5");
			GiveItem2Character(CharacterFromID("Mutineer_20"), "blade4");
			EquipCharacterByItem(characterFromID("Mutineer_20"), "blade4");	
		break;

		case "careen_mutineers10":
			ChangeCharacterAddressGroup(characterFromID("Constable Mills"), "BB_careen_shore", "quest", "return");
			LAi_SetActorType(characterFromID("Constable Mills"));
			LAi_ActorRunToLocator(characterFromID("Constable Mills"), "quest", "duel_mills", "careen_mutineers10_A", 13.0);
		break;

		case "careen_mutineers10_A":
			ChangeCharacterAddressGroup(characterFromID("Constable Mills"), "BB_careen_shore", "quest", "duel_mills");
		break;

		case "careen_mutineers11":
			ChangeCharacterAddressGroup(characterFromID("Fletcher Christian"), "BB_careen_shore", "quest", "return");
			LAi_SetActorType(characterFromID("Fletcher Christian"));
			LAi_ActorRunToLocator(characterFromID("Fletcher Christian"), "quest", "duel_christian", "careen_mutineers11_A", 13.0);
		break;

		case "careen_mutineers11_A":
			ChangeCharacterAddressGroup(characterFromID("Fletcher Christian"), "BB_careen_shore", "quest", "duel_christian");

			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_15"), "BB_careen_shore", "quest", "duel_m15");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_16"), "BB_careen_shore", "quest", "duel_m16");

			LAi_SetStayType(characterFromID("Mutineer_15"));
			LAi_SetStayType(characterFromID("Mutineer_16"));
		break;

		case "careen_mutineers12":
			ChangeCharacterAddressGroup(characterFromID("Midshipman Young"), "BB_careen_shore", "quest", "return");
			LAi_SetActorType(characterFromID("Midshipman Young"));
			LAi_ActorRunToLocator(characterFromID("Midshipman Young"), "quest", "duel_young", "careen_mutineers12_A", 12.0);
		break;

		case "careen_mutineers12_A":
			ChangeCharacterAddressGroup(characterFromID("Midshipman Young"), "BB_careen_shore", "quest", "duel_young");
		break;

		case "careen_mutineers13":
			ChangeCharacterAddressGroup(characterFromID("Mutineer_14"), "BB_careen_shore", "quest", "return");
			ChangeCharacterAddressGroup(characterFromID("Mutineer_13"), "BB_careen_shore", "quest", "return");
			ChangeCharacterAddressGroup(characterFromID("Mutineer_12"), "BB_careen_shore", "quest", "return");
			ChangeCharacterAddressGroup(characterFromID("Mutineer_11"), "BB_careen_shore", "quest", "return");
			ChangeCharacterAddressGroup(characterFromID("Mutineer_25"), "BB_careen_shore", "quest", "return");
			ChangeCharacterAddressGroup(characterFromID("Mutineer_26"), "BB_careen_shore", "quest", "return");
			ChangeCharacterAddressGroup(characterFromID("Mutineer_27"), "BB_careen_shore", "quest", "return");
			ChangeCharacterAddressGroup(characterFromID("Mutineer_31"), "BB_careen_shore", "quest", "return");

			LAi_SetActorType(characterFromID("Mutineer_14"));
			LAi_SetActorType(characterFromID("Mutineer_13"));
			LAi_SetActorType(characterFromID("Mutineer_12"));
			LAi_SetActorType(characterFromID("Mutineer_11"));
			LAi_SetActorType(characterFromID("Mutineer_25"));
			LAi_SetActorType(characterFromID("Mutineer_26"));
			LAi_SetActorType(characterFromID("Mutineer_27"));
			LAi_SetActorType(characterFromID("Mutineer_31"));

			LAi_ActorRunToLocator(characterFromID("Mutineer_31"), "quest", "duel_m31", "_", 14.0);
			LAi_ActorRunToLocator(characterFromID("Mutineer_27"), "quest", "duel_m27", "_", 14.0);
			LAi_ActorRunToLocator(characterFromID("Mutineer_26"), "quest", "duel_m26", "_", 14.0);
			LAi_ActorRunToLocator(characterFromID("Mutineer_25"), "quest", "duel_m25", "_", 14.0);
			LAi_ActorRunToLocator(characterFromID("Mutineer_14"), "quest", "duel_m14", "_", 14.0);
			LAi_ActorRunToLocator(characterFromID("Mutineer_13"), "quest", "duel_m13", "_", 14.0);
			LAi_ActorRunToLocator(characterFromID("Mutineer_12"), "quest", "duel_m12", "_", 14.0);
			LAi_ActorRunToLocator(characterFromID("Mutineer_11"), "quest", "duel_m11", "careen_mutineers13_A", 14.0);
		break;

		case "careen_mutineers13_A":
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_11"), "BB_careen_shore", "quest", "duel_m11");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_12"), "BB_careen_shore", "quest", "duel_m12");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_13"), "BB_careen_shore", "quest", "duel_m13");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_14"), "BB_careen_shore", "quest", "duel_m14");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_25"), "BB_careen_shore", "quest", "duel_m25");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_26"), "BB_careen_shore", "quest", "duel_m26");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_27"), "BB_careen_shore", "quest", "duel_m27");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_31"), "BB_careen_shore", "quest", "duel_m31");

			LAi_SetStayType(characterFromID("Mutineer_11"));
			LAi_SetStayType(characterFromID("Mutineer_12"));
			LAi_SetStayType(characterFromID("Mutineer_13"));
			LAi_SetStayType(characterFromID("Mutineer_14"));
			LAi_SetStayType(characterFromID("Mutineer_25"));
			LAi_SetStayType(characterFromID("Mutineer_26"));
			LAi_SetStayType(characterFromID("Mutineer_27"));
			LAi_SetStayType(characterFromID("Mutineer_31"));
		break;

		case "careen_mutineers14":
			ChangeCharacterAddressGroup(characterFromID("Mutineer_7"), "BB_careen_shore", "quest", "return");
			ChangeCharacterAddressGroup(characterFromID("Mutineer_8"), "BB_careen_shore", "quest", "return");
			ChangeCharacterAddressGroup(characterFromID("Mutineer_9"), "BB_careen_shore", "quest", "return");
			ChangeCharacterAddressGroup(characterFromID("Mutineer_10"), "BB_careen_shore", "quest", "return");
			ChangeCharacterAddressGroup(characterFromID("Mutineer_22"), "BB_careen_shore", "quest", "return");
			ChangeCharacterAddressGroup(characterFromID("Mutineer_32"), "BB_careen_shore", "quest", "return");
			ChangeCharacterAddressGroup(characterFromID("Mutineer_24"), "BB_careen_shore", "quest", "return");

			LAi_SetActorType(characterFromID("Mutineer_7"));
			LAi_SetActorType(characterFromID("Mutineer_8"));
			LAi_SetActorType(characterFromID("Mutineer_9"));
			LAi_SetActorType(characterFromID("Mutineer_10"));
			LAi_SetActorType(characterFromID("Mutineer_22"));
			LAi_SetActorType(characterFromID("Mutineer_32"));
			LAi_SetActorType(characterFromID("Mutineer_24"));

			LAi_ActorRunToLocator(characterFromID("Mutineer_7"), "quest", "duel_m7", "_", 14.0);
			LAi_ActorRunToLocator(characterFromID("Mutineer_8"), "quest", "duel_m8", "_", 14.0);
			LAi_ActorRunToLocator(characterFromID("Mutineer_9"), "quest", "duel_m9", "_", 14.0);
			LAi_ActorRunToLocator(characterFromID("Mutineer_10"), "quest", "duel_m10", "_", 14.0);
			LAi_ActorRunToLocator(characterFromID("Mutineer_22"), "quest", "duel_m22", "_", 14.0);
			LAi_ActorRunToLocator(characterFromID("Mutineer_32"), "quest", "duel_m23", "_", 14.0);
			LAi_ActorRunToLocator(characterFromID("Mutineer_24"), "quest", "duel_m24", "careen_mutineers14_A", 14.0);
		break;

		case "careen_mutineers14_A":
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_7"), "BB_careen_shore", "quest", "duel_m7");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_8"), "BB_careen_shore", "quest", "duel_m8");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_9"), "BB_careen_shore", "quest", "duel_m9");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_10"), "BB_careen_shore", "quest", "duel_m10");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_22"), "BB_careen_shore", "quest", "duel_m22");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_32"), "BB_careen_shore", "quest", "duel_m23");
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_24"), "BB_careen_shore", "quest", "duel_m24");

			LAi_SetStayType(characterFromID("Mutineer_7"));
			LAi_SetStayType(characterFromID("Mutineer_8"));
			LAi_SetStayType(characterFromID("Mutineer_9"));
			LAi_SetStayType(characterFromID("Mutineer_10"));
			LAi_SetStayType(characterFromID("Mutineer_22"));
			LAi_SetStayType(characterFromID("Mutineer_32"));
			LAi_SetStayType(characterFromID("Mutineer_24"));

			ChangeCharacterAddressGroup(Pchar, "BB_careen_shore", "quest", "duel_pyle");

			LAi_QuestDelay("careen_mutineers15", 1.5);
		break;

		case "careen_mutineers15":
			PlaySound("VOICE\ENGLISH\gm_crew21A.wav");
			LAi_SetOfficerType(characterFromID("Mutineer_1"));

			LAi_QuestDelay("careen_mutineers15_A", 1.0);
		break;

		case "careen_mutineers15_A":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "quest", "duel_m1");

			LAi_QuestDelay("careen_mutineers15_C", 3.0);
		break;
	
		case "careen_mutineers15_C":
			GiveItem2Character(Pchar, "blade4");
			EquipCharacterByItem(Pchar, "blade4");
			PlaySound("OBJECTS\DUEL\sabre_sh.wav");

			LAi_QuestDelay("careen_mutineers15_CC", 1.0);
		break;

		case "careen_mutineers15_CC":
			TakenItems(Pchar, "gunpowder", 6);
			TakenItems(Pchar, "pistolbullets", 6);
			GiveItem2Character(Pchar, "PiratesPistol");
			EquipCharacterByItem(Pchar, "PiratesPistol");
			PlaySound("OBJECTS\DUEL\pistol_out1original.wav");

			LAi_QuestDelay("careen_mutineers15_D", 1.0);
		break;

		case "careen_mutineers15_D":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "quest", "duel_christian");

			LAi_QuestDelay("careen_mutineers15_E", 1.0);
			LAi_QuestDelay("careen_mutineers16", 2.0);
		break;

		case "careen_mutineers15_E":
			LAi_SetActorType(characterFromID("Mutineer_1"));
			LAi_ActorGoToLocator(characterFromID("Mutineer_1"), "quest", "duel_m1", "careen_mutineers15_F", 2.5);
		break;

		case "careen_mutineers15_F":
			ChangeCharacterAddressGroup(CharacterFromID("Mutineer_1"), "BB_careen_shore", "quest", "duel_m1");
			LAi_SetStayType(characterFromID("Mutineer_1"));
		break;

		case "careen_mutineers16":
			PlaySound("OBJECTS\DUEL\sabre_out.wav");
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(Pchar, true);

			LAi_QuestDelay("careen_mutineers16_A", 1.0);
			LAi_QuestDelay("careen_mutineers16_B", 1.5);
			LAi_QuestDelay("careen_mutineers16_C", 1.75);
		break;

		case "careen_mutineers16_A":
			PlaySound("OBJECTS\DUEL\sword_sh.wav");
			LAi_SetPlayerType(characterFromID("Fletcher Christian"));
			LAi_SetFightMode(characterFromID("Fletcher Christian"), true);
		break;

		case "careen_mutineers16_B":
			PlaySound("OBJECTS\DUEL\sword_sh.wav");
			LAi_SetPlayerType(characterFromID("Midshipman Young"));
			LAi_SetFightMode(characterFromID("Midshipman Young"), true);
		break;

		case "careen_mutineers16_C":
			PlaySound("OBJECTS\DUEL\sword_sh.wav");
			LAi_SetPlayerType(characterFromID("Constable Mills"));
			LAi_SetFightMode(characterFromID("Constable Mills"), true);

			LAi_QuestDelay("careen_mutineers17", 1.0);
		break;

		case "careen_mutineers17":
			PlaySound("AMBIENT\pirate_captains.wav");

			LAi_QuestDelay("careen_mutineers17_0", 1.0);
			LAi_QuestDelay("careen_mutineers17_A", 3.0);
		break;
	
		case "careen_mutineers17_0":
			LAi_SetFightMode(characterFromID("Midshipman Young"), false);
			LAi_SetFightMode(characterFromID("Constable Mills"), false);
		break;

		case "careen_mutineers17_A":
			LAi_SetFightMode(characterFromID("Fletcher Christian"), false);
			LAi_SetFightMode(Pchar, false);
			
			Characters[GetCharacterIndex("Fletcher Christian")].dialog.CurrentNode  = "careen_mutineers17_A";
			LAi_SetActorType(characterFromID("Fletcher Christian"));
			LAi_ActorDialogNow(characterFromID("Fletcher Christian"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Fletcher Christian"));
		break;

		case "careen_mutineers17_B":
			Characters[GetCharacterIndex("Mutineer_32")].dialog.CurrentNode  = "careen_mutineers17_B";
			LAi_SetActorType(characterFromID("Mutineer_32"));
			LAi_ActorDialogNow(characterFromID("Mutineer_32"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Mutineer_32"));
		break;

		case "careen_mutineers17_C":
			DoQuickSave();
			PlaySound("VOICE\ENGLISH\Mutineer_Christian.wav");

		//	LAi_QuestDelay("careen_mutineers18", 3.0);
			LAi_QuestDelay("careen_mutineers17_D", 3.0);			
		break;
	
		case "careen_mutineers17_D":
			Locations[FindLocation("BB_careen_shore")].image = "";
			DoQuestReloadToLocation("BB_careen_shore", "quest", "duel_pyle" ,"careen_mutineers18");
		break;

		case "careen_mutineers18":			
			LAi_SetActorType(characterFromID("Fletcher Christian"));
			LAi_ActorTurnToCharacter(characterFromID("Fletcher Christian"), PChar);

			LAi_QuestDelay("careen_mutineers18_A", 0.5);
		break;

		case "careen_mutineers18_A":
			PlaySound("OBJECTS\DUEL\sword_sh.wav");
			LAi_SetPlayerType(characterFromID("Fletcher Christian"));
			LAi_SetFightMode(characterFromID("Fletcher Christian"), true);
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Fletcher Christian"));

			LAi_QuestDelay("careen_mutineers18_B", 0.5);
		break;

		case "careen_mutineers18_B":
			LAi_SetActorType(characterFromID("Fletcher Christian"));
			LAi_ActorAttack(CharacterFromID("Fletcher Christian"), Pchar, "");
	
			PlaySound("OBJECTS\DUEL\sabre_out.wav");
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(Pchar, true);

			LAi_SetImmortal(characterFromID("Fletcher Christian"), false);
		
			pchar.quest.careen_mutineers19.win_condition.l1 = "NPC_Death";
			pchar.quest.careen_mutineers19.win_condition.l1.character = "Fletcher Christian";
			pchar.quest.careen_mutineers19.win_condition = "careen_mutineers19";
		break;

		case "careen_mutineers19":
			if(LAi_IsFightMode(Pchar)) {LAi_SetFightMode(Pchar, false);}

			RemoveCharacterEquip(characterFromID("Fletcher Christian"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Fletcher Christian"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Fletcher Christian"), "items");
			AddMoneyToCharacter(characterFromID("Fletcher Christian"), -1000);

			GiveItem2Character(Pchar, "blade1");
			EquipCharacterByItem(Pchar, "blade1");	
			GiveItem2Character(Pchar, "pistolbbuss");
			EquipCharacterByItem(Pchar, "pistolbbuss");
			GiveItem2Character(Pchar, "ammopouch");
			EquipCharacterByItem(Pchar, "ammopouch");
			GiveItem2Character(Pchar, "powderflask");
			EquipCharacterByItem(Pchar, "powderflask");
			TakenItems(Pchar, "pistolbullets", -6);
			TakenItems(Pchar, "pistolgrapes", 6);
			TakenItems(Pchar, "gunpowder", -6);
			TakenItems(Pchar, "gunpowder", 6);
			AddMoneyToCharacter(Pchar, 200);
			
			LAi_QuestDelay("careen_mutineers19_A", 1.5);
		break;
	
		case "careen_mutineers19_A":
			PlaySound("VOICE\ENGLISH\Mutineer_Young.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Midshipman Young"));

			LAi_QuestDelay("careen_mutineers19_B", 2.5);
		break;
	
		case "careen_mutineers19_B":
			PlaySound("VOICE\ENGLISH\gm_crew16B.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Constable Mills"));
			
			LAi_QuestDelay("careen_mutineers19_C", 1.5);
		break;

		case "careen_mutineers19_C":
			DoQuickSave();
			PlaySound("VOICE\ENGLISH\gm_crew5A.wav");
			
			LAi_QuestDelay("careen_mutineers19_D", 1.5);
		break;	

		case "careen_mutineers19_D":
			ChangeCharacterAddressGroup(characterFromID("Fletcher Christian"), "none", "", "");
			SetNextWeather("Clear");
			SetNextWind("N",30);

			ChangeCharacterAddressGroup(characterFromID("Caesar"), "BB_careen_shore", "quest", "duel_caesar");	//have to be here to work (old save game)

			Locations[FindLocation("BB_careen_shore")].image = "";
			DoQuestReloadToLocation("BB_careen_shore", "quest", "duel_pyle" ,"careen_mutineers19_E");
		break;

		case "careen_mutineers19_E":
			PlaySound("VOICE\ENGLISH\blaze_huh.wav");
			LAi_SetActorType(characterFromID("Caesar"));

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("mutineer_16"));

			RemoveCharacterEquip(characterFromID("Caesar"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Caesar"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Caesar"), "items");
			GiveItem2Character(characterFromID("Caesar"), "bladeanchor");
			EquipCharacterByItem(characterFromID("Caesar"), "bladeanchor");	
		
			Locations[FindLocation("BB_careen_shore")].image = "Outside_Shore_6.tga";

			LAi_QuestDelay("careen_mutineers19_F", 1.0);
		break;

		case "careen_mutineers19_F":
			AddPassenger(Pchar, characterFromID("Caesar"), 0);
			SetOfficersIndex(Pchar, 2, getCharacterIndex("Caesar"));
			LAi_SetOfficerType(characterFromID("Caesar"));

			LAi_SetImmortal(characterFromID("Constable Mills"), false);
			LAi_SetImmortal(characterFromID("Midshipman Young"), false);
			LAi_SetPlayerType(Pchar);

			ChangeCharacterAddressGroup(characterFromID("Constable Mills"), "BB_careen_shore", "quest", "duel_christian");

			LAi_QuestDelay("pchar_yah", 0.01);
			LAi_QuestDelay("careen_mutineers19_G", 1.0);
		break;

		case "careen_mutineers19_G":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "quest", "duel_christian");

			LAi_QuestDelay("careen_mutineers20", 1.0);
		break;

		case "careen_mutineers20":
			ChangeCharacterAddressGroup(characterFromID("Caesar"), "BB_careen_shore", "quest", "duel2_caesar");
			PlaySound("OBJECTS\DUEL\sabre_out.wav");
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(Pchar, true);
			LAi_QuestDelay("pchar_hip_mode_check", 0.1);

			LAi_group_MoveCharacter(characterFromID("Caesar"), LAI_GROUP_PLAYER);
			LAi_group_MoveCharacter(characterFromID("Constable Mills"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("Midshipman Young"), "ROOF_THUGS_1");
			LAi_group_Register("ROOF_THUGS_1");
			LAi_group_SetRelation(LAI_GROUP_PLAYER, "ROOF_THUGS_1", LAI_GROUP_ENEMY);
			LAi_group_FightGroups(LAI_GROUP_PLAYER, "ROOF_THUGS_1", true);

			Pchar.quest.careen_mutineers20_A.win_condition.l1 = "NPC_Death";
			Pchar.quest.careen_mutineers20_A.win_condition.l1.character = "Constable Mills";
			Pchar.quest.careen_mutineers20_A.win_condition.l2 = "NPC_Death";
			Pchar.quest.careen_mutineers20_A.win_condition.l2.character = "Midshipman Young";
			Pchar.quest.careen_mutineers20_A.win_condition = "careen_mutineers20_A";
		break;

		case "careen_mutineers20_A":
			PlaySound("OBJECTS\ABORDAGE\abordage_wining.wav");
			if(LAi_IsFightMode(Pchar)) {LAi_SetFightMode(Pchar, false);}

			RemoveCharacterEquip(characterFromID("Constable Mills"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Constable Mills"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Constable Mills"), "items");
			AddMoneyToCharacter(characterFromID("Constable Mills"), -1000);
			RemoveCharacterEquip(characterFromID("Midshipman Young"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Midshipman Young"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Midshipman Young"), "items");
			AddMoneyToCharacter(characterFromID("Midshipman Young"), -1000);

			GiveItem2Character(Pchar, "blade3"); GiveItem2Character(Pchar, "blade2");
			GiveItem2Character(Pchar, "pistol6"); GiveItem2Character(Pchar, "pistol5");
			TakenItems(Pchar, "pistolbullets", 6);
			TakenItems(Pchar, "gunpowder", 6);
			AddMoneyToCharacter(Pchar, 300);

			LAi_QuestDelay("careen_mutineers20_B", 2.0);
		break;

		case "careen_mutineers20_B":
			ChangeCharacterAddressGroup(characterFromID("Constable Mills"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("Midshipman Young"), "none", "", "");
			SetNextWeather("Clear");
			SetNextWind("N",30);
			
			Locations[FindLocation("BB_careen_shore")].image = "";
			DoQuestReloadToLocation("BB_careen_shore", "quest", "duel_pyle" ,"careen_mutineers20_C");
		break;

		case "careen_mutineers20_C":
			ChangeCharacterAddressGroup(characterFromID("Caesar"), "BB_careen_shore", "quest", "duel2_caesar");
			RemoveCharacterEquip(characterFromID("Caesar"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("Caesar"), "bladeanchor");
			GiveItem2Character(characterFromID("Caesar"), "blade4");
			EquipCharacterByItem(characterFromID("Caesar"), "blade4");
			GiveItem2Character(characterFromID("Caesar"), "PiratesPistol");
			EquipCharacterByItem(characterFromID("Caesar"), "PiratesPistol");
			TakenItems(characterFromID("Caesar"), "pistolbullets", 2);
			TakenItems(characterFromID("Caesar"), "gunpowder", 2);
		
			TakeItemFromCharacter(Pchar, "blade4");
			TakeItemFromCharacter(Pchar, "PiratesPistol");
			TakenItems(Pchar, "pistolbullets", -2);
			TakenItems(Pchar, "gunpowder", -2);
		
			Locations[FindLocation("BB_careen_shore")].image = "Outside_Shore_6.tga";

			LAi_QuestDelay("careen_mutineers21", 1.0);
		break;

		case "careen_mutineers21":
			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_careen_shore", "goto", "locator11");
			ChangeCharacterAddressGroup(characterFromID("Pell"), "BB_careen_shore", "box", "box14");
			RemoveCharacterEquip(characterFromID("Hands"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Hands"), BLADE_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Pell"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Pell"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Hands"), "items");
			AddMoneyToCharacter(characterFromID("Hands"), -1000);
			DeleteAttribute(characterFromID("Pell"), "items");
			AddMoneyToCharacter(characterFromID("Pell"), -1000);
			LAi_SetActorType(characterFromID("Hands"));
			LAi_SetStayType(characterFromID("Pell"));
			LAi_ActorRunToLocator(characterFromID("Hands"), "quest", "duel_christian", "careen_mutineers22", 30.0);

			LAi_QuestDelay("careen_mutineers21_A", 2.0);
		break;

		case "careen_mutineers21_A":
			Characters[GetCharacterIndex("Caesar")].dialog.CurrentNode  = "shore_runner";
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorDialogNow(characterFromID("Caesar"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Caesar"));
		break;
		
		case "careen_mutineers21_B":
			//check if Hands already is in place

			if(CheckAttribute(Pchar, "Hands_running") && Pchar.Hands_running == "finished")
			{
				LAi_QuestDelay("careen_mutineers24", 0.1);
			}
			else LAi_QuestDelay("careen_mutineers21_C", 2.0);
		break;

		case "careen_mutineers21_C":
			Characters[GetCharacterIndex("Caesar")].dialog.CurrentNode  = "shore_runner1";
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorDialogNow(characterFromID("Caesar"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Caesar"));
		break;

		case "careen_mutineers21_D":
			//check if Hands already is in place

			if(CheckAttribute(Pchar, "Hands_running") && Pchar.Hands_running == "finished")
			{
				LAi_QuestDelay("careen_mutineers24", 0.1);
			}
			else LAi_QuestDelay("careen_mutineers21_E", 2.0);
		break;

		case "careen_mutineers21_E":
			Characters[GetCharacterIndex("Caesar")].dialog.CurrentNode  = "shore_runner2";
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorDialogNow(characterFromID("Caesar"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Caesar"));
		break;

		case "careen_mutineers21_F":
			//Caesar's dialog is done
			//now check if Hands is in place

			Pchar.careen_runner = "Hands";

			PlaySound("PEOPLE\clothes1.wav");
			LAi_SetStayType(Pchar);
			LAi_SetOfficerType(characterFromID("Caesar"));
			Characters[GetCharacterIndex("Caesar")].dialog.CurrentNode  = "neutral";

			GiveItem2Character(Pchar, "pistolbelt");
			EquipCharacterByItem(Pchar, "pistolbelt");
			SetModel(PChar, "Howard_Pyle_b", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);
			GiveItem2Character(Pchar, "picture8_A");

			if(CheckAttribute(Pchar, "Hands_running") && Pchar.Hands_running == "finished")
			{
				LAi_QuestDelay("careen_mutineers24", 0.1);
			}

			LAi_QuestDelay("pchar_yah", 1.0);
		break;

		case "careen_mutineers22":
			AddPassenger(Pchar, characterFromID("Hands"), 0);
			SetOfficersIndex(Pchar, 1, getCharacterIndex("Hands"));
			LAi_SetOfficerType(characterFromID("Hands"));

			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorTurnToCharacter(characterFromID("Caesar"), characterFromID("Hands"));
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Hands"));
			
			LAi_QuestDelay("careen_mutineers22_A", 4.0);
		break;

		case "careen_mutineers22_A":
			//Hands is in place
			//now check if Caesar's dialog is done

			Pchar.Hands_running = "finished";

			if(CheckAttribute(Pchar, "careen_runner") && Pchar.careen_runner == "Hands")
			{
				LAi_QuestDelay("careen_mutineers24", 0.1);
			}
		break;

		case "careen_mutineers24":
			if(CheckAttribute(Pchar, "4_survivors") && Pchar.4_survivors == "done") return;	//Hands start dialog already done

			characters[GetCharacterIndex("Hands")].dialog.CurrentNode = "careen_shore";
			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorDialog(characterFromID("Hands"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hands"));
		break;

		case "careen_mutineers23":
			Characters[GetCharacterIndex("Caesar")].dialog.CurrentNode  = "Hands_is_back";
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorDialogNow(characterFromID("Caesar"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Caesar"));
		break;

		case "careen_mutineers23_A":
			//from Caesar dialog - all ready for (cannon shot) new captain etc talk

			Pchar.4_survivors = "done";

			LAi_SetPlayerType(Pchar);//temp

			LAi_QuestDelay("careen_mutineers25", 1.0);
		break;

		case "careen_mutineers25":
			Characters[GetCharacterIndex("Mutineer_32")].dialog.CurrentNode  = "careen_mutineers25";
			LAi_SetActorType(characterFromID("Mutineer_32"));
			LAi_ActorDialogNow(characterFromID("Mutineer_32"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Mutineer_32"));
		break;

		case "careen_mutineers25_A":
			Characters[GetCharacterIndex("Mutineer_8")].Dialog.Filename = "Mutiny leader_dialog.c";

			Characters[GetCharacterIndex("Mutineer_8")].dialog.CurrentNode  = "careen_mutineers25_A";
			LAi_SetActorType(characterFromID("Mutineer_8"));
			LAi_ActorDialogNow(characterFromID("Mutineer_8"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Mutineer_8"));
		break;

		case "careen_mutineers25_B":
			LAi_SetActorType(characterFromID("Mutineer_8"));
			LAi_ActorTurnToLocator(characterFromID("Mutineer_8"), "quest", "duel_m22");

			Characters[GetCharacterIndex("Mutineer_32")].dialog.CurrentNode  = "careen_mutineers25_B";
			LAi_SetActorType(characterFromID("Mutineer_32"));
			LAi_ActorDialogNow(characterFromID("Mutineer_32"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Mutineer_32"));
		break;

		case "careen_mutineers25_C":
			Characters[GetCharacterIndex("Mutineer_11")].Dialog.Filename = "Mutiny leader_dialog.c";

			Characters[GetCharacterIndex("Mutineer_11")].dialog.CurrentNode  = "careen_mutineers25_C";
			LAi_SetActorType(characterFromID("Mutineer_11"));
			LAi_ActorDialogNow(characterFromID("Mutineer_11"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Mutineer_11"));
		break;

		case "careen_mutineers25_D":
			LAi_SetActorType(characterFromID("Mutineer_11"));
			LAi_ActorTurnToLocator(characterFromID("Mutineer_11"), "quest", "duel_m25");

			PlaySound("AMBIENT\man_laughter.wav");
			PlaySound("AMBIENT\cheer.wav");

			LAi_QuestDelay("careen_mutineers25_E", 3.0);
		break;

		case "careen_mutineers25_E":
			PlaySound("AMBIENT\TAVERN\Tavern_001.wav");

			LAi_QuestDelay("careen_mutineers25_F", 3.0);
		break;

		case "careen_mutineers25_F":
			Characters[GetCharacterIndex("Mutineer_20")].Dialog.Filename = "Mutiny leader_dialog.c";

			Characters[GetCharacterIndex("Mutineer_20")].dialog.CurrentNode  = "careen_mutineers25_F";
			LAi_SetActorType(characterFromID("Mutineer_20"));
			LAi_ActorDialogNow(characterFromID("Mutineer_20"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Mutineer_20"));
		break;

		case "careen_mutineers25_G":
			LAi_SetActorType(characterFromID("Mutineer_20"));
			LAi_ActorTurnToLocator(characterFromID("Mutineer_20"), "quest", "duel_m6");

			Characters[GetCharacterIndex("Mutineer_12")].Dialog.Filename = "Mutiny leader_dialog.c";

			Characters[GetCharacterIndex("Mutineer_12")].dialog.CurrentNode  = "careen_mutineers25_G";
			LAi_SetActorType(characterFromID("Mutineer_12"));
			LAi_ActorDialogNow(characterFromID("Mutineer_12"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Mutineer_3"));
		break;

		case "careen_mutineers25_H":
			LAi_SetActorType(characterFromID("Mutineer_12"));
			LAi_ActorTurnToLocator(characterFromID("Mutineer_12"), "quest", "duel_m26");

			Characters[GetCharacterIndex("Mutineer_32")].dialog.CurrentNode  = "careen_mutineers25_H";
			LAi_SetActorType(characterFromID("Mutineer_32"));
			LAi_ActorDialogNow(characterFromID("Mutineer_32"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Mutineer_32"));
		break;
	//------------------------------------------------------------------------------------------------------
		case "careen_mutineers26":
			LAi_SetActorType(characterFromID("Mutineer_32"));
			LAi_ActorTurnToLocator(characterFromID("Mutineer_32"), "quest", "duel_m9");

			PlaySound("VOICE\ENGLISH\Desmond Ray Beltrop.wav");		//RIGHT: There's no place for you here, youngster
			PlaySound("VOICE\ENGLISH\Desmond Ray Beltrop.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Mutineer_3"));

			LAi_QuestDelay("careen_mutineers26_C", 4.0);
		break;

		case "careen_mutineers26_C":
			PlaySound("VOICE\ENGLISH\Fre_m_c_052.wav");			//LEFT: Tah hah, bad move capitaine
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Mutineer_20"));

			LAi_QuestDelay("careen_mutineers26_B", 3.5);
		break;
	
		case "careen_mutineers26_B":
			PlaySound("VOICE\ENGLISH\Dut_m_a_033.wav");			//RIGHT: I don't think I like your attitude hond
			PlaySound("VOICE\ENGLISH\Dut_m_a_033.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Mutineer_5"));

			LAi_QuestDelay("careen_mutineers26_E", 3.0);
		break;

		case "careen_mutineers26_E":
			PlaySound("VOICE\ENGLISH\Spa_m_a_030.wav");			//LEFT: Keep your distance perro
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Mutineer_31"));

			LAi_QuestDelay("careen_mutineers26_F", 3.0);
		break;

		case "careen_mutineers26_F":
			PlaySound("VOICE\ENGLISH\Fre_m_b_040.wav");			//RIGHT: Watch where you are going imbecille
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Mutineer_6"));

			LAi_QuestDelay("careen_mutineers26_G", 2.0);
		break;

		case "careen_mutineers26_G":
			PlaySound("VOICE\ENGLISH\Eng_m_b_056.wav");			//LEFT: Your days are at an end rogue
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Mutineer_15"));

			LAi_QuestDelay("careen_mutineers26_H", 3.0);
		break;

		case "careen_mutineers26_H":
			PlaySound("VOICE\ENGLISH\Eng_m_a_053.wav");			//RIGHT: Your career as a scoundrel has ended
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Mutineer_7"));

			LAi_QuestDelay("careen_mutineers26_J", 4.0);
		break;

		case "careen_mutineers26_J":
			PlaySound("VOICE\ENGLISH\Dut_m_a_043.wav");			//LEFT: I will gut you like a fish
			PlaySound("VOICE\ENGLISH\Dut_m_a_043.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Mutineer_24"));

			LAi_QuestDelay("careen_mutineers26_K", 3.0);
		break;

		case "careen_mutineers26_K":
			PlaySound("VOICE\ENGLISH\Eng_m_a_059.wav");			//RIGHT: Check and mate
			LAi_SetPlayerType(characterFromID("Mutineer_11"));
			LAi_SetFightMode(characterFromID("Mutineer_11"), true);
	
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Mutineer_11"));

			LAi_QuestDelay("careen_mutineers27", 1.5);
		break;
	//------------------------------------------------------------------------------------------------------
	
		case "careen_mutineers27":
			PlaySound("OBJECTS\DUEL\sword_sh.wav");
			LAi_SetActorType(PChar);
			LAi_ActorTurnToLocator(PChar, "quest", "duel_christian");

			LAi_SetPlayerType(characterFromID("Mutineer_24"));
			LAi_SetFightMode(characterFromID("Mutineer_24"), true);
			LAi_SetPlayerType(characterFromID("Mutineer_15"));
			LAi_SetFightMode(characterFromID("Mutineer_15"), true);

			LAi_QuestDelay("careen_mutineers27_A", 1.0);
		break;

		case "careen_mutineers27_A":
			PlaySound("OBJECTS\DUEL\sabre_out.wav");
			LAi_SetPlayerType(characterFromID("Mutineer_3"));
			LAi_SetFightMode(characterFromID("Mutineer_3"), true);
			LAi_SetPlayerType(characterFromID("Mutineer_5"));
			LAi_SetFightMode(characterFromID("Mutineer_5"), true);
			LAi_SetPlayerType(characterFromID("Mutineer_6"));
			LAi_SetFightMode(characterFromID("Mutineer_6"), true);
			LAi_SetPlayerType(characterFromID("Mutineer_7"));
			LAi_SetFightMode(characterFromID("Mutineer_7"), true);

			LAi_QuestDelay("careen_mutineers27_B", 0.5);
		break;

		case "careen_mutineers27_B":
			PlaySound("OBJECTS\DUEL\sword_sh.wav");
			PlaySound("OBJECTS\DUEL\sabre_out.wav");
			LAi_SetPlayerType(characterFromID("Mutineer_32"));
			LAi_SetFightMode(characterFromID("Mutineer_32"), true);
			LAi_SetPlayerType(characterFromID("Mutineer_20"));
			LAi_SetFightMode(characterFromID("Mutineer_20"), true);
			LAi_SetPlayerType(characterFromID("Mutineer_31"));
			LAi_SetFightMode(characterFromID("Mutineer_31"), true);

			LAi_QuestDelay("careen_mutineers28", 2.0);
		break;
	
	//------------------------------------------------------------------------------------------------------

		case "careen_mutineers28":
			PlaySound("OBJECTS\SHIPCHARGE\CR12C.wav");
		
			CreateParticleSystem("canfire2" , 89.6, 16.9, 40.8, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 89.6, 16.9, 40.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 89.6, 16.9, 41.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 89.6, 16.9, 40.8, 0.0, 0.0, 0.0, sti(20) );

			LAi_SetActorType(PChar);
			LAi_ActorTurnToLocator(PChar, "quest", "duel_christian");

			LAi_SetFightMode(characterFromID("Mutineer_11"), false);
			LAi_SetFightMode(characterFromID("Mutineer_24"), false);
			LAi_SetFightMode(characterFromID("Mutineer_15"), false);
			LAi_SetFightMode(characterFromID("Mutineer_3"), false);
			LAi_SetFightMode(characterFromID("Mutineer_5"), false);
			LAi_SetFightMode(characterFromID("Mutineer_6"), false);
			LAi_SetFightMode(characterFromID("Mutineer_7"), false);
			LAi_SetFightMode(characterFromID("Mutineer_32"), false);
			LAi_SetFightMode(characterFromID("Mutineer_20"), false);
			LAi_SetFightMode(characterFromID("Mutineer_31"), false);

			PlaySound("PEOPLE\recoil.wav");
			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_careen_shore", "quest", "duel_hands");

			LAi_QuestDelay("careen_mutineers28_AA", 1.0);
			LAi_QuestDelay("careen_mutineers28_A", 2.0);
			LAi_QuestDelay("careen_mutineers28_0", 3.0);
		break;

		case "careen_mutineers28_0":
			CreateParticleSystem("gunfire" , 89.6, 16.9, 40.8, 0.0, 4.5, 0.0, sti(20) );
		break;

		case "careen_mutineers28_AA":
			LAi_SetActorType(characterFromID("Mutineer_31"));
			LAi_ActorTurnToLocator(characterFromID("Mutineer_31"), "box", "box13");
			LAi_SetActorType(characterFromID("Mutineer_14"));
			LAi_ActorTurnToLocator(characterFromID("Mutineer_14"), "box", "box13");
			LAi_SetActorType(characterFromID("Mutineer_27"));
			LAi_ActorTurnToLocator(characterFromID("Mutineer_27"), "box", "box13");
			LAi_SetActorType(characterFromID("Mutineer_13"));
			LAi_ActorTurnToLocator(characterFromID("Mutineer_13"), "box", "box13");
			LAi_SetActorType(characterFromID("Mutineer_26"));
			LAi_ActorTurnToLocator(characterFromID("Mutineer_26"), "box", "box13");
			LAi_SetActorType(characterFromID("Mutineer_12"));
			LAi_ActorTurnToLocator(characterFromID("Mutineer_12"), "box", "box13");
			LAi_SetActorType(characterFromID("Mutineer_25"));
			LAi_ActorTurnToLocator(characterFromID("Mutineer_25"), "box", "box13");
			LAi_SetActorType(characterFromID("Mutineer_11"));
			LAi_ActorTurnToLocator(characterFromID("Mutineer_11"), "box", "box13");
			LAi_SetActorType(characterFromID("Mutineer_24"));
			LAi_ActorTurnToLocator(characterFromID("Mutineer_24"), "box", "box13");
			LAi_SetActorType(characterFromID("Mutineer_10"));
			LAi_ActorTurnToLocator(characterFromID("Mutineer_10"), "box", "box13");
			LAi_SetActorType(characterFromID("Mutineer_32"));
			LAi_ActorTurnToLocator(characterFromID("Mutineer_32"), "box", "box13");
			LAi_SetActorType(characterFromID("Mutineer_9"));
			LAi_ActorTurnToLocator(characterFromID("Mutineer_9"), "box", "box13");
			LAi_SetActorType(characterFromID("Mutineer_22"));
			LAi_ActorTurnToLocator(characterFromID("Mutineer_22"), "box", "box13");
			LAi_SetActorType(characterFromID("Mutineer_8"));
			LAi_ActorTurnToLocator(characterFromID("Mutineer_8"), "box", "box13");
			LAi_SetActorType(characterFromID("Mutineer_7"));
			LAi_ActorTurnToLocator(characterFromID("Mutineer_7"), "box", "box13");
		break;
	
		case "careen_mutineers28_A":
			characters[GetCharacterIndex("Hands")].dialog.CurrentNode = "Pell_shooting";
			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorDialog(characterFromID("Hands"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hands"));
		break;
	
		case "careen_mutineers28_B":
			PlaySound("OBJECTS\SHIPCHARGE\gunner_fire.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Mutineer_32"));
			Locations[FindLocation("BB_careen_shore")].image = "Outside_Shore_6.tga";

			LAi_QuestDelay("careen_mutineers29", 1.0);
		break;

		case "careen_mutineers29":
			//GROUP 1

			PauseAllSounds();//stops music
			locations[FindLocation("BB_careen_shore")].type = "rush_seashore";
			PostEvent("LoadSceneSound", 0.1);

			Pchar.careen_running = "started";

			LAi_SetActorType(PChar);
			LAi_ActorTurnToLocator(PChar, "quest", "duel_christian");

			LAi_SetActorType(characterFromID("Mutineer_31"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_31"), "goto", "gun1A", "gun1A", 64.0);
			LAi_SetActorType(characterFromID("Mutineer_10"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_10"), "goto", "gun1B", "gun1B", 70.0);
			LAi_SetActorType(characterFromID("Mutineer_4"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_4"), "goto", "gun_group1", "gun_group1", 71.0);
			LAi_SetActorType(characterFromID("Mutineer_20"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_20"), "goto", "gun2A", "gun2A", 61.0);
			LAi_SetActorType(characterFromID("Mutineer_15"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_15"), "goto", "gun2B", "gun2B", 60.0);

			LAi_QuestDelay("careen_mutineers29_A", 1.0);
		break;

		case "careen_mutineers29_A":
			//GROUP 2

			Pchar.careen_guns = "ready";

			LAi_SetActorType(characterFromID("Mutineer_25"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_25"), "goto", "gun3A", "gun3A", 60.0);
			LAi_SetActorType(characterFromID("Mutineer_16"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_16"), "goto", "gun3B", "gun3B", 60.0);
			LAi_SetActorType(characterFromID("Mutineer_3"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_3"), "goto", "gun_group2", "gun_group2", 60.0);
			LAi_SetActorType(characterFromID("Mutineer_17"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_17"), "goto", "gun4A", "gun4A", 55.0);
			LAi_SetActorType(characterFromID("Mutineer_26"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_26"), "goto", "gun4B", "gun4B", 55.0);
			LAi_SetActorType(characterFromID("Mutineer_8"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_8"), "goto", "gun5A", "gun5A", 50.0);
			LAi_SetActorType(characterFromID("Mutineer_22"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_22"), "goto", "gun5B", "gun5B", 50.0);

			LAi_QuestDelay("careen_mutineers29_B", 1.0);
		break;

		case "careen_mutineers29_B":
			//GROUP 3

			LAi_SetActorType(characterFromID("Mutineer_14"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_14"), "goto", "gun6A", "gun6A", 43.0);
			LAi_SetActorType(characterFromID("Mutineer_18"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_18"), "goto", "gun6B", "gun6B", 43.0);
			LAi_SetActorType(characterFromID("Mutineer_9"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_9"), "goto", "gun_group3", "gun_group3", 43.0);
			LAi_SetActorType(characterFromID("Mutineer_32"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_32"), "goto", "gun_commander", "gun_commander", 43.0);
			LAi_SetActorType(characterFromID("Mutineer_21"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_21"), "goto", "gun7A", "gun7A", 43.0);
			LAi_SetActorType(characterFromID("Mutineer_27"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_27"), "goto", "gun7B", "gun7B", 43.0);

			LAi_QuestDelay("careen_mutineers29_C", 1.0);
		break;

		case "careen_mutineers29_C":
			//GROUP 4

			LAi_SetActorType(characterFromID("Mutineer_13"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_13"), "goto", "gun8A", "gun8A", 30.0);
			LAi_SetActorType(characterFromID("Mutineer_24"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_24"), "goto", "gun8B", "gun8B", 30.0);
			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorRunToLocator(characterFromID("Hands"), "goto", "gun_group4", "gun_group4", 30.0);
			LAi_SetActorType(characterFromID("Mutineer_5"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_5"), "goto", "gun9A", "gun9A", 25.0);
			LAi_SetActorType(characterFromID("Mutineer_2"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_2"), "goto", "gun9B", "gun9B", 25.0);
			LAi_SetActorType(characterFromID("Mutineer_19"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_19"), "goto", "gun10A", "gun10A", 20.0);
			LAi_SetActorType(characterFromID("Mutineer_6"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_6"), "goto", "gun10B", "gun10B", 20.0);

			LAi_QuestDelay("careen_mutineers29_D", 1.0);
		break;

		case "careen_mutineers29_D":
			//GROUP 5

			LAi_SetActorType(characterFromID("Mutineer_7"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_7"), "goto", "gun11A", "gun11A", 10.0);
			LAi_SetActorType(characterFromID("Mutineer_12"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_12"), "goto", "gun11B", "gun11B", 10.0);
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorRunToLocator(characterFromID("Caesar"), "goto", "gun_group5", "gun_group5", 10.0);
			LAi_SetActorType(characterFromID("Mutineer_1"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_1"), "goto", "gun12A", "gun12A", 10.0);
			LAi_SetActorType(characterFromID("Mutineer_11"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_11"), "goto", "gun12B", "gun12B", 10.0);

			LAi_QuestDelay("careen_mutineers29_E", 1.0);
		break;

		case "careen_mutineers29_E":
			LAi_SetActorType(PChar);
			LAi_ActorGoToLocator(Pchar, "goto", "tower_down", "careen_mutineers30", 43.0);
			Characters[GetCharacterIndex("Mutineer_32")].name = TranslateString("", "Quartermaster");
		break;
		
	//-------------------------------------------------------------------------------------------------------------------
		case "gun1A":  	ChangeCharacterAddressGroup(characterFromID("Mutineer_31"), "BB_careen_shore", "goto", "gun1A");
			       	LAi_SetStayType(characterFromID("Mutineer_31")); 

				RemoveCharacterEquip(characterFromID("Mutineer_31"), BLADE_ITEM_TYPE);
				GiveItem2Character(characterFromID("Mutineer_31"), "bladeladle");
				EquipCharacterByItem(characterFromID("Mutineer_31"), "bladeladle");
				GiveItem2Character(characterFromID("Mutineer_31"), "pistolsponge");
				EquipCharacterByItem(characterFromID("Mutineer_31"), "pistolsponge");
		break;

		case "gun1B":   ChangeCharacterAddressGroup(characterFromID("Mutineer_10"), "BB_careen_shore", "goto", "gun1B");
			        LAi_SetStayType(characterFromID("Mutineer_10")); 
			        Pchar.careen_running = "done";

				RemoveCharacterEquip(characterFromID("Mutineer_10"), BLADE_ITEM_TYPE);
				GiveItem2Character(characterFromID("Mutineer_10"), "bladerammer");
				EquipCharacterByItem(characterFromID("Mutineer_10"), "bladerammer");
				GiveItem2Character(characterFromID("Mutineer_10"), "pistolcannon_ball");
				EquipCharacterByItem(characterFromID("Mutineer_10"), "pistolcannon_ball");
		break;

		case "gun_group1": ChangeCharacterAddressGroup(characterFromID("Mutineer_4"), "BB_careen_shore", "goto", "gun_group1");
		 	           LAi_SetStayType(characterFromID("Mutineer_4")); 

				   RemoveCharacterEquip(characterFromID("Mutineer_4"), BLADE_ITEM_TYPE);
				   GiveItem2Character(characterFromID("Mutineer_4"), "bladepowderhornN");
				   EquipCharacterByItem(characterFromID("Mutineer_4"), "bladepowderhornN");
				   GiveItem2Character(characterFromID("Mutineer_4"), "pistolbarrel4");
				   EquipCharacterByItem(characterFromID("Mutineer_4"), "pistolbarrel4");
		break;

		case "gun2A":   ChangeCharacterAddressGroup(characterFromID("Mutineer_20"), "BB_careen_shore", "goto", "gun2A");
			        LAi_SetStayType(characterFromID("Mutineer_20")); 

				RemoveCharacterEquip(characterFromID("Mutineer_20"), BLADE_ITEM_TYPE);
				GiveItem2Character(characterFromID("Mutineer_20"), "bladeladle");
				EquipCharacterByItem(characterFromID("Mutineer_20"), "bladeladle");
				GiveItem2Character(characterFromID("Mutineer_20"), "pistolsponge");
				EquipCharacterByItem(characterFromID("Mutineer_20"), "pistolsponge");
		break;

		case "gun2B":   ChangeCharacterAddressGroup(characterFromID("Mutineer_15"), "BB_careen_shore", "goto", "gun2B");
			        LAi_SetStayType(characterFromID("Mutineer_15")); 

				RemoveCharacterEquip(characterFromID("Mutineer_15"), BLADE_ITEM_TYPE);
				GiveItem2Character(characterFromID("Mutineer_15"), "bladecannon_ball");
				EquipCharacterByItem(characterFromID("Mutineer_15"), "bladecannon_ball");
				GiveItem2Character(characterFromID("Mutineer_15"), "pistolrammer");
				EquipCharacterByItem(characterFromID("Mutineer_15"), "pistolrammer");
		break;
	//-------------------------------------------------------------------------------------------------------------------
		case "gun3A":   ChangeCharacterAddressGroup(characterFromID("Mutineer_25"), "BB_careen_shore", "goto", "gun3A");
			        LAi_SetStayType(characterFromID("Mutineer_25")); 

				RemoveCharacterEquip(characterFromID("Mutineer_25"), BLADE_ITEM_TYPE);
				GiveItem2Character(characterFromID("Mutineer_25"), "bladesponge");
				EquipCharacterByItem(characterFromID("Mutineer_25"), "bladesponge");
				GiveItem2Character(characterFromID("Mutineer_25"), "pistolwad");
				EquipCharacterByItem(characterFromID("Mutineer_25"), "pistolwad");
		break;

		case "gun3B":   ChangeCharacterAddressGroup(characterFromID("Mutineer_16"), "BB_careen_shore", "goto", "gun3B");
			        LAi_SetStayType(characterFromID("Mutineer_16")); 

				RemoveCharacterEquip(characterFromID("Mutineer_16"), BLADE_ITEM_TYPE);
				GiveItem2Character(characterFromID("Mutineer_16"), "bladecannon_ball");
				EquipCharacterByItem(characterFromID("Mutineer_16"), "bladecannon_ball");
				GiveItem2Character(characterFromID("Mutineer_16"), "pistolrammer");
				EquipCharacterByItem(characterFromID("Mutineer_16"), "pistolrammer");
		break;

		case "gun_group2": ChangeCharacterAddressGroup(characterFromID("Mutineer_3"), "BB_careen_shore", "goto", "gun_group2");
			           LAi_SetStayType(characterFromID("Mutineer_3")); 

				   RemoveCharacterEquip(characterFromID("Mutineer_3"), BLADE_ITEM_TYPE);
				   GiveItem2Character(characterFromID("Mutineer_3"), "bladepowderhornN");
				   EquipCharacterByItem(characterFromID("Mutineer_3"), "bladepowderhornN");
				   GiveItem2Character(characterFromID("Mutineer_3"), "pistolbarrel4");
				   EquipCharacterByItem(characterFromID("Mutineer_3"), "pistolbarrel4");
		break;

		case "gun4A":   ChangeCharacterAddressGroup(characterFromID("Mutineer_17"), "BB_careen_shore", "goto", "gun4A");
			        LAi_SetStayType(characterFromID("Mutineer_17")); 

				RemoveCharacterEquip(characterFromID("Mutineer_17"), BLADE_ITEM_TYPE);
				GiveItem2Character(characterFromID("Mutineer_17"), "bladeladle");
				EquipCharacterByItem(characterFromID("Mutineer_17"), "bladeladle");
				GiveItem2Character(characterFromID("Mutineer_17"), "pistolsponge");
				EquipCharacterByItem(characterFromID("Mutineer_17"), "pistolsponge");
		break;

		case "gun4B":   ChangeCharacterAddressGroup(characterFromID("Mutineer_26"), "BB_careen_shore", "goto", "gun4B");
			        LAi_SetStayType(characterFromID("Mutineer_26")); 

				RemoveCharacterEquip(characterFromID("Mutineer_26"), BLADE_ITEM_TYPE);
				GiveItem2Character(characterFromID("Mutineer_26"), "bladecannon_ball");
				EquipCharacterByItem(characterFromID("Mutineer_26"), "bladecannon_ball");
				GiveItem2Character(characterFromID("Mutineer_26"), "pistolboom");
				EquipCharacterByItem(characterFromID("Mutineer_26"), "pistolboom");
		break;

		case "gun5A":   ChangeCharacterAddressGroup(characterFromID("Mutineer_8"), "BB_careen_shore", "goto", "gun5A");
			        LAi_SetStayType(characterFromID("Mutineer_8")); 

				RemoveCharacterEquip(characterFromID("Mutineer_8"), BLADE_ITEM_TYPE);
				GiveItem2Character(characterFromID("Mutineer_8"), "bladesponge");
				EquipCharacterByItem(characterFromID("Mutineer_8"), "bladesponge");
				GiveItem2Character(characterFromID("Mutineer_8"), "pistolcannon_ball");
				EquipCharacterByItem(characterFromID("Mutineer_8"), "pistolcannon_ball");
		break;

		case "gun5B": ChangeCharacterAddressGroup(characterFromID("Mutineer_22"), "BB_careen_shore", "goto", "gun5B");
			      LAi_SetStayType(characterFromID("Mutineer_22")); 

				RemoveCharacterEquip(characterFromID("Mutineer_22"), BLADE_ITEM_TYPE);
				GiveItem2Character(characterFromID("Mutineer_22"), "bladeladle");
				EquipCharacterByItem(characterFromID("Mutineer_22"), "bladeladle");
				GiveItem2Character(characterFromID("Mutineer_22"), "pistolrammer");
				EquipCharacterByItem(characterFromID("Mutineer_22"), "pistolrammer");
		break;
	//-------------------------------------------------------------------------------------------------------------------	
		case "gun6A":   ChangeCharacterAddressGroup(characterFromID("Mutineer_14"), "BB_careen_shore", "goto", "gun6A");
			        LAi_SetStayType(characterFromID("Mutineer_14")); 

				RemoveCharacterEquip(characterFromID("Mutineer_14"), BLADE_ITEM_TYPE);
				GiveItem2Character(characterFromID("Mutineer_14"), "bladeladle");
				EquipCharacterByItem(characterFromID("Mutineer_14"), "bladeladle");
				GiveItem2Character(characterFromID("Mutineer_14"), "pistolsponge");
				EquipCharacterByItem(characterFromID("Mutineer_14"), "pistolsponge");
		break;

		case "gun6B":   ChangeCharacterAddressGroup(characterFromID("Mutineer_18"), "BB_careen_shore", "goto", "gun6B");
			        LAi_SetStayType(characterFromID("Mutineer_18")); 

				RemoveCharacterEquip(characterFromID("Mutineer_18"), BLADE_ITEM_TYPE);
				GiveItem2Character(characterFromID("Mutineer_18"), "bladerammer");
				EquipCharacterByItem(characterFromID("Mutineer_18"), "bladerammer");
				GiveItem2Character(characterFromID("Mutineer_18"), "pistolcannon_ball");
				EquipCharacterByItem(characterFromID("Mutineer_18"), "pistolcannon_ball");
		break;

		case "gun_group3": ChangeCharacterAddressGroup(characterFromID("Mutineer_9"), "BB_careen_shore", "goto", "gun_group3");
		 	           LAi_SetStayType(characterFromID("Mutineer_9")); 

				   RemoveCharacterEquip(characterFromID("Mutineer_9"), BLADE_ITEM_TYPE);
				   GiveItem2Character(characterFromID("Mutineer_9"), "bladepowderhornN");
				   EquipCharacterByItem(characterFromID("Mutineer_9"), "bladepowderhornN");
				   GiveItem2Character(characterFromID("Mutineer_9"), "pistolbarrel4");
				   EquipCharacterByItem(characterFromID("Mutineer_9"), "pistolbarrel4");	
		break;

		case "gun_commander":   ChangeCharacterAddressGroup(characterFromID("Mutineer_32"), "BB_careen_shore", "goto", "gun_commander");
		 	                LAi_SetStayType(characterFromID("Mutineer_32")); 

					RemoveCharacterEquip(characterFromID("Mutineer_32"), BLADE_ITEM_TYPE);
					GiveItem2Character(characterFromID("Mutineer_32"), "blademegaphone");
					EquipCharacterByItem(characterFromID("Mutineer_32"), "blademegaphone");
		break;

		case "gun7A":   ChangeCharacterAddressGroup(characterFromID("Mutineer_21"), "BB_careen_shore", "goto", "gun7A");
			        LAi_SetStayType(characterFromID("Mutineer_21")); 

				RemoveCharacterEquip(characterFromID("Mutineer_21"), BLADE_ITEM_TYPE);
				GiveItem2Character(characterFromID("Mutineer_21"), "bladesponge");
				EquipCharacterByItem(characterFromID("Mutineer_21"), "bladesponge");
				GiveItem2Character(characterFromID("Mutineer_21"), "pistolwad");
				EquipCharacterByItem(characterFromID("Mutineer_21"), "pistolwad");
		break;

		case "gun7B":   ChangeCharacterAddressGroup(characterFromID("Mutineer_27"), "BB_careen_shore", "goto", "gun7B");
			        LAi_SetStayType(characterFromID("Mutineer_27")); 

				RemoveCharacterEquip(characterFromID("Mutineer_27"), BLADE_ITEM_TYPE);
				GiveItem2Character(characterFromID("Mutineer_27"), "bladecannon_ball");
				EquipCharacterByItem(characterFromID("Mutineer_27"), "bladecannon_ball");
				GiveItem2Character(characterFromID("Mutineer_27"), "pistolrammer");
				EquipCharacterByItem(characterFromID("Mutineer_27"), "pistolrammer");
		break;
	//-------------------------------------------------------------------------------------------------------------------	
		case "gun8A":   ChangeCharacterAddressGroup(characterFromID("Mutineer_13"), "BB_careen_shore", "goto", "gun8A");
			        LAi_SetStayType(characterFromID("Mutineer_13")); 

				RemoveCharacterEquip(characterFromID("Mutineer_13"), BLADE_ITEM_TYPE);
				GiveItem2Character(characterFromID("Mutineer_13"), "bladeladle");
				EquipCharacterByItem(characterFromID("Mutineer_13"), "bladeladle");
				GiveItem2Character(characterFromID("Mutineer_13"), "pistolsponge");
				EquipCharacterByItem(characterFromID("Mutineer_13"), "pistolsponge");
		break;

		case "gun8B":   ChangeCharacterAddressGroup(characterFromID("Mutineer_24"), "BB_careen_shore", "goto", "gun8B");
			        LAi_SetStayType(characterFromID("Mutineer_24")); 

				RemoveCharacterEquip(characterFromID("Mutineer_24"), BLADE_ITEM_TYPE);
				GiveItem2Character(characterFromID("Mutineer_24"), "bladecannon_ball");
				EquipCharacterByItem(characterFromID("Mutineer_24"), "bladecannon_ball");
				GiveItem2Character(characterFromID("Mutineer_24"), "pistolrammer");
				EquipCharacterByItem(characterFromID("Mutineer_24"), "pistolrammer");
		break;

		case "gun_group4": ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_careen_shore", "goto", "gun_group4");
			           LAi_SetStayType(characterFromID("Hands")); 

				   RemoveCharacterEquip(characterFromID("Hands"), BLADE_ITEM_TYPE);
				   GiveItem2Character(characterFromID("Hands"), "bladepowderhornN");
				   EquipCharacterByItem(characterFromID("Hands"), "bladepowderhornN");
				   GiveItem2Character(characterFromID("Hands"), "pistolbarrel4");
				   EquipCharacterByItem(characterFromID("Hands"), "pistolbarrel4");
		break;

		case "gun9A":   ChangeCharacterAddressGroup(characterFromID("Mutineer_5"), "BB_careen_shore", "goto", "gun9A");
			        LAi_SetStayType(characterFromID("Mutineer_5")); 

				RemoveCharacterEquip(characterFromID("Mutineer_5"), BLADE_ITEM_TYPE);
				GiveItem2Character(characterFromID("Mutineer_5"), "bladeladle");
				EquipCharacterByItem(characterFromID("Mutineer_5"), "bladeladle");
				GiveItem2Character(characterFromID("Mutineer_5"), "pistolsponge");
				EquipCharacterByItem(characterFromID("Mutineer_5"), "pistolsponge");
		break;

		case "gun9B":   ChangeCharacterAddressGroup(characterFromID("Mutineer_2"), "BB_careen_shore", "goto", "gun9B");
			        LAi_SetStayType(characterFromID("Mutineer_2")); 

				RemoveCharacterEquip(characterFromID("Mutineer_2"), BLADE_ITEM_TYPE);
				GiveItem2Character(characterFromID("Mutineer_2"), "bladecannon_ball");
				EquipCharacterByItem(characterFromID("Mutineer_2"), "bladecannon_ball");
				GiveItem2Character(characterFromID("Mutineer_2"), "pistolboom");
				EquipCharacterByItem(characterFromID("Mutineer_2"), "pistolboom");
		break;

		case "gun10A":  ChangeCharacterAddressGroup(characterFromID("Mutineer_19"), "BB_careen_shore", "goto", "gun10A");
			        LAi_SetStayType(characterFromID("Mutineer_19")); 

				RemoveCharacterEquip(characterFromID("Mutineer_19"), BLADE_ITEM_TYPE);
				GiveItem2Character(characterFromID("Mutineer_19"), "bladesponge");
				EquipCharacterByItem(characterFromID("Mutineer_19"), "bladesponge");
				GiveItem2Character(characterFromID("Mutineer_19"), "pistolcannon_ball");
				EquipCharacterByItem(characterFromID("Mutineer_19"), "pistolcannon_ball");
		break;

		case "gun10B":  ChangeCharacterAddressGroup(characterFromID("Mutineer_6"), "BB_careen_shore", "goto", "gun10B");
			        LAi_SetStayType(characterFromID("Mutineer_6")); 

				RemoveCharacterEquip(characterFromID("Mutineer_6"), BLADE_ITEM_TYPE);
				GiveItem2Character(characterFromID("Mutineer_6"), "bladeladle");
				EquipCharacterByItem(characterFromID("Mutineer_6"), "bladeladle");
				GiveItem2Character(characterFromID("Mutineer_6"), "pistolrammer");
				EquipCharacterByItem(characterFromID("Mutineer_6"), "pistolrammer");
		break;
	//-------------------------------------------------------------------------------------------------------------------	
		case "gun11A": ChangeCharacterAddressGroup(characterFromID("Mutineer_7"), "BB_careen_shore", "goto", "gun11A");
			       LAi_SetStayType(characterFromID("Mutineer_7")); 

				RemoveCharacterEquip(characterFromID("Mutineer_7"), BLADE_ITEM_TYPE);
				GiveItem2Character(characterFromID("Mutineer_7"), "bladerammer");
				EquipCharacterByItem(characterFromID("Mutineer_7"), "bladerammer");
				GiveItem2Character(characterFromID("Mutineer_7"), "pistolcannon_ball");
				EquipCharacterByItem(characterFromID("Mutineer_7"), "pistolcannon_ball");
		break;

		case "gun11B": ChangeCharacterAddressGroup(characterFromID("Mutineer_12"), "BB_careen_shore", "goto", "gun11B");
			       LAi_SetStayType(characterFromID("Mutineer_12")); 

				RemoveCharacterEquip(characterFromID("Mutineer_12"), BLADE_ITEM_TYPE);
				GiveItem2Character(characterFromID("Mutineer_12"), "bladeladle");
				EquipCharacterByItem(characterFromID("Mutineer_12"), "bladeladle");
				GiveItem2Character(characterFromID("Mutineer_12"), "pistolsponge");
				EquipCharacterByItem(characterFromID("Mutineer_12"), "pistolsponge");
		break;

		case "gun_group5": ChangeCharacterAddressGroup(characterFromID("Caesar"), "BB_careen_shore", "goto", "gun_group5");
		 	           LAi_SetStayType(characterFromID("Caesar")); 

				   RemoveCharacterEquip(characterFromID("Caesar"), BLADE_ITEM_TYPE);
				   GiveItem2Character(characterFromID("Caesar"), "bladepowderhornN");
				   EquipCharacterByItem(characterFromID("Caesar"), "bladepowderhornN");
				   GiveItem2Character(characterFromID("Caesar"), "pistolbarrel4");
				   EquipCharacterByItem(characterFromID("Caesar"), "pistolbarrel4");
		break;

		case "gun12A":  ChangeCharacterAddressGroup(characterFromID("Mutineer_1"), "BB_careen_shore", "goto", "gun12A");
			        LAi_SetStayType(characterFromID("Mutineer_1")); 

				RemoveCharacterEquip(characterFromID("Mutineer_1"), BLADE_ITEM_TYPE);
				GiveItem2Character(characterFromID("Mutineer_1"), "bladeladle");
				EquipCharacterByItem(characterFromID("Mutineer_1"), "bladeladle");
				GiveItem2Character(characterFromID("Mutineer_1"), "pistolsponge");
				EquipCharacterByItem(characterFromID("Mutineer_1"), "pistolsponge");
		break;

		case "gun12B":  ChangeCharacterAddressGroup(characterFromID("Mutineer_11"), "BB_careen_shore", "goto", "gun12B");
			        LAi_SetStayType(characterFromID("Mutineer_11")); 

				RemoveCharacterEquip(characterFromID("Mutineer_11"), BLADE_ITEM_TYPE);
				GiveItem2Character(characterFromID("Mutineer_11"), "bladecannon_ball");
				EquipCharacterByItem(characterFromID("Mutineer_11"), "bladecannon_ball");
				GiveItem2Character(characterFromID("Mutineer_11"), "pistolboom");
				EquipCharacterByItem(characterFromID("Mutineer_11"), "pistolboom");
		break;
	//-------------------------------------------------------------------------------------------------------------------
		case "careen_mutineers30":
			ChangeCharacterAddressGroup(Pchar, "BB_careen_shore", "quest", "tower_down");
			LAi_SetPlayerType(PChar);
		break;
	
		case "careen_ship1":
			//from SL_utils, DQR

			Pchar.careen_corvette = "round1";		//firing at corvette 1:st time
			
			LAi_QuestDelay("careen_gun12", 55.0);
		LAi_QuestDelay("turn_to_gun9B", 56.0);
			LAi_QuestDelay("careen_gun11", 59.0);
	LAi_QuestDelay("corvette_fire_sounds", 60.0);
	LAi_QuestDelay("careen_sloop_damaged1", 61.0);
			LAi_QuestDelay("careen_gun10", 62.0);
			LAi_QuestDelay("careen_gun9", 64.0);
			LAi_QuestDelay("careen_gun8", 67.0);
		LAi_QuestDelay("turn_to_look2", 69.0);
			LAi_QuestDelay("careen_gun7", 72.0);
			LAi_QuestDelay("careen_gun6", 74.0);
		LAi_QuestDelay("turn_to_gun3A", 76.0);	
			LAi_QuestDelay("careen_gun5", 81.0);
			LAi_QuestDelay("careen_gun4", 84.0);
			LAi_QuestDelay("careen_gun3", 86.0);
	LAi_QuestDelay("corvette_fire_sounds", 88.0);
	LAi_QuestDelay("careen_cliff_hit", 89.0);
			LAi_QuestDelay("careen_gun2", 91.0);
			LAi_QuestDelay("careen_gun1", 93.0);
	LAi_QuestDelay("careen_corvette_returns", 95.0);
	
			Characters[GetCharacterIndex("Pell")].dialog.CurrentNode  = "careen_ship1";
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorDialogNow(characterFromID("Pell"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Pell"));
	
			Locations[FindLocation("BB_careen_shore")].image = "Outside_Shore_6.tga";
		break;

		case "careen_ship1_A":	
			PlaySound("OBJECTS\DUEL\sabre_out.wav");		
			GiveItem2Character(characterFromID("Pell"), "blade3");
			EquipCharacterByItem(characterFromID("Pell"), "blade3");
		//	if(CheckCharacterItem(Pchar,"pistolbbuss"))
		//	{
				GiveItem2Character(characterFromID("Pell"), "Pistol5");
				EquipCharacterByItem(characterFromID("Pell"), "Pistol5");
				TakeItemFromCharacter(Pchar, "pistol5");
		//	}
			TakenItems(characterFromID("Pell"), "pistolbullets", 2);
			TakenItems(characterFromID("Pell"), "gunpowder", 2);
		
			TakeItemFromCharacter(Pchar, "blade3");
			TakenItems(Pchar, "gunpowder", -2);
			TakenItems(Pchar, "pistolbullets", -2);

			LAi_QuestDelay("careen_ship2", 1.0);
		break;
	
		case "careen_ship2":
			Characters[GetCharacterIndex("Pell")].dialog.CurrentNode  = "careen_ship2";
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorDialogNow(characterFromID("Pell"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Pell"));
		break;

		case "careen_ship4":
			//LAi_SetPlayerType(PChar);
			locations[FindLocation("BB_careen_shore")].type = "attack_seashore";
			PostEvent("LoadSceneSound", 0.01);

			LAi_QuestDelay("careen_tower_thoughts1", 5.0);
			LAi_QuestDelay("careen_tower_thoughts2", 10.0);
			LAi_QuestDelay("careen_tower_thoughts3", 20.0);
			LAi_QuestDelay("careen_tower_thoughts4", 25.0);
			LAi_QuestDelay("careen_tower_thoughts5", 35.0);
			LAi_QuestDelay("careen_tower_thoughts6", 40.0);
		break;

		case "careen_tower_thoughts1":
			LAi_QuestDelay("pchar_sigh", 0.1);
			Logit(LanguageConvertString(tmpLangFileID,"Now let's see, the Sloop's guns are only 9-pounders but the Corvette could easily have 12-pounders."));
		break;

		case "careen_tower_thoughts2":
			LAi_QuestDelay("pchar_oh", 0.1);
			Logit(LanguageConvertString(tmpLangFileID,"So they may knock out our guns while we'll just hit the sea."));
		break;

		case "careen_tower_thoughts3":
			LAi_QuestDelay("pchar_ohoh", 0.1);
			Logit(LanguageConvertString(tmpLangFileID,"But the worst scenario would be if they destroy the Sloop!"));
		break;

		case "careen_tower_thoughts4":
			LAi_QuestDelay("pchar_grr", 0.1);
			Logit(LanguageConvertString(tmpLangFileID,"Then we're stuck on this isolated shore..."));
		break;

		case "careen_tower_thoughts5":
			LAi_QuestDelay("pchar_huh", 0.1);
			Logit(LanguageConvertString(tmpLangFileID,"What if they attack with Boats? That vessel can have a very large crew!"));
		break;

		case "careen_tower_thoughts6":
			LAi_QuestDelay("pchar_yah", 0.1);
			Logit(LanguageConvertString(tmpLangFileID,"Maybe that's our best chance. They can't fire the ship cannons but we can hit the Boats!!"));
		break;


		case "turn_to_gun9B":
			LAi_SetActorType(PChar);
			LAi_ActorTurnToLocator(PChar, "goto", "gun9B");
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorTurnToLocator(characterFromID("Pell"), "goto", "gun9B");
		break;

		case "turn_to_look2":
			LAi_SetActorType(PChar);
			LAi_ActorTurnToLocator(PChar, "goto", "look2");
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorTurnToLocator(characterFromID("Pell"), "goto", "look2");
		break;

		case "turn_to_gun3A":
			LAi_SetActorType(PChar);
			LAi_ActorTurnToLocator(PChar, "goto", "gun3A");
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorTurnToLocator(characterFromID("Pell"), "goto", "gun3A");	
		break;
	//==================================================================================================
		case "careen_gun12":
			//logit("GUN 12");
			PlaySound("OBJECTS\SHIPCHARGE\LG12J.wav");

			CreateParticleSystem("canfire2" , 218.95, 2.6, 59.7, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 219.0, 2.6, 60.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 219.0, 2.6, 60.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 219.0, 2.6, 60.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 219.0, 2.6, 60.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 219.0, 2.6, 60.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 219.0, 2.6, 60.0, 0.0, 0.0, 0.0, sti(20) );
		
			LAi_QuestDelay("careen_gun12_smoke1", 1.0);
			LAi_QuestDelay("careen_gun12_smoke2", 2.0);	
		break;
	
		case "careen_gun12_smoke1":
			if(Pchar.careen_corvette == "round1")
			{
				PauseAllSounds();//stops music
				locations[FindLocation("BB_careen_shore")].type = "silent_seashore";
				PostEvent("LoadSceneSound", 0.1);
			}

			CreateParticleSystem("MMcancloud" , 219.0, 2.6, 60.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 219.0, 2.6, 60.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 219.0, 2.6, 60.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 219.0, 2.6, 60.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 219.0, 2.6, 60.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 219.0, 2.6, 60.0, 0.0, 0.0, 0.0, sti(20) );
		break;

		case "careen_gun12_smoke2":
			CreateParticleSystem("MMcancloud2" , 219.0, 2.6, 60.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 219.0, 2.6, 60.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2_light" , 219.0, 2.6, 60.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2_light" , 219.0, 2.6, 60.0, 0.0, 0.0, 0.0, sti(20) );

			if(CheckAttribute(Pchar, "careen_corvette"))
			{
			    if(Pchar.careen_corvette == "round1")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
				CreateParticleSystemX("ball_splash", 219.0, 0.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 219.0, 1.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 219.0, 2.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 219.0, 3.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 219.0, 4.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 219.0, 5.0, 420.0, 0.0, 0.0, 0.0, 0);
			    }

			    if(Pchar.careen_corvette == "round3" || Pchar.careen_corvette == "round5")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
				CreateParticleSystemX("ball_splash", 219.0, 0.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 219.0, 1.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 219.0, 2.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 219.0, 3.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 219.0, 4.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 219.0, 5.0, 150.0, 0.0, 0.0, 0.0, 0);
			    }

			    if(Pchar.careen_corvette == "round4") PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			}
		break;		

		case "careen_gun11":
			//logit("GUN 11");
			PlaySound("OBJECTS\SHIPCHARGE\LG12J.wav");

			CreateParticleSystem("canfire2" , 212.65, 2.5, 57.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 212.7, 2.5, 58.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 212.7, 2.5, 58.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 212.7, 2.5, 58.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 212.7, 2.5, 58.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 212.7, 2.5, 58.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 212.7, 2.5, 58.2, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("careen_gun11_smoke1", 1.0);
			LAi_QuestDelay("careen_gun11_smoke2", 2.0);	
		break;

		case "careen_gun11_smoke1":
			CreateParticleSystem("MMcancloud" , 212.7, 2.5, 58.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 212.7, 2.5, 58.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 212.7, 2.5, 58.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 212.7, 2.5, 58.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 212.7, 2.5, 58.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 212.7, 2.5, 58.2, 0.0, 0.0, 0.0, sti(20) );
		break;

		case "careen_gun11_smoke2":
			CreateParticleSystem("MMcancloud2" , 212.7, 2.5, 58.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 212.7, 2.5, 58.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2_light" , 212.7, 2.5, 58.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2_light" , 212.7, 2.5, 58.2, 0.0, 0.0, 0.0, sti(20) );

			if(CheckAttribute(Pchar, "careen_corvette"))
			{
			    if(Pchar.careen_corvette == "round1")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
				CreateParticleSystemX("ball_splash", 212.7, 0.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 212.7, 1.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 212.7, 2.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 212.7, 3.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 212.7, 4.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 212.7, 5.0, 420.0, 0.0, 0.0, 0.0, 0);
			    }

			    if(Pchar.careen_corvette == "round3" || Pchar.careen_corvette == "round5")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
				CreateParticleSystemX("ball_splash", 212.7, 0.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 212.7, 1.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 212.7, 2.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 212.7, 3.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 212.7, 4.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 212.7, 5.0, 150.0, 0.0, 0.0, 0.0, 0);
			    }

			    if(Pchar.careen_corvette == "round4") PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			}
		break;	
	//-----------------------------------------------------------------------------------------------------------
		case "corvette_fire_sounds":
			//logit("CORVETTE FIRES!");

			PlaySound("OBJECTS\SHIPCHARGE\LG24J.wav");

			LAi_QuestDelay("cannon_24P", 0.3);
			LAi_QuestDelay("cannon_24P", 0.5);
			LAi_QuestDelay("cannon_24P", 0.6);
			LAi_QuestDelay("cannon_24P", 0.8);
			LAi_QuestDelay("cannon_24P", 0.9);
			LAi_QuestDelay("cannon_24P", 1.0);
		break;

		case "cannon_24P":
			PlaySound("OBJECTS\SHIPCHARGE\LG24J.wav");
		break;

		case "corvette_fire_effects":
			//when firing at tower

			CreateParticleSystem("MMcancloud" , 84.0, 4.0, 455.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 84.5, 4.5, 455.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 83.5, 3.5, 455.0, 3.14, 0.0, 0.0, sti(20) );

			CreateParticleSystem("MMcancloud" , 80.5, 4.0, 455.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 80.0, 4.0, 455.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 79.5, 4.5, 455.0, 3.14, 0.0, 0.0, sti(20) );

			CreateParticleSystem("MMcancloud" , 76.0, 4.0, 455.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 76.0, 3.5, 455.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 76.5, 4.5, 455.0, 3.14, 0.0, 0.0, sti(20) );

			CreateParticleSystem("MMcancloud" , 72.0, 4.0, 455.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 72.5, 4.5, 455.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 71.5, 3.5, 455.0, 3.14, 0.0, 0.0, sti(20) );

			CreateParticleSystem("MMcancloud" , 68.0, 4.0, 455.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 68.5, 4.0, 455.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 67.5, 4.5, 455.0, 3.14, 0.0, 0.0, sti(20) );

			CreateParticleSystem("MMcancloud" , 64.0, 4.0, 455.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 64.5, 4.5, 455.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 63.5, 3.5, 455.0, 3.14, 0.0, 0.0, sti(20) );

			CreateParticleSystem("MMcancloud" , 60.0, 4.0, 455.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 60.5, 4.5, 455.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 59.5, 3.5, 455.0, 3.14, 0.0, 0.0, sti(20) );

			CreateParticleSystem("MMcancloud" , 56.0, 4.0, 455.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 56.5, 3.5, 455.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 55.5, 4.5, 455.0, 3.14, 0.0, 0.0, sti(20) );

			CreateParticleSystem("MMcancloud2" , 84.0, 4.0, 455.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 80.0, 4.0, 455.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 76.0, 4.0, 455.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 72.0, 4.0, 455.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 68.0, 4.0, 455.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 64.0, 4.0, 455.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 60.0, 4.0, 455.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 56.0, 4.0, 455.0, 3.14, 0.0, 0.0, sti(20) );
		break;

		case "careen_sloop_damaged1":
			PlaySound("PEOPLE\derrick_fall.wav");
			PlaySound("INTERFACE\glass_explosion.wav");
			PlaySound("PEOPLE\wood2.wav");

			CreateParticleSystemX("blast", 202.0, 8.7, 51.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters", 189.0, 8.5, 51.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 195.0, 8.7, 51.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters3", 202.0, 9.0, 51.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters_enhanced", 192.0, 8.5, 53.0, 0.0, 0.0, 0.0, 0);	
			CreateParticleSystem("splinters2_enhanced", 199.0, 8.7, 53.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2_enhanced", 205.0, 8.7, 53.0, 0.0, 0.0, 0.0, 0);

			CreateParticleSystem("splinters", 189.0, 8.5, 54.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 195.0, 8.7, 54.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters3", 202.0, 9.0, 54.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters_enhanced", 192.0, 11.5, 53.0, 0.0, 0.0, 0.0, 0);	
			CreateParticleSystem("splinters2_enhanced", 199.0, 11.7, 53.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2_enhanced", 205.0, 11.7, 53.0, 0.0, 0.0, 0.0, 0);

			CreateParticleSystem("blast_dirt", 189.0, 8.5, 51.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("blast_dirt", 202.0, 8.0, 51.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("blast_dirt", 199.0, 8.7, 53.0, 0.0, 0.0, 0.0, 0);

			LAi_QuestDelay("careen_sloop_damaged2", 1.0);
		break;

		case "careen_sloop_damaged2":
			PlaySound("PEOPLE\wood3.wav");

			CreateParticleSystem("splinters", 189.0, 8.5, 51.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 195.0, 8.7, 51.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters3", 202.0, 9.0, 51.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters_enhanced", 192.0, 8.5, 53.0, 0.0, 0.0, 0.0, 0);	
			CreateParticleSystem("splinters2_enhanced", 199.0, 8.7, 53.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2_enhanced", 205.0, 8.7, 53.0, 0.0, 0.0, 0.0, 0);

			CreateParticleSystem("splinters", 189.0, 8.5, 54.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2", 195.0, 8.7, 54.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters3", 202.0, 9.0, 54.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters_enhanced", 192.0, 11.5, 53.0, 0.0, 0.0, 0.0, 0);	
			CreateParticleSystem("splinters2_enhanced", 199.0, 11.7, 53.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("splinters2_enhanced", 205.0, 11.7, 53.0, 0.0, 0.0, 0.0, 0);

			CreateParticleSystem("blast_dirt", 189.0, 8.5, 51.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("blast_dirt", 202.0, 8.0, 51.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("blast_dirt", 199.0, 8.7, 53.0, 0.0, 0.0, 0.0, 0);

			LAi_QuestDelay("careen_sloop_damaged3", 1.0);
		break;

		case "careen_sloop_damaged3":
			LAi_QuestDelay("pchar_ooh", 0.1);

			CreateParticleSystem("blast_dirt", 189.0, 8.5, 51.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("blast_dirt", 202.0, 8.0, 51.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystem("blast_dirt", 199.0, 8.7, 53.0, 0.0, 0.0, 0.0, 0);
		break;

	//-----------------------------------------------------------------------------------------------------------
		case "careen_gun10":
			//logit("GUN 10");
			LAi_SetSitType(characterFromID("Mutineer_19"));
			PlaySound("OBJECTS\SHIPCHARGE\LG12J.wav");

			CreateParticleSystem("canfire2" , 178.35, 2.4, 46.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 178.4, 2.4, 46.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 178.4, 2.4, 46.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 178.4, 2.4, 46.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 178.4, 2.4, 46.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 178.4, 2.4, 46.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 178.4, 2.4, 46.9, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("Mutineer_19_stay", 0.5);
			LAi_QuestDelay("careen_gun10_smoke1", 1.0);
			LAi_QuestDelay("careen_gun10_smoke2", 2.0);
		break;

		case "Mutineer_19_stay":
			LAi_SetStayType(characterFromID("Mutineer_19"));
		break;

		case "careen_gun10_smoke1":
			CreateParticleSystem("MMcancloud" , 178.4, 2.4, 46.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 178.4, 2.4, 46.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 178.4, 2.4, 46.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 178.4, 2.4, 46.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 178.4, 2.4, 46.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 178.4, 2.4, 46.9, 0.0, 0.0, 0.0, sti(20) );
		break;

		case "careen_gun10_smoke2":
			CreateParticleSystem("MMcancloud2" , 178.4, 2.4, 46.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 178.4, 2.4, 46.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2_light" , 178.4, 2.4, 46.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2_light" , 178.4, 2.4, 46.9, 0.0, 0.0, 0.0, sti(20) );

			if(CheckAttribute(Pchar, "careen_corvette"))
			{
			    if(Pchar.careen_corvette == "round1")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
				CreateParticleSystemX("ball_splash", 178.4, 0.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 178.4, 1.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 178.4, 2.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 178.4, 3.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 178.4, 4.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 178.4, 5.0, 420.0, 0.0, 0.0, 0.0, 0);
			    }

			    if(Pchar.careen_corvette == "round3" || Pchar.careen_corvette == "round5")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
				CreateParticleSystemX("ball_splash", 178.4, 0.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 178.4, 1.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 178.4, 2.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 178.4, 3.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 178.4, 4.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 178.4, 5.0, 150.0, 0.0, 0.0, 0.0, 0);
			    }

			    if(Pchar.careen_corvette == "round4") PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			}
		break;

		case "careen_gun9":
			//logit("GUN 9");
			LAi_SetSitType(characterFromID("Mutineer_5"));
			PlaySound("OBJECTS\SHIPCHARGE\LG12J.wav");

			CreateParticleSystem("canfire2" , 168.75, 2.4, 43.3, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 168.8, 2.4, 43.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 168.8, 2.4, 43.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 168.8, 2.4, 43.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 168.8, 2.4, 43.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 168.8, 2.4, 43.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 168.8, 2.4, 43.6, 0.0, 0.0, 0.0, sti(20) );			

			LAi_QuestDelay("Mutineer_5_stay", 0.5);
			LAi_QuestDelay("careen_gun9_smoke1", 1.0);
			LAi_QuestDelay("careen_gun9_smoke2", 2.0);
		break;

		case "Mutineer_5_stay":
			LAi_SetStayType(characterFromID("Mutineer_5"));
		break;

		case "careen_gun9_smoke1":
			CreateParticleSystem("MMcancloud" , 168.8, 2.4, 43.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 168.8, 2.4, 43.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 168.8, 2.4, 43.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 168.8, 2.4, 43.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 168.8, 2.4, 43.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 168.8, 2.4, 43.6, 0.0, 0.0, 0.0, sti(20) );
		break;

		case "careen_gun9_smoke2":
			CreateParticleSystem("MMcancloud2" , 168.8, 2.4, 43.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 168.8, 2.4, 43.6, 0.0, 0.0, 0.0, sti(20) );	
			CreateParticleSystem("MMcancloud2_light" , 168.8, 2.4, 43.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2_light" , 168.8, 2.4, 43.6, 0.0, 0.0, 0.0, sti(20) );

			if(CheckAttribute(Pchar, "careen_corvette"))
			{
			    if(Pchar.careen_corvette == "round1")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
				CreateParticleSystemX("ball_splash", 168.8, 0.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 168.8, 1.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 168.8, 2.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 168.8, 3.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 168.8, 4.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 168.8, 5.0, 420.0, 0.0, 0.0, 0.0, 0);
			    }

			    if(Pchar.careen_corvette == "round3")
			    {
				//hit boat4 (sound + particles)
				PlaySound("OBJECTS\SHIPCHARGE\vzriv_pogreb_003.wav");
				PlaySound("PEOPLE\wood2.wav");
				CreateParticleSystemX("blast", 168.7, 2.0, 144.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("blast_dirt", 168.7, 2.0, 144.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("blast_dirt", 168.7, 3.0, 144.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("blast_dirt", 168.7, 2.0, 144.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("blast_dirt", 168.7, 3.0, 144.0, 0.0, 0.0, 0.0, 0);

				CreateParticleSystemX("flyers", 168.7, 2.0, 144.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("flyers2", 168.7, 3.0, 144.0, 0.0, 0.0, 0.0, 0);

				LAi_QuestDelay("hurrah", 0.5);
			    }

			    if(Pchar.careen_corvette == "round5")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
				CreateParticleSystemX("ball_splash", 168.8, 0.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 168.8, 1.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 168.8, 2.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 168.8, 3.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 168.8, 4.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 168.8, 5.0, 150.0, 0.0, 0.0, 0.0, 0);
			    }

			    if(Pchar.careen_corvette == "round4") PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			}
		break;

		case "careen_gun8":
			//logit("GUN 8");
			LAi_SetSitType(characterFromID("Mutineer_24"));
			PlaySound("OBJECTS\SHIPCHARGE\LG12J.wav");

			CreateParticleSystem("canfire2" , 157.15, 2.5, 39.7, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 157.2, 2.5, 40.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 157.2, 2.5, 40.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 157.2, 2.5, 40.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 157.2, 2.5, 40.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 157.2, 2.5, 40.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 157.2, 2.5, 40.0, 0.0, 0.0, 0.0, sti(20) );	

			LAi_QuestDelay("Mutineer_24_stay", 0.5);
			LAi_QuestDelay("careen_gun8_smoke1", 1.0);
			LAi_QuestDelay("careen_gun8_smoke2", 2.0);
		break;

		case "Mutineer_24_stay":
			LAi_SetStayType(characterFromID("Mutineer_24"));
		break;

		case "careen_gun8_smoke1":
			CreateParticleSystem("MMcancloud" , 157.2, 2.5, 40.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 157.2, 2.5, 40.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 157.2, 2.5, 40.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 157.2, 2.5, 40.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 157.2, 2.5, 40.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 157.2, 2.5, 40.0, 0.0, 0.0, 0.0, sti(20) );			
		break;

		case "careen_gun8_smoke2":
			CreateParticleSystem("MMcancloud2" , 157.2, 2.5, 40.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 157.2, 2.5, 40.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2_light" , 157.2, 2.5, 40.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2_light" , 157.2, 2.5, 40.0, 0.0, 0.0, 0.0, sti(20) );

			if(CheckAttribute(Pchar, "careen_corvette"))
			{
			    if(Pchar.careen_corvette == "round1")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
				CreateParticleSystemX("ball_splash", 157.2, 0.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 157.2, 1.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 157.2, 2.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 157.2, 3.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 157.2, 4.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 157.2, 5.0, 420.0, 0.0, 0.0, 0.0, 0);
			    }

			    if(Pchar.careen_corvette == "round3" || Pchar.careen_corvette == "round5")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
				CreateParticleSystemX("ball_splash", 157.2, 0.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 157.2, 1.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 157.2, 2.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 157.2, 3.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 157.2, 4.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 157.2, 5.0, 150.0, 0.0, 0.0, 0.0, 0);
			    }

			    if(Pchar.careen_corvette == "round4") PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			}
		break;

		case "careen_gun7":
			//logit("GUN 7");
			LAi_SetSitType(characterFromID("Mutineer_27"));
			PlaySound("OBJECTS\SHIPCHARGE\LG12J.wav");

			CreateParticleSystem("canfire2" , 120.05, 2.65, 15.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 120.1, 2.65, 16.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 120.1, 2.65, 16.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 120.1, 2.65, 16.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 120.1, 2.65, 16.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 120.1, 2.65, 16.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 120.1, 2.65, 16.2, 0.0, 0.0, 0.0, sti(20) );	

			LAi_QuestDelay("Mutineer_27_stay", 0.5);
			LAi_QuestDelay("careen_gun7_smoke1", 1.0);
			LAi_QuestDelay("careen_gun7_smoke2", 2.0);
		break;

		case "Mutineer_27_stay":
			LAi_SetStayType(characterFromID("Mutineer_27"));
		break;

		case "careen_gun7_smoke1":
			CreateParticleSystem("MMcancloud" , 120.1, 2.65, 16.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 120.1, 2.65, 16.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 120.1, 2.65, 16.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 120.1, 2.65, 16.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 120.1, 2.65, 16.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 120.1, 2.65, 16.2, 0.0, 0.0, 0.0, sti(20) );		
		break;

		case "careen_gun7_smoke2":
			CreateParticleSystem("MMcancloud2" , 120.1, 2.65, 16.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 120.1, 2.65, 16.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2_light" , 120.1, 2.65, 16.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2_light" , 120.1, 2.65, 16.2, 0.0, 0.0, 0.0, sti(20) );

			if(CheckAttribute(Pchar, "careen_corvette"))
			{
			    if(Pchar.careen_corvette == "round1")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
				CreateParticleSystemX("ball_splash", 120.1, 0.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 120.1, 1.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 120.1, 2.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 120.1, 3.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 120.1, 4.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 120.1, 5.0, 420.0, 0.0, 0.0, 0.0, 0);
			    }

			    if(Pchar.careen_corvette == "round3" || Pchar.careen_corvette == "round5")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
				CreateParticleSystemX("ball_splash", 120.1, 0.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 120.1, 1.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 120.1, 2.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 120.1, 3.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 120.1, 4.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 120.1, 5.0, 150.0, 0.0, 0.0, 0.0, 0);
			    }

			    if(Pchar.careen_corvette == "round4") PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			}
		break;

		case "careen_gun6":
			//logit("GUN 6");
			LAi_SetSitType(characterFromID("Mutineer_18"));
			PlaySound("OBJECTS\SHIPCHARGE\LG12J.wav");

			CreateParticleSystem("canfire2" , 111.45, 2.5, 11.5, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 111.6, 2.5, 11.8, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 111.6, 2.5, 11.8, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 111.6, 2.5, 11.8, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 111.6, 2.5, 11.8, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 111.6, 2.5, 11.8, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 111.6, 2.5, 11.8, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("Mutineer_18_stay", 0.5);
			LAi_QuestDelay("careen_gun6_smoke1", 1.0);
			LAi_QuestDelay("careen_gun6_smoke2", 2.0);
		break;

		case "Mutineer_18_stay":
			LAi_SetStayType(characterFromID("Mutineer_18"));
		break;

		case "careen_gun6_smoke1":
			CreateParticleSystem("MMcancloud" , 111.6, 2.5, 11.8, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 111.6, 2.5, 11.8, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 111.6, 2.5, 11.8, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 111.6, 2.5, 11.8, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 111.6, 2.5, 11.8, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 111.6, 2.5, 11.8, 0.0, 0.0, 0.0, sti(20) );
		break;

		case "careen_gun6_smoke2":
			CreateParticleSystem("MMcancloud2" , 111.6, 2.5, 11.8, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 111.6, 2.5, 11.8, 0.0, 0.0, 0.0, sti(20) );	
			CreateParticleSystem("MMcancloud2_light" , 111.6, 2.5, 11.8, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2_light" , 111.6, 2.5, 11.8, 0.0, 0.0, 0.0, sti(20) );

			if(CheckAttribute(Pchar, "careen_corvette"))
			{
			    if(Pchar.careen_corvette == "round1")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
				CreateParticleSystemX("ball_splash", 111.6, 0.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 111.6, 1.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 111.6, 2.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 111.6, 3.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 111.6, 4.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 111.6, 5.0, 420.0, 0.0, 0.0, 0.0, 0);
			    }

			    if(Pchar.careen_corvette == "round3" || Pchar.careen_corvette == "round5")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
				CreateParticleSystemX("ball_splash", 111.6, 0.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 111.6, 1.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 111.6, 2.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 111.6, 3.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 111.6, 4.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 111.6, 5.0, 150.0, 0.0, 0.0, 0.0, 0);
			    }

			    if(Pchar.careen_corvette == "round4") PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			}
		break;
	
		case "careen_gun5":
			//logit("GUN 5");
			LAi_SetSitType(characterFromID("Mutineer_8"));
			PlaySound("OBJECTS\SHIPCHARGE\LG12J.wav");

			CreateParticleSystem("canfire2" , 60.35, 2.5, 3.3, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 60.4, 2.5, 3.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 60.4, 2.5, 3.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 60.4, 2.5, 3.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 60.4, 2.5, 3.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 60.4, 2.5, 3.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 60.4, 2.5, 3.6, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("Mutineer_8_stay", 0.5);
			LAi_QuestDelay("careen_gun5_smoke1", 1.0);
			LAi_QuestDelay("careen_gun5_smoke2", 2.0);
		break;

		case "Mutineer_8_stay":
			LAi_SetStayType(characterFromID("Mutineer_8"));
		break;

		case "careen_gun5_smoke1":
			CreateParticleSystem("MMcancloud" , 60.4, 2.5, 3.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 60.4, 2.5, 3.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 60.4, 2.5, 3.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 60.4, 2.5, 3.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 60.4, 2.5, 3.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 60.4, 2.5, 3.6, 0.0, 0.0, 0.0, sti(20) );
		break;

		case "careen_gun5_smoke2":
			CreateParticleSystem("MMcancloud2" , 60.4, 2.5, 3.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 60.4, 2.5, 3.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2_light" , 60.4, 2.5, 3.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2_light" , 60.4, 2.5, 3.6, 0.0, 0.0, 0.0, sti(20) );

			if(CheckAttribute(Pchar, "careen_corvette"))
			{
			    if(Pchar.careen_corvette == "round1")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
				CreateParticleSystemX("ball_splash", 60.4, 0.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 60.4, 1.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 60.4, 2.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 60.4, 3.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 60.4, 4.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 60.4, 5.0, 420.0, 0.0, 0.0, 0.0, 0);
			    }

			    if(Pchar.careen_corvette == "round3" || Pchar.careen_corvette == "round5")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
				CreateParticleSystemX("ball_splash", 60.4, 0.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 60.4, 1.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 60.4, 2.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 60.4, 3.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 60.4, 4.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 60.4, 5.0, 150.0, 0.0, 0.0, 0.0, 0);
			    }
			
			    if(Pchar.careen_corvette == "round2")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\vzriv_pogreb_002.wav");
				CreateParticleSystemX("blast", 60.4, 3.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("blast", 60.4, 4.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("blast_dirt", 60.4, 2.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("blast_dirt", 60.4, 3.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("blast_dirt", 60.4, 4.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("blast_dirt", 60.4, 5.0, 430.0, 0.0, 0.0, 0.0, 0);
			
				CreateParticleSystemX("flyers2", 60.4, 4.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("flyers", 60.4, 5.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("flyers", 60.4, 2.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("flyers", 60.4, 3.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("flyers2", 60.4, 4.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("flyers2", 60.4, 5.0, 430.0, 0.0, 0.0, 0.0, 0);

				LAi_QuestDelay("hurrah", 0.5);
			    }

			    if(Pchar.careen_corvette == "round4") PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			}
		break;

		case "careen_gun4":
			//logit("GUN 4");
			LAi_SetSitType(characterFromID("Mutineer_17"));
			PlaySound("OBJECTS\SHIPCHARGE\LG12J.wav");

			CreateParticleSystem("canfire2" , 46.35, 2.4, 9.4, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 46.4, 2.4, 9.7, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 46.4, 2.4, 9.7, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 46.4, 2.4, 9.7, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 46.4, 2.4, 9.7, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 46.4, 2.4, 9.7, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 46.4, 2.4, 9.7, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("Mutineer_17_stay", 0.5);
			LAi_QuestDelay("careen_gun4_smoke1", 1.0);
			LAi_QuestDelay("careen_gun4_smoke2", 2.0);
		break;

		case "Mutineer_17_stay":
			LAi_SetStayType(characterFromID("Mutineer_17"));
		break;

		case "careen_gun4_smoke1":
			CreateParticleSystem("MMcancloud" , 46.4, 2.4, 9.7, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 46.4, 2.4, 9.7, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 46.4, 2.4, 9.7, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 46.4, 2.4, 9.7, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 46.4, 2.4, 9.7, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 46.4, 2.4, 9.7, 0.0, 0.0, 0.0, sti(20) );
		break;

		case "careen_gun4_smoke2":
			CreateParticleSystem("MMcancloud2" , 46.4, 2.4, 9.7, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 46.4, 2.4, 9.7, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2_light" , 46.4, 2.4, 9.7, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2_light" , 46.4, 2.4, 9.7, 0.0, 0.0, 0.0, sti(20) );

			if(CheckAttribute(Pchar, "careen_corvette"))
			{
			    if(Pchar.careen_corvette == "round1" || Pchar.careen_corvette == "round2")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
				CreateParticleSystemX("ball_splash", 46.4, 0.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 46.4, 1.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 46.4, 2.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 46.4, 3.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 46.4, 4.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 46.4, 5.0, 420.0, 0.0, 0.0, 0.0, 0);
			    }

			    if(Pchar.careen_corvette == "round3")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
				CreateParticleSystemX("ball_splash", 46.4, 0.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 46.4, 1.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 46.4, 2.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 46.4, 3.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 46.4, 4.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 46.4, 5.0, 150.0, 0.0, 0.0, 0.0, 0);
			    }

			    if(Pchar.careen_corvette == "round4") PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");

			    if(Pchar.careen_corvette == "round5")
			    {
				//hit boat2 (sound + particles)
				PlaySound("OBJECTS\SHIPCHARGE\vzriv_pogreb_003.wav");
				PlaySound("PEOPLE\wood2.wav");
				CreateParticleSystemX("blast", 46.3, 2.0, 140.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("blast_dirt", 46.3, 2.0, 140.0, 0.0, 0.0, 0.0, 0);	//z was 144
				CreateParticleSystemX("blast_dirt", 46.3, 3.0, 140.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("blast_dirt", 46.3, 2.0, 140.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("blast_dirt", 46.3, 3.0, 140.0, 0.0, 0.0, 0.0, 0);

				CreateParticleSystemX("flyers", 46.3, 2.0, 140.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("flyers2", 46.3, 3.0, 140.0, 0.0, 0.0, 0.0, 0);

				LAi_QuestDelay("hurrah", 0.5);
			    }	
			}
		break;

		case "careen_gun3":
			//logit("GUN 3");
			LAi_SetSitType(characterFromID("Mutineer_16"));
			PlaySound("OBJECTS\SHIPCHARGE\LG12J.wav");

			CreateParticleSystem("canfire2" , 33.05, 2.6, 14.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 33.1, 2.6, 14.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 33.1, 2.6, 14.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 33.1, 2.6, 14.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 33.1, 2.6, 14.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 33.1, 2.6, 14.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 33.1, 2.6, 14.9, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("Mutineer_16_stay", 0.5);
			LAi_QuestDelay("careen_gun3_smoke1", 1.0);
			LAi_QuestDelay("careen_gun3_smoke2", 2.0);
		break;

		case "Mutineer_16_stay":
			LAi_SetStayType(characterFromID("Mutineer_16"));
		break;

		case "careen_gun3_smoke1":
			CreateParticleSystem("MMcancloud" , 33.1, 2.6, 14.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 33.1, 2.6, 14.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 33.1, 2.6, 14.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 33.1, 2.6, 14.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 33.1, 2.6, 14.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 33.1, 2.6, 14.9, 0.0, 0.0, 0.0, sti(20) );
		break;

		case "careen_gun3_smoke2":
			CreateParticleSystem("MMcancloud2" , 33.1, 2.6, 14.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 33.1, 2.6, 14.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2_light" , 33.1, 2.6, 14.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2_light" , 33.1, 2.6, 14.9, 0.0, 0.0, 0.0, sti(20) );

			if(CheckAttribute(Pchar, "careen_corvette"))
			{
			    if(Pchar.careen_corvette == "round1")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
				CreateParticleSystemX("ball_splash", 33.1, 0.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 33.1, 1.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 33.1, 2.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 33.1, 3.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 33.1, 4.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 33.1, 5.0, 420.0, 0.0, 0.0, 0.0, 0);
			    }

			    if(Pchar.careen_corvette == "round3" || Pchar.careen_corvette == "round5")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
				CreateParticleSystemX("ball_splash", 33.1, 0.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 33.1, 1.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 33.1, 2.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 33.1, 3.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 33.1, 4.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 33.1, 5.0, 150.0, 0.0, 0.0, 0.0, 0);
			    }	
			
			    if(Pchar.careen_corvette == "round2")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\vzriv_pogreb_001.wav");
				CreateParticleSystemX("blast", 33.1, 4.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("blast", 33.1, 3.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("blast_dirt", 33.1, 2.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("blast_dirt", 33.1, 3.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("blast_dirt", 33.1, 4.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("blast_dirt", 33.1, 5.0, 430.0, 0.0, 0.0, 0.0, 0);				
			
				CreateParticleSystemX("flyers2", 33.1, 4.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("flyers", 33.1, 5.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("flyers", 33.1, 2.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("flyers", 33.1, 3.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("flyers2", 33.1, 4.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("flyers2", 33.1, 5.0, 430.0, 0.0, 0.0, 0.0, 0);
							

				LAi_QuestDelay("hurrah", 0.5);
			    }

			    if(Pchar.careen_corvette == "round4") PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			}	
		break;
	//-----------------------------------------------------------------------------------------------------------

		case "careen_cliff_hit":
			PlaySound("PEOPLE\cavern1.wav");
			PlaySound("PEOPLE\cavern4.wav");
			PlaySound("OBJECTS\SHIPCHARGE\vzriv_pogreb_001.wav");

			CreateParticleSystemX("blast", 20.5, 10.0, -14.8, 0.0, 4.0, 0.0, 0);
			CreateParticleSystem("splinters" , 20.5, 10.0, -14.8, 0.0, 4.0, 0.0, sti(20) );
			CreateParticleSystem("splinters2" , 20.5, 10.0, -14.8, 0.0, 4.0, 0.0, sti(20) );
			CreateParticleSystem("splinters3" , 20.5, 10.0, -14.8, 0.0, 4.0, 0.0, sti(20) );
			CreateParticleSystem("splinters_enhanced" , 20.5, 10.0, -14.8, 0.0, 4.0, 0.0, sti(20) );
			CreateParticleSystem("splinters2_enhanced" , 20.5, 10.0, -14.8, 0.0, 4.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 20.5, 10.0, -14.8, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 20.5, 10.0, -14.8, 0.0, 0.0, 0.0, sti(20) );

			CreateParticleSystem("splinters" , 21.5, 10.0, -13.8, 0.0, 4.0, 0.0, sti(20) );
			CreateParticleSystem("splinters2" , 20.5, 10.0, -13.8, 0.0, 4.0, 0.0, sti(20) );
			CreateParticleSystem("splinters3" , 19.5, 10.0, -13.8, 0.0, 4.0, 0.0, sti(20) );
			CreateParticleSystem("splinters_enhanced" , 21.5, 10.0, -13.8, 0.0, 4.0, 0.0, sti(20) );
			CreateParticleSystem("splinters2_enhanced" , 20.5, 10.0, -13.8, 0.0, 4.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 19.5, 10.0, -13.8, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 20.5, 10.0, -13.8, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("careen_cliff_hit1", 2.0);
			LAi_QuestDelay("pchar_yah", 2.0);
			LAi_QuestDelay("pchar_yah", 2.0);
		break;

		case "careen_cliff_hit1":
			PlaySound("PEOPLE\cavern1.wav");
		break;

	//-----------------------------------------------------------------------------------------------------------
		case "careen_gun2":
			//logit("GUN 2");
			LAi_SetSitType(characterFromID("Mutineer_20"));

			PlaySound("OBJECTS\SHIPCHARGE\LG12J.wav");

			CreateParticleSystem("canfire2" , 8.15, 2.5, 21.3, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 8.2, 2.5, 21.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 8.2, 2.5, 21.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 8.2, 2.5, 21.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 8.2, 2.5, 21.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 8.2, 2.5, 21.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 8.2, 2.5, 21.6, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("Mutineer_20_stay", 0.5);
			LAi_QuestDelay("careen_gun2_smoke1", 1.0);
			LAi_QuestDelay("careen_gun2_smoke2", 2.0);
		break;

		case "Mutineer_20_stay":
			LAi_SetStayType(characterFromID("Mutineer_20"));
		break;

		case "careen_gun2_smoke1":
			CreateParticleSystem("MMcancloud" , 8.2, 2.5, 21.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 8.2, 2.5, 21.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 8.2, 2.5, 21.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 8.2, 2.5, 21.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 8.2, 2.5, 21.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 8.2, 2.5, 21.6, 0.0, 0.0, 0.0, sti(20) );
		break;

		case "careen_gun2_smoke2":
			CreateParticleSystem("MMcancloud2" , 8.2, 2.5, 21.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , 8.2, 2.5, 21.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2_light" , 8.2, 2.5, 21.6, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2_light" , 8.2, 2.5, 21.6, 0.0, 0.0, 0.0, sti(20) );

			if(CheckAttribute(Pchar, "careen_corvette"))
			{
			    if(Pchar.careen_corvette == "round1")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
				CreateParticleSystemX("ball_splash", 8.2, 0.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 8.2, 1.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 8.2, 2.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 8.2, 3.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 8.2, 4.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 8.2, 5.0, 420.0, 0.0, 0.0, 0.0, 0);
			    }

			    if(Pchar.careen_corvette == "round3")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
				CreateParticleSystemX("ball_splash", 8.2, 0.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 8.2, 1.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 8.2, 2.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 8.2, 3.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 8.2, 4.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", 8.2, 5.0, 150.0, 0.0, 0.0, 0.0, 0);
			    }

			    if(Pchar.careen_corvette == "round2")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\vzriv_pogreb_003.wav");
				CreateParticleSystemX("blast", 8.2, 4.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("blast", 8.2, 3.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("blast_dirt", 8.2, 2.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("blast_dirt", 8.2, 3.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("blast_dirt", 8.2, 4.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("blast_dirt", 8.2, 5.0, 430.0, 0.0, 0.0, 0.0, 0);
			
				CreateParticleSystemX("flyers2", 8.2, 4.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("flyers", 8.2, 5.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("flyers", 8.2, 2.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("flyers", 8.2, 3.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("flyers2", 8.2, 4.0, 430.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("flyers2", 8.2, 5.0, 430.0, 0.0, 0.0, 0.0, 0);

				LAi_QuestDelay("hurrah", 0.5);
			    }

			    if(Pchar.careen_corvette == "round5")
			    {
				//hit boat1 (sound + particles)
				PlaySound("OBJECTS\SHIPCHARGE\vzriv_pogreb_003.wav");
				CreateParticleSystemX("blast", 3.4, 2.0, 125.0, 0.0, 0.0, 0.0, 0);
				PlaySound("PEOPLE\wood2.wav");
				CreateParticleSystemX("blast_dirt", 3.4, 2.0, 125.0, 0.0, 0.0, 0.0, 0);	//z was 144 
				CreateParticleSystemX("blast_dirt", 3.4, 3.0, 125.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("blast_dirt", 3.4, 2.0, 125.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("blast_dirt", 3.4, 3.0, 125.0, 0.0, 0.0, 0.0, 0);

				CreateParticleSystemX("flyers", 3.4, 2.0, 125.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("flyers2", 3.4, 3.0, 125.0, 0.0, 0.0, 0.0, 0);

				LAi_QuestDelay("hurrah", 0.5);
			    }	

			    if(Pchar.careen_corvette == "round4") PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			}
		break;

		case "careen_gun1":
			//logit("GUN 1");
			LAi_SetSitType(characterFromID("Mutineer_31"));

			PlaySound("OBJECTS\SHIPCHARGE\LG12J.wav");

			CreateParticleSystem("canfire2" , -1.45, 2.7, 20.9, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , -1.4, 2.7, 21.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , -1.4, 2.7, 21.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , -1.4, 2.7, 21.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , -1.4, 2.7, 21.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , -1.4, 2.7, 21.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , -1.4, 2.7, 21.2, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("Mutineer_31_stay", 0.5);
			LAi_QuestDelay("careen_gun1_smoke1", 1.0);
			LAi_QuestDelay("careen_gun1_smoke2", 2.0);
		break;

		case "Mutineer_31_stay":
			LAi_SetStayType(characterFromID("Mutineer_31"));
		break;

		case "careen_gun1_smoke1":
			if(Pchar.careen_corvette == "round2")
			{
				PauseAllSounds();//stops music
				locations[FindLocation("BB_careen_shore")].type = "silent_seashore";
				PostEvent("LoadSceneSound", 0.1);
			}

			CreateParticleSystem("MMcancloud" , -1.4, 2.7, 21.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , -1.4, 2.7, 21.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , -1.4, 2.7, 21.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , -1.4, 2.7, 21.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , -1.4, 2.7, 21.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , -1.4, 2.7, 21.2, 0.0, 0.0, 0.0, sti(20) );
		break;

		case "careen_gun1_smoke2":
			CreateParticleSystem("MMcancloud2" , -1.4, 2.7, 21.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2" , -1.4, 2.7, 21.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2_light" , -1.4, 2.7, 21.2, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud2_light" , -1.4, 2.7, 21.2, 0.0, 0.0, 0.0, sti(20) );

			if(CheckAttribute(Pchar, "careen_corvette"))
			{
			    if(Pchar.careen_corvette == "round1" || Pchar.careen_corvette == "round2")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
				CreateParticleSystemX("ball_splash", -1.4, 0.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", -1.4, 1.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", -1.4, 2.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", -1.4, 3.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", -1.4, 4.0, 420.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", -1.4, 5.0, 420.0, 0.0, 0.0, 0.0, 0);
			    }

			    if(Pchar.careen_corvette == "round3" || Pchar.careen_corvette == "round5")
			    {
				PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
				CreateParticleSystemX("ball_splash", -1.4, 0.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", -1.4, 1.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", -1.4, 2.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", -1.4, 3.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", -1.4, 4.0, 150.0, 0.0, 0.0, 0.0, 0);
				CreateParticleSystemX("ball_splash", -1.4, 5.0, 150.0, 0.0, 0.0, 0.0, 0);
			    }

			    if(Pchar.careen_corvette == "round4") PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			}
		break;
	//==================================================================================================

		case "careen_corvette_returns":
			Characters[GetCharacterIndex("Pell")].dialog.CurrentNode  = "careen_corvette_returns";
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorDialogNow(characterFromID("Pell"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Pell"));
		break;

		case "careen_corvette_returns1":
			LAi_QuestDelay("turn_to_look2", 0.1);
			LAi_QuestDelay("careen_corvette_returns2", 1.0);
		break;

		case "careen_corvette_returns2":
			PlaySound("OBJECTS\SHIPCHARGE\gunner_warning.wav");

			LAi_QuestDelay("careen_corvette_returns3", 1.0);
		break;

		case "careen_corvette_returns3":
			Characters[GetCharacterIndex("Mutineer_32")].dialog.CurrentNode  = "careen_corvette_returns3";
			LAi_SetActorType(characterFromID("Mutineer_32"));
			LAi_ActorDialogNow(characterFromID("Mutineer_32"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Mutineer_32"));
		break;

		case "careen_corvette_returns4":
			PlaySound("OBJECTS\SHIPCHARGE\gunner_fire.wav");

			LAi_QuestDelay("careen_corvette_returns5", 1.0);
		break;

		case "careen_corvette_returns5":
			locations[FindLocation("BB_careen_shore")].type = "attack_seashore";
			SetNextWeather("Clear");
			SetNextWind("SE",90);
		
			characters[GetCharacterIndex("Maltese_soldier3")].Ship.Type = "obj_invisible";
			characters[GetCharacterIndex("Maltese_soldier3")].Ship.Stopped = true;

			characters[GetCharacterIndex("Maltese_soldier4")].Ship.Type = "Corvette2";
			characters[GetCharacterIndex("Maltese_soldier4")].sailaway = true;

			Locations[FindLocation("BB_careen_shore")].image = "";
			DoQuestReloadToLocation("BB_careen_shore", "quest", "see_guns" ,"careen_corvette_returns6");
		break;

		case "careen_corvette_returns6":
			Pchar.careen_corvette = "round2";		//firing at corvette 2:nd time (when it returns)

			PlaySound("VOICE\ENGLISH\pir_capI.wav");

			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorTurnToLocator(characterFromID("Pell"), "ships_other", "ship_2");
		
			LAi_SetActorType(PChar);
			LAi_ActorTurnToLocator(PChar, "ships_other", "ship_2");

			LAi_QuestDelay("careen_gun1", 8.0);	//ok
			LAi_QuestDelay("careen_gun2", 12.0);	//ok
			LAi_QuestDelay("careen_gun3", 18.0);	//ok
			LAi_QuestDelay("careen_gun4", 22.0);	//ok
			LAi_QuestDelay("careen_gun5", 25.0);	//ok
			LAi_QuestDelay("corvette_fire_sounds", 28.5);
			LAi_QuestDelay("corvette_fire_effects", 28.5);
			LAi_QuestDelay("careen_tower_damaged1", 29.5);
		break;
	//-----------------------------------------------------------------------------------------------------------
		case "careen_tower_damaged1":
			//logit("TOWER HIT!");
		
			LAi_SetActorType(Pchar);
			LAi_ActorSetLayMode(Pchar);

			ChangeCharacterAddressGroup(Pchar, "BB_careen_shore", "quest", "under_platform");
			ChangeCharacterAddressGroup(characterFromID("Pell"), "none", "", "");
			RemovePassenger(Pchar, characterFromID("Hands"));
			RemovePassenger(Pchar, characterFromID("Caesar"));
			RemovePassenger(Pchar, characterFromID("Pell"));

			CreateParticleSystem("splinters" , 89.0, 17.0, 38.0, 0.0, 4.0, 0.0, sti(20) );
			CreateParticleSystem("splinters2" , 89.0, 17.0, 38.0, 0.0, 4.0, 0.0, sti(20) );
			CreateParticleSystem("splinters3" , 89.0, 17.0, 38.0, 0.0, 4.0, 0.0, sti(20) );
			CreateParticleSystem("splinters_enhanced" , 89.0, 17.0, 38.0, 0.0, 4.0, 0.0, sti(20) );
			CreateParticleSystem("splinters2_enhanced" , 89.0, 17.0, 38.0, 0.0, 4.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 89.0, 17.0, 38.0, 0.0, 0.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 89.0, 17.0, 38.0, 0.0, 0.0, 0.0, sti(20) );

			PlaySound("OBJECTS\SHIPCHARGE\gunpowder_explosion.wav");
			PlaySound("PEOPLE\slide_down_roof.wav");
			PlaySound("PEOPLE\roof_broken1.wav");
			PlaySound("PEOPLE\wood3.wav");

			Php = LAi_GetCharacterHP(Pchar);
			Php95 = Php*0.95;
			LAi_ApplyCharacterDamage(Pchar, Php95);

			LAi_QuestDelay("careen_tower_damaged2", 1.0);
		break;

		case "careen_tower_damaged2":
			SetNextWeather("Clear");
			SetNextWind("SE",90);
			Locations[FindLocation("BB_careen_shore")].models.always.locators = "Shore06_l_careen_R";
			Locations[FindLocation("BB_careen_shore")].models.always.l2 = "";
			locations[FindLocation("BB_careen_shore")].type = "angels_choir";
			Locations[FindLocation("BB_careen_shore")].image = "";

			ChangeCharacterAddressGroup(Pchar, "BB_careen_shore", "goto", "blackout");
			PostVideoAndQuest("common\Skeleton_on_beach",1, "careen_tower_damaged2_A");
		break;

		case "careen_tower_damaged2_A":
			DoQuestReloadToLocation("BB_careen_shore", "goto", "blackout" ,"careen_tower_damaged3");
		break;

		case "careen_tower_damaged3":
			//phase A black + angels_choir
			//logit("BLACK CHOIR");

			SetModel(PChar, "Zombie1", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);
			RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
		//	TakeItemFromCharacter(Pchar, "pistolbbuss");		//no, keep it for last fight
			TakeItemFromCharacter(Pchar, "pistol5");
			TakeItemFromCharacter(Pchar, "blade3");
			TakeItemFromCharacter(Pchar, "ammopouch");
			TakeItemFromCharacter(Pchar, "powderflask");
			TakeItemFromCharacter(Pchar, "bb_hatA2");
		
			LAi_SetActorType(Pchar);
			LAi_ActorSetLayMode(Pchar);
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorSetLayMode(characterFromID("Pell"));

			LAi_QuestDelay("Pyle_dead", 15.0);
		break;

		case "Pyle_dead":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "Pyle_dead";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Pyle_dead_delay":
			LAi_QuestDelay("careen_tower_damaged4", 5.0);
		break;

		case "careen_tower_damaged4":
			SetNextWeather("Clear");
			SetNextWind("SE",90);
			locations[FindLocation("BB_careen_shore")].type = "San_Felipe_fort";

			DoQuestReloadToLocation("BB_careen_shore", "goto", "blackout" ,"careen_tower_damaged5");
		break;

		case "careen_tower_damaged5":
			//phase B black + seashore sounds
			//logit("BLACK SHORE");		

			LAi_QuestDelay("Pyle_dark", 8.0);		//was 10.0
		break;

		case "Pyle_dark":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "Pyle_dark";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Pyle_dark_delay":
			LAi_SetActorType(Pchar);
			LAi_ActorSetLayMode(Pchar);

			LAi_QuestDelay("careen_tower_damaged6", 5.0);
		break;

		case "careen_tower_damaged6":
			//phase C under roof + seashore sounds
			//logit("UNDER ROOF");

			ChangeCharacterAddressGroup(Pchar, "BB_careen_shore", "goto", "return");
			ChangeCharacterAddressGroup(characterFromID("Pell"), "BB_careen_shore", "goto", "lift3");	//testing
			ChangeCharacterAddressGroup(characterFromID("Mutineer_9"), "BB_careen_shore", "goto", "lift1");	//testing
			ChangeCharacterAddressGroup(characterFromID("Mutineer_32"), "BB_careen_shore", "goto", "lift4");	//testing
			LAi_SetActorType(characterFromID("Pell"));
			GiveItem2Character(characterFromID("Mutineer_32"), "pistolcannon");
			EquipCharacterByItem(characterFromID("Mutineer_32"), "pistolcannon");

			LAi_QuestDelay("careen_tower_damaged7", 3.0);			//was 5
		break;

		case "careen_tower_damaged7":
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box15", 1.0);
		break;

		case "careen_tower_damaged7_A":
			//from SL_utils.c roof removing roof	
			
			LAi_SetSitType(characterFromID("Pell"));
			LAi_SetSitType(characterFromID("Mutineer_9"));
			LAi_SetSitType(characterFromID("Mutineer_32"));
			PlaySound("OBJECTS\DUEL\man_attack1.wav");

			LAi_QuestDelay("careen_tower_damaged7_B", 1.0);
		break;

		case "careen_tower_damaged7_B":
			//from SL_utils.c roof removing roof

			SetNextWeather("Clear");
			SetNextWind("S",90);
			Locations[FindLocation("BB_careen_shore")].models.always.locators = "Shore06_l_careen_S";
			Locations[FindLocation("BB_careen_shore")].models.always.l1 = "FR_Sloop_careen_hit";
			Locations[FindLocation("BB_careen_shore")].models.always.l5 = "FR_sloop_railing";

			characters[GetCharacterIndex("Maltese_soldier3")].Ship.Type = "obj_invisible";
			characters[GetCharacterIndex("Maltese_soldier3")].Ship.Stopped = true;

			characters[GetCharacterIndex("Maltese_soldier4")].Ship.Type = "obj_Boat2G_crew";
			characters[GetCharacterIndex("Maltese_soldier4")].sailaway = true;
			characters[GetCharacterIndex("Maltese_soldier5")].Ship.Type = "obj_Boat2G_crew";
			characters[GetCharacterIndex("Maltese_soldier5")].sailaway = true;
			characters[GetCharacterIndex("Maltese_soldier6")].Ship.Type = "obj_Boat2G_small_crew";
			characters[GetCharacterIndex("Maltese_soldier6")].sailaway = true;
			characters[GetCharacterIndex("Maltese_soldier7")].Ship.Type = "obj_Boat2G_crew";
			characters[GetCharacterIndex("Maltese_soldier7")].sailaway = true;
			characters[GetCharacterIndex("Maltese_governor")].Ship.Type = "obj_Boat2G_crew";
			characters[GetCharacterIndex("Maltese_governor")].sailaway = true;
			characters[GetCharacterIndex("Maltese_red1")].Ship.Type = "Corvette2";			//stopped corvette with sails down
			Locations[FindLocation("BB_careen_shore")].image = "";
			DoQuestReloadToLocation("BB_careen_shore", "goto", "return" ,"careen_tower_damaged8");
		break;

		case "careen_tower_damaged8":
			//from SL_utils.c roof removed	
			//phase D Pyle visible + seashore sounds
			//logit("PYLE VISIBLE");

			SetModel(PChar, "Howard_Pyle_a", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);	

			LAi_SetStayType(characterFromID("Pell"));
			LAi_SetStayType(characterFromID("Mutineer_9"));
			LAi_SetStayType(characterFromID("Mutineer_32"));
		
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
			PlaySound("OBJECTS\SHIPCHARGE\ball_splash1.wav");
			CreateParticleSystemX("ball_splash", 94.3, 0.0, 14.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", 94.0, 0.0, 14.0, 0.0, 0.0, 0.0, 0);
			CreateParticleSystemX("ball_splash", 94.6, 0.0, 14.0, 0.0, 0.0, 0.0, 0);		

			LAi_QuestDelay("careen_tower_damaged8_A", 2.0);
			LAi_QuestDelay("careen_tower_damaged9", 5.0);
		break;

		case "careen_tower_damaged8_A":
			PlaySound("VOICE\ENGLISH\Dupin_splendid.wav");
		break;		

		case "careen_tower_damaged9":
			Logit(LanguageConvertString(tmpLangFileID,"I hear church bells - I must have been completely knocked out!"));
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("stars_short" , u, v+1, w, 0.0, 0.0, 0.0, sti(20) );
			PlaySound("OBJECTS\VOICES\DEAD\male\dead4.wav");
			LAi_SetPoorType(Pchar);
	
			LAi_QuestDelay("careen_tower_damaged10", 5.0);
		break;

		case "careen_tower_damaged10":
			//phase E Pyle player + seashore sounds and Felipe attack music

			LAi_SetActorType(Pchar);
			PlaySound("PEOPLE\step_sand.wav");

			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_careen_shore", "goto", "gun_group4");
			ChangeCharacterAddressGroup(characterFromID("Caesar"), "BB_careen_shore", "goto", "gun_group5");

			AddPassenger(Pchar, characterFromID("Hands"), 0);
			SetOfficersIndex(Pchar, 1, getCharacterIndex("Hands"));
			LAi_SetOfficerType(characterFromID("Hands"));
			LAi_SetStayType(characterFromID("Hands"));

			AddPassenger(Pchar, characterFromID("Caesar"), 0);
			SetOfficersIndex(Pchar, 2, getCharacterIndex("Caesar"));
			LAi_SetOfficerType(characterFromID("Caesar"));
			LAi_SetStayType(characterFromID("Caesar"));

			AddPassenger(Pchar, characterFromID("Pell"), 0);
			SetOfficersIndex(Pchar, 3, getCharacterIndex("Pell"));
			LAi_SetOfficerType(characterFromID("Pell"));
			LAi_SetStayType(characterFromID("Pell"));

			LAi_QuestDelay("hat_again", 2.0);
		break;

		case "hat_again":
			Characters[GetCharacterIndex("Pell")].dialog.CurrentNode  = "hat_again";
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorDialogNow(characterFromID("Pell"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Pell"));
		break;
	
		case "corvette_boats":
			Characters[GetCharacterIndex("Mutineer_32")].Dialog.Filename = "Mutiny leader_dialog.c";
			Characters[GetCharacterIndex("Mutineer_32")].dialog.CurrentNode  = "corvette_boats";
			LAi_SetActorType(characterFromID("Mutineer_32"));
			LAi_ActorDialogNow(characterFromID("Mutineer_32"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Mutineer_32"));
		break;

		case "Pell_to_cliff":
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorRunToLocator(characterFromID("Pell"), "goto", "box7", "_", 10.0);
			LAi_SetActorType(characterFromID("Mutineer_9"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_9"), "goto", "gun_group3", "_", 10.0);
			LAi_SetActorType(characterFromID("Mutineer_32"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_32"), "goto", "goto13", "ready_fire_at_boats", 22.0);	

			LAi_QuestDelay("Pell_to_cliff1", 2.0);
		break;

		case "Pell_to_cliff1":
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "goto12", "ready_fire_at_boats_pchar", 23.0);
		break;

		case "ready_fire_at_boats":
			ChangeCharacterAddressGroup(characterFromID("Pell"), "BB_careen_shore", "goto", "cliff_top");
			ChangeCharacterAddressGroup(characterFromID("Mutineer_9"), "BB_careen_shore", "goto", "gun_group3");
			ChangeCharacterAddressGroup(characterFromID("Mutineer_32"), "BB_careen_shore", "goto", "goto13");

			LAi_SetActorType(characterFromID("Mutineer_32"));
			LAi_ActorTurnToLocator(characterFromID("Mutineer_32"), "ships_other", "ship_4");
		break;
		
		case "ready_fire_at_boats_pchar":
			ChangeCharacterAddressGroup(Pchar, "BB_careen_shore", "goto", "goto12");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "ships_other", "ship_4");

			LAi_QuestDelay("fire_at_boats1", 1.0);
		break;

		case "fire_at_boats1":
			Pchar.careen_corvette = "round3";		//firing at boats 1:st time
			LAi_SetPlayerType(characterFromID("Mutineer_32"));
			LAi_SetFightMode(characterFromID("Mutineer_32"), true);
			PlaySound("OBJECTS\SHIPCHARGE\gunner_fire.wav");

			LAi_QuestDelay("careen_gun12", 1.0);
			LAi_QuestDelay("careen_gun11", 2.0);
			LAi_QuestDelay("careen_gun10", 4.0);
			LAi_QuestDelay("careen_gun9", 5.0);
			LAi_QuestDelay("careen_gun8", 6.0);
			LAi_QuestDelay("careen_gun7", 8.0);
			LAi_QuestDelay("careen_gun6", 9.0);
			LAi_QuestDelay("careen_gun5", 11.0);
			LAi_QuestDelay("careen_gun4", 12.0);
			LAi_QuestDelay("careen_gun3", 13.0);
			LAi_QuestDelay("careen_gun2", 15.0);
			LAi_QuestDelay("careen_gun1", 16.0);

			LAi_QuestDelay("fire_at_boats_turn1", 1.5);
			LAi_QuestDelay("m32_not fight", 3.0);
			LAi_QuestDelay("fire_at_boats_turn2", 12.0);
			LAi_QuestDelay("fire_at_boats_turn3", 15.0);
			LAi_QuestDelay("fire_at_boats2", 18.0);		
		break;

		case "m32_not fight":
			LAi_SetFightMode(characterFromID("Mutineer_32"), false);
		break;

		case "fire_at_boats_turn1":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "gun5B");
		break;

		case "fire_at_boats_turn2":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "ships_other", "ship_3");
		break;

		case "fire_at_boats_turn3":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "citizen04");

			LAi_QuestDelay("pchar_stand_by_for_broadside", 2.0);	
		break;

		case "pchar_stand_by_for_broadside":
			ChangeCharacterAddressGroup(Pchar, "BB_careen_shore", "goto", "goto12");

			LAi_QuestDelay("pchar_playertype", 1.0);
		break;		

		case "fire_at_boats2":
			Pchar.careen_corvette = "round4";			//firing at boats 2:nd time
			Pchar.careen_boats = "round1";
			LAi_SetPlayerType(characterFromID("Mutineer_32"));
			LAi_SetFightMode(characterFromID("Mutineer_32"), true);
			PlaySound("OBJECTS\SHIPCHARGE\gunner_fire.wav");

			LAi_QuestDelay("careen_gun12", 1.0);
			LAi_QuestDelay("careen_gun11", 2.0);
			LAi_QuestDelay("careen_gun10", 4.0);
			LAi_QuestDelay("careen_gun9", 5.0);
			LAi_QuestDelay("careen_gun8", 6.0);
			LAi_QuestDelay("careen_gun7", 8.0);
			LAi_QuestDelay("careen_gun6", 9.0);
			LAi_QuestDelay("careen_gun5", 11.0);
			LAi_QuestDelay("careen_gun4", 12.0);
			LAi_QuestDelay("careen_gun3", 13.0);
			LAi_QuestDelay("careen_gun2", 15.0);
			LAi_QuestDelay("careen_gun1", 16.0);

			LAi_QuestDelay("fire_at_boats_turn1", 1.5);
			LAi_QuestDelay("m32_not fight", 3.0);
			LAi_QuestDelay("fire_at_boats_turn2", 12.0);
			LAi_QuestDelay("fire_at_boats_turn3", 15.0);

			LAi_QuestDelay("1_boat_hit", 18.0);
			LAi_QuestDelay("whistle_the_side", 38.0);
			LAi_QuestDelay("careen_boat1", 43.0);
			LAi_QuestDelay("careen_boat3", 44.0);
			LAi_QuestDelay("careen_boat2", 44.5);
			LAi_QuestDelay("careen_boat4", 45.0);
			LAi_QuestDelay("careen_boat5", 45.3);

			LAi_QuestDelay("fire_at_boats3", 48.0);		
		break;

		case "1_boat_hit":
			Characters[GetCharacterIndex("Pell")].dialog.CurrentNode  = "1_boat_hit";
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorDialogNow(characterFromID("Pell"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Pell"));
		break;

		case "1_boat_hit_done":
			ChangeCharacterAddressGroup(characterFromID("Pell"), "BB_careen_shore", "goto", "cliff_top");//turning him towards sea

			LAi_QuestDelay("fire_at_boats_turn2", 0.01);
			LAi_QuestDelay("pchar_grr", 0.01);
			LAi_QuestDelay("reload_gun3", 1.0);
			LAi_QuestDelay("reload_gun4", 3.0);	
		break;
//-----------------------------------------------------------------------------------------------------

		case "reload_gun3":
			LAi_SetActorType(characterFromID("Mutineer_25"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_25"), "goto", "gun3RL", "reload_gun3_1", 3.0);	
		break;

		case "reload_gun3_1":
			ChangeCharacterAddressGroup(characterFromID("Mutineer_25"), "BB_careen_shore", "goto", "gun3RL");
			LAi_SetPlayerType(characterFromID("Mutineer_25"));
			LAi_SetFightMode(characterFromID("Mutineer_25"), true);

			LAi_QuestDelay("reload_gun3_2", 3.0);
		break;

		case "reload_gun3_2":
			LAi_SetFightMode(characterFromID("Mutineer_25"), false);
			LAi_SetActorType(characterFromID("Mutineer_25"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_25"), "goto", "gun3A", "reload_gun3_3", 3.0);
		break;

		case "reload_gun3_3":
			ChangeCharacterAddressGroup(characterFromID("Mutineer_25"), "BB_careen_shore", "goto", "gun3A");
		break;
	//.................................................................................................................
		case "reload_gun4":
			LAi_SetActorType(characterFromID("Mutineer_26"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_26"), "goto", "gun4RL", "reload_gun4_1", 3.0);	
		break;

		case "reload_gun4_1":
			ChangeCharacterAddressGroup(characterFromID("Mutineer_26"), "BB_careen_shore", "goto", "gun4RL");
			LAi_SetPlayerType(characterFromID("Mutineer_26"));
			LAi_SetFightMode(characterFromID("Mutineer_26"), true);

			LAi_QuestDelay("reload_gun4_2", 3.0);
		break;

		case "reload_gun4_2":
			LAi_SetFightMode(characterFromID("Mutineer_26"), false);
			LAi_SetActorType(characterFromID("Mutineer_26"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_26"), "goto", "gun4B", "reload_gun4_3", 3.0);
		break;

		case "reload_gun4_3":
			ChangeCharacterAddressGroup(characterFromID("Mutineer_26"), "BB_careen_shore", "goto", "gun4B");
		break;
//-----------------------------------------------------------------------------------------------------
		case "careen_boat1":
			PlaySound("OBJECTS\SHIPCHARGE\CR12C.wav");
			CreateParticleSystem("canfire2" , 3.3, 2.0, 123.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 3.3, 2.0, 123.0, 3.14, 0.0, 0.0, sti(20) );
		break;

		case "careen_boat2":
			PlaySound("OBJECTS\SHIPCHARGE\CR12C.wav");
			CreateParticleSystem("canfire2" , 46.3, 2.0, 123.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 46.3, 2.0, 123.0, 3.14, 0.0, 0.0, sti(20) );

			if(CheckAttribute(Pchar, "careen_boats"))
			{
			    if(Pchar.careen_boats == "round1")
			    {
				LAi_QuestDelay("kill_careen_crew2_1", 1.5);
			    }
			}
		break;

		case "kill_careen_crew2_1":
			LAi_KillCharacter(characterFromID("Mutineer_25"));
			LAi_KillCharacter(characterFromID("Mutineer_26"));
		break;

		case "careen_boat3":
			PlaySound("OBJECTS\SHIPCHARGE\CR12C.wav");
			CreateParticleSystem("canfire2" , 115.7, 2.0, 123.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 115.7, 2.0, 123.0, 3.14, 0.0, 0.0, sti(20) );

			if(CheckAttribute(Pchar, "careen_boats"))
			{
			    if(Pchar.careen_boats == "round1")
			    {
				LAi_QuestDelay("kill_careen_crew3_1", 1.5);
			    }
			}
		break;

		case "kill_careen_crew3_1":
			LAi_KillCharacter(characterFromID("Mutineer_14"));
			LAi_KillCharacter(characterFromID("Mutineer_21"));
		break;

		case "careen_boat4":
			PlaySound("OBJECTS\SHIPCHARGE\CR12C.wav");
			CreateParticleSystem("canfire2" , 168.7, 2.0, 123.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 168.7, 2.0, 123.0, 3.14, 0.0, 0.0, sti(20) );
		break;

		case "careen_boat5":
			PlaySound("OBJECTS\SHIPCHARGE\CR12C.wav");
			CreateParticleSystem("canfire2" , 215.8, 2.0, 123.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 215.8, 2.0, 123.0, 3.14, 0.0, 0.0, sti(20) );
		break;

		case "fire_at_boats3":
			Pchar.careen_corvette = "round5";		//firing at boats 3:rd time
			Pchar.careen_boats = "round2";
			LAi_SetPlayerType(characterFromID("Mutineer_32"));
			LAi_SetFightMode(characterFromID("Mutineer_32"), true);
			PlaySound("OBJECTS\SHIPCHARGE\gunner_fire.wav");

			LAi_QuestDelay("careen_gun12", 1.0);
			LAi_QuestDelay("careen_gun11", 2.0);
			LAi_QuestDelay("careen_gun10", 4.0);
			LAi_QuestDelay("careen_gun9", 5.0);
			LAi_QuestDelay("careen_gun8", 6.0);
			LAi_QuestDelay("careen_gun7", 8.0);
			LAi_QuestDelay("careen_gun6", 9.0);
			LAi_QuestDelay("careen_gun5", 11.0);
			LAi_QuestDelay("careen_gun4", 12.0);
			LAi_QuestDelay("careen_gun3", 13.0);
			LAi_QuestDelay("careen_gun2", 15.0);
			LAi_QuestDelay("careen_gun1", 16.0);

			LAi_QuestDelay("fire_at_boats_turn1", 1.5);
			LAi_QuestDelay("m32_not fight", 3.0);
			LAi_QuestDelay("fire_at_boats_turn2", 12.0);
			LAi_QuestDelay("fire_at_boats_turn3", 15.0);

			LAi_QuestDelay("2_boats_sunk", 17.0);
		break;

		case "2_boats_sunk":
			Characters[GetCharacterIndex("Pell")].dialog.CurrentNode  = "2_boats_sunk";
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorDialogNow(characterFromID("Pell"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Pell"));
		break;

		case "to_the_blockhouse":
			Characters[GetCharacterIndex("Mutineer_32")].dialog.CurrentNode  = "to_the_blockhouse";
			LAi_SetActorType(characterFromID("Mutineer_32"));
			LAi_ActorDialogNow(characterFromID("Mutineer_32"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Mutineer_32"));
		break;

		case "prepare_withdraw":
			Locations[FindLocation("BB_careen_shore")].models.always.locators = "Shore06_l_careen_S2";

			characters[GetCharacterIndex("Maltese_soldier4")].Ship.Type = "obj_invisible";	//boat1 replaced
			characters[GetCharacterIndex("Maltese_soldier5")].Ship.Type = "obj_invisible";	//boat2 replaced
			characters[GetCharacterIndex("Maltese_red2")].Ship.Type = "obj_boat2_down";	//boat1 when hit	
			characters[GetCharacterIndex("Maltese_green")].Ship.Type = "obj_invisible";	//boat2 when hit, was obj_hatch12
			characters[GetCharacterIndex("Maltese_black")].Ship.Type = "obj_soldier";	//boat2 when hit
			characters[GetCharacterIndex("Maltese_knight")].Ship.Type = "obj_soldier";	//boat2 when hit
		
			ChangeCharacterAddressGroup(characterFromID("Mutineer_25"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("Mutineer_26"), "none", "", "");

			Locations[FindLocation("BB_careen_shore")].image = "";
			DoQuestReloadToLocation("BB_careen_shore", "goto", "goto12" ,"start_withdraw");
		break;

		case "start_withdraw":
			ChangeCharacterAddressGroup(characterFromID("Pell"), "BB_careen_shore", "goto", "tower_down");
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorRunToLocator(characterFromID("Pell"), "box", "box1", "bhousePell", 50.0);

			LAi_QuestDelay("withdraw_to_blockhouse1", 0.01);
			LAi_QuestDelay("withdraw_to_blockhouse2", 0.01);
			LAi_QuestDelay("withdraw_to_blockhouse3", 0.01);
			LAi_QuestDelay("withdraw_to_blockhouse4", 0.01);
			LAi_QuestDelay("withdraw_to_blockhouse5", 0.01);

			LAi_SetStayType(Pchar);
			LAi_QuestDelay("pchar_turn_to_ship_7", 9.0);
			LAi_QuestDelay("pchar_turn_to_box11", 18.0);
			LAi_QuestDelay("pchar_turn_to_goto23", 27.0);
			LAi_QuestDelay("pchar_turn_to_goto61", 36.0);
			LAi_QuestDelay("pchar_to_blockhouse1", 45.0);
		break;

		case "withdraw_to_blockhouse1":
			LAi_SetActorType(characterFromID("Mutineer_7"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_7"), "box", "box1", "bhouse7", 80.0);
			LAi_SetActorType(characterFromID("Mutineer_12"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_12"), "box", "box1", "bhouse12", 80.0);
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorRunToLocator(characterFromID("Caesar"), "box", "box1", "bhouseC", 80.0);
			LAi_SetActorType(characterFromID("Mutineer_1"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_1"), "box", "box1", "bhouse1", 80.0);
			LAi_SetActorType(characterFromID("Mutineer_11"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_11"), "box", "box1", "bhouse11", 80.0);
		break;

		case "withdraw_to_blockhouse2":
			LAi_SetActorType(characterFromID("Mutineer_13"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_13"), "box", "box1", "bhouse13", 65.0);		//this group was 60.0
			LAi_SetActorType(characterFromID("Mutineer_24"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_24"), "box", "box1", "bhouse24", 65.0);
			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorRunToLocator(characterFromID("Hands"), "box", "box1", "bhouseH", 65.0);
			LAi_SetActorType(characterFromID("Mutineer_5"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_5"), "box", "box1", "bhouse5", 65.0);
			LAi_SetActorType(characterFromID("Mutineer_2"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_2"), "box", "box1", "bhouse2", 65.0);
			LAi_SetActorType(characterFromID("Mutineer_19"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_19"), "box", "box1", "bhouse19", 65.0);
			LAi_SetActorType(characterFromID("Mutineer_6"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_6"), "box", "box1", "bhouse6", 65.0);
		break;

		case "withdraw_to_blockhouse3":
		    ChangeCharacterAddressGroup(characterFromID("Mutineer_14"), "none", "", "");
			LAi_SetActorType(characterFromID("Mutineer_18"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_18"), "box", "box1", "bhouse18", 50.0);
			LAi_SetActorType(characterFromID("Mutineer_9"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_9"), "box", "box1", "bhouse9", 50.0);
			LAi_SetActorType(characterFromID("Mutineer_32"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_32"), "box", "box1", "bhouse32", 50.0);
		    ChangeCharacterAddressGroup(characterFromID("Mutineer_21"), "none", "", "");
			LAi_SetActorType(characterFromID("Mutineer_27"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_27"), "box", "box1", "bhouse27", 50.0);
		break;

		case "withdraw_to_blockhouse4":
			LAi_SetActorType(characterFromID("Mutineer_31"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_31"), "box", "box1", "bhouse31", 40.0);
			LAi_SetActorType(characterFromID("Mutineer_10"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_10"), "box", "box1", "bhouse10", 40.0);
			LAi_SetActorType(characterFromID("Mutineer_4"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_4"), "box", "box1", "bhouse4", 40.0);
			LAi_SetActorType(characterFromID("Mutineer_20"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_20"), "box", "box1", "bhouse20", 40.0);
			LAi_SetActorType(characterFromID("Mutineer_15"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_15"), "box", "box1", "bhouse15", 40.0);
		break;

		case "withdraw_to_blockhouse5":
		    ChangeCharacterAddressGroup(characterFromID("Mutineer_25"), "none", "", "");
			LAi_SetActorType(characterFromID("Mutineer_16"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_16"), "box", "box1", "bhouse16", 30.0);
			LAi_SetActorType(characterFromID("Mutineer_3"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_3"), "box", "box1", "bhouse3", 30.0);
			LAi_SetActorType(characterFromID("Mutineer_17"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_17"), "box", "box1", "bhouse17", 30.0);
		    ChangeCharacterAddressGroup(characterFromID("Mutineer_26"), "none", "", "");
			LAi_SetActorType(characterFromID("Mutineer_8"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_8"), "box", "box1", "bhouse8", 30.0);
			LAi_SetActorType(characterFromID("Mutineer_22"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_22"), "box", "box1", "bhouse22", 30.0);
		break;
		case "bhouse7": ChangeCharacterAddressGroup(characterFromID("Mutineer_7"), "BB_careen_shore", "goto", "hidden"); break;
		case "bhouse12": ChangeCharacterAddressGroup(characterFromID("Mutineer_12"), "none", "", ""); break;
		case "bhouse12": ChangeCharacterAddressGroup(characterFromID("Mutineer_12"), "BB_careen_shore", "goto", "hidden"); break;
		case "bhouse1": ChangeCharacterAddressGroup(characterFromID("Mutineer_1"), "BB_careen_shore", "goto", "hidden"); break;
		case "bhouse11": ChangeCharacterAddressGroup(characterFromID("Mutineer_11"), "BB_careen_shore", "goto", "hidden"); break;

		case "bhouse13": ChangeCharacterAddressGroup(characterFromID("Mutineer_13"), "BB_careen_shore", "goto", "hidden"); break;
		case "bhouse24": ChangeCharacterAddressGroup(characterFromID("Mutineer_24"), "BB_careen_shore", "goto", "hidden"); break;
		case "bhouseH": ChangeCharacterAddressGroup(characterFromID("Hands"), "none", "", ""); break;
		case "bhouse5": ChangeCharacterAddressGroup(characterFromID("Mutineer_5"), "none", "", ""); break;
		case "bhouse2": ChangeCharacterAddressGroup(characterFromID("Mutineer_2"), "none", "", ""); break;
		case "bhouse19": ChangeCharacterAddressGroup(characterFromID("Mutineer_19"), "BB_careen_shore", "goto", "hidden"); break;
		case "bhouse6": ChangeCharacterAddressGroup(characterFromID("Mutineer_6"), "BB_careen_shore", "goto", "hidden"); break;

		case "bhouse18": ChangeCharacterAddressGroup(characterFromID("Mutineer_18"), "none", "", ""); break;
		case "bhouse9": ChangeCharacterAddressGroup(characterFromID("Mutineer_9"), "BB_careen_shore", "goto", "hidden"); break;
		case "bhouse32": ChangeCharacterAddressGroup(characterFromID("Mutineer_32"), "none", "", ""); break;
		case "bhouse27": ChangeCharacterAddressGroup(characterFromID("Mutineer_27"), "none", "", ""); break;
	
		case "bhouse31": ChangeCharacterAddressGroup(characterFromID("mutineer_31"), "BB_careen_blockhouse", "goto", "musk1"); 
				 LAi_SetStayType(characterFromID("mutineer_31")); break;
		case "bhouse10": ChangeCharacterAddressGroup(characterFromID("mutineer_10"), "BB_careen_blockhouse", "goto", "musk2");
				 LAi_SetStayType(characterFromID("mutineer_10")); break;
		case "bhouse20": ChangeCharacterAddressGroup(characterFromID("mutineer_20"), "BB_careen_blockhouse", "goto", "musk3");
				 LAi_SetPoorType(characterFromID("mutineer_20")); break;
		case "bhouse4":  ChangeCharacterAddressGroup(characterFromID("mutineer_4"), "BB_careen_blockhouse", "goto", "musk4");
				 LAi_SetStayType(characterFromID("mutineer_4")); break;
		case "bhouse15": ChangeCharacterAddressGroup(characterFromID("Mutineer_15"), "none", "", ""); break;

		case "bhouse16": ChangeCharacterAddressGroup(characterFromID("Mutineer_16"), "none", "", ""); break;
		case "bhouse3": ChangeCharacterAddressGroup(characterFromID("Mutineer_3"), "none", "", ""); break;
		case "bhouse17": ChangeCharacterAddressGroup(characterFromID("Mutineer_17"), "none", "", ""); break;
		case "bhouse8": ChangeCharacterAddressGroup(characterFromID("Mutineer_8"), "none", "", ""); break;
		case "bhouse22": ChangeCharacterAddressGroup(characterFromID("Mutineer_22"), "none", "", ""); break;

		case "bhousePell": ChangeCharacterAddressGroup(characterFromID("Pell"), "none", "", ""); break;


		case "pchar_turn_to_ship_7":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "ships_other", "ship_7");
		break;

		case "pchar_turn_to_box11":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "box", "box11");
		break;

		case "pchar_turn_to_goto23":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto23");

			LAi_QuestDelay("careen_boat4_last", 1.0);
			LAi_QuestDelay("careen_boat3_last", 3.0);
		break;
	
		case "careen_boat4_last":
			PlaySound("OBJECTS\SHIPCHARGE\CR12C.wav");
			CreateParticleSystem("canfire2" , 168.7, 2.0, 71.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 168.7, 2.0, 71.0, 3.14, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("careen_boat4_last_hit", 1.0);
		break;

		case "careen_boat4_last_hit":
			PlaySound("PEOPLE\cavern1.wav");
			PlaySound("OBJECTS\SHIPCHARGE\vzriv_pogreb_001.wav");

			CreateParticleSystemX("blast", 168.7, 6.0, -8.0, 0.0, 4.0, 0.0, 0);
			CreateParticleSystem("splinters" , 168.7, 6.0, -8.0, 0.0, 4.0, 0.0, sti(20) );
			CreateParticleSystem("splinters2" , 168.7, 6.0, -8.0, 0.0, 4.0, 0.0, sti(20) );
			CreateParticleSystem("splinters_enhanced" , 168.7, 6.0, -8.0, 0.0, 4.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 168.7, 6.0, -8.0, 0.0, 0.0, 0.0, sti(20) );
		break;
	
		case "careen_boat3_last":
			PlaySound("OBJECTS\SHIPCHARGE\CR12C.wav");
			CreateParticleSystem("canfire2" , 115.7, 2.0, 71.0, 3.14, 0.0, 0.0, sti(20) );
			CreateParticleSystem("MMcancloud" , 115.7, 2.0, 71.0, 3.14, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("careen_boat3_last_hit", 1.0);
		break;

		case "careen_boat3_last_hit":
			PlaySound("PEOPLE\cavern1.wav");
			PlaySound("OBJECTS\SHIPCHARGE\vzriv_pogreb_001.wav");

			CreateParticleSystemX("blast", 115.7, 6.0, 0.5, 0.0, 4.0, 0.0, 0);
			CreateParticleSystem("splinters" , 115.7, 6.0, 0.5, 0.0, 4.0, 0.0, sti(20) );
			CreateParticleSystem("splinters2" , 115.7, 6.0, 0.5, 0.0, 4.0, 0.0, sti(20) );
			CreateParticleSystem("splinters_enhanced" , 115.7, 6.0, 0.5, 0.0, 4.0, 0.0, sti(20) );
			CreateParticleSystem("blast_dirt" , 115.7, 6.0, 0.5, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("pchar_oh", 1.5);
		break;

		case "pchar_turn_to_goto61":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "goto61");
		break;

		case "pchar_to_blockhouse1":
			PlaySound("VOICE\ENGLISH\blaze_lets_go.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "locator26", "pchar_to_blockhouse1_A", 12.0);
		break;

		case "pchar_to_blockhouse1_A":
			LAi_SetStayType(Pchar);
			PlaySound("VOICE\ENGLISH\blaze_lead_way_out.wav");

			LAi_QuestDelay("pchar_to_blockhouse1_B", 1.0);
		break;

		case "pchar_to_blockhouse1_B":
			LAi_SetStayType(Pchar);
			PlaySound("VOICE\ENGLISH\blaze_follow_you.wav");

			LAi_QuestDelay("pchar_to_blockhouse2", 8.0);		//was 11 sec
		break;

		case "pchar_to_blockhouse2":
			Locations[FindLocation("BB_careen_shore")].models.always.locators = "Shore06_l_careen_S3";

			characters[GetCharacterIndex("Maltese_soldier6")].Ship.Type = "obj_invisible";	//boat3 replaced
			characters[GetCharacterIndex("Maltese_soldier7")].Ship.Type = "obj_invisible";	//boat4 replaced
			characters[GetCharacterIndex("Maltese_governor")].Ship.Type = "obj_invisible";	//boat4 replaced

			ChangeCharacterAddressGroup(characterFromID("Mutineer_13"), "BB_careen_shore", "goto", "hidden");
			ChangeCharacterAddressGroup(characterFromID("Mutineer_24"), "BB_careen_shore", "goto", "hidden");
			ChangeCharacterAddressGroup(characterFromID("Hands"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("Mutineer_5"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("Mutineer_9"), "BB_careen_shore", "goto", "hidden");
			ChangeCharacterAddressGroup(characterFromID("Mutineer_2"), "none", "", "");

			ChangeCharacterAddressGroup(characterFromID("Herrick"), "BB_careen_shore", "goto", "hidden");
		
			Locations[FindLocation("BB_careen_shore")].image = "";
			DoQuestReloadToLocation("BB_careen_shore", "goto", "locator26" ,"pchar_to_blockhouse3");
		break;

		case "pchar_to_blockhouse3":
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "goto", "trigger1", 21.0);		//was 18
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "goto", "trigger2", 10.0);		//was 9

			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(characterFromID("Herrick"), "BB_careen_shore", "quest", "marine_off2");
			LAi_SetImmortal(characterFromID("Herrick"), false);
			LAi_SetHP(CharacterFromID("Herrick"), 125.0, 125.0);

		//place 5 mutineers on roof here
			ChangeCharacterAddressGroup(characterFromID("mutineer_11"), "BB_careen_shore", "goto", "roof1");
			ChangeCharacterAddressGroup(characterFromID("mutineer_1"), "BB_careen_shore", "goto", "roof2");
			ChangeCharacterAddressGroup(characterFromID("mutineer_12"), "BB_careen_shore", "goto", "roof3");
			ChangeCharacterAddressGroup(characterFromID("mutineer_7"), "BB_careen_shore", "goto", "roof4");
			ChangeCharacterAddressGroup(characterFromID("mutineer_6"), "BB_careen_shore", "goto", "roof5");
			ChangeCharacterAddressGroup(characterFromID("mutineer_19"), "BB_careen_shore", "goto", "roof6");
			LAi_SetActorType(characterFromID("mutineer_11"));
			LAi_SetActorType(characterFromID("mutineer_1"));
			LAi_SetActorType(characterFromID("mutineer_12"));
			LAi_SetActorType(characterFromID("mutineer_7"));
			LAi_SetActorType(characterFromID("mutineer_6"));
			LAi_SetActorType(characterFromID("mutineer_19"));
	
		//and 4 mutineers in blockhouse
			ChangeCharacterAddressGroup(characterFromID("mutineer_31"), "BB_careen_blockhouse", "goto", "musk1"); 
			ChangeCharacterAddressGroup(characterFromID("mutineer_10"), "BB_careen_blockhouse", "goto", "musk2");
			ChangeCharacterAddressGroup(characterFromID("mutineer_20"), "BB_careen_blockhouse", "goto", "musk3");
			ChangeCharacterAddressGroup(characterFromID("mutineer_4"), "BB_careen_blockhouse", "goto", "musk4");
			LAi_SetStayType(characterFromID("mutineer_31"));
			LAi_SetStayType(characterFromID("mutineer_10"));
			LAi_SetPoorType(characterFromID("mutineer_20"));
			LAi_SetStayType(characterFromID("mutineer_4"));

		RemoveCharacterEquip(characterFromID("Mutineer_11"), GUN_ITEM_TYPE);
		RemoveCharacterEquip(characterFromID("Mutineer_11"), BLADE_ITEM_TYPE);
		DeleteAttribute(characterFromID("mutineer_11"), "items");
		GiveItem2Character(characterFromID("Mutineer_11"), "blade4");
		EquipCharacterByItem(characterFromID("Mutineer_11"), "blade4");

		RemoveCharacterEquip(characterFromID("Mutineer_1"), GUN_ITEM_TYPE);
		RemoveCharacterEquip(characterFromID("Mutineer_1"), BLADE_ITEM_TYPE);
		DeleteAttribute(characterFromID("mutineer_1"), "items");
		GiveItem2Character(characterFromID("Mutineer_1"), "blade4");
		EquipCharacterByItem(characterFromID("Mutineer_1"), "blade4");

		RemoveCharacterEquip(characterFromID("Mutineer_12"), GUN_ITEM_TYPE);
		RemoveCharacterEquip(characterFromID("Mutineer_12"), BLADE_ITEM_TYPE);
		DeleteAttribute(characterFromID("mutineer_12"), "items");
		GiveItem2Character(characterFromID("Mutineer_12"), "blade4");
		EquipCharacterByItem(characterFromID("Mutineer_12"), "blade4");

		RemoveCharacterEquip(characterFromID("Mutineer_7"), GUN_ITEM_TYPE);
		RemoveCharacterEquip(characterFromID("Mutineer_7"), BLADE_ITEM_TYPE);
		DeleteAttribute(characterFromID("mutineer_7"), "items");
		GiveItem2Character(characterFromID("Mutineer_7"), "blade4");
		EquipCharacterByItem(characterFromID("Mutineer_7"), "blade4");

		RemoveCharacterEquip(characterFromID("Mutineer_6"), GUN_ITEM_TYPE);
		RemoveCharacterEquip(characterFromID("Mutineer_6"), BLADE_ITEM_TYPE);
		DeleteAttribute(characterFromID("mutineer_6"), "items");
		GiveItem2Character(characterFromID("Mutineer_6"), "blade4");
		EquipCharacterByItem(characterFromID("Mutineer_6"), "blade4");

		RemoveCharacterEquip(characterFromID("Mutineer_19"), GUN_ITEM_TYPE);
		RemoveCharacterEquip(characterFromID("Mutineer_19"), BLADE_ITEM_TYPE);
		DeleteAttribute(characterFromID("mutineer_19"), "items");
		GiveItem2Character(characterFromID("Mutineer_19"), "blade4");
		EquipCharacterByItem(characterFromID("Mutineer_19"), "blade4");

			PlaySound("VOICE\ENGLISH\Eng_m_b_059.wav");
		
			LAi_QuestDelay("pchar_to_blockhouse4", 1.0);

			pchar.quest.pchar_to_blockhouse6_0.win_condition.l1 = "locator";
			pchar.quest.pchar_to_blockhouse6_0.win_condition.l1.location = "BB_careen_shore";
			pchar.quest.pchar_to_blockhouse6_0.win_condition.l1.locator_group = "goto";
			pchar.quest.pchar_to_blockhouse6_0.win_condition.l1.locator = "trigger1";
			pchar.quest.pchar_to_blockhouse6_0.win_condition = "pchar_to_blockhouse6_0";
		break;

		case "pchar_to_blockhouse4":
			ChangeCharacterAddressGroup(characterFromID("mutineer_6"), "BB_careen_shore", "goto", "roof5");
			ChangeCharacterAddressGroup(characterFromID("mutineer_19"), "BB_careen_shore", "goto", "roof6");
			ChangeCharacterAddressGroup(characterFromID("Caesar"), "none", "", "");

			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "quest", "marine1");

		RemoveCharacterEquip(characterFromID("Mutineer_31"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_31"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("mutineer_31"), "items");
			GiveItem2Character(characterFromID("Mutineer_31"), "blade4");
			EquipCharacterByItem(characterFromID("Mutineer_31"), "blade4");
			GiveItem2Character(characterFromID("Mutineer_31"), "PiratesPistol");
			EquipCharacterByItem(characterFromID("Mutineer_31"), "PiratesPistol");
			TakenItems(characterFromID("Mutineer_31"), "gunpowder", 2);
			TakenItems(characterFromID("Mutineer_31"), "pistolbullets", 2);

		RemoveCharacterEquip(characterFromID("Mutineer_10"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_10"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("mutineer_10"), "items");
			GiveItem2Character(characterFromID("Mutineer_10"), "blade4");
			EquipCharacterByItem(characterFromID("Mutineer_10"), "blade4");
			GiveItem2Character(characterFromID("Mutineer_10"), "PiratesPistol");
			EquipCharacterByItem(characterFromID("Mutineer_10"), "PiratesPistol");
			TakenItems(characterFromID("Mutineer_10"), "gunpowder", 2);
			TakenItems(characterFromID("Mutineer_10"), "pistolbullets", 2);

		RemoveCharacterEquip(characterFromID("Mutineer_20"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_20"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("mutineer_20"), "items");
			GiveItem2Character(characterFromID("Mutineer_20"), "blade4");
			EquipCharacterByItem(characterFromID("Mutineer_20"), "blade4");
			GiveItem2Character(characterFromID("Mutineer_20"), "PiratesPistol");
			EquipCharacterByItem(characterFromID("Mutineer_20"), "PiratesPistol");
			TakenItems(characterFromID("Mutineer_20"), "gunpowder", 2);
			TakenItems(characterFromID("Mutineer_20"), "pistolbullets", 2);

		RemoveCharacterEquip(characterFromID("Mutineer_4"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_4"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("mutineer_4"), "items");
			GiveItem2Character(characterFromID("Mutineer_4"), "blade4");
			EquipCharacterByItem(characterFromID("Mutineer_4"), "blade4");
			GiveItem2Character(characterFromID("Mutineer_4"), "PiratesPistol");
			EquipCharacterByItem(characterFromID("Mutineer_4"), "PiratesPistol");
			TakenItems(characterFromID("Mutineer_4"), "gunpowder", 2);
			TakenItems(characterFromID("Mutineer_4"), "pistolbullets", 2);

			LAi_QuestDelay("pchar_to_blockhouse5", 1.0);
		break;

		case "pchar_to_blockhouse5":
			LAi_group_MoveCharacter(characterFromID("car_marine1"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("car_marine2"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("car_marine3"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("car_marine4"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("car_marine5"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("car_marine6"), "ROOF_THUGS_1");

			LAi_group_MoveCharacter(characterFromID("Herrick"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("car_marine7"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("car_marine8"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("car_marine9"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("car_marine10"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("car_marine11"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("car_marine12"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("car_marine13"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("car_marine14"), "ROOF_THUGS_1");

			LAi_group_MoveCharacter(characterFromID("Inch"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("car_marine16"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("car_marine17"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("car_marine18"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("car_marine19"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("car_marine20"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("car_marine21"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("car_marine22"), "ROOF_THUGS_1");
			LAi_group_MoveCharacter(characterFromID("car_marine23"), "ROOF_THUGS_1");
		
			LAi_group_Register("ROOF_THUGS_1");
			LAi_group_SetRelation(LAI_GROUP_PLAYER, "ROOF_THUGS_1", LAI_GROUP_ENEMY);
			LAi_group_FightGroups(LAI_GROUP_PLAYER, "ROOF_THUGS_1", true);

			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(Pchar, true);
		break;

		case "pchar_to_blockhouse6_0":
			PlaySound("OBJECTS\SHIPCHARGE\gunner_fire.wav");

			LAi_QuestDelay("pchar_to_blockhouse6", 1.0);
		break;

		case "pchar_to_blockhouse6":
			PlaySound("OBJECTS\SHIPCHARGE\CR18C.wav");
			PlaySound("OBJECTS\DUEL\pistol_big.wav");
			CreateParticleSystem("gunfire" , 45.85, 13.65, -105.7, 0.0, 0.0, 0.0, sti(20) );	//roof 1
			CreateParticleSystem("gunfire" , 44.35, 13.65, -105.7, 0.0, 0.0, 0.0, sti(20) );	//roof 2
			CreateParticleSystem("gunfire" , 38.75, 13.65, -105.7, 0.0, 0.0, 0.0, sti(20) );	//roof 5

			if(!LAi_IsDead(CharacterFromID("car_marine5"))) LAi_KillCharacter(characterFromID("car_marine5"));
			if(!LAi_IsDead(CharacterFromID("car_marine2"))) LAi_KillCharacter(characterFromID("car_marine2"));
			if(!LAi_IsDead(CharacterFromID("car_marine3"))) LAi_KillCharacter(characterFromID("car_marine3"));

			LAi_QuestDelay("pchar_to_blockhouse6_A", 0.5);
			LAi_QuestDelay("pchar_to_blockhouse6_B", 1.0);

			pchar.quest.pchar_to_blockhouse7_0.win_condition.l1 = "locator";
			pchar.quest.pchar_to_blockhouse7_0.win_condition.l1.location = "BB_careen_shore";
			pchar.quest.pchar_to_blockhouse7_0.win_condition.l1.locator_group = "goto";
			pchar.quest.pchar_to_blockhouse7_0.win_condition.l1.locator = "trigger2";
			pchar.quest.pchar_to_blockhouse7_0.win_condition = "pchar_to_blockhouse7_0";
		break;

		case "pchar_to_blockhouse6_A":
			PlaySound("OBJECTS\SHIPCHARGE\CR18C.wav");
			CreateParticleSystem("gunfire" , 42.3, 13.65, -105.7, 0.0, 0.0, 0.0, sti(20) );		//roof 3
			CreateParticleSystem("gunfire" , 37.25, 13.65, -105.7, 0.0, 0.0, 0.0, sti(20) );	//roof 6

			if(!LAi_IsDead(CharacterFromID("car_marine6"))) LAi_KillCharacter(characterFromID("car_marine6"));
			if(!LAi_IsDead(CharacterFromID("car_marine4"))) LAi_KillCharacter(characterFromID("car_marine4"));
		break;

		case "pchar_to_blockhouse6_B":
			PlaySound("OBJECTS\SHIPCHARGE\CR12C.wav");
			CreateParticleSystem("gunfire" , 40.53, 13.65, -105.7, 0.0, 0.0, 0.0, sti(20) );	//roof 4

			if(!LAi_IsDead(CharacterFromID("car_marine1"))) LAi_KillCharacter(characterFromID("car_marine1"));
			ChangeCharacterAddressGroup(characterFromID("car_marine1"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("car_marine2"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("car_marine3"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("car_marine4"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("car_marine5"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("car_marine6"), "none", "", "");
		break;

		case "pchar_to_blockhouse7_0":
			PlaySound("OBJECTS\SHIPCHARGE\gunner_warning.wav");
		Characters[GetCharacterIndex("Mutineer_31")].Dialog.Filename = "Mutiny leader_dialog.c";
		Characters[GetCharacterIndex("Mutineer_10")].Dialog.Filename = "Mutiny leader_dialog.c";
		Characters[GetCharacterIndex("Mutineer_20")].Dialog.Filename = "Mutiny leader_dialog.c";
		Characters[GetCharacterIndex("Mutineer_4")].Dialog.Filename = "Mutiny leader_dialog.c";
		Characters[GetCharacterIndex("Mutineer_31")].dialog.CurrentNode  = "blockhouse";
		Characters[GetCharacterIndex("Mutineer_10")].dialog.CurrentNode  = "blockhouse";
		Characters[GetCharacterIndex("Mutineer_20")].dialog.CurrentNode  = "blockhouse";
		Characters[GetCharacterIndex("Mutineer_4")].dialog.CurrentNode  = "blockhouse";

			LAi_QuestDelay("pchar_to_blockhouse7", 0.5);
		break;

		case "pchar_to_blockhouse7":			
			PlaySound("OBJECTS\SHIPCHARGE\CR18C.wav");
			CreateParticleSystem("gunfire" , 42.3, 10.6, -103.9, 0.0, 0.0, 0.0, sti(20) );		//house 3
			CreateParticleSystem("gunfire" , 38.75, 10.6, -103.9, 0.0, 0.0, 0.0, sti(20) );		//house 4
		
			LAi_KillCharacter(characterFromID("car_marine14"));
			LAi_KillCharacter(characterFromID("car_marine8"));
			ChangeCharacterAddressGroup(characterFromID("car_marine14"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("car_marine8"), "none", "", "");

			LAi_QuestDelay("pchar_to_blockhouse7_A", 0.5);

			pchar.quest.pchar_to_blockhouse8.win_condition.l1 = "locator";
			pchar.quest.pchar_to_blockhouse8.win_condition.l1.location = "BB_careen_shore";
			pchar.quest.pchar_to_blockhouse8.win_condition.l1.locator_group = "reload";
			pchar.quest.pchar_to_blockhouse8.win_condition.l1.locator = "reload1";
			pchar.quest.pchar_to_blockhouse8.win_condition = "pchar_to_blockhouse8";
		break;

		case "pchar_to_blockhouse7_A":
			PlaySound("OBJECTS\SHIPCHARGE\CR18C.wav");
			PlaySound("OBJECTS\DUEL\pistol_big.wav");
			CreateParticleSystem("gunfire" , 45.85, 10.6, -103.9, 0.0, 0.0, 0.0, sti(20) );		//house 1
			CreateParticleSystem("gunfire" , 44.35, 10.6, -103.9, 0.0, 0.0, 0.0, sti(20) );		//house 2
			CreateParticleSystem("gunfire" , 37.25, 10.6, -103.9, 0.0, 0.0, 0.0, sti(20) );		//house 5, misses his shot

			LAi_KillCharacter(characterFromID("car_marine13"));
			LAi_KillCharacter(characterFromID("Herrick"));	
			ChangeCharacterAddressGroup(characterFromID("Herrick"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("car_marine13"), "none", "", "");
		break;

		case "pchar_to_blockhouse8":
			if(LAi_IsFightMode(Pchar)) {LAi_SetFightMode(Pchar, false);}

			pchar.quest.pchar_to_blockhouse9.win_condition.l1 = "location";
			pchar.quest.pchar_to_blockhouse9.win_condition.l1.location = "BB_careen_blockhouse";
			pchar.quest.pchar_to_blockhouse9.win_condition = "pchar_to_blockhouse9";
		break;

		case "pchar_to_blockhouse9":
	GiveItem2Character(Pchar, "clock1");
	EquipCharacterByItem(Pchar, "clock1");

			locations[FindLocation("BB_careen_shore")].type = "silent_seashore";
			LAi_SetActorType(Pchar);
			PlaySound("INTERFACE\key_lock.wav");
			LAi_LocationFightDisable(&Locations[FindLocation("BB_careen_shore")], true);
			LAi_group_SetRelation(LAI_GROUP_PLAYER, "ROOF_THUGS_1", LAI_GROUP_FRIEND);
			LAi_QuestDelay("pchar_puh", 1.0);

			ChangeCharacterAddressGroup(characterFromID("Mutineer_14"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("Mutineer_21"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("Mutineer_25"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("Mutineer_26"), "none", "", "");

			LAi_QuestDelay("pchar_to_blockhouse10", 2.0);
		break;

		case "pchar_to_blockhouse10":
			LAi_ActorRunToLocator(Pchar, "goto", "goto1", "pchar_to_blockhouse11", 3.0);
		break;

		case "pchar_to_blockhouse11":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "goto", "musk2");
			
			LAi_QuestDelay("pchar_to_blockhouse13_0", 1.0);
		break;

		case "pchar_to_blockhouse13_0":
			PlaySound("OBJECTS\SHIPCHARGE\gunner_warning.wav");
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box3", 1.0);			//temp
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload1", 0.0001);		//temp
			Locations[FindLocation("BB_careen_blockhouse")].reload.l1.disable = 0;

		RemoveCharacterEquip(characterFromID("Mutineer_6"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_6"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_6"), "items");
			GiveItem2Character(characterFromID("Mutineer_6"), "blade4");
			EquipCharacterByItem(characterFromID("Mutineer_6"), "blade4");
			GiveItem2Character(characterFromID("Mutineer_6"), "PiratesPistol");
			EquipCharacterByItem(characterFromID("Mutineer_6"), "PiratesPistol");
			TakenItems(characterFromID("Mutineer_6"), "gunpowder", 2);
			TakenItems(characterFromID("Mutineer_6"), "pistolbullets", 2);
	
		RemoveCharacterEquip(characterFromID("Mutineer_19"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_19"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_19"), "items");
			GiveItem2Character(characterFromID("Mutineer_19"), "blade4");
			EquipCharacterByItem(characterFromID("Mutineer_19"), "blade4");
			GiveItem2Character(characterFromID("Mutineer_19"), "PiratesPistol");
			EquipCharacterByItem(characterFromID("Mutineer_19"), "PiratesPistol");
			TakenItems(characterFromID("Mutineer_19"), "gunpowder", 2);
			TakenItems(characterFromID("Mutineer_19"), "pistolbullets", 2);

			LAi_QuestDelay("pchar_to_blockhouse13", 0.5);
		break;

		case "pchar_to_blockhouse13":
			PlaySound("OBJECTS\DUEL\pistol_musket.wav");
			CreateParticleSystem("gunfire" , 0.3, 1.3, 1.35, 3.1, 0.0, 0.0, sti(20) );		//inside 2

			RemoveCharacterEquip(characterFromID("Mutineer_9"), GUN_ITEM_TYPE);		//instead of nr5 Emilio
			RemoveCharacterEquip(characterFromID("Mutineer_9"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_9"), "items");
			GiveItem2Character(characterFromID("Mutineer_9"), "blade4");
			EquipCharacterByItem(characterFromID("Mutineer_9"), "blade4");
			GiveItem2Character(characterFromID("Mutineer_9"), "PiratesPistol");
			EquipCharacterByItem(characterFromID("Mutineer_9"), "PiratesPistol");
			TakenItems(characterFromID("Mutineer_9"), "gunpowder", 2);
			TakenItems(characterFromID("Mutineer_9"), "pistolbullets", 2);

			RemoveCharacterEquip(characterFromID("Mutineer_24"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_24"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_24"), "items");
			GiveItem2Character(characterFromID("Mutineer_24"), "blade4");
			EquipCharacterByItem(characterFromID("Mutineer_24"), "blade4");
			GiveItem2Character(characterFromID("Mutineer_24"), "PiratesPistol");
			EquipCharacterByItem(characterFromID("Mutineer_24"), "PiratesPistol");
			TakenItems(characterFromID("Mutineer_24"), "gunpowder", 2);
			TakenItems(characterFromID("Mutineer_24"), "pistolbullets", 2);

			LAi_QuestDelay("pchar_to_blockhouse14", 1.0);
		break;

		case "pchar_to_blockhouse14":
			PlaySound("OBJECTS\DUEL\pistol_musket.wav");
			CreateParticleSystem("gunfire" , -2.7, 1.3, 1.35, 3.1, 0.0, 0.0, sti(20) );		//inside 1

		RemoveCharacterEquip(characterFromID("Mutineer_13"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_13"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_13"), "items");
			GiveItem2Character(characterFromID("Mutineer_13"), "blade4");
			EquipCharacterByItem(characterFromID("Mutineer_13"), "blade4");
			GiveItem2Character(characterFromID("Mutineer_13"), "PiratesPistol");
			EquipCharacterByItem(characterFromID("Mutineer_13"), "PiratesPistol");
			TakenItems(characterFromID("Mutineer_13"), "gunpowder", 2);
			TakenItems(characterFromID("Mutineer_13"), "pistolbullets", 2);

		RemoveCharacterEquip(characterFromID("Mutineer_11"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_11"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_11"), "items");
			GiveItem2Character(characterFromID("Mutineer_11"), "blade4");
			EquipCharacterByItem(characterFromID("Mutineer_11"), "blade4");
			GiveItem2Character(characterFromID("Mutineer_11"), "PiratesPistol");
			EquipCharacterByItem(characterFromID("Mutineer_11"), "PiratesPistol");
			TakenItems(characterFromID("Mutineer_11"), "gunpowder", 2);
			TakenItems(characterFromID("Mutineer_11"), "pistolbullets", 2);

			LAi_QuestDelay("pchar_to_blockhouse15", 0.5);
		break;

		case "pchar_to_blockhouse15":
			PlaySound("OBJECTS\DUEL\pistol_musket.wav");
			CreateParticleSystem("gunfire" , 1.8, 1.3, 1.35, 3.1, 0.0, 0.0, sti(20) );		//inside 3

		RemoveCharacterEquip(characterFromID("Mutineer_1"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_1"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_1"), "items");
			GiveItem2Character(characterFromID("Mutineer_1"), "blade4");
			EquipCharacterByItem(characterFromID("Mutineer_1"), "blade4");
			GiveItem2Character(characterFromID("Mutineer_1"), "PiratesPistol");
			EquipCharacterByItem(characterFromID("Mutineer_1"), "PiratesPistol");
			TakenItems(characterFromID("Mutineer_1"), "gunpowder", 2);
			TakenItems(characterFromID("Mutineer_1"), "pistolbullets", 2);

		RemoveCharacterEquip(characterFromID("Mutineer_12"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_12"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_12"), "items");
			GiveItem2Character(characterFromID("Mutineer_12"), "blade4");
			EquipCharacterByItem(characterFromID("Mutineer_12"), "blade4");
			GiveItem2Character(characterFromID("Mutineer_12"), "PiratesPistol");
			EquipCharacterByItem(characterFromID("Mutineer_12"), "PiratesPistol");
			TakenItems(characterFromID("Mutineer_12"), "gunpowder", 2);
			TakenItems(characterFromID("Mutineer_12"), "pistolbullets", 2);

			LAi_QuestDelay("pchar_to_blockhouse16", 1.5);						//inside next room 1, 2
			LAi_QuestDelay("pchar_to_blockhouse16", 2.0);
			LAi_QuestDelay("pchar_to_blockhouse17", 3.5);
		break;

		case "pchar_to_blockhouse16":
			PlaySound("OBJECTS\DUEL\pistol_musket2.wav");						//inside next room 1, 2

		RemoveCharacterEquip(characterFromID("Mutineer_7"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_7"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_7"), "items");
			GiveItem2Character(characterFromID("Mutineer_7"), "blade4");
			EquipCharacterByItem(characterFromID("Mutineer_7"), "blade4");
			GiveItem2Character(characterFromID("Mutineer_7"), "PiratesPistol");
			EquipCharacterByItem(characterFromID("Mutineer_7"), "PiratesPistol");
			TakenItems(characterFromID("Mutineer_7"), "gunpowder", 2);
			TakenItems(characterFromID("Mutineer_7"), "pistolbullets", 2);
		break;

		case "pchar_to_blockhouse17":
			PlaySound("PEOPLE\counter_openclose.wav");
			LAi_SetStayType(characterFromID("Mutineer_32"));
			ChangeCharacterAddressGroup(characterFromID("mutineer_32"), "BB_careen_blockhouse", "goto", "goto3");
			
		RemoveCharacterEquip(characterFromID("Hands"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Hands"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("Hands"), "bladepowderhornN");
			TakeItemFromCharacter(characterFromID("Hands"), "pistolbarrel4");
			EquipCharacterByItem(characterFromID("Hands"), "blade2");
			EquipCharacterByItem(characterFromID("Hands"), "pistol6");

		RemoveCharacterEquip(characterFromID("Caesar"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Caesar"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("Caesar"), "bladepowderhornN");
			TakeItemFromCharacter(characterFromID("Caesar"), "pistolbarrel4");
			EquipCharacterByItem(characterFromID("Caesar"), "blade4");
			EquipCharacterByItem(characterFromID("Caesar"), "PiratesPistol");

			LAi_QuestDelay("pchar_to_blockhouse18", 1.5);
		break;

		case "pchar_to_blockhouse18":
			Characters[GetCharacterIndex("Mutineer_32")].dialog.CurrentNode  = "no_ammo";
			LAi_SetActorType(characterFromID("Mutineer_32"));
			LAi_ActorDialogNow(characterFromID("Mutineer_32"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Mutineer_32"));
		break;

		case "pchar_to_blockhouse19":
			DoQuickSave();
			LAi_SetPlayerType(Pchar);
			LAi_SetStayType(characterFromID("Mutineer_32"));
			Characters[GetCharacterIndex("Mutineer_32")].dialog.CurrentNode  = "blockhouse";
			LAi_LocationFightDisable(&Locations[FindLocation("BB_careen_shore")], false);
			Locations[FindLocation("BB_careen_shore")].models.always.locators = "Shore06_l_careen_S4";	//last fight positions
			Characters[GetCharacterIndex("Margaret_Pough")].Ship.Type = "obj_Boat2G_small_crew";
			Characters[GetCharacterIndex("KR_indian_L")].Ship.Type = "obj_Boat2G_crew";
			Characters[GetCharacterIndex("KR_indian_1")].Ship.Type = "obj_Boat2G_crew";

			LAi_SetImmortal(CharacterFromID("mutineer_6"), false);
		//	LAi_SetImmortal(CharacterFromID("mutineer_19"), false);		//survives to be a swimmer
			LAi_SetImmortal(CharacterFromID("mutineer_13"), false);
			LAi_SetImmortal(CharacterFromID("mutineer_9"), false);
			LAi_SetImmortal(CharacterFromID("mutineer_24"), false);
			LAi_SetImmortal(CharacterFromID("mutineer_11"), false);
			LAi_SetImmortal(CharacterFromID("mutineer_1"), false);
			LAi_SetImmortal(CharacterFromID("mutineer_12"), false);
			LAi_SetImmortal(CharacterFromID("mutineer_7"), false);

			LAi_KillCharacter(characterFromID("car_marine18"));
			LAi_KillCharacter(characterFromID("car_marine19"));
			LAi_KillCharacter(characterFromID("car_marine20"));
			LAi_KillCharacter(characterFromID("car_marine21"));
			LAi_KillCharacter(characterFromID("car_marine22"));
			LAi_KillCharacter(characterFromID("car_marine23"));

			ChangeCharacterAddressGroup(characterFromID("car_marine18"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("car_marine19"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("car_marine20"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("car_marine21"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("car_marine22"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("car_marine23"), "none", "", "");

			pchar.quest.pchar_to_blockhouse20.win_condition.l1 = "location";
			pchar.quest.pchar_to_blockhouse20.win_condition.l1.location = "BB_careen_shore";
			pchar.quest.pchar_to_blockhouse20.win_condition = "pchar_to_blockhouse20";
		break;

		case "pchar_to_blockhouse20":
			//logit("IMMORTAL");
			LAi_SetImmortal(pchar, true);

			if(!IsEquipCharacterByItem(Pchar, "pistolcannon"))
			{
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "pistolcannon");
			}

			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(Pchar, true);

			ChangeCharacterAddressGroup(characterFromID("mutineer_32"), "BB_careen_shore", "goto", "hidden");

			ChangeCharacterAddressGroup(characterFromID("mutineer_6"), "BB_careen_shore", "goto", "def1");
			ChangeCharacterAddressGroup(characterFromID("mutineer_19"), "BB_careen_shore", "goto", "def2");
			ChangeCharacterAddressGroup(characterFromID("mutineer_13"), "BB_careen_shore", "goto", "def3");
			ChangeCharacterAddressGroup(characterFromID("mutineer_9"), "BB_careen_shore", "goto", "def4");
			ChangeCharacterAddressGroup(characterFromID("mutineer_24"), "BB_careen_shore", "goto", "def5");	
			ChangeCharacterAddressGroup(characterFromID("mutineer_11"), "BB_careen_shore", "goto", "def6");
			ChangeCharacterAddressGroup(characterFromID("mutineer_1"), "BB_careen_shore", "goto", "def7"); 
			ChangeCharacterAddressGroup(characterFromID("mutineer_12"), "BB_careen_shore", "goto", "def8");
			ChangeCharacterAddressGroup(characterFromID("mutineer_7"), "BB_careen_shore", "goto", "def9"); 
		
			LAi_SetOfficerType(characterFromID("Mutineer_6"));
			LAi_SetOfficerType(characterFromID("Mutineer_19"));
			LAi_SetOfficerType(characterFromID("Mutineer_9"));
			LAi_SetOfficerType(characterFromID("Mutineer_24"));
			LAi_SetOfficerType(characterFromID("Mutineer_13"));
			LAi_SetOfficerType(characterFromID("Mutineer_11"));
			LAi_SetOfficerType(characterFromID("Mutineer_1"));
			LAi_SetOfficerType(characterFromID("Mutineer_12"));
			LAi_SetOfficerType(characterFromID("Mutineer_7"));
		
			LAi_SetOfficerType(characterFromID("Hands"));
			LAi_SetOfficerType(characterFromID("Caesar"));
			LAi_SetOfficerType(characterFromID("Pell"));

			LAi_group_MoveCharacter(characterFromID("mutineer_6"), "LAI_GROUP_PLAYER");
			LAi_group_MoveCharacter(characterFromID("mutineer_19"), "LAI_GROUP_PLAYER");
			LAi_group_MoveCharacter(characterFromID("mutineer_9"), "LAI_GROUP_PLAYER");
			LAi_group_MoveCharacter(characterFromID("mutineer_24"), "LAI_GROUP_PLAYER");
			LAi_group_MoveCharacter(characterFromID("mutineer_13"), "LAI_GROUP_PLAYER");
			LAi_group_MoveCharacter(characterFromID("mutineer_11"), "LAI_GROUP_PLAYER");
			LAi_group_MoveCharacter(characterFromID("mutineer_1"), "LAI_GROUP_PLAYER");
			LAi_group_MoveCharacter(characterFromID("mutineer_12"), "LAI_GROUP_PLAYER");
			LAi_group_MoveCharacter(characterFromID("mutineer_7"), "LAI_GROUP_PLAYER");
		//-------------------------------------------------------------------------------------------
			ChangeCharacterAddressGroup(characterFromID("car_marine7"), "BB_careen_shore", "quest", "marine7");
			ChangeCharacterAddressGroup(characterFromID("car_marine9"), "BB_careen_shore", "quest", "marine9");
			ChangeCharacterAddressGroup(characterFromID("car_marine10"), "BB_careen_shore", "quest", "marine10");
			ChangeCharacterAddressGroup(characterFromID("car_marine11"), "BB_careen_shore", "quest", "marine11");
			ChangeCharacterAddressGroup(characterFromID("car_marine12"), "BB_careen_shore", "quest", "marine12");
			ChangeCharacterAddressGroup(characterFromID("Herrick"), "BB_careen_shore", "quest", "marine_off2");
			ChangeCharacterAddressGroup(characterFromID("Inch"), "BB_careen_shore", "quest", "marine1_off1");
			ChangeCharacterAddressGroup(characterFromID("car_marine16"), "BB_careen_shore", "quest", "marine16");
			ChangeCharacterAddressGroup(characterFromID("car_marine17"), "BB_careen_shore", "quest", "marine17");
	
			LAi_group_MoveCharacter(characterFromID("car_marine7"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("car_marine9"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("car_marine10"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("car_marine11"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("car_marine12"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("Herrick"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("Inch"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("car_marine16"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("car_marine17"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("car_marine28"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("car_marine29"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("car_marine30"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("car_marine31"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("car_marine32"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("car_marine33"), "ROOF_THUGS_2");

			LAi_group_Register("ROOF_THUGS_2");
			LAi_group_SetRelation(LAI_GROUP_PLAYER, "ROOF_THUGS_2", LAI_GROUP_ENEMY);
			LAi_group_FightGroups(LAI_GROUP_PLAYER, "ROOF_THUGS_2", true);

			LAi_QuestDelay("pchar_to_blockhouse21", 2.0);
			LAi_QuestDelay("pchar_to_blockhouse23", 0.1);	
		
			Pchar.quest.careen_shore_fight_end.win_condition.l1 = "NPC_Death";
			Pchar.quest.careen_shore_fight_end.win_condition.l1.character = "car_marine7";
			Pchar.quest.careen_shore_fight_end.win_condition.l2 = "NPC_Death";
			Pchar.quest.careen_shore_fight_end.win_condition.l2.character = "car_marine9";
			Pchar.quest.careen_shore_fight_end.win_condition.l3 = "NPC_Death";
			Pchar.quest.careen_shore_fight_end.win_condition.l3.character = "car_marine10";
			Pchar.quest.careen_shore_fight_end.win_condition.l4 = "NPC_Death";
			Pchar.quest.careen_shore_fight_end.win_condition.l4.character = "car_marine11";
			Pchar.quest.careen_shore_fight_end.win_condition.l5 = "NPC_Death";
			Pchar.quest.careen_shore_fight_end.win_condition.l5.character = "car_marine12";
			Pchar.quest.careen_shore_fight_end.win_condition.l6 = "NPC_Death";
			Pchar.quest.careen_shore_fight_end.win_condition.l6.character = "Herrick";
			Pchar.quest.careen_shore_fight_end.win_condition.l7 = "NPC_Death";
			Pchar.quest.careen_shore_fight_end.win_condition.l7.character = "car_marine16";
			Pchar.quest.careen_shore_fight_end.win_condition.l8 = "NPC_Death";
			Pchar.quest.careen_shore_fight_end.win_condition.l8.character = "car_marine17";
			Pchar.quest.careen_shore_fight_end.win_condition.l9 = "NPC_Death";
			Pchar.quest.careen_shore_fight_end.win_condition.l9.character = "car_marine28";
			Pchar.quest.careen_shore_fight_end.win_condition.l10 = "NPC_Death";
			Pchar.quest.careen_shore_fight_end.win_condition.l10.character = "car_marine29";
			Pchar.quest.careen_shore_fight_end.win_condition.l11 = "NPC_Death";
			Pchar.quest.careen_shore_fight_end.win_condition.l11.character = "car_marine30";
			Pchar.quest.careen_shore_fight_end.win_condition.l12 = "NPC_Death";
			Pchar.quest.careen_shore_fight_end.win_condition.l12.character = "car_marine31";
			Pchar.quest.careen_shore_fight_end.win_condition.l13 = "NPC_Death";
			Pchar.quest.careen_shore_fight_end.win_condition.l13.character = "car_marine32";
			Pchar.quest.careen_shore_fight_end.win_condition.l14 = "NPC_Death";
			Pchar.quest.careen_shore_fight_end.win_condition.l14.character = "car_marine33";
			Pchar.quest.careen_shore_fight_end.win_condition.l15 = "NPC_Death";
			Pchar.quest.careen_shore_fight_end.win_condition.l15.character = "Inch";
			Pchar.quest.careen_shore_fight_end.win_condition = "careen_shore_fight_end";
		break;

		case "pchar_to_blockhouse21":
			LAi_group_MoveCharacter(Pchar, "LAI_GROUP_PLAYER");

			LAi_QuestDelay("pchar_to_blockhouse22", 7.0);
		break;

		case "pchar_to_blockhouse22":
			LAi_SetImmortal(pchar, false);
			//logit("MORTAL");
		break;

		case "pchar_to_blockhouse23":
			pg = GetCharacterItem(pchar, "pistolgrapes");
			if(pg <=6)
			{
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "pistolbbuss");

				if(CheckCharacterItem(Pchar,"pistol3"))
				{
					LAi_QuestDelay("pchar_to_blockhouse24", 0.1);
				}
			}
			else LAi_QuestDelay("pchar_to_blockhouse23", 0.5);
		break;

		case "pchar_to_blockhouse24":
			pg = GetCharacterItem(pchar, "pistolgrapes");
			if(pg <=4)
			{
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "pistol3");
			}
			else LAi_QuestDelay("pchar_to_blockhouse24", 0.5);
		break;

		case "careen_shore_fight_end":
			RemoveCharacterEquip(characterFromID("car_marine7"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("car_marine7"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("car_marine7"), "items");
			AddMoneyToCharacter(characterFromID("car_marine7"), -1000);

			RemoveCharacterEquip(characterFromID("car_marine9"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("car_marine9"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("car_marine9"), "items");
			AddMoneyToCharacter(characterFromID("car_marine9"), -1000);

			RemoveCharacterEquip(characterFromID("car_marine10"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("car_marine10"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("car_marine10"), "items");
			AddMoneyToCharacter(characterFromID("car_marine10"), -1000);
		ChangeCharacterAddressGroup(characterFromID("car_marine10"), "none", "", "");

			RemoveCharacterEquip(characterFromID("car_marine11"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("car_marine11"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("car_marine11"), "items");
			AddMoneyToCharacter(characterFromID("car_marine11"), -1000);

			RemoveCharacterEquip(characterFromID("car_marine12"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("car_marine12"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("car_marine12"), "items");
			AddMoneyToCharacter(characterFromID("car_marine12"), -1000);

			RemoveCharacterEquip(characterFromID("car_marine16"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("car_marine16"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("car_marine16"), "items");
			AddMoneyToCharacter(characterFromID("car_marine16"), -1000);

			RemoveCharacterEquip(characterFromID("car_marine17"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("car_marine17"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("car_marine17"), "items");
			AddMoneyToCharacter(characterFromID("car_marine17"), -1000);

			RemoveCharacterEquip(characterFromID("car_marine28"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("car_marine28"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("car_marine28"), "items");
			AddMoneyToCharacter(characterFromID("car_marine28"), -1000);

			RemoveCharacterEquip(characterFromID("car_marine29"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("car_marine29"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("car_marine29"), "items");
			AddMoneyToCharacter(characterFromID("car_marine29"), -1000);

			RemoveCharacterEquip(characterFromID("car_marine30"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("car_marine30"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("car_marine30"), "items");
			AddMoneyToCharacter(characterFromID("car_marine30"), -1000);

			RemoveCharacterEquip(characterFromID("car_marine31"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("car_marine31"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("car_marine31"), "items");
			AddMoneyToCharacter(characterFromID("car_marine31"), -1000);

			RemoveCharacterEquip(characterFromID("car_marine32"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("car_marine32"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("car_marine32"), "items");
			AddMoneyToCharacter(characterFromID("car_marine32"), -1000);

			RemoveCharacterEquip(characterFromID("car_marine33"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("car_marine33"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("car_marine33"), "items");
			AddMoneyToCharacter(characterFromID("car_marine33"), -1000);

			RemoveCharacterEquip(characterFromID("Herrick"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Herrick"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Herrick"), "items");
			AddMoneyToCharacter(characterFromID("Herrick"), -1000);

			RemoveCharacterEquip(characterFromID("Inch"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Inch"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Inch"), "items");
			AddMoneyToCharacter(characterFromID("Inch"), -1000);

			LAi_SetActorType(Pchar);
	
			PauseAllSounds();//stops music
			LAi_QuestDelay("hurrah", 0.5);
			
			characters[GetCharacterIndex("Hands")].dialog.CurrentNode = "neutral";
			characters[GetCharacterIndex("Caesar")].dialog.CurrentNode = "neutral";
			characters[GetCharacterIndex("Pell")].dialog.CurrentNode = "neutral";

			LAi_QuestDelay("careen_shore_fight_end0", 0.1);
			LAi_QuestDelay("careen_shore_fight_end0", 1.0);
			LAi_QuestDelay("careen_shore_fight_end0", 2.0);
			LAi_QuestDelay("careen_shore_fight_end0", 3.0);

			LAi_QuestDelay("careen_shore_fight_end1", 2.0);
		break;

		case "careen_shore_fight_end0":
			LAi_LocationFightDisable(&Locations[FindLocation("BB_careen_shore")], true);

			if(LAi_IsFightMode(Pchar)) {LAi_SetFightMode(Pchar, false);}
			if(LAi_IsFightMode(characterFromID("Hands"))) {LAi_SetPlayerType(characterFromID("Hands"));       LAi_SetFightMode(characterFromID("Hands"), false);}
			if(LAi_IsFightMode(characterFromID("Caesar"))) {LAi_SetPlayerType(characterFromID("Caesar"));  LAi_SetFightMode(characterFromID("Caesar"), false);}
			if(LAi_IsFightMode(characterFromID("Pell"))) {LAi_SetPlayerType(characterFromID("Pell"));  LAi_SetFightMode(characterFromID("Pell"), false);}

			if(LAi_IsFightMode(characterFromID("mutineer_6"))) {LAi_SetPlayerType(characterFromID("mutineer_6"));  LAi_SetFightMode(characterFromID("mutineer_6"), false);}
			if(LAi_IsFightMode(characterFromID("mutineer_19"))) {LAi_SetPlayerType(characterFromID("mutineer_19")); LAi_SetFightMode(characterFromID("mutineer_19"), false);}
			if(LAi_IsFightMode(characterFromID("mutineer_9"))) {LAi_SetPlayerType(characterFromID("mutineer_9")); LAi_SetFightMode(characterFromID("mutineer_9"), false);}
			if(LAi_IsFightMode(characterFromID("mutineer_24"))) {LAi_SetPlayerType(characterFromID("mutineer_24")); LAi_SetFightMode(characterFromID("mutineer_24"), false);}
			if(LAi_IsFightMode(characterFromID("mutineer_13"))) {LAi_SetPlayerType(characterFromID("mutineer_13")); LAi_SetFightMode(characterFromID("mutineer_13"), false);}
			if(LAi_IsFightMode(characterFromID("mutineer_11"))) {LAi_SetPlayerType(characterFromID("mutineer_11")); LAi_SetFightMode(characterFromID("mutineer_11"), false);}
			if(LAi_IsFightMode(characterFromID("mutineer_1"))) {LAi_SetPlayerType(characterFromID("mutineer_1")); LAi_SetFightMode(characterFromID("mutineer_1"), false);}
			if(LAi_IsFightMode(characterFromID("mutineer_12"))) {LAi_SetPlayerType(characterFromID("mutineer_12")); LAi_SetFightMode(characterFromID("mutineer_12"), false);}
			if(LAi_IsFightMode(characterFromID("mutineer_7"))) {LAi_SetPlayerType(characterFromID("mutineer_7")); LAi_SetFightMode(characterFromID("mutineer_7"), false);}
		break;

		case "careen_shore_fight_end1":
			LAi_ActorTurnToLocator(Pchar, "reload", "reload1");
			ChangeCharacterAddressGroup(characterFromID("mutineer_32"), "BB_careen_shore", "reload", "reload1");
			PlaySound("PEOPLE\counter_openclose.wav");

			Characters[GetCharacterIndex("Mutineer_19")].name = TranslateString("", "King David");
			Characters[GetCharacterIndex("Mutineer_23")].name = TranslateString("", "Crimson Pirate");

			LAi_QuestDelay("careen_shore_fight_end2", 1.5);
		break;

		case "careen_shore_fight_end2":
			Characters[GetCharacterIndex("Mutineer_32")].dialog.CurrentNode  = "what_now";
			LAi_SetActorType(characterFromID("Mutineer_32"));
			LAi_ActorDialogNow(characterFromID("Mutineer_32"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Mutineer_32"));
		break;

		case "careen_shore_fight_end3":
			LAi_QuestDelay("hurrah", 0.1);
			
			LAi_QuestDelay("careen_shore_fight_end4", 2.0);
		break;

		case "careen_shore_fight_end4":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "who_can_swim";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "careen_shore_fight_end5":
			Characters[GetCharacterIndex("Caesar")].dialog.CurrentNode  = "neutral_swim";
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorDialogNow(characterFromID("Caesar"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Caesar"));
		break;

		case "careen_shore_fight_end6":
			Characters[GetCharacterIndex("Mutineer_19")].Dialog.Filename = "Mutiny leader_dialog.c";
			Characters[GetCharacterIndex("Mutineer_19")].dialog.CurrentNode  = "swim";
			LAi_SetActorType(characterFromID("Mutineer_19"));
			LAi_ActorDialogNow(characterFromID("Mutineer_19"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Mutineer_19"));
		break;

		case "careen_shore_fight_end7":
			Characters[GetCharacterIndex("Mutineer_32")].dialog.CurrentNode  = "shackels";
			LAi_SetActorType(characterFromID("Mutineer_32"));
			LAi_ActorDialogNow(characterFromID("Mutineer_32"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Mutineer_32"));
		break;

		case "careen_shore_fight_end7_A":
			LAi_QuestDelay("pchar_sigh", 0.1);
			LAi_QuestDelay("pchar_sigh", 0.1);
			LAi_QuestDelay("careen_shore_fight_end7_B", 2.0);
		break;

		case "careen_shore_fight_end7_B":
			PlaySound("AMBIENT\UnHappy-001.wav");

			if(!LAi_IsDead(CharacterFromID("Mutineer_6")))
			{ LAi_SetActorType(CharacterFromID("Mutineer_6")); LAi_ActorTurnToCharacter(characterFromID("Mutineer_6"), Pchar); }

			if(!LAi_IsDead(CharacterFromID("Mutineer_19")))
			{ LAi_SetActorType(CharacterFromID("Mutineer_19")); LAi_ActorTurnToCharacter(characterFromID("Mutineer_19"), Pchar); }

			if(!LAi_IsDead(CharacterFromID("Mutineer_9")))
			{ LAi_SetActorType(CharacterFromID("Mutineer_9")); LAi_ActorTurnToCharacter(characterFromID("Mutineer_9"), Pchar); }

			if(!LAi_IsDead(CharacterFromID("Mutineer_24")))
			{ LAi_SetActorType(CharacterFromID("Mutineer_24")); LAi_ActorTurnToCharacter(characterFromID("Mutineer_24"), Pchar); }

			if(!LAi_IsDead(CharacterFromID("Mutineer_13")))
			{ LAi_SetActorType(CharacterFromID("Mutineer_13")); LAi_ActorTurnToCharacter(characterFromID("Mutineer_13"), Pchar); }

			if(!LAi_IsDead(CharacterFromID("Mutineer_11")))
			{ LAi_SetActorType(CharacterFromID("Mutineer_11")); LAi_ActorTurnToCharacter(characterFromID("Mutineer_11"), Pchar); }

			if(!LAi_IsDead(CharacterFromID("Mutineer_1")))
			{ LAi_SetActorType(CharacterFromID("Mutineer_1")); LAi_ActorTurnToCharacter(characterFromID("Mutineer_1"), Pchar); }

			if(!LAi_IsDead(CharacterFromID("Mutineer_12")))
			{ LAi_SetActorType(CharacterFromID("Mutineer_12")); LAi_ActorTurnToCharacter(characterFromID("Mutineer_12"), Pchar); }

			if(!LAi_IsDead(CharacterFromID("Mutineer_7")))
			{ LAi_SetActorType(CharacterFromID("Mutineer_7")); LAi_ActorTurnToCharacter(characterFromID("Mutineer_7"), Pchar); }

			LAi_SetActorType(CharacterFromID("Hands")); LAi_ActorTurnToCharacter(characterFromID("Hands"), Pchar);
			LAi_SetActorType(CharacterFromID("Pell")); LAi_ActorTurnToCharacter(characterFromID("Pell"), Pchar);

			LAi_QuestDelay("careen_shore_fight_end8", 3.5);
		break;

		case "careen_shore_fight_end8":
			Characters[GetCharacterIndex("Mutineer_19")].dialog.CurrentNode  = "lockpick";
			LAi_SetActorType(characterFromID("Mutineer_19"));
			LAi_ActorDialogNow(characterFromID("Mutineer_19"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Mutineer_19"));
		break;

		case "careen_shore_fight_end9":
			LAi_SetActorType(characterFromID("Mutineer_32"));
			LAi_ActorTurnToLocator(characterFromID("Mutineer_32"), "goto", "roof4");

			LAi_QuestDelay("careen_shore_fight_end10", 1.0);
		break;

		case "careen_shore_fight_end10":
			PlaySound("INTERFACE\knock.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload1");

			LAi_QuestDelay("careen_shore_fight_end11", 1.0);
		break;

		case "careen_shore_fight_end11":
			ChangeCharacterAddressGroup(characterFromID("mutineer_23"), "BB_careen_shore", "reload", "reload1");
			PlaySound("PEOPLE\counter_openclose.wav");
			ChangeCharacterAddressGroup(characterFromID("mutineer_32"), "BB_careen_shore", "goto", "def3");

			Locations[FindLocation("BB_careen_shore")].reload.l1.disable = 1;				//no more access to blockhouse	

			LAi_QuestDelay("careen_shore_fight_end12", 1.5);
		break;

		case "careen_shore_fight_end12":
			Characters[GetCharacterIndex("Mutineer_23")].Dialog.Filename = "Mutiny leader_dialog.c";
			Characters[GetCharacterIndex("Mutineer_23")].dialog.CurrentNode  = "crimson_pirate";
			LAi_SetActorType(characterFromID("Mutineer_23"));
			LAi_ActorDialogNow(characterFromID("Mutineer_23"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Mutineer_23"));
		break;

		case "careen_shore_fight_end13":
			PlaySound("AMBIENT\cheer.wav");

			LAi_QuestDelay("careen_shore_fight_end14", 4.5);
		break;

		case "careen_shore_fight_end14":
			Characters[GetCharacterIndex("Mutineer_23")].dialog.CurrentNode  = "school";
			LAi_SetActorType(characterFromID("Mutineer_23"));
			LAi_ActorDialogNow(characterFromID("Mutineer_23"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Mutineer_23"));
		break;

		case "careen_shore_fight_end15":
			PlaySound("AMBIENT\cheer2.wav");

			LAi_QuestDelay("careen_shore_fight_end16", 4.5);
		break;

		case "careen_shore_fight_end16":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "red_uniforms";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "careen_shore_fight_end17":		
			LAi_QuestDelay("mut6_sold", 1.0);

			LAi_QuestDelay("mut1_sold", 2.0);
			LAi_QuestDelay("mut7_sold", 2.0);

			LAi_QuestDelay("mut9_sold", 3.0);
			LAi_QuestDelay("mut11_sold", 3.0);

			LAi_QuestDelay("mut12_sold", 4.0);
			LAi_QuestDelay("mut13_sold", 4.0);
			LAi_QuestDelay("mut24_sold", 4.0);

			LAi_QuestDelay("mut_sold_to boats", 6.0);		//ok here
			LAi_QuestDelay("mut_swimmers_to shore", 8.0);		//ok here		
		break;
    //-----------------------------------------------------------------------------------
		
		case "mut6_sold":
			if(!LAi_IsDead(CharacterFromID("Mutineer_6")))
			{
				PlaySound("PEOPLE\clothes1.wav");
				SetModel(characterFromID("Mutineer_6"), "Soldier_Eng_17", "man", "man", 1.8, false);
				ChangeCharacterAddressGroup(characterFromID("car_marine7"), "none", "", "");				

				LAi_QuestDelay("mut6_sold_1", 1.0);
			}
		break;

		case "mut6_sold_1":
			PlaySound("OBJECTS\DUEL\pistol_out1original.wav");
			RemoveCharacterEquip(characterFromID("Mutineer_6"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_6"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_6"), "items");
			GiveItem2Character(characterFromID("Mutineer_6"), "bladeX4");
			EquipCharacterByItem(characterFromID("Mutineer_6"), "bladeX4");
			GiveItem2Character(characterFromID("Mutineer_6"), "pistolmketB");
			EquipCharacterByItem(characterFromID("Mutineer_6"), "pistolmketB");
			TakenItems(characterFromID("Mutineer_6"), "gunpowder", 2);
			TakenItems(characterFromID("Mutineer_6"), "musketbullets", 1);

			weaponID = GetCharacterEquipByGroup(characterFromID("Mutineer_6"),GUN_ITEM_TYPE);
			Items_FindItem(weaponID, &weapon);
			if(weapon.model == "musketB")
			{
				weapon.model = "musketB_back";
				RemoveCharacterEquip(characterFromID("Mutineer_6"), GUN_ITEM_TYPE );
				EquipCharacterByItem(characterFromID("Mutineer_6"), "pistolmketB");
			}
		break;
	//..................................................................
		case "mut1_sold":
			if(!LAi_IsDead(CharacterFromID("Mutineer_1")))
			{
				PlaySound("PEOPLE\clothes1.wav");
				SetModel(characterFromID("Mutineer_1"), "Soldier_Eng2_17", "man", "man", 1.8, false);
				ChangeCharacterAddressGroup(characterFromID("car_marine9"), "none", "", "");			

				LAi_QuestDelay("mut1_sold_1", 1.0);
			}
		break;

		case "mut1_sold_1":
			PlaySound("OBJECTS\DUEL\pistol_out1original.wav");
			RemoveCharacterEquip(characterFromID("Mutineer_1"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_1"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_1"), "items");
			GiveItem2Character(characterFromID("Mutineer_1"), "bladeX4");
			EquipCharacterByItem(characterFromID("Mutineer_1"), "bladeX4");
			GiveItem2Character(characterFromID("Mutineer_1"), "pistolmketB");
			EquipCharacterByItem(characterFromID("Mutineer_1"), "pistolmketB");
			TakenItems(characterFromID("Mutineer_1"), "gunpowder", 2);
			TakenItems(characterFromID("Mutineer_1"), "musketbullets", 1);

			weaponID = GetCharacterEquipByGroup(characterFromID("Mutineer_1"),GUN_ITEM_TYPE);
			Items_FindItem(weaponID, &weapon);
			if(weapon.model == "musketB")
			{
				weapon.model = "musketB_back";
				RemoveCharacterEquip(characterFromID("Mutineer_1"), GUN_ITEM_TYPE );
				EquipCharacterByItem(characterFromID("Mutineer_1"), "pistolmketB");
			}
		break;
	//..................................................................
		case "mut7_sold":
			if(!LAi_IsDead(CharacterFromID("Mutineer_7")))
			{
				SetModel(characterFromID("Mutineer_7"), "Soldier_Eng6_17", "man", "man", 1.8, false);
				ChangeCharacterAddressGroup(characterFromID("car_marine10"), "none", "", "");				

				LAi_QuestDelay("mut7_sold_1", 1.0);
			}
		break;

		case "mut7_sold_1":
			RemoveCharacterEquip(characterFromID("Mutineer_7"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_7"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_7"), "items");
			GiveItem2Character(characterFromID("Mutineer_7"), "bladeX4");
			EquipCharacterByItem(characterFromID("Mutineer_7"), "bladeX4");
			GiveItem2Character(characterFromID("Mutineer_7"), "pistolmketB");
			EquipCharacterByItem(characterFromID("Mutineer_7"), "pistolmketB");
			TakenItems(characterFromID("Mutineer_7"), "gunpowder", 2);
			TakenItems(characterFromID("Mutineer_7"), "musketbullets", 1);

			weaponID = GetCharacterEquipByGroup(characterFromID("Mutineer_7"),GUN_ITEM_TYPE);
			Items_FindItem(weaponID, &weapon);
			if(weapon.model == "musketB")
			{
				weapon.model = "musketB_back";
				RemoveCharacterEquip(characterFromID("Mutineer_7"), GUN_ITEM_TYPE );
				EquipCharacterByItem(characterFromID("Mutineer_7"), "pistolmketB");
			}
		break;
	//..................................................................
		case "mut9_sold":
			if(!LAi_IsDead(CharacterFromID("Mutineer_9")))
			{
				PlaySound("PEOPLE\clothes1.wav");
				SetModel(characterFromID("Mutineer_9"), "Soldier_Eng2_17", "man", "man", 1.8, false);
				ChangeCharacterAddressGroup(characterFromID("car_marine11"), "none", "", "");			

				LAi_QuestDelay("mut9_sold_1", 1.0);
			}
		break;

		case "mut9_sold_1":
			PlaySound("OBJECTS\DUEL\pistol_out1original.wav");
			RemoveCharacterEquip(characterFromID("Mutineer_9"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_9"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_9"), "items");
			GiveItem2Character(characterFromID("Mutineer_9"), "bladeX4");
			EquipCharacterByItem(characterFromID("Mutineer_9"), "bladeX4");
			GiveItem2Character(characterFromID("Mutineer_9"), "pistolmketB");
			EquipCharacterByItem(characterFromID("Mutineer_9"), "pistolmketB");
			TakenItems(characterFromID("Mutineer_9"), "gunpowder", 2);
			TakenItems(characterFromID("Mutineer_9"), "musketbullets", 1);

			weaponID = GetCharacterEquipByGroup(characterFromID("Mutineer_9"),GUN_ITEM_TYPE);
			Items_FindItem(weaponID, &weapon);
			if(weapon.model == "musketB")
			{
				weapon.model = "musketB_back";
				RemoveCharacterEquip(characterFromID("Mutineer_9"), GUN_ITEM_TYPE );
				EquipCharacterByItem(characterFromID("Mutineer_9"), "pistolmketB");
			}
		break;
	//..................................................................
		case "mut11_sold":
			if(!LAi_IsDead(CharacterFromID("Mutineer_11")))
			{
				SetModel(characterFromID("Mutineer_11"), "Soldier_Eng2_17", "man", "man", 1.8, false);
				ChangeCharacterAddressGroup(characterFromID("car_marine12"), "none", "", "");			

				LAi_QuestDelay("mut11_sold_1", 1.0);
			}
		break;

		case "mut11_sold_1":
			RemoveCharacterEquip(characterFromID("Mutineer_11"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_11"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_11"), "items");
			GiveItem2Character(characterFromID("Mutineer_11"), "bladeX4");
			EquipCharacterByItem(characterFromID("Mutineer_11"), "bladeX4");
			GiveItem2Character(characterFromID("Mutineer_11"), "pistolmketB");
			EquipCharacterByItem(characterFromID("Mutineer_11"), "pistolmketB");
			TakenItems(characterFromID("Mutineer_11"), "gunpowder", 2);
			TakenItems(characterFromID("Mutineer_11"), "musketbullets", 1);

			weaponID = GetCharacterEquipByGroup(characterFromID("Mutineer_11"),GUN_ITEM_TYPE);
			Items_FindItem(weaponID, &weapon);
			if(weapon.model == "musketB")
			{
				weapon.model = "musketB_back";
				RemoveCharacterEquip(characterFromID("Mutineer_11"), GUN_ITEM_TYPE );
				EquipCharacterByItem(characterFromID("Mutineer_11"), "pistolmketB");
			}
		break;
	//..................................................................
		case "mut12_sold":
			if(!LAi_IsDead(CharacterFromID("Mutineer_12")))
			{
				SetModel(characterFromID("Mutineer_12"), "Soldier_Eng3_17", "man", "man", 1.8, false);
				ChangeCharacterAddressGroup(characterFromID("car_marine16"), "none", "", "");			

				LAi_QuestDelay("mut12_sold_1", 1.0);
			}
		break;

		case "mut12_sold_1":
			RemoveCharacterEquip(characterFromID("Mutineer_12"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_12"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_12"), "items");
			GiveItem2Character(characterFromID("Mutineer_12"), "bladeX4");
			EquipCharacterByItem(characterFromID("Mutineer_12"), "bladeX4");
			GiveItem2Character(characterFromID("Mutineer_12"), "pistolmketB");
			EquipCharacterByItem(characterFromID("Mutineer_12"), "pistolmketB");
			TakenItems(characterFromID("Mutineer_12"), "gunpowder", 2);
			TakenItems(characterFromID("Mutineer_12"), "musketbullets", 1);

			weaponID = GetCharacterEquipByGroup(characterFromID("Mutineer_12"),GUN_ITEM_TYPE);
			Items_FindItem(weaponID, &weapon);
			if(weapon.model == "musketB")
			{
				weapon.model = "musketB_back";
				RemoveCharacterEquip(characterFromID("Mutineer_12"), GUN_ITEM_TYPE );
				EquipCharacterByItem(characterFromID("Mutineer_12"), "pistolmketB");
			}
		break;
	//..................................................................
		case "mut13_sold":
			if(!LAi_IsDead(CharacterFromID("Mutineer_13")))
			{
				SetModel(characterFromID("Mutineer_13"), "Soldier_Eng2_17", "man", "man", 1.8, false);
				ChangeCharacterAddressGroup(characterFromID("car_marine17"), "none", "", "");			

				LAi_QuestDelay("mut13_sold_1", 1.0);
			}
		break;

		case "mut13_sold_1":
			RemoveCharacterEquip(characterFromID("Mutineer_13"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_13"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_13"), "items");
			GiveItem2Character(characterFromID("Mutineer_13"), "bladeX4");
			EquipCharacterByItem(characterFromID("Mutineer_13"), "bladeX4");
			GiveItem2Character(characterFromID("Mutineer_13"), "pistolmketB");
			EquipCharacterByItem(characterFromID("Mutineer_13"), "pistolmketB");
			TakenItems(characterFromID("Mutineer_13"), "gunpowder", 2);
			TakenItems(characterFromID("Mutineer_13"), "musketbullets", 1);

			weaponID = GetCharacterEquipByGroup(characterFromID("Mutineer_13"),GUN_ITEM_TYPE);
			Items_FindItem(weaponID, &weapon);
			if(weapon.model == "musketB")
			{
				weapon.model = "musketB_back";
				RemoveCharacterEquip(characterFromID("Mutineer_13"), GUN_ITEM_TYPE );
				EquipCharacterByItem(characterFromID("Mutineer_13"), "pistolmketB");
			}
		break;
	//..................................................................
		case "mut24_sold":
			if(!LAi_IsDead(CharacterFromID("Mutineer_24")))
			{
				PlaySound("PEOPLE\clothes1.wav");
				SetModel(characterFromID("Mutineer_24"), "Soldier_Eng3_17", "man", "man", 1.8, false);
				ChangeCharacterAddressGroup(characterFromID("car_marine28"), "none", "", "");			

				LAi_QuestDelay("mut24_sold_1", 1.0);
			}
		break;

		case "mut24_sold_1":
			PlaySound("OBJECTS\DUEL\pistol_out1original.wav");
			RemoveCharacterEquip(characterFromID("Mutineer_24"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_24"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_24"), "items");
			GiveItem2Character(characterFromID("Mutineer_24"), "bladeX4");
			EquipCharacterByItem(characterFromID("Mutineer_24"), "bladeX4");
			GiveItem2Character(characterFromID("Mutineer_24"), "pistolmketB");
			EquipCharacterByItem(characterFromID("Mutineer_24"), "pistolmketB");
			TakenItems(characterFromID("Mutineer_24"), "gunpowder", 2);
			TakenItems(characterFromID("Mutineer_24"), "musketbullets", 1);

			weaponID = GetCharacterEquipByGroup(characterFromID("Mutineer_24"),GUN_ITEM_TYPE);
			Items_FindItem(weaponID, &weapon);
			if(weapon.model == "musketB")
			{
				weapon.model = "musketB_back";
				RemoveCharacterEquip(characterFromID("Mutineer_24"), GUN_ITEM_TYPE );
				EquipCharacterByItem(characterFromID("Mutineer_24"), "pistolmketB");
			}
		break;
		
    //-----------------------------------------------------------------------------------
		
		case "mut_sold_to boats":
			if(!LAi_IsDead(CharacterFromID("Mutineer_6")))
			{
				LAi_SetActorType(characterFromID("Mutineer_6"));
				LAi_ActorRunToLocator(characterFromID("Mutineer_6"), "goto", "citizen01", "", 20.0);
			}
			if(!LAi_IsDead(CharacterFromID("Mutineer_13")))
			{
				LAi_SetActorType(characterFromID("Mutineer_13"));
				LAi_ActorRunToLocator(characterFromID("Mutineer_13"), "goto", "citizen01", "", 20.0);
			}
			if(!LAi_IsDead(CharacterFromID("Mutineer_9")))
			{
				LAi_SetActorType(characterFromID("Mutineer_9"));
				LAi_ActorRunToLocator(characterFromID("Mutineer_9"), "goto", "citizen01", "", 20.0);
			}
			if(!LAi_IsDead(CharacterFromID("Mutineer_24")))
			{
				LAi_SetActorType(characterFromID("Mutineer_24"));
				LAi_ActorRunToLocator(characterFromID("Mutineer_24"), "goto", "citizen01", "", 20.0);
			}
			if(!LAi_IsDead(CharacterFromID("Mutineer_11")))
			{
				LAi_SetActorType(characterFromID("Mutineer_11"));
				LAi_ActorRunToLocator(characterFromID("Mutineer_11"), "goto", "citizen01", "", 20.0);
			}
			if(!LAi_IsDead(CharacterFromID("Mutineer_1")))
			{
				LAi_SetActorType(characterFromID("Mutineer_1"));
				LAi_ActorRunToLocator(characterFromID("Mutineer_1"), "goto", "citizen01", "", 20.0);
			}
			if(!LAi_IsDead(CharacterFromID("Mutineer_12")))
			{
				LAi_SetActorType(characterFromID("Mutineer_12"));
				LAi_ActorRunToLocator(characterFromID("Mutineer_12"), "goto", "citizen01", "", 20.0);
			}
			if(!LAi_IsDead(CharacterFromID("Mutineer_7")))
			{
				LAi_SetActorType(characterFromID("Mutineer_7"));
				LAi_ActorRunToLocator(characterFromID("Mutineer_7"), "goto", "citizen01", "", 20.0);
			}

			LAi_QuestDelay("mut_sold_to boats1", 20.0);
		break;

		case "mut_sold_to boats1":
			ChangeCharacterAddressGroup(characterFromID("mutineer_6"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("mutineer_13"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("mutineer_9"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("mutineer_24"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("mutineer_11"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("mutineer_1"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("mutineer_12"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("mutineer_7"), "none", "", "");
		break;
	
    //-----------------------------------------------------------------------------------

		case "mut_swimmers_to shore":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "mut_swimmers_to shore";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "mut_swimmers_to shore1":
			PlaySound("OBJECTS\DUEL\man_hit1.wav");

			RemoveOfficersIndex(pchar, GetCharacterIndex("Caesar"));
			RemovePassenger(Pchar, characterFromID("Caesar"));

			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorRunToLocator(characterFromID("Caesar"), "goto", "gun3A", "", 35.0);
			LAi_SetActorType(characterFromID("mutineer_23"));
			LAi_ActorRunToLocator(characterFromID("mutineer_23"), "goto", "locator12", "mut_swimmers_to shore2", 35.0);
			LAi_SetActorType(characterFromID("mutineer_19"));
			LAi_ActorRunToLocator(characterFromID("mutineer_19"), "goto", "gun3B", "", 35.0);

			LAi_QuestDelay("crimson_greeting", 1.0);
			LAi_QuestDelay("king_david_greeting", 2.0);
			LAi_QuestDelay("mut_officers_outfits", 4.0);
		break;

		case "crimson_greeting":
			PlaySound("VOICE\ENGLISH\gr_wench3_aye.wav");
		break;

		case "king_david_greeting":
			PlaySound("VOICE\ENGLISH\Dut_m_a_017.wav");
		break;

		case "mut_swimmers_to shore2":
			ChangeCharacterAddressGroup(characterFromID("Caesar"), "BB_careen_shore", "goto", "gun3A");
			ChangeCharacterAddressGroup(characterFromID("mutineer_23"), "BB_careen_shore", "goto", "locator12");
			ChangeCharacterAddressGroup(characterFromID("mutineer_19"), "BB_careen_shore", "goto", "gun3B");
			LAi_SetStayType(characterFromID("Caesar"));
			LAi_SetStayType(characterFromID("mutineer_23"));
			LAi_SetStayType(characterFromID("mutineer_19"));
		break;

    //-----------------------------------------------------------------------------------	

		case "mut_officers_outfits":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "officers_outfits";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "mut_officers_outfits1":
			ChangeCharacterAddressGroup(characterFromID("mutineer_32"), "BB_careen_shore", "goto", "def3");
			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorRunToLocator(characterFromID("Hands"), "goto", "def4", "Hands_to_def4", 5.0);
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorRunToLocator(characterFromID("Pell"), "goto", "def7", "Pell_to_def7", 4.0);
	
			LAi_QuestDelay("mut32_sold", 4.0);
		break;

		case "Hands_to_def4":
			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_careen_shore", "goto", "def4");

			LAi_QuestDelay("Hands_midshipman", 5.0);
		break;

		case "Pell_to_def7":
			ChangeCharacterAddressGroup(characterFromID("Pell"), "BB_careen_shore", "goto", "def7");

			LAi_QuestDelay("Pell_lieutenant", 4.0);	
		break;
	//..................................................................
		case "Hands_midshipman":
			PlaySound("PEOPLE\clothes1.wav");
			SetModel(characterFromID("Hands"), "bb_Hands2_officer", "man", "man", 1.8, false);
			ChangeCharacterAddressGroup(characterFromID("Herrick"), "none", "", "");

			LAi_QuestDelay("careen_shore_fight_end18", 1.0);					
		break;
	//..................................................................
		case "Pell_lieutenant":
			PlaySound("PEOPLE\clothes1.wav");
			SetModel(characterFromID("Pell"), "bb_Pell_officer", "man", "man", 1.8, false);
			ChangeCharacterAddressGroup(characterFromID("Inch"), "none", "", "");			
		break;
	//..................................................................
		case "mut32_sold":
			if(!LAi_IsDead(CharacterFromID("Mutineer_32")))
			{
				PlaySound("PEOPLE\clothes1.wav");
				SetModel(characterFromID("Mutineer_32"), "bb_qm_soldier", "man", "man", 1.8, false);
				ChangeCharacterAddressGroup(characterFromID("car_marine29"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("car_marine30"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("car_marine31"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("car_marine33"), "none", "", "");
				ChangeCharacterAddressGroup(characterFromID("car_marine32"), "none", "", "");			

				LAi_QuestDelay("mut32_sold_1", 1.0);
			}
		break;

		case "mut32_sold_1":
			PlaySound("OBJECTS\DUEL\pistol_out1original.wav");
			RemoveCharacterEquip(characterFromID("Mutineer_32"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_32"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_32"), "items");
			GiveItem2Character(characterFromID("Mutineer_32"), "bladeX4");
			EquipCharacterByItem(characterFromID("Mutineer_32"), "bladeX4");
			GiveItem2Character(characterFromID("Mutineer_32"), "pistolmketB");
			EquipCharacterByItem(characterFromID("Mutineer_32"), "pistolmketB");
			TakenItems(characterFromID("Mutineer_32"), "gunpowder", 2);
			TakenItems(characterFromID("Mutineer_32"), "musketbullets", 1);

			weaponID = GetCharacterEquipByGroup(characterFromID("Mutineer_32"),GUN_ITEM_TYPE);
			Items_FindItem(weaponID, &weapon);
			if(weapon.model == "musketB")
			{
				weapon.model = "musketB_back";
				RemoveCharacterEquip(characterFromID("Mutineer_32"), GUN_ITEM_TYPE );
				EquipCharacterByItem(characterFromID("Mutineer_32"), "pistolmketB");
			}
		break;
	
    //-----------------------------------------------------------------------------------	

		case "careen_shore_fight_end18":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "command_the_boats";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "careen_shore_fight_end19":
			Characters[GetCharacterIndex("Mutineer_32")].dialog.CurrentNode  = "succeed";
			LAi_SetActorType(characterFromID("Mutineer_32"));
			LAi_ActorDialogNow(characterFromID("Mutineer_32"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Mutineer_32"));
		break;

		case "careen_shore_fight_end20":
			Characters[GetCharacterIndex("Pell")].dialog.CurrentNode  = "crew_decides";
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorDialogNow(characterFromID("Pell"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Pell"));
		break;

		case "careen_shore_fight_end21":
			characters[GetCharacterIndex("Hands")].dialog.CurrentNode = "what_about_weapons";
			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorDialog(characterFromID("Hands"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hands"));
		break;

		case "careen_shore_fight_end22":
			Characters[GetCharacterIndex("Mutineer_32")].dialog.CurrentNode  = "signal_how";
			LAi_SetActorType(characterFromID("Mutineer_32"));
			LAi_ActorDialogNow(characterFromID("Mutineer_32"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Mutineer_32"));
		break;

		case "careen_shore_fight_end23":
			PlaySound("VOICE\ENGLISH\gr_Hands1.wav");
			RemoveOfficersIndex(pchar, GetCharacterIndex("Hands"));
			RemovePassenger(pchar, characterFromID("Hands"));
			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorRunToLocator(characterFromID("Hands"), "goto", "Hands_boat", "careen_shore_fight_end23_A", 85.0);	//was 90

			LAi_QuestDelay("careen_shore_fight_end24", 2.0);
		break;

		case "careen_shore_fight_end23_A":
			LAi_SetPlayerType(characterFromID("Hands"));
			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_careen_shore", "quest", "mut");
		break;

		case "careen_shore_fight_end24":
			PlaySound("VOICE\ENGLISH\gm_crew16A.wav");
			RemoveOfficersIndex(pchar, GetCharacterIndex("Pell"));
			RemovePassenger(pchar, characterFromID("Pell"));
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorRunToLocator(characterFromID("Pell"), "goto", "Pell_boat", "careen_shore_fight_end24_A", 68.0); 	//was 78

			LAi_QuestDelay("careen_shore_fight_end25", 2.0);
		break;

		case "careen_shore_fight_end24_A":
			LAi_SetPlayerType(characterFromID("Pell"));
			ChangeCharacterAddressGroup(characterFromID("Pell"), "BB_careen_shore", "quest", "mut");
		break;

		case "careen_shore_fight_end25":
			PlaySound("VOICE\ENGLISH\Dupin_good_day.wav");
			LAi_SetActorType(characterFromID("Mutineer_32"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_32"), "goto", "citizen01", "careen_shore_fight_end25_A", 55.0);

			LAi_QuestDelay("careen_shore_fight_end26", 3.0);
		break;

		case "careen_shore_fight_end25_A":
			ChangeCharacterAddressGroup(characterFromID("Mutineer_32"), "none", "", "");
		break;

		case "careen_shore_fight_end26":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "quest", "marine_off1");

			LAi_QuestDelay("pchar_playertype", 2.0);

			pchar.quest.careen_shore_fight_end27.win_condition.l1 = "locator";
			pchar.quest.careen_shore_fight_end27.win_condition.l1.location = "BB_careen_shore";
			pchar.quest.careen_shore_fight_end27.win_condition.l1.locator_group = "quest";
			pchar.quest.careen_shore_fight_end27.win_condition.l1.locator = "pyle_swim";
			pchar.quest.careen_shore_fight_end27.win_condition = "careen_shore_fight_end27";
		break;

		case "careen_shore_fight_end27":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "wait_until_dark";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "careen_shore_fight_end28":
			SetCurrentTime(0.00, 0);
			Pchar.quest.JRH_sky = "";
			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Clear";
			Locations[FindLocation("BB_careen_shore")].locators_radius.ships_other.ship_7 = 420.0;

			RemoveCharacterEquip(Pchar, POUCH_ITEM_TYPE );
			RemoveCharacterEquip(Pchar, BELT_ITEM_TYPE );
			RemoveCharacterEquip(Pchar, EQUIP3_ITEM_TYPE );		//hat
			RemoveCharacterEquip(Pchar, FLASK_ITEM_TYPE );		//earlier powderflask

			DeleteAttribute(Pchar, "items");
			GiveItem2Character(Pchar, "book71_9_start");
			GiveItem2Character(Pchar, "picture8_A");
 
			DeleteAttribute(characterFromID("Caesar"), "items");
			DeleteAttribute(characterFromID("mutineer_23"), "items");
			DeleteAttribute(characterFromID("mutineer_19"), "items");

			GiveItem2Character(pchar,"bladeX4");
			EquipCharacterByItem(pchar, "bladeX4");
			GiveItem2Character(characterFromID("Caesar"),"bladeX4");
			EquipCharacterByItem(characterFromID("Caesar"), "bladeX4");
			GiveItem2Character(characterFromID("mutineer_23"),"bladeX4");
			EquipCharacterByItem(characterFromID("mutineer_23"), "bladeX4");
			GiveItem2Character(characterFromID("mutineer_19"),"bladeX4");
			EquipCharacterByItem(characterFromID("mutineer_19"), "bladeX4");

			SetModel(PChar, "Howard_Pyle", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);

			DoQuestReloadToLocation("BB_careen_shore", "goto", "pyle_swim_start" ,"careen_shore_fight_end30");
		break;

		case "careen_shore_fight_end30":
			LAi_SetPlayerType(pchar);
			PlaySound("VOICE\ENGLISH\blaze_lets_go.wav");

			AddPassenger(Pchar, characterFromID("Caesar"), 0);
			SetOfficersIndex(Pchar, 1, getCharacterIndex("Caesar"));
			characters[GetCharacterIndex("Caesar")].dialog.CurrentNode = "neutral";
			LAi_SetOfficerType(characterFromID("Caesar"));

			AddPassenger(Pchar, characterFromID("mutineer_23"), 0);
			SetOfficersIndex(Pchar, 2, getCharacterIndex("mutineer_23"));
			characters[GetCharacterIndex("mutineer_23")].dialog.CurrentNode = "neutral";
			LAi_SetOfficerType(characterFromID("mutineer_23"));

			AddPassenger(Pchar, characterFromID("mutineer_19"), 0);
			SetOfficersIndex(Pchar, 3, getCharacterIndex("mutineer_19"));
			characters[GetCharacterIndex("mutineer_19")].dialog.CurrentNode = "neutral";
			LAi_SetOfficerType(characterFromID("mutineer_19"));

			pchar.quest.prepare_start_careen_corvette.win_condition.l1 = "locator";
			pchar.quest.prepare_start_careen_corvette.win_condition.l1.location = "BB_careen_shore";
			pchar.quest.prepare_start_careen_corvette.win_condition.l1.locator_group = "ships_other";
			pchar.quest.prepare_start_careen_corvette.win_condition.l1.locator = "ship_7";
			pchar.quest.prepare_start_careen_corvette.win_condition = "prepare_start_careen_corvette";
		break;

//careen corvette start
//-------------------------------------------------------------------------------------------------------------
		case "prepare_start_careen_corvette":
			//from jump start or above
			Characters[GetCharacterIndex("Mutineer_32")].name = TranslateString("", "Quartermaster");

			DoQuestReloadToLocation("BB_careen_capsm", "goto", "arrive" ,"start_careen_corvette");
		break;

		case "start_careen_corvette":
			PlaySound("PEOPLE\recoil.wav");
			ChangeCharacterAddressGroup(characterFromID("Bolitho"), "BB_careen_capmd_2", "goto", "cap_sit");
			LAi_SetSitType(characterFromID("Bolitho"));
			
			//yes here, not in console!
			Characters[GetCharacterIndex("Mutineer_19")].name = TranslateString("", "King David");
			Characters[GetCharacterIndex("Mutineer_23")].name = TranslateString("", "Crimson Pirate");

			Characters[GetCharacterIndex("Mutineer_19")].Dialog.Filename = "Mutiny leader_dialog.c";
			Characters[GetCharacterIndex("Mutineer_23")].Dialog.Filename = "Mutiny leader_dialog.c";

			Characters[GetCharacterIndex("Mutineer_19")].dialog.CurrentNode  = "neutral_king_david";
			Characters[GetCharacterIndex("Mutineer_23")].dialog.CurrentNode  = "neutral_crimson_pirate";
			Characters[GetCharacterIndex("Caesar")].dialog.CurrentNode  = "neutral_silent";

			Pchar.careen_convicts = "locked";
			Pchar.careen_weatherdeck = "too_soon";

			pchar.quest.explore_corvette.win_condition.l1 = "locator";
			pchar.quest.explore_corvette.win_condition.l1.location = "BB_careen_capsm";
			pchar.quest.explore_corvette.win_condition.l1.locator_group = "quest";
			pchar.quest.explore_corvette.win_condition.l1.locator = "start";
			pchar.quest.explore_corvette.win_condition = "explore_corvette";

			pchar.quest.careen_wdeck.win_condition.l1 = "location";
			pchar.quest.careen_wdeck.win_condition.l1.location = "BB_careen_corvette";
			pchar.quest.careen_wdeck.win_condition = "careen_wdeck";

			pchar.quest.deck1_checkpoints.win_condition.l1 = "location";
			pchar.quest.deck1_checkpoints.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.deck1_checkpoints.win_condition = "deck1_checkpoints";

			pchar.quest.holdP_checkpoints.win_condition.l1 = "location";
			pchar.quest.holdP_checkpoints.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.holdP_checkpoints.win_condition = "holdP_checkpoints";
		break;
	//..........................................................................................
		case "explore_corvette":
			LAi_SetStayType(Pchar);
			PlaySound("PEOPLE\recoil.wav");
			ChangeCharacterAddressGroup(characterFromID("mutineer_23"), "BB_careen_capsm", "goto", "arrive");
			ChangeCharacterAddressGroup(characterFromID("mutineer_19"), "BB_careen_capsm", "goto", "arrive2");
			ChangeCharacterAddressGroup(characterFromID("Caesar"), "BB_careen_capsm", "goto", "arrive3");
		
			LAi_SetActorType(characterFromID("Mutineer_23"));
			LAi_SetActorType(characterFromID("Mutineer_19"));
			LAi_SetActorType(characterFromID("Caesar"));

			LAi_QuestDelay("explore_corvette1", 1.0);
		break;

		case "explore_corvette1":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Mutineer_23"));

			RemoveCharacterEquip(characterFromID("Bolitho"), BLADE_ITEM_TYPE);
			DeleteAttribute(CharacterFromID("Bolitho"), "items");
			GiveItem2Character(characterFromID("Bolitho"), "bladespyglass6");
			EquipCharacterByItem(characterFromID("Bolitho"), "bladespyglass6");

			LAi_QuestDelay("explore_corvette2", 1.0);
		break;

		case "explore_corvette2":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "explore_corvette2";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "explore_corvette3":
			PlaySound("VOICE\ENGLISH\gr_wench3_mhm.wav");
			LAi_SetPlayerType(Pchar);

			pchar.quest.explore_corvette3_A.win_condition.l1 = "locator";
			pchar.quest.explore_corvette3_A.win_condition.l1.location = "BB_careen_capsm";
			pchar.quest.explore_corvette3_A.win_condition.l1.locator_group = "box";
			pchar.quest.explore_corvette3_A.win_condition.l1.locator = "box2";
			pchar.quest.explore_corvette3_A.win_condition = "explore_corvette3_A";
		break;

		case "explore_corvette3_A":
			LAi_SetStayType(Pchar);
			PlaySound("VOICE\ENGLISH\blaze_hah.wav");
			Logit(LanguageConvertString(tmpLangFileID,"That hatch - could be the way to the Captain's cabin."));

			pchar.quest.explore_corvette4.win_condition.l1 = "locator";
			pchar.quest.explore_corvette4.win_condition.l1.location = "BB_careen_deck2";
			pchar.quest.explore_corvette4.win_condition.l1.locator_group = "goto";
			pchar.quest.explore_corvette4.win_condition.l1.locator = "psst";
			pchar.quest.explore_corvette4.win_condition = "explore_corvette4";
		break;

		case "explore_corvette4":
			PauseAllSounds();//stops music
			locations[FindLocation("BB_careen_deck2")].type = "silent_deck";
			PostEvent("LoadSceneSound", 0);

			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "explore_corvette4";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "explore_corvette5":
			AddQuestRecord("Careen_corvette", "2");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload6");

			LAi_QuestDelay("explore_corvette5_A", 1.0);
			LAi_QuestDelay("explore_corvette6_A", 1.5);
			LAi_QuestDelay("explore_corvette6_B", 2.5);
			LAi_QuestDelay("explore_corvette6_C", 3.5);
			LAi_QuestDelay("explore_corvette7", 5.5);
		break;

		case "explore_corvette5_A":
			PlaySound("VOICE\ENGLISH\gm_crew21A.wav");
		break;

		case "explore_corvette6_A":
			ChangeCharacterAddressGroup(characterFromID("mutineer_23"), "BB_careen_deck2", "reload", "reload1");
			LAi_SetOfficerType(characterFromID("Mutineer_23"));
		break;

		case "explore_corvette6_B":
			ChangeCharacterAddressGroup(characterFromID("mutineer_19"), "BB_careen_deck2", "reload", "reload1");
			LAi_SetOfficerType(characterFromID("Mutineer_19"));
		break;

		case "explore_corvette6_C":
			ChangeCharacterAddressGroup(characterFromID("Caesar"), "BB_careen_deck2", "reload", "reload1");
			LAi_SetOfficerType(characterFromID("Caesar"));
		break;

		case "explore_corvette7":
			LAi_SetActorType(characterFromID("Mutineer_23"));
			LAi_SetActorType(characterFromID("Mutineer_19"));
			LAi_SetActorType(characterFromID("Caesar"));		

			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "explore_corvette7";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "explore_corvette8":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload1");

			RemoveOfficersIndex(pchar, GetCharacterIndex("mutineer_23"));
			ChangeCharacterAddressGroup(characterFromID("mutineer_23"), "BB_careen_deck2", "goto", "crimson");
			LAi_SetStayType(characterFromID("mutineer_23"));
			PlaySound("PEOPLE\recoil.wav");
			PlaySound("VOICE\ENGLISH\gr_wench3_mhm.wav");

			LAi_QuestDelay("explore_corvette8_A", 1.0);
		break;

		case "explore_corvette8_A":
			RemoveOfficersIndex(pchar, GetCharacterIndex("Caesar"));
			ChangeCharacterAddressGroup(characterFromID("Caesar"), "BB_careen_deck2", "reload", "reload6");
			LAi_SetPoorType(characterFromID("Caesar"));
			PlaySound("PEOPLE\creak2.wav");
			PlaySound("VOICE\ENGLISH\Jupiter_aha.wav");

			LAi_QuestDelay("explore_corvette8_B", 1.0);
		break;

		case "explore_corvette8_B":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");

			Locations[FindLocation("BB_careen_deck2")].models.always.locators = "deck2_l_careen_off";

			LAi_SetOfficerType(characterFromID("Mutineer_19"));

			LAi_QuestDelay("pchar_playertype", 1.0);

			pchar.quest.explore_corvette9.win_condition.l1 = "locator";
			pchar.quest.explore_corvette9.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.explore_corvette9.win_condition.l1.locator_group = "quest";
			pchar.quest.explore_corvette9.win_condition.l1.locator = "KD_guard";
			pchar.quest.explore_corvette9.win_condition = "explore_corvette9";
		break;

		case "explore_corvette9":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Mutineer_19"));

			LAi_QuestDelay("explore_corvette9_A", 1.0);
		break;

		case "explore_corvette9_A":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "explore_corvette9_B";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "explore_corvette9_B":
			LAi_SetActorType(characterFromID("Mutineer_19"));
			LAi_ActorGoToLocator(characterFromID("Mutineer_19"), "officers", "reload1_1", "explore_corvette9_C", 3.0);
		break;

		case "explore_corvette9_C":
			RemoveOfficersIndex(pchar, GetCharacterIndex("Mutineer_19"));
			ChangeCharacterAddressGroup(characterFromID("Mutineer_19"), "BB_careen_deck1", "officers", "reload1_1");
			LAi_SetStayType(characterFromID("mutineer_19"));
			LAi_SetPlayerType(Pchar);
		break;
	
		case "explore_corvette10":
			//from pitchfork p.u

			SetOfficersIndex(Pchar, 1, getCharacterIndex("Mutineer_19"));
			LAi_SetOfficerType(characterFromID("Mutineer_19"));
			LAi_SetStayType(characterFromID("Caesar"));

			pchar.quest.explore_corvette10_A.win_condition.l1 = "locator";
			pchar.quest.explore_corvette10_A.win_condition.l1.location = "BB_careen_deck2";
			pchar.quest.explore_corvette10_A.win_condition.l1.locator_group = "reload";
			pchar.quest.explore_corvette10_A.win_condition.l1.locator = "reload6";
			pchar.quest.explore_corvette10_A.win_condition = "explore_corvette10_A";
		break;

		case "explore_corvette10_A":
			Characters[GetCharacterIndex("Caesar")].dialog.CurrentNode  = "locked_to_slaves";
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorDialogNow(characterFromID("Caesar"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Caesar"));
		break;

		case "explore_corvette10_B":
			PlaySound("PEOPLE\recoil.wav");
			ChangeCharacterAddressGroup(characterFromID("Caesar"), "BB_careen_deck2", "goto", "caesar_weapons");
			LAi_SetStayType(characterFromID("Caesar"));

			pchar.quest.explore_corvette11.win_condition.l1 = "location";
			pchar.quest.explore_corvette11.win_condition.l1.location = "BB_careen_capmd_2";
			pchar.quest.explore_corvette11.win_condition = "explore_corvette11";
		break;
		
		case "explore_corvette11":
			LAi_SetStayType(Pchar);
			LAi_SetImmortal(characterFromID("Bolitho"), false);
			LAi_SetHP(CharacterFromID("Bolitho"), 50.0, 50.0);
			Php = LAi_GetCharacterHP(Pchar);
			if(Php < 100.0) {LAi_SetHP(Pchar, 100.0, 100.0);}
			
			LAi_QuestDelay("pchar_ohoh", 0.01);
			LAi_QuestDelay("explore_corvette11_A", 1.0);
		break;

		case "explore_corvette11_A":
			PlaySound("PEOPLE\creak2.wav");
			LAi_SetStayType(characterFromID("Bolitho"));
			ChangeCharacterAddressGroup(characterFromID("Bolitho"), "BB_careen_capmd_2", "goto", "cap_stay");
			LAi_SetActorType(characterFromID("Bolitho"));
			LAi_ActorTurnToLocator(characterFromID("Bolitho"), "goto", "R2");

			LAi_QuestDelay("explore_corvette11_B", 1.0);
		break;

		case "explore_corvette11_B":
			LAi_ActorAttack(CharacterFromID("Bolitho"), Pchar, "");
			PlaySound("OBJECTS\DUEL\sabre_out.wav");
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(Pchar, true);

			pchar.quest.explore_corvette12.win_condition.l1 = "NPC_Death";
			pchar.quest.explore_corvette12.win_condition.l1.character = "Bolitho";
			pchar.quest.explore_corvette12.win_condition = "explore_corvette12";
		break;
	
		case "explore_corvette12":
			GiveItem2Character(pchar, "spyglass3");
			TakeItemFromCharacter(characterFromID("Bolitho"), "bladespyglass6");
			ChangeCharacterAddressGroup(characterFromID("car_sailor1"), "BB_careen_capmd_2", "goto", "sailor1");
			LAi_SetStayType(Pchar);
			LAi_LocationFightDisable(&Locations[FindLocation("BB_careen_capmd_2")], true);
			
			LAi_QuestDelay("explore_corvette12_A", 1.0);	
		break;

		case "explore_corvette12_A":
			PlaySound("INTERFACE\knock.wav");
			
			LAi_QuestDelay("explore_corvette12_B", 1.0);
		break;
		
		case "explore_corvette12_B":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload1");

			LAi_QuestDelay("explore_corvette12_C", 1.0);
		break;

		case "explore_corvette12_C":
			characters[GetCharacterIndex("car_sailor1")].dialog.CurrentNode = "ok_captain";
			LAi_SetActorType(characterFromID("car_sailor1"));
			LAi_ActorDialog(characterFromID("car_sailor1"), pchar, "", 0.0, 0.0);
			LAi_ActorWaitDialog(Pchar, characterFromID("car_sailor1"));
		break;

		case "explore_corvette12_D":
			ChangeCharacterAddressGroup(characterFromID("car_sailor1"), "none", "", "");
			LAi_QuestDelay("pchar_puh", 0.1);
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("explore_corvette13", 1.0);
		break;

		case "explore_corvette13":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "explore_corvette13";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "explore_corvette13_A":
			//start timer here

			AddQuestRecord("Careen_corvette", "6");
			LAi_SetPlayerType(Pchar);
			SetLocatorRadius(locations[FindLocation("BB_careen_capmd_2")], "randitem", "randitem5", 1.5);
			Locations[FindLocation("BB_careen_capmd_2")].locators_radius.randitem.randitem5 = 1.5;
		
			LAi_QuestDelay("pillow1_check", 0.5);
			LAi_QuestDelay("corvette_blade11_check", 0.5);
			LAi_QuestDelay("corvette_pistol6_check", 0.5);
			LAi_QuestDelay("explore_corvette14", 5.0);		//timer to sailor1 attack
		break;

		case "place_pitchfork":
			PlaySound("PEOPLE\wood1.wav");
			RemoveCharacterEquip(pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(pchar, "pitchfork");
			EquipCharacterByItem(pchar, "bladeX4");

			Locations[FindLocation("BB_careen_capmd_2")].models.always.locators = "capmd_2_l_careen_blocked";
			Locations[FindLocation("BB_careen_capmd_2")].image = "";
			DoQuestReloadToLocation("BB_careen_capmd_2", "goto", "at_door" ,"reset_capmd_2");
		break;

		case "remove_pitchfork":
			PlaySound("INTERFACE\wheel_take.wav");
			Locations[FindLocation("BB_careen_capmd_2")].models.always.locators = "capmd_2_l_careen_opened";

	
			Locations[FindLocation("BB_careen_capmd_2")].image = "";
			DoQuestReloadToLocation("BB_careen_capmd_2", "goto", "at_door" ,"reset_capmd_2");
		break;

		case "take_pitchfork":
			PlaySound("INTERFACE\wheel_take.wav");
			Locations[FindLocation("BB_careen_capmd_2")].models.always.locators = "capmd_2_l_careen";

			Locations[FindLocation("BB_careen_capmd_2")].image = "";
			DoQuestReloadToLocation("BB_careen_capmd_2", "goto", "at_door" ,"reset_capmd_2");
		break;

		case "reset_capmd_2":
			if(Locations[FindLocation("BB_careen_capmd_2")].models.always.locators == "capmd_2_l_careen_opened") 
			{
				PlaySound("PEOPLE\wood1.wav");
				
				LAi_QuestDelay("pchar_ohoh", 1.0);
				LAi_QuestDelay("explore_corvette14", 8.0);	//timer to sailor1 attack
			}

			if(Locations[FindLocation("BB_careen_capmd_2")].models.always.locators == "capmd_2_l_careen")
			{
				GiveItem2Character(pchar, "pitchfork");
				RemoveCharacterEquip(pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(pchar, "pitchfork");
			}

			LAi_LocationFightDisable(&Locations[FindLocation("BB_careen_capmd_2")], true);
			if(LAi_IsFightMode(Pchar)) {LAi_SetFightMode(Pchar, false);}
			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("BB_careen_capmd_2")].image = "Deck.tga";
		break;

		case "explore_corvette14":
			if(Locations[FindLocation("BB_careen_capmd_2")].models.always.locators == "capmd_2_l_careen_blocked")
			{
				//no problems
				PlaySound("INTERFACE\lever_stuck.wav");

				LAi_QuestDelay("pchar_puh", 2.0);
			}
			else
			{
				PlaySound("INTERFACE\closet_open.wav");
				ChangeCharacterAddressGroup(characterFromID("car_sailor1"), "BB_careen_capmd_2", "reload", "reload1");
				LAi_SetImmortal(characterFromID("car_sailor1"), true);
				LAi_LocationFightDisable(&Locations[FindLocation("BB_careen_capmd_2")], false);
				LAi_SetActorType(Pchar);
				LAi_ActorTurnToLocator(Pchar, "reload", "reload1");

				LAi_QuestDelay("explore_corvette14_A", 1.0);
			}
		break;

		case "explore_corvette14_A":
			LAi_ActorAttack(CharacterFromID("car_sailor1"), Pchar, "");
			PlaySound("OBJECTS\DUEL\sabre_out.wav");
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(Pchar, true);
		break;

		case "pillow1_check":
			if(CheckCharacterItem(Pchar,"pillow1"))
			{
				PlaySound("PEOPLE\clothes1.wav");
				TakeItemFromCharacter(Pchar, "pillow1");
				SetLocatorRadius(locations[FindLocation("BB_careen_capmd_2")], "randitem", "randitem4", 1.5);
				Locations[FindLocation("BB_careen_capmd_2")].locators_radius.randitem.randitem4 = 1.5;
				SetLocatorRadius(locations[FindLocation("BB_careen_capmd_2")], "randitem", "randitem5", 0.001);
				Locations[FindLocation("BB_careen_capmd_2")].locators_radius.randitem.randitem5 = 0.001;
				ChangeCharacterAddressGroup(Pchar, "BB_careen_capmd_2", "goto", "seekey");

				LAi_QuestDelay("key39_check", 0.5);
			}
			else LAi_QuestDelay("pillow1_check", 0.5);//loop check
		break;

		case "key39_check":
			if(CheckCharacterItem(Pchar,"key39"))
			{
				PlaySound("INTERFACE\took_item.wav");
				Pchar.capmd_position = "inner";

				LAi_QuestDelay("corv_capmd_2_check", 0.1);
			}
			else LAi_QuestDelay("key39_check", 0.5);//loop check
		break;

		case "corvette_blade11_check":
			if(CheckCharacterItem(Pchar,"blade11"))
			{
				PlaySound("OBJECTS\DUEL\sabre_sh.wav");
				RemoveCharacterEquip(pchar, BLADE_ITEM_TYPE);
				EquipCharacterByItem(pchar, "blade11");
				Pchar.capmd_position = "inner";

				LAi_QuestDelay("corv_capmd_2_check", 0.1);
			}
			else LAi_QuestDelay("corvette_blade11_check", 0.5);//loop check
		break;

		case "corvette_pistol6_check":
			if(CheckCharacterItem(Pchar,"pistol6"))
			{
				if(CheckCharacterItem(Pchar,"blade11"))
				{
					EquipCharacterByItem(pchar, "blade11");
				}
				else EquipCharacterByItem(pchar, "bladeX4");

				PlaySound("OBJECTS\DUEL\pistol_out1original.wav");
				EquipCharacterByItem(pchar, "pistol6");
				Pchar.capmd_position = "inner";

				LAi_QuestDelay("corv_capmd_2_check", 0.1);
			}
			else LAi_QuestDelay("corvette_pistol6_check", 0.5);//loop check
		break;

		case "corv_capmd_2_check":
			pchar.quest.items_transfer = "ok";

			if(CheckAttribute(Pchar,"explore_capmd_2") && Pchar.explore_capmd_2 == "done")
			{
			 	//only once
			}
			else
			{
				if(CheckAttribute(Pchar,"corv_weaponslocker") && Pchar.corv_weaponslocker == "check")
				{
					if(CheckCharacterItem(Pchar,"key39") && CheckCharacterItem(Pchar,"blade11") && CheckCharacterItem(Pchar,"pistol6"))
					{
						Pchar.explore_capmd_2 = "done";		//so this isn't repeated
						SetLocatorRadius(locations[FindLocation("BB_careen_capmd_2")], "reload", "reload2", 0.7);
						Locations[FindLocation("BB_careen_capmd_2")].locators_radius.reload.reload2 = 0.7;
					
						LAi_QuestDelay("corv_capmd_2_check_king", 1.0);
					}
				}
			}
		break;

		case "corv_capmd_2_check_king":
			if(CheckAttribute(Pchar,"capmd_position") && Pchar.capmd_position == "inner")
			{
				ChangeCharacterAddressGroup(characterFromID("Mutineer_19"), "BB_careen_capmd_2", "quest", "king_inner");
			}
			else ChangeCharacterAddressGroup(characterFromID("Mutineer_19"), "BB_careen_capmd_2", "quest", "king_outer");

			SetOfficersIndex(Pchar, 1, getCharacterIndex("Mutineer_19"));
			LAi_SetActorType(characterFromID("Mutineer_19"));
			LAi_ActorTurnToCharacter(characterFromID("Mutineer_19"), Pchar);
			PlaySound("VOICE\ENGLISH\Dut_m_a_001.wav");

			LAi_QuestDelay("explore_corvette15", 1.0);
		break;

		case "explore_corvette15":
			Locations[FindLocation("BB_careen_deck2")].models.always.locators = "deck2_l_careen";
			LAi_SetActorType(pchar);	
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Mutineer_19"));

			LAi_QuestDelay("explore_corvette15_A", 1.0);
		break;

		case "explore_corvette15_A":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "explore_corvette15";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "explore_corvette15_B":
			PlaySound("VOICE\ENGLISH\Jupiter_aha.wav");
			LAi_SetPlayerType(pchar);

			pchar.quest.explore_corvette16.win_condition.l1 = "locator";
			pchar.quest.explore_corvette16.win_condition.l1.location = "BB_careen_deck2";
			pchar.quest.explore_corvette16.win_condition.l1.locator_group = "goto";
			pchar.quest.explore_corvette16.win_condition.l1.locator = "psst";
			pchar.quest.explore_corvette16.win_condition = "explore_corvette16";
		break;

		case "explore_corvette16":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload6");

			TakeNItems(characterFromID("mutineer_19"), "blade1", 9);
			EquipCharacterByItem(characterFromID("mutineer_19"), "blade1");
			TakeNItems(characterFromID("mutineer_19"), "piratespistol", 9);
			EquipCharacterByItem(characterFromID("mutineer_19"), "piratespistol");
			Pchar.quest.take_items = "no";

			LAi_QuestDelay("explore_corvette16_A", 1.0);
			LAi_QuestDelay("explore_corvette16_B", 1.5);
		break;

		case "explore_corvette16_A":
			PlaySound("VOICE\ENGLISH\gm_crew21A.wav");
		break;

		case "explore_corvette16_B":
			ChangeCharacterAddressGroup(characterFromID("mutineer_19"), "BB_careen_deck2", "reload", "reload1");
			LAi_SetOfficerType(characterFromID("Mutineer_19"));

			LAi_QuestDelay("explore_corvette17", 4.0);
		break;

		case "explore_corvette17":
			LAi_SetActorType(characterFromID("mutineer_23"));
			LAi_ActorTurnToCharacter(characterFromID("mutineer_23"), characterFromID("Mutineer_19"));
			LAi_SetActorType(characterFromID("mutineer_19"));
			LAi_ActorTurnToCharacter(characterFromID("mutineer_19"), characterFromID("Mutineer_23"));

			LAi_QuestDelay("explore_corvette17_A", 1.0);
		break;

		case "explore_corvette17_A":
			PlaySound("OBJECTS\DUEL\sabre_sh.wav");
			TakeItemFromCharacter(characterFromID("mutineer_19"), "blade1");
			GiveItem2Character(characterFromID("mutineer_23"), "blade1");
			EquipCharacterByItem(characterFromID("mutineer_23"), "blade1");
			
			LAi_QuestDelay("explore_corvette17_B", 1.0);
		break;

		case "explore_corvette17_B":
			PlaySound("OBJECTS\DUEL\pistol_out1original.wav");
			TakeItemFromCharacter(characterFromID("mutineer_19"), "piratespistol");
			GiveItem2Character(characterFromID("mutineer_23"), "piratespistol");
			EquipCharacterByItem(characterFromID("mutineer_23"), "piratespistol");

			LAi_QuestDelay("explore_corvette17_C", 1.0);	
		break;

		case "explore_corvette17_C":	
			PlaySound("VOICE\ENGLISH\gr_wench3_mhm.wav");
			SetOfficersIndex(Pchar, 2, getCharacterIndex("Mutineer_23"));

			LAi_QuestDelay("explore_corvette18", 1.0);
		break;

		case "explore_corvette18":
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorTurnToCharacter(characterFromID("Caesar"), characterFromID("Mutineer_19"));
			LAi_SetActorType(characterFromID("mutineer_19"));
			LAi_ActorTurnToCharacter(characterFromID("mutineer_19"), characterFromID("Caesar"));

			LAi_QuestDelay("explore_corvette18_A", 1.0);
		break;

		case "explore_corvette18_A":
			PlaySound("OBJECTS\DUEL\sabre_sh.wav");
			TakeItemFromCharacter(characterFromID("mutineer_19"), "blade1");
			GiveItem2Character(characterFromID("Caesar"), "blade1");
			EquipCharacterByItem(characterFromID("Caesar"), "blade1");
			
			LAi_QuestDelay("explore_corvette18_B", 1.0);
		break;

		case "explore_corvette18_B":
			PlaySound("OBJECTS\DUEL\pistol_out1original.wav");
			TakeItemFromCharacter(characterFromID("mutineer_19"), "piratespistol");
			GiveItem2Character(characterFromID("Caesar"), "piratespistol");
			EquipCharacterByItem(characterFromID("Caesar"), "piratespistol");

			LAi_QuestDelay("explore_corvette18_C", 1.0);	
		break;

		case "explore_corvette18_C":	
			PlaySound("VOICE\ENGLISH\Jupiter_mm.wav");
			SetOfficersIndex(Pchar, 3, getCharacterIndex("Caesar"));

			LAi_QuestDelay("explore_corvette18_D", 0.5);
		break;

		case "explore_corvette18_D":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");

			LAi_QuestDelay("explore_corvette19", 1.0);
		break;

		case "explore_corvette19":
			Locations[FindLocation("BB_careen_deck2")].models.always.locators = "deck2_l_careen_off";	
			LAi_SetPlayerType(pchar);
			LAi_SetOfficerType(characterFromID("mutineer_23"));
			LAi_SetOfficerType(characterFromID("mutineer_19"));
			LAi_SetOfficerType(characterFromID("Caesar"));

			pchar.quest.explore_corvette20.win_condition.l1 = "locator";
			pchar.quest.explore_corvette20.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.explore_corvette20.win_condition.l1.locator_group = "goto";
			pchar.quest.explore_corvette20.win_condition.l1.locator = "convicts";
			pchar.quest.explore_corvette20.win_condition = "explore_corvette20";
		break;

		case "unlock_convicts":
			//from SL_utils

			PlaySound("AMBIENT\UnHappy-001.wav");
			TakeItemFromCharacter(Pchar, "key39");
			Pchar.careen_convicts = "open";

	//for(i=1; i<7; i++) Characters[GetCharacterIndex("car_convict"+i)].name = TranslateString("", "Freedman"));
			LAi_SetStayType(characterFromID("car_convict1"));
			LAi_SetStayType(characterFromID("car_convict2"));
			LAi_SetStayType(characterFromID("car_convict3"));
			LAi_SetStayType(characterFromID("car_convict4"));
			LAi_SetStayType(characterFromID("car_convict5"));
			LAi_SetStayType(characterFromID("car_convict6"));

			ChangeCharacterAddressGroup(characterFromID("car_convict1"), "BB_careen_holdP", "quest", "conv1_stay");
			ChangeCharacterAddressGroup(characterFromID("car_convict2"), "BB_careen_holdP", "quest", "conv2_stay");
			ChangeCharacterAddressGroup(characterFromID("car_convict3"), "BB_careen_holdP", "quest", "conv3_stay");
			ChangeCharacterAddressGroup(characterFromID("car_convict4"), "BB_careen_holdP", "quest", "conv4_stay");				
			ChangeCharacterAddressGroup(characterFromID("car_convict5"), "BB_careen_holdP", "quest", "conv5_stay");
		break;

		case "explore_corvette20":
			PlaySound("OBJECTS\SHIPCHARGE\hurrah.wav");
			PlaySound("AMBIENT\cheer2.wav");
			
			LAi_QuestDelay("explore_corvette20_B", 2.0);
		break;

		case "explore_corvette20_B":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "explore_corvette20_B";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "explore_corvette20_C":
			PlaySound("AMBIENT\UnHappy-001.wav");
			PlaySound("PEOPLE\creak2.wav");

			ChangeCharacterAddressGroup(characterFromID("car_convict1"), "BB_careen_holdP", "quest", "convict1");
			ChangeCharacterAddressGroup(characterFromID("car_convict2"), "BB_careen_holdP", "quest", "convict2");
			ChangeCharacterAddressGroup(characterFromID("car_convict3"), "BB_careen_holdP", "quest", "convict3");
			ChangeCharacterAddressGroup(characterFromID("car_convict4"), "BB_careen_holdP", "quest", "convict4");
			ChangeCharacterAddressGroup(characterFromID("car_convict5"), "BB_careen_holdP", "quest", "convict5");
			LAi_SetSitType(characterFromID("car_convict1"));
			LAi_SetSitType(characterFromID("car_convict2"));
			LAi_SetSitType(characterFromID("car_convict3"));
			LAi_SetPoorType(characterFromID("car_convict4"));
			LAi_SetPoorType(characterFromID("car_convict5"));
			LAi_SetSitType(characterFromID("car_convict6"));

			for (i = 1; i < 7; i++)
			{
				GiveItem2Character(characterFromID("car_convict" + i), "blade1");
				EquipCharacterByItem(characterFromID("car_convict" + i), "blade1");
				GiveItem2Character(characterFromID("car_convict" + i), "piratespistol");
				EquipCharacterByItem(characterFromID("car_convict" + i), "piratespistol");
			}

			LAi_QuestDelay("explore_corvette20_D", 3.0);
		break;

		case "explore_corvette20_D":
			TakeNItems(characterFromID("mutineer_19"), "blade1", -6);
			TakeNItems(characterFromID("mutineer_19"), "piratespistol", -6);

			Characters[GetCharacterIndex("Caesar")].dialog.CurrentNode  = "open_to_slaves";
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorDialogNow(characterFromID("Caesar"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Caesar"));
		break;

		case "explore_corvette20_E":
			LAi_SetPlayerType(pchar);

			RemoveOfficersIndex(pchar, GetCharacterIndex("Caesar"));
			RemoveOfficersIndex(pchar, GetCharacterIndex("mutineer_19"));
			RemovePassenger(pchar, characterFromID("Caesar"));
			RemovePassenger(pchar, characterFromID("mutineer_19"));

			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorGoToLocator(characterFromID("Caesar"), "quest", "exit", "explore_corvette20_F", 2.5);
			LAi_SetActorType(characterFromID("mutineer_19"));
			LAi_ActorGoToLocator(characterFromID("mutineer_19"), "quest", "exit", "explore_corvette20_G", 3.5);
		
			pchar.quest.explore_corvette21.win_condition.l1 = "location";
			pchar.quest.explore_corvette21.win_condition.l1.location = "BB_careen_holdS";
			pchar.quest.explore_corvette21.win_condition = "explore_corvette21";
		break;
	
		case "explore_corvette20_F":
			ChangeCharacterAddressGroup(characterFromID("Caesar"), "BB_careen_holdP", "goto", "officers");
		break;

		case "explore_corvette20_G":
			ChangeCharacterAddressGroup(characterFromID("mutineer_19"), "BB_careen_holdP", "goto", "officers");
		break;
	
		case "explore_corvette21":
			RemoveOfficersIndex(pchar, GetCharacterIndex("mutineer_23"));
			RemovePassenger(pchar, characterFromID("mutineer_23"));
			ChangeCharacterAddressGroup(characterFromID("mutineer_23"), "BB_careen_holdS", "officers", "reload1_1");
			LAi_SetStayType(characterFromID("mutineer_23"));

			LAi_SetStayType(pchar);
			LAi_QuestDelay("pchar_oh", 1.0);

			LAi_QuestDelay("explore_corvette21_A", 2.0);
			LAi_QuestDelay("explore_corvette21_B", 4.0);
			LAi_QuestDelay("explore_corvette21_C", 5.0);
			LAi_QuestDelay("explore_corvette22", 6.0);		//shackles dialog auto
		break;

		case "explore_corvette21_A":
			PlaySound("AMBIENT\JAIL\chains2.wav");
			ChangeCharacterAddressGroup(characterFromID("car_slave22"), "BB_careen_holdS", "quest", "slave22_P");
			LAi_SetPoorType(characterFromID("car_slave22"));
			ChangeCharacterAddressGroup(characterFromID("car_slave26"), "BB_careen_holdS", "quest", "slave26_P");
			LAi_SetPoorType(characterFromID("car_slave26"));
			ChangeCharacterAddressGroup(characterFromID("car_slave27"), "BB_careen_holdS", "quest", "slave27_P");
			LAi_SetPoorType(characterFromID("car_slave27"));
		break;

		case "explore_corvette21_B":
			PlaySound("AMBIENT\JAIL\chains2.wav");
			ChangeCharacterAddressGroup(characterFromID("car_slave25"), "BB_careen_holdS", "quest", "slave25_P");
			LAi_SetPoorType(characterFromID("car_slave25"));
			ChangeCharacterAddressGroup(characterFromID("car_slave28"), "BB_careen_holdS", "quest", "slave28_P");
			LAi_SetPoorType(characterFromID("car_slave28"));
		break;

		case "explore_corvette21_C":
			PlaySound("AMBIENT\JAIL\chains2.wav");
			ChangeCharacterAddressGroup(characterFromID("car_slave24"), "BB_careen_holdS", "quest", "slave24_P");
			LAi_SetPoorType(characterFromID("car_slave24"));
			ChangeCharacterAddressGroup(characterFromID("car_slave7"), "BB_careen_holdS", "quest", "slave29_P");
			LAi_SetPoorType(characterFromID("car_slave7"));
			LAi_SetPlayerType(pchar);
		break;
	//-------------------------------------------------------------------------------------------------------
		case "explore_corvette22":
			Characters[GetCharacterIndex("mutineer_23")].dialog.CurrentNode  = "lockpick_shackles";
			LAi_SetActorType(characterFromID("mutineer_23"));
			LAi_ActorDialogNow(characterFromID("mutineer_23"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("mutineer_23"));
		break;

		case "explore_corvette22_A":
			LAi_SetActorType(characterFromID("mutineer_23"));
			LAi_ActorTurnToLocator(characterFromID("mutineer_23"), "randitem", "randitem15");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "quest", "slave4");

			LAi_QuestDelay("explore_corvette22_B", 1.5);
		break;
	
		case "explore_corvette22_B":
			LAi_SetSitType(characterFromID("mutineer_23"));
			PlaySound("PEOPLE\lockpick2.wav");

			LAi_QuestDelay("explore_corvette22_C", 2.5);
		break;

		case "explore_corvette22_C":
			LAi_SetStayType(characterFromID("mutineer_23"));
			PlaySound("VOICE\ENGLISH\gr_wench3_sigh.wav");

			LAi_QuestDelay("explore_corvette22_D", 2.0);
		break;
		
		case "explore_corvette22_D":
			LAi_SetSitType(characterFromID("mutineer_23"));
			PlaySound("PEOPLE\lockpick2.wav");

			LAi_QuestDelay("explore_corvette22_E", 2.5);
		break;

		case "explore_corvette22_E":
			LAi_SetStayType(characterFromID("mutineer_23"));
			PlaySound("VOICE\ENGLISH\gr_wench3_angry.wav");

			LAi_QuestDelay("explore_corvette22_F", 2.0);
		break;

		case "explore_corvette22_F":
			LAi_SetSitType(characterFromID("mutineer_23"));
			PlaySound("PEOPLE\lockpick.wav");

			LAi_QuestDelay("explore_corvette22_G", 3.0);
		break;

		case "explore_corvette22_G":
			LAi_SetStayType(characterFromID("mutineer_23"));
			PlaySound("VOICE\ENGLISH\gr_wench3_pos.wav");

			LAi_QuestDelay("pchar_puh", 1.0);
			LAi_QuestDelay("explore_corvette22_H", 2.0);
		break;

		case "explore_corvette22_H":
			PlaySound("AMBIENT\JAIL\chains2.wav");
			LAi_SetActorType(characterFromID("car_slave27"));
			LAi_SetActorType(characterFromID("car_slave7"));

			LAi_QuestDelay("explore_corvette22_I", 0.5);
		break;

		case "explore_corvette22_I":
			PlaySound("AMBIENT\JAIL\chains2.wav");
			LAi_SetActorType(characterFromID("car_slave28"));
			LAi_SetActorType(characterFromID("car_slave26"));
			LAi_ActorTurnToCharacter(characterFromID("car_slave27"), pchar);
			LAi_ActorTurnToCharacter(characterFromID("car_slave7"), pchar);
			PlaySound("AMBIENT\TAVERN\Tavern_003.wav");
			PlaySound("AMBIENT\TAVERN\Tavern_003.wav");
			PlaySound("AMBIENT\TAVERN\Tavern_003.wav");
			PlaySound("AMBIENT\TAVERN\Tavern_003.wav");
			PlaySound("AMBIENT\TAVERN\Tavern_003.wav");

			LAi_QuestDelay("explore_corvette22_J", 0.5);
		break;

		case "explore_corvette22_J":
			PlaySound("PEOPLE\creak2.wav");
			LAi_ActorTurnToCharacter(characterFromID("car_slave28"), pchar);
			LAi_ActorTurnToCharacter(characterFromID("car_slave26"), pchar);

			LAi_QuestDelay("explore_corvette22_K", 1.5);
		break;

		case "explore_corvette22_K":
			LAi_SetStayType(characterFromID("car_slave28"));
			LAi_SetStayType(characterFromID("car_slave26"));
			LAi_SetStayType(characterFromID("car_slave27"));
			LAi_SetStayType(characterFromID("car_slave7"));
		Characters[GetCharacterIndex("car_slave28")].name = TranslateString("", "Freedman"));
		Characters[GetCharacterIndex("car_slave26")].name = TranslateString("", "Freedman"));
		Characters[GetCharacterIndex("car_slave27")].name = TranslateString("", "Freedman"));
		Characters[GetCharacterIndex("car_slave7")].name = TranslateString("", "Freedman"));	

			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "explore_corvette22_K";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "explore_corvette22_L":
			AddQuestRecord("Careen_corvette", "4");
			LAi_SetPlayerType(pchar);

			pchar.quest.explore_corvette21_D.win_condition.l1 = "locator";
			pchar.quest.explore_corvette21_D.win_condition.l1.location = "BB_careen_holdS";
			pchar.quest.explore_corvette21_D.win_condition.l1.locator_group = "goto";
			pchar.quest.explore_corvette21_D.win_condition.l1.locator = "second";
			pchar.quest.explore_corvette21_D.win_condition = "explore_corvette21_D";
		break;
	//-------------------------------------------------------------------------------------------------------
		case "explore_corvette21_D":
			//more slaves this time

			LAi_SetActorType(pchar);
			LAi_ActorTurnToLocator(pchar, "quest", "slave11");

			PlaySound("AMBIENT\JAIL\chains2.wav");
			ChangeCharacterAddressGroup(characterFromID("car_slave23"), "BB_careen_holdS", "quest", "slave23_P");
			LAi_SetPoorType(characterFromID("car_slave23"));

			ChangeCharacterAddressGroup(characterFromID("car_slave2"), "BB_careen_holdS", "quest", "slave2_P");
			LAi_SetPoorType(characterFromID("car_slave2"));
			ChangeCharacterAddressGroup(characterFromID("car_slave3"), "BB_careen_holdS", "quest", "slave3_P");
			LAi_SetPoorType(characterFromID("car_slave3"));
		
			ChangeCharacterAddressGroup(characterFromID("car_slave4"), "BB_careen_holdS", "quest", "slave4_P");
			LAi_SetPoorType(characterFromID("car_slave4"));
			ChangeCharacterAddressGroup(characterFromID("car_slave5"), "BB_careen_holdS", "quest", "slave5_P");
			LAi_SetPoorType(characterFromID("car_slave5"));

			ChangeCharacterAddressGroup(characterFromID("mutineer_23"), "BB_careen_holdS", "goto", "unlock2");

			LAi_QuestDelay("explore_corvette23", 1.5);
		break;

		case "explore_corvette23":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "explore_corvette23";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "explore_corvette23_A":
			LAi_QuestDelay("pchar_ooh", 0.1);

			LAi_QuestDelay("explore_corvette23_B", 1.0);
		break;

		case "explore_corvette23_B":
			LAi_SetSitType(characterFromID("mutineer_23"));
			PlaySound("PEOPLE\lockpick.wav");

			LAi_QuestDelay("explore_corvette24", 1.0);
			LAi_QuestDelay("explore_corvette23_C", 3.0);
		break;

		case "explore_corvette24":
			LAi_SetActorType(pchar);
			LAi_ActorTurnToCharacter(pchar, characterFromID("mutineer_23"));
		break;

		case "explore_corvette23_C":
			LAi_SetStayType(characterFromID("mutineer_23"));
			PlaySound("VOICE\ENGLISH\gr_wench3_mhm.wav");

			LAi_QuestDelay("explore_corvette23_D", 1.0);
		break;

		case "explore_corvette23_D":
			PlaySound("AMBIENT\JAIL\chains2.wav");
			LAi_SetActorType(characterFromID("car_slave22"));
			LAi_SetActorType(characterFromID("car_slave24"));
			LAi_SetActorType(characterFromID("car_slave25"));
			
			LAi_QuestDelay("explore_corvette23_E", 0.5);
		break;

		case "explore_corvette23_E":
			LAi_ActorTurnToCharacter(characterFromID("car_slave22"), characterFromID("mutineer_23"));
			LAi_ActorTurnToCharacter(characterFromID("car_slave24"), characterFromID("mutineer_23"));
			LAi_ActorTurnToCharacter(characterFromID("car_slave25"), characterFromID("mutineer_23"));
			PlaySound("AMBIENT\TAVERN\Tavern_002.wav");
			PlaySound("AMBIENT\TAVERN\Tavern_002.wav");
			PlaySound("AMBIENT\TAVERN\Tavern_002.wav");

			LAi_QuestDelay("explore_corvette24_A", 1.0);
		break;

		case "explore_corvette24_A":
			LAi_SetStayType(characterFromID("car_slave22"));
			LAi_SetStayType(characterFromID("car_slave24"));
			LAi_SetStayType(characterFromID("car_slave25"));
		Characters[GetCharacterIndex("car_slave22")].name = TranslateString("", "Freedman"));
		Characters[GetCharacterIndex("car_slave24")].name = TranslateString("", "Freedman"));
		Characters[GetCharacterIndex("car_slave25")].name = TranslateString("", "Freedman"));
		
			LAi_SetActorType(pchar);
			LAi_ActorTurnToLocator(pchar, "quest", "slave11_P");

			LAi_QuestDelay("pchar_playertype", 1.0);
			LAi_QuestDelay("explore_corvette25", 1.0);
		break;

		case "explore_corvette25":
			LAi_SetPlayerType(pchar);
			Pchar.quest.take_items = "yes";					//reset to normal

			PlaySound("AMBIENT\JAIL\chains2.wav");
			ChangeCharacterAddressGroup(characterFromID("car_slave11"), "BB_careen_holdS", "quest", "slave11_P");
			LAi_SetPoorType(characterFromID("car_slave11"));
			ChangeCharacterAddressGroup(characterFromID("car_slave12"), "BB_careen_holdS", "quest", "slave12_P");
			LAi_SetPoorType(characterFromID("car_slave12"));
		
			ChangeCharacterAddressGroup(characterFromID("car_slave8"), "BB_careen_holdS", "quest", "slave8_P");
			LAi_SetPoorType(characterFromID("car_slave8"));
			ChangeCharacterAddressGroup(characterFromID("car_slave9"), "BB_careen_holdS", "quest", "slave9_P");
			LAi_SetPoorType(characterFromID("car_slave9"));
			ChangeCharacterAddressGroup(characterFromID("car_slave10"), "BB_careen_holdS", "quest", "slave10_P");
			LAi_SetPoorType(characterFromID("car_slave10"));

			LAi_QuestDelay("explore_corvette25_A", 1.5);

			pchar.quest.explore_corvette26.win_condition.l1 = "locator";
			pchar.quest.explore_corvette26.win_condition.l1.location = "BB_careen_holdS";
			pchar.quest.explore_corvette26.win_condition.l1.locator_group = "goto";
			pchar.quest.explore_corvette26.win_condition.l1.locator = "third";
			pchar.quest.explore_corvette26.win_condition = "explore_corvette26";
		break;

		case "explore_corvette25_A":
			PlaySound("AMBIENT\JAIL\chains2.wav");

			ChangeCharacterAddressGroup(characterFromID("car_slave15"), "BB_careen_holdS", "quest", "slave15_P");
			LAi_SetPoorType(characterFromID("car_slave15"));
			ChangeCharacterAddressGroup(characterFromID("car_slave16"), "BB_careen_holdS", "quest", "slave16_P");
			LAi_SetPoorType(characterFromID("car_slave16"));

			ChangeCharacterAddressGroup(characterFromID("car_slave17"), "BB_careen_holdS", "quest", "slave17_P");
			LAi_SetPoorType(characterFromID("car_slave17"));
			ChangeCharacterAddressGroup(characterFromID("car_slave18"), "BB_careen_holdS", "quest", "slave18_P");
			LAi_SetPoorType(characterFromID("car_slave18"));

			ChangeCharacterAddressGroup(characterFromID("car_slave20"), "BB_careen_holdS", "quest", "slave20_P");
			LAi_SetPoorType(characterFromID("car_slave20"));
			ChangeCharacterAddressGroup(characterFromID("car_slave21"), "BB_careen_holdS", "quest", "slave21_P");
			LAi_SetPoorType(characterFromID("car_slave21"));
		break; 

		case "explore_corvette26":
			ChangeCharacterAddressGroup(characterFromID("mutineer_23"), "BB_careen_holdS", "goto", "unlock3");
			LAi_SetSitType(characterFromID("mutineer_23"));
			PlaySound("PEOPLE\lockpick.wav");

			LAi_QuestDelay("explore_corvette26_A", 3.0);

		//on the way TO gps
			pchar.quest.explore_corvette27.win_condition.l1 = "locator";
			pchar.quest.explore_corvette27.win_condition.l1.location = "BB_careen_holdS";
			pchar.quest.explore_corvette27.win_condition.l1.locator_group = "quest";
			pchar.quest.explore_corvette27.win_condition.l1.locator = "slave16_P";		//was slave20
			pchar.quest.explore_corvette27.win_condition = "explore_corvette27";

			pchar.quest.explore_corvette26_E.win_condition.l1 = "locator";
			pchar.quest.explore_corvette26_E.win_condition.l1.location = "BB_careen_holdS";
			pchar.quest.explore_corvette26_E.win_condition.l1.locator_group = "box";
			pchar.quest.explore_corvette26_E.win_condition.l1.locator = "box1";
			pchar.quest.explore_corvette26_E.win_condition = "explore_corvette26_E";
		break;

		case "explore_corvette26_A":
			LAi_SetStayType(characterFromID("mutineer_23"));
			PlaySound("VOICE\ENGLISH\gr_wench3.wav");

			LAi_QuestDelay("explore_corvette26_B", 1.0);		//was 2.0
		break;

		case "explore_corvette26_B":
			PlaySound("AMBIENT\JAIL\chains2.wav");
			LAi_SetActorType(characterFromID("car_slave23"));
			LAi_SetActorType(characterFromID("car_slave2"));
			LAi_SetActorType(characterFromID("car_slave3"));
			LAi_SetActorType(characterFromID("car_slave4"));
			LAi_SetActorType(characterFromID("car_slave5"));

			LAi_QuestDelay("explore_corvette26_C", 0.5);
		break;

		case "explore_corvette26_C":
			LAi_ActorTurnToCharacter(characterFromID("car_slave23"), characterFromID("mutineer_23"));
			LAi_ActorTurnToCharacter(characterFromID("car_slave2"), characterFromID("mutineer_23"));
			LAi_ActorTurnToCharacter(characterFromID("car_slave3"), characterFromID("mutineer_23"));
			LAi_ActorTurnToCharacter(characterFromID("car_slave4"), characterFromID("mutineer_23"));
			LAi_ActorTurnToCharacter(characterFromID("car_slave5"), characterFromID("mutineer_23"));
			PlaySound("AMBIENT\TAVERN\Tavern_001.wav");
			PlaySound("AMBIENT\TAVERN\Tavern_001.wav");
			PlaySound("AMBIENT\TAVERN\Tavern_001.wav");

			LAi_QuestDelay("explore_corvette26_D", 1.0);
		break;

		case "explore_corvette26_D":
			LAi_SetStayType(characterFromID("car_slave23"));
			LAi_SetStayType(characterFromID("car_slave2"));
			LAi_SetStayType(characterFromID("car_slave3"));
			LAi_SetStayType(characterFromID("car_slave4"));
			LAi_SetStayType(characterFromID("car_slave5"));
		Characters[GetCharacterIndex("car_slave23")].name = TranslateString("", "Freedman"));
		Characters[GetCharacterIndex("car_slave2")].name = TranslateString("", "Freedman"));
		Characters[GetCharacterIndex("car_slave3")].name = TranslateString("", "Freedman"));
		Characters[GetCharacterIndex("car_slave4")].name = TranslateString("", "Freedman"));
		Characters[GetCharacterIndex("car_slave5")].name = TranslateString("", "Freedman"));
		break;
	
		case "explore_corvette26_E":
			LAi_QuestDelay("pchar_yah", 0.1);

			LAi_QuestDelay("explore_corvette28", 0.1);
		break;
	//-----------------------------------------------------------------------------------------------------------------
		case "explore_corvette27":
			PlaySound("AMBIENT\JAIL\chains2.wav");
			ChangeCharacterAddressGroup(characterFromID("mutineer_23"), "BB_careen_holdS", "goto", "unlock4");
			LAi_SetActorType(characterFromID("car_slave8"));
			LAi_SetActorType(characterFromID("car_slave9"));
			LAi_SetActorType(characterFromID("car_slave10"));
			LAi_SetActorType(characterFromID("car_slave11"));
			LAi_SetActorType(characterFromID("car_slave12"));

			LAi_ActorTurnToCharacter(characterFromID("car_slave8"), characterFromID("mutineer_23"));
			LAi_ActorTurnToCharacter(characterFromID("car_slave9"), characterFromID("mutineer_23"));
			LAi_ActorTurnToCharacter(characterFromID("car_slave10"), characterFromID("mutineer_23"));
			LAi_ActorTurnToCharacter(characterFromID("car_slave11"), characterFromID("mutineer_23"));
			LAi_ActorTurnToCharacter(characterFromID("car_slave12"), characterFromID("mutineer_23"));
			PlaySound("AMBIENT\TAVERN\Tavern_004.wav");
			PlaySound("AMBIENT\TAVERN\Tavern_004.wav");
			PlaySound("AMBIENT\TAVERN\Tavern_004.wav");
		
			LAi_QuestDelay("explore_corvette27_A", 0.1);

		//on the way back
			pchar.quest.explore_corvette30.win_condition.l1 = "locator";
			pchar.quest.explore_corvette30.win_condition.l1.location = "BB_careen_holdS";
			pchar.quest.explore_corvette30.win_condition.l1.locator_group = "goto";			//was quest
			pchar.quest.explore_corvette30.win_condition.l1.locator = "swim_dialog";		//was slave20, then slave16_P
			pchar.quest.explore_corvette30.win_condition = "explore_corvette30";
		break;

		case "explore_corvette27_A":
			LAi_SetStayType(characterFromID("car_slave8"));
			LAi_SetStayType(characterFromID("car_slave9"));
			LAi_SetStayType(characterFromID("car_slave10"));
			LAi_SetStayType(characterFromID("car_slave11"));
			LAi_SetStayType(characterFromID("car_slave12"));
		Characters[GetCharacterIndex("car_slave8")].name = TranslateString("", "Freedman"));
		Characters[GetCharacterIndex("car_slave9")].name = TranslateString("", "Freedman"));
		Characters[GetCharacterIndex("car_slave10")].name = TranslateString("", "Freedman"));
		Characters[GetCharacterIndex("car_slave11")].name = TranslateString("", "Freedman"));
		Characters[GetCharacterIndex("car_slave12")].name = TranslateString("", "Freedman"));
		break;
	//---------------------------------------------------------------------------------------------------------	
		case "explore_corvette28":
			//pchar ammo check

			gp = GetCharacterItem(Pchar, "gunpowder");
			pb = GetCharacterItem(Pchar, "pistolbullets");

			if(gp == 6 && pb ==6) 
			{
				ChangeCharacterAddressGroup(characterFromID("mutineer_23"), "BB_careen_holdS", "goto", "swim_dialog");
				LAi_SetActorType(characterFromID("car_slave15"));
				LAi_SetActorType(characterFromID("car_slave16"));
				LAi_SetActorType(characterFromID("car_slave17"));
				LAi_SetActorType(characterFromID("car_slave18"));
				LAi_SetActorType(characterFromID("car_slave20"));
				LAi_SetActorType(characterFromID("car_slave21"));

				LAi_ActorTurnToCharacter(characterFromID("car_slave15"), characterFromID("mutineer_23"));
				LAi_ActorTurnToCharacter(characterFromID("car_slave16"), characterFromID("mutineer_23"));
				LAi_ActorTurnToCharacter(characterFromID("car_slave17"), characterFromID("mutineer_23"));
				LAi_ActorTurnToCharacter(characterFromID("car_slave18"), characterFromID("mutineer_23"));
				LAi_ActorTurnToCharacter(characterFromID("car_slave20"), characterFromID("mutineer_23"));
				LAi_ActorTurnToCharacter(characterFromID("car_slave21"), characterFromID("mutineer_23"));

				PlaySound("INTERFACE\closet_open.wav");
		
				for(i=1; i<7; i++) Characters[GetCharacterIndex("car_convict"+i)].name = TranslateString("", "Freedman"));

				LAi_QuestDelay("explore_corvette29", 1.0);	
			}
			else LAi_QuestDelay("explore_corvette28", 1.0);		//loops until enough ammo
		break;

		case "explore_corvette29":
			ChangeCharacterAddressGroup(characterFromID("mutineer_19"), "BB_careen_holdS", "officers", "reload1_1");
			ChangeCharacterAddressGroup(characterFromID("Caesar"), "BB_careen_holdS", "officers", "reload1_3");
			LAi_SetStayType(characterFromID("mutineer_19"));
			LAi_SetStayType(characterFromID("Caesar"));

			LAi_SetStayType(characterFromID("car_slave15"));
			LAi_SetStayType(characterFromID("car_slave16"));
			LAi_SetStayType(characterFromID("car_slave17"));
			LAi_SetStayType(characterFromID("car_slave18"));
			LAi_SetStayType(characterFromID("car_slave20"));
			LAi_SetStayType(characterFromID("car_slave21"));
		Characters[GetCharacterIndex("car_slave15")].name = TranslateString("", "Freedman"));
		Characters[GetCharacterIndex("car_slave16")].name = TranslateString("", "Freedman"));
		Characters[GetCharacterIndex("car_slave17")].name = TranslateString("", "Freedman"));
		Characters[GetCharacterIndex("car_slave18")].name = TranslateString("", "Freedman"));
		Characters[GetCharacterIndex("car_slave20")].name = TranslateString("", "Freedman"));
		Characters[GetCharacterIndex("car_slave21")].name = TranslateString("", "Freedman"));

			LAi_SetActorType(pchar);
			LAi_ActorTurnToLocator(pchar, "reload", "reload1");

			LAi_QuestDelay("pchar_huh", 0.1);
			LAi_QuestDelay("explore_corvette29_A", 1.0);
		break;

		case "explore_corvette29_A":
			PlaySound("VOICE\ENGLISH\gm_crew7.wav");
			
			LAi_QuestDelay("explore_corvette29_B", 1.0);
		break;

		case "explore_corvette29_B":
			PlaySound("VOICE\ENGLISH\Dut_m_a_001.wav");
			LAi_SetPlayerType(pchar);
		break;

		case "explore_corvette30":
			gp = GetCharacterItem(Pchar, "gunpowder");
			pb = GetCharacterItem(Pchar, "pistolbullets");

			if(gp == 6 && pb ==6) 
			{
				Characters[GetCharacterIndex("mutineer_23")].dialog.CurrentNode  = "swim_to_shore";
				LAi_SetActorType(characterFromID("mutineer_23"));
				LAi_ActorDialogNow(characterFromID("mutineer_23"), pchar, "", 0.1);
				LAi_ActorWaitDialog(Pchar, characterFromID("mutineer_23"));
			}
			else
			{
				pchar.quest.explore_corvette31.win_condition.l1 = "locator";
				pchar.quest.explore_corvette31.win_condition.l1.location = "BB_careen_holdS";
				pchar.quest.explore_corvette31.win_condition.l1.locator_group = "box";
				pchar.quest.explore_corvette31.win_condition.l1.locator = "box1";
				pchar.quest.explore_corvette31.win_condition = "explore_corvette31";
			}
		break;

		case "explore_corvette31":
	//on the way back
			pchar.quest.explore_corvette30.win_condition.l1 = "locator";
			pchar.quest.explore_corvette30.win_condition.l1.location = "BB_careen_holdS";
			pchar.quest.explore_corvette30.win_condition.l1.locator_group = "goto";			//was  quest
			pchar.quest.explore_corvette30.win_condition.l1.locator = "swim_dialog";		//was slave20, then slave16_P
			pchar.quest.explore_corvette30.win_condition = "explore_corvette30";
		break;

		case "explore_corvette30_A":
			//from dialog
			LAi_SetActorType(pchar);
			LAi_ActorTurnToLocator(pchar, "reload", "reload1");

			PlaySound("VOICE\ENGLISH\gr_wench3_mhm.wav");
			LAi_SetActorType(characterFromID("mutineer_23"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_23"), "reload", "reload1_back", "explore_corvette30_B", 5.0);
		break;

		case "explore_corvette30_B":
			ChangeCharacterAddressGroup(characterFromID("mutineer_23"), "none", "", "");
			PlaySound("INTERFACE\closed_door.wav");

			LAi_SetActorType(characterFromID("mutineer_19"));
			LAi_ActorRunToLocator(characterFromID("Mutineer_19"), "goto", "king_last", "_", 4.0);

			LAi_QuestDelay("explore_corvette30_C", 1.0);
		break;

		case "explore_corvette30_C":
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorRunToLocator(characterFromID("Caesar"), "goto", "caesar_last", "pchar_playertype", 4.0);

			pchar.quest.explore_corvette32.win_condition.l1 = "locator";
			pchar.quest.explore_corvette32.win_condition.l1.location = "BB_careen_holdS";
			pchar.quest.explore_corvette32.win_condition.l1.locator_group = "goto";
			pchar.quest.explore_corvette32.win_condition.l1.locator = "second";
			pchar.quest.explore_corvette32.win_condition = "explore_corvette32";
		break;

		case "explore_corvette32":
			Characters[GetCharacterIndex("Caesar")].dialog.CurrentNode  = "we_got_weapons";
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorDialogNow(characterFromID("Caesar"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Caesar"));
		break;

		case "explore_corvette32_A":
			Characters[GetCharacterIndex("mutineer_19")].dialog.CurrentNode  = "plan_corvette_fight";
			LAi_SetActorType(characterFromID("mutineer_19"));
			LAi_ActorDialogNow(characterFromID("mutineer_19"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("mutineer_19"));
		break;

		case "explore_corvette32_B":
			LAi_QuestDelay("explore_corvette32_C", 1.0);
		break;

		case "explore_corvette32_C":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "explore_corvette32_C";
			LAi_ActorSelfDialog(pchar, "");

			LAi_SetActorType(characterFromID("car_slave2"));
			LAi_SetActorType(characterFromID("car_slave5"));
			LAi_SetActorType(characterFromID("car_slave8"));
			LAi_SetActorType(characterFromID("car_slave9"));
			LAi_SetActorType(characterFromID("car_slave11"));
			LAi_SetActorType(characterFromID("car_slave12"));
			LAi_ActorTurnToCharacter(characterFromID("car_slave2"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("car_slave5"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("car_slave8"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("car_slave9"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("car_slave11"), Pchar);
			LAi_ActorTurnToCharacter(characterFromID("car_slave12"), Pchar);
		break;

		case "explore_corvette33":
			Characters[GetCharacterIndex("mutineer_19")].dialog.CurrentNode  = "no_slavers";
			LAi_SetActorType(characterFromID("mutineer_19"));
			LAi_ActorDialogNow(characterFromID("mutineer_19"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("mutineer_19"));
		break;
	
		case "explore_corvette33_A":
			PlaySound("VOICE\ENGLISH\gm_crew5A.wav");
			LAi_SetActorType(pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Caesar"));

			LAi_QuestDelay("explore_corvette33_AA", 2.0);
		break;

		case "explore_corvette33_AA":
			PlaySound("AMBIENT\UnHappy-001.wav");

			LAi_QuestDelay("explore_corvette33_B", 4.0);
		break;

		case "explore_corvette33_B":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "explore_corvette33_B";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "explore_corvette33_D":
			PlaySound("VOICE\ENGLISH\blaze_dont_leave_me.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorAnimation(Pchar, "hands up", "_", 2.0);

			LAi_QuestDelay("explore_corvette33_E", 2.0);
		break;

		case "explore_corvette33_E":
			PlaySound("AMBIENT\cheer2.wav");

			LAi_QuestDelay("explore_corvette33_F", 4.5);
		break;

		case "explore_corvette33_F":
			PlaySound("VOICE\ENGLISH\Mateus Santos1.wav");
			LAi_SetActorType(pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("car_slave11"));
			LAi_SetActorType(characterFromID("car_slave11"));
			LAi_ActorTurnToCharacter(characterFromID("car_slave11"), Pchar);

			LAi_QuestDelay("explore_corvette33_G", 3.5);
		break;

		case "explore_corvette33_G":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "explore_corvette33_G";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "explore_corvette33_H":
			PlaySound("VOICE\ENGLISH\Mateus Santos2.wav");
			
			LAi_QuestDelay("explore_corvette33_I", 2.5);
		break;

		case "explore_corvette33_I":
			LAi_QuestDelay("pchar_huh", 0.1);

			LAi_QuestDelay("explore_corvette33_J", 2.5);
		break;

		case "explore_corvette33_J":
			LAi_SetActorType(pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Caesar"));

			LAi_QuestDelay("explore_corvette34", 1.0);
		break;

		case "explore_corvette34":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "explore_corvette34";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "explore_corvette34_A":
			Characters[GetCharacterIndex("car_slave8")].name = TranslateString("", "Fred");
			Characters[GetCharacterIndex("car_slave8")].lastname = TranslateString("", "Bob");

			Characters[GetCharacterIndex("car_slave8")].dialog.CurrentNode  = "FredBob_here";
			LAi_SetActorType(characterFromID("car_slave8"));
			LAi_ActorDialogNow(characterFromID("car_slave8"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("car_slave8"));
		break;

		case "explore_corvette34_B":
			Characters[GetCharacterIndex("car_slave3")].name = TranslateString("", "Prince");

			Characters[GetCharacterIndex("car_slave3")].dialog.CurrentNode  = "Prince_here";
			LAi_SetActorType(characterFromID("car_slave3"));
			LAi_ActorDialogNow(characterFromID("car_slave3"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("car_slave3"));
		break;

		case "explore_corvette34_C":
			LAi_QuestDelay("pchar_lets_go", 0.01);

			LAi_SetPlayerType(pchar);	

			Locations[FindLocation("BB_careen_holdS")].reload.l1.emerge = "goto2";

			LAi_SetStayType(characterFromID("car_convict1"));
			LAi_SetStayType(characterFromID("car_convict2"));
			LAi_SetStayType(characterFromID("car_convict3"));
			LAi_SetStayType(characterFromID("car_convict4"));
			LAi_SetStayType(characterFromID("car_convict5"));
			LAi_SetStayType(characterFromID("car_convict6"));
			ChangeCharacterAddressGroup(characterFromID("car_convict1"), "BB_careen_holdP", "quest", "conv1_stay");
			ChangeCharacterAddressGroup(characterFromID("car_convict2"), "BB_careen_holdP", "quest", "conv2_stay");
			ChangeCharacterAddressGroup(characterFromID("car_convict3"), "BB_careen_holdP", "quest", "conv3_stay");

			pchar.quest.explore_corvette35_0.win_condition.l1 = "location";
			pchar.quest.explore_corvette35_0.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.explore_corvette35_0.win_condition = "explore_corvette35_0";
		break;

		case "explore_corvette35_0":
			LAi_SetActorType(pchar);
			
			Locations[FindLocation("BB_careen_holdS")].reload.l1.emerge = "reload1";		//reset

			GiveItem2Character(characterFromID("car_slave8"), "blade4");
			EquipCharacterByItem(characterFromID("car_slave8"), "blade4");
			GiveItem2Character(characterFromID("car_slave8"), "pistol5");
			EquipCharacterByItem(characterFromID("car_slave8"), "pistol5");
			TakeNItems(characterFromID("car_slave8"), "gunpowder", 2);
			TakeNItems(characterFromID("car_slave8"), "pistolbullets", 2);

			GiveItem2Character(characterFromID("car_slave26"), "blade4");
			EquipCharacterByItem(characterFromID("car_slave26"), "blade4");
			GiveItem2Character(characterFromID("car_slave26"), "piratespistol");
			EquipCharacterByItem(characterFromID("car_slave26"), "piratespistol");
			TakeNItems(characterFromID("car_slave26"), "gunpowder", 2);
			TakeNItems(characterFromID("car_slave26"), "pistolbullets", 2);

			LAi_QuestDelay("explore_corvette35", 1.0);
		break;

		case "explore_corvette35":
			LAi_SetActorType(pchar);
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "explore_corvette35";		//1st
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "explore_corvette35_A":
			PlaySound("INTERFACE\closet_open.wav");

			GiveItem2Character(characterFromID("car_slave27"), "blade4");
			EquipCharacterByItem(characterFromID("car_slave27"), "blade4");
			GiveItem2Character(characterFromID("car_slave27"), "piratespistol");
			EquipCharacterByItem(characterFromID("car_slave27"), "piratespistol");
			TakeNItems(characterFromID("car_slave27"), "gunpowder", 2);
			TakeNItems(characterFromID("car_slave27"), "pistolbullets", 2);

			GiveItem2Character(characterFromID("car_slave28"), "blade4");
			EquipCharacterByItem(characterFromID("car_slave28"), "blade4");
			GiveItem2Character(characterFromID("car_slave28"), "piratespistol");
			EquipCharacterByItem(characterFromID("car_slave28"), "piratespistol");
			TakeNItems(characterFromID("car_slave28"), "gunpowder", 2);
			TakeNItems(characterFromID("car_slave28"), "pistolbullets", 2);
			
			LAi_QuestDelay("explore_corvette35_B", 1.0);
		break;

		case "explore_corvette35_B":
			LAi_QuestDelay("pchar_huh", 0.1);
			LAi_ActorTurnToLocator(pchar, "goto", "look2");
			ChangeCharacterAddressGroup(characterFromID("car_slave8"), "BB_careen_holdP", "reload", "reload1");

			LAi_QuestDelay("explore_corvette35_C", 1.0);
		break;

		case "explore_corvette35_C":
			PlaySound("PEOPLE\recoil.wav");
			ChangeCharacterAddressGroup(pchar, "BB_careen_holdP", "goto", "goto2_back");
			LAi_SetActorType(characterFromID("car_slave8"));
			LAi_ActorGoToLocator(characterFromID("car_slave8"), "quest", "exit", "car_slave8_to_sleeping", 3.5);

			LAi_QuestDelay("explore_corvette35_D", 1.0);
		break;

		case "explore_corvette35_D":
			PlaySound("INTERFACE\closet_open.wav");
			ChangeCharacterAddressGroup(characterFromID("car_slave26"), "BB_careen_holdP", "reload", "reload1");
			LAi_SetActorType(characterFromID("car_slave26"));
			LAi_ActorGoToLocator(characterFromID("car_slave26"), "quest", "exit", "car_slave26_to_sleeping", 3.5);

			LAi_QuestDelay("explore_corvette35_E", 1.0);
		break;

		case "explore_corvette35_E":
			PlaySound("INTERFACE\closet_open.wav");
			ChangeCharacterAddressGroup(characterFromID("car_slave27"), "BB_careen_holdP", "reload", "reload1");
			LAi_SetActorType(characterFromID("car_slave27"));
			LAi_ActorGoToLocator(characterFromID("car_slave27"), "quest", "exit", "car_slave27_to_sleeping", 3.5);

			LAi_QuestDelay("explore_corvette35_F", 1.0);
		break;

		case "explore_corvette35_F":
			PlaySound("INTERFACE\closet_open.wav");
			ChangeCharacterAddressGroup(characterFromID("car_slave28"), "BB_careen_holdP", "reload", "reload1");
			LAi_SetActorType(characterFromID("car_slave28"));
			LAi_ActorGoToLocator(characterFromID("car_slave28"), "quest", "exit", "car_slave28_to_sleeping", 3.5);
		break;

		case "car_slave8_to_sleeping":
			ChangeCharacterAddressGroup(characterFromID("car_slave8"), "BB_careen_deck1", "reload", "reload4");
			LAi_SetActorType(characterFromID("car_slave8"));
		break;

		case "car_slave26_to_sleeping":
			ChangeCharacterAddressGroup(characterFromID("car_slave26"), "BB_careen_deck1", "officers", "reload4_1");
			LAi_SetActorType(characterFromID("car_slave26"));
		break;

		case "car_slave27_to_sleeping":
			ChangeCharacterAddressGroup(characterFromID("car_slave27"), "BB_careen_deck1", "officers", "reload4_2");
			LAi_SetActorType(characterFromID("car_slave27"));
		break;

		case "car_slave28_to_sleeping":
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(characterFromID("car_slave28"), "BB_careen_deck1", "officers", "reload4_3");
			LAi_SetActorType(characterFromID("car_slave28"));

			LAi_QuestDelay("explore_corvette36", 1.0); 
		break;

		case "explore_corvette36":
			LAi_SetActorType(pchar);
			LAi_ActorTurnToLocator(pchar, "officers", "reload4_1");

			GiveItem2Character(characterFromID("car_slave3"), "blade4");
			EquipCharacterByItem(characterFromID("car_slave3"), "blade4");
			GiveItem2Character(characterFromID("car_slave3"), "pistol5");
			EquipCharacterByItem(characterFromID("car_slave3"), "pistol5");
			TakeNItems(characterFromID("car_slave3"), "gunpowder", 2);
			TakeNItems(characterFromID("car_slave3"), "pistolbullets", 2);

			GiveItem2Character(characterFromID("car_slave7"), "blade4");
			EquipCharacterByItem(characterFromID("car_slave7"), "blade4");
			GiveItem2Character(characterFromID("car_slave7"), "piratespistol");
			EquipCharacterByItem(characterFromID("car_slave7"), "piratespistol");
			TakeNItems(characterFromID("car_slave7"), "gunpowder", 2);
			TakeNItems(characterFromID("car_slave7"), "pistolbullets", 2);

			LAi_QuestDelay("explore_corvette36_A", 1.0);
		break;

		case "explore_corvette36_A":
			GiveItem2Character(characterFromID("car_slave22"), "blade4");
			EquipCharacterByItem(characterFromID("car_slave22"), "blade4");
			GiveItem2Character(characterFromID("car_slave22"), "piratespistol");
			EquipCharacterByItem(characterFromID("car_slave22"), "piratespistol");
			TakeNItems(characterFromID("car_slave22"), "gunpowder", 2);
			TakeNItems(characterFromID("car_slave22"), "pistolbullets", 2);

			GiveItem2Character(characterFromID("car_slave25"), "blade4");
			EquipCharacterByItem(characterFromID("car_slave25"), "blade4");
			GiveItem2Character(characterFromID("car_slave25"), "piratespistol");
			EquipCharacterByItem(characterFromID("car_slave25"), "piratespistol");
			TakeNItems(characterFromID("car_slave25"), "gunpowder", 2);
			TakeNItems(characterFromID("car_slave25"), "pistolbullets", 2);

			LAi_SetActorType(pchar);
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "explore_corvette36_A";			//2nd
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "explore_corvette36_B":
			PlaySound("INTERFACE\closet_open.wav");
			ChangeCharacterAddressGroup(characterFromID("car_slave3"), "BB_careen_holdP", "reload", "reload1");
			LAi_SetActorType(characterFromID("car_slave3"));
			LAi_ActorGoToLocator(characterFromID("car_slave3"), "quest", "exit", "car_slave3_to_sleeping", 3.5);

			LAi_QuestDelay("explore_corvette36_BB", 1.0);
			LAi_QuestDelay("explore_corvette36_C", 2.0);
		break;

		case "explore_corvette36_BB":
			LAi_QuestDelay("pchar_ooh", 0.1);
			LAi_SetActorType(pchar);
			LAi_ActorTurnToLocator(pchar, "quest", "exit");
		break;

		case "explore_corvette36_C":
			PlaySound("INTERFACE\closet_open.wav");
			ChangeCharacterAddressGroup(characterFromID("car_slave22"), "BB_careen_holdP", "reload", "reload1");
			LAi_SetActorType(characterFromID("car_slave22"));
			LAi_ActorGoToLocator(characterFromID("car_slave22"), "quest", "exit", "car_slave22_to_sleeping", 3.5);

			LAi_QuestDelay("explore_corvette36_D", 1.0);
		break;

		case "explore_corvette36_D":
			PlaySound("INTERFACE\closet_open.wav");
			ChangeCharacterAddressGroup(characterFromID("car_slave7"), "BB_careen_holdP", "reload", "reload1");
			LAi_SetActorType(characterFromID("car_slave7"));
			LAi_ActorGoToLocator(characterFromID("car_slave7"), "quest", "exit", "car_slave7_to_sleeping", 3.5);

			LAi_QuestDelay("explore_corvette36_E", 1.0);
		break;

		case "explore_corvette36_E":
			PlaySound("INTERFACE\closet_open.wav");
			ChangeCharacterAddressGroup(characterFromID("car_slave25"), "BB_careen_holdP", "reload", "reload1");
			LAi_SetActorType(characterFromID("car_slave25"));
			LAi_ActorGoToLocator(characterFromID("car_slave25"), "quest", "exit", "car_slave25_to_sleeping", 3.5);
		break;

		case "car_slave3_to_sleeping":
			ChangeCharacterAddressGroup(characterFromID("car_slave3"), "BB_careen_deck1", "reload", "reload5");
		break;

		case "car_slave7_to_sleeping":
			ChangeCharacterAddressGroup(characterFromID("car_slave7"), "BB_careen_deck1", "officers", "reload5_1");
		break;

		case "car_slave22_to_sleeping":
			ChangeCharacterAddressGroup(characterFromID("car_slave22"), "BB_careen_deck1", "officers", "reload5_2");
		break;

		case "car_slave25_to_sleeping":
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(characterFromID("car_slave25"), "BB_careen_deck1", "officers", "reload5_3");

			LAi_QuestDelay("explore_corvette37", 1.0); 
		break;

		case "explore_corvette37":
			TakeNItems(characterFromID("Caesar"), "gunpowder", 2);
			TakeNItems(characterFromID("Caesar"), "pistolbullets", 2);
			TakeNItems(characterFromID("mutineer_19"), "gunpowder", 2);
			TakeNItems(characterFromID("mutineer_19"), "pistolbullets", 2);

			LAi_SetActorType(pchar);
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "explore_corvette37";			//3rd
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "explore_corvette37_A":
			PlaySound("INTERFACE\closet_open.wav");
			ChangeCharacterAddressGroup(characterFromID("Caesar"), "BB_careen_holdP", "reload", "reload1");
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorGoToLocator(characterFromID("Caesar"), "quest", "conv4_stay", "Caesar_corv_off", 1.5);

			LAi_QuestDelay("explore_corvette37_AA", 1.0);
			LAi_QuestDelay("explore_corvette37_B", 2.0);  
		break;

		case "explore_corvette37_AA":
			LAi_QuestDelay("pchar_grr", 0.1);
			LAi_SetActorType(pchar);
			LAi_ActorTurnToLocator(pchar, "quest", "conv4_talk");
		break;

		case "explore_corvette37_B":
			PlaySound("INTERFACE\closet_open.wav");
			ChangeCharacterAddressGroup(characterFromID("mutineer_19"), "BB_careen_holdP", "reload", "reload1");
			LAi_SetActorType(characterFromID("mutineer_19"));
			LAi_ActorGoToLocator(characterFromID("mutineer_19"), "officers", "reload1_1", "King_corv_off", 1.0);
		break;

		case "Caesar_corv_off":
			AddPassenger(Pchar, characterFromID("Caesar"), 0);
			SetOfficersIndex(Pchar, 1, getCharacterIndex("Caesar"));
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorTurnToCharacter(characterFromID("Caesar"), Pchar);
		break;

		case "King_corv_off":
			AddPassenger(Pchar, characterFromID("mutineer_19"), 0);
			SetOfficersIndex(Pchar, 2, getCharacterIndex("mutineer_19"));
			LAi_SetActorType(characterFromID("mutineer_19"));
			LAi_ActorTurnToCharacter(characterFromID("mutineer_19"), Pchar);

			LAi_QuestDelay("explore_corvette38", 2.0);
		break;

		case "explore_corvette38":
			LAi_SetActorType(pchar);
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "explore_corvette38";			//4th
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "explore_corvette38_A":
			ChangeCharacterAddressGroup(characterFromID("car_sleeper1"), "BB_careen_deck1", "goto", "alm30_1");
			ChangeCharacterAddressGroup(characterFromID("car_sleeper2"), "BB_careen_deck1", "goto", "alm24_1");
			ChangeCharacterAddressGroup(characterFromID("car_sleeper3"), "BB_careen_deck1", "goto", "alm29_1");
			ChangeCharacterAddressGroup(characterFromID("car_sleeper4"), "BB_careen_deck1", "goto", "alm23_1");
		//not on deck from start
			ChangeCharacterAddressGroup(characterFromID("car_sleeper5"), "BB_careen_deck1", "goto", "sleepers");
		
			LAi_group_MoveCharacter(characterFromID("car_sleeper1"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("car_sleeper2"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("car_sleeper3"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("car_sleeper4"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("car_sleeper5"), "ROOF_THUGS_2");

			LAi_QuestDelay("pchar_sigh", 1.0);
			LAi_QuestDelay("pchar_sigh", 1.0);
			LAi_QuestDelay("explore_corvette38_B", 2.0);
			LAi_QuestDelay("sleeper1_4_mortal", 3.0);
		break;

		case "sleeper1_4_mortal":
			LAi_SetImmortal(characterFromID("car_sleeper1"), false);
			LAi_SetImmortal(characterFromID("car_sleeper2"), false);
			LAi_SetImmortal(characterFromID("car_sleeper3"), false);
			LAi_SetImmortal(characterFromID("car_sleeper4"), false);
		break;

		case "explore_corvette38_B":
			LAi_SetActorType(pchar);
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "explore_corvette38_B";			//5th
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "explore_corvette38_C":
			PlaySound("INTERFACE\closet_open.wav");
			ChangeCharacterAddressGroup(characterFromID("car_slave11"), "BB_careen_holdP", "reload", "reload1");
			LAi_SetStayType(characterFromID("car_slave11"));

			GiveItem2Character(characterFromID("car_slave11"), "blade4");
			EquipCharacterByItem(characterFromID("car_slave11"), "blade4");
			GiveItem2Character(characterFromID("car_slave11"), "pistol5");
			EquipCharacterByItem(characterFromID("car_slave11"), "pistol5");
			TakeNItems(characterFromID("car_slave11"), "gunpowder", 2);
			TakeNItems(characterFromID("car_slave11"), "pistolbullets", 2);

			GiveItem2Character(characterFromID("car_slave24"), "blade4");
			EquipCharacterByItem(characterFromID("car_slave24"), "blade4");
			GiveItem2Character(characterFromID("car_slave24"), "piratespistol");
			EquipCharacterByItem(characterFromID("car_slave24"), "piratespistol");
			TakeNItems(characterFromID("car_slave24"), "gunpowder", 2);
			TakeNItems(characterFromID("car_slave24"), "pistolbullets", 2);

			LAi_QuestDelay("explore_corvette38_D", 1.0);
		break;

		case "explore_corvette38_D":
			LAi_QuestDelay("pchar_scream", 0.1);
			LAi_SetActorType(pchar);
			LAi_ActorTurnToLocator(pchar, "goto", "look2");

			LAi_QuestDelay("explore_corvette38_E", 1.0);
		break;

		case "explore_corvette38_E":
			PlaySound("VOICE\ENGLISH\Mateus Santos1.wav");
			LAi_SetActorType(characterFromID("car_slave11"));
			LAi_ActorTurnToCharacter(characterFromID("car_slave11"), Pchar);
	
		//not on deck from start
			ChangeCharacterAddressGroup(characterFromID("car_sleeper6"), "BB_careen_deck1", "goto", "sleepers");
			ChangeCharacterAddressGroup(characterFromID("car_sleeper7"), "BB_careen_deck1", "goto", "sleepers");
			ChangeCharacterAddressGroup(characterFromID("car_sleeper8"), "BB_careen_deck1", "goto", "sleepers");
			ChangeCharacterAddressGroup(characterFromID("car_sleeper9"), "BB_careen_deck1", "goto", "sleepers");
			ChangeCharacterAddressGroup(characterFromID("car_sleeper10"), "BB_careen_deck1", "goto", "sleepers");
		
			LAi_group_MoveCharacter(characterFromID("car_sleeper6"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("car_sleeper7"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("car_sleeper8"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("car_sleeper9"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("car_sleeper10"), "ROOF_THUGS_2");

			LAi_QuestDelay("explore_corvette39", 3.0);
		break;

		case "explore_corvette39":
			LAi_SetActorType(pchar);
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "explore_corvette39";			//6th
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "explore_corvette39_A":
			LAi_SetActorType(pchar);
			LAi_ActorTurnToLocator(pchar, "box", "box1");

			LAi_SetOfficerType(characterFromID("Caesar"));
			LAi_SetOfficerType(characterFromID("mutineer_19"));

			Locations[FindLocation("BB_careen_deck1")].models.always.locators = "deck1_l_careen_fight";	
			Pchar.careen_deck1_snoring = "finished";

			ChangeCharacterAddressGroup(characterFromID("car_sleeper11"), "BB_careen_deck1", "goto", "sleepers");
			ChangeCharacterAddressGroup(characterFromID("car_sleeper12"), "BB_careen_deck1", "goto", "sleepers");
			ChangeCharacterAddressGroup(characterFromID("car_sleeper13"), "BB_careen_deck1", "goto", "sleepers");
			ChangeCharacterAddressGroup(characterFromID("car_sleeper14"), "BB_careen_deck1", "goto", "sleepers");
			ChangeCharacterAddressGroup(characterFromID("car_sleeper15"), "BB_careen_deck1", "goto", "sleepers");
			ChangeCharacterAddressGroup(characterFromID("car_sleeper16"), "BB_careen_deck1", "goto", "sleepers");

			LAi_group_MoveCharacter(characterFromID("car_sleeper11"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("car_sleeper12"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("car_sleeper13"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("car_sleeper14"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("car_sleeper15"), "ROOF_THUGS_2");
			LAi_group_MoveCharacter(characterFromID("car_sleeper16"), "ROOF_THUGS_2");

			LAi_QuestDelay("explore_corvette39_B", 1.0);
		break;

		case "explore_corvette39_B":
			PlaySound("VOICE\ENGLISH\blaze_lead_way_out.wav");
			LAi_SetPlayerType(pchar);

			pchar.quest.explore_corvette40.win_condition.l1 = "locator";
			pchar.quest.explore_corvette40.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.explore_corvette40.win_condition.l1.locator_group = "goto";
			pchar.quest.explore_corvette40.win_condition.l1.locator = "animals";
			pchar.quest.explore_corvette40.win_condition = "explore_corvette40";
		break;

		case "explore_corvette40":
			PlaySound("INTERFACE\closed_door.wav");
			ChangeCharacterAddressGroup(characterFromID("car_slave11"), "BB_careen_holdP", "quest", "monk");
			LAi_SetStayType(characterFromID("car_slave11"));

			ChangeCharacterAddressGroup(characterFromID("car_slave24"), "BB_careen_holdP", "quest", "conv4_talk");
			ChangeCharacterAddressGroup(characterFromID("car_slave23"), "BB_careen_holdP", "quest", "conv5_talk");
			ChangeCharacterAddressGroup(characterFromID("car_slave10"), "BB_careen_holdP", "quest", "conv6_talk");
			ChangeCharacterAddressGroup(characterFromID("car_slave20"), "BB_careen_holdP", "quest", "conv2_talk");

			GiveItem2Character(characterFromID("car_slave23"), "blade4");
			EquipCharacterByItem(characterFromID("car_slave23"), "blade4");
			GiveItem2Character(characterFromID("car_slave23"), "piratespistol");
			EquipCharacterByItem(characterFromID("car_slave23"), "piratespistol");
			TakeNItems(characterFromID("car_slave23"), "gunpowder", 2);
			TakeNItems(characterFromID("car_slave23"), "pistolbullets", 2);

			GiveItem2Character(characterFromID("car_slave10"), "blade4");
			EquipCharacterByItem(characterFromID("car_slave10"), "blade4");
			GiveItem2Character(characterFromID("car_slave10"), "piratespistol");
			EquipCharacterByItem(characterFromID("car_slave10"), "piratespistol");
			TakeNItems(characterFromID("car_slave10"), "gunpowder", 2);
			TakeNItems(characterFromID("car_slave10"), "pistolbullets", 2);

			GiveItem2Character(characterFromID("car_slave20"), "blade4");
			EquipCharacterByItem(characterFromID("car_slave20"), "blade4");
			GiveItem2Character(characterFromID("car_slave20"), "piratespistol");
			EquipCharacterByItem(characterFromID("car_slave20"), "piratespistol");
			TakeNItems(characterFromID("car_slave20"), "gunpowder", 2);
			TakeNItems(characterFromID("car_slave20"), "pistolbullets", 2);
	
			LAi_QuestDelay("explore_corvette40_A", 1.0);
		break;

		case "explore_corvette40_A":
			LAi_SetActorType(pchar);
			LAi_ActorTurnToLocator(pchar, "quest", "monk");

			LAi_QuestDelay("explore_corvette40_B", 1.0);
		break;

		case "explore_corvette40_B":
			PlaySound("VOICE\ENGLISH\gm_crew23B.wav");
	
			LAi_SetActorType(characterFromID("car_slave8"));
			LAi_SetActorType(characterFromID("car_slave26"));
			LAi_SetActorType(characterFromID("car_slave27"));
			LAi_SetActorType(characterFromID("car_slave28"));
		
			LAi_QuestDelay("explore_corvette40_C", 2.0);
		break;

		case "explore_corvette40_C":
			PlaySound("OBJECTS\DUEL\sword_sh.wav");

			LAi_SetActorType(characterFromID("car_slave25"));
			LAi_SetActorType(characterFromID("car_slave3"));
			LAi_SetActorType(characterFromID("car_slave7"));
			LAi_SetActorType(characterFromID("car_slave22"));
		
			LAi_QuestDelay("explore_corvette40_D", 1.0);
		break;

		case "explore_corvette40_D":
			PlaySound("VOICE\ENGLISH\blaze_what_was_that.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToLocator(Pchar, "reload", "reload2");

			LAi_QuestDelay("explore_corvette40_E", 1.0);
		break;

		case "explore_corvette40_E":
			PlaySound("OBJECTS\DUEL\pistol_musket2.wav");

			LAi_SetActorType(characterFromID("car_slave11"));
			LAi_SetActorType(characterFromID("car_slave24"));
			LAi_SetActorType(characterFromID("car_slave23"));
			LAi_SetActorType(characterFromID("car_slave10"));
			LAi_SetActorType(characterFromID("car_slave20"));
			
			LAi_QuestDelay("explore_corvette40_F", 1.0);
		break;

		case "explore_corvette40_F":
			LAi_SetActorType(pchar);
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "explore_corvette40_F";			//7th
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "explore_corvette40_G":
			LAi_SetPlayerType(pchar);
			PlaySound("VOICE\ENGLISH\gm_crew16B.wav");

			locations[FindLocation("BB_careen_deck1")].type = "silent_deck";
			Locations[FindLocation("BB_careen_deck1")].locators_radius.reload.reload1 = 0.001;
			Locations[FindLocation("BB_careen_deck1")].locators_radius.reload.reload4 = 0.001;
			Locations[FindLocation("BB_careen_deck1")].locators_radius.reload.reload5 = 0.001;

			DoQuickSave();			//before hammock deck fight
		
			pchar.quest.explore_corvette41.win_condition.l1 = "location";
			pchar.quest.explore_corvette41.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.explore_corvette41.win_condition = "explore_corvette41";
	
			LAi_QuestDelay("explore_corvette40_H", 1.5);
		break;

		case "explore_corvette40_H":
			PlaySound("VOICE\ENGLISH\gm_crew5C.wav");
		break;

		case "explore_corvette41":
			PlaySound("OBJECTS\DUEL\pistol_medium3.wav");

			ChangeCharacterAddressGroup(characterFromID("car_slave11"), "BB_careen_deck1", "goto", "slaves");
			ChangeCharacterAddressGroup(characterFromID("car_slave24"), "BB_careen_deck1", "goto", "slaves");
			ChangeCharacterAddressGroup(characterFromID("car_slave23"), "BB_careen_deck1", "goto", "slaves");
			ChangeCharacterAddressGroup(characterFromID("car_slave10"), "BB_careen_deck1", "goto", "slaves");
			ChangeCharacterAddressGroup(characterFromID("car_slave20"), "BB_careen_deck1", "goto", "slaves");
	
			LAi_SetOfficerType(characterFromID("car_slave8"));
			LAi_SetOfficerType(characterFromID("car_slave26"));
			LAi_SetOfficerType(characterFromID("car_slave27"));
			LAi_SetOfficerType(characterFromID("car_slave28"));
			
			LAi_SetOfficerType(characterFromID("car_slave25"));
			LAi_SetOfficerType(characterFromID("car_slave3"));
			LAi_SetOfficerType(characterFromID("car_slave7"));
			LAi_SetOfficerType(characterFromID("car_slave22"));

			LAi_SetOfficerType(characterFromID("car_slave11"));
			LAi_SetOfficerType(characterFromID("car_slave24"));
			LAi_SetOfficerType(characterFromID("car_slave23"));
			LAi_SetOfficerType(characterFromID("car_slave10"));
			LAi_SetOfficerType(characterFromID("car_slave20"));
		
			LAi_group_Register("ROOF_THUGS_2");
			LAi_group_SetRelation(LAI_GROUP_PLAYER, "ROOF_THUGS_2", LAI_GROUP_ENEMY);
			LAi_group_FightGroups(LAI_GROUP_PLAYER, "ROOF_THUGS_2", true);
			LAi_SetFightMode(Pchar, true);
	
		//opposite side
			LAi_QuestDelay("jump_corvette31", 2.0);			//1
			LAi_QuestDelay("jump_corvette32", 4.0);			//1
			LAi_QuestDelay("jump_corvette38", 5.0);			//1

			LAi_QuestDelay("jump_corvette39", 9.0);			//2

			LAi_QuestDelay("jump_corvette33", 12.0);		//3
			LAi_QuestDelay("jump_corvette37", 12.5);		//3
				
		//my side
			LAi_QuestDelay("jump_corvette28", 8.0);			//2

			LAi_QuestDelay("jump_corvette22", 11.0);		//3

			LAi_QuestDelay("jump_corvette27", 13.5);		//4
			LAi_QuestDelay("jump_corvette21", 14.5);		//4
			
		//middle
			LAi_QuestDelay("jump_corvette45", 14.0);		//4	
			LAi_QuestDelay("jump_corvette46", 14.25);		//4

			LAi_QuestDelay("explore_corvette41_A", 1.0);

			Pchar.quest.careen_corvette_fight_end.win_condition.l1 = "NPC_Death";
			Pchar.quest.careen_corvette_fight_end.win_condition.l1.character = "car_sleeper1";
			Pchar.quest.careen_corvette_fight_end.win_condition.l2 = "NPC_Death";
			Pchar.quest.careen_corvette_fight_end.win_condition.l2.character = "car_sleeper2";
			Pchar.quest.careen_corvette_fight_end.win_condition.l3 = "NPC_Death";
			Pchar.quest.careen_corvette_fight_end.win_condition.l3.character = "car_sleeper3";
			Pchar.quest.careen_corvette_fight_end.win_condition.l4 = "NPC_Death";
			Pchar.quest.careen_corvette_fight_end.win_condition.l4.character = "car_sleeper4";
			Pchar.quest.careen_corvette_fight_end.win_condition.l5 = "NPC_Death";
			Pchar.quest.careen_corvette_fight_end.win_condition.l5.character = "car_sleeper5";
			Pchar.quest.careen_corvette_fight_end.win_condition.l6 = "NPC_Death";
			Pchar.quest.careen_corvette_fight_end.win_condition.l6.character = "car_sleeper6";
			Pchar.quest.careen_corvette_fight_end.win_condition.l7 = "NPC_Death";
			Pchar.quest.careen_corvette_fight_end.win_condition.l7.character = "car_sleeper7";
			Pchar.quest.careen_corvette_fight_end.win_condition.l8 = "NPC_Death";
			Pchar.quest.careen_corvette_fight_end.win_condition.l8.character = "car_sleeper8";
			Pchar.quest.careen_corvette_fight_end.win_condition.l9 = "NPC_Death";
			Pchar.quest.careen_corvette_fight_end.win_condition.l9.character = "car_sleeper9";
			Pchar.quest.careen_corvette_fight_end.win_condition.l10 = "NPC_Death";
			Pchar.quest.careen_corvette_fight_end.win_condition.l10.character = "car_sleeper10";
			Pchar.quest.careen_corvette_fight_end.win_condition.l11 = "NPC_Death";
			Pchar.quest.careen_corvette_fight_end.win_condition.l11.character = "car_sleeper11";
			Pchar.quest.careen_corvette_fight_end.win_condition.l12 = "NPC_Death";
			Pchar.quest.careen_corvette_fight_end.win_condition.l12.character = "car_sleeper12";
			Pchar.quest.careen_corvette_fight_end.win_condition.l13 = "NPC_Death";
			Pchar.quest.careen_corvette_fight_end.win_condition.l13.character = "car_sleeper13";
			Pchar.quest.careen_corvette_fight_end.win_condition.l14 = "NPC_Death";
			Pchar.quest.careen_corvette_fight_end.win_condition.l14.character = "car_sleeper14";
			Pchar.quest.careen_corvette_fight_end.win_condition.l15 = "NPC_Death";
			Pchar.quest.careen_corvette_fight_end.win_condition.l15.character = "car_sleeper15";
			Pchar.quest.careen_corvette_fight_end.win_condition.l16 = "NPC_Death";
			Pchar.quest.careen_corvette_fight_end.win_condition.l16.character = "car_sleeper16";
			Pchar.quest.careen_corvette_fight_end.win_condition = "careen_corvette_fight_end";	
		break;

		case "explore_corvette41_A":
			PlaySound("OBJECTS\ABORDAGE\abordage2.wav");
//early equip of 2 slaves for wdeck scene

			RemoveCharacterEquip(characterFromID("car_slave16"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("car_slave16"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("car_slave16"), "items");
			GiveItem2Character(characterFromID("car_slave16"), "blade4");
			GiveItem2Character(characterFromID("car_slave16"), "piratespistol");
			EquipCharacterByItem(characterFromID("car_slave16"), "blade4");
			EquipCharacterByItem(characterFromID("car_slave16"), "piratespistol");

			RemoveCharacterEquip(characterFromID("car_slave2"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("car_slave2"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("car_slave2"), "items");
			GiveItem2Character(characterFromID("car_slave2"), "blade4");
			GiveItem2Character(characterFromID("car_slave2"), "piratespistol");
			EquipCharacterByItem(characterFromID("car_slave2"), "blade4");
			EquipCharacterByItem(characterFromID("car_slave2"), "piratespistol");
		break;

	//opposite side ----------------------------------------------------------------------------------------------
		case "jump_corvette31":
			PlaySound("PEOPLE\creak2.wav");
			ChangeCharacterAddressGroup(characterFromID("car_sleeper5"), "BB_careen_deck1", "goto", "bed31_1");
		ChangeCharacterAddressGroup(characterFromID("car_slave11"), "BB_careen_deck1", "goto", "res1");

			LAi_QuestDelay("jump_sound", 0.75);
			LAi_QuestDelay("sleeper5_mortal", 3.75);
		break;

		case "sleeper5_mortal":
			LAi_SetImmortal(characterFromID("car_sleeper5"), false);
		break;

		case "jump_corvette37":
			PlaySound("OBJECTS\DUEL\sword_sh.wav");
			ChangeCharacterAddressGroup(characterFromID("car_sleeper6"), "BB_careen_deck1", "goto", "bed37_1");

			LAi_QuestDelay("jump_sound", 0.75);
			LAi_QuestDelay("sleeper6_mortal", 3.75);
		break;

		case "sleeper6_mortal":
			LAi_SetImmortal(characterFromID("car_sleeper6"), false);
		break;

		case "jump_corvette32":
			PlaySound("OBJECTS\DUEL\man_attack3.wav");
			ChangeCharacterAddressGroup(characterFromID("car_sleeper7"), "BB_careen_deck1", "goto", "bed32_1");

			LAi_QuestDelay("jump_sound", 0.75);
			LAi_QuestDelay("sleeper7_mortal", 3.75);
		break;

		case "sleeper7_mortal":
			LAi_SetImmortal(characterFromID("car_sleeper7"), false);
		break;

		case "jump_corvette38":
			PlaySound("PEOPLE\clothes1.wav");
			ChangeCharacterAddressGroup(characterFromID("car_sleeper8"), "BB_careen_deck1", "goto", "bed38_1");

			LAi_QuestDelay("jump_sound", 0.75);
			LAi_QuestDelay("sleeper8_mortal", 3.75);
		break;

		case "sleeper8_mortal":
			LAi_SetImmortal(characterFromID("car_sleeper8"), false);
		break;
	
		case "jump_corvette33":
			PlaySound("PEOPLE\creak2.wav");
			ChangeCharacterAddressGroup(characterFromID("car_sleeper9"), "BB_careen_deck1", "goto", "bed33_1");

			LAi_QuestDelay("jump_sound", 0.75);
			LAi_QuestDelay("sleeper9_mortal", 3.75);
		break;

		case "sleeper9_mortal":
			LAi_SetImmortal(characterFromID("car_sleeper9"), false);
		break;

		case "jump_corvette39":
			PlaySound("OBJECTS\DUEL\sword_sh.wav");
			ChangeCharacterAddressGroup(characterFromID("car_sleeper10"), "BB_careen_deck1", "goto", "bed39_1");

			LAi_QuestDelay("jump_sound", 0.75);
			LAi_QuestDelay("sleeper10_mortal", 3.75);
		break;

		case "sleeper10_mortal":
			LAi_SetImmortal(characterFromID("car_sleeper10"), false);
		break;
	//my side ----------------------------------------------------------------------------------------------
		case "jump_corvette21":
			PlaySound("OBJECTS\DUEL\man_attack3.wav");
			ChangeCharacterAddressGroup(characterFromID("car_sleeper11"), "BB_careen_deck1", "goto", "bed21_1");
		ChangeCharacterAddressGroup(characterFromID("car_slave20"), "BB_careen_deck1", "goto", "res4");

			LAi_QuestDelay("jump_sound", 0.75);
			LAi_QuestDelay("sleeper11_mortal", 3.75);
		break;

		case "sleeper11_mortal":
			LAi_SetImmortal(characterFromID("car_sleeper11"), false);
		break;

		case "jump_corvette27":
			PlaySound("PEOPLE\clothes1.wav");
			ChangeCharacterAddressGroup(characterFromID("car_sleeper12"), "BB_careen_deck1", "goto", "bed27_1");
		ChangeCharacterAddressGroup(characterFromID("car_slave10"), "BB_careen_deck1", "goto", "res4");

			LAi_QuestDelay("jump_sound", 0.75);
			LAi_QuestDelay("sleeper12_mortal", 3.75);
		break;

		case "sleeper12_mortal":
			LAi_SetImmortal(characterFromID("car_sleeper12"), false);
		break;

		case "jump_corvette22":
			PlaySound("PEOPLE\creak2.wav");
			ChangeCharacterAddressGroup(characterFromID("car_sleeper13"), "BB_careen_deck1", "goto", "bed22_1");
		ChangeCharacterAddressGroup(characterFromID("car_slave23"), "BB_careen_deck1", "goto", "res3");

			LAi_QuestDelay("jump_sound", 0.75);
			LAi_QuestDelay("sleeper13_mortal", 3.75);
		break;

		case "sleeper13_mortal":
			LAi_SetImmortal(characterFromID("car_sleeper13"), false);
		break;

		case "jump_corvette28":
			PlaySound("OBJECTS\DUEL\sword_sh.wav");
			ChangeCharacterAddressGroup(characterFromID("car_sleeper14"), "BB_careen_deck1", "goto", "bed28_1");
		ChangeCharacterAddressGroup(characterFromID("car_slave24"), "BB_careen_deck1", "goto", "res2");

			LAi_QuestDelay("jump_sound", 0.75);
			LAi_QuestDelay("sleeper14_mortal", 3.75);
		break;

		case "sleeper14_mortal":
			LAi_SetImmortal(characterFromID("car_sleeper14"), false);
		break;
	//middle ----------------------------------------------------------------------------------------------
		case "jump_corvette46":
			PlaySound("OBJECTS\DUEL\man_attack3.wav");
			ChangeCharacterAddressGroup(characterFromID("car_sleeper15"), "BB_careen_deck1", "goto", "bed46_1");

			LAi_QuestDelay("jump_sound", 0.75);
			LAi_QuestDelay("sleeper15_mortal", 3.75);
		break;

		case "sleeper15_mortal":
			LAi_SetImmortal(characterFromID("car_sleeper15"), false);
		break;

		case "jump_corvette45":
			PlaySound("PEOPLE\clothes1.wav");
			ChangeCharacterAddressGroup(characterFromID("car_sleeper16"), "BB_careen_deck1", "goto", "bed45_1");

			LAi_QuestDelay("jump_sound", 0.75);
			LAi_QuestDelay("sleeper16_mortal", 3.75);
		break;

		case "sleeper16_mortal":
			LAi_SetImmortal(characterFromID("car_sleeper16"), false);
		break;

		case "careen_corvette_fight_end":
			PauseAllSounds();
			PostEvent("LoadSceneSound", 0);
			LAi_LocationFightDisable(&Locations[FindLocation("BB_careen_deck1")], true);

			if(LAi_IsFightMode(Pchar)) {LAi_SetFightMode(Pchar, false);}
			if(LAi_IsFightMode(characterFromID("mutineer_19"))) {LAi_SetFightMode(characterFromID("mutineer_19"), false);}
			if(LAi_IsFightMode(characterFromID("Caesar"))) {LAi_SetFightMode(characterFromID("Caesar"), false);}

			if(LAi_IsFightMode(characterFromID("car_slave8"))) {LAi_SetFightMode(characterFromID("car_slave8"), false);}
			if(LAi_IsFightMode(characterFromID("car_slave26"))) {LAi_SetFightMode(characterFromID("car_slave26"), false);}
			if(LAi_IsFightMode(characterFromID("car_slave27"))) {LAi_SetFightMode(characterFromID("car_slave27"), false);}
			if(LAi_IsFightMode(characterFromID("car_slave28"))) {LAi_SetFightMode(characterFromID("car_slave28"), false);}

			if(LAi_IsFightMode(characterFromID("car_slave25"))) {LAi_SetFightMode(characterFromID("car_slave25"), false);}
			if(LAi_IsFightMode(characterFromID("car_slave3"))) {LAi_SetFightMode(characterFromID("car_slave3"), false);}
			if(LAi_IsFightMode(characterFromID("car_slave7"))) {LAi_SetFightMode(characterFromID("car_slave7"), false);}
			if(LAi_IsFightMode(characterFromID("car_slave22"))) {LAi_SetFightMode(characterFromID("car_slave22"), false);}

			if(LAi_IsFightMode(characterFromID("car_slave11"))) {LAi_SetFightMode(characterFromID("car_slave11"), false);}
			if(LAi_IsFightMode(characterFromID("car_slave24"))) {LAi_SetFightMode(characterFromID("car_slave24"), false);}
			if(LAi_IsFightMode(characterFromID("car_slave23"))) {LAi_SetFightMode(characterFromID("car_slave23"), false);}
			if(LAi_IsFightMode(characterFromID("car_slave10"))) {LAi_SetFightMode(characterFromID("car_slave10"), false);}
			if(LAi_IsFightMode(characterFromID("car_slave20"))) {LAi_SetFightMode(characterFromID("car_slave20"), false);}

			SetLocatorRadius(locations[FindLocation("BB_careen_deck1")], "reload", "reload1", 1.5);
			SetLocatorRadius(locations[FindLocation("BB_careen_deck1")], "reload", "reload4", 1.5);
			SetLocatorRadius(locations[FindLocation("BB_careen_deck1")], "reload", "reload5", 1.5);
			Locations[FindLocation("BB_careen_deck1")].locators_radius.reload.reload1 = 1.5;
			Locations[FindLocation("BB_careen_deck1")].locators_radius.reload.reload4 = 1.5;
			Locations[FindLocation("BB_careen_deck1")].locators_radius.reload.reload5 = 1.5;

			Locations[FindLocation("BB_careen_deck1")].reload.l5.go = "BB_careen_corvette_end";

			Locations[FindLocation("BB_careen_deck2")].reload.l4.go = "BB_careen_corvette_end";
			Locations[FindLocation("BB_careen_capmd_2")].reload.l3.go = "BB_careen_corvette_end";
	
		//mutineer weapons start here
			RemoveCharacterEquip(characterFromID("Mutineer_2"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_2"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_2"), "items");
			GiveItem2Character(characterFromID("Mutineer_2"), "blademketB");
			EquipCharacterByItem(characterFromID("Mutineer_2"), "blademketB");

			RemoveCharacterEquip(characterFromID("Mutineer_10"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_10"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_10"), "items");
			GiveItem2Character(characterFromID("Mutineer_10"), "blademketB");
			EquipCharacterByItem(characterFromID("Mutineer_10"), "blademketB");

			RemoveCharacterEquip(characterFromID("Mutineer_4"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_4"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_4"), "items");
			GiveItem2Character(characterFromID("Mutineer_4"), "blademketB");
			EquipCharacterByItem(characterFromID("Mutineer_4"), "blademketB");
			

			LAi_QuestDelay("cc_fight_end1", 1.0);
	
			pchar.quest.cc_wdeck_fight.win_condition.l1 = "location";
			pchar.quest.cc_wdeck_fight.win_condition.l1.location = "BB_careen_corvette_end";
			pchar.quest.cc_wdeck_fight.win_condition = "cc_wdeck_fight";
		break;
	
		case "cc_fight_end1":
			if(LAi_IsFightMode(Pchar)) {LAi_SetFightMode(Pchar, false);}
			if(LAi_IsFightMode(characterFromID("mutineer_19"))) {LAi_SetFightMode(characterFromID("mutineer_19"), false);}
			if(LAi_IsFightMode(characterFromID("Caesar"))) {LAi_SetFightMode(characterFromID("Caesar"), false);}

			LAi_SetActorType(characterFromID("car_sailor1"));

			SetModel(characterFromID("Mutineer_2"), "Soldier_Eng_17", "man", "man", 1.8, false);
			SetModel(characterFromID("Mutineer_3"), "Soldier_Eng2_17", "man", "man", 1.8, false);
			SetModel(characterFromID("Mutineer_10"), "Soldier_Eng6_17", "man", "man", 1.8, false);
			SetModel(characterFromID("Mutineer_15"), "Soldier_Eng2_17", "man", "man", 1.8, false);
			SetModel(characterFromID("Hands"), "bb_Hands2_officer", "man", "man", 1.8, false);
			SetModel(characterFromID("Pell"), "bb_Pell_officer", "man", "man", 1.8, false);
			SetModel(characterFromID("Mutineer_32"), "bb_qm_soldier", "man", "man", 1.8, false);
			SetModel(characterFromID("Mutineer_4"), "Soldier_Eng3_17", "man", "man", 1.8, false);
			SetModel(characterFromID("Mutineer_5"), "Soldier_Eng4_17", "man", "man", 1.8, false);
			SetModel(characterFromID("Mutineer_8"), "Soldier_Eng5_17", "man", "man", 1.8, false);
			SetModel(characterFromID("Mutineer_16"), "Soldier_Eng_17", "man", "man", 1.8, false);

			RemoveOfficersIndex(pchar, GetCharacterIndex("mutineer_19"));
			RemovePassenger(pchar, characterFromID("mutineer_19"));
			RemoveOfficersIndex(pchar, GetCharacterIndex("Caesar"));
			RemovePassenger(pchar, characterFromID("Caesar"));

	//mutineer weapons continue here
			RemoveCharacterEquip(characterFromID("Mutineer_16"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_16"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_16"), "items");
			GiveItem2Character(characterFromID("Mutineer_16"), "blademketB");
			EquipCharacterByItem(characterFromID("Mutineer_16"), "blademketB");

			RemoveCharacterEquip(characterFromID("Mutineer_5"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_5"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_5"), "items");
			GiveItem2Character(characterFromID("Mutineer_5"), "blademketB");
			EquipCharacterByItem(characterFromID("Mutineer_5"), "blademketB");

			RemoveCharacterEquip(characterFromID("Mutineer_8"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_8"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_8"), "items");
			GiveItem2Character(characterFromID("Mutineer_8"), "bladeX4");
			GiveItem2Character(characterFromID("Mutineer_8"), "pistolmketB");
			EquipCharacterByItem(characterFromID("Mutineer_8"), "bladeX4");
			EquipCharacterByItem(characterFromID("Mutineer_8"), "pistolmketB");
		break;
//.........................................................................................................................
	
		case "cc_wdeck_fight":
			LAi_SetActorType(Pchar);

		//8 allies on the corvette (with pchar & 2 officers)
			ChangeCharacterAddressGroup(characterFromID("mutineer_19"), "BB_careen_corvette_end", "officers", "reload3_1");	//KD
			ChangeCharacterAddressGroup(characterFromID("Caesar"), "BB_careen_corvette_end", "officers", "reload3_2");
			ChangeCharacterAddressGroup(characterFromID("car_convict6"), "BB_careen_corvette_end", "goto", "slave2");	//doc

			ChangeCharacterAddressGroup(characterFromID("car_slave8"), "BB_careen_corvette_end", "goto", "slave1");		//FB
			ChangeCharacterAddressGroup(characterFromID("car_slave3"), "BB_careen_corvette_end", "goto", "slave3");		//PR

			ChangeCharacterAddressGroup(characterFromID("car_slave27"), "BB_careen_corvette_end", "goto", "slave5");	//maroon4
			ChangeCharacterAddressGroup(characterFromID("car_convict3"), "BB_careen_corvette_end", "goto", "slave4");	//swedish

		//8 redcoats + 4 more
			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_careen_corvette_end", "goto", "red_standby");
			ChangeCharacterAddressGroup(characterFromID("Pell"), "BB_careen_corvette_end", "goto", "red_standby");
			ChangeCharacterAddressGroup(characterFromID("mutineer_32"), "BB_careen_corvette_end", "goto", "red_standby");
			ChangeCharacterAddressGroup(characterFromID("mutineer_23"), "BB_careen_corvette_end", "goto", "red_standby");
			ChangeCharacterAddressGroup(characterFromID("mutineer_3"), "BB_careen_corvette_end", "goto", "red_standby");
			ChangeCharacterAddressGroup(characterFromID("mutineer_15"), "BB_careen_corvette_end", "goto", "red_standby");

			ChangeCharacterAddressGroup(characterFromID("mutineer_2"), "BB_careen_corvette_end", "goto", "mutineer_2");
			ChangeCharacterAddressGroup(characterFromID("mutineer_10"), "BB_careen_corvette_end", "goto", "mutineer_10");
			ChangeCharacterAddressGroup(characterFromID("mutineer_4"), "BB_careen_corvette_end", "quest", "sailor5");
			ChangeCharacterAddressGroup(characterFromID("mutineer_5"), "BB_careen_corvette_end", "quest", "sailor8");
			ChangeCharacterAddressGroup(characterFromID("mutineer_8"), "BB_careen_corvette_end", "officers", "reload2_2");
			ChangeCharacterAddressGroup(characterFromID("mutineer_16"), "BB_careen_corvette_end", "quest", "sailor11");

			LAi_SetStayType(characterFromID("Hands")); LAi_SetStayType(characterFromID("Pell"));
			LAi_SetStayType(characterFromID("mutineer_32")); LAi_SetStayType(characterFromID("mutineer_23"));
			LAi_SetStayType(characterFromID("mutineer_15")); LAi_SetPlayerType(characterFromID("mutineer_2"));
			LAi_SetStayType(characterFromID("mutineer_3")); LAi_SetPlayerType(characterFromID("mutineer_10"));
			LAi_SetPlayerType(characterFromID("mutineer_4")); LAi_SetPlayerType(characterFromID("mutineer_5"));
			LAi_SetStayType(characterFromID("mutineer_8")); LAi_SetPlayerType(characterFromID("mutineer_16"));

			LAi_SetPlayerType(characterFromID("mutineer_19")); LAi_SetPlayerType(characterFromID("Caesar"));
			LAi_SetPlayerType(characterFromID("car_slave8"));  LAi_SetPlayerType(characterFromID("car_slave3"));
			LAi_SetPlayerType(characterFromID("car_convict6"));
			LAi_SetPlayerType(characterFromID("car_slave27"));
			LAi_SetPlayerType(characterFromID("car_convict3"));

			ChangeCharacterAddressGroup(characterFromID("car_sailor1"), "BB_careen_corvette_end", "quest", "sailor1");
			ChangeCharacterAddressGroup(characterFromID("car_sailor2"), "BB_careen_corvette_end", "quest", "sailor2");
			ChangeCharacterAddressGroup(characterFromID("car_sailor3"), "BB_careen_corvette_end", "quest", "sailor3");
			ChangeCharacterAddressGroup(characterFromID("car_sailor4"), "BB_careen_corvette_end", "quest", "sailor4");
			ChangeCharacterAddressGroup(characterFromID("car_sailor5"), "BB_careen_corvette_end", "quest", "sailor5");
			ChangeCharacterAddressGroup(characterFromID("car_sailor6"), "BB_careen_corvette_end", "quest", "sailor6");
			ChangeCharacterAddressGroup(characterFromID("car_sailor7"), "BB_careen_corvette_end", "quest", "sailor7");
			ChangeCharacterAddressGroup(characterFromID("car_sailor8"), "BB_careen_corvette_end", "quest", "sailor8");
			ChangeCharacterAddressGroup(characterFromID("car_sailor9"), "BB_careen_corvette_end", "quest", "sailor9");
			ChangeCharacterAddressGroup(characterFromID("car_sailor10"), "BB_careen_corvette_end", "quest", "sailor10");
			ChangeCharacterAddressGroup(characterFromID("car_sailor11"), "BB_careen_corvette_end", "quest", "sailor11");
			ChangeCharacterAddressGroup(characterFromID("car_sailor12"), "BB_careen_corvette_end", "quest", "sailor12");
		
			LAi_QuestDelay("cc_wdeck_fight1", 0.1);
			LAi_QuestDelay("wdeck_shot", 0.5);
			LAi_QuestDelay("Pyle_to_wdeck", 1.0);
		

			LAi_QuestDelay("boat2_m32_arriveA", 5.0);		//was 5
			LAi_QuestDelay("boat4_m3_arriveA", 7.0);		//6
			LAi_QuestDelay("boat3_m15_arriveA", 8.5);		//6.5
			
			LAi_QuestDelay("boat2_m23_arriveA", 10.5);		//7	
			LAi_QuestDelay("boat3_pell_arriveA", 12.0);		//8
			LAi_QuestDelay("boat4_hands_arriveA", 13.0);		//8.5
		break;

		case "cc_wdeck_fight1":
			LAi_KillCharacter(characterFromID("car_sailor1"));
			LAi_KillCharacter(characterFromID("car_sailor3"));
			LAi_KillCharacter(characterFromID("car_sailor5"));
			LAi_KillCharacter(characterFromID("car_sailor6"));
			LAi_KillCharacter(characterFromID("car_sailor7"));
			LAi_KillCharacter(characterFromID("car_sailor8"));
			LAi_KillCharacter(characterFromID("car_sailor9"));	
			LAi_KillCharacter(characterFromID("car_sailor11"));
		break;
//start wdeck
		case "wdeck_shot":
			PlaySound("OBJECTS\DUEL\pistol_medium2.wav");
			Characters[GetCharacterIndex("car_slave27")].name = TranslateString("", "Musician");
			Characters[GetCharacterIndex("car_slave10")].name = TranslateString("", "Soldier");
			Characters[GetCharacterIndex("car_slave11")].name = TranslateString("", "Priest");
			Characters[GetCharacterIndex("car_convict3")].name = TranslateString("", "Gunnar");
		break;

		case "Pyle_to_wdeck":
			LAi_SetFightMode(characterFromID("Caesar"), true);
			LAi_SetFightMode(characterFromID("mutineer_19"), true);
			LAi_SetFightMode(characterFromID("car_slave8"), true);
			LAi_SetFightMode(characterFromID("car_slave3"), true);
			LAi_SetFightMode(characterFromID("car_convict6"), true);
			LAi_SetFightMode(characterFromID("car_slave27"), true);
			LAi_SetFightMode(characterFromID("car_convict3"), true);
			
			LAi_SetFightMode(characterFromID("Mutineer_2"), true);
			LAi_SetFightMode(characterFromID("Mutineer_4"), true);
			LAi_SetFightMode(characterFromID("Mutineer_5"), true);
			LAi_SetFightMode(characterFromID("Mutineer_16"), true);
			LAi_SetFightMode(characterFromID("Mutineer_10"), true);

			LAi_QuestDelay("Pyle_to_wdeck1", 1.0);
		break;

		case "Pyle_to_wdeck1":
			LAi_ActorTurnToLocator(Pchar, "reload", "reload1");
			CreateParticleSystem("gunfire" , 1.3, 3.8, 3.1, 5.1, 4.0, 0.0, sti(20) );

			LAi_QuestDelay("Pyle_to_wdeck2", 1.0);
		break;

		case "Pyle_to_wdeck2":
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(Pchar, true);
	
			LAi_KillCharacter(characterFromID("car_sailor12"));

			LAi_QuestDelay("Pyle_to_wdeck3", 1.0);
		break;
		
		case "Pyle_to_wdeck3":
			PlaySound("VOICE\ENGLISH\Eng_m_a_059.wav");
			LAi_LocationFightDisable(&Locations[FindLocation("BB_careen_corvette_end")], true);
			LAi_SetFightMode(characterFromID("mutineer_2"), false);

			LAi_SetActorType(characterFromID("car_sailor2"));
			LAi_ActorAnimation(characterFromID("car_sailor2"), "hands up", "Pyle_to_wdeck8", 15.0);
			LAi_SetActorType(characterFromID("car_sailor4"));
			LAi_ActorAnimation(characterFromID("car_sailor4"), "hands up", "_", 15.0);
			LAi_SetActorType(characterFromID("car_sailor10"));
			LAi_ActorAnimation(characterFromID("car_sailor10"), "hands up", "_", 15.0);
			
			LAi_QuestDelay("Pyle_to_wdeck4", 1.0);
			LAi_QuestDelay("Pyle_to_wdeck6", 2.0);
		break;

		case "Pyle_to_wdeck4":
			LAi_SetPlayerType(Pchar);
			LAi_SetFightMode(Pchar, false);

			RemoveCharacterEquip(characterFromID("Mutineer_2"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_2"), "items");
			GiveItem2Character(characterFromID("Mutineer_2"), "bladeX4");
			GiveItem2Character(characterFromID("Mutineer_2"), "pistolmketB");
			EquipCharacterByItem(characterFromID("Mutineer_2"), "bladeX4");
			EquipCharacterByItem(characterFromID("Mutineer_2"), "pistolmketB");

			LAi_QuestDelay("Pyle_to_wdeck5", 0.5);
		break;

		case "Pyle_to_wdeck5":
			LAi_SetStayType(Pchar);

			if(LAi_IsFightMode(characterFromID("Caesar"))) {LAi_SetFightMode(characterFromID("Caesar"), false);}
			if(LAi_IsFightMode(characterFromID("mutineer_19"))) {LAi_SetFightMode(characterFromID("mutineer_19"), false);}
			if(LAi_IsFightMode(characterFromID("car_slave8"))) {LAi_SetFightMode(characterFromID("car_slave8"), false);}
			if(LAi_IsFightMode(characterFromID("car_slave3"))) {LAi_SetFightMode(characterFromID("car_slave3"), false);}
			if(LAi_IsFightMode(characterFromID("car_convict6"))) {LAi_SetFightMode(characterFromID("car_convict6"), false);}
			if(LAi_IsFightMode(characterFromID("car_slave27"))) {LAi_SetFightMode(characterFromID("car_slave27"), false);}
			if(LAi_IsFightMode(characterFromID("car_convict3"))) {LAi_SetFightMode(characterFromID("car_convict3"), false);}
		break;

		case "Pyle_to_wdeck6":
			//after check and mate

			PlaySound("OBJECTS\SHIPCHARGE\hurrah.wav");
			PlaySound("OBJECTS\ABORDAGE\abordage_wining.wav");		
		break;

		case "Pyle_to_wdeck7":
			//after Hands arrived

			LAi_SetActorType(Pchar);
			LAi_ActorGoToLocator(Pchar, "goto", "dialog", "Pyle_to_wdeck9", 4.0);
		break;

		case "Pyle_to_wdeck8":
			PlaySound("OBJECTS\DUEL\sword_fallen.wav");

			RemoveCharacterEquip(characterFromID("car_sailor2"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("car_sailor2"), "items");
			RemoveCharacterEquip(characterFromID("car_sailor4"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("car_sailor4"), "items");
			RemoveCharacterEquip(characterFromID("car_sailor10"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("car_sailor10"), "items");

			LAi_SetPoorType(characterFromID("car_sailor2"));
			LAi_SetPoorType(characterFromID("car_sailor4"));
			LAi_SetPoorType(characterFromID("car_sailor10"));
		break;

		case "Pyle_to_wdeck9":	
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "Pyle_to_wdeck9";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Pyle_to_wdeck10":	
			LAi_SetFightMode(characterFromID("Mutineer_4"), false);
			LAi_SetFightMode(characterFromID("Mutineer_5"), false);
			LAi_SetFightMode(characterFromID("Mutineer_16"), false);
			LAi_SetFightMode(characterFromID("Mutineer_10"), false);

			LAi_QuestDelay("Pyle_to_wdeck11", 1.0);
		break;

		case "Pyle_to_wdeck11":	
			PlaySound("VOICE\ENGLISH\grandma_yell2.wav");
			LAi_SetOfficerType(characterFromID("Hands"));
			LAi_SetOfficerType(characterFromID("Pell"));
		//	LAi_SetOfficerType(characterFromID("mutineer_32"));
			LAi_SetActorType(characterFromID("mutineer_32"));
			LAi_ActorGoToLocator(characterFromID("mutineer_32"), "goto", "qm_dialog", "Pyle_to_wdeck11A", 3.0);
			LAi_SetOfficerType(characterFromID("Caesar"));

			RemoveCharacterEquip(characterFromID("Mutineer_4"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_4"), "items");
			GiveItem2Character(characterFromID("Mutineer_4"), "bladeX4");
			GiveItem2Character(characterFromID("Mutineer_4"), "pistolmketB");
			EquipCharacterByItem(characterFromID("Mutineer_4"), "bladeX4");
			EquipCharacterByItem(characterFromID("Mutineer_4"), "pistolmketB");

			RemoveCharacterEquip(characterFromID("Mutineer_5"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_5"), "items");
			GiveItem2Character(characterFromID("Mutineer_5"), "bladeX4");
			GiveItem2Character(characterFromID("Mutineer_5"), "pistolmketB");
			EquipCharacterByItem(characterFromID("Mutineer_5"), "bladeX4");
			EquipCharacterByItem(characterFromID("Mutineer_5"), "pistolmketB");

			RemoveCharacterEquip(characterFromID("Mutineer_16"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_16"), "items");
			GiveItem2Character(characterFromID("Mutineer_16"), "bladeX4");
			GiveItem2Character(characterFromID("Mutineer_16"), "pistolmketB");
			EquipCharacterByItem(characterFromID("Mutineer_16"), "bladeX4");
			EquipCharacterByItem(characterFromID("Mutineer_16"), "pistolmketB");

			RemoveCharacterEquip(characterFromID("Mutineer_10"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_10"), "items");
			GiveItem2Character(characterFromID("Mutineer_10"), "bladeX4");
			GiveItem2Character(characterFromID("Mutineer_10"), "pistolmketB");
			EquipCharacterByItem(characterFromID("Mutineer_10"), "bladeX4");
			EquipCharacterByItem(characterFromID("Mutineer_10"), "pistolmketB");

			LAi_QuestDelay("Pyle_to_wdeck12", 3.0);			//was 2
		break;

		case "Pyle_to_wdeck11A":
			ChangeCharacterAddressGroup(characterFromID("mutineer_32"), "BB_careen_corvette_end", "goto", "qm_dialog");
			LAi_SetOfficerType(characterFromID("mutineer_32"));
		break;

		case "Pyle_to_wdeck12":	
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "Pyle_to_wdeck12";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Pyle_to_wdeck13":
			PlaySound("VOICE\ENGLISH\gr_wench3_pos.wav");

			LAi_QuestDelay("Pyle_to_wdeck14", 1.0);
		break;

		case "Pyle_to_wdeck14":
			PlaySound("VOICE\ENGLISH\Dut_m_a_001.wav");

			LAi_QuestDelay("Pyle_to_wdeck15", 1.5);
		break;

		case "Pyle_to_wdeck15":
			Characters[GetCharacterIndex("Mutineer_32")].dialog.CurrentNode  = "no_doctor";
			LAi_SetActorType(characterFromID("Mutineer_32"));
			LAi_ActorDialogNow(characterFromID("Mutineer_32"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Mutineer_32"));
		break;

		case "Pyle_to_wdeck16":
			PlaySound("AMBIENT\JAIL\cough.wav");

			LAi_QuestDelay("Pyle_to_wdeck16A", 1.0);
		break;

		case "Pyle_to_wdeck16A":
			LAi_SetActorType(characterFromID("Mutineer_19"));
			LAi_ActorTurnToCharacter(characterFromID("Mutineer_19"), characterFromID("car_convict6"));
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorTurnToCharacter(characterFromID("Caesar"), characterFromID("car_convict6"));

			Characters[GetCharacterIndex("car_convict6")].dialog.CurrentNode  = "doctor";
			LAi_SetActorType(characterFromID("car_convict6"));
			LAi_ActorDialogNow(characterFromID("car_convict6"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("car_convict6"));
		break;

		case "Pyle_to_wdeck17":
			LAi_SetOfficerType(characterFromID("car_convict6"));

			LAi_QuestDelay("Pyle_to_wdeck18", 2.5);
		break;

		case "Pyle_to_wdeck18":
			Characters[GetCharacterIndex("car_convict6")].dialog.CurrentNode  = "yes_doctor";
			LAi_SetActorType(characterFromID("car_convict6"));
			LAi_ActorDialogNow(characterFromID("car_convict6"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("car_convict6"));
		break;

		case "Pyle_to_wdeck18A":
			PlaySound("AMBIENT\cheer2.wav");

			LAi_QuestDelay("Pyle_to_wdeck19", 4.5);
		break;

		case "Pyle_to_wdeck19":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "Pyle_to_wdeck19";
			LAi_ActorSelfDialog(pchar, "");
		break;
	
		case "Pyle_to_wdeck20":
			Characters[GetCharacterIndex("car_convict6")].old.name = "Peter";
			Characters[GetCharacterIndex("car_convict6")].old.lastname = "Blood";
			Characters[GetCharacterIndex("car_convict6")].name = TranslateString("", "Peter");
			Characters[GetCharacterIndex("car_convict6")].lastname = TranslateString("", "Blood");

			Characters[GetCharacterIndex("car_convict6")].dialog.CurrentNode  = "Blood";
			LAi_SetActorType(characterFromID("car_convict6"));
			LAi_ActorDialogNow(characterFromID("car_convict6"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("car_convict6"));
		break;

		case "Pyle_to_wdeck21":
			Characters[GetCharacterIndex("Mutineer_23")].dialog.CurrentNode  = "doctors_face";
			LAi_SetActorType(characterFromID("Mutineer_23"));
			LAi_ActorDialogNow(characterFromID("Mutineer_23"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Mutineer_23"));
		break;

		case "Pyle_to_wdeck22":
			Characters[GetCharacterIndex("car_convict6")].dialog.CurrentNode  = "hidden_face";
			LAi_SetActorType(characterFromID("car_convict6"));
			LAi_ActorDialogNow(characterFromID("car_convict6"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("car_convict6"));
		break;

		case "Pyle_to_wdeck23":
			LAi_SetActorType(characterFromID("Mutineer_19"));
			LAi_ActorTurnToCharacter(characterFromID("Mutineer_19"), characterFromID("Pell"));
			LAi_SetActorType(characterFromID("Caesar"));
			LAi_ActorTurnToCharacter(characterFromID("Caesar"), characterFromID("Pell"));

			Characters[GetCharacterIndex("Pell")].dialog.CurrentNode  = "kill_prisoners";
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorDialogNow(characterFromID("Pell"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Pell"));
		break;

		case "Pyle_to_wdeck23A":
			PlaySound("AMBIENT\cheer.wav");
			
			LAi_QuestDelay("Pyle_to_wdeck24", 4.5);
		break;

		case "Pyle_to_wdeck24":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "Pyle_to_wdeck24";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Pyle_to_wdeck25":
			Characters[GetCharacterIndex("car_convict6")].dialog.CurrentNode  = "no_water";
			LAi_SetActorType(characterFromID("car_convict6"));
			LAi_ActorDialogNow(characterFromID("car_convict6"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("car_convict6"));
		break;

		case "Pyle_to_wdeck26":
			Characters[GetCharacterIndex("Mutineer_32")].dialog.CurrentNode  = "Isla_Mona";
			LAi_SetActorType(characterFromID("Mutineer_32"));
			LAi_ActorDialogNow(characterFromID("Mutineer_32"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Mutineer_32"));
		break;

		case "Pyle_to_wdeck27":
			LAi_QuestDelay("Pchar_ooh", 0.01);

			DeleteAttribute(Pchar,"ship");
			GiveShip2Character(pchar,"Corvette2","Den svenske islandsfararen",-1,PIRATE,true,true);
			SetCharacterShipLocation(Pchar, "IslaMona_port");

			Pchar.nation = PERSONAL_NATION;
			Pchar.Flags.Personal = 3;
			Pchar.Flags.Personal.texture = 4;

			Island_SetReloadEnableLocal("Redmond", "reload_1", true);	//to wr_port
			Locations[FindLocation("wr_port")].models.always.locators = "QCport_l_JRHsea";

			LAi_QuestDelay("Pyle_to_wdeck28", 2.0);
		break;

		case "Pyle_to_wdeck28":
			setCharacterShipLocation(characterFromID("KR_indian_4"), "IslaMona_port");	//boat at corvette
			setCharacterShipLocation(characterFromID("KR_indian_5"), "IslaMona_port");	//boat near shore
			setCharacterShipLocation(characterFromID("KR_indian_6"), "IslaMona_port");	//barrel in shore boat, left
			setCharacterShipLocation(characterFromID("Louis_Arot"), "IslaMona_port");	//barrel in shore boat, right
			setCharacterShipLocation(characterFromID("Trafvenfeldt"), "IslaMona_port");	//barrel in shore boat, sea
			setCharacterShipLocation(characterFromID("KR_cit1"), "IslaMona_port");		//barrel in shore boat, land
			setCharacterShipLocation(characterFromID("KR_cit2"), "IslaMona_port");		//barrel in corv boat

			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "Pyle_to_wdeck28";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Pyle_to_wdeck29":
			PlaySound("OBJECTS\DUEL\pistol_out1original.wav");
			RemoveCharacterEquip(characterFromID("Mutineer_2"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_5"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("Mutineer_2"), "pistolmketB");
			TakeItemFromCharacter(characterFromID("Mutineer_5"), "pistolmketB");

			LAi_QuestDelay("Pyle_to_wdeck29A", 1.0);
		break;

		case "Pyle_to_wdeck29A":
			PlaySound("PEOPLE\clothes1.wav");
			SetModel(characterFromID("Mutineer_2"), "prison_3", "man", "man", 1.8, false);
			SetModel(characterFromID("Mutineer_5"), "Emilio2", "man", "man", 1.8, false);

			LAi_QuestDelay("Pyle_to_wdeck30", 1.0);
		break;

		case "Pyle_to_wdeck30":
			PlaySound("OBJECTS\DUEL\pistol_out1original.wav");
			RemoveCharacterEquip(characterFromID("Mutineer_4"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_16"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_8"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("Mutineer_4"), "pistolmketB");
			TakeItemFromCharacter(characterFromID("Mutineer_16"), "pistolmketB");
			TakeItemFromCharacter(characterFromID("Mutineer_8"), "pistolmketB");

			LAi_QuestDelay("Pyle_to_wdeck30A", 1.0);
		break;

		case "Pyle_to_wdeck30A":
			PlaySound("PEOPLE\clothes1.wav");
			SetModel(characterFromID("Mutineer_4"), "Buccaneer1", "man", "man", 1.8, false);
			SetModel(characterFromID("Mutineer_16"), "prison_4", "man", "man", 1.8, false);
			SetModel(characterFromID("Mutineer_8"), "sailor7", "man", "man", 1.8, false);

			LAi_QuestDelay("Pyle_to_wdeck31", 1.0);
		break;

		case "Pyle_to_wdeck31":
			PlaySound("OBJECTS\DUEL\pistol_out1original.wav");
			RemoveCharacterEquip(characterFromID("Mutineer_10"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_3"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_15"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("Mutineer_10"), "pistolmketB");
			TakeItemFromCharacter(characterFromID("Mutineer_3"), "pistolmketB");
			TakeItemFromCharacter(characterFromID("Mutineer_15"), "pistolmketB");

			LAi_QuestDelay("Pyle_to_wdeck31A", 1.0);
		break;

		case "Pyle_to_wdeck31A":
			PlaySound("PEOPLE\clothes1.wav");
			SetModel(characterFromID("Mutineer_10"), "pirat12", "man", "man", 1.8, false);
			SetModel(characterFromID("Mutineer_3"), "Mansveldt", "man", "man", 1.8, false);
			SetModel(characterFromID("Mutineer_15"), "rabblack", "man", "man", 1.8, false);

			LAi_QuestDelay("Pyle_to_wdeck32", 2.0);
		break;

		case "Pyle_to_wdeck32":
			//Hands
			PlaySound("VOICE\ENGLISH\gr_Hands1.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Hands"));

			LAi_QuestDelay("Pyle_to_wdeck32A", 1.0);
		break;

		case "Pyle_to_wdeck32A":
			PlaySound("PEOPLE\clothes1.wav");
			SetModel(characterFromID("Hands"), "bb_Hands2", "man", "man", 1.8, false);
			
			LAi_QuestDelay("Pyle_to_wdeck33", 2.0);
		break;

		case "Pyle_to_wdeck33":
			//Pell
			PlaySound("VOICE\ENGLISH\Odel_fine.wav");
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Pell"));

			LAi_QuestDelay("Pyle_to_wdeck33A", 1.0);
		break;

		case "Pyle_to_wdeck33A":
			PlaySound("PEOPLE\clothes1.wav");
			SetModel(characterFromID("Pell"), "bb_Pell", "man", "man", 1.8, false);
			
			LAi_QuestDelay("Pyle_to_wdeck34", 2.0);
		break;

		case "Pyle_to_wdeck34":
			//QM
			PlaySound("VOICE\ENGLISH\Dupin_alright.wav");
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Mutineer_32"));

			LAi_QuestDelay("Pyle_to_wdeck34A", 1.0);
		break;

		case "Pyle_to_wdeck34A":
			PlaySound("OBJECTS\DUEL\pistol_out1original.wav");
			RemoveCharacterEquip(characterFromID("Mutineer_32"), GUN_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("Mutineer_32"), "pistolmketB");

			LAi_QuestDelay("Pyle_to_wdeck34B", 1.0);
		break;

		case "Pyle_to_wdeck34B":
			PlaySound("PEOPLE\clothes1.wav");
			SetModel(characterFromID("Mutineer_32"), "capJRMM", "man", "man", 1.8, false);

			RemoveCharacterEquip(characterFromID("Pell"), BLADE_ITEM_TYPE);
			GiveItem2Character(characterFromID("Pell"), "bladewhistle");
			EquipCharacterByItem(characterFromID("Pell"), "bladewhistle");

			RemoveCharacterEquip(characterFromID("car_convict3"), GUN_ITEM_TYPE);
			GiveItem2Character(characterFromID("car_convict3"), "pistolmketB");
			EquipCharacterByItem(characterFromID("car_convict3"), "pistolmketB");

			RemoveCharacterEquip(characterFromID("car_slave10"), GUN_ITEM_TYPE);
			GiveItem2Character(characterFromID("car_slave10"), "pistolmketB");
			EquipCharacterByItem(characterFromID("car_slave10"), "pistolmketB");

			RemoveCharacterEquip(characterFromID("car_slave27"), GUN_ITEM_TYPE);
			GiveItem2Character(characterFromID("car_slave27"), "pistolmketB");
			EquipCharacterByItem(characterFromID("car_slave27"), "pistolmketB");
			
			LAi_QuestDelay("Pyle_to_wdeck35", 2.0);
		break;

		case "Pyle_to_wdeck35":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "swedish_uniform";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Pyle_to_wdeck36":
			Characters[GetCharacterIndex("car_convict3")].dialog.CurrentNode  = "swedish_language";
			LAi_SetActorType(characterFromID("car_convict3"));
			LAi_ActorDialogNow(characterFromID("car_convict3"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("car_convict3"));
		break;

		case "Pyle_to_wdeck37":
			Characters[GetCharacterIndex("car_slave27")].dialog.CurrentNode  = "priest_spanish";
			LAi_SetActorType(characterFromID("car_slave27"));
			LAi_ActorDialogNow(characterFromID("car_slave27"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("car_slave27"));
		break;

		case "Pyle_to_wdeck38":
			LAi_QuestDelay("Pchar_lets_go", 1.0);
			LAi_QuestDelay("Pyle_to_wdeck39", 2.0);
		break;

		case "Pyle_to_wdeck39":
		//	SetCurrentTime(7, 0);	
			SetCurrentTime(12, 0);
			SetNextWeather("Clear");
			Pchar.quest.JRH_rain = "Clear";
			SetNextWind("E",30);
			Locations[FindLocation("IslaMona_port")].models.always.locators = "mayak_ls_JRH";
			ChangeCharacterAddressGroup(characterFromID("Pell"), "IslaMona_port", "quest", "water1");
			ChangeCharacterAddressGroup(characterFromID("car_convict3"), "IslaMona_port", "quest", "water2");
			ChangeCharacterAddressGroup(characterFromID("car_slave10"), "IslaMona_port", "quest", "water3");
			ChangeCharacterAddressGroup(characterFromID("Hands"), "IslaMona_port", "quest", "hands");
			Locations[FindLocation("IslaMona_port")].locators_radius.reload.boat = 0.001;
			Locations[FindLocation("IslaMona_port")].locators_radius.quest.water1 = 2.0;
			Locations[FindLocation("IslaMona_port_exit")].reload.l1.disable = 1;			//no more Kristiania

			DoQuestReloadToLocation("IslaMona_port", "quest", "pyle_low" ,"Pyle_to_Mona");
		break;

	//---------------------------------------------------------------------------------------------
//Mona start
		case "Pyle_to_Mona":
			SetModel(PChar, "Howard_Pyle_hat_a", Pchar.model.animation, PChar.sex, stf(PChar.model.height), true);
			GiveItem2Character(Pchar, "pistolbelt");
			EquipCharacterByItem(Pchar, "pistolbelt");
			GiveItem2Character(Pchar, "ammobag2");
			EquipCharacterByItem(Pchar, "ammobag2");
			GiveItem2Character(Pchar, "BB_hatA2");
			EquipCharacterByItem(Pchar, "BB_hatA2");

			LAi_SetPlayerType(pchar);
			LAi_SetStayType(characterFromID("Hands"));
			LAi_SetStayType(characterFromID("Pell"));
			LAi_SetStayType(characterFromID("car_convict3"));	
			LAi_SetStayType(characterFromID("car_slave10"));	
		
			Characters[GetCharacterIndex("Hands")].dialog.CurrentNode  = "neutral";
			Characters[GetCharacterIndex("Pell")].dialog.CurrentNode  = "neutral";
			Characters[GetCharacterIndex("car_convict3")].dialog.CurrentNode  = "neutral_Gunnar";
			Characters[GetCharacterIndex("car_slave10")].dialog.CurrentNode  = "neutral_soldier";
		
			pchar.quest.Pyle_to_Mona1.win_condition.l1 = "locator";
			pchar.quest.Pyle_to_Mona1.win_condition.l1.location = "IslaMona_port";
			pchar.quest.Pyle_to_Mona1.win_condition.l1.locator_group = "quest";
			pchar.quest.Pyle_to_Mona1.win_condition.l1.locator = "water1";
			pchar.quest.Pyle_to_Mona1.win_condition = "Pyle_to_Mona1";
		break;

		case "Pyle_to_Mona1":
			Characters[GetCharacterIndex("Pell")].dialog.CurrentNode  = "water_done";
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorDialogNow(characterFromID("Pell"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Pell"));
		break;

		case "Pyle_to_Mona2":
			//from Pell dialog

			Characters[GetCharacterIndex("Pell")].dialog.CurrentNode  = "neutral";
			LAi_SetStayType(pchar);
			LAi_SetPlayerType(characterFromID("Pell"));
			LAi_SetFightMode(characterFromID("Pell"), true);

			LAi_QuestDelay("Pyle_to_Mona3", 1.0);
		break;

		case "Pyle_to_Mona3":
			PlaySound("OBJECTS\SHIPCHARGE\whistle_call_mates.wav");
			Logit(LanguageConvertString(tmpLangFileID,"CALL MATES"));

			LAi_QuestDelay("Pyle_to_Mona4", 3.0);
		break;

		case "Pyle_to_Mona4":
			LAi_SetFightMode(characterFromID("Pell"), false);

			LAi_QuestDelay("Pyle_to_Mona5", 1.0);
		break;

		case "Pyle_to_Mona5":
			PlaySound("VOICE\ENGLISH\gm_crew16B.wav");

			LAi_QuestDelay("Pyle_to_Mona6", 2.5);
		break;

		case "Pyle_to_Mona6":
			LAi_SetFightMode(characterFromID("Pell"), true);

			LAi_QuestDelay("Pyle_to_Mona7", 1.0);
		break;

		case "Pyle_to_Mona7":
			PlaySound("OBJECTS\SHIPCHARGE\whistle_away_boat.wav");
			Logit(LanguageConvertString(tmpLangFileID,"AWAY BOAT"));

			LAi_QuestDelay("Pyle_to_Mona8", 5.5);
		break;

		case "Pyle_to_Mona8":
			LAi_SetFightMode(characterFromID("Pell"), false);
			SetModel(characterFromID("car_slave27"), "gm_crew21", "man", "man", 1.8, false);
			ChangeCharacterAddressGroup(characterFromID("car_slave27"), "IslaMona_port", "goto", "goto14");
			LAi_SetActorType(characterFromID("car_slave27"));
			LAi_ActorRunToLocator(characterFromID("car_slave27"), "quest", "music", "Pyle_to_Mona9", 18.0);	//21 was from reload6

			Characters[GetCharacterIndex("Hands")].dialog.CurrentNode  = "fiddler_returning";
			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorDialogNow(characterFromID("Hands"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hands"));
		break;
	
		case "Pyle_to_Mona9":
			ChangeCharacterAddressGroup(characterFromID("car_slave27"), "IslaMona_port", "quest", "music");
			PlaySound("INTERFACE\violin.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Pell"));
		
			LAi_QuestDelay("Pyle_to_Mona10", 1.0);	
		break;
	
		case "Pyle_to_Mona10":
			Characters[GetCharacterIndex("Pell")].dialog.CurrentNode  = "violin_found";
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorDialogNow(characterFromID("Pell"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Pell"));
		break;

		case "Pyle_to_Mona11":
			LAi_QuestDelay("Pyle_to_Mona11_A", 0.2);	//selfdialog doesn't behave ok if started direct from another dialog
		break;

		case "Pyle_to_Mona11_A":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "violin_free";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Pyle_to_Mona12":
			PlaySound("INTERFACE\violin.wav");
			
			LAi_QuestDelay("Pyle_to_Mona12_A", 0.25);
		break;

		case "Pyle_to_Mona12_A":
			PlaySound("INTERFACE\violin.wav");
			SetModel(characterFromID("car_slave27"), "maroon4", "man", "man", 1.8, false);

			LAi_QuestDelay("Pyle_to_Mona13", 1.0);
		break;
	
		case "Pyle_to_Mona13":
			RemoveCharacterEquip(characterFromID("car_slave11"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("car_slave11"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("car_slave11"), "items");

			ChangeCharacterAddressGroup(characterFromID("car_slave11"), "IslaMona_port", "quest", "priest");
			ChangeCharacterAddressGroup(characterFromID("Sergio"), "IslaMona_port", "quest", "soldier");
			LAi_SetActorType(characterFromID("car_slave11"));
			LAi_ActorRunToLocator(characterFromID("car_slave11"), "quest", "priest2", "Pyle_to_Mona13_A", 15.0);	
			LAi_ActorRunToLocator(characterFromID("Sergio"), "quest", "soldier2", "Pyle_to_Mona13_B", 17.0);

			Characters[GetCharacterIndex("Hands")].dialog.CurrentNode  = "priest_returning";
			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorDialogNow(characterFromID("Hands"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hands"));
		break;

		case "Pyle_to_Mona14":
			//from Hands dialog

			SetLocatorRadius(locations[FindLocation(Pchar.location)], "quest", "between", 2.0);
			Locations[FindLocation("IslaMona_port")].locators_radius.quest.between = 2.0;

			pchar.quest.Pyle_to_Mona15.win_condition.l1 = "locator";
			pchar.quest.Pyle_to_Mona15.win_condition.l1.location = "IslaMona_port";
			pchar.quest.Pyle_to_Mona15.win_condition.l1.locator_group = "quest";
			pchar.quest.Pyle_to_Mona15.win_condition.l1.locator = "between";		//was priest2
			pchar.quest.Pyle_to_Mona15.win_condition = "Pyle_to_Mona15";

			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorTurnToCharacter(characterFromID("Pell"), characterFromID("car_slave11"));
			LAi_SetActorType(characterFromID("car_convict3"));
			LAi_ActorTurnToCharacter(characterFromID("car_convict3"), characterFromID("car_slave11"));
			LAi_SetActorType(characterFromID("car_slave10"));
			LAi_ActorTurnToCharacter(characterFromID("car_slave10"), characterFromID("car_slave11"));
			LAi_SetActorType(characterFromID("car_slave27"));
			LAi_ActorTurnToCharacter(characterFromID("car_slave27"), characterFromID("car_slave11"));
			
			PlaySound("OBJECTS\DUEL\pistol_out1original.wav");
		break;

		case "Pyle_to_Mona13_A":
			ChangeCharacterAddressGroup(characterFromID("car_slave11"), "IslaMona_port", "quest", "priest2");
			LAi_SetStayType(characterFromID("car_slave11"));
			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorTurnToCharacter(characterFromID("Hands"), characterFromID("car_slave11"));
			LAi_SetPlayerType(Pchar);

			LAi_SetStayType(characterFromID("Pell"));
			LAi_SetStayType(characterFromID("car_convict3"));	
			LAi_SetStayType(characterFromID("car_slave10"));
			LAi_SetStayType(characterFromID("car_slave27"));
		break;

		case "Pyle_to_Mona13_B":
			ChangeCharacterAddressGroup(characterFromID("Sergio"), "IslaMona_port", "quest", "soldier2");
			LAi_SetStayType(characterFromID("Sergio"));
			LAi_SetStayType(characterFromID("Hands"));
		break;

		case "Pyle_to_Mona15":
			ChangeCharacterAddressGroup(Pchar, "IslaMona_port", "quest", "pyle2");
			LAi_SetStayType(Pchar);

			Characters[GetCharacterIndex("car_slave11")].dialog.CurrentNode  = "soldier_volunteer";
			LAi_SetActorType(characterFromID("car_slave11"));
			LAi_ActorDialogNow(characterFromID("car_slave11"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("car_slave11"));
		break;

		case "Pyle_to_Mona16":
			Characters[GetCharacterIndex("Sergio")].dialog.CurrentNode  = "italian";
			LAi_SetActorType(characterFromID("Sergio"));
			LAi_ActorDialogNow(characterFromID("Sergio"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("Sergio"));
		break;

		case "Pyle_to_Mona17":
			Characters[GetCharacterIndex("car_slave11")].dialog.CurrentNode  = "switch_outfits";
			LAi_SetActorType(characterFromID("car_slave11"));
			LAi_ActorDialogNow(characterFromID("car_slave11"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("car_slave11"));
		break;

		case "Pyle_to_Mona18":
			ChangeCharacterAddressGroup(Pchar, "IslaMona_port", "quest", "pyle2");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("Pyle_to_Mona18_A", 1.0);
		break;

		case "Pyle_to_Mona18_A":
			//Sergio removes his musket

			PlaySound("OBJECTS\DUEL\pistol_out1original.wav");
			RemoveCharacterEquip(characterFromID("Sergio"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Sergio"), BLADE_ITEM_TYPE);
			TakeItemFromCharacter(characterFromID("Sergio"), "pistolmketB");
			TakeItemFromCharacter(characterFromID("Sergio"), "blade_MKnife");
			
			LAi_QuestDelay("Pyle_to_Mona19", 1.0);
		break;

		case "Pyle_to_Mona19":
			//Sergio removes uniform

			PlaySound("PEOPLE\clothes1.wav");
			SetModel(characterFromID("Sergio"), "Blazepira4M_WL", "man", "man", 1.8, false);

			LAi_QuestDelay("Pyle_to_Mona20", 2.0);
		break;

		case "Pyle_to_Mona20":
			//monk removes his red costume

			PlaySound("PEOPLE\clothes1.wav");
			SetModel(characterFromID("car_slave11"), "rabblack_1", "man", "man", 1.8, false);

			LAi_QuestDelay("Pyle_to_Mona21", 2.0);
		break;

		case "Pyle_to_Mona21":
			//Sergio as red monk

			PlaySound("PEOPLE\clothes1.wav");
			SetModel(characterFromID("Sergio"), "Animists1", "man", "man", 1.8, false);

			LAi_QuestDelay("Pyle_to_Mona22", 2.0);
		break;

		case "Pyle_to_Mona22":
			//monk equips musket

			PlaySound("OBJECTS\DUEL\pistol_out1original.wav");
			GiveItem2Character(characterFromID("car_slave11"), "blade_mKnife");
			GiveItem2Character(characterFromID("car_slave11"), "pistolmket");
			EquipCharacterByItem(characterFromID("car_slave11"), "blade_mKnife");
			EquipCharacterByItem(characterFromID("car_slave11"), "pistolmket");

			LAi_QuestDelay("Pyle_to_Mona23", 2.0);
		break;
	
		case "Pyle_to_Mona23":
			ChangeCharacterAddressGroup(characterFromID("Walter"), "IslaMona_port", "goto", "goto1");
			ChangeCharacterAddressGroup(characterFromID("Hilphershausen"), "IslaMona_port", "goto", "goto5");
			ChangeCharacterAddressGroup(characterFromID("Kri_grenadier"), "IslaMona_port", "goto", "goto11");
			ChangeCharacterAddressGroup(characterFromID("Kri_soldier_13"), "IslaMona_port", "goto", "goto11");
			ChangeCharacterAddressGroup(characterFromID("Kri_soldier_14"), "IslaMona_port", "goto", "goto11");
			LAi_SetOfficerType(characterFromID("Walter"));
			LAi_SetOfficerType(characterFromID("Hilphershausen"));
			LAi_SetOfficerType(characterFromID("Kri_grenadier"));
			LAi_SetOfficerType(characterFromID("Kri_soldier_13"));
			LAi_SetOfficerType(characterFromID("Kri_soldier_14"));
			GiveItem2Character(characterFromID("Hilphershausen"),"pistol3");		//was 5
			EquipCharacterByItem(characterFromID("Hilphershausen"), "pistol3");
			Characters[GetCharacterIndex("Kri_grenadier")].dialog.CurrentNode  = "grenadier";

			LAi_QuestDelay("Pyle_to_Mona24", 14.0);	//swedes running time
		
			Characters[GetCharacterIndex("Pell")].dialog.CurrentNode  = "swedes_arriving";
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorDialogNow(characterFromID("Pell"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Pell"));
		break;

		case "Pyle_to_Mona24":
			LAi_SetActorType(characterFromID("Pell"));
			LAi_ActorTurnToCharacter(characterFromID("Pell"), Pchar);
			LAi_SetActorType(characterFromID("car_convict3"));
			LAi_ActorTurnToCharacter(characterFromID("car_convict3"), Pchar);
			LAi_SetActorType(characterFromID("car_slave10"));
			LAi_ActorTurnToCharacter(characterFromID("car_slave10"), Pchar);
			LAi_SetActorType(characterFromID("car_slave27"));
			LAi_ActorTurnToCharacter(characterFromID("car_slave27"), Pchar);

			LAi_SetStayType(characterFromID("Walter"));
			LAi_SetStayType(characterFromID("Hilphershausen"));

			LAi_QuestDelay("Pyle_to_Mona25", 2.0);
		break;

		case "Pyle_to_Mona25":
			LAi_SetStayType(characterFromID("Kri_grenadier"));
			LAi_SetStayType(characterFromID("Kri_soldier_13"));
			LAi_SetStayType(characterFromID("Kri_soldier_14"));	
	
			Characters[GetCharacterIndex("Hilphershausen")].dialog.CurrentNode  = "captain_where";
			LAi_SetActorType(characterFromID("Hilphershausen"));
			LAi_ActorDialogNow(characterFromID("Hilphershausen"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hilphershausen"));
		break;
	
		case "Pyle_to_Mona26":
			Characters[GetCharacterIndex("Walter")].dialog.CurrentNode  = "commanders_here";
			LAi_SetActorType(characterFromID("Walter"));
			LAi_ActorDialogNow(characterFromID("Walter"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Walter"));
		break;
	
		case "Pyle_to_Mona27":
			Characters[GetCharacterIndex("Hilphershausen")].dialog.CurrentNode  = "recognize_Pyle";
			LAi_SetActorType(characterFromID("Hilphershausen"));
			LAi_ActorDialogNow(characterFromID("Hilphershausen"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hilphershausen"));
		break;

		case "Pyle_to_Mona28":
			if(CheckAttribute(Pchar,"talked_to_Walter") && Pchar.talked_to_Walter == "yes")
			{
				Characters[GetCharacterIndex("Walter")].dialog.CurrentNode  = "talked_to_in_port";
			}
			else
			{
				Characters[GetCharacterIndex("Walter")].dialog.CurrentNode  = "seen_in_port";
			}
			LAi_SetActorType(characterFromID("Walter"));
			LAi_ActorDialogNow(characterFromID("Walter"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Walter"));
		break;

		case "Pyle_to_Mona29":
			Characters[GetCharacterIndex("Hilphershausen")].dialog.CurrentNode  = "translate_please";
			LAi_SetActorType(characterFromID("Hilphershausen"));
			LAi_ActorDialogNow(characterFromID("Hilphershausen"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hilphershausen"));
		break;

		case "Pyle_to_Mona30":
			LAi_SetActorType(pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("car_convict3"));

			LAi_QuestDelay("Pyle_to_Mona30_A", 1.0);
		break;

		case "Pyle_to_Mona30_A":
			LAi_SetOfficerType(characterFromID("car_convict3"));
			LAi_QuestDelay("Pyle_to_Mona32", 4.0);

			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "hey_gunnar";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Pyle_to_Mona31":
			Pchar.pyle_ready = "yes";

			LAi_QuestDelay("Pyle_to_Mona33", 0.1);
		break;

		case "Pyle_to_Mona32":
			Pchar.gunnar_close = "yes";

			LAi_QuestDelay("Pyle_to_Mona33", 0.1);
		break;

		case "Pyle_to_Mona33":
			if(CheckAttribute(Pchar,"pyle_ready") && Pchar.pyle_ready == "yes")
			{
				if(CheckAttribute(Pchar,"gunnar_close") && Pchar.gunnar_close == "yes")
				{
					Pchar.pyle_ready = "over";
					Pchar.gunnar_close = "over";
					//gunnar dialog here ev as blaze selfdialog

					Characters[GetCharacterIndex("car_convict3")].dialog.CurrentNode  = "french_ship_name";
					LAi_SetActorType(characterFromID("car_convict3"));
					LAi_ActorDialogNow(characterFromID("car_convict3"), pchar, "", 0.1);
					LAi_ActorWaitDialog(Pchar, characterFromID("car_convict3"));
				}
			}
		break;

		case "Pyle_to_Mona34":
			Characters[GetCharacterIndex("Walter")].dialog.CurrentNode  = "gatenhielm";
			LAi_SetActorType(characterFromID("Walter"));
			LAi_ActorDialogNow(characterFromID("Walter"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Walter"));
		break;

		case "Pyle_to_Mona35":
			LAi_ActorTurnToLocator(characterFromID("Walter"), "officers", "reload3_2");
			LAi_ActorTurnToLocator(characterFromID("Hilphershausen"), "officers", "reload3_2");

			PlaySound("AMBIENT\JAIL\sigh.wav");
			PlaySound("AMBIENT\JAIL\sigh.wav");
		
			LAi_QuestDelay("Pyle_to_Mona36", 2.5);
		break;

		case "Pyle_to_Mona36":
			Characters[GetCharacterIndex("car_convict3")].dialog.CurrentNode  = "privateer";
			LAi_SetActorType(characterFromID("car_convict3"));
			LAi_ActorDialogNow(characterFromID("car_convict3"), pchar, "", 0.1);
			LAi_ActorWaitDialog(Pchar, characterFromID("car_convict3"));
		break;

		case "Pyle_to_Mona37":
			LAi_SetActorType(characterFromID("Walter"));
			LAi_ActorTurnToCharacter(characterFromID("Walter"), Pchar);

			Characters[GetCharacterIndex("Hilphershausen")].dialog.CurrentNode  = "foul_smell";
			LAi_SetActorType(characterFromID("Hilphershausen"));
			LAi_ActorDialogNow(characterFromID("Hilphershausen"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hilphershausen"));
		break;

		case "Pyle_to_Mona38":
			Characters[GetCharacterIndex("Walter")].dialog.CurrentNode  = "no_slaver";
			LAi_SetActorType(characterFromID("Walter"));
			LAi_ActorDialogNow(characterFromID("Walter"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Walter"));
		break;

		case "Pyle_to_Mona39":
			Characters[GetCharacterIndex("Hilphershausen")].dialog.CurrentNode  = "stolen_uniform";
			LAi_SetActorType(characterFromID("Hilphershausen"));
			LAi_ActorDialogNow(characterFromID("Hilphershausen"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hilphershausen"));
		break;

		case "Pyle_to_Mona39_A":
			LAi_SetActorType(characterFromID("Walter"));
			LAi_ActorTurnToCharacter(characterFromID("Walter"), characterFromID("car_slave10"));
			LAi_SetActorType(characterFromID("Hilphershausen"));
			LAi_ActorTurnToCharacter(characterFromID("Hilphershausen"), characterFromID("car_slave10"));

			Characters[GetCharacterIndex("car_slave10")].dialog.CurrentNode  = "worthless_uniform";
			LAi_SetActorType(characterFromID("car_slave10"));
			LAi_ActorDialogNow(characterFromID("car_slave10"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("car_slave10"));
		break;

		case "Pyle_to_Mona39_AA":
			PlaySound("VOICE\ENGLISH\Dut_m_a_008.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Hilphershausen"));

			LAi_QuestDelay("Pyle_to_Mona39_B", 3.5);
		break;

		case "Pyle_to_Mona39_B":
			LAi_SetActorType(characterFromID("Walter"));
			LAi_ActorTurnToCharacter(characterFromID("Walter"), Pchar);
			LAi_SetActorType(characterFromID("Hilphershausen"));
			LAi_ActorTurnToCharacter(characterFromID("Hilphershausen"), Pchar);

			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "took_the_ship";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Pyle_to_Mona39_C":
			Characters[GetCharacterIndex("Hilphershausen")].dialog.CurrentNode  = "which_nation";
			LAi_SetActorType(characterFromID("Hilphershausen"));
			LAi_ActorDialogNow(characterFromID("Hilphershausen"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hilphershausen"));
		break;

		case "Pyle_to_Mona40":
			PlaySound("VOICE\ENGLISH\Dut_m_a_023.wav");

			LAi_QuestDelay("Pyle_to_Mona41", 4.0);	
		break;

		case "Pyle_to_Mona41":
			PlaySound("VOICE\ENGLISH\Mateus Santos1.wav");

			LAi_QuestDelay("Pyle_to_Mona42", 3.0);	
		break;

		case "Pyle_to_Mona42":
			Characters[GetCharacterIndex("Walter")].dialog.CurrentNode  = "LOM";
			LAi_SetActorType(characterFromID("Walter"));
			LAi_ActorDialogNow(characterFromID("Walter"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Walter"));
		break;

		case "Pyle_to_Mona43":
			LAi_ActorTurnToCharacter(Pchar, characterFromID("car_slave11"));
			LAi_SetActorType(characterFromID("car_slave27"));
			LAi_ActorTurnToLocator(characterFromID("car_slave27"), "quest", "water2");

			LAi_QuestDelay("Pyle_to_Mona44", 1.0);
		break;

		case "Pyle_to_Mona44":
			PlaySound("VOICE\ENGLISH\Mateus Santos3.wav");
			
			LAi_QuestDelay("Pyle_to_Mona45", 3.0);	
		break;

		case "Pyle_to_Mona45":
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Hands"));
			LAi_SetActorType(characterFromID("Hands"));
			LAi_ActorTurnToCharacter(characterFromID("Hands"), Pchar);

			LAi_QuestDelay("Pyle_to_Mona46", 1.0);
		break;

		case "Pyle_to_Mona46":
			PlaySound("VOICE\ENGLISH\gr_Hands1.wav");

			LAi_QuestDelay("Pyle_to_Mona47", 1.0);
		break;

		case "Pyle_to_Mona47":
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Sergio"));

			LAi_QuestDelay("Pyle_to_Mona48", 1.0);
		break;

		case "Pyle_to_Mona48":
			PlaySound("VOICE\ENGLISH\Ita_m_a_001.wav");

			LAi_QuestDelay("Pyle_to_Mona49", 1.5);
		break;

		case "Pyle_to_Mona49":
			LAi_ActorTurnToCharacter(Pchar, characterFromID("car_convict3"));
			LAi_ActorTurnToCharacter(characterFromID("car_convict3"), Pchar);

			LAi_QuestDelay("Pyle_to_Mona50", 1.0);
		break;

		case "Pyle_to_Mona50":
			PlaySound("VOICE\ENGLISH\gm_crew1C.wav");

			LAi_QuestDelay("Pyle_to_Mona51", 1.0);
		break;

		case "Pyle_to_Mona51":
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Pell"));

			LAi_QuestDelay("Pyle_to_Mona52", 0.5);
		break;

		case "Pyle_to_Mona52":
			PlaySound("OBJECTS\SHIPCHARGE\gunner_warning.wav");

			LAi_QuestDelay("Pyle_to_Mona53", 1.5);
		break;

		case "Pyle_to_Mona53":
			PlaySound("VOICE\ENGLISH\Odel_fine.wav");
			PlaySound("VOICE\ENGLISH\Odel_fine.wav");

			LAi_QuestDelay("Pyle_to_Mona54", 1.0);
		break;

		case "Pyle_to_Mona54":
			LAi_ActorTurnToCharacter(Pchar, characterFromID("car_slave10"));

			LAi_QuestDelay("Pyle_to_Mona55", 0.5);
		break;

		case "Pyle_to_Mona55":
			PlaySound("VOICE\ENGLISH\Poe_go_on.wav");
			PlaySound("VOICE\ENGLISH\Poe_go_on.wav");

			LAi_QuestDelay("Pyle_to_Mona56", 1.0);
		break;

		case "Pyle_to_Mona56":
			LAi_ActorTurnToCharacter(Pchar, characterFromID("car_slave27"));

			LAi_QuestDelay("Pyle_to_Mona57", 0.5);
		break;

		case "Pyle_to_Mona57":
			SetModel(characterFromID("car_slave27"), "gm_crew21", "man", "man", 1.8, false);
			PlaySound("INTERFACE\violin.wav");

			LAi_QuestDelay("Pyle_to_Mona58", 1.0);
			LAi_QuestDelay("Pchar_ooh", 1.0);
		break;

		case "Pyle_to_Mona58":
			SetModel(characterFromID("car_slave27"), "maroon4", "man", "man", 1.8, false);

			LAi_QuestDelay("Pyle_to_Mona59", 2.0);
		break;

		case "Pyle_to_Mona59":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "agree_LOM";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Pyle_to_Mona60":
			PlaySound("VOICE\ENGLISH\Dut_m_a_030.wav");
			LAi_SetActorType(pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Hilphershausen"));

			LAi_QuestDelay("Pyle_to_Mona61", 1.5);		//was 2.5
		break;

		case "Pyle_to_Mona61":
			PlaySound("AMBIENT\cheer2.wav");

			LAi_QuestDelay("Pyle_to_Mona62", 4.5);
		break;

		case "Pyle_to_Mona62":
			Characters[GetCharacterIndex("Hilphershausen")].dialog.CurrentNode  = "one_detail";
			LAi_SetActorType(characterFromID("Hilphershausen"));
			LAi_ActorDialogNow(characterFromID("Hilphershausen"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hilphershausen"));
		break;

		case "Pyle_to_Mona63":
			Characters[GetCharacterIndex("Walter")].dialog.CurrentNode  = "grenadier";
			LAi_SetActorType(characterFromID("Walter"));
			LAi_ActorDialogNow(characterFromID("Walter"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Walter"));
		break;
	
		case "Pyle_to_Mona64":
			Characters[GetCharacterIndex("Kri_grenadier")].dialog.CurrentNode  = "grenadier_hello";
			LAi_SetActorType(characterFromID("Kri_grenadier"));
			LAi_ActorDialogNow(characterFromID("Kri_grenadier"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Kri_grenadier"));
		break;
	
		case "Pyle_to_Mona65":
			LAi_SetStayType(characterFromID("Kri_grenadier"));
			
			LAi_SetActorType(characterFromID("Walter"));
			LAi_ActorTurnToCharacter(characterFromID("Walter"), characterFromID("Hilphershausen"));

			Characters[GetCharacterIndex("Walter")].dialog.CurrentNode  = "got_document";
			LAi_SetActorType(characterFromID("Walter"));
			LAi_ActorDialogNow(characterFromID("Walter"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Walter"));
		break;
	
		case "Pyle_to_Mona66":
			PlaySound("AMBIENT\RESIDENCE\some1.wav");
			PlaySound("AMBIENT\RESIDENCE\some1.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Hilphershausen"));

			LAi_QuestDelay("Pyle_to_Mona67", 5.0);
		break;
		
		case "Pyle_to_Mona67":
			Characters[GetCharacterIndex("Hilphershausen")].dialog.CurrentNode  = "give_document";
			LAi_SetActorType(characterFromID("Hilphershausen"));
			LAi_ActorDialogNow(characterFromID("Hilphershausen"), pchar, "", 0.01);
			LAi_ActorWaitDialog(Pchar, characterFromID("Hilphershausen"));
		break;

		case "Pyle_to_Mona68":
			PlaySound("VOICE\ENGLISH\jrh_3.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Walter"));

			LAi_QuestDelay("Pyle_to_Mona69", 2.5);
		break;

		case "Pyle_to_Mona69":
			LAi_ActorTurnToLocator(characterFromID("Walter"), "officers", "reload3_2");

			LAi_QuestDelay("Pyle_to_Mona70", 1.0);
		break;

		case "Pyle_to_Mona70":
			PlaySound("VOICE\ENGLISH\Dut_m_a_005.wav");
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Hilphershausen"));

			LAi_QuestDelay("Pyle_to_Mona71", 2.0);
		break;

		case "Pyle_to_Mona71":
			LAi_ActorTurnToLocator(characterFromID("Hilphershausen"), "officers", "reload3_2");

			LAi_QuestDelay("Pyle_to_Mona72", 1.0);
		break;

		case "Pyle_to_Mona72":
			LAi_ActorGoToLocator(characterFromID("Walter"), "reload", "reload1", "Pyle_to_Mona73", 35.0);
			LAi_ActorGoToLocator(characterFromID("Hilphershausen"), "reload", "reload1", "Pyle_to_Mona73", "");

			LAi_QuestDelay("Pyle_to_Mona74", 4.0);
			LAi_QuestDelay("Pyle_to_Mona76", 16.0);	//was 12
		break;

		case "Pyle_to_Mona73":
			ChangeCharacterAddressGroup(characterFromID("Walter"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("Hilphershausen"), "none", "", "");
		break;

		case "Pyle_to_Mona74":
			LAi_SetActorType(characterFromID("Kri_soldier_13"));
			LAi_SetActorType(characterFromID("Kri_soldier_14"));
			LAi_ActorGoToLocator(characterFromID("Kri_soldier_13"), "reload", "reload1", "Pyle_to_Mona75", 31.0);
			LAi_ActorGoToLocator(characterFromID("Kri_soldier_14"), "reload", "reload1", "Pyle_to_Mona73", "");
		break;

		case "Pyle_to_Mona75":
			ChangeCharacterAddressGroup(characterFromID("Kri_soldier_13"), "none", "", "");
			ChangeCharacterAddressGroup(characterFromID("Kri_soldier_14"), "none", "", "");
		break;

		case "Pyle_to_Mona76":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "puh_and_puh_again";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Pyle_to_Mona76_A":
			LAi_SetActorType(Pchar);
			LAi_ActorTurnToCharacter(Pchar, characterFromID("Hands"));

			LAi_QuestDelay("Pyle_to_Mona77", 1.0);
		break;

		case "Pyle_to_Mona77":
			LAi_SetActorType(pchar);	
			characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "sail_home";
			LAi_ActorSelfDialog(pchar, "");
		break;

		case "Pyle_to_Mona78":
			PlaySound("OBJECTS\SHIPCHARGE\hurrah.wav");

			ChangeCharacterAddressGroup(characterFromID("Kri_grenadier"), "IslaMona_port", "quest", "grenadier");

			LAi_SetPlayerType(Pchar);
			SetLocatorRadius(locations[FindLocation("IslaMona_port")], "reload", "boat", 10.0);	//was 12
			Locations[FindLocation("IslaMona_port")].locators_radius.reload.boat = 10.0;

			LAi_SetStayType(characterFromID("Hands"));
			LAi_SetStayType(characterFromID("Pell"));
			LAi_SetStayType(characterFromID("Sergio"));
			LAi_SetStayType(characterFromID("car_slave10"));
			LAi_SetStayType(characterFromID("car_slave11"));
			LAi_SetStayType(characterFromID("car_slave27"));
			LAi_SetStayType(characterFromID("car_convict3"));

			Characters[GetCharacterIndex("Hands")].dialog.CurrentNode  = "neutral";
			Characters[GetCharacterIndex("Pell")].dialog.CurrentNode  = "neutral";
			Characters[GetCharacterIndex("Sergio")].dialog.CurrentNode  = "neutral_Sergio";
			Characters[GetCharacterIndex("car_convict3")].dialog.CurrentNode  = "neutral_Gunnar";
			Characters[GetCharacterIndex("car_slave10")].dialog.CurrentNode  = "neutral_soldier";
			Characters[GetCharacterIndex("car_slave11")].dialog.CurrentNode  = "neutral_priest";
			Characters[GetCharacterIndex("car_slave27")].dialog.CurrentNode  = "neutral_musician";

			Pchar.nation = ENGLAND;

			LAi_QuestDelay("return_farm_items_Mona", 0.1);	//ready for alchemy part 2
		break;
	


















	//--------------------------------------------------------------------------------------------------------------
	
		case "boat3_m15_arriveA":
			ChangeCharacterAddressGroup(characterFromID("mutineer_15"), "BB_careen_corvette_end", "goto", "arrive3A");
			RemoveCharacterEquip(characterFromID("Mutineer_15"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_15"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_15"), "items");
			GiveItem2Character(characterFromID("Mutineer_15"), "bladeX4");
			GiveItem2Character(characterFromID("Mutineer_15"), "pistolmketB");
			EquipCharacterByItem(characterFromID("Mutineer_15"), "bladeX4");
			EquipCharacterByItem(characterFromID("Mutineer_15"), "pistolmketB");
		
			LAi_QuestDelay("boat3_m15_arriveB", 2.0);
		break;

		case "boat3_m15_arriveB":
			PlaySound("PEOPLE\step_wood1.wav");
			ChangeCharacterAddressGroup(characterFromID("mutineer_15"), "BB_careen_corvette_end", "goto", "arrive3B");

			LAi_QuestDelay("boat3_m15_arriveC", 1.0);
		break;

		case "boat3_m15_arriveC":
			PlaySound("PEOPLE\Jump_Wood.wav");
			LAi_SetSitType(characterFromID("mutineer_15"));
			ChangeCharacterAddressGroup(characterFromID("mutineer_15"), "BB_careen_corvette_end", "goto", "arrive3C");

			LAi_QuestDelay("boat3_m15_arriveD", 0.25);
		break;

		case "boat3_m15_arriveD":
			LAi_SetStayType(characterFromID("mutineer_15"));

			LAi_QuestDelay("boat3_m15_arriveE", 1.0);
		break;

		case "boat3_m15_arriveE":
			PlaySound("PEOPLE\recoil.wav");
			ChangeCharacterAddressGroup(characterFromID("mutineer_15"), "BB_careen_corvette_end", "goto", "arrive3D");
		break;
	    //---------------------------------
		case "boat3_pell_arriveA":
			ChangeCharacterAddressGroup(characterFromID("Pell"), "BB_careen_corvette_end", "goto", "arrive3A");

			RemoveCharacterEquip(characterFromID("Pell"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Pell"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Pell"), "items");
			GiveItem2Character(characterFromID("Pell"), "blade3");
			EquipCharacterByItem(characterFromID("Pell"), "blade3");
			GiveItem2Character(characterFromID("Pell"), "Pistol5");
			EquipCharacterByItem(characterFromID("Pell"), "Pistol5");
			TakenItems(characterFromID("Pell"), "pistolbullets", 2);
			TakenItems(characterFromID("Pell"), "gunpowder", 2);

			LAi_QuestDelay("boat3_pell_arriveB", 2.0);
		break;

		case "boat3_pell_arriveB":
			PlaySound("PEOPLE\step_wood1.wav");
			ChangeCharacterAddressGroup(characterFromID("Pell"), "BB_careen_corvette_end", "goto", "arrive3B");

			LAi_QuestDelay("boat3_pell_arriveC", 1.0);
		break;

		case "boat3_pell_arriveC":
			PlaySound("PEOPLE\Jump_Wood.wav");
			ChangeCharacterAddressGroup(characterFromID("Pell"), "BB_careen_corvette_end", "goto", "arrive3C");
		break;

	//--------------------------------------------------------------------------------------------------------------
	
		case "boat4_m3_arriveA":
			ChangeCharacterAddressGroup(characterFromID("mutineer_3"), "BB_careen_corvette_end", "goto", "arrive4A");
			RemoveCharacterEquip(characterFromID("Mutineer_3"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_3"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_3"), "items");
			GiveItem2Character(characterFromID("Mutineer_3"), "bladeX4");
			GiveItem2Character(characterFromID("Mutineer_3"), "pistolmketB");
			EquipCharacterByItem(characterFromID("Mutineer_3"), "bladeX4");
			EquipCharacterByItem(characterFromID("Mutineer_3"), "pistolmketB");
		
			LAi_QuestDelay("boat4_m3_arriveB", 2.0);
		break;

		case "boat4_m3_arriveB":
			PlaySound("PEOPLE\step_wood1.wav");
			ChangeCharacterAddressGroup(characterFromID("mutineer_3"), "BB_careen_corvette_end", "goto", "arrive4B");

			LAi_QuestDelay("boat4_m3_arriveC", 1.0);
		break;

		case "boat4_m3_arriveC":
			PlaySound("PEOPLE\Jump_Wood.wav");
			LAi_SetSitType(characterFromID("mutineer_3"));
			ChangeCharacterAddressGroup(characterFromID("mutineer_3"), "BB_careen_corvette_end", "goto", "arrive4C");

			LAi_QuestDelay("boat4_m3_arriveD", 0.25);
		break;

		case "boat4_m3_arriveD":
			LAi_SetStayType(characterFromID("mutineer_3"));
			
			LAi_QuestDelay("boat4_m3_arriveE", 1.0);
		break;

		case "boat4_m3_arriveE":
			PlaySound("PEOPLE\recoil.wav");
			ChangeCharacterAddressGroup(characterFromID("mutineer_3"), "BB_careen_corvette_end", "goto", "arrive4D");
		break;

	    //---------------------------------
		case "boat4_hands_arriveA":
			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_careen_corvette_end", "goto", "arrive4A");

			RemoveCharacterEquip(characterFromID("Hands"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Hands"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Hands"), "items");
			GiveItem2Character(characterFromID("Hands"), "blade2");
			EquipCharacterByItem(characterFromID("Hands"), "blade2");
			GiveItem2Character(characterFromID("Hands"), "pistol6");
			EquipCharacterByItem(characterFromID("Hands"), "pistol6");
			TakenItems(characterFromID("Hands"), "pistolbullets", 2);
			TakenItems(characterFromID("Hands"), "gunpowder", 2);

			LAi_QuestDelay("boat4_hands_arriveB", 2.0);
		break;

		case "boat4_hands_arriveB":
			PlaySound("PEOPLE\step_wood1.wav");
			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_careen_corvette_end", "goto", "arrive4B");

			LAi_QuestDelay("boat4_hands_arriveC", 1.0);
		break;

		case "boat4_hands_arriveC":
			PlaySound("PEOPLE\Jump_Wood.wav");
			ChangeCharacterAddressGroup(characterFromID("Hands"), "BB_careen_corvette_end", "goto", "arrive4C");

			LAi_QuestDelay("Pyle_to_wdeck7", 1.0);
		break;

	//--------------------------------------------------------------------------------------------------------------

		case "boat2_m32_arriveA":
			ChangeCharacterAddressGroup(characterFromID("mutineer_32"), "BB_careen_corvette_end", "goto", "arrive2A");

			RemoveCharacterEquip(characterFromID("Mutineer_32"), GUN_ITEM_TYPE);
			RemoveCharacterEquip(characterFromID("Mutineer_32"), BLADE_ITEM_TYPE);
			DeleteAttribute(characterFromID("Mutineer_32"), "items");
			GiveItem2Character(characterFromID("Mutineer_32"), "bladeX4");
			GiveItem2Character(characterFromID("Mutineer_32"), "pistolmketB");
			EquipCharacterByItem(characterFromID("Mutineer_32"), "bladeX4");
			EquipCharacterByItem(characterFromID("Mutineer_32"), "pistolmketB");

			LAi_QuestDelay("boat2_m32_arriveB", 2.0);
		break;

		case "boat2_m32_arriveB":
			PlaySound("PEOPLE\step_wood1.wav");
			ChangeCharacterAddressGroup(characterFromID("mutineer_32"), "BB_careen_corvette_end", "goto", "arrive2B");

			LAi_QuestDelay("boat2_m32_arriveC", 1.0);
		break;

		case "boat2_m32_arriveC":
			PlaySound("PEOPLE\Jump_Wood.wav");
			LAi_SetSitType(characterFromID("mutineer_32"));
			ChangeCharacterAddressGroup(characterFromID("mutineer_32"), "BB_careen_corvette_end", "goto", "arrive2C");

			LAi_QuestDelay("boat2_m32_arriveD", 0.25);
		break;

		case "boat2_m32_arriveD":
			LAi_SetStayType(characterFromID("mutineer_32"));
			
			LAi_QuestDelay("boat2_m32_arriveE", 1.0);
		break;

		case "boat2_m32_arriveE":
			PlaySound("PEOPLE\recoil.wav");
			ChangeCharacterAddressGroup(characterFromID("mutineer_32"), "BB_careen_corvette_end", "goto", "arrive2D");
		break;
	    //---------------------------------
		case "boat2_m23_arriveA":
			ChangeCharacterAddressGroup(characterFromID("mutineer_23"), "BB_careen_corvette_end", "goto", "arrive2A");

			EquipCharacterByItem(characterFromID("Mutineer_23"), "blade1");
			EquipCharacterByItem(characterFromID("Mutineer_23"), "PiratesPistol");
			TakenItems(characterFromID("Mutineer_23"), "pistolbullets", 2);
			TakenItems(characterFromID("Mutineer_23"), "gunpowder", 2);

			LAi_QuestDelay("boat2_m23_arriveB", 2.0);
		break;

		case "boat2_m23_arriveB":	
			PlaySound("PEOPLE\step_wood1.wav");
			ChangeCharacterAddressGroup(characterFromID("mutineer_23"), "BB_careen_corvette_end", "goto", "arrive2B");

			LAi_QuestDelay("boat2_m23_arriveC", 1.0);
		break;

		case "boat2_m23_arriveC":
			PlaySound("PEOPLE\Jump_Wood.wav");
			ChangeCharacterAddressGroup(characterFromID("mutineer_23"), "BB_careen_corvette_end", "goto", "arrive2C");
		break;
	//--------------------------------------------------------------------------------------------------------------
		case "careen_wdeck":
			//maybe a switch for more cases later here

			if(CheckAttribute(Pchar,"careen_weatherdeck") && Pchar.careen_weatherdeck == "too_soon")
			{
				LAi_SetStayType(Pchar);

				LAi_QuestDelay("Pchar_ohoh", 0.001);
				LAi_QuestDelay("careen_wdeck_no_return", 2.0);		//was 3 sec
			}
			else
			{





			}
		break;

		case "careen_wdeck_no_return":
			if(pchar.location == "BB_careen_corvette")
			{
				LAi_SetPlayerType(Pchar);
				PlaySound("VOICE\ENGLISH\alarm1.wav");

				SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload1", 0.0001);
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload2", 0.0001);
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload3", 0.0001);
			}
			else 
			{
				LAi_SetPlayerType(Pchar);

				LAi_QuestDelay("Pchar_puh", 0.001);

				pchar.quest.careen_wdeck.win_condition.l1 = "location";
				pchar.quest.careen_wdeck.win_condition.l1.location = "BB_careen_corvette";
				pchar.quest.careen_wdeck.win_condition = "careen_wdeck";
			}
		break;
	//..........................................................................................
		case "careen_deck1_sleeping":
			if(Pchar.location == "BB_careen_deck1")
			{ 
				if(CheckAttribute(Pchar,"careen_deck1_snoring") && Pchar.careen_deck1_snoring == "finished") return;
							
				int hammock_sailor_sleeping = rand(12);
				switch (hammock_sailor_sleeping)
				{
					case 0: PlaySound("PEOPLE\snoring.wav"); break;
					case 1: PlaySound("PEOPLE\snoring2.wav"); break;
					case 2: PlaySound("PEOPLE\fart1.wav"); break;
					case 3: PlaySound("PEOPLE\yawn.wav"); break;
					case 4: PlaySound("AMBIENT\TAVERN\man2.wav"); break;
					case 5: PlaySound("AMBIENT\JAIL\sigh.wav"); break;
					case 6: PlaySound("AMBIENT\JAIL\sigh2.wav"); break;
					case 7: PlaySound("AMBIENT\TAVERN\man1.wav"); break;
					case 8: PlaySound("PEOPLE\snoring.wav"); break;
					case 9: PlaySound("PEOPLE\snoring2.wav"); break;
					case 10: PlaySound("PEOPLE\yawn.wav"); break;
					case 11: PlaySound("PEOPLE\snoring.wav"); break;
					case 12: PlaySound("PEOPLE\snoring2.wav"); break;
				}

				LAi_QuestDelay("careen_deck1_sleeping", 3.5);
			}
			else
			{
				pchar.quest.careen_deck1_sleeping.win_condition.l1 = "location";
				pchar.quest.careen_deck1_sleeping.win_condition.l1.location = "BB_careen_deck1";
				pchar.quest.careen_deck1_sleeping.win_condition = "careen_deck1_sleeping";
			}
		break;
	//..........................................................................................
		case "deck1_checkpoints":
			LAi_QuestDelay("careen_deck1_sleeping", 1.0);

		//left side
			pchar.quest.alm19.win_condition.l1 = "locator";
			pchar.quest.alm19.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm19.win_condition.l1.locator_group = "goto";
			pchar.quest.alm19.win_condition.l1.locator = "alm19";
			pchar.quest.alm19.win_condition = "alm19";

			pchar.quest.alm20.win_condition.l1 = "locator";
			pchar.quest.alm20.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm20.win_condition.l1.locator_group = "goto";
			pchar.quest.alm20.win_condition.l1.locator = "alm20";
			pchar.quest.alm20.win_condition = "alm20";

			pchar.quest.alm21.win_condition.l1 = "locator";
			pchar.quest.alm21.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm21.win_condition.l1.locator_group = "goto";
			pchar.quest.alm21.win_condition.l1.locator = "alm21";
			pchar.quest.alm21.win_condition = "alm21";

			pchar.quest.alm22.win_condition.l1 = "locator";
			pchar.quest.alm22.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm22.win_condition.l1.locator_group = "goto";
			pchar.quest.alm22.win_condition.l1.locator = "alm22";
			pchar.quest.alm22.win_condition = "alm22";

			pchar.quest.alm23.win_condition.l1 = "locator";
			pchar.quest.alm23.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm23.win_condition.l1.locator_group = "goto";
			pchar.quest.alm23.win_condition.l1.locator = "alm23";
			pchar.quest.alm23.win_condition = "alm23";

			pchar.quest.alm24.win_condition.l1 = "locator";
			pchar.quest.alm24.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm24.win_condition.l1.locator_group = "goto";
			pchar.quest.alm24.win_condition.l1.locator = "alm24";
			pchar.quest.alm24.win_condition = "alm24";

			pchar.quest.alm25.win_condition.l1 = "locator";
			pchar.quest.alm25.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm25.win_condition.l1.locator_group = "goto";
			pchar.quest.alm25.win_condition.l1.locator = "alm25";
			pchar.quest.alm25.win_condition = "alm25";

			pchar.quest.alm26.win_condition.l1 = "locator";
			pchar.quest.alm26.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm26.win_condition.l1.locator_group = "goto";
			pchar.quest.alm26.win_condition.l1.locator = "alm26";
			pchar.quest.alm26.win_condition = "alm26";

			pchar.quest.alm27.win_condition.l1 = "locator";
			pchar.quest.alm27.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm27.win_condition.l1.locator_group = "goto";
			pchar.quest.alm27.win_condition.l1.locator = "alm27";
			pchar.quest.alm27.win_condition = "alm27";

			pchar.quest.alm28.win_condition.l1 = "locator";
			pchar.quest.alm28.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm28.win_condition.l1.locator_group = "goto";
			pchar.quest.alm28.win_condition.l1.locator = "alm28";
			pchar.quest.alm28.win_condition = "alm28";

			pchar.quest.alm29.win_condition.l1 = "locator";
			pchar.quest.alm29.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm29.win_condition.l1.locator_group = "goto";
			pchar.quest.alm29.win_condition.l1.locator = "alm29";
			pchar.quest.alm29.win_condition = "alm29";

			pchar.quest.alm30.win_condition.l1 = "locator";
			pchar.quest.alm30.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm30.win_condition.l1.locator_group = "goto";
			pchar.quest.alm30.win_condition.l1.locator = "alm30";
			pchar.quest.alm30.win_condition = "alm30";
		//--------------------------------------------------------------------
		//right side
			pchar.quest.alm31.win_condition.l1 = "locator";
			pchar.quest.alm31.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm31.win_condition.l1.locator_group = "goto";
			pchar.quest.alm31.win_condition.l1.locator = "alm31";
			pchar.quest.alm31.win_condition = "alm31";

			pchar.quest.alm32.win_condition.l1 = "locator";
			pchar.quest.alm32.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm32.win_condition.l1.locator_group = "goto";
			pchar.quest.alm32.win_condition.l1.locator = "alm32";
			pchar.quest.alm32.win_condition = "alm32";

			pchar.quest.alm33.win_condition.l1 = "locator";
			pchar.quest.alm33.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm33.win_condition.l1.locator_group = "goto";
			pchar.quest.alm33.win_condition.l1.locator = "alm33";
			pchar.quest.alm33.win_condition = "alm33";

			pchar.quest.alm34.win_condition.l1 = "locator";
			pchar.quest.alm34.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm34.win_condition.l1.locator_group = "goto";
			pchar.quest.alm34.win_condition.l1.locator = "alm34";
			pchar.quest.alm34.win_condition = "alm34";

			pchar.quest.alm35.win_condition.l1 = "locator";
			pchar.quest.alm35.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm35.win_condition.l1.locator_group = "goto";
			pchar.quest.alm35.win_condition.l1.locator = "alm35";
			pchar.quest.alm35.win_condition = "alm35";

			pchar.quest.alm36.win_condition.l1 = "locator";
			pchar.quest.alm36.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm36.win_condition.l1.locator_group = "goto";
			pchar.quest.alm36.win_condition.l1.locator = "alm36";
			pchar.quest.alm36.win_condition = "alm36";

			pchar.quest.alm37.win_condition.l1 = "locator";
			pchar.quest.alm37.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm37.win_condition.l1.locator_group = "goto";
			pchar.quest.alm37.win_condition.l1.locator = "alm37";
			pchar.quest.alm37.win_condition = "alm37";

			pchar.quest.alm38.win_condition.l1 = "locator";
			pchar.quest.alm38.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm38.win_condition.l1.locator_group = "goto";
			pchar.quest.alm38.win_condition.l1.locator = "alm38";
			pchar.quest.alm38.win_condition = "alm38";

			pchar.quest.alm39.win_condition.l1 = "locator";
			pchar.quest.alm39.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm39.win_condition.l1.locator_group = "goto";
			pchar.quest.alm39.win_condition.l1.locator = "alm39";
			pchar.quest.alm39.win_condition = "alm39";

			pchar.quest.alm40.win_condition.l1 = "locator";
			pchar.quest.alm40.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm40.win_condition.l1.locator_group = "goto";
			pchar.quest.alm40.win_condition.l1.locator = "alm40";
			pchar.quest.alm40.win_condition = "alm40";

			pchar.quest.alm41.win_condition.l1 = "locator";
			pchar.quest.alm41.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm41.win_condition.l1.locator_group = "goto";
			pchar.quest.alm41.win_condition.l1.locator = "alm41";
			pchar.quest.alm41.win_condition = "alm41";

			pchar.quest.alm42.win_condition.l1 = "locator";
			pchar.quest.alm42.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm42.win_condition.l1.locator_group = "goto";
			pchar.quest.alm42.win_condition.l1.locator = "alm42";
			pchar.quest.alm42.win_condition = "alm42";

			pchar.quest.alm44.win_condition.l1 = "locator";
			pchar.quest.alm44.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm44.win_condition.l1.locator_group = "goto";
			pchar.quest.alm44.win_condition.l1.locator = "alm44";
			pchar.quest.alm44.win_condition = "alm44";

			pchar.quest.alm45.win_condition.l1 = "locator";
			pchar.quest.alm45.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm45.win_condition.l1.locator_group = "goto";
			pchar.quest.alm45.win_condition.l1.locator = "alm45";
			pchar.quest.alm45.win_condition = "alm45";

			pchar.quest.alm46.win_condition.l1 = "locator";
			pchar.quest.alm46.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm46.win_condition.l1.locator_group = "goto";
			pchar.quest.alm46.win_condition.l1.locator = "alm46";
			pchar.quest.alm46.win_condition = "alm46";
		break;
	//..........................................................................................
	//left side
		case "alm19":
			PauseAllSounds();//stops music
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload5", 0.001);
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm19_1", 5.0);
		break;

		case "alm19_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm19_1");
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload5", 1.0);

			pchar.quest.alm19.win_condition.l1 = "locator";
			pchar.quest.alm19.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm19.win_condition.l1.locator_group = "goto";
			pchar.quest.alm19.win_condition.l1.locator = "alm19";
			pchar.quest.alm19.win_condition = "alm19";
		break;

		case "alm20":
			PauseAllSounds();//stops music
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload1", 0.001);
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm20_1", 5.0);
		break;

		case "alm20_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm20_1");
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload1", 1.0);

			pchar.quest.alm20.win_condition.l1 = "locator";
			pchar.quest.alm20.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm20.win_condition.l1.locator_group = "goto";
			pchar.quest.alm20.win_condition.l1.locator = "alm20";
			pchar.quest.alm20.win_condition = "alm20";
		break;

		case "alm21":
			PauseAllSounds();//stops music
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm21_1", 5.0);
		break;

		case "alm21_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm21_1");

			pchar.quest.alm21.win_condition.l1 = "locator";
			pchar.quest.alm21.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm21.win_condition.l1.locator_group = "goto";
			pchar.quest.alm21.win_condition.l1.locator = "alm21";
			pchar.quest.alm21.win_condition = "alm21";
		break;

		case "alm22":
			PauseAllSounds();//stops music
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm22_1", 5.0);
		break;

		case "alm22_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm22_1");

			pchar.quest.alm22.win_condition.l1 = "locator";
			pchar.quest.alm22.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm22.win_condition.l1.locator_group = "goto";
			pchar.quest.alm22.win_condition.l1.locator = "alm22";
			pchar.quest.alm22.win_condition = "alm22";
		break;

		case "alm23":
			PauseAllSounds();//stops music
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm23_1", 5.0);
		break;

		case "alm23_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm23_1");

			pchar.quest.alm23.win_condition.l1 = "locator";
			pchar.quest.alm23.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm23.win_condition.l1.locator_group = "goto";
			pchar.quest.alm23.win_condition.l1.locator = "alm23";
			pchar.quest.alm23.win_condition = "alm23";
		break;

		case "alm24":
			PauseAllSounds();//stops music
			LAi_SetStayType(Pchar);
			
			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm24_1", 5.0);
		break;

		case "alm24_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm24_1");

			pchar.quest.alm24.win_condition.l1 = "locator";
			pchar.quest.alm24.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm24.win_condition.l1.locator_group = "goto";
			pchar.quest.alm24.win_condition.l1.locator = "alm24";
			pchar.quest.alm24.win_condition = "alm24";
		break;

		case "alm25":
			PauseAllSounds();//stops music
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm25_1", 5.0);
		break;

		case "alm25_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm25_1");

			pchar.quest.alm25.win_condition.l1 = "locator";
			pchar.quest.alm25.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm25.win_condition.l1.locator_group = "goto";
			pchar.quest.alm25.win_condition.l1.locator = "alm25";
			pchar.quest.alm25.win_condition = "alm25";
		break;

		case "alm26":
			PauseAllSounds();//stops music
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload1", 0.001);
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm26_1", 5.0);
		break;

		case "alm26_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm26_1");
			SetLocatorRadius(locations[FindLocation(Pchar.location)], "reload", "reload1", 1.0);

			pchar.quest.alm26.win_condition.l1 = "locator";
			pchar.quest.alm26.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm26.win_condition.l1.locator_group = "goto";
			pchar.quest.alm26.win_condition.l1.locator = "alm26";
			pchar.quest.alm26.win_condition = "alm26";
		break;

		case "alm27":
			PauseAllSounds();//stops music
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm27_1", 5.0);
		break;

		case "alm27_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm27_1");

			pchar.quest.alm27.win_condition.l1 = "locator";
			pchar.quest.alm27.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm27.win_condition.l1.locator_group = "goto";
			pchar.quest.alm27.win_condition.l1.locator = "alm27";
			pchar.quest.alm27.win_condition = "alm27";
		break;

		case "alm28":
			PauseAllSounds();//stops music
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm28_1", 5.0);
		break;

		case "alm28_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm28_1");

			pchar.quest.alm28.win_condition.l1 = "locator";
			pchar.quest.alm28.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm28.win_condition.l1.locator_group = "goto";
			pchar.quest.alm28.win_condition.l1.locator = "alm28";
			pchar.quest.alm28.win_condition = "alm28";
		break;

		case "alm29":
			PauseAllSounds();//stops music
			LAi_SetStayType(Pchar);
			
			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm29_1", 5.0);
		break;

		case "alm29_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm29_1");

			pchar.quest.alm29.win_condition.l1 = "locator";
			pchar.quest.alm29.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm29.win_condition.l1.locator_group = "goto";
			pchar.quest.alm29.win_condition.l1.locator = "alm29";
			pchar.quest.alm29.win_condition = "alm29";
		break;

		case "alm30":
			PauseAllSounds();//stops music
			LAi_SetStayType(Pchar);
			
			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm30_1", 5.0);
		break;

		case "alm30_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm30_1");

			pchar.quest.alm30.win_condition.l1 = "locator";
			pchar.quest.alm30.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm30.win_condition.l1.locator_group = "goto";
			pchar.quest.alm30.win_condition.l1.locator = "alm30";
			pchar.quest.alm30.win_condition = "alm30";
		break;
	//--------------------------------------------------------------------
	//right side
		case "alm31":
			PauseAllSounds();//stops music
			LAi_SetStayType(Pchar);
			
			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm31_1", 5.0);
		break;

		case "alm31_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm31_1");

			pchar.quest.alm31.win_condition.l1 = "locator";
			pchar.quest.alm31.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm31.win_condition.l1.locator_group = "goto";
			pchar.quest.alm31.win_condition.l1.locator = "alm31";
			pchar.quest.alm31.win_condition = "alm31";
		break;

		case "alm32":
			PauseAllSounds();//stops music
			LAi_SetStayType(Pchar);
			
			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm32_1", 5.0);
		break;

		case "alm32_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm32_1");

			pchar.quest.alm32.win_condition.l1 = "locator";
			pchar.quest.alm32.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm32.win_condition.l1.locator_group = "goto";
			pchar.quest.alm32.win_condition.l1.locator = "alm32";
			pchar.quest.alm32.win_condition = "alm32";
		break;

		case "alm33":
			PauseAllSounds();//stops music
			LAi_SetStayType(Pchar);
			
			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm33_1", 5.0);
		break;

		case "alm33_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm33_1");

			pchar.quest.alm33.win_condition.l1 = "locator";
			pchar.quest.alm33.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm33.win_condition.l1.locator_group = "goto";
			pchar.quest.alm33.win_condition.l1.locator = "alm33";
			pchar.quest.alm33.win_condition = "alm33";
		break;

		case "alm34":
			PauseAllSounds();//stops music
			LAi_SetStayType(Pchar);
			
			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm34_1", 5.0);
		break;

		case "alm34_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm34_1");

			pchar.quest.alm34.win_condition.l1 = "locator";
			pchar.quest.alm34.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm34.win_condition.l1.locator_group = "goto";
			pchar.quest.alm34.win_condition.l1.locator = "alm34";
			pchar.quest.alm34.win_condition = "alm34";
		break;

		case "alm35":
			PauseAllSounds();//stops music
			LAi_SetStayType(Pchar);
			
			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm35_1", 5.0);
		break;

		case "alm35_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm35_1");

			pchar.quest.alm35.win_condition.l1 = "locator";
			pchar.quest.alm35.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm35.win_condition.l1.locator_group = "goto";
			pchar.quest.alm35.win_condition.l1.locator = "alm35";
			pchar.quest.alm35.win_condition = "alm35";
		break;

		case "alm36":
			PauseAllSounds();//stops music
			LAi_SetStayType(Pchar);
			
			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm36_1", 5.0);
		break;

		case "alm36_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm36_1");

			pchar.quest.alm36.win_condition.l1 = "locator";
			pchar.quest.alm36.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm36.win_condition.l1.locator_group = "goto";
			pchar.quest.alm36.win_condition.l1.locator = "alm36";
			pchar.quest.alm36.win_condition = "alm36";
		break;

		case "alm37":
			PauseAllSounds();//stops music
			LAi_SetStayType(Pchar);
			
			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm37_1", 5.0);
		break;

		case "alm37_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm37_1");

			pchar.quest.alm37.win_condition.l1 = "locator";
			pchar.quest.alm37.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm37.win_condition.l1.locator_group = "goto";
			pchar.quest.alm37.win_condition.l1.locator = "alm37";
			pchar.quest.alm37.win_condition = "alm37";
		break;

		case "alm38":
			PauseAllSounds();//stops music
			LAi_SetStayType(Pchar);
			
			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm38_1", 5.0);
		break;

		case "alm38_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm38_1");

			pchar.quest.alm38.win_condition.l1 = "locator";
			pchar.quest.alm38.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm38.win_condition.l1.locator_group = "goto";
			pchar.quest.alm38.win_condition.l1.locator = "alm38";
			pchar.quest.alm38.win_condition = "alm38";
		break;

		case "alm39":
			PauseAllSounds();//stops music
			LAi_SetStayType(Pchar);
			
			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm39_1", 5.0);
		break;

		case "alm39_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm39_1");

			pchar.quest.alm39.win_condition.l1 = "locator";
			pchar.quest.alm39.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm39.win_condition.l1.locator_group = "goto";
			pchar.quest.alm39.win_condition.l1.locator = "alm39";
			pchar.quest.alm39.win_condition = "alm39";
		break;	

		case "alm40":
			PauseAllSounds();//stops music
			LAi_SetStayType(Pchar);
			
			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm40_1", 5.0);
		break;

		case "alm40_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm40_1");

			pchar.quest.alm40.win_condition.l1 = "locator";
			pchar.quest.alm40.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm40.win_condition.l1.locator_group = "goto";
			pchar.quest.alm40.win_condition.l1.locator = "alm40";
		break;

		case "alm41":
			PauseAllSounds();//stops music
			LAi_SetStayType(Pchar);
			
			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm41_1", 5.0);
		break;

		case "alm41_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm41_1");

			pchar.quest.alm41.win_condition.l1 = "locator";
			pchar.quest.alm41.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm41.win_condition.l1.locator_group = "goto";
			pchar.quest.alm41.win_condition.l1.locator = "alm41";
			pchar.quest.alm41.win_condition = "alm41";
		break;	

		case "alm42":
			PauseAllSounds();//stops music
			LAi_SetStayType(Pchar);
			
			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm42_1", 5.0);
		break;

		case "alm42_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm42_1");

			pchar.quest.alm42.win_condition.l1 = "locator";
			pchar.quest.alm42.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm42.win_condition.l1.locator_group = "goto";
			pchar.quest.alm42.win_condition.l1.locator = "alm42";
			pchar.quest.alm42.win_condition = "alm42";
		break;	

		case "alm44":
			PauseAllSounds();//stops music
			LAi_SetStayType(Pchar);
			
			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm44_1", 5.0);
		break;

		case "alm44_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm44_1");

			pchar.quest.alm44.win_condition.l1 = "locator";
			pchar.quest.alm44.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm44.win_condition.l1.locator_group = "goto";
			pchar.quest.alm44.win_condition.l1.locator = "alm44";
			pchar.quest.alm44.win_condition = "alm44";
		break;	

		case "alm45":
			PauseAllSounds();//stops music
			LAi_SetStayType(Pchar);
			
			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm45_1", 5.0);
		break;

		case "alm45_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm45_1");

			pchar.quest.alm45.win_condition.l1 = "locator";
			pchar.quest.alm45.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm45.win_condition.l1.locator_group = "goto";
			pchar.quest.alm45.win_condition.l1.locator = "alm45";
			pchar.quest.alm45.win_condition = "alm45";
		break;	
						
		case "alm46":
			PauseAllSounds();//stops music
			LAi_SetStayType(Pchar);
			
			LAi_QuestDelay("hammock_sailor_greeting", 0.01);
			LAi_QuestDelay("hammock_punch", 2.0);
			LAi_QuestDelay("alm46_1", 5.0);
		break;

		case "alm46_1":
			PostEvent("LoadSceneSound", 0);
			LAi_SetPlayerType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "BB_careen_deck1", "goto", "alm46_1");

			pchar.quest.alm46.win_condition.l1 = "locator";
			pchar.quest.alm46.win_condition.l1.location = "BB_careen_deck1";
			pchar.quest.alm46.win_condition.l1.locator_group = "goto";
			pchar.quest.alm46.win_condition.l1.locator = "alm46";
			pchar.quest.alm46.win_condition = "alm46";
		break;
	//--------------------------------------------------------------------
		case "hammock_sailor_greeting":
			int hammock_sailor_greeting = rand(10);
			switch (hammock_sailor_greeting)
			{
				case 0: PlaySound("VOICE\ENGLISH\Barbossa01.wav"); break;
				case 1: PlaySound("VOICE\ENGLISH\gm_crew5C.wav"); break;
				case 2: PlaySound("VOICE\ENGLISH\gr_Hgold3.wav"); break;
				case 3: PlaySound("VOICE\ENGLISH\gr_Richards.wav"); break;
				case 4: PlaySound("VOICE\ENGLISH\gr_WR_host6.wav"); break;
				case 5: PlaySound("VOICE\ENGLISH\Odel_what_you_want.wav"); break;
				case 6: PlaySound("VOICE\ENGLISH\Odel_who_you_are.wav"); break;
				case 7: PlaySound("VOICE\ENGLISH\pir_capCCC.wav"); break;
				case 8: PlaySound("VOICE\ENGLISH\pir_capFFF.wav"); break;
				case 9: PlaySound("VOICE\ENGLISH\pir_capGGG.wav"); break;
				case 10: PlaySound("OBJECTS\DUEL\man_attack5.wav"); break;
			}
		break;

		case "hammock_punch":
			PlaySound("OBJECTS\DUEL\punch2.wav");
			LAi_SetPoorType(Pchar);
			LAi_ApplyCharacterDamage(Pchar, 10);
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("stars_short" , u, v+1.0, w, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("Pchar_mule_kick", 1.0);
			LAi_QuestDelay("mule_kill_check", 1.0);
		break;
	//..........................................................................................
	
		case "holdP_checkpoints":
			LAi_QuestDelay("pitchfork_check", 0.1);

			pchar.quest.donkey1_L.win_condition.l1 = "locator";
			pchar.quest.donkey1_L.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.donkey1_L.win_condition.l1.locator_group = "goto";
			pchar.quest.donkey1_L.win_condition.l1.locator = "stay1_L";
			pchar.quest.donkey1_L.win_condition = "donkey1_L";

			pchar.quest.donkey1_R.win_condition.l1 = "locator";
			pchar.quest.donkey1_R.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.donkey1_R.win_condition.l1.locator_group = "goto";
			pchar.quest.donkey1_R.win_condition.l1.locator = "stay1_R";
			pchar.quest.donkey1_R.win_condition = "donkey1_R";

			pchar.quest.donkey2_L.win_condition.l1 = "locator";
			pchar.quest.donkey2_L.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.donkey2_L.win_condition.l1.locator_group = "goto";
			pchar.quest.donkey2_L.win_condition.l1.locator = "stay2_L";
			pchar.quest.donkey2_L.win_condition = "donkey2_L";

			pchar.quest.donkey2_R.win_condition.l1 = "locator";
			pchar.quest.donkey2_R.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.donkey2_R.win_condition.l1.locator_group = "goto";
			pchar.quest.donkey2_R.win_condition.l1.locator = "stay2_R";
			pchar.quest.donkey2_R.win_condition = "donkey2_R";

			pchar.quest.donkey3_L.win_condition.l1 = "locator";
			pchar.quest.donkey3_L.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.donkey3_L.win_condition.l1.locator_group = "goto";
			pchar.quest.donkey3_L.win_condition.l1.locator = "stay3_L";
			pchar.quest.donkey3_L.win_condition = "donkey3_L";

			pchar.quest.donkey3_R.win_condition.l1 = "locator";
			pchar.quest.donkey3_R.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.donkey3_R.win_condition.l1.locator_group = "goto";
			pchar.quest.donkey3_R.win_condition.l1.locator = "stay3_R";
			pchar.quest.donkey3_R.win_condition = "donkey3_R";

			pchar.quest.donkey4_L.win_condition.l1 = "locator";
			pchar.quest.donkey4_L.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.donkey4_L.win_condition.l1.locator_group = "goto";
			pchar.quest.donkey4_L.win_condition.l1.locator = "stay4_L";
			pchar.quest.donkey4_L.win_condition = "donkey4_L";

			pchar.quest.donkey4_R.win_condition.l1 = "locator";
			pchar.quest.donkey4_R.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.donkey4_R.win_condition.l1.locator_group = "goto";
			pchar.quest.donkey4_R.win_condition.l1.locator = "stay4_R";
			pchar.quest.donkey4_R.win_condition = "donkey4_R";

			pchar.quest.kick1.win_condition.l1 = "locator";
			pchar.quest.kick1.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.kick1.win_condition.l1.locator_group = "goto";
			pchar.quest.kick1.win_condition.l1.locator = "kick1";
			pchar.quest.kick1.win_condition = "kick1";

			pchar.quest.kick2.win_condition.l1 = "locator";
			pchar.quest.kick2.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.kick2.win_condition.l1.locator_group = "goto";
			pchar.quest.kick2.win_condition.l1.locator = "kick2";
			pchar.quest.kick2.win_condition = "kick2";

			pchar.quest.kick3.win_condition.l1 = "locator";
			pchar.quest.kick3.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.kick3.win_condition.l1.locator_group = "goto";
			pchar.quest.kick3.win_condition.l1.locator = "kick3";
			pchar.quest.kick3.win_condition = "kick3";

			pchar.quest.kick4.win_condition.l1 = "locator";
			pchar.quest.kick4.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.kick4.win_condition.l1.locator_group = "goto";
			pchar.quest.kick4.win_condition.l1.locator = "kick4";
			pchar.quest.kick4.win_condition = "kick4";
		break;

	//..........................................................................................
		case "donkey1_L":
			ChangeCharacterAddressGroup(Pchar, "BB_careen_holdP", "quest", "stay1_L");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("mule_close_sound", 0.001);
			LAi_QuestDelay("donkey1L_A", 0.5);
		break;

		case "donkey1L_A":
			LAi_SetPlayerType(Pchar);

			pchar.quest.donkey1_L.win_condition.l1 = "locator";
			pchar.quest.donkey1_L.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.donkey1_L.win_condition.l1.locator_group = "goto";
			pchar.quest.donkey1_L.win_condition.l1.locator = "stay1_L";
			pchar.quest.donkey1_L.win_condition = "donkey1_L";
		break;

		case "donkey1_R":
			ChangeCharacterAddressGroup(Pchar, "BB_careen_holdP", "quest", "stay1_R");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("mule_close_sound", 0.001);
			LAi_QuestDelay("donkey1R_A", 0.5);
		break;

		case "donkey1R_A":
			LAi_SetPlayerType(Pchar);

			pchar.quest.donkey1_R.win_condition.l1 = "locator";
			pchar.quest.donkey1_R.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.donkey1_R.win_condition.l1.locator_group = "goto";
			pchar.quest.donkey1_R.win_condition.l1.locator = "stay1_R";
			pchar.quest.donkey1_R.win_condition = "donkey1_R";
		break;
	//..........................................................................................
		case "donkey2_L":
			ChangeCharacterAddressGroup(Pchar, "BB_careen_holdP", "quest", "stay2_L");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("mule_close_sound", 0.001);
			LAi_QuestDelay("donkey2L_A", 0.5);
		break;

		case "donkey2L_A":
			LAi_SetPlayerType(Pchar);

			pchar.quest.donkey2_L.win_condition.l1 = "locator";
			pchar.quest.donkey2_L.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.donkey2_L.win_condition.l1.locator_group = "goto";
			pchar.quest.donkey2_L.win_condition.l1.locator = "stay2_L";
			pchar.quest.donkey2_L.win_condition = "donkey2_L";

		break;

		case "donkey2_R":
			ChangeCharacterAddressGroup(Pchar, "BB_careen_holdP", "quest", "stay2_R");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("mule_close_sound", 0.001);
			LAi_QuestDelay("donkey2R_A", 0.5);
		break;

		case "donkey2R_A":
			LAi_SetPlayerType(Pchar);

			pchar.quest.donkey2_R.win_condition.l1 = "locator";
			pchar.quest.donkey2_R.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.donkey2_R.win_condition.l1.locator_group = "goto";
			pchar.quest.donkey2_R.win_condition.l1.locator = "stay2_R";
			pchar.quest.donkey2_R.win_condition = "donkey2_R";
		break;
	//..........................................................................................
		case "donkey3_L":
			ChangeCharacterAddressGroup(Pchar, "BB_careen_holdP", "quest", "stay3_L");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("mule_close_sound", 0.001);
			LAi_QuestDelay("donkey3L_A", 0.5);
		break;

		case "donkey3L_A":
			LAi_SetPlayerType(Pchar);

			pchar.quest.donkey3_L.win_condition.l1 = "locator";
			pchar.quest.donkey3_L.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.donkey3_L.win_condition.l1.locator_group = "goto";
			pchar.quest.donkey3_L.win_condition.l1.locator = "stay3_L";
			pchar.quest.donkey3_L.win_condition = "donkey3_L";
		break;

		case "donkey3_R":
			ChangeCharacterAddressGroup(Pchar, "BB_careen_holdP", "quest", "stay3_R");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("mule_close_sound", 0.001);
			LAi_QuestDelay("donkey3R_A", 0.5);
		break;

		case "donkey3R_A":
			LAi_SetPlayerType(Pchar);

			pchar.quest.donkey3_R.win_condition.l1 = "locator";
			pchar.quest.donkey3_R.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.donkey3_R.win_condition.l1.locator_group = "goto";
			pchar.quest.donkey3_R.win_condition.l1.locator = "stay3_R";
			pchar.quest.donkey3_R.win_condition = "donkey3_R";
		break;
	//..........................................................................................
		case "donkey4_L":
			ChangeCharacterAddressGroup(Pchar, "BB_careen_holdP", "quest", "stay4_L");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("mule_close_sound", 0.001);
			LAi_QuestDelay("donkey4L_A", 0.5);
		break;

		case "donkey4L_A":
			LAi_SetPlayerType(Pchar);

			pchar.quest.donkey4_L.win_condition.l1 = "locator";
			pchar.quest.donkey4_L.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.donkey4_L.win_condition.l1.locator_group = "goto";
			pchar.quest.donkey4_L.win_condition.l1.locator = "stay4_L";
			pchar.quest.donkey4_L.win_condition = "donkey4_L";
		break;

		case "donkey4_R":
			ChangeCharacterAddressGroup(Pchar, "BB_careen_holdP", "quest", "stay4_R");
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("mule_close_sound", 0.001);
			LAi_QuestDelay("donkey4R_A", 0.5);
		break;

		case "donkey4R_A":
			LAi_SetPlayerType(Pchar);

			pchar.quest.donkey4_R.win_condition.l1 = "locator";
			pchar.quest.donkey4_R.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.donkey4_R.win_condition.l1.locator_group = "goto";
			pchar.quest.donkey4_R.win_condition.l1.locator = "stay4_R";
			pchar.quest.donkey4_R.win_condition = "donkey4_R";
		break;
	//..........................................................................................
		case "kick1":
			PlaySound("OBJECTS\DUEL\club1.wav");
			PlaySound("OBJECTS\DUEL\club1.wav");
			ChangeCharacterAddressGroup(Pchar, "BB_careen_holdP", "goto", "kick1_fall");
			LAi_SetPoorType(Pchar);
			LAi_ApplyCharacterDamage(Pchar, 15);
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("stars_short" , u, v+1.0, w, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("Pchar_mule_kick", 1.0);
			LAi_QuestDelay("mule_kill_check", 1.0);
			LAi_QuestDelay("mule_kick_sound", 2.0);
			LAi_QuestDelay("kick1_A", 3.0);
		break;

		case "kick1_A":
			LAi_SetPlayerType(Pchar);

			pchar.quest.kick1.win_condition.l1 = "locator";
			pchar.quest.kick1.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.kick1.win_condition.l1.locator_group = "goto";
			pchar.quest.kick1.win_condition.l1.locator = "kick1";
			pchar.quest.kick1.win_condition = "kick1";
		break;
		
		case "kick2":
			PlaySound("OBJECTS\DUEL\club1.wav");
			PlaySound("OBJECTS\DUEL\club1.wav");
			ChangeCharacterAddressGroup(Pchar, "BB_careen_holdP", "goto", "kick2_fall");
			LAi_SetPoorType(Pchar);
			LAi_ApplyCharacterDamage(Pchar, 15);
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("stars_short" , u, v+1.0, w, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("Pchar_mule_kick", 1.0);
			LAi_QuestDelay("mule_kill_check", 1.0);
			LAi_QuestDelay("mule_kick_sound", 2.0);
			LAi_QuestDelay("kick2_A", 3.0);
		break;

		case "kick2_A":
			LAi_SetPlayerType(Pchar);

			pchar.quest.kick2.win_condition.l1 = "locator";
			pchar.quest.kick2.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.kick2.win_condition.l1.locator_group = "goto";
			pchar.quest.kick2.win_condition.l1.locator = "kick2";
			pchar.quest.kick2.win_condition = "kick2";
		break;

		case "kick3":
			PlaySound("OBJECTS\DUEL\club1.wav");
			PlaySound("OBJECTS\DUEL\club1.wav");
			ChangeCharacterAddressGroup(Pchar, "BB_careen_holdP", "goto", "kick3_fall");
			LAi_SetPoorType(Pchar);
			LAi_ApplyCharacterDamage(Pchar, 15);
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("stars_short" , u, v+1.0, w, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("Pchar_mule_kick", 1.0);
			LAi_QuestDelay("mule_kill_check", 1.0);
			LAi_QuestDelay("mule_kick_sound", 2.0);
			LAi_QuestDelay("kick3_A", 3.0);
		break;

		case "kick3_A":
			LAi_SetPlayerType(Pchar);

			pchar.quest.kick3.win_condition.l1 = "locator";
			pchar.quest.kick3.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.kick3.win_condition.l1.locator_group = "goto";
			pchar.quest.kick3.win_condition.l1.locator = "kick3";
			pchar.quest.kick3.win_condition = "kick3";
		break;
		
		case "kick4":
			PlaySound("OBJECTS\DUEL\club1.wav");
			PlaySound("OBJECTS\DUEL\club1.wav");
			ChangeCharacterAddressGroup(Pchar, "BB_careen_holdP", "goto", "kick4_fall");
			LAi_SetPoorType(Pchar);
			LAi_ApplyCharacterDamage(Pchar, 15);
			GetCharacterPos(Pchar, &u, &v, &w);
			CreateParticleSystem("stars_short" , u, v+1.0, w, 0.0, 0.0, 0.0, sti(20) );

			LAi_QuestDelay("Pchar_mule_kick", 1.0);
			LAi_QuestDelay("mule_kill_check", 1.0);
			LAi_QuestDelay("mule_kick_sound", 2.0);
			LAi_QuestDelay("kick4_A", 3.0);
		break;

		case "kick4_A":
			LAi_SetPlayerType(Pchar);

			pchar.quest.kick4.win_condition.l1 = "locator";
			pchar.quest.kick4.win_condition.l1.location = "BB_careen_holdP";
			pchar.quest.kick4.win_condition.l1.locator_group = "goto";
			pchar.quest.kick4.win_condition.l1.locator = "kick4";
			pchar.quest.kick4.win_condition = "kick4";
		break;

		case "mule_kick_sound":
			int mule_kick_sound = rand(5);
			switch (mule_kick_sound)
			{
				case 0: PlaySound("INTERFACE\donkey1.wav"); break;
				case 1: PlaySound("INTERFACE\donkey1.wav"); break;
				case 2: PlaySound("INTERFACE\donkey1.wav"); break;
				case 3: PlaySound("INTERFACE\donkey2.wav"); break;
				case 4: PlaySound("INTERFACE\donkey2.wav"); break;
				case 5: PlaySound("INTERFACE\donkey4.wav"); break;
			}
		break;

		case "mule_close_sound":
			int mule_close_sound = rand(5);
			switch (mule_close_sound)
			{
				case 0: PlaySound("INTERFACE\donkey3.wav"); break;
				case 1: PlaySound("INTERFACE\donkey3.wav"); break;
				case 2: PlaySound("INTERFACE\donkey3.wav"); break;
				case 3: PlaySound("INTERFACE\donkey4.wav"); break;
				case 4: PlaySound("INTERFACE\donkey4.wav"); break;
				case 5: PlaySound("INTERFACE\donkey2.wav"); break;
			}
		break;

		case "mule_kill_check":
			Php = LAi_GetCharacterHP(Pchar);
			if(Php == 0) LAi_KillCharacter(Pchar);
		break;
	//..........................................................................................

		case "pitchfork_check":
			if(CheckCharacterItem(Pchar,"pitchfork"))
			{
				PlaySound("INTERFACE\wheel_take.wav");
				EquipCharacterByItem(pchar, "pitchfork");
				SetLocatorRadius(locations[FindLocation(Pchar.location)], "box", "box2", 0.001);
				Locations[FindLocation("BB_careen_holdP")].locators_radius.box.box2 = 0.001;

				pchar.quest.explore_corvette10.win_condition.l1 = "location";
				pchar.quest.explore_corvette10.win_condition.l1.location = "BB_careen_deck1";
				pchar.quest.explore_corvette10.win_condition = "explore_corvette10";
			}
			else LAi_QuestDelay("pitchfork_check", 0.5);
		break;

		case "use_pitchfork":
			PlaySound("PEOPLE\wood1.wav");

			LAi_QuestDelay("use_pitchfork1", 1.0);
		break;

		case "use_pitchfork1":
			DoQuickSave();			//before cabin fight
			LAi_LocationFightDisable(&Locations[FindLocation("BB_careen_shore")], true);
			if(LAi_IsFightMode(Pchar)) {LAi_SetFightMode(Pchar, false);}

			LAi_QuestDelay("use_pitchfork2", 1.0);
		break;

		case "use_pitchfork2":
			Locations[FindLocation("BB_careen_capsm")].models.always.l2 = "";				//no stopboom
			Locations[FindLocation("BB_careen_capsm")].models.always.locators = "capsm_l_careen_open";
			Locations[FindLocation("BB_careen_capsm")].image = "";
			DoQuestReloadToLocation("BB_careen_capsm", "reload", "reload2" ,"use_pitchfork3");
		break;

		case "use_pitchfork3":
			PlaySound("INTERFACE\shelf_open.wav");
			CreateParticleSystem("blast_dirt_small" , 0.0, 5.4, -2.6, 0.0, 0.0, 0.0, sti(20) );

			Locations[FindLocation("BB_careen_capsm")].image = "Deck_Capsm.tga";
		break;


		
//careen corvette end
	//.........................................................................................

		case "careen_back1":
			pchar.quest.careen_back1_A.win_condition.l1 = "locator";
			pchar.quest.careen_back1_A.win_condition.l1.location = "BB_careen_shore";
			pchar.quest.careen_back1_A.win_condition.l1.locator_group = "quest";
			pchar.quest.careen_back1_A.win_condition.l1.locator = "1";
			pchar.quest.careen_back1_A.win_condition = "careen_back1_A";
		break;

		case "careen_back1_A":
			ChangeCharacterAddressGroup(Pchar, "BB_careen_shore", "goto", "1_back");

			LAi_QuestDelay("careen_back1", 0.1);
		break;

		case "careen_back2":
			pchar.quest.careen_back2_A.win_condition.l1 = "locator";
			pchar.quest.careen_back2_A.win_condition.l1.location = "BB_careen_shore";
			pchar.quest.careen_back2_A.win_condition.l1.locator_group = "quest";
			pchar.quest.careen_back2_A.win_condition.l1.locator = "2";
			pchar.quest.careen_back2_A.win_condition = "careen_back2_A";
		break;

		case "careen_back2_A":
			ChangeCharacterAddressGroup(Pchar, "BB_careen_shore", "goto", "2_back");

			LAi_QuestDelay("careen_back2", 0.1);
		break;

		case "careen_back3":
			pchar.quest.careen_back3_A.win_condition.l1 = "locator";
			pchar.quest.careen_back3_A.win_condition.l1.location = "BB_careen_shore";
			pchar.quest.careen_back3_A.win_condition.l1.locator_group = "quest";
			pchar.quest.careen_back3_A.win_condition.l1.locator = "3";
			pchar.quest.careen_back3_A.win_condition = "careen_back3_A";
		break;

		case "careen_back3_A":
			ChangeCharacterAddressGroup(Pchar, "BB_careen_shore", "goto", "3_back");

			LAi_QuestDelay("careen_back3", 0.1);
		break;

		case "careen_back4":
			pchar.quest.careen_back4_A.win_condition.l1 = "locator";
			pchar.quest.careen_back4_A.win_condition.l1.location = "BB_careen_shore";
			pchar.quest.careen_back4_A.win_condition.l1.locator_group = "quest";
			pchar.quest.careen_back4_A.win_condition.l1.locator = "4";
			pchar.quest.careen_back4_A.win_condition = "careen_back4_A";
		break;

		case "careen_back4_A":
			ChangeCharacterAddressGroup(Pchar, "BB_careen_shore", "goto", "4_back");

			LAi_QuestDelay("careen_back4", 0.1);
		break;

		case "careen_back5":
			pchar.quest.careen_back5_A.win_condition.l1 = "locator";
			pchar.quest.careen_back5_A.win_condition.l1.location = "BB_careen_shore";
			pchar.quest.careen_back5_A.win_condition.l1.locator_group = "quest";
			pchar.quest.careen_back5_A.win_condition.l1.locator = "5";
			pchar.quest.careen_back5_A.win_condition = "careen_back5_A";
		break;

		case "careen_back5_A":
			ChangeCharacterAddressGroup(Pchar, "BB_careen_shore", "goto", "5_back");

			LAi_QuestDelay("careen_back5", 0.1);
		break;

		case "careen_back6":
			pchar.quest.careen_back6_A.win_condition.l1 = "locator";
			pchar.quest.careen_back6_A.win_condition.l1.location = "BB_careen_shore";
			pchar.quest.careen_back6_A.win_condition.l1.locator_group = "quest";
			pchar.quest.careen_back6_A.win_condition.l1.locator = "6";
			pchar.quest.careen_back6_A.win_condition = "careen_back6_A";
		break;

		case "careen_back6_A":
			ChangeCharacterAddressGroup(Pchar, "BB_careen_shore", "goto", "6_back");

			LAi_QuestDelay("careen_back6", 0.1);
		break;
	//...............................................................................................
		case "careen_back7":
			pchar.quest.careen_back7_A.win_condition.l1 = "locator";
			pchar.quest.careen_back7_A.win_condition.l1.location = "BB_careen_shore";
			pchar.quest.careen_back7_A.win_condition.l1.locator_group = "barmen";
			pchar.quest.careen_back7_A.win_condition.l1.locator = "7";
			pchar.quest.careen_back7_A.win_condition = "careen_back7_A";
		break;

		case "careen_back7_A":
			ChangeCharacterAddressGroup(Pchar, "BB_careen_shore", "goto", "7_back");

			LAi_QuestDelay("careen_back7", 0.1);
		break;

		case "careen_back8":
			pchar.quest.careen_back8_A.win_condition.l1 = "locator";
			pchar.quest.careen_back8_A.win_condition.l1.location = "BB_careen_shore";
			pchar.quest.careen_back8_A.win_condition.l1.locator_group = "barmen";
			pchar.quest.careen_back8_A.win_condition.l1.locator = "8";
			pchar.quest.careen_back8_A.win_condition = "careen_back8_A";
		break;

		case "careen_back8_A":
			ChangeCharacterAddressGroup(Pchar, "BB_careen_shore", "goto", "8_back");

			LAi_QuestDelay("careen_back8", 0.1);
		break;

		case "careen_back9":
			pchar.quest.careen_back9_A.win_condition.l1 = "locator";
			pchar.quest.careen_back9_A.win_condition.l1.location = "BB_careen_shore";
			pchar.quest.careen_back9_A.win_condition.l1.locator_group = "barmen";
			pchar.quest.careen_back9_A.win_condition.l1.locator = "9";
			pchar.quest.careen_back9_A.win_condition = "careen_back9_A";
		break;

		case "careen_back9_A":
			ChangeCharacterAddressGroup(Pchar, "BB_careen_shore", "goto", "9_back");

			LAi_QuestDelay("careen_back9", 0.1);
		break;

		case "careen_back10":
			pchar.quest.careen_back10_A.win_condition.l1 = "locator";
			pchar.quest.careen_back10_A.win_condition.l1.location = "BB_careen_shore";
			pchar.quest.careen_back10_A.win_condition.l1.locator_group = "quest";
			pchar.quest.careen_back10_A.win_condition.l1.locator = "10";
			pchar.quest.careen_back10_A.win_condition = "careen_back10_A";
		break;

		case "careen_back10_A":
			PlaySound("INTERFACE\cauterization.wav");
			LAi_ApplyCharacterDamage(Pchar, 10);
			LAi_SetStayType(Pchar);

			LAi_QuestDelay("careen_back10_B", 0.5);
		break;
	
		case "careen_back10_B":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead6.wav");
			ChangeCharacterAddressGroup(Pchar, "BB_careen_shore", "goto", "10_back");
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("careen_back10", 0.1);
		break;

		case "careen_dog":
			PlaySound("INTERFACE\dog.wav");
			PlaySound("INTERFACE\dog.wav");
		break;

		case "mutineer_dialog_careen_over":
			LAi_SetStayType(characterFromID("Mutineer_1"));
			LAi_SetStayType(characterFromID("Mutineer_2"));
			LAi_SetStayType(characterFromID("Mutineer_3"));
			LAi_SetStayType(characterFromID("Mutineer_4"));
			LAi_SetStayType(characterFromID("Mutineer_5"));
			LAi_SetStayType(characterFromID("Mutineer_6"));
			LAi_SetStayType(characterFromID("Mutineer_7"));
			LAi_SetStayType(characterFromID("Mutineer_8"));
			LAi_SetStayType(characterFromID("Mutineer_9"));
			LAi_SetStayType(characterFromID("Mutineer_10"));
			LAi_SetStayType(characterFromID("Mutineer_11"));
			LAi_SetStayType(characterFromID("Mutineer_12"));
			LAi_SetStayType(characterFromID("Mutineer_13"));
			LAi_SetStayType(characterFromID("Mutineer_14"));

			LAi_SetStayType(characterFromID("Mutineer_15"));
			LAi_SetStayType(characterFromID("Mutineer_16"));
			LAi_SetStayType(characterFromID("Mutineer_17"));
			LAi_SetStayType(characterFromID("Mutineer_18"));
			LAi_SetStayType(characterFromID("Mutineer_19"));
			LAi_SetStayType(characterFromID("Mutineer_20"));
			LAi_SetStayType(characterFromID("Mutineer_21"));
			LAi_SetStayType(characterFromID("Mutineer_22"));
			LAi_SetStayType(characterFromID("Mutineer_32"));
			LAi_SetStayType(characterFromID("Mutineer_24"));
			LAi_SetStayType(characterFromID("Mutineer_25"));
			LAi_SetStayType(characterFromID("Mutineer_26"));
			LAi_SetStayType(characterFromID("Mutineer_27"));
			LAi_SetStayType(characterFromID("Mutineer_31"));
		break;

//------------------------------------------------------------------------------------------------------------------------

		//here are all start conditions for alchemy 2 part (from shipyard shore ambush)
		case "start_alchemy2":

			GiveShip2Character(pchar,"SloopBermuda","Marquis",-1,PIRATE,true,true);
			Locations[FindLocation("Redmond_shore_03")].models.always.locators = "shore10_l_JRH1";
		//	Locations[FindLocation("Redmond_shore_03")].locators_radius.reload.reload1 = 0.001;
			Locations[FindLocation("wr_farm_booty")].models.always.locators = "sklad_locators_JRH2";
			Locations[FindLocation("wr_farm_bedroom")].reload.l2.disable = 0;
			Locations[FindLocation("wr_farm_corridor")].filespath.textures = "locations\inside\Corridor\normal";
			Locations[FindLocation("wr_farm_corridor")].locators_radius.box.box1 = 0.001;
			Locations[FindLocation("wr_farm_corridor")].models.always.locators = "storeSmall_locators_JRH_normal";
			Locations[FindLocation("wr_farm_corridor")].reload.l5.disable = 0;
			Locations[FindLocation("wr_farm_servant")].models.always.locators = "sh_l_JRH2_open";
			Locations[FindLocation("wr_farm_alchemy")].reload.l3.disable = 0;
			Locations[FindLocation("wr_farm_alchemy")].locators_radius.box.box6 = 0.0001;
			Locations[FindLocation("wr_farm_alchemy")].locators_radius.reload.reload1 = 0.6;
			locations[FindLocation("wr_farm_alchemy")].models.always.l9 = "cauldron3_w";
			locations[FindLocation("wr_farm_alchemy")].models.always.l10 = "retort_E0";
			locations[FindLocation("wr_farm_alchemy")].models.always.l11 = "top3";
			locations[FindLocation("wr_farm_alchemy")].models.always.l12 = "glass_tube3";
			locations[FindLocation("wr_farm_servant")].id.label = "Minervas room";
			locations[FindLocation("wr_farm_corridor")].id.label = "Rogers' passage";

			Locations[FindLocation("wr_farm_kitchen")].items.randitem1 = "key8";		//invisible model
			Locations[FindLocation("wr_farm_bedroom")].items.randitem7 = "key8";
			Locations[FindLocation("wr_farm_corridor")].models.always.l1 = "";
			Locations[FindLocation("wr_farm_servant")].items.randitem6 = "key8";
			Locations[FindLocation("wr_farm_servant")].items.randitem7 = "key8";
			Locations[FindLocation("wr_farm_alchemy")].items.randitem6 = "key8";

			Locations[FindLocation("wr_farm_kitchen")].locators_radius.randitem.randitem1 = 0.0001;
			Locations[FindLocation("wr_farm_bedroom")].locators_radius.randitem.randitem7 = 0.0001;
			Locations[FindLocation("wr_farm_servant")].locators_radius.randitem.randitem6 = 0.0001;
			Locations[FindLocation("wr_farm_servant")].locators_radius.randitem.randitem7 = 0.0001;
			Locations[FindLocation("wr_farm_alchemy")].locators_radius.randitem.randitem6 = 0.0001;

			Pchar.quest.distillery_items = "open";
			//Pchar.quest.farm_water = "off";
			Pchar.quest.alchemy_lever = "down";
			Pchar.quest.alchemy_plank = "up";
			Pchar.quest.apparatus_level = "glass_tube";		
			Pchar.quest.farmbooty_fillbottle = "off";
			Pchar.quest.apparatus_liquid = "none";
			Pchar.quest.apparatus_cooling = "2";
			Pchar.quest.mixtable_bottle = "ME0";
			pchar.quest.Minerva = "arrived";
			Pchar.quest.cauldron = "water";
			Pchar.quest.retort = "yes";

			//---------------------------------------------------------------------

			Pchar.alchemy2_grinder = "empty";
			Pchar.use_only_big_bottle = "yes";
			Pchar.Q2_mix = "1";
			Pchar.quest.qbook_receiver = "done";
			Pchar.quest.distillery_items_Q2 = "open";
			Pchar.quest.block_water = "yes";

			Locations[FindLocation("wr_farm_alchemy")].locators_radius.box.box7 = 0.5;	//mixtable big bottle
			locations[FindLocation("wr_farm_alchemy")].models.always.l16 = "bottle_LE0";
			locations[FindLocation("wr_farm_alchemy")].models.always.l15 = "hatch7";

		pchar.quest.place_distillery_itemsA1.win_condition.l1 = "location";
			pchar.quest.place_distillery_itemsA1.win_condition.l1.location = "wr_farm_booty";
			pchar.quest.place_distillery_itemsA1.win_condition = "place_distillery_itemsA1";

			pchar.quest.alchemy2_fire_level_down1.win_condition.l1 = "location";
			pchar.quest.alchemy2_fire_level_down1.win_condition.l1.location = "wr_farm_alchemy2";
			pchar.quest.alchemy2_fire_level_down1.win_condition = "alchemy2_fire_level_down1";

			pchar.quest.ovenstop1.win_condition.l1 = "locator";
			pchar.quest.ovenstop1.win_condition.l1.location = "wr_farm_alchemy2";
			pchar.quest.ovenstop1.win_condition.l1.locator_group = "goto";
			pchar.quest.ovenstop1.win_condition.l1.locator = "ovenstop1";
			pchar.quest.ovenstop1.win_condition = "ovenback1";

			pchar.quest.ovenstop2.win_condition.l1 = "locator";
			pchar.quest.ovenstop2.win_condition.l1.location = "wr_farm_alchemy2";
			pchar.quest.ovenstop2.win_condition.l1.locator_group = "goto";
			pchar.quest.ovenstop2.win_condition.l1.locator = "ovenstop2";
			pchar.quest.ovenstop2.win_condition = "ovenback2";

			pchar.quest.ovenstop3.win_condition.l1 = "locator";
			pchar.quest.ovenstop3.win_condition.l1.location = "wr_farm_alchemy2";
			pchar.quest.ovenstop3.win_condition.l1.locator_group = "goto";
			pchar.quest.ovenstop3.win_condition.l1.locator = "ovenstop3";
			pchar.quest.ovenstop3.win_condition = "ovenback2";

			pchar.quest.woodstop.win_condition.l1 = "locator";
			pchar.quest.woodstop.win_condition.l1.location = "wr_farm_alchemy2";
			pchar.quest.woodstop.win_condition.l1.locator_group = "goto";
			pchar.quest.woodstop.win_condition.l1.locator = "woodstop";
			pchar.quest.woodstop.win_condition = "woodback";
		break;

		case "newspapers_check":
			if(CheckCharacterItem(Pchar,"newspaper1") || CheckCharacterItem(Pchar,"newspaper2") || CheckCharacterItem(Pchar,"newspaper3"))
			{
				Logit(LanguageConvertString(tmpLangFileID,"I don't need to carry these newspapers around."));
				Logit(LanguageConvertString(tmpLangFileID,"Better study them or return them to the counter."));
				PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
				LAi_SetStayType(Pchar);
			}
			else LAi_SetPlayerType(Pchar);
		break;

		case "return_newspaper1":
			Pchar.return_newspaper = "yes";
			TakeItemFromCharacter(Pchar, "newspaper1");
			locations[FindLocation(Pchar.location)].box5.items.newspaper1 = 1;

			LAi_QuestDelay("newspapers_sound_check", 0.01);
			LAi_QuestDelay("newspapers_check", 1.0);
		break;

		case "return_newspaper2":
			Pchar.return_newspaper = "yes";
			TakeItemFromCharacter(Pchar, "newspaper2");
			locations[FindLocation(Pchar.location)].box5.items.newspaper2 = 1;

			LAi_QuestDelay("newspapers_sound_check", 0.01);
			LAi_QuestDelay("newspapers_check", 1.0);
		break;

		case "return_newspaper3":
			Pchar.return_newspaper = "yes";
			TakeItemFromCharacter(Pchar, "newspaper3");
			locations[FindLocation(Pchar.location)].box5.items.newspaper3 = 1;

			LAi_QuestDelay("newspapers_sound_check", 0.01);
			LAi_QuestDelay("newspapers_check", 1.0);
		break;

		case "newspapers_sound_check":
			if(CheckAttribute(Pchar,"newspaper1") && Pchar.return_newspaper == "yes") PlaySound("INTERFACE\paper.wav");
			Pchar.return_newspaper = "no";
		break;


		case "read_all_newspapers":
			if(!CheckAttribute(Pchar,"all_newspapers") || Pchar.all_newspapers != "read")
			{
				if(CheckAttribute(Pchar,"newspaper1") && CheckAttribute(Pchar,"newspaper2") && CheckAttribute(Pchar,"newspaper3"))
				{
					if(Pchar.newspaper1 == "read" && Pchar.newspaper2 == "read" && Pchar.newspaper3 == "read")
					{
						Pchar.all_newspapers = "read";
						AddQuestRecord("Johnson","2");
					}
				}
			}
		break;		

		case "unlock_alchemy2_downstairs":
			Locations[FindLocation("wr_farm_alchemy")].locators_radius.box.box8 = 0.0001;
			Locations[FindLocation("wr_farm_alchemy")].locators_radius.reload.reload2 = 0.6;
			Locations[FindLocation("wr_farm_alchemy2")].locators_radius.box.box17 = 0.0001;
			Locations[FindLocation("wr_farm_alchemy2")].locators_radius.reload.reload2 = 0.7;
			Locations[FindLocation("wr_farm_alchemy")].reload.l2.disable = 0;

			if(CheckAttribute(locations[FindLocation("wr_farm_alchemy2")], "id.label") 
			&& locations[FindLocation("wr_farm_alchemy2")].id.label == "Rogers' secret laboratory")
			{ 
				TakeItemFromCharacter(Pchar, "key36"); 

				LAi_QuestDelay("Minerva_Q2", 3.0);
			}

			locations[FindLocation("wr_farm_alchemy2")].id.label = "Rogers' secret laboratory";

			if(pchar.location == "wr_farm_alchemy") 
			{
				DoQuestReloadToLocation("wr_farm_alchemy2", "reload", "reload2", "_");
			}
			else DoQuestReloadToLocation("wr_farm_alchemy", "reload", "reload2", "_");
		break;

		case "unlock_alchemy2_upstairs":
			Locations[FindLocation("wr_farm_servant")].locators_radius.box.box5 = 0.0001;
			Locations[FindLocation("wr_farm_servant")].locators_radius.reload.reload2 = 0.7;
			Locations[FindLocation("wr_farm_alchemy2")].locators_radius.box.box18 = 0.0001;
			Locations[FindLocation("wr_farm_alchemy2")].locators_radius.reload.reload3 = 0.7;
			Locations[FindLocation("wr_farm_servant")].reload.l2.disable = 0;
			
			if(CheckAttribute(locations[FindLocation("wr_farm_alchemy2")], "id.label") 
			&& locations[FindLocation("wr_farm_alchemy2")].id.label == "Rogers' secret laboratory")
			{ 
				TakeItemFromCharacter(Pchar, "key36"); 

				LAi_QuestDelay("Minerva_Q2", 3.0);
			}

			locations[FindLocation("wr_farm_alchemy2")].id.label = "Rogers' secret laboratory";

			if(pchar.location == "wr_farm_servant") 
			{
				DoQuestReloadToLocation("wr_farm_alchemy2", "reload", "reload3", "_");
			}
			else DoQuestReloadToLocation("wr_farm_servant", "reload", "reload2", "_");
		break;

		//-------------------------------------------------------------------------------------------------
//pär minerva
		case "Minerva_Q2":
			PlaySound("INTERFACE\knock2.wav");
			LAi_QuestDelay("pchar_staytype", 0.1);

			ChangeCharacterAddressGroup(characterFromID("Minerva"), "wr_farm_kitchen", "goto", "goto3");
			Characters[GetCharacterIndex("Minerva")].dialog.CurrentNode  = "Minerva_Q2";

			LAi_SetWaitressType(characterFromID("Minerva"));

			LAi_QuestDelay("Minerva_Q2_1", 1.0);
		break;

		case "Minerva_Q2_1":
			PlaySound("VOICE\ENGLISH\Fre_f_a_004.wav");

			LAi_QuestDelay("Minerva_Q2_2", 3.0);
		break;

		case "Minerva_Q2_2":
			LAi_QuestDelay("pchar_huh", 0.1);
			LAi_QuestDelay("pchar_playertype", 0.1);

		break;



		//-------------------------------------------------------------------------------------------------

		case "place_distillery_itemsA":
			pchar.quest.place_distillery_itemsA1.win_condition.l1 = "location";
			pchar.quest.place_distillery_itemsA1.win_condition.l1.location = "wr_farm_booty";
			pchar.quest.place_distillery_itemsA1.win_condition = "place_distillery_itemsA1";
		break;

		case "place_distillery_itemsA1":
			locations[FindLocation(Pchar.location)].box4.items.pistolretort = 15;
			locations[FindLocation(Pchar.location)].box3.items.bladetop = 13;
			locations[FindLocation(Pchar.location)].box2.items.pistolglass_tube = 12;
			locations[FindLocation(Pchar.location)].box6.items.bladebottle_CE0 = 12;
		break;

		case "ovenstop":
			pchar.quest.ovenstop1.win_condition.l1 = "locator";
			pchar.quest.ovenstop1.win_condition.l1.location = "wr_farm_alchemy2";
			pchar.quest.ovenstop1.win_condition.l1.locator_group = "goto";
			pchar.quest.ovenstop1.win_condition.l1.locator = "ovenstop1";
			pchar.quest.ovenstop1.win_condition = "ovenback1";

			pchar.quest.ovenstop2.win_condition.l1 = "locator";
			pchar.quest.ovenstop2.win_condition.l1.location = "wr_farm_alchemy2";
			pchar.quest.ovenstop2.win_condition.l1.locator_group = "goto";
			pchar.quest.ovenstop2.win_condition.l1.locator = "ovenstop2";
			pchar.quest.ovenstop2.win_condition = "ovenback2";

			pchar.quest.ovenstop3.win_condition.l1 = "locator";
			pchar.quest.ovenstop3.win_condition.l1.location = "wr_farm_alchemy2";
			pchar.quest.ovenstop3.win_condition.l1.locator_group = "goto";
			pchar.quest.ovenstop3.win_condition.l1.locator = "ovenstop3";
			pchar.quest.ovenstop3.win_condition = "ovenback2";

			pchar.quest.woodstop.win_condition.l1 = "locator";
			pchar.quest.woodstop.win_condition.l1.location = "wr_farm_alchemy2";
			pchar.quest.woodstop.win_condition.l1.locator_group = "goto";
			pchar.quest.woodstop.win_condition.l1.locator = "woodstop";
			pchar.quest.woodstop.win_condition = "woodback";
		break;

		case "ovenback1":
			LAi_SetStayType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "wr_farm_alchemy2", "goto", "ovenback1");
			
			LAi_QuestDelay("ovenstop", 0.1);
			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "ovenback2":
			LAi_SetStayType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "wr_farm_alchemy2", "goto", "ovenback2");
			
			LAi_QuestDelay("ovenstop", 0.1);
			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		case "woodback":
			LAi_SetStayType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "wr_farm_alchemy2", "goto", "woodback");
			
			LAi_QuestDelay("ovenstop", 0.1);
			LAi_QuestDelay("pchar_playertype", 0.5);
		break;

		//---------------------------------------------------------------------------------------------------------------------

		case "pistolsalt_check":
			if(CheckCharacterItem(Pchar,"pistolsalt"))
			{
				weaponID7 = GetCharacterEquipByGroup(Pchar,BLADE_ITEM_TYPE);
				if(weaponID7 == "") EquipCharacterByItem(Pchar, "bladeX4");

				PlaySound("INTERFACE\cancel.wav");
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "pistolsalt");
				return;
			}
			else LAi_QuestDelay("pistolsalt_check", 0.5);	//loops until item picked up
		break;

		case "pistolcloth_check":
			if(CheckCharacterItem(Pchar,"pistolcloth"))
			{
				weaponID7 = GetCharacterEquipByGroup(Pchar,BLADE_ITEM_TYPE);
				if(weaponID7 == "") EquipCharacterByItem(Pchar, "bladeX4");

				PlaySound("PEOPLE\clothes4.wav");
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "pistolcloth");
				return;
			}
			else LAi_QuestDelay("pistolcloth_check", 0.5);	//loops until item picked up
		break;

		case "pistolfunnel_check":
			if(CheckCharacterItem(Pchar,"pistolfunnel"))
			{
				if(CheckCharacterItem(Pchar,"bladebottle_CE0"))
				{
					if(!IsEquipCharacterByItem(Pchar, "bladebottle_CE0")) EquipCharacterByItem(Pchar, "bladebottle_CE0");
				}

				weaponID7 = GetCharacterEquipByGroup(Pchar,BLADE_ITEM_TYPE);
				if(weaponID7 == "") EquipCharacterByItem(Pchar, "bladeX4");

				PlaySound("INTERFACE\button2.wav");
				RemoveCharacterEquip(Pchar, GUN_ITEM_TYPE);
				EquipCharacterByItem(Pchar, "pistolfunnel");
				return;
			}
			else LAi_QuestDelay("pistolfunnel_check", 0.5);	//loops until item picked up
		break;

		//---------------------------------------------------------------------------------------------------------------------
		
		case "extra_bottle_sound":
			PlaySound("INTERFACE\button2.wav");
		break;

		//--------------------------------------------------------------------------------------------------------------
		//Box 9

		case "oven_alchemy2_box9":
			Locations[FindLocation("wr_farm_alchemy2")].image = "";
			DoQuestReloadToLocation("wr_farm_alchemy2", "goto", "ovenback1", "loading_back_alchemy2");
		break;

		case "oven_alchemy2_box9_take_time_JRH3":
			Locations[FindLocation("wr_farm_alchemy2")].image = "";
			DoQuestReloadToLocation("wr_farm_alchemy2", "goto", "ovenback1", "loading_back_alchemy2_take_time_JRH3");
		break;

		case "oven_alchemy2_box9_take_time_JRH2":
			Locations[FindLocation("wr_farm_alchemy2")].image = "";
			DoQuestReloadToLocation("wr_farm_alchemy2", "goto", "ovenback1", "loading_back_alchemy2_take_time_JRH2");
		break;

		case "oven_alchemy2_box9_take_time_JRH1":
			Locations[FindLocation("wr_farm_alchemy2")].image = "";
			DoQuestReloadToLocation("wr_farm_alchemy2", "goto", "ovenback1", "loading_back_alchemy2_take_time_JRH1");
		break;

		case "oven_alchemy2_box9_burning_direct":
			if(CheckAttribute(Pchar, "Q2_mix") && Pchar.Q2_mix == "11")
			{
				CreateParticleSystem("smoke_short" , -8.4, 3.7, 3.7, 4.5, 1.5, 0.0, sti(20) );
				PlaySound("INTERFACE\steam1.wav");

				LAi_QuestDelay("alchemy_acid_heavy_boiling1", 4.0);
				LAi_QuestDelay("alchemy_acid_small_boiling1", 3.0);
				LAi_QuestDelay("alchemy_acid_hevay_boiling2", 5.0);
			}
			else 
			{
				CreateParticleSystemX("qar_fire", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);
				CreateParticleSystemX("smoke_inv_short", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);
				PlaySound("INTERFACE\fire_off.wav");

				LAi_QuestDelay("Pchar_ooh", 2.0);
			}
		break;

		//--------------------------------------------------------------------------------------------------------------
		//Box 14

		case "oven_alchemy2_box14":
			Locations[FindLocation("wr_farm_alchemy2")].image = "";
			DoQuestReloadToLocation("wr_farm_alchemy2", "goto", "ovenback2", "loading_back_alchemy2");
		break;

		case "oven_alchemy2_box14_take_time_JRH3":
			Locations[FindLocation("wr_farm_alchemy2")].image = "";
			DoQuestReloadToLocation("wr_farm_alchemy2", "goto", "ovenback2", "loading_back_alchemy2_take_time_JRH3");
		break;

		case "oven_alchemy2_box14_take_time_JRH2":
			Locations[FindLocation("wr_farm_alchemy2")].image = "";
			DoQuestReloadToLocation("wr_farm_alchemy2", "goto", "ovenback2", "loading_back_alchemy2_take_time_JRH2");
		break;

		case "oven_alchemy2_box14_take_time_JRH1":
			Locations[FindLocation("wr_farm_alchemy2")].image = "";
			DoQuestReloadToLocation("wr_farm_alchemy2", "goto", "ovenback2", "loading_back_alchemy2_take_time_JRH1");
		break;

		case "oven_alchemy2_box14_burning_direct":
			if(CheckAttribute(Pchar, "Q2_mix") && Pchar.Q2_mix == "11")
			{
				CreateParticleSystem("smoke_short" , -8.4, 3.7, 3.7, 4.5, 1.5, 0.0, sti(20) );
				PlaySound("INTERFACE\steam1.wav");

				LAi_QuestDelay("alchemy_acid_heavy_boiling1", 4.0);
				LAi_QuestDelay("alchemy_acid_small_boiling1", 3.0);
				LAi_QuestDelay("alchemy_acid_hevay_boiling2", 5.0);
			}
			else 
			{
				CreateParticleSystemX("qar_fire", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);
				CreateParticleSystemX("smoke_inv_short", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);
				PlaySound("INTERFACE\fire_off.wav");

				LAi_QuestDelay("Pchar_ooh", 2.0);
			}
		break;

		//--------------------------------------------------------------------------------------------------------------
//JRH heavy boil
		case "alchemy_acid_heavy_boiling1":
			PlaySound("INTERFACE\steam1.wav");
		break;

		case "alchemy_acid_hevay_boiling2":
			PlaySound("VOICE\ENGLISH\blaze_mhm.wav");
			Logit(LanguageConvertString(tmpLangFileID,"I think that's the right mixture."));
		break;
		
		case "oven_alchemy2_box14":
			Locations[FindLocation("wr_farm_alchemy2")].image = "";
			DoQuestReloadToLocation("wr_farm_alchemy2", "goto", "ovenback2", "loading_back_alchemy2");
		break;

		//---------------------------------------------------------------------------------------------------------------------

		case "place_wood_alchemy2_box9":
			if(CheckAttribute(Pchar, "Q2_mix"))
			{
				if(Pchar.Q2_mix == "5" || Pchar.Q2_mix == "9")
				{
					if(Locations[FindLocation(Pchar.location)].models.always.l10 == "powder_grey")
					{
						if(Locations[FindLocation(Pchar.location)].models.always.locators == "TwoFloorHouse_locators_JRH3")
						{
							Pchar.powder_grey = "burning";
							Locations[FindLocation(Pchar.location)].models.always.l10 = "";		//burning up
						}
					}
				}
			}

			if(CheckAttribute(Pchar, "Q2_mix") && Pchar.Q2_mix == "6")
			{
				if(Locations[FindLocation(Pchar.location)].models.always.l10 == "solid_brown")
				{
					if(Locations[FindLocation(Pchar.location)].models.always.locators == "TwoFloorHouse_locators_JRH2"
					|| Locations[FindLocation(Pchar.location)].models.always.locators == "TwoFloorHouse_locators_JRH3")
					{
						Pchar.solid_brown = "burning";
						Locations[FindLocation(Pchar.location)].models.always.l10 = "";		//burning up
					}
				}
			}

			if(CheckAttribute(Pchar, "Q2_mix") && Pchar.Q2_mix == "9")
			{
				if(Locations[FindLocation(Pchar.location)].models.always.l10 == "powder_light_yellow")
				{
					if(Locations[FindLocation(Pchar.location)].models.always.locators == "TwoFloorHouse_locators_JRH2"
					|| Locations[FindLocation(Pchar.location)].models.always.locators == "TwoFloorHouse_locators_JRH3")
					{
						Pchar.powder_light_yellow = "burning";
						Locations[FindLocation(Pchar.location)].models.always.l10 = "";		//burning up
					}
				}
			}

			if(CheckAttribute(Pchar, "Q2_mix") && Pchar.Q2_mix == "11")
			{
				if(Locations[FindLocation(Pchar.location)].models.always.l10 == "solid_red")
				{
					if(Locations[FindLocation(Pchar.location)].models.always.locators == "TwoFloorHouse_locators_JRH2"
					|| Locations[FindLocation(Pchar.location)].models.always.locators == "TwoFloorHouse_locators_JRH3")
					{
						Pchar.solid_red = "burning";
						Locations[FindLocation(Pchar.location)].models.always.l10 = "";		//burning up
					}
				}

				if(Locations[FindLocation(Pchar.location)].models.always.l10 == "liquid_white")
				{
					if(Locations[FindLocation("wr_farm_alchemy2")].models.always.locators == "TwoFloorHouse_locators_JRH3")
					{
						//reacting direct to orange liquid
						Locations[FindLocation(Pchar.location)].models.always.l10 = "liquid_orange";
						Pchar.liquid_orange = "processed";

						LAi_QuestDelay("oven_alchemy2_box9_burning_direct", 0.5);
					}			
				}
			}

			DoQuestReloadToLocation("wr_farm_alchemy2", "goto", "ovenback1", "fire_up_alchemy2");
		break;

		case "place_wood_alchemy2_box14":
			if(CheckAttribute(Pchar, "Q2_mix"))
			{
				if(Pchar.Q2_mix == "5" || Pchar.Q2_mix == "9")
				{
					if(Locations[FindLocation(Pchar.location)].models.always.l10 == "powder_grey")
					{
						if(Locations[FindLocation(Pchar.location)].models.always.locators == "TwoFloorHouse_locators_JRH3")
						{
							Pchar.powder_grey = "burning";
							Locations[FindLocation(Pchar.location)].models.always.l10 = "";		//burning up
						}
					}
				}
			}

			if(CheckAttribute(Pchar, "Q2_mix") && Pchar.Q2_mix == "6")
			{
				if(Locations[FindLocation(Pchar.location)].models.always.l10 == "solid_brown")
				{
					if(Locations[FindLocation(Pchar.location)].models.always.locators == "TwoFloorHouse_locators_JRH2"
					|| Locations[FindLocation(Pchar.location)].models.always.locators == "TwoFloorHouse_locators_JRH3")
					{
						Pchar.solid_brown = "burning";
						Locations[FindLocation(Pchar.location)].models.always.l10 = "";		//burning up
					}
				}
			}

			if(CheckAttribute(Pchar, "Q2_mix") && Pchar.Q2_mix == "9")
			{
				if(Locations[FindLocation(Pchar.location)].models.always.l10 == "powder_light_yellow")
				{
					if(Locations[FindLocation(Pchar.location)].models.always.locators == "TwoFloorHouse_locators_JRH2"
					|| Locations[FindLocation(Pchar.location)].models.always.locators == "TwoFloorHouse_locators_JRH3")
					{
						Pchar.powder_light_yellow = "burning";
						Locations[FindLocation(Pchar.location)].models.always.l10 = "";		//burning up
					}
				}
			}

			if(CheckAttribute(Pchar, "Q2_mix") && Pchar.Q2_mix == "11")
			{
				if(Locations[FindLocation(Pchar.location)].models.always.l10 == "solid_red")
				{
					if(Locations[FindLocation(Pchar.location)].models.always.locators == "TwoFloorHouse_locators_JRH2"
					|| Locations[FindLocation(Pchar.location)].models.always.locators == "TwoFloorHouse_locators_JRH3")
					{
						Pchar.solid_red = "burning";
						Locations[FindLocation(Pchar.location)].models.always.l10 = "";		//burning up
					}
				}

				if(Locations[FindLocation(Pchar.location)].models.always.l10 == "liquid_white")
				{
					if(Locations[FindLocation("wr_farm_alchemy2")].models.always.locators == "TwoFloorHouse_locators_JRH3")
					{
						//reacting direct to orange liquid
						Locations[FindLocation(Pchar.location)].models.always.l10 = "liquid_orange";
						Pchar.liquid_orange = "processed";

						LAi_QuestDelay("oven_alchemy2_box9_burning_direct", 0.5);
					}			
				}
			}

			DoQuestReloadToLocation("wr_farm_alchemy2", "goto", "ovenback2", "fire_up_alchemy2");
		break;
//----------------------------------------------------------------------------------------------------------------------------------
		case "fire_up_alchemy2":
			Locations[FindLocation("wr_farm_alchemy2")].image = "wr_farm_alchemy2.tga";

			switch(Locations[FindLocation(Pchar.location)].models.always.locators)
			{
				case "TwoFloorHouse_locators_JRH1":
					PlaySound3D("NATURE\fireplace2.wav", -8.4, 3.7, 4.4);

				LAi_QuestDelay("fireplace2", 2.5);

					if(Locations[FindLocation(Pchar.location)].models.always.l10 == "liquid_white"
					|| Locations[FindLocation(Pchar.location)].models.always.l10 == "powder_grey")
					{	
						PlaySound3D("INTERFACE\rumble1.wav", -8.4, 3.7, 4.4);

				LAi_QuestDelay("rumble1", 2.5);
					}

					if(Locations[FindLocation(Pchar.location)].models.always.l10 == "solid_brown")
					{
						CreateParticleSystem("waterfog_yellow_light" , -8.4, 3.7, 3.7, 5.0, 1.5, 0.0, sti(20) );

						LAi_QuestDelay("take_time", 2.0);
					}

					if(Locations[FindLocation(Pchar.location)].models.always.l10 == "powder_light_yellow"
					|| Locations[FindLocation(Pchar.location)].models.always.l10 == "solid_red")
					{
						PlaySound3D("INTERFACE\rumble1.wav", -8.4, 3.7, 4.4);
						CreateParticleSystemX("waterfog_fall", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);

			LAi_QuestDelay("rumble1", 2.5);
						LAi_QuestDelay("take_time", 2.0);
					}

					LAi_QuestDelay("alchemy2_fire_low", 5.0);
				break;

				case "TwoFloorHouse_locators_JRH2":
					PlaySound3D("NATURE\fireplace3.wav", -8.4, 3.7, 4.4);

			LAi_QuestDelay("fireplace3", 2.5);

					if(Locations[FindLocation(Pchar.location)].models.always.l10 == "liquid_white")
					{	
						PlaySound3D("INTERFACE\rumble1.wav", -8.4, 3.7, 4.4);
						PlaySound3D("INTERFACE\bubbles2.wav", -8.4, 3.7, 4.4);

			LAi_QuestDelay("rumble1", 2.5);
			LAi_QuestDelay("bubbles2", 2.5);	
					}

					if(Locations[FindLocation(Pchar.location)].models.always.l10 == "powder_grey")
					{
						PlaySound3D("INTERFACE\rumble1.wav", -8.4, 3.7, 4.4);	
						PlaySound3D("INTERFACE\rumble2.wav", -8.4, 3.7, 4.4);
						PlaySound3D("INTERFACE\rumble2.wav", -8.4, 3.7, 4.4);

			LAi_QuestDelay("rumble1", 2.5);
			LAi_QuestDelay("rumble2", 2.5);

						if(CheckAttribute(Pchar, "Q2_mix")) 
						{
							if(Pchar.Q2_mix == "5" || Pchar.Q2_mix == "9")
							{
								CreateParticleSystemX("waterfog_fall", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);
								CreateParticleSystemX("waterfog_fall", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);

								LAi_QuestDelay("take_time", 2.0);
							}
						}
					}

					if(Locations[FindLocation(Pchar.location)].models.always.l10 == "")
					{
						if(CheckAttribute(Pchar, "Q2_mix") && Pchar.Q2_mix == "6")
						{
							if(CheckAttribute(Pchar, "solid_brown") && Pchar.solid_brown == "burning")
							{
								Pchar.solid_brown = "finished";
								CreateParticleSystemX("qar_fire", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);
								CreateParticleSystemX("smoke_inv_short", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);
								PlaySound("INTERFACE\fire_off.wav");

								LAi_QuestDelay("Pchar_ooh", 2.0);
							}
						}

						if(CheckAttribute(Pchar, "Q2_mix") && Pchar.Q2_mix == "9")
						{
							if(CheckAttribute(Pchar, "powder_light_yellow") && Pchar.powder_light_yellow == "burning")
							{
								Pchar.powder_light_yellow = "finished";
								CreateParticleSystemX("qar_fire", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);
								CreateParticleSystemX("smoke_inv_short", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);
								PlaySound("INTERFACE\fire_off.wav");

								LAi_QuestDelay("Pchar_ooh", 2.0);
							}
						}

						if(CheckAttribute(Pchar, "Q2_mix") && Pchar.Q2_mix == "11")
						{
							if(CheckAttribute(Pchar, "solid_red") && Pchar.solid_red == "burning")
							{
								Pchar.solid_red = "finished";
								CreateParticleSystemX("qar_fire", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);
								CreateParticleSystemX("smoke_inv_short", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);
								PlaySound("INTERFACE\fire_off.wav");

								LAi_QuestDelay("Pchar_ooh", 2.0);
							}	
						}
					}

					LAi_QuestDelay("alchemy2_fire_high", 4.8);
				break;

				case "TwoFloorHouse_locators_JRH3":
					PlaySound3D("NATURE\fireplace2.wav", -8.4, 3.7, 4.4);
					PlaySound3D("NATURE\fireplace2.wav", -8.4, 3.7, 4.4);
					PlaySound3D("NATURE\fireplace3.wav", -8.4, 3.7, 4.4);
					PlaySound3D("NATURE\fireplace3.wav", -8.4, 3.7, 4.4);
					PlaySound3D("NATURE\fireplace3.wav", -8.4, 3.7, 4.4);
					PlaySound3D("NATURE\fireplace3.wav", -8.4, 3.7, 4.4);

				LAi_QuestDelay("fireplace2", 2.5);
				LAi_QuestDelay("fireplace3", 2.5);

					if(Locations[FindLocation(Pchar.location)].models.always.l10 == "liquid_white")
					{
						CreateParticleSystemX("smoke_short", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);
	
						PlaySound3D("INTERFACE\rumble1.wav", -8.4, 3.7, 4.4);
						PlaySound("INTERFACE\steam1.wav");
						PlaySound3D("INTERFACE\bubbles2.wav", -8.4, 3.7, 4.4);
						PlaySound3D("INTERFACE\bubbles2.wav", -8.4, 3.7, 4.4);

				LAi_QuestDelay("rumble1", 2.5);
				LAi_QuestDelay("bubbles2", 2.5);
				LAi_QuestDelay("steam1", 2.5);

						LAi_QuestDelay("take_time", 2.0);
					}

					if(Locations[FindLocation(Pchar.location)].models.always.l10 == "powder_grey")
					{
						if(CheckAttribute(Pchar, "Q2_mix") && Pchar.Q2_mix == "2")
						{
							PlaySound3D("INTERFACE\rumble1.wav", -8.4, 3.7, 4.4);
							PlaySound3D("INTERFACE\rumble1.wav", -8.4, 3.7, 4.4);		
							PlaySound3D("INTERFACE\rumble2.wav", -8.4, 3.7, 4.4);
							PlaySound3D("INTERFACE\rumble2.wav", -8.4, 3.7, 4.4);
							PlaySound3D("INTERFACE\rumble2.wav", -8.4, 3.7, 4.4);
							PlaySound3D("INTERFACE\rumble2.wav", -8.4, 3.7, 4.4);	

				LAi_QuestDelay("rumble1", 2.5);
				LAi_QuestDelay("rumble2", 2.5);

						CreateParticleSystemX("waterfog_fall", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);
						CreateParticleSystemX("waterfog_fall", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);

						 	LAi_QuestDelay("take_time", 2.0);
						}
					}

					if(Locations[FindLocation(Pchar.location)].models.always.l10 == "")
					{
						if(CheckAttribute(Pchar, "Q2_mix"))
						{
							if(Pchar.Q2_mix == "5" || Pchar.Q2_mix == "9")
							{
								if(CheckAttribute(Pchar, "powder_grey") && Pchar.powder_grey == "burning")
								{
									Pchar.powder_grey = "finished2";
									CreateParticleSystemX("qar_fire", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);
									CreateParticleSystemX("smoke_inv_short", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);
									PlaySound("INTERFACE\fire_off.wav");

									LAi_QuestDelay("Pchar_ooh", 2.0);
								}
							}
						}
					}

					if(Locations[FindLocation(Pchar.location)].models.always.l10 == "")
					{
						if(CheckAttribute(Pchar, "Q2_mix") && Pchar.Q2_mix == "6")
						{
							if(CheckAttribute(Pchar, "solid_brown") && Pchar.solid_brown == "burning")
							{
								Pchar.solid_brown = "finished";
								CreateParticleSystemX("qar_fire", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);
								CreateParticleSystemX("smoke_inv_short", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);
								PlaySound("INTERFACE\fire_off.wav");

								LAi_QuestDelay("Pchar_ooh", 2.0);
							}
						}

						if(CheckAttribute(Pchar, "Q2_mix") && Pchar.Q2_mix == "9")
						{
							if(CheckAttribute(Pchar, "powder_light_yellow") && Pchar.powder_light_yellow == "burning")
							{
								Pchar.powder_light_yellow = "finished";
								CreateParticleSystemX("qar_fire", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);
								CreateParticleSystemX("smoke_inv_short", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);
								PlaySound("INTERFACE\fire_off.wav");

								LAi_QuestDelay("Pchar_ooh", 2.0);
							}
						}

						if(CheckAttribute(Pchar, "Q2_mix") && Pchar.Q2_mix == "11")
						{
							if(CheckAttribute(Pchar, "solid_red") && Pchar.solid_red == "burning")
							{
								Pchar.solid_red = "finished";
								CreateParticleSystemX("qar_fire", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);
								CreateParticleSystemX("smoke_inv_short", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);
								PlaySound("INTERFACE\fire_off.wav");

								LAi_QuestDelay("Pchar_ooh", 2.0);
							}
						}
					}

					LAi_QuestDelay("alchemy2_fire_very_high", 4.8);
				break;
			}
		break;
//----------------------------------------------------------------------------------------------------------------------------------
//JRH alch fire levels

		case "alchemy2_fire_low":
			if(Pchar.location == "wr_farm_alchemy2")
			{
				if(Locations[FindLocation("wr_farm_alchemy2")].models.always.locators == "TwoFloorHouse_locators_JRH1")
				{
					PlaySound3D("NATURE\fireplace2.wav", -8.4, 3.7, 4.4);

				LAi_QuestDelay("fireplace2", 2.5);

					if(Locations[FindLocation(Pchar.location)].models.always.l10 == "liquid_white"
					|| Locations[FindLocation(Pchar.location)].models.always.l10 == "powder_grey")
					{	
						PlaySound3D("INTERFACE\rumble1.wav", -8.4, 3.7, 4.4);

				LAi_QuestDelay("rumble1", 2.5);
					}

					if(Locations[FindLocation(Pchar.location)].models.always.l10 == "solid_brown")
					{
						CreateParticleSystem("waterfog_yellow_light" , -8.4, 3.7, 3.7, 5.0, 1.5, 0.0, sti(20) );
					}

					if(Locations[FindLocation(Pchar.location)].models.always.l10 == "powder_light_yellow"
					|| Locations[FindLocation(Pchar.location)].models.always.l10 == "solid_red")
					{	
						PlaySound3D("INTERFACE\rumble1.wav", -8.4, 3.7, 4.4);
						CreateParticleSystemX("waterfog_fall", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);

				LAi_QuestDelay("rumble1", 2.5);
					}

					LAi_QuestDelay("alchemy2_fire_low", 5.0);
				}
				else return;
			}
			else return;
		break;

		case "alchemy2_fire_high":
			if(Pchar.location == "wr_farm_alchemy2")
			{
				if(Locations[FindLocation("wr_farm_alchemy2")].models.always.locators == "TwoFloorHouse_locators_JRH2")
				{
					PlaySound3D("NATURE\fireplace3.wav", -8.4, 3.7, 4.4);

				LAi_QuestDelay("fireplace3", 2.5);

					if(Locations[FindLocation(Pchar.location)].models.always.l10 == "liquid_white")
					{	
						PlaySound3D("INTERFACE\rumble1.wav", -8.4, 3.7, 4.4);
						PlaySound3D("INTERFACE\bubbles2.wav", -8.4, 3.7, 4.4);

				LAi_QuestDelay("rumble1", 2.5);
				LAi_QuestDelay("bubbles2", 2.5);
					}

					if(Locations[FindLocation(Pchar.location)].models.always.l10 == "powder_grey")
					{
						PlaySound3D("INTERFACE\rumble1.wav", -8.4, 3.7, 4.4);	
						PlaySound3D("INTERFACE\rumble2.wav", -8.4, 3.7, 4.4);
						PlaySound3D("INTERFACE\rumble2.wav", -8.4, 3.7, 4.4);

				LAi_QuestDelay("rumble1", 2.5);
				LAi_QuestDelay("rumble2", 2.5);

						if(CheckAttribute(Pchar, "Q2_mix")) 
						{
							if(Pchar.Q2_mix == "5" || Pchar.Q2_mix == "9")
							{
								CreateParticleSystemX("waterfog_fall", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);
								CreateParticleSystemX("waterfog_fall", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);
							}
						}
					}

					LAi_QuestDelay("alchemy2_fire_high", 4.8);
				}
				else return;
			}
			else return;
		break;

		case "alchemy2_fire_very_high":
			if(Pchar.location == "wr_farm_alchemy2")
			{
				if(Locations[FindLocation("wr_farm_alchemy2")].models.always.locators == "TwoFloorHouse_locators_JRH3")
				{
					PlaySound3D("NATURE\fireplace2.wav", -8.4, 3.7, 4.4);
					PlaySound3D("NATURE\fireplace2.wav", -8.4, 3.7, 4.4);
					PlaySound3D("NATURE\fireplace3.wav", -8.4, 3.7, 4.4);
					PlaySound3D("NATURE\fireplace3.wav", -8.4, 3.7, 4.4);
					PlaySound3D("NATURE\fireplace3.wav", -8.4, 3.7, 4.4);
					PlaySound3D("NATURE\fireplace3.wav", -8.4, 3.7, 4.4);

				LAi_QuestDelay("fireplace2", 2.5);
				LAi_QuestDelay("fireplace3", 2.5);

					if(Locations[FindLocation(Pchar.location)].models.always.l10 == "liquid_white")
					{
						CreateParticleSystemX("smoke_short", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);	

						PlaySound3D("INTERFACE\rumble1.wav", -8.4, 3.7, 4.4);
						PlaySound("INTERFACE\steam1.wav");
						PlaySound3D("INTERFACE\bubbles2.wav", -8.4, 3.7, 4.4);
						PlaySound3D("INTERFACE\bubbles2.wav", -8.4, 3.7, 4.4);

				LAi_QuestDelay("rumble1", 2.5);
				LAi_QuestDelay("bubbles2", 2.5);
				LAi_QuestDelay("steam1", 2.5);
					}

					if(Locations[FindLocation(Pchar.location)].models.always.l10 == "powder_grey")
					{
						if(CheckAttribute(Pchar, "Q2_mix") && Pchar.Q2_mix == "2")
						{
							PlaySound3D("INTERFACE\rumble1.wav", -8.4, 3.7, 4.4);
							PlaySound3D("INTERFACE\rumble1.wav", -8.4, 3.7, 4.4);		
							PlaySound3D("INTERFACE\rumble2.wav", -8.4, 3.7, 4.4);
							PlaySound3D("INTERFACE\rumble2.wav", -8.4, 3.7, 4.4);
							PlaySound3D("INTERFACE\rumble2.wav", -8.4, 3.7, 4.4);
							PlaySound3D("INTERFACE\rumble2.wav", -8.4, 3.7, 4.4);

							CreateParticleSystemX("waterfog_fall", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);
							CreateParticleSystemX("waterfog_fall", -8.4, 3.7, 3.7, 0.0, 3.0, -2.0, 5);

				LAi_QuestDelay("rumble1", 2.5);
				LAi_QuestDelay("rumble2", 2.5);
						}
					}

					LAi_QuestDelay("alchemy2_fire_very_high", 4.8);
				}
				else return;
			}
			else return;
		break;
//----------------------------------------------------------------------------------------------------------------------------------
//additional sounds to cover the gap when looping sound effects
//pär fire
		case "rumble1":
			if(Pchar.location == "wr_farm_alchemy2") {PlaySound3D("INTERFACE\rumble1.wav", -8.4, 3.7, 4.4);}
		break;

		case "rumble2":
			if(Pchar.location == "wr_farm_alchemy2") {PlaySound3D("INTERFACE\rumble2.wav", -8.4, 3.7, 4.4);}
		break;

		case "bubbles2":
			if(Pchar.location == "wr_farm_alchemy2") {PlaySound3D("INTERFACE\bubbles2.wav", -8.4, 3.7, 4.4);}
		break;

		case "steam1":
			if(Pchar.location == "wr_farm_alchemy2") {PlaySound("INTERFACE\steam1.wav");}
		break;

		case "fireplace2":
			if(Pchar.location == "wr_farm_alchemy2") {PlaySound3D("NATURE\fireplace2.wav", -8.4, 3.7, 4.4);}
		break;

		case "fireplace3":
			if(Pchar.location == "wr_farm_alchemy2") {PlaySound3D("NATURE\fireplace3.wav", -8.4, 3.7, 4.4);}
		break;

//----------------------------------------------------------------------------------------------------------------------------------
		case "take_time":
			PlaySound("VOICE\ENGLISH\blaze_lets_go.wav");
			Logit(LanguageConvertString(tmpLangFileID,"This will take time - I'll do something else meanwhile."));

			if(Locations[FindLocation(Pchar.location)].models.always.l10 == "liquid_white")
			{
				Pchar.liquid_white = "boiling";
			}

			if(Locations[FindLocation(Pchar.location)].models.always.l10 == "powder_grey")
			{
				Pchar.powder_grey = "processed";
				if(CheckAttribute(Pchar, "Q2_mix")) 
				{
					if(Pchar.Q2_mix == "5" || Pchar.Q2_mix == "9") 
					{
						Pchar.powder_grey = "processed2";
					}
				}
				else Pchar.powder_grey = "processed";
			}

			if(Locations[FindLocation(Pchar.location)].models.always.l10 == "solid_brown")
			{
				Pchar.solid_brown = "processed";
			}

			if(Locations[FindLocation(Pchar.location)].models.always.l10 == "powder_light_yellow")
			{
				Pchar.powder_light_yellow = "processed";
			}

			if(Locations[FindLocation(Pchar.location)].models.always.l10 == "solid_red")
			{
				Pchar.solid_red = "processed";
			}
		break;

		//---------------------------------------------------------------------------------------------------------------------

		case "alchemy2_fire_level_down1":
			Pchar.quest.alchemy2_fire_level_down2.win_condition.l1 = "ExitFromLocation";
			Pchar.quest.alchemy2_fire_level_down2.win_condition.l1.location = "wr_farm_alchemy2";
			Pchar.quest.alchemy2_fire_level_down2.win_condition = "alchemy2_fire_level_down2";
		break;

		case "alchemy2_fire_level_down2":
			if(Locations[FindLocation("wr_farm_alchemy2")].models.always.locators == "TwoFloorHouse_locators_JRH1")
			{
				Locations[FindLocation("wr_farm_alchemy2")].models.always.locators = "TwoFloorHouse_locators_JRH0";

				if(CheckAttribute(Pchar, "Q2_mix") && Pchar.Q2_mix == "6")
				{
					if(CheckAttribute(Pchar, "solid_brown") && Pchar.solid_brown == "processed")
					{
						Pchar.solid_brown = "finished";
						Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 = "powder_white";
					}
				}

				if(CheckAttribute(Pchar, "Q2_mix") && Pchar.Q2_mix == "9")
				{
					if(CheckAttribute(Pchar, "powder_light_yellow") && Pchar.powder_light_yellow == "processed")
					{
						Pchar.powder_light_yellow = "finished";
						Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 = "powder_dark_yellow";
					}
				}

				if(CheckAttribute(Pchar, "Q2_mix") && Pchar.Q2_mix == "11")
				{
					if(CheckAttribute(Pchar, "solid_red") && Pchar.solid_red == "processed")
					{
						Pchar.solid_red = "finished";
						Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 = "liquid_mercury";
					}
				}
			}

			if(Locations[FindLocation("wr_farm_alchemy2")].models.always.locators == "TwoFloorHouse_locators_JRH2")
			{
				Locations[FindLocation("wr_farm_alchemy2")].models.always.locators = "TwoFloorHouse_locators_JRH1";

				if(CheckAttribute(Pchar, "powder_grey") && Pchar.powder_grey == "processed2")
				{
					Pchar.powder_grey = "finished2";
					Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 = "powder_white";
				}

				pchar.quest.alchemy2_fire_low.win_condition.l1 = "location";
				pchar.quest.alchemy2_fire_low.win_condition.l1.location = "wr_farm_alchemy2";
				pchar.quest.alchemy2_fire_low.win_condition = "alchemy2_fire_low";
			}

			if(Locations[FindLocation("wr_farm_alchemy2")].models.always.locators == "TwoFloorHouse_locators_JRH3")
			{
				Locations[FindLocation("wr_farm_alchemy2")].models.always.locators = "TwoFloorHouse_locators_JRH2";

				if(CheckAttribute(Pchar, "liquid_white") && Pchar.liquid_white == "boiling")
				{
					Pchar.liquid_white = "finished";
					Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 = "powder_white";
				}

				if(CheckAttribute(Pchar, "Q2_mix") && Pchar.Q2_mix == "2")
				{
					if(CheckAttribute(Pchar, "powder_grey") && Pchar.powder_grey == "processed")
					{
						Pchar.powder_grey = "finished";
						Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 = "powder_white";
					}
				}

				pchar.quest.alchemy2_fire_high.win_condition.l1 = "location";
				pchar.quest.alchemy2_fire_high.win_condition.l1.location = "wr_farm_alchemy2";
				pchar.quest.alchemy2_fire_high.win_condition = "alchemy2_fire_high";
			}

			LAi_QuestDelay("alchemy2_fire_level_down", 0.1);
		break;

		case "alchemy2_fire_level_down":
			pchar.quest.alchemy2_fire_level_down1.win_condition.l1 = "location";
			pchar.quest.alchemy2_fire_level_down1.win_condition.l1.location = "wr_farm_alchemy2";
			pchar.quest.alchemy2_fire_level_down1.win_condition = "alchemy2_fire_level_down1";
		break;

		//---------------------------------------------------------------------------------------------------------------------

		case "crucible_turn":
			Locations[FindLocation("wr_farm_alchemy2")].image = "";

			if(Locations[FindLocation("wr_farm_alchemy2")].models.always.l7 == "cauldron2") 
			{
				//TURN DOWN

				Locations[FindLocation("wr_farm_alchemy2")].models.always.l7 = "cauldron2_tilt";

				if(Locations[FindLocation("wr_farm_alchemy2")].models.always.l11 == "funnel")
				{
					if(Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 == "powder_white")
					{
						if(CheckAttribute(Pchar, "Q2_mix") && Pchar.Q2_mix == "1")
						{
							Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 = "";
							Locations[FindLocation("wr_farm_alchemy2")].models.always.l8 = "bottle_FS1";
							Pchar.content_to_bottle = "powder";
						}

						if(CheckAttribute(Pchar, "Q2_mix") && Pchar.Q2_mix == "2")
						{
							Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 = "";
							Locations[FindLocation("wr_farm_alchemy2")].models.always.l8 = "bottle_FS2";
							Pchar.content_to_bottle = "powder";
						}

						if(CheckAttribute(Pchar, "Q2_mix"))
						{
							if(Pchar.Q2_mix == "5" || Pchar.Q2_mix == "9")
							{
								Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 = "";
								Locations[FindLocation("wr_farm_alchemy2")].models.always.l8 = "bottle_FS1";
								Pchar.content_to_bottle = "powder";
							}
						}

						if(CheckAttribute(Pchar, "Q2_mix") && Pchar.Q2_mix == "6")
						{
							Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 = "";
							Locations[FindLocation("wr_farm_alchemy2")].models.always.l8 = "bottle_FS1";
							Pchar.content_to_bottle = "powder";
						}
					}

					if(Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 == "powder_dark_yellow")
					{
						Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 = "";
						Locations[FindLocation("wr_farm_alchemy2")].models.always.l8 = "bottle_FB2";
						Pchar.content_to_bottle = "powder";
					}

					if(Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 == "liquid_mercury")
					{
						Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 = "";
						Locations[FindLocation("wr_farm_alchemy2")].models.always.l8 = "bottle_FQ1";
						Pchar.content_to_bottle = "liquid";
					}
//JRH here
					if(Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 == "liquid_orange")
					{
						Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 = "";
						Locations[FindLocation("wr_farm_alchemy2")].models.always.l8 = "bottle_FA2";
						Pchar.content_to_bottle = "liquid";
					}
				}
				else
				{
					//no funnel => pour out the crucible content on the floor
					
					if(Locations[FindLocation("wr_farm_alchemy2")].models.always.l8 == "bottle_FE0")
					{
						Pchar.empty_bottle = "crashed";
						Locations[FindLocation("wr_farm_alchemy2")].models.always.l8 = "";
					}

					if(Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 == "solid_brown"
					|| Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 == "solid_red") 
					{
						Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 = "";
						Pchar.content_to_floor = "solid";
					}

					if(Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 == "liquid_white"
					|| Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 == "liquid_grey"
					|| Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 == "liquid_orange"
					|| Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 == "liquid_mercury") 
					{
						Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 = "";
						Pchar.content_to_floor = "liquid";
					}

					if(Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 == "powder_white"
					|| Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 == "powder_grey"
					|| Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 == "powder_dark_yellow") 
					{
						Locations[FindLocation("wr_farm_alchemy2")].models.always.l10 = "";
						Pchar.content_to_floor = "powder";
					}
				}

				DoQuestReloadToLocation("wr_farm_alchemy2", "goto", "wheel2", "crucible_turn_down");
			}
			else 
			{
				//TURN UP

				Locations[FindLocation("wr_farm_alchemy2")].models.always.l7 = "cauldron2";

				DoQuestReloadToLocation("wr_farm_alchemy2", "goto", "wheel2", "crucible_turn_up");
			}
		break;
	
		case "crucible_turn_down":
			PlaySound("INTERFACE\damper_close.wav");
			PlaySound("INTERFACE\damper_close.wav");

			LAi_QuestDelay("loading_back_alchemy2", 0.1);

			if(CheckAttribute(Pchar, "content_to_bottle")) 
			{
				if(Pchar.content_to_bottle == "powder") PlaySound("PEOPLE\gunpowder.wav");
				if(Pchar.content_to_bottle == "liquid") PlaySound("AMBIENT\TAVERN\tinkle1.wav");
				Pchar.content_to_bottle = "";
			}

			if(CheckAttribute(Pchar, "content_to_floor")) 
			{
				if(Pchar.content_to_floor == "solid")
				{
					CreateParticleSystem("blast_dirt_small" , -8.4, 2.9, 4.4, 0.0, 0.0, 0.0, sti(20) );
					Pchar.content_to_floor = "no";

					LAi_QuestDelay("stones_out", 0.5);
					LAi_QuestDelay("crucible_turn_down1", 1.5);
				}
				
				if(Pchar.content_to_floor == "liquid")
				{
					PlaySound("OBJECTS\SHIPCHARGE\ball_splash2.wav");
					CreateParticleSystemX("ball_splash", -7.7, 2.9, 5.6, 0.0, 0.0, 0.0, 0);
					Pchar.content_to_floor = "no";

					LAi_QuestDelay("crucible_turn_down1", 2.5);
				}

				if(Pchar.content_to_floor == "powder")
				{
					PlaySound("PEOPLE\gunpowder.wav");
					CreateParticleSystem("blast_dirt_small" , -8.4, 2.9, 4.4, 0.0, 0.0, 0.0, sti(20) );
					CreateParticleSystem("blast_dirt_small" , -8.4, 2.9, 4.4, 0.0, 0.0, 0.0, sti(20) );
					Pchar.content_to_floor = "no";

					LAi_QuestDelay("crucible_turn_down1", 2.5);
				}
			}
		break;
	
		case "stones_out":
			PlaySound("PEOPLE\cavern1.wav");
		break;

		case "crucible_turn_down1":
			if(CheckAttribute(Pchar, "empty_bottle") && Pchar.empty_bottle == "crashed")  
			{
				PlaySound("AMBIENT\TAVERN\tinkle4.wav");
				Pchar.empty_bottle = "";

				LAi_QuestDelay("Pchar_ooh", 1.5);		
			}
			else PlaySound("OBJECTS\VOICES\DEAD\male\dead7.wav");
		break;

		case "crucible_turn_up":
			PlaySound("INTERFACE\damper_change.wav");
			PlaySound("INTERFACE\damper_change.wav");

			LAi_QuestDelay("loading_back_alchemy2", 0.1);
		break;

		case "loading_back_alchemy2":
			Pchar.alchemy2_box13 = "free";
			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("wr_farm_alchemy2")].image = "wr_farm_alchemy2.tga";

			if(CheckAttribute(Pchar, "filter_failure") && Pchar.filter_failure == "yes")
			{
				PlaySound("OBJECTS\VOICES\DEAD\male\dead7.wav");
				Logit(LanguageConvertString(tmpLangFileID,"Oh no, I forgot to use a clean filter and lost the mixture!"));
				Pchar.filter_failure = "no";
			}
		break;

		case "loading_back_alchemy2_plop":
			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("wr_farm_alchemy2")].image = "wr_farm_alchemy2.tga";

			PlaySound("AMBIENT\TAVERN\open_bottle.wav");
		break;
//JRH take time
		case "loading_back_alchemy2_take_time_JRH3":
			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("wr_farm_alchemy2")].image = "wr_farm_alchemy2.tga";
			
			if(Locations[FindLocation(Pchar.location)].models.always.locators == "TwoFloorHouse_locators_JRH3")
			{
				LAi_QuestDelay("take_time", 2.0);
			}
		break;

		case "loading_back_alchemy2_take_time_JRH1":
			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("wr_farm_alchemy2")].image = "wr_farm_alchemy2.tga";
			
			if(Locations[FindLocation(Pchar.location)].models.always.locators == "TwoFloorHouse_locators_JRH1")
			{
				LAi_QuestDelay("take_time", 2.0);
			}
		break;

		case "loading_back_alchemy2_take_time_JRH2":
			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("wr_farm_alchemy2")].image = "wr_farm_alchemy2.tga";
			
			if(Locations[FindLocation(Pchar.location)].models.always.locators == "TwoFloorHouse_locators_JRH2")
			{
				LAi_QuestDelay("take_time", 2.0);
			}
		break;

		case "crucible_dont_turn":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead1.wav");
			Logit(LanguageConvertString(tmpLangFileID,"No, I havn't processed the content yet."));
		break;

		//---------------------------------------------------------------------------------------------------------------------

		case "2FH_running_acid":
			PlaySound("INTERFACE\running_water_short.wav");

			LAi_QuestDelay("2FH_running_acid1", 0.5);
		break;

		case "2FH_running_acid1":
			PlaySound("OBJECTS\VOICES\DEAD\male\dead6.wav");
			LAi_ApplyCharacterDamage(Pchar, 20);	

			LAi_QuestDelay("2FH_running_acid2", 0.5);
		break;

		case "2FH_running_acid2":
			PlaySound("PEOPLE\jump.wav");
			LAi_SetPoorType(Pchar);
			ChangeCharacterAddressGroup(Pchar, "wr_farm_alchemy2", "box", "box10");

			LAi_QuestDelay("2FH_running_acid3", 1.0);
		break;

		case "2FH_running_acid3":
			LAi_SetPlayerType(Pchar);
			PlaySound("VOICE\ENGLISH\blaze_sigh.wav");
			Logit(LanguageConvertString(tmpLangFileID,"It smells like Sulfuric Acid."));
			Logit(LanguageConvertString(tmpLangFileID,"Next time I'll use a bottle."));
		break;

		//---------------------------------------------------------------------------------------------------------------------
	
		case "2FH_fill_acidbottle":
			PlaySound("AMBIENT\TAVERN\tinkle1.wav");

			LAi_QuestDelay("2FH_fill_acidbottle1", 3.0);
		break;

		case "2FH_fill_acidbottle1":
			Pchar.2FH_fillbottle = "off";
			PlaySound("AMBIENT\TAVERN\open_bottle.wav");
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladebottle_CE0");
			GiveItem2Character(Pchar,"bladebottle_CT1_sulf");
			EquipCharacterByItem(Pchar, "bladebottle_CT1_sulf");
			LAi_SetPlayerType(Pchar);

			LAi_QuestDelay("2FH_fill_acidbottle2", 1.0);
		break;

		case "2FH_fill_acidbottle2":
			PlaySound("PEOPLE\jump_roof.wav");
			ChangeCharacterAddressGroup(Pchar, "wr_farm_alchemy2", "box", "box10");

			LAi_QuestDelay("2FH_fill_acidbottle3", 1.0);
		break;

		case "2FH_fill_acidbottle3":
			PlaySound("VOICE\ENGLISH\blaze_mhm.wav");
			Logit(LanguageConvertString(tmpLangFileID,"It smells like Sulfuric Acid."));
		break;

		//---------------------------------------------------------------------------------------------------------------------

		case "2FH_grinding":
			LAi_SetSitType(Pchar);
			PlaySound("INTERFACE\grinder.wav");

			if(CheckAttribute(Pchar, "alchemy2_grinder"))
			{
				if(Pchar.alchemy2_grinder == "black_stones" || Pchar.alchemy2_grinder == "grey_stones")
				CreateParticleSystem("blast_dirt_small" , -9.05, 3.9, 9.65, 0.0, 0.0, 0.0, sti(20) );
			}

			LAi_QuestDelay("pchar_staytype", 1.0);	
			LAi_QuestDelay("2FH_grinding1", 1.7);
		break;

		case "2FH_grinding1":
			LAi_SetPlayerType(Pchar);
			Pchar.alchemy2_box8 = "off";
			
			if(CheckAttribute(Pchar, "alchemy2_grinder") && Pchar.alchemy2_grinder == "black_stones")
			{ Pchar.alchemy2_grinder = "black_powder";}

			if(CheckAttribute(Pchar, "alchemy2_grinder") && Pchar.alchemy2_grinder == "grey_stones")
			{ Pchar.alchemy2_grinder = "grey_powder";}
		break;


		
		case "alchemy2_grinder_powder_out":
			switch(Locations[FindLocation("wr_farm_alchemy2")].models.always.l14)
			{
					case "":
						Pchar.alchemy2_grinder = "empty";
						PlaySound("PEOPLE\gunpowder.wav");
						CreateParticleSystem("blast_dirt_small" , -9.05, 3.1, 9.75, 0.0, 0.0, 0.0, sti(20) );
						CreateParticleSystem("blast_dirt_small" , -9.05, 3.1, 9.75, 0.0, 0.0, 0.0, sti(20) );

						LAi_QuestDelay("crucible_turn_down1", 2.5);
					break;
				/*
					case "bottle_GC1":
						Logit(TranslateString("","I have already done that."));
						PlaySound("VOICE\ENGLISH\blaze_hah.wav");
					break;

					case "bottle_GG1":
						Logit(TranslateString("","I have already done that."));
						PlaySound("VOICE\ENGLISH\blaze_hah.wav");
					break;
				*/
					case "bottle_GE0":
						if(CheckAttribute(Pchar, "alchemy2_grinder"))
						{
							switch(Pchar.alchemy2_grinder)
							{
								case "black_powder":
									Pchar.alchemy2_grinder = "empty";
									Locations[FindLocation("wr_farm_alchemy2")].models.always.l14 = "bottle_GC1";
					
									Locations[FindLocation("wr_farm_alchemy2")].image = "";
									DoQuestReloadToLocation("wr_farm_alchemy2", "goto", "box16", "alchemy2_grinder_powder_out1");
								break;

								case "grey_powder":
									Pchar.alchemy2_grinder = "empty";
									Locations[FindLocation("wr_farm_alchemy2")].models.always.l14 = "bottle_GG1";

									Locations[FindLocation("wr_farm_alchemy2")].image = "";
									DoQuestReloadToLocation("wr_farm_alchemy2", "goto", "box16", "alchemy2_grinder_powder_out1");
								break;
							}

						}	
					break;
			}
		break;
	
		case "alchemy2_grinder_powder_out1":
			PlaySound("PEOPLE\gunpowder.wav");
			LAi_SetPlayerType(Pchar);
			Locations[FindLocation("wr_farm_alchemy2")].image = "wr_farm_alchemy2.tga";
		break;

		case "take_grinded_item":
			Locations[FindLocation("wr_farm_alchemy2")].image = "";
			DoQuestReloadToLocation("wr_farm_alchemy2", "goto", "box7", "loading_back_alchemy2");
		break;

		//---------------------------------------------------------------------------------------------------------------------

		case "alch2_box4":	
			Locations[FindLocation("wr_farm_alchemy2")].image = "";
			DoQuestReloadToLocation("wr_farm_alchemy2", "goto", "box4", "loading_back_alchemy2");
		break;

		case "alch2_box4_white_powder":
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladebottle_CE0");
			GiveItem2Character(Pchar,"bladebottle_CV1_sc");
			EquipCharacterByItem(Pchar, "bladebottle_CV1_sc");	
			Locations[FindLocation("wr_farm_alchemy2")].image = "";
			DoQuestReloadToLocation("wr_farm_alchemy2", "goto", "box4", "loading_back_alchemy2_plop");
		break;

		case "alch2_box4_red_powder":
			RemoveCharacterEquip(Pchar, BLADE_ITEM_TYPE);
			TakeItemFromCharacter(Pchar, "bladebottle_CE0");
			GiveItem2Character(Pchar,"bladebottle_CR1");
			EquipCharacterByItem(Pchar, "bladebottle_CR1");	
			Locations[FindLocation("wr_farm_alchemy2")].image = "";
			DoQuestReloadToLocation("wr_farm_alchemy2", "goto", "box4", "loading_back_alchemy2_plop");
		break;

		case "HNO3_check":
			if(CheckCharacterItem(Pchar,"bladebottle_CT1_nitr"))
			{
				Pchar.use_only_big_bottle = "yes";		//small mix bottle disabled
				Pchar.use_only_small_bottle = "no";		//big mix bottle enabled
				Pchar.Q2_mix = "5";
				return;
			}
			else LAi_QuestDelay("HNO3_check", 2.0);//loop check
		break;

		
	
		PChar.questnotfound = true; // PB: Testing
	}
	LanguageCloseFile(tmpLangFileID);
}
